X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FExternalTemplate.C;h=197667759426db5dd075d07a37e8ec985710ae39;hb=b5589bf6cf82439dc8dcc6c9465ce3b32dc0f389;hp=0bffe07c0fdc1f8612fee3fe58586ee0a63d870d;hpb=da61af2b8ef95ab206d02deb9c52f03335682d9e;p=lyx.git diff --git a/src/insets/ExternalTemplate.C b/src/insets/ExternalTemplate.C index 0bffe07c0f..1976677594 100644 --- a/src/insets/ExternalTemplate.C +++ b/src/insets/ExternalTemplate.C @@ -18,13 +18,8 @@ #include "support/filetools.h" #include "support/lstrings.h" +#include "support/package.h" #include "support/path.h" -#include "support/path_defines.h" -#include "support/translator.h" - -#include - -#include namespace support = lyx::support; @@ -59,7 +54,7 @@ Template::Format::Format() TemplateManager::TemplateManager() { - readTemplates(support::user_lyxdir()); + readTemplates(support::package().user_support()); if (lyxerr.debugging(Debug::EXTERNAL)) { dumpPreambleDefs(lyxerr); lyxerr << '\n'; @@ -151,6 +146,18 @@ public: ost << "\t\tPreamble " << *pit << '\n'; } + typedef Template::Format::FileMap FileMap; + FileMap::const_iterator rit = ft.referencedFiles.begin(); + FileMap::const_iterator rend = ft.referencedFiles.end(); + for (; rit != rend; ++rit) { + vector::const_iterator fit = rit->second.begin(); + vector::const_iterator fend = rit->second.end(); + for (; fit != fend; ++fit) { + ost << "\t\tReferencedFile " << rit->first + << " \"" << *fit << "\"\n"; + } + } + ost << "\tFormatEnd\n"; } private: @@ -457,6 +464,7 @@ void Template::Format::readFormat(LyXLex & lex) FO_PREAMBLE, FO_TRANSFORMCOMMAND, FO_TRANSFORMOPTION, + FO_REFERENCEDFILE, FO_END }; @@ -465,6 +473,7 @@ void Template::Format::readFormat(LyXLex & lex) { "option", FO_OPTION }, { "preamble", FO_PREAMBLE }, { "product", FO_PRODUCT }, + { "referencedfile", FO_REFERENCEDFILE }, { "requirement", FO_REQUIREMENT }, { "transformcommand", FO_TRANSFORMCOMMAND }, { "transformoption", FO_TRANSFORMOPTION }, @@ -526,6 +535,15 @@ void Template::Format::readFormat(LyXLex & lex) break; } + case FO_REFERENCEDFILE: { + lex.next(true); + string const format = lex.getString(); + lex.next(true); + string const file = lex.getString(); + referencedFiles[format].push_back(file); + break; + } + case FO_END: return; }