]> git.lyx.org Git - features.git/commitdiff
* Moved std::sets out of Buffer.h to reduce overall LyX compile time
authorStefan Schimanski <sts@lyx.org>
Sat, 23 Feb 2008 18:11:35 +0000 (18:11 +0000)
committerStefan Schimanski <sts@lyx.org>
Sat, 23 Feb 2008 18:11:35 +0000 (18:11 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23163 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp
src/Buffer.h
src/insets/InsetText.h
src/mathed/InsetMathNest.cpp
src/mathed/MacroTable.h
src/mathed/MathFactory.cpp
src/mathed/MathFactory.h

index d9d9a82f692808c8566d4fe82d5860ff9597f97d..3a074cba943e6663a491b42c2dbff92c057c593c 100644 (file)
@@ -203,6 +203,9 @@ public:
        /// A cache for the bibfiles (including bibfiles of loaded child
        /// documents), needed for appropriate update of natbib labels.
        mutable EmbeddedFileList bibfilesCache_;
+       
+       ///
+       WordList words_;
 };
 
 /// Creates the per buffer temporary directory
@@ -2667,7 +2670,13 @@ void Buffer::bufferErrors(TeXErrors const & terr, ErrorList & errorList) const
 
 void Buffer::registerWord(docstring const & word)
 {
-       words_.insert(word);
+       d->words_.insert(word);
+}
+
+
+WordList const & Buffer::registeredWords() const
+{
+       return d->words_;
 }
 
 } // namespace lyx
index 51c3855f8775c46880d04aace8dea689a69410af..ace9986f23880a6e5111f255335618e1d3ba39d8 100644 (file)
@@ -18,7 +18,6 @@
 #include "support/types.h"
 #include "support/SignalSlot.h"
 
-#include <set>
 #include <string>
 #include <vector>
 
@@ -41,6 +40,7 @@ class LyXVC;
 class LaTeXFeatures;
 class Language;
 class MacroData;
+class MacroNameSet;
 class OutputParams;
 class Paragraph;
 class ParConstIterator;
@@ -50,6 +50,7 @@ class TeXErrors;
 class TexRow;
 class TocBackend;
 class Undo;
+class WordList;
 
 namespace frontend {
 class GuiBufferDelegate;
@@ -366,8 +367,6 @@ public:
        /// Iterate through the whole buffer and try to resolve macros
        void updateMacroInstances() const;
 
-       typedef std::set<docstring> MacroNameSet;
-
        /// List macro names of this buffer. the parent and the children
        void listMacroNames(MacroNameSet & macros) const;
        /// Write out all macros somewhere defined in the parent,
@@ -457,7 +456,7 @@ public:
        /// Register word for completion word list.
        void registerWord(docstring const & word);
        ///
-       std::set<docstring> const & registeredWords() const { return words_; }
+       WordList const & registeredWords() const;
        
 private:
        /// search for macro in local (buffer) table or in children
@@ -510,8 +509,6 @@ private:
        //Signal setBusy(bool) = 0;
        /// Reset autosave timers for all users.
        Signal resetAutosaveTimers_;
-       
-       std::set<docstring> words_;
 };
 
 
index ed748c7680714cf544fae3fd32ef7d1e9bd95ad2..0101724cb1ae336ed1ca6277bc9acdd501a2d9f5 100644 (file)
@@ -19,6 +19,8 @@
 
 #include "support/types.h"
 
+#include <set>
+
 namespace lyx {
 
 class Buffer;
@@ -29,6 +31,7 @@ class Dimension;
 class ParagraphList;
 class InsetTabular;
 
+class WordList : public std::set<docstring> {};
 
 /**
  A text inset is like a TeX box to write full text
index e0cf27a5fbd6c2c92507a7dedb6cf97ae5cdf4b2..4cf95e192866c2d41c732d2c63d011bb6e93c5f0 100644 (file)
@@ -1716,9 +1716,9 @@ bool InsetMathNest::cursorMathBackward(Cursor & cur)
 MathCompletionList::MathCompletionList(Cursor const & cur)
 {
        // fill it with macros from the buffer
-       Buffer::MacroNameSet macros;
+       MacroNameSet macros;
        cur.buffer().listMacroNames(macros);
-       Buffer::MacroNameSet::const_iterator it;
+       MacroNameSet::const_iterator it;
        for (it = macros.begin(); it != macros.end(); ++it) {
                if (cur.buffer().getMacro(*it, cur, false))
                        locals.push_back("\\" + *it);
@@ -1782,8 +1782,8 @@ MathCompletionList::MathCompletionList(Cursor const & cur)
        globals.push_back(from_ascii("\\hphantom"));
        globals.push_back(from_ascii("\\phantom"));
        globals.push_back(from_ascii("\\vphantom"));
-       WordList const & words = mathedWordList();
-       WordList::const_iterator it2;
+       MathWordList const & words = mathedWordList();
+       MathWordList::const_iterator it2;
        lyxerr << "Globals completion commands: ";
        for (it2 = words.begin(); it2 != words.end(); ++it2) {
                globals.push_back("\\" + (*it2).first);
index 594e1bebc8f3c336636ba03c9903dd847d67d6d9..57a0431dea2074bec81ef43d460bcb8b05d05f4b 100644 (file)
@@ -34,6 +34,9 @@ enum MacroType {
        MacroTypeDef
 };
 
+///
+class MacroNameSet : public std::set<docstring> {};
+       
 ///
 class MacroData {
 public:
index 9e776cde7566742c1e77e793606fdb2b5c6bb093..d65747898869d8d0d65206268f5ed39319c893e4 100644 (file)
@@ -69,7 +69,7 @@ bool has_math_fonts;
 
 namespace {
 
-WordList theWordList;
+MathWordList theWordList;
 
 
 bool math_font_available(docstring & name)
@@ -218,7 +218,7 @@ void initSymbols()
 
 } // namespace anon
 
-WordList const & mathedWordList()
+MathWordList const & mathedWordList()
 {
        return theWordList;
 }
@@ -237,7 +237,7 @@ void initMath()
 
 latexkeys const * in_word_set(docstring const & str)
 {
-       WordList::iterator it = theWordList.find(str);
+       MathWordList::iterator it = theWordList.find(str);
        return it != theWordList.end() ? &(it->second) : 0;
 }
 
index ab89328707cb0c7b8d15e69817f60335c4e8e1d3..f62f22d980f09b26b9a419e0e44830de9b2ce0d1 100644 (file)
@@ -35,8 +35,8 @@ MathAtom createInsetMath(char const * const);
  */
 bool createInsetMath_fromDialogStr(docstring const &, MathData &);
 
-typedef map<docstring, latexkeys> WordList;
-WordList const & mathedWordList();
+typedef map<docstring, latexkeys> MathWordList;
+MathWordList const & mathedWordList();
 
 } // namespace lyx