/// 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
void Buffer::registerWord(docstring const & word)
{
- words_.insert(word);
+ d->words_.insert(word);
+}
+
+
+WordList const & Buffer::registeredWords() const
+{
+ return d->words_;
}
} // namespace lyx
#include "support/types.h"
#include "support/SignalSlot.h"
-#include <set>
#include <string>
#include <vector>
class LaTeXFeatures;
class Language;
class MacroData;
+class MacroNameSet;
class OutputParams;
class Paragraph;
class ParConstIterator;
class TexRow;
class TocBackend;
class Undo;
+class WordList;
namespace frontend {
class GuiBufferDelegate;
/// 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,
/// 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
//Signal setBusy(bool) = 0;
/// Reset autosave timers for all users.
Signal resetAutosaveTimers_;
-
- std::set<docstring> words_;
};
#include "support/types.h"
+#include <set>
+
namespace lyx {
class Buffer;
class ParagraphList;
class InsetTabular;
+class WordList : public std::set<docstring> {};
/**
A text inset is like a TeX box to write full text
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);
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);
MacroTypeDef
};
+///
+class MacroNameSet : public std::set<docstring> {};
+
///
class MacroData {
public:
namespace {
-WordList theWordList;
+MathWordList theWordList;
bool math_font_available(docstring & name)
} // namespace anon
-WordList const & mathedWordList()
+MathWordList const & mathedWordList()
{
return theWordList;
}
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;
}
*/
bool createInsetMath_fromDialogStr(docstring const &, MathData &);
-typedef map<docstring, latexkeys> WordList;
-WordList const & mathedWordList();
+typedef map<docstring, latexkeys> MathWordList;
+MathWordList const & mathedWordList();
} // namespace lyx