]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
After a hiatus, I'm returning to the rewrite of InsetCommandParams, the purpose of...
[lyx.git] / src / Buffer.cpp
index c95054b72bed0edac67981d8b09f7e5aaadffda6..3a074cba943e6663a491b42c2dbff92c057c593c 100644 (file)
@@ -113,7 +113,7 @@ namespace os = support::os;
 
 namespace {
 
-int const LYX_FORMAT = 314; // Uwe Stöhr: scrlttr2 for serial letters
+int const LYX_FORMAT = 315; // Richard Heck: column separation
 
 } // namespace anon
 
@@ -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
@@ -466,6 +469,7 @@ int Buffer::readHeader(Lexer & lex)
        params().headheight.erase();
        params().headsep.erase();
        params().footskip.erase();
+       params().columnsep.erase();
        params().listings_params.clear();
        params().clearLayoutModules();
        params().pdfoptions().clear();
@@ -567,7 +571,7 @@ bool Buffer::readDocument(Lexer & lex)
        }
 
        // read main text
-       bool const res = text().read(*this, lex, errorList, &inset());
+       bool const res = text().read(*this, lex, errorList, &(d->inset));
 
        updateMacros();
        updateMacroInstances();
@@ -1183,19 +1187,19 @@ void Buffer::writeLaTeXSource(odocstream & os,
 
 bool Buffer::isLatex() const
 {
-       return params().getTextClass().outputType() == LATEX;
+       return params().textClass().outputType() == LATEX;
 }
 
 
 bool Buffer::isLiterate() const
 {
-       return params().getTextClass().outputType() == LITERATE;
+       return params().textClass().outputType() == LITERATE;
 }
 
 
 bool Buffer::isDocBook() const
 {
-       return params().getTextClass().outputType() == DOCBOOK;
+       return params().textClass().outputType() == DOCBOOK;
 }
 
 
@@ -1226,7 +1230,7 @@ void Buffer::writeDocBookSource(odocstream & os, string const & fname,
 
        d->texrow.reset();
 
-       TextClass const & tclass = params().getTextClass();
+       TextClass const & tclass = params().textClass();
        string const top_element = tclass.latexname();
 
        if (!only_body) {
@@ -1281,7 +1285,7 @@ void Buffer::writeDocBookSource(odocstream & os, string const & fname,
            << " file was created by LyX " << lyx_version
            << "\n  See http://www.lyx.org/ for more information -->\n";
 
-       params().getTextClass().counters().reset();
+       params().textClass().counters().reset();
 
        loadChildDocuments();
 
@@ -2311,6 +2315,9 @@ void Buffer::autoSave() const
 
 void Buffer::resetChildDocuments(bool close_them) const
 {
+       if (text().empty())
+               return;
+
        for (InsetIterator it = inset_iterator_begin(inset()); it; ++it) {
                if (it->lyxCode() != INCLUDE_CODE)
                        continue;
@@ -2529,7 +2536,7 @@ vector<Format const *> Buffer::exportableFormats(bool only_viewable) const
 vector<string> Buffer::backends() const
 {
        vector<string> v;
-       if (params().getTextClass().isTeXClassAvailable()) {
+       if (params().textClass().isTeXClassAvailable()) {
                v.push_back(bufferFormat());
                // FIXME: Don't hardcode format names here, but use a flag
                if (v.back() == "latex")
@@ -2660,4 +2667,16 @@ void Buffer::bufferErrors(TeXErrors const & terr, ErrorList & errorList) const
        }
 }
 
+
+void Buffer::registerWord(docstring const & word)
+{
+       d->words_.insert(word);
+}
+
+
+WordList const & Buffer::registeredWords() const
+{
+       return d->words_;
+}
+
 } // namespace lyx