]> git.lyx.org Git - lyx.git/commitdiff
remove unnneded #include
authorAndré Pönitz <poenitz@gmx.net>
Tue, 11 Sep 2007 22:31:24 +0000 (22:31 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Tue, 11 Sep 2007 22:31:24 +0000 (22:31 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20233 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/controllers/ControlTexinfo.cpp
src/frontends/controllers/ControlTexinfo.h
src/frontends/controllers/frontend_helpers.cpp
src/frontends/controllers/frontend_helpers.h
src/frontends/qt4/GuiBox.cpp
src/frontends/qt4/GuiDocument.cpp
src/frontends/qt4/GuiGraphics.cpp
src/frontends/qt4/GuiPrefs.cpp
src/insets/InsetCitation.cpp

index 1d2e7af7a00ef13e2f984173e2d790afce88bc0e..0320afdcebf7f72e1f92c39f39b8fad36aa6160b 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "ControlTexinfo.h"
 #include "FuncRequest.h"
+#include "debug.h"
 
 #include "support/filetools.h"
 #include "support/FileName.h"
@@ -21,6 +22,7 @@
 
 using std::string;
 using std::vector;
+using std::endl;
 
 namespace lyx {
 namespace frontend {
@@ -29,6 +31,9 @@ using support::FileName;
 using support::contains;
 using support::split;
 using support::token;
+using support::getExtension;
+using support::libFileSearch;
+using support::onlyFilename;
 
 
 ControlTexinfo::ControlTexinfo(Dialog & parent)
@@ -43,6 +48,47 @@ void ControlTexinfo::viewFile(string const & filename) const
 }
 
 
+/// get a class with full path from the list
+string const getTexFileFromList(string const & file, string const & type)
+{
+       string file_ = file;
+       // do we need to add the suffix?
+       if (!(getExtension(file) == type))
+               file_ += '.' + type;
+
+       lyxerr << "Searching for file " << file_ << endl;
+
+       string lstfile = type + "Files.lst";
+       if (type == "cls")
+               lstfile = "clsFiles.lst";
+       else if (type == "sty")
+               lstfile = "styFiles.lst";
+       else if (type == "bst")
+               lstfile = "bstFiles.lst";
+       else if (type == "bib")
+               lstfile = "bibFiles.lst";
+       FileName const abslstfile = libFileSearch(string(), lstfile);
+       if (abslstfile.empty()) {
+               lyxerr << "File `'" << lstfile << "' not found." << endl;
+               return string();
+       }
+       string const allClasses = getFileContents(abslstfile);
+       int entries = 0;
+       string classfile = token(allClasses, '\n', entries);
+       int count = 0;
+       while ((!contains(classfile, file) ||
+               (onlyFilename(classfile) != file)) &&
+               (++count < 1000)) {
+               classfile = token(allClasses, '\n', ++entries);
+       }
+
+       // now we have filename with full path
+       lyxerr << "with full path: " << classfile << endl;
+
+       return classfile;
+}
+
+
 string const ControlTexinfo::getClassOptions(string const & classname) const
 {
        FileName const filename(getTexFileFromList(classname, "cls"));
index f0165a09a3dfbd5e16db3c028c33d7987b0a070e..2a2f9309c836bed8e067ec3fc68e60b7e7df8fa8 100644 (file)
 namespace lyx {
 namespace frontend {
 
-/** A controller for Texinfo dialogs. */
+std::string const getTexFileFromList(std::string const & file,
+       std::string const & type);
 
+/** A controller for Texinfo dialogs. */
 class ControlTexinfo : public Controller {
 public:
        ///
index 5ff3b865fdaf5bd656ccfee247076b197845947e..e3b8d3f1e65775a2807aae5e606d13c0bebede8c 100644 (file)
 
 #include "frontend_helpers.h"
 
-#include "Buffer.h"
-#include "BufferParams.h"
-#include "Color.h"
-#include "debug.h"
 #include "gettext.h"
 #include "Language.h"
-#include "Length.h"
 
 #include "frontends/FileDialog.h"
 #include "frontends/alert.h"
 
 #include "support/filetools.h"
 #include "support/lstrings.h"
-#include "support/Package.h"
-#include "support/lstrings.h"
 #include "support/lyxalgo.h"
 #include "support/os.h"
 #include "support/Package.h"
 #include "support/Path.h"
 #include "support/Systemcall.h"
 
-#include <boost/cregex.hpp>
 #include <boost/regex.hpp>
 
 #include <algorithm>
@@ -50,7 +42,6 @@ namespace frontend {
 
 using support::addName;
 using support::bformat;
-using support::contains;
 using support::FileFilterList;
 using support::FileName;
 using support::getExtension;
@@ -212,18 +203,6 @@ docstring const browseDir(docstring const & pathname,
 }
 
 
-vector<docstring> const getLatexUnits()
-{
-       vector<docstring> units;
-       int i = 0;
-       char const * str = stringFromUnit(i);
-       for (; str != 0; ++i, str = stringFromUnit(i))
-               units.push_back(from_ascii(str));
-
-       return units;
-}
-
-
 void rescanTexStyles()
 {
        // Run rescan in user lyx directory
@@ -254,55 +233,13 @@ void getTexFileList(string const & filename, std::vector<string> & list)
        boost::RegEx regex("/{2,}");
        std::vector<string>::iterator it  = list.begin();
        std::vector<string>::iterator end = list.end();
-       for (; it != end; ++it) {
+       for (; it != end; ++it)
                *it = regex.Merge((*it), "/");
-       }
 
        // remove empty items and duplicates
        list.erase(std::remove(list.begin(), list.end(), ""), list.end());
        eliminate_duplicates(list);
 }
 
-
-string const getTexFileFromList(string const & file,
-                           string const & type)
-{
-       string file_ = file;
-       // do we need to add the suffix?
-       if (!(getExtension(file) == type))
-               file_ += '.' + type;
-
-       lyxerr << "Searching for file " << file_ << endl;
-
-       string lstfile;
-       if (type == "cls")
-               lstfile = "clsFiles.lst";
-       else if (type == "sty")
-               lstfile = "styFiles.lst";
-       else if (type == "bst")
-               lstfile = "bstFiles.lst";
-       else if (type == "bib")
-               lstfile = "bibFiles.lst";
-       FileName const abslstfile = libFileSearch(string(), lstfile);
-       if (abslstfile.empty()) {
-               lyxerr << "File `'" << lstfile << "' not found." << endl;
-               return string();
-       }
-       string const allClasses = getFileContents(abslstfile);
-       int entries = 0;
-       string classfile = token(allClasses, '\n', entries);
-       int count = 0;
-       while ((!contains(classfile, file) ||
-               (onlyFilename(classfile) != file)) &&
-               (++count < 1000)) {
-               classfile = token(allClasses, '\n', ++entries);
-       }
-
-       // now we have filename with full path
-       lyxerr << "with full path: " << classfile << endl;
-
-       return classfile;
-}
-
 } // namespace frontend
 } // namespace lyx
index cbaaf0a5aaae72ebbb0c9dd88cf18e335134076e..03356ad67ddc2abe36f1b9248b58e455a8a16054 100644 (file)
 #include <vector>
 #include <string>
 
-#include <boost/bind.hpp>
-
 namespace lyx {
 
 namespace support { class FileFilterList; }
 
 namespace frontend {
 
-///
-template<class Pair>
-std::vector<typename Pair::second_type> const
-getSecond(std::vector<Pair> const & pr)
-{
-        std::vector<typename Pair::second_type> tmp(pr.size());
-        std::transform(pr.begin(), pr.end(), tmp.begin(),
-                                        boost::bind(&Pair::second, _1));
-        return tmp;
-}
-
 ///
 typedef std::pair<docstring, std::string> LanguagePair;
 
@@ -108,10 +95,6 @@ browseDir(docstring const & pathname,
         std::make_pair(docstring(), docstring()));
 
 
-/// Returns a vector of units that can be used to create a valid LaTeX length.
-std::vector<docstring> const getLatexUnits();
-
-
 /** Build filelists of all availabe bst/cls/sty-files. Done through
 *  kpsewhich and an external script, saved in *Files.lst.
 */
@@ -122,9 +105,6 @@ void rescanTexStyles();
  */
 void getTexFileList(std::string const & filename, std::vector<std::string> & contents);
 
-/// get a class with full path from the list
-std::string const getTexFileFromList(std::string const & classname, std::string const & type);
-
 } // namespace frontend
 } // namespace lyx
 
index 0e6b55c3dd26d7ae17db0f6784ca4932fd434c89..fde1ba6b13233c4c4f2a8c555aa8e622ea21f7b9 100644 (file)
 
 #include "GuiBox.h"
 
-#include "ControlBox.h"
-
 #include "LengthCombo.h"
 #include "qt_helpers.h"
 #include "lengthcommon.h"
 #include "LyXRC.h" // to set the default length values
 #include "Validator.h"
 
-#include "controllers/ControlBox.h"
-#include "controllers/frontend_helpers.h"
-
 #include "insets/InsetBox.h"
 
 #include "support/lstrings.h"
 #include <QCloseEvent>
 
 
-using lyx::support::getStringFromVector;
-using lyx::support::isStrDbl;
-using lyx::support::subst;
 using std::string;
 
-
 namespace lyx {
 namespace frontend {
 
-
 GuiBoxDialog::GuiBoxDialog(LyXView & lv)
        : GuiDialog(lv, "box")
 {
@@ -210,7 +200,7 @@ void GuiBoxDialog::updateContents()
        lengthToWidgets(widthED, widthUnitsLC,
                (controller().params().width).asString(), default_unit);
 
-       string const special(controller().params().special);
+       string const special = controller().params().special;
        if (!special.empty() && special != "none") {
                QString spc;
                for (unsigned int i = 0; i < gui_names_spec_.size(); i++) {
@@ -226,7 +216,7 @@ void GuiBoxDialog::updateContents()
        lengthToWidgets(heightED, heightUnitsLC,
                (controller().params().height).asString(), default_unit);
 
-       string const height_special(controller().params().height_special);
+       string const height_special = controller().params().height_special;
        if (!height_special.empty() && height_special != "none") {
                QString hspc;
                for (unsigned int i = 0; i < gui_names_spec_.size(); i++) {
@@ -366,7 +356,7 @@ void GuiBoxDialog::setInnerType(bool frameless, int i)
                innerBoxCO->setCurrentIndex(i - 1);
        } else {
                if (innerBoxCO->count() == 2)
-                       i += 1;
+                       ++i;
                innerBoxCO->clear();
                innerBoxCO->addItem(qt_("None"));
                innerBoxCO->addItem(qt_("Parbox"));
index b586395f54ea34198dae90177bbe16bebe4aaddf..2fb693eba5ef372deed46b3f8928fc15186e097c 100644 (file)
 
 #include "GuiViewSource.h" // For latexHighlighter use in the preamble.
 
+#include "frontend_helpers.h"
 #include "BufferParams.h"
 #include "Encoding.h"
 #include "gettext.h"
-#include "frontend_helpers.h" // getSecond()
 #include "Language.h"
 #include "LyXRC.h" // defaultUnit
 #include "TextClassList.h"
@@ -36,6 +36,8 @@
 
 #include "support/lstrings.h"
 
+#include <boost/bind.hpp>
+
 #include <QCloseEvent>
 #include <QScrollBar>
 #include <QTextCursor>
@@ -54,6 +56,17 @@ using std::vector;
 using std::string;
 
 
+///
+template<class Pair>
+std::vector<typename Pair::second_type> const
+getSecond(std::vector<Pair> const & pr)
+{
+        std::vector<typename Pair::second_type> tmp(pr.size());
+        std::transform(pr.begin(), pr.end(), tmp.begin(),
+                                        boost::bind(&Pair::second, _1));
+        return tmp;
+}
+
 char const * const tex_graphics[] =
 {
        "default", "dvips", "dvitops", "emtex",
index 4ce719a1a3b6d4e26061c759a1db26df0c978a99..577dc77214649a54fa26607013cb472068bc0b7e 100644 (file)
@@ -23,8 +23,6 @@
 #include "qt_helpers.h"
 #include "Validator.h"
 
-#include "controllers/frontend_helpers.h"
-
 #include "insets/InsetGraphicsParams.h"
 
 #include "support/convert.h"
@@ -32,6 +30,8 @@
 #include "support/lyxlib.h"
 #include "support/os.h"
 
+#include <boost/bind.hpp>
+
 #include <QCheckBox>
 #include <QCloseEvent>
 #include <QLabel>
@@ -69,6 +69,17 @@ getFirst(std::vector<Pair> const & pr)
        return tmp;
 }
 
+///
+template<class Pair>
+std::vector<typename Pair::second_type> const
+getSecond(std::vector<Pair> const & pr)
+{
+        std::vector<typename Pair::second_type> tmp(pr.size());
+        std::transform(pr.begin(), pr.end(), tmp.begin(),
+                                        boost::bind(&Pair::second, _1));
+        return tmp;
+}
+
 GuiGraphicsDialog::GuiGraphicsDialog(LyXView & lv)
        : GuiDialog(lv, "graphics")
 {
index 26e23ac4a9f78f8cbc5dc6190351cb70f997f8a5..df7959d740bb8d9bbb503829b45959be846fea21 100644 (file)
@@ -70,8 +70,6 @@ namespace frontend {
 //
 /////////////////////////////////////////////////////////////////////
 
-// FIXME: move to frontend_helpers.h
-
 template<class A>
 static size_t findPos_helper(std::vector<A> const & vec, A const & val)
 {
@@ -1609,12 +1607,12 @@ PrefLanguage::PrefLanguage(QWidget * parent)
 
        // store the lang identifiers for later
        std::vector<LanguagePair> const langs = frontend::getLanguageData(false);
-       lang_ = getSecond(langs);
-
        std::vector<LanguagePair>::const_iterator lit  = langs.begin();
        std::vector<LanguagePair>::const_iterator lend = langs.end();
+       lang_.clear();
        for (; lit != lend; ++lit) {
                defaultLanguageCO->addItem(toqstr(lit->first));
+               lang_.push_back(lit->second);
        }
 }
 
index 1cd5c8e4b0620831b55c690eb9fbb69bbdbe3185..020e2b36891ebd2c7f38606d321a3eaa9bd02d0b 100644 (file)
@@ -20,8 +20,6 @@
 #include "FuncRequest.h"
 #include "LaTeXFeatures.h"
 
-#include "frontends/controllers/frontend_helpers.h"
-
 #include "support/fs_extras.h"
 #include "support/lstrings.h"
 
@@ -53,7 +51,7 @@ namespace {
 
 vector<string> const init_possible_cite_commands()
 {
-       char const * const pos[] = {
+       char const * const possible[] = {
                "cite", "citet", "citep", "citealt", "citealp",
                "citeauthor", "citeyear", "citeyearpar",
                "citet*", "citep*", "citealt*", "citealp*", "citeauthor*",
@@ -64,16 +62,16 @@ vector<string> const init_possible_cite_commands()
                "footcitealp", "footciteauthor", "footciteyear", "footciteyearpar",
                "citefield", "citetitle", "cite*"
        };
-       size_t const size_pos = sizeof(pos) / sizeof(pos[0]);
+       size_t const size_possible = sizeof(possible) / sizeof(possible[0]);
 
-       return vector<string>(pos, pos + size_pos);
+       return vector<string>(possible, possible + size_possible);
 }
 
 
 vector<string> const & possible_cite_commands()
 {
-       static vector<string> const pos = init_possible_cite_commands();
-       return pos;
+       static vector<string> const possible = init_possible_cite_commands();
+       return possible;
 }
 
 
@@ -459,9 +457,7 @@ int InsetCitation::plaintext(Buffer const & buffer, odocstream & os,
 }
 
 
-namespace {
-
-docstring const cleanupWhitespace(docstring const & citelist)
+static docstring const cleanupWhitespace(docstring const & citelist)
 {
        docstring::const_iterator it  = citelist.begin();
        docstring::const_iterator end = citelist.end();
@@ -478,8 +474,6 @@ docstring const cleanupWhitespace(docstring const & citelist)
        return result;
 }
 
-// end anon namyspace
-}
 
 int InsetCitation::docbook(Buffer const &, odocstream & os,
                           OutputParams const &) const