From 3e3955c4f3ee3302d2e1aae643be37ee3b758512 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Tue, 17 Jul 2007 17:46:54 +0000 Subject: [PATCH] more std declaration fixes. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19104 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Cursor.cpp | 5 +++-- src/CursorSlice.cpp | 4 ++-- src/DepTable.cpp | 19 +++++++++---------- src/DocIterator.cpp | 4 ++-- src/Encoding.cpp | 14 ++++++-------- src/ErrorList.cpp | 4 ++-- src/Exporter.cpp | 8 ++++---- src/FloatList.cpp | 4 ++-- src/Floating.cpp | 4 ++-- src/Font.cpp | 16 ++++++++-------- src/Format.cpp | 6 +++--- src/FuncRequest.cpp | 6 +++--- src/Graph.cpp | 6 +++--- src/ISpell.cpp | 9 ++++----- src/Importer.cpp | 8 ++++---- src/InsetList.cpp | 6 +++--- src/Intl.cpp | 5 ++--- src/KeyMap.cpp | 6 +++--- src/KeySequence.cpp | 6 +++--- src/LaTeX.cpp | 29 ++++++++++++++--------------- src/LaTeXFeatures.cpp | 15 ++++++++------- src/Language.cpp | 6 +++--- src/debug.cpp | 8 ++++---- src/factory.cpp | 8 ++++---- src/gettext.cpp | 10 +++++----- 25 files changed, 106 insertions(+), 110 deletions(-) diff --git a/src/Cursor.cpp b/src/Cursor.cpp index 929b4b9230..bb9b91dec6 100644 --- a/src/Cursor.cpp +++ b/src/Cursor.cpp @@ -53,14 +53,15 @@ #include #include -namespace lyx { - using std::string; using std::vector; using std::endl; using std::min; using std::for_each; + +namespace lyx { + namespace { bool diff --git a/src/CursorSlice.cpp b/src/CursorSlice.cpp index 56b642a89e..47b518cbfd 100644 --- a/src/CursorSlice.cpp +++ b/src/CursorSlice.cpp @@ -26,11 +26,11 @@ #include +using std::endl; + namespace lyx { -using std::endl; - CursorSlice::CursorSlice() : inset_(0), idx_(0), pit_(0), pos_(0) diff --git a/src/DepTable.cpp b/src/DepTable.cpp index c68eef628e..1cef441eb2 100644 --- a/src/DepTable.cpp +++ b/src/DepTable.cpp @@ -25,19 +25,9 @@ #include - -namespace lyx { - #ifndef CXX_GLOBAL_CSTD using std::time; #endif - -using support::FileName; -using support::ltrim; -using support::onlyFilename; -using support::suffixIs; -using support::sum; - using std::endl; using std::flush; using std::getline; @@ -45,6 +35,15 @@ using std::string; using std::ofstream; using std::ifstream; + +namespace lyx { + +using support::FileName; +using support::ltrim; +using support::onlyFilename; +using support::suffixIs; +using support::sum; + inline bool DepTable::dep_info::changed() const { diff --git a/src/DocIterator.cpp b/src/DocIterator.cpp index d3db75d1fd..2764952b08 100644 --- a/src/DocIterator.cpp +++ b/src/DocIterator.cpp @@ -26,11 +26,11 @@ #include #include +using std::endl; + namespace lyx { -using std::endl; - // We could be able to get rid of this if only every BufferView were // associated to a buffer on construction. diff --git a/src/Encoding.cpp b/src/Encoding.cpp index a4cd882f73..6f009046a3 100644 --- a/src/Encoding.cpp +++ b/src/Encoding.cpp @@ -25,19 +25,17 @@ #include +#ifndef CXX_GLOBAL_CSTD +using std::strtol; +#endif +using std::endl; +using std::string; + namespace lyx { using support::FileName; -#ifndef CXX_GLOBAL_CSTD -using std::strtol; -#endif - -using std::endl; -using std::string; - - Encodings encodings; namespace { diff --git a/src/ErrorList.cpp b/src/ErrorList.cpp index a9e1212203..1fc64c7315 100644 --- a/src/ErrorList.cpp +++ b/src/ErrorList.cpp @@ -12,11 +12,11 @@ #include "ErrorList.h" +using std::string; + namespace lyx { -using std::string; - ErrorItem::ErrorItem(docstring const & error_, docstring const & description_, int par_id_, pos_type pos_start_, pos_type pos_end_) : error(error_), description(description_), par_id(par_id_), diff --git a/src/Exporter.cpp b/src/Exporter.cpp index 498f8de5f9..5826cb52fc 100644 --- a/src/Exporter.cpp +++ b/src/Exporter.cpp @@ -36,6 +36,10 @@ #include +using std::find; +using std::string; +using std::vector; + namespace lyx { @@ -51,10 +55,6 @@ using support::onlyPath; using support::package; using support::prefixIs; -using std::find; -using std::string; -using std::vector; - namespace Alert = frontend::Alert; namespace fs = boost::filesystem; diff --git a/src/FloatList.cpp b/src/FloatList.cpp index acdc628e7d..1c80fc1b15 100644 --- a/src/FloatList.cpp +++ b/src/FloatList.cpp @@ -13,11 +13,11 @@ #include "FloatList.h" #include "Floating.h" +using std::string; + namespace lyx { -using std::string; - // This class is now mostly finished, except one thing, it is a global // object. This will not do. The user (and layout files) are free to // create floats and modify them to fit into a certain document. So it is diff --git a/src/Floating.cpp b/src/Floating.cpp index 91f87a519e..9da1f1a389 100644 --- a/src/Floating.cpp +++ b/src/Floating.cpp @@ -14,11 +14,11 @@ #include "Floating.h" +using std::string; + namespace lyx { -using std::string; - Floating::Floating() {} diff --git a/src/Font.cpp b/src/Font.cpp index ea1b8c17a3..28ef37464d 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -29,14 +29,6 @@ #include "support/lstrings.h" - -namespace lyx { - -using support::ascii_lowercase; -using support::bformat; -using support::rtrim; -using support::subst; - using std::endl; using std::string; using std::ostream; @@ -46,6 +38,14 @@ using std::pair; using std::strlen; #endif + +namespace lyx { + +using support::ascii_lowercase; +using support::bformat; +using support::rtrim; +using support::subst; + // // Names for the GUI // diff --git a/src/Format.cpp b/src/Format.cpp index e2107a5bdc..90f766bfeb 100644 --- a/src/Format.cpp +++ b/src/Format.cpp @@ -28,6 +28,9 @@ #include +using std::string; +using std::distance; + namespace lyx { @@ -44,9 +47,6 @@ using support::subst; using support::Systemcall; using support::token; -using std::string; -using std::distance; - namespace Alert = frontend::Alert; namespace fs = boost::filesystem; namespace os = support::os; diff --git a/src/FuncRequest.cpp b/src/FuncRequest.cpp index d853ada38e..296728aca2 100644 --- a/src/FuncRequest.cpp +++ b/src/FuncRequest.cpp @@ -16,15 +16,15 @@ #include #include - -namespace lyx { - using std::getline; using std::istringstream; using std::vector; using std::string; +namespace lyx { + + FuncRequest::FuncRequest(Origin o) : action(LFUN_NOACTION), origin(o), x(0), y(0), button_(mouse_button::none) diff --git a/src/Graph.cpp b/src/Graph.cpp index 72b738450f..502ff72944 100644 --- a/src/Graph.cpp +++ b/src/Graph.cpp @@ -15,14 +15,14 @@ #include - -namespace lyx { - using std::vector; using std::reverse; using std::fill; +namespace lyx { + + int Graph::bfs_init(int s, bool clear_visited) { if (s < 0) diff --git a/src/ISpell.cpp b/src/ISpell.cpp index 0c788fac13..73ee01cd1f 100644 --- a/src/ISpell.cpp +++ b/src/ISpell.cpp @@ -34,11 +34,6 @@ # include #endif - -namespace lyx { - -using support::bformat; - using boost::shared_ptr; #ifndef CXX_GLOBAL_CSTD @@ -52,6 +47,10 @@ using std::max; using std::string; +namespace lyx { + +using support::bformat; + namespace { class LaunchIspell : public support::ForkedProcess { diff --git a/src/Importer.cpp b/src/Importer.cpp index 8bd7bccb64..78c2c0969e 100644 --- a/src/Importer.cpp +++ b/src/Importer.cpp @@ -27,6 +27,10 @@ #include "BufferView.h" #include "buffer_funcs.h" +using std::find; +using std::string; +using std::vector; + namespace lyx { @@ -35,10 +39,6 @@ using support::changeExtension; using support::FileName; using support::makeDisplayPath; -using std::find; -using std::string; -using std::vector; - bool Importer::Import(LyXView * lv, FileName const & filename, string const & format, ErrorList & errorList) diff --git a/src/InsetList.cpp b/src/InsetList.cpp index 61d418410c..c34677be07 100644 --- a/src/InsetList.cpp +++ b/src/InsetList.cpp @@ -20,13 +20,13 @@ #include "insets/InsetBranch.h" - -namespace lyx { - using std::endl; using std::lower_bound; +namespace lyx { + + namespace { typedef InsetList::InsetTable Table; diff --git a/src/Intl.cpp b/src/Intl.cpp index fe91d4e7e0..bdf295e655 100644 --- a/src/Intl.cpp +++ b/src/Intl.cpp @@ -17,13 +17,12 @@ #include "debug.h" #include "LyXRC.h" +using std::endl; + namespace lyx { -using std::endl; - - Intl::Intl() : keymap(Intl::PRIMARY), keymapon(lyxrc.use_kbmap), prim_lang(lyxrc.primary_kbmap), sec_lang(lyxrc.secondary_kbmap) diff --git a/src/KeyMap.cpp b/src/KeyMap.cpp index fe3092b509..7c9c4718f6 100644 --- a/src/KeyMap.cpp +++ b/src/KeyMap.cpp @@ -26,15 +26,15 @@ #include +using std::endl; +using std::string; + namespace lyx { using support::FileName; using support::i18nLibFileSearch; -using std::endl; -using std::string; - string const KeyMap::printKeySym(KeySymbol const & key, key_modifier::state mod) diff --git a/src/KeySequence.cpp b/src/KeySequence.cpp index 9f25e9b0ab..84d760c343 100644 --- a/src/KeySequence.cpp +++ b/src/KeySequence.cpp @@ -20,13 +20,13 @@ #include "frontends/KeySymbol.h" - -namespace lyx { - using std::make_pair; using std::string; +namespace lyx { + + FuncRequest const & KeySequence::addkey(KeySymbolPtr key, key_modifier::state mod, key_modifier::state nmod) diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp index 8f6bd510d8..1cbbe2a915 100644 --- a/src/LaTeX.cpp +++ b/src/LaTeX.cpp @@ -35,6 +35,20 @@ #include +using boost::regex; +using boost::smatch; + +#ifndef CXX_GLOBAL_CSTD +using std::sscanf; +#endif + +using std::endl; +using std::getline; +using std::string; +using std::ifstream; +using std::set; +using std::vector; + namespace lyx { @@ -62,21 +76,6 @@ using support::trim; namespace os = support::os; namespace fs = boost::filesystem; -using boost::regex; -using boost::smatch; - - -#ifndef CXX_GLOBAL_CSTD -using std::sscanf; -#endif - -using std::endl; -using std::getline; -using std::string; -using std::ifstream; -using std::set; -using std::vector; - // TODO: in no particular order // - get rid of the call to // BufferList::updateIncludedTeXfiles, this should either diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 22d35ea75c..d5163a09d4 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -31,13 +31,6 @@ #include "frontends/controllers/frontend_helpers.h" -namespace lyx { - -using support::isSGMLFilename; -using support::libFileSearch; -using support::makeRelPath; -using support::onlyPath; - using std::endl; using std::find; using std::string; @@ -46,6 +39,14 @@ using std::ostream; using std::ostringstream; using std::set; + +namespace lyx { + +using support::isSGMLFilename; +using support::libFileSearch; +using support::makeRelPath; +using support::onlyPath; + ///////////////////////////////////////////////////////////////////// // // Strings diff --git a/src/Language.cpp b/src/Language.cpp index 49fd356034..6a517d0985 100644 --- a/src/Language.cpp +++ b/src/Language.cpp @@ -21,13 +21,13 @@ #include "support/FileName.h" - -namespace lyx { - using std::endl; using std::string; +namespace lyx { + + Languages languages; Language const * english_language; Language const * default_language; diff --git a/src/debug.cpp b/src/debug.cpp index 2e532fc7ec..bff728d334 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -20,6 +20,10 @@ #include #include +using std::setw; +using std::string; +using std::ostream; + namespace lyx { @@ -27,10 +31,6 @@ using support::ascii_lowercase; using support::bformat; using support::isStrInt; -using std::setw; -using std::string; -using std::ostream; - namespace { struct error_item { diff --git a/src/factory.cpp b/src/factory.cpp index f46d9c85a8..a30aba41dd 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -68,6 +68,10 @@ #include +using std::auto_ptr; +using std::endl; +using std::string; + namespace lyx { @@ -75,10 +79,6 @@ namespace Alert = frontend::Alert; using support::compare_ascii_no_case; -using std::auto_ptr; -using std::endl; -using std::string; - Inset * createInset(BufferView * bv, FuncRequest const & cmd) { diff --git a/src/gettext.cpp b/src/gettext.cpp index e7b1650736..3235992c08 100644 --- a/src/gettext.cpp +++ b/src/gettext.cpp @@ -17,18 +17,18 @@ #include "support/environment.h" #include "support/lstrings.h" - -namespace lyx { - #ifdef HAVE_LOCALE_H # include #endif -using support::setEnv; - using std::string; +namespace lyx { + +using support::setEnv; + + docstring const _(string const & str) { return getGuiMessages().get(str);