summaryrefslogtreecommitdiffstats
path: root/src/definition.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2000-07-16 17:27:25 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2000-07-16 17:27:25 (GMT)
commit55571c2989a42e670d62b4cb2d2bd2882b5ecd60 (patch)
tree156f3b8b79f2df8ecf0c8d3175e2788e40b4b824 /src/definition.cpp
parent56bc9bda61e06b9bd6da5aa58083e93a3b55a465 (diff)
downloadDoxygen-55571c2989a42e670d62b4cb2d2bd2882b5ecd60.zip
Doxygen-55571c2989a42e670d62b4cb2d2bd2882b5ecd60.tar.gz
Doxygen-55571c2989a42e670d62b4cb2d2bd2882b5ecd60.tar.bz2
Release-1.1.5-20000716
Diffstat (limited to 'src/definition.cpp')
-rw-r--r--src/definition.cpp33
1 files changed, 30 insertions, 3 deletions
diff --git a/src/definition.cpp b/src/definition.cpp
index 4b96f04..22a5826 100644
--- a/src/definition.cpp
+++ b/src/definition.cpp
@@ -132,6 +132,7 @@ static bool readCodeFragment(const char *fileName,
if (f.open(IO_ReadOnly))
{
int c=0;
+ int col=0;
int lineNr=1;
// skip until the startLine has reached
while (lineNr<startLine && !f.atEnd())
@@ -146,7 +147,21 @@ static bool readCodeFragment(const char *fileName,
char cn=0;
while (lineNr<=endLine && !f.atEnd() && !found)
{
- while ((c=f.getch())!='{' && c!=':' && c!=-1) if (c=='\n') lineNr++;
+ while ((c=f.getch())!='{' && c!=':' && c!=-1)
+ {
+ if (c=='\n')
+ {
+ lineNr++,col=0;
+ }
+ else if (c=='\t')
+ {
+ col+=Config::tabSize - (col%Config::tabSize);
+ }
+ else
+ {
+ col++;
+ }
+ }
if (c==':')
{
cn=f.getch();
@@ -159,6 +174,9 @@ static bool readCodeFragment(const char *fileName,
}
if (found)
{
+ // full the line with spaces until the right column
+ int i;
+ for (i=0;i<col;i++) result+=' ';
// copy until end of line
result+=c;
if (c==':') result+=cn;
@@ -346,10 +364,19 @@ void Definition::writeSourceRefs(OutputList &ol,const char *scopeName)
}
if (md->getStartBodyLine()!=-1 && md->getBodyDef())
{
+ // for HTML write a real link
+ ol.pushGeneratorState();
+ ol.disableAllBut(OutputGenerator::Html);
QCString lineStr,anchorStr;
anchorStr.sprintf("l%05d",md->getStartBodyLine());
- ol.writeObjectLink(0,md->getBodyDef()->sourceName(),
- anchorStr,name);
+ ol.writeObjectLink(0,md->getBodyDef()->sourceName(),anchorStr,name);
+ ol.popGeneratorState();
+
+ // for the other output formats just mention the name
+ ol.pushGeneratorState();
+ ol.disable(OutputGenerator::Html);
+ ol.docify(name);
+ ol.popGeneratorState();
}
else
{