summaryrefslogtreecommitdiffstats
path: root/src/rtfdocvisitor.cpp
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2016-09-02 13:01:11 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2016-09-03 09:04:38 (GMT)
commit9ae1af9b8679a0f14cb568d1db3afcc6e3ba40a6 (patch)
treecd636c234fbe837dddfabbb0230aa016e01d6572 /src/rtfdocvisitor.cpp
parent445347566078a1cc64705f28932e1da5bf9f531f (diff)
downloadDoxygen-9ae1af9b8679a0f14cb568d1db3afcc6e3ba40a6.zip
Doxygen-9ae1af9b8679a0f14cb568d1db3afcc6e3ba40a6.tar.gz
Doxygen-9ae1af9b8679a0f14cb568d1db3afcc6e3ba40a6.tar.bz2
Bug 770660 - Code snippet always shows line numbers from 1
This patch makes the handling of the \snippet and other commands consistent between the different languages (no line numbers anymore with python) and also introduces analogous to \includelineno the command \snippetlineno. Some non relevant changes: - *code.l Calculation of the end line was incorrect, in case of a snippet the end line was the number of lines of the snippet and not reltive to the start line. - *code.l made consistent over the different laguages, enabling exBlock and inlineFragment - testing/indexpage.xml in test 14 the \snippet command was used with python and giving line numbers, linenumbers are now gone (consistency)
Diffstat (limited to 'src/rtfdocvisitor.cpp')
-rw-r--r--src/rtfdocvisitor.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp
index 76da457..c85b638 100644
--- a/src/rtfdocvisitor.cpp
+++ b/src/rtfdocvisitor.cpp
@@ -444,6 +444,30 @@ void RTFDocVisitor::visit(DocInclude *inc)
);
m_t << "}";
break;
+ case DocInclude::SnipWithLines:
+ {
+ QFileInfo cfi( inc->file() );
+ FileDef fd( cfi.dirPath().utf8(), cfi.fileName().utf8() );
+ m_t << "{" << endl;
+ if (!m_lastIsPara) m_t << "\\par" << endl;
+ m_t << rtf_Style_Reset << getStyle("CodeExample");
+ Doxygen::parserManager->getParser(inc->extension())
+ ->parseCode(m_ci,
+ inc->context(),
+ extractBlock(inc->text(),inc->blockId()),
+ langExt,
+ inc->isExample(),
+ inc->exampleFile(),
+ &fd,
+ lineBlock(inc->text(),inc->blockId()),
+ -1, // endLine
+ FALSE, // inlineFragment
+ 0, // memberDef
+ TRUE // show line number
+ );
+ m_t << "}";
+ }
+ break;
case DocInclude::SnippetDoc:
case DocInclude::IncludeDoc:
err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s"