]> git.lyx.org Git - lyx.git/blobdiff - src/LaTeXFeatures.C
Move #includes out of header files.
[lyx.git] / src / LaTeXFeatures.C
index 0fc6816232cf4a3e7bc472678392729d25a1e929..6984882c5eaa2cd7575f43f3ca3f2ecf8b98e5f6 100644 (file)
@@ -19,6 +19,7 @@
 #include "lyx_sty.h"
 #include "lyxrc.h"
 #include "bufferparams.h"
+#include "Floating.h"
 #include "FloatList.h"
 #include "language.h"
 #include "encoding.h"
@@ -106,9 +107,12 @@ bool LaTeXFeatures::isRequired(string const & name) const
 }
 
 
-void LaTeXFeatures::addExternalPreamble(string const & pream)
+void LaTeXFeatures::addExternalPreamble(string const & preamble)
 {
-       externalPreambles += pream;
+       FeaturesList::const_iterator begin = preamble_snippets.begin();
+       FeaturesList::const_iterator end   = preamble_snippets.end();
+       if (find(begin, end, preamble) == end)
+               preamble_snippets.push_back(preamble);
 }
 
 
@@ -298,7 +302,11 @@ string const LaTeXFeatures::getPackages() const
                packages << "]{natbib}\n";
        }
 
-       packages << externalPreambles;
+       FeaturesList::const_iterator pit  = preamble_snippets.begin();
+       FeaturesList::const_iterator pend = preamble_snippets.end();
+       for (; pit != pend; ++pit) {
+               packages << *pit << '\n';
+       }
 
        return STRCONV(packages.str());
 }