]> git.lyx.org Git - features.git/commitdiff
Final batch of BufferParam renaming.
authorRichard Heck <rgheck@comcast.net>
Fri, 26 Nov 2010 18:42:53 +0000 (18:42 +0000)
committerRichard Heck <rgheck@comcast.net>
Fri, 26 Nov 2010 18:42:53 +0000 (18:42 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36525 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp
src/BufferParams.cpp
src/BufferParams.h
src/LaTeXFeatures.cpp
src/frontends/qt4/GuiDocument.cpp

index 01a51d41d6d07a3b63f3dce17062f496da78d88e..ea0443de39131bbf09acc4dbdbfb64e1bac8d4b8 100644 (file)
@@ -3333,9 +3333,9 @@ string Buffer::bufferFormat() const
 
 string Buffer::getDefaultOutputFormat() const
 {
-       if (!params().defaultOutputFormat.empty()
-           && params().defaultOutputFormat != "default")
-               return params().defaultOutputFormat;
+       if (!params().default_output_format.empty()
+           && params().default_output_format != "default")
+               return params().default_output_format;
        typedef vector<Format const *> Formats;
        Formats formats = exportableFormats(true);
        if (isDocBook()
index 6f1c883e518ac905af14cf5b837cb66742cf6f52..6e72a38c04c3579e8bff22f0c5912db13fe1aad6 100644 (file)
@@ -385,8 +385,8 @@ BufferParams::BufferParams()
        fonts_sans_scale = 100;
        fonts_typewriter_scale = 100;
        inputenc = "auto";
-       graphicsDriver = "default";
-       defaultOutputFormat = "default";
+       graphics_driver = "default";
+       default_output_format = "default";
        bibtex_command = "default";
        index_command = "default";
        sides = OneSide;
@@ -606,7 +606,7 @@ string BufferParams::readToken(Lexer & lex, string const & token,
        } else if (token == "\\graphics") {
                readGraphicsDriver(lex);
        } else if (token == "\\default_output_format") {
-               lex >> defaultOutputFormat;
+               lex >> default_output_format;
        } else if (token == "\\bibtex_command") {
                lex.eatLine();
                bibtex_command = lex.getString();
@@ -902,30 +902,30 @@ void BufferParams::writeFile(ostream & os) const
        }
        
        // removed modules
-       if (!removedModules_.empty()) {
+       if (!removed_modules_.empty()) {
                os << "\\begin_removed_modules" << '\n';
-               list<string>::const_iterator it = removedModules_.begin();
-               list<string>::const_iterator en = removedModules_.end();
+               list<string>::const_iterator it = removed_modules_.begin();
+               list<string>::const_iterator en = removed_modules_.end();
                for (; it != en; it++)
                        os << *it << '\n';
                os << "\\end_removed_modules" << '\n';
        }
 
        // the modules
-       if (!layoutModules_.empty()) {
+       if (!layout_modules_.empty()) {
                os << "\\begin_modules" << '\n';
-               LayoutModuleList::const_iterator it = layoutModules_.begin();
-               LayoutModuleList::const_iterator en = layoutModules_.end();
+               LayoutModuleList::const_iterator it = layout_modules_.begin();
+               LayoutModuleList::const_iterator en = layout_modules_.end();
                for (; it != en; it++)
                        os << *it << '\n';
                os << "\\end_modules" << '\n';
        }
 
        // includeonly
-       if (!includedChildren_.empty()) {
+       if (!included_children_.empty()) {
                os << "\\begin_includeonly" << '\n';
-               list<string>::const_iterator it = includedChildren_.begin();
-               list<string>::const_iterator en = includedChildren_.end();
+               list<string>::const_iterator it = included_children_.begin();
+               list<string>::const_iterator en = included_children_.end();
                for (; it != en; it++)
                        os << *it << '\n';
                os << "\\end_includeonly" << '\n';
@@ -960,8 +960,8 @@ void BufferParams::writeFile(ostream & os) const
        if (!fonts_cjk.empty()) {
                os << "\\font_cjk " << fonts_cjk << '\n';
        }
-       os << "\n\\graphics " << graphicsDriver << '\n';
-       os << "\\default_output_format " << defaultOutputFormat << '\n';
+       os << "\n\\graphics " << graphics_driver << '\n';
+       os << "\\default_output_format " << default_output_format << '\n';
        os << "\\output_sync " << output_sync << '\n';
        if (!output_sync_macro.empty())
                os << "\\output_sync_macro \"" << output_sync_macro << "\"\n";
@@ -1382,11 +1382,12 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
        writeEncodingPreamble(os, features, texrow);
 
        // includeonly
-       if (!features.runparams().includeall && !includedChildren_.empty()) {
+       if (!features.runparams().includeall && !included_children_.empty()) {
                os << "\\includeonly{";
-               list<string>::const_iterator it = includedChildren_.begin();
+               list<string>::const_iterator it = included_children_.begin();
+               list<string>::const_iterator en = included_children_.end();
                bool first = true;
-               for (; it != includedChildren_.end() ; ++it) {
+               for (; it != en; ++it) {
                        string incfile = *it;
                        FileName inc = makeAbsPath(incfile, filepath.absFileName());
                        string mangled = DocFileName(changeExtension(inc.absFileName(), ".tex")).
@@ -2004,7 +2005,7 @@ bool BufferParams::setBaseClass(string const & classname)
        }
 
        pimpl_->baseClass_ = classname;
-       layoutModules_.adaptToBaseClass(baseClass(), removedModules_);
+       layout_modules_.adaptToBaseClass(baseClass(), removed_modules_);
        return true;
 }
 
@@ -2029,7 +2030,7 @@ void BufferParams::makeDocumentClass()
        if (!baseClass())
                return;
 
-       doc_class_ = &(DocumentClassBundle::get().makeDocumentClass(*baseClass(), layoutModules_));
+       doc_class_ = &(DocumentClassBundle::get().makeDocumentClass(*baseClass(), layout_modules_));
 
        if (!local_layout.empty()) {
                if (!doc_class_->read(local_layout, TextClass::MODULE)) {
@@ -2042,18 +2043,18 @@ void BufferParams::makeDocumentClass()
 
 bool BufferParams::moduleCanBeAdded(string const & modName) const
 {
-       return layoutModules_.moduleCanBeAdded(modName, baseClass());
+       return layout_modules_.moduleCanBeAdded(modName, baseClass());
 }
 
 
 bool BufferParams::addLayoutModule(string const & modName)
 {
-       LayoutModuleList::const_iterator it = layoutModules_.begin();
-       LayoutModuleList::const_iterator end = layoutModules_.end();
+       LayoutModuleList::const_iterator it = layout_modules_.begin();
+       LayoutModuleList::const_iterator end = layout_modules_.end();
        for (; it != end; it++)
                if (*it == modName) 
                        return false;
-       layoutModules_.push_back(modName);
+       layout_modules_.push_back(modName);
        return true;
 }
 
@@ -2121,14 +2122,14 @@ void BufferParams::readGraphicsDriver(Lexer & lex)
                string const test = tex_graphics[n++];
 
                if (test == tmptok) {
-                       graphicsDriver = tmptok;
+                       graphics_driver = tmptok;
                        break;
                }
                if (test.empty()) {
                        lex.printError(
                                "Warning: graphics driver `$$Token' not recognized!\n"
                                "         Setting graphics driver to `default'.\n");
-                       graphicsDriver = "default";
+                       graphics_driver = "default";
                        break;
                }
        }
@@ -2196,22 +2197,22 @@ void BufferParams::readRemovedModules(Lexer & lex)
                string mod = lex.getString();
                if (mod == "\\end_removed_modules")
                        break;
-               removedModules_.push_back(mod);
+               removed_modules_.push_back(mod);
                lex.eatLine();
        }
        // now we want to remove any removed modules that were previously 
        // added. normally, that will be because default modules were added in 
        // setBaseClass(), which gets called when \textclass is read at the 
        // start of the read.
-       list<string>::const_iterator rit = removedModules_.begin();
-       list<string>::const_iterator const ren = removedModules_.end();
+       list<string>::const_iterator rit = removed_modules_.begin();
+       list<string>::const_iterator const ren = removed_modules_.end();
        for (; rit != ren; rit++) {
-               LayoutModuleList::iterator const mit = layoutModules_.begin();
-               LayoutModuleList::iterator const men = layoutModules_.end();
+               LayoutModuleList::iterator const mit = layout_modules_.begin();
+               LayoutModuleList::iterator const men = layout_modules_.end();
                LayoutModuleList::iterator found = find(mit, men, *rit);
                if (found == men)
                        continue;
-               layoutModules_.erase(found);
+               layout_modules_.erase(found);
        }
 }
 
@@ -2227,7 +2228,7 @@ void BufferParams::readIncludeonly(Lexer & lex)
                string child = lex.getString();
                if (child == "\\end_includeonly")
                        break;
-               includedChildren_.push_back(child);
+               included_children_.push_back(child);
                lex.eatLine();
        }
 }
@@ -2441,12 +2442,12 @@ docstring BufferParams::getGraphicsDriver(string const & package) const
        docstring result;
 
        if (package == "geometry") {
-               if (graphicsDriver == "dvips"
-                   || graphicsDriver == "dvipdfm"
-                   || graphicsDriver == "pdftex"
-                   || graphicsDriver == "vtex")
-                       result = from_ascii(graphicsDriver);
-               else if (graphicsDriver == "dvipdfmx")
+               if (graphics_driver == "dvips"
+                   || graphics_driver == "dvipdfm"
+                   || graphics_driver == "pdftex"
+                   || graphics_driver == "vtex")
+                       result = from_ascii(graphics_driver);
+               else if (graphics_driver == "dvipdfmx")
                        result = from_ascii("dvipdfm");
        }
 
index 50e0fce26d13280dba97c1c3fe16d99d061ecbc4..e5a443cb81fbcd622465ca45ab7b18108517bd95 100644 (file)
@@ -132,10 +132,10 @@ public:
        /// but it seems to be needed by CutAndPaste::putClipboard().
        void setDocumentClass(DocumentClass const * const);
        /// List of modules in use
-       LayoutModuleList const & getModules() const { return layoutModules_; }
+       LayoutModuleList const & getModules() const { return layout_modules_; }
        /// List of default modules the user has removed
        std::list<std::string> const & getRemovedModules() const 
-                       { return removedModules_; }
+                       { return removed_modules_; }
        ///
        /// Add a module to the list of modules in use. This checks only that the
        /// module is not already in the list, so use moduleIsCompatible first if
@@ -147,20 +147,20 @@ public:
        bool moduleCanBeAdded(std::string const & modName) const;
        ///
        void addRemovedModule(std::string const & modName) 
-                       { removedModules_.push_back(modName); }
+                       { removed_modules_.push_back(modName); }
        /// Clear the list
-       void clearLayoutModules() { layoutModules_.clear(); }
+       void clearLayoutModules() { layout_modules_.clear(); }
        /// Clear the removed module list
-       void clearRemovedModules() { removedModules_.clear(); }
+       void clearRemovedModules() { removed_modules_.clear(); }
 
        /// List of included children (for includeonly)
        std::list<std::string> const & getIncludedChildren() const 
-                       { return includedChildren_; }
+                       { return included_children_; }
        ///
        void addIncludedChildren(std::string const & child) 
-                       { includedChildren_.push_back(child); }
+                       { included_children_.push_back(child); }
        /// Clear the list of included children
-       void clearIncludedChildren() { includedChildren_.clear(); }
+       void clearIncludedChildren() { included_children_.clear(); }
 
        /// update aux files of unincluded children (with \includeonly)
        bool maintain_unincluded_children;
@@ -198,9 +198,9 @@ public:
 
        /* some LaTeX options */
        /// The graphics driver
-       std::string graphicsDriver;
+       std::string graphics_driver;
        /// The default output format
-       std::string defaultOutputFormat;
+       std::string default_output_format;
        /// customized bibliography processor
        std::string bibtex_command;
        /// customized index processor
@@ -434,13 +434,13 @@ private:
        ///
        DocumentClass * doc_class_;
        /// 
-       LayoutModuleList layoutModules_;
+       LayoutModuleList layout_modules_;
        /// this is for modules that are required by the document class but that
        /// the user has chosen not to use
-       std::list<std::string> removedModules_;
+       std::list<std::string> removed_modules_;
 
        /// the list of included children (for includeonly)
-       std::list<std::string> includedChildren_;
+       std::list<std::string> included_children_;
 
        /** Use the Pimpl idiom to hide those member variables that would otherwise
         *  drag in other header files.
index 6e5b4121094c72c20742f8d3e3aa37e87956cbdf..bc19ac5f14eb14932ce8bce6145f3925f0027c2c 100644 (file)
@@ -616,12 +616,12 @@ string const LaTeXFeatures::getColorOptions() const
        if (mustProvide("color") || mustProvide("xcolor")) {
                string const package =
                        (mustProvide("xcolor") ? "xcolor" : "color");
-               if (params_.graphicsDriver == "default"
-                       || params_.graphicsDriver == "none")
+               if (params_.graphics_driver == "default"
+                       || params_.graphics_driver == "none")
                        colors << "\\usepackage{" << package << "}\n";
                else
                        colors << "\\usepackage["
-                                << params_.graphicsDriver
+                                << params_.graphics_driver
                                 << "]{" << package << "}\n";
        }
 
@@ -742,12 +742,12 @@ string const LaTeXFeatures::getPackages() const
        }
 
        // graphicx.sty
-       if (mustProvide("graphicx") && params_.graphicsDriver != "none") {
-               if (params_.graphicsDriver == "default")
+       if (mustProvide("graphicx") && params_.graphics_driver != "none") {
+               if (params_.graphics_driver == "default")
                        packages << "\\usepackage{graphicx}\n";
                else
                        packages << "\\usepackage["
-                                << params_.graphicsDriver
+                                << params_.graphics_driver
                                 << "]{graphicx}\n";
        }
        
index 8e35ff6b6d77b25ddd96b6da2365589b4008683e..da80de1777cb312b7352aa8782733570af933518 100644 (file)
@@ -2224,7 +2224,7 @@ void GuiDocument::applyView()
        bp_.user_defined_bullet(3) = bulletsModule->bullet(3);
 
        // packages
-       bp_.graphicsDriver =
+       bp_.graphics_driver =
                tex_graphics[latexModule->psdriverCO->currentIndex()];
        
        // text layout
@@ -2388,7 +2388,7 @@ void GuiDocument::applyView()
                InsetListingsParams(fromqstr(listingsModule->listingsED->toPlainText())).params();
 
        // output
-       bp_.defaultOutputFormat = fromqstr(outputModule->defaultFormatCO->itemData(
+       bp_.default_output_format = fromqstr(outputModule->defaultFormatCO->itemData(
                outputModule->defaultFormatCO->currentIndex()).toString());
 
        bool const nontexfonts = fontModule->osFontsCB->isChecked();
@@ -2662,7 +2662,7 @@ void GuiDocument::paramsToDialog()
        bulletsModule->init();
 
        // packages
-       int nitem = findToken(tex_graphics, bp_.graphicsDriver);
+       int nitem = findToken(tex_graphics, bp_.graphics_driver);
        if (nitem >= 0)
                latexModule->psdriverCO->setCurrentIndex(nitem);
        updateModuleInfo();
@@ -2822,7 +2822,7 @@ void GuiDocument::paramsToDialog()
        // update combobox with formats
        updateDefaultFormat();
        int index = outputModule->defaultFormatCO->findData(toqstr(
-               bp_.defaultOutputFormat));
+               bp_.default_output_format));
        // set to default if format is not found 
        if (index == -1)
                index = 0;