diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2002-04-30 17:51:14 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2002-04-30 17:51:14 (GMT) |
commit | 758291b1be0c43c13088389b0cfbb560efe00c1f (patch) | |
tree | a37d75aa0ebe073906cb1a3c2c1506b96409f075 /src/rtfgen.cpp | |
parent | 210582f8060fb41f6ad34d8315c9dd27b1bb6834 (diff) | |
download | Doxygen-758291b1be0c43c13088389b0cfbb560efe00c1f.zip Doxygen-758291b1be0c43c13088389b0cfbb560efe00c1f.tar.gz Doxygen-758291b1be0c43c13088389b0cfbb560efe00c1f.tar.bz2 |
Release-1.2.15-20020430
Diffstat (limited to 'src/rtfgen.cpp')
-rw-r--r-- | src/rtfgen.cpp | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index 3d70b3a..d84c54f 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -37,6 +37,9 @@ //#define DBG_RTF(x) x; #define DBG_RTF(x) +// used for table column width calculation +#define PAGEWIDTH 8748 + const int indentLevels = 10; struct ListItemInfo @@ -121,6 +124,7 @@ void RTFGenerator::append(const OutputGenerator *g) //insideTabbing=insideTabbing || ((RTFGenerator *)g)->insideTabbing; m_listLevel=((RTFGenerator *)g)->m_listLevel; m_omitParagraph=((RTFGenerator *)g)->m_omitParagraph; + m_columnNumbers=((RTFGenerator *)g)->m_columnNumbers; //printf("RTFGenerator::append(%s) insideTabbing=%s\n", g->getContents().data(), // insideTabbing ? "TRUE" : "FALSE" ); } @@ -1641,6 +1645,59 @@ void RTFGenerator::endSubsubsection() // t << "}"; //} +void RTFGenerator::startTable(bool,int colNumbers) +{ + m_columnNumbers=colNumbers; + t<<"\\par\n"; +} + +void RTFGenerator::endTable(bool hasCaption) +{ + if (!hasCaption) + t << "\n\\pard \\widctlpar\\intbl\\adjustright\n{\\row }\n"; + t << "\\pard\n" << endl; +} + +void RTFGenerator::startCaption() +{ + endTableRow(); + t<<"\\trowd \\trgaph108\\trleft-108\\trbrdrt\\brdrs\\brdrw10 \\trbrdrl\\brdrs\\brdrw10 \\trbrdrb\\brdrs\\brdrw10 \\trbrdrr\\brdrs\\brdrw10 \\trbrdrh\\brdrs\\brdrw10 \\trbrdrv\\brdrs\\brdrw10"<<endl; + t<<"\\clvertalt\\clbrdrt\\brdrs\\brdrw10 \\clbrdrl\\brdrs\\brdrw10 \\clbrdrb\\brdrs\\brdrw10 \\clbrdrr \\brdrs\\brdrw10 \\cltxlrtb \\cellx"<<PAGEWIDTH<<"\\pard \\qc\\nowidctlpar\\widctlpar\\intbl\\adjustright "<<endl; + nextTableColumn(); +} + +void RTFGenerator::endCaption() +{ + endTableColumn(); + endTableRow(); +} + +void RTFGenerator::nextTableRow() +{ + unsigned long columnWidth=PAGEWIDTH/m_columnNumbers; + t<<"\\trowd \\trgaph108\\trleft-108\\trbrdrt\\brdrs\\brdrw10 \\trbrdrl\\brdrs\\brdrw10 \\trbrdrb\\brdrs\\brdrw10 \\trbrdrr\\brdrs\\brdrw10 \\trbrdrh\\brdrs\\brdrw10 \\trbrdrv\\brdrs\\brdrw10 "<<endl; + for (int i=1;i<=m_columnNumbers;i++) + { + t<<"\\clvertalt\\clbrdrt\\brdrs\\brdrw10 \\clbrdrl\\brdrs\\brdrw10 \\clbrdrb\\brdrs\\brdrw10 \\clbrdrr \\brdrs\\brdrw10 \\cltxlrtb \\cellx"<<i*columnWidth<<endl; + } + t<<"\\pard \\widctlpar\\intbl\\adjustright\n{"; +} + +void RTFGenerator::endTableRow() +{ + t<<"\n\\pard \\widctlpar\\intbl\\adjustright\n{\\row }\n"; +} + +void RTFGenerator::nextTableColumn() +{ + t<<"{ "; +} + +void RTFGenerator::endTableColumn() +{ + t<<" \\cell }"; +} + void RTFGenerator::startTextLink(const char *f,const char *anchor) { if (Config_getBool("RTF_HYPERLINKS")) |