diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-02-15 14:44:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-15 14:44:50 (GMT) |
commit | 776af03711c9caa1b3ce2b586ed1e8283402907d (patch) | |
tree | 5e94e707f1fe4f5dc074686796c1bca4f7d0cbe0 | |
parent | 8d0c54e642838d3af1658f3d0ee8db0133c40eb5 (diff) | |
parent | 6d3d15af681da52873f643f3952b6efcba40f1a8 (diff) | |
download | Doxygen-776af03711c9caa1b3ce2b586ed1e8283402907d.zip Doxygen-776af03711c9caa1b3ce2b586ed1e8283402907d.tar.gz Doxygen-776af03711c9caa1b3ce2b586ed1e8283402907d.tar.bz2 |
Merge pull request #7569 from albert-github/feature/issue_7558
issue #7558 PlantUML: Different behavior whether LATEX_OUTPUT has a final slash or not.
-rw-r--r-- | src/plantuml.cpp | 44 | ||||
-rw-r--r-- | src/plantuml.h | 18 |
2 files changed, 35 insertions, 27 deletions
diff --git a/src/plantuml.cpp b/src/plantuml.cpp index fa50f2d..7d60e32 100644 --- a/src/plantuml.cpp +++ b/src/plantuml.cpp @@ -76,7 +76,7 @@ QCString PlantumlManager::writePlantUMLSource(const QCString &outDir,const QCStr uint pos = qcOutDir.findRev("/"); QCString generateType(qcOutDir.right(qcOutDir.length() - (pos + 1)) ); Debug::print(Debug::Plantuml,0,"*** %s generateType: %s\n","writePlantUMLSource",qPrint(generateType)); - PlantumlManager::instance()->insert(generateType,puName,format,text); + PlantumlManager::instance()->insert(generateType,puName,outDir,format,text); Debug::print(Debug::Plantuml,0,"*** %s generateType: %s\n","writePlantUMLSource",qPrint(generateType)); return baseName; @@ -178,7 +178,7 @@ PlantumlManager::~PlantumlManager() } static void runPlantumlContent(const QDict< QList <QCString> > &plantumlFiles, - const QDict< QCString > &plantumlContent, + const QDict< PlantumlContent > &plantumlContent, PlantumlManager::OutputFormat format) { /* example : running: java -Djava.awt.headless=true @@ -244,25 +244,21 @@ static void runPlantumlContent(const QDict< QList <QCString> > &plantumlFiles, } { - QDictIterator< QCString > it( plantumlContent); // See QDictIterator - QCString *nb; + QDictIterator< PlantumlContent > it( plantumlContent); // See QDictIterator + PlantumlContent *nb; for (it.toFirst();(nb=it.current());++it) { QCString pumlArguments(pumlArgs); msg("Generating PlantUML %s Files in %s\n",qPrint(pumlType),qPrint(it.currentKey())); pumlArguments+="-o \""; - pumlArguments+=Config_getString(OUTPUT_DIRECTORY); - pumlArguments+="/"; - pumlArguments+=it.currentKey(); + pumlArguments+=nb->outDir.data(); pumlArguments+="\" "; pumlArguments+="-charset UTF-8 -t"; pumlArguments+=pumlType; pumlArguments+=" "; QCString puFileName(""); - puFileName+=Config_getString(OUTPUT_DIRECTORY); - puFileName+="/"; - puFileName+=it.currentKey(); + puFileName+=nb->outDir.data(); puFileName+="/"; pumlOutDir=puFileName; puFileName+="inline_umlgraph_"; @@ -279,7 +275,7 @@ static void runPlantumlContent(const QDict< QList <QCString> > &plantumlFiles, { err("Could not open file %s for writing\n",puFileName.data()); } - file.writeBlock( *nb, nb->length() ); + file.writeBlock( nb->content, nb->content.length() ); file.close(); Debug::print(Debug::Plantuml,0,"*** %s Running Plantuml arguments:%s\n","PlantumlManager::runPlantumlContent",qPrint(pumlArguments)); @@ -358,16 +354,16 @@ static void print(const QDict< QList <QCString> > &plantumlFiles) } } -static void print(const QDict<QCString> &plantumlContent) +static void print(const QDict<PlantumlContent> &plantumlContent) { if (Debug::isFlagSet(Debug::Plantuml)) { - QDictIterator< QCString > it( plantumlContent); // See QDictIterator - QCString *nb; + QDictIterator< PlantumlContent > it( plantumlContent); // See QDictIterator + PlantumlContent *nb; for (it.toFirst();(nb=it.current());++it) { Debug::print(Debug::Plantuml,0,"*** %s PlantumlContent key:%s\n","PlantumlManager::print Content",qPrint(it.currentKey())); - Debug::print(Debug::Plantuml,0,"*** %s Content :%s\n","PlantumlManager::print",qPrint(*nb)); + Debug::print(Debug::Plantuml,0,"*** %s Content :%s\n","PlantumlManager::print",qPrint(nb->content)); } } } @@ -384,22 +380,22 @@ static void addPlantumlFiles(QDict< QList<QCString> > &plantumlFiles, list->append(new QCString(value)); } -static void addPlantumlContent(QDict< QCString > &plantumlContent, - const QCString &key, const QCString &puContent) +static void addPlantumlContent(QDict< PlantumlContent > &plantumlContent, + const QCString &key, const QCString &outDir, const QCString &puContent) { - QCString* content = plantumlContent.find(key); + PlantumlContent* content = plantumlContent.find(key); if (content == 0) { - content = new QCString(""); + content = new PlantumlContent("",outDir); plantumlContent.insert(key,content); } - (*content)+=puContent; + (content->content)+=puContent; } void PlantumlManager::insert(const QCString &key, const QCString &value, - OutputFormat format,const QCString &puContent) + const QCString &outDir,OutputFormat format,const QCString &puContent) { int find; @@ -419,19 +415,19 @@ void PlantumlManager::insert(const QCString &key, const QCString &value, case PUML_BITMAP: addPlantumlFiles(m_pngPlantumlFiles,key,value); print(m_pngPlantumlFiles); - addPlantumlContent(m_pngPlantumlContent,key,puContent); + addPlantumlContent(m_pngPlantumlContent,key,outDir,puContent); print(m_pngPlantumlContent); break; case PUML_EPS: addPlantumlFiles(m_epsPlantumlFiles,key,value); print(m_epsPlantumlFiles); - addPlantumlContent(m_epsPlantumlContent,key,puContent); + addPlantumlContent(m_epsPlantumlContent,key,outDir,puContent); print(m_epsPlantumlContent); break; case PUML_SVG: addPlantumlFiles(m_svgPlantumlFiles,key,value); print(m_svgPlantumlFiles); - addPlantumlContent(m_svgPlantumlContent,key,puContent); + addPlantumlContent(m_svgPlantumlContent,key,outDir,puContent); print(m_svgPlantumlContent); break; } diff --git a/src/plantuml.h b/src/plantuml.h index d3a01f5..f2e9dec 100644 --- a/src/plantuml.h +++ b/src/plantuml.h @@ -24,6 +24,17 @@ #define MIN_PLANTUML_COUNT 8 class QCString; +struct PlantumlContent +{ + QCString outDir; + QCString content; + PlantumlContent(const QCString Content, const QCString OutDir) + { + outDir = OutDir; + content = Content; + }; + ~PlantumlContent(){}; +}; /** Singleton that manages plantuml relation actions */ class PlantumlManager @@ -58,15 +69,16 @@ class PlantumlManager ~PlantumlManager(); void insert(const QCString &key, const QCString &value, + const QCString &outDir, OutputFormat format, const QCString &puContent); static PlantumlManager *m_theInstance; QDict< QList<QCString> > m_pngPlantumlFiles; QDict< QList<QCString> > m_svgPlantumlFiles; QDict< QList<QCString> > m_epsPlantumlFiles; - QDict< QCString > m_pngPlantumlContent; // use circular queue for using multi-processor (multi threading) - QDict< QCString > m_svgPlantumlContent; - QDict< QCString > m_epsPlantumlContent; + QDict< PlantumlContent > m_pngPlantumlContent; // use circular queue for using multi-processor (multi threading) + QDict< PlantumlContent > m_svgPlantumlContent; + QDict< PlantumlContent > m_epsPlantumlContent; QCString m_cachedPlantumlAllContent; // read from CACHE_FILENAME file QCString m_currentPlantumlAllContent; // processing plantuml then write it into CACHE_FILENAME to reuse the next time as cache information }; |