]> git.lyx.org Git - lyx.git/blobdiff - src/insets/ExternalTemplate.C
insetcharstyle drawing cosmetics
[lyx.git] / src / insets / ExternalTemplate.C
index ba2bf86e4ec43875ac4ba3404dfb471fd6fff395..482a0663dbf7e567bd6c341c3649d9bae607e2a1 100644 (file)
 #include "support/lstrings.h"
 #include "support/path.h"
 #include "support/path_defines.h"
-#include "support/translator.h"
-
-#include <boost/assert.hpp>
-
-#include <algorithm>
 
 namespace support = lyx::support;
 
@@ -101,7 +96,6 @@ public:
                    << "\tHelpTextEnd\n"
                    << "\tInputFormat " << et.inputFormat << '\n'
                    << "\tFileFilter " << et.fileRegExp << '\n'
-                   << "\tEditCommand " << et.editCommand << '\n'
                    << "\tAutomaticProduction " << et.automaticProduction << '\n';
 
                typedef vector<TransformID> IDs;
@@ -152,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<string>::const_iterator fit  = rit->second.begin();
+                       vector<string>::const_iterator fend = rit->second.end();
+                       for (; fit != fend; ++fit) {
+                               ost << "\t\tReferencedFile " << rit->first
+                                   << " \"" << *fit << "\"\n";
+                       }
+               }
+
                ost << "\tFormatEnd\n";
        }
 private:
@@ -298,7 +304,6 @@ void Template::readTemplate(LyXLex & lex)
                TO_HELPTEXT,
                TO_INPUTFORMAT,
                TO_FILTER,
-               TO_EDITCMD,
                TO_AUTOMATIC,
                TO_TRANSFORM,
                TO_FORMAT,
@@ -307,7 +312,6 @@ void Template::readTemplate(LyXLex & lex)
 
        keyword_item templateoptiontags[] = {
                { "automaticproduction", TO_AUTOMATIC },
-               { "editcommand", TO_EDITCMD },
                { "filefilter", TO_FILTER },
                { "format", TO_FORMAT },
                { "guiname", TO_GUINAME },
@@ -340,11 +344,6 @@ void Template::readTemplate(LyXLex & lex)
                        fileRegExp = lex.getString();
                        break;
 
-               case TO_EDITCMD:
-                       lex.next(true);
-                       editCommand = lex.getString();
-                       break;
-
                case TO_AUTOMATIC:
                        lex.next();
                        automaticProduction = lex.getBool();
@@ -465,6 +464,7 @@ void Template::Format::readFormat(LyXLex & lex)
                FO_PREAMBLE,
                FO_TRANSFORMCOMMAND,
                FO_TRANSFORMOPTION,
+               FO_REFERENCEDFILE,
                FO_END
        };
 
@@ -473,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 },
@@ -534,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;
                }