summaryrefslogtreecommitdiffstats
path: root/src/definition.cpp
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2000-07-16 17:27:25 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2000-07-16 17:27:25 (GMT)
commit8feba3b60badccd732e753fadb089d13799db829 (patch)
tree156f3b8b79f2df8ecf0c8d3175e2788e40b4b824 /src/definition.cpp
parent61a83f312ce95090dc02ca3b8ce8dd3319d97df1 (diff)
downloadDoxygen-8feba3b60badccd732e753fadb089d13799db829.zip
Doxygen-8feba3b60badccd732e753fadb089d13799db829.tar.gz
Doxygen-8feba3b60badccd732e753fadb089d13799db829.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
{