]> git.lyx.org Git - lyx.git/commitdiff
std:: changes, stupid stuff
authorLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 28 Jan 2004 16:21:29 +0000 (16:21 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 28 Jan 2004 16:21:29 +0000 (16:21 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8375 a592a061-630c-0410-9148-cb99ea01b6c8

27 files changed:
src/BufferView.C
src/ChangeLog
src/cursor.C
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlExternal.C
src/frontends/controllers/ControlSpellchecker.C
src/frontends/qt2/ChangeLog
src/frontends/qt2/QDocument.C
src/frontends/qt2/QLPopupMenu.C
src/frontends/qt2/QPrefs.C
src/frontends/xforms/ChangeLog
src/frontends/xforms/XFormsMenubar.C
src/frontends/xforms/XFormsToolbar.C
src/insets/ChangeLog
src/insets/insettabular.C
src/lyxfind.C
src/mathed/ChangeLog
src/mathed/math_atom.C
src/mathed/math_atom.h
src/mathed/math_cursor.C
src/mathed/math_extern.C
src/mathed/math_gridinset.C
src/mathed/math_hullinset.C
src/paragraph.C
src/support/ChangeLog
src/support/globbing.C
src/text.C

index 58d13607621a5d9c3fde024928cedd9a15db6330..3de1d1b6038560b7aac5fe63e16eadb2e72a14c6 100644 (file)
 using lyx::support::bformat;
 using lyx::support::MakeAbsPath;
 
+using std::distance;
 using std::find;
 using std::string;
+using std::swap;
 using std::vector;
 
 
@@ -314,7 +316,7 @@ void BufferView::gotoLabel(string const & label)
                if (find(labels.begin(),labels.end(),label) != labels.end()) {
                        cursor().clearSelection();
                        text()->setCursor(
-                               std::distance(text()->paragraphs().begin(), it.getPar()),
+                               distance(text()->paragraphs().begin(), it.getPar()),
                                it.getPos());
                        cursor().resetAnchor();
                        update();
@@ -462,7 +464,7 @@ void BufferView::putSelectionAt(PosIterator const & cur,
                      int length, bool backwards)
 {
        ParIterator par(cur);
-       
+
        cursor().clearSelection();
 
        LyXText * text = par.text(*buffer());
@@ -478,7 +480,7 @@ void BufferView::putSelectionAt(PosIterator const & cur,
                text->setSelectionRange(length);
                cursor().setSelection();
                if (backwards)
-                       std::swap(cursor().cursor_, cursor().anchor_);
+                       swap(cursor().cursor_, cursor().anchor_);
        }
 
        fitCursor();
@@ -496,4 +498,3 @@ LCursor const & BufferView::cursor() const
 {
        return pimpl_->cursor_;
 }
-
index 90e892a4df339a4e5015a6dba1f62b8c8be213c1..eb669090a66e4751586b8b476d3a1f20a180f702 100644 (file)
@@ -1,3 +1,16 @@
+2004-01-28  Lars Gullik Bjonnes  <larsbj@gullik.net>
+
+       * text.C: add using statements for std::advance and std::distance
+
+       * paragraph.C: add using statement for std::distance
+
+       * lyxfind.C: add using statement for std::advance
+
+       * cursor.C (region): remove std:: from swap
+       (openable): use nucleus in stead of operator->
+
+       * BufferView.C: add using statements for std::distance and std::swap
+
 2004-01-27  Lars Gullik Bjonnes  <larsbj@gullik.net>
 
        * iterators.C: Remove the pimple, move the needed structures to
index 5eb17f6bf414b5db68a59d26f6acaf23a11935d4..7f96e6e32908c7e2a00bd3b4621273b5511d75ee 100644 (file)
@@ -560,11 +560,11 @@ void region(CursorSlice const & i1, CursorSlice const & i2,
        c1 = p->col(i1.idx_);
        c2 = p->col(i2.idx_);
        if (c1 > c2)
-               std::swap(c1, c2);
+               swap(c1, c2);
        r1 = p->row(i1.idx_);
        r2 = p->row(i2.idx_);
        if (r1 > r2)
-               std::swap(r1, r2);
+               swap(r1, r2);
 }
 
 }
@@ -835,7 +835,7 @@ bool LCursor::openable(MathAtom const & t)
        // we can't move into anything new during selection
        if (depth() == anchor_.size())
                return false;
-       if (t.operator->() != anchor_[depth()].inset())
+       if (t.nucleus() != anchor_[depth()].inset())
                return false;
 
        return true;
@@ -1212,7 +1212,7 @@ MathHullInset * LCursor::formula() const
 
 
 void LCursor::adjust(pos_type from, int diff)
-{      
+{
        if (pos() > from)
                pos() += diff;
        if (anchor().pos_ > from)
index be5691b826df371507b90501e49d07fc1fe70bc1..9f29b6f72c365e8dfd6ef707dea2a830ce83617a 100644 (file)
@@ -1,3 +1,10 @@
+2004-01-28  Lars Gullik Bjonnes  <larsbj@gullik.net>
+
+       * ControlSpellchecker.C: add using statements for std::advance and
+       std::distance
+
+       * ControlExternal.C: add using statement for std::advance
+
 2004-01-26  Lars Gullik Bjonnes  <larsbj@gullik.net>
 
        * ControlSpellchecker.C (check): use std::distance and
index ac15b57ea91b39469ae22eb221e7232b106ffe63..8e0797deeace05484392a2eee003ff6679380240 100644 (file)
@@ -37,6 +37,7 @@ using lyx::support::FileFilterList;
 using lyx::support::MakeAbsPath;
 using lyx::support::readBB_from_PSFile;
 
+using std::advance;
 using std::vector;
 using std::string;
 
@@ -131,7 +132,7 @@ external::Template ControlExternal::getTemplate(int i) const
        external::TemplateManager::Templates::const_iterator i1
                = external::TemplateManager::get().getTemplates().begin();
 
-       std::advance(i1, i);
+       advance(i1, i);
 
        return i1->second;
 }
index 835aa4c1e9fa76230fa57e9cf7dda8cc9ac0beb8..f5f6c820454d84383fa8118412ecf6638ca5d49e 100644 (file)
@@ -41,6 +41,8 @@
 
 using lyx::support::bformat;
 
+using std::advance;
+using std::distance;
 using std::endl;
 using std::string;
 
@@ -195,8 +197,8 @@ void ControlSpellchecker::check()
        PosIterator const beg = buffer()->pos_iterator_begin();
        PosIterator const end = buffer()->pos_iterator_end();
 
-       int start = std::distance(beg, cur);
-       int const total = start + std::distance(cur, end);
+       int start = distance(beg, cur);
+       int const total = start + distance(cur, end);
 
        if (cur != buffer()->pos_iterator_begin())
                for (; cur != end && isLetter(cur); ++cur, ++start);
@@ -235,9 +237,9 @@ void ControlSpellchecker::check()
 
        if (!word_.word().empty()) {
                int const size = word_.word().size();
-               std::advance(cur, -size);
+               advance(cur, -size);
                bufferview()->putSelectionAt(cur, size, false);
-               std::advance(cur, size);
+               advance(cur, size);
        } else {
                showSummary();
                endSession();
index 0f53c54bad485bce5204344f7abceee76027408a..b7ba44559c38e5a71d714e4a8b34adbac88f613e 100644 (file)
@@ -1,3 +1,12 @@
+2004-01-28  Lars Gullik Bjonnes  <larsbj@gullik.net>
+
+       * QPrefs.C: add using statement for std::distance
+       (findPos): add a typedef for the const_iterator.
+
+       * QLPopupMenu.C: add using statement for std::distance
+
+       * QDocument.C: add using statement for std::distance
+
 2004-01-25  Angus Leeming  <leeming@lyx.org>
 
        * Dialog.C (build): add the "findreplace" dialog.
 
        * QExternalDialog.C (browseClicked):
        * QGraphicsDialog.C (browse_clicked):
-       * QInclude.C (browse): 
+       * QInclude.C (browse):
        changes doe to the name change controller().Browse() to
        controller().browse().
 
 2003-12-15  Ronald Florence <ron@18james.com>
 
        * qfont_loader.C: fixed headers to compile w/o X11
-       
-       * QWorkArea.C (checkAppleEventForMissingParams) 
+
+       * QWorkArea.C (checkAppleEventForMissingParams)
        (handleOpenDocuments): add support for OpenDocuments apple event
 
        * lyx_gui.C (macEventFilter): handle apple events
+
 2004-01-05  Angus Leeming  <leeming@lyx.org>
 
        * FileDialog_private.C (c-tor): invoke convert_brace_glob to convert
@@ -55,7 +64,7 @@
 2003-12-14  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
 
        * QMinipage.[Ch]:
-       * QMinipageDialog.[Ch]: 
+       * QMinipageDialog.[Ch]:
        * ui/QMinipageDialogBase.ui: remove from repository.
        * Dialogs.C:
        * Makefile.am:
 
 2003-11-24  Alfredo Braunstein  <abraunst@lyx.org>
 
-       * QContentpane.[Ch] (trackScrollbar): add 
+       * QContentpane.[Ch] (trackScrollbar): add
        * QWorkarea.C (setScrollbarParams): do not track scrollbar signals
        when manually setting the scrollbar position
 
 
        * lyx_gui.C: {set,remove}_{server,data}socket_callback(): replace
        dummy functions with working ones
-       * socket_callback.[Ch] (): 
+       * socket_callback.[Ch] ():
        new files with a class to connect sockets.
        * Makefile.am: add the above
 
index 89c2de1fd4983fbd92c2868d3c2d6df8899383dd..50919033047c7abef5052d8a7b00864dfa1629d6 100644 (file)
@@ -40,6 +40,7 @@
 using lyx::support::bformat;
 using lyx::support::getVectorFromString;
 
+using std::distance;
 using std::vector;
 using std::string;
 
@@ -404,7 +405,7 @@ findPos(std::vector<A> const & vec, A const & val)
                std::find(vec.begin(), vec.end(), val);
        if (it == vec.end())
                return 0;
-       return std::distance(vec.begin(), it);
+       return distance(vec.begin(), it);
 }
 
 } // namespace anom
index b40a386236bbc9483208deec8b5289d6ff49c8cd..ea7c8cd3275ca97e792c34812f816bf64ba8ca07 100644 (file)
@@ -22,6 +22,7 @@
 
 using lyx::support::subst;
 
+using std::distance;
 using std::make_pair;
 using std::string;
 using std::pair;
@@ -100,7 +101,7 @@ void QLPopupMenu::populate(Menu * menu)
 
                        Funcs::iterator fit =
                                funcs_.insert(funcs_.end(), m->func());
-                       int const index = std::distance(funcs_.begin(), fit);
+                       int const index = distance(funcs_.begin(), fit);
 
                        insertItem(toqstr(getLabel(*m)), index);
                        setItemEnabled(index, !status.disabled());
index 0c0ad9e51c08a49b0a8823260374cea284c1e26f..19d53f58b33800db762b331e8f0dc7b473318426 100644 (file)
@@ -55,6 +55,7 @@
 using lyx::support::compare_no_case;
 using lyx::support::strToDbl;
 
+using std::distance;
 using std::endl;
 using std::setfill;
 using std::setw;
@@ -323,11 +324,12 @@ template<class A>
 typename std::vector<A>::size_type
 findPos(std::vector<A> const & vec, A const & val)
 {
-       typename std::vector<A>::const_iterator it =
-               std::find(vec.begin(), vec.end(), val);
+       typedef typename std::vector<A>::const_iterator Cit;
+
+       Cit it = std::find(vec.begin(), vec.end(), val);
        if (it == vec.end())
                return 0;
-       return std::distance(vec.begin(), it);
+       return distance(vec.begin(), it);
 }
 
 void setComboxFont(QComboBox * cb, string const & family, string const & foundry)
index 0b5707089e5309dd74509487b59a01821b329cdc..a274c1051c7c1c3daf86792e81fdd2bc1436b1fd 100644 (file)
@@ -1,3 +1,9 @@
+2004-01-28  Lars Gullik Bjonnes  <larsbj@gullik.net>
+
+       * XFormsToolbar.C: add using statement for std::distance
+
+       * XFormsMenubar.C: add using statement for std::distance
+
 2004-01-25  Angus Leeming  <leeming@lyx.org>
 
        * Dialog.C (build): add the "findreplace" dialog.
@@ -14,7 +20,7 @@
 
        * QExternalDialog.C (browseClicked):
        * QGraphicsDialog.C (browse_clicked):
-       * QInclude.C (browse): 
+       * QInclude.C (browse):
        changes doe to the name change controller().Browse() to
        controller().browse().
 
index d737f499fb0d4ef02c0d8c72c1d1211369b8fbb0..fec33840e8b697b3b9cc71d1cd491a99f85908e3 100644 (file)
@@ -28,6 +28,7 @@
 using lyx::support::lowercase;
 using lyx::support::subst;
 
+using std::distance;
 using std::endl;
 using std::for_each;
 using std::string;
@@ -296,7 +297,7 @@ int XFormsMenubar::create_submenu(Window win, XFormsView * view,
                                Funcs::iterator fit =
                                        funcs.insert(funcs.end(), item.func());
                                int const action_count =
-                                       std::distance(funcs.begin(), fit);
+                                       distance(funcs.begin(), fit);
 
                                label += "%x" + tostr(action_count + action_offset);
                                lyxerr[Debug::GUI] << "Action: \""
index 7b6bda4e57bb959d448bbc9ff981c759ef2fbc07..2025257c26709135f7e7218383d5cb3f353a86c3 100644 (file)
@@ -30,6 +30,7 @@
 #include "lyx_forms.h"
 #include "combox.h"
 
+using std::distance;
 using std::endl;
 using std::string;
 
@@ -330,7 +331,7 @@ void XFormsToolbar::add(FuncRequest const & func, string const & tooltip)
                                      NorthWestGravity);
 
                Funcs::iterator fit = funcs.insert(funcs.end(), func);
-               int const index = std::distance(funcs.begin(), fit);
+               int const index = distance(funcs.begin(), fit);
                fl_set_object_callback(obj, C_Toolbar_ToolbarCB, index);
                // Remove the blue feedback rectangle
                fl_set_pixmapbutton_focus_outline(obj, 0);
index 0636925b45bc11f7a9c6639baa5fc816a5e92220..c8b39dfca5ba6471c7707fa97c46c8056056bbe1 100644 (file)
@@ -1,3 +1,8 @@
+2004-01-28  Lars Gullik Bjonnes  <larsbj@gullik.net>
+
+       * insettabular.C: add using statement for std::vector, remove
+       std:: where using was already used.
+
 2004-01-19  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
 
        * insetgraphics.C, insetinclude.C: use runparams.nice instead of
index b676d8d66d0a8e52f74c21263581e7befb8af7c4..83b8483d498d519308ce0bb2d279c8b4609ced99 100644 (file)
@@ -47,14 +47,15 @@ using lyx::support::ltrim;
 using lyx::support::strToInt;
 using lyx::support::strToDbl;
 
+using std::auto_ptr;
 using std::endl;
 using std::max;
-using std::swap;
 using std::string;
-using std::auto_ptr;
 using std::istringstream;
 using std::ostream;
 using std::ostringstream;
+using std::swap;
+using std::vector;
 
 
 namespace {
@@ -506,7 +507,7 @@ InsetTabular::priv_dispatch(LCursor & cur, FuncRequest const & cmd)
        }
 
        if (!tablemode) {
-               
+
                int cell = cur.idx();
                lyxerr << "# InsetTabular::dispatch: A " << cur << endl;
                result = tabular.getCellInset(cell).dispatch(cur, cmd);
@@ -692,7 +693,7 @@ tabular.column_of_cell(cur.idx()))
                                clearSelection();
                        int column = tabular.column_of_cell(cur.idx());
                        if (yo_ < 0) {
-                               cur.bv().scrollDocView( 
+                               cur.bv().scrollDocView(
                                        cur.bv().top_y() - cur.bv().painter().paperHeight());
                                if (yo_ > 0)
                                        cur.idx() = column;
@@ -1222,7 +1223,7 @@ bool InsetTabular::movePrevCell(LCursor & cur)
 }
 
 
-bool InsetTabular::tabularFeatures(LCursor & cur, std::string const & what)
+bool InsetTabular::tabularFeatures(LCursor & cur, string const & what)
 {
        LyXTabular::Feature action = LyXTabular::LAST_ACTION;
 
@@ -1645,7 +1646,7 @@ FuncStatus InsetTabular::getStatus(string const & what, int actcell) const
                string const tmp = tabularFeature[i].feature;
                if (tmp == what.substr(0, tmp.length())) {
                        //if (!compare(tabularFeatures[i].feature.c_str(), what.c_str(),
-                       //   tabularFeatures[i].feature.length())) 
+                       //   tabularFeatures[i].feature.length()))
                        action = tabularFeature[i].action;
                        break;
                }
@@ -1814,7 +1815,7 @@ FuncStatus InsetTabular::getStatus(string const & what, int actcell) const
 
 
 void InsetTabular::getLabelList(Buffer const & buffer,
-                               std::vector<string> & list) const
+                               vector<string> & list) const
 {
        tabular.getLabelList(buffer, list);
 }
index 043a45d7538048bb299585a0e737346ce37ddab3..528ca0b3ccf2a63929176282e6ef41c42d9b583c 100644 (file)
@@ -39,6 +39,7 @@ using lyx::support::lowercase;
 using lyx::support::uppercase;
 using lyx::support::split;
 
+using std::advance;
 using std::ostringstream;
 using std::string;
 
@@ -345,7 +346,7 @@ int replaceAll(BufferView * bv,
                        = cur.pit()->getFontSettings(buf.params(), pos);
                int striked = ssize - cur.pit()->erase(pos, pos + ssize);
                cur.pit()->insert(pos, replacestr, font);
-               std::advance(cur, rsize + striked);
+               advance(cur, rsize + striked);
                ++num;
        }
 
index cdd54a88ccb41feb9ea7b1a0d899fb70cfe00349..4ef566a1be3dc2d5ef0a679ae69aaacf7c394526 100644 (file)
@@ -1,3 +1,19 @@
+2004-01-28  Lars Gullik Bjonnes  <larsbj@gullik.net>
+
+       * math_hullinset.C: add using statements for std::ostream,
+       std::swap and std::vector
+
+       * math_gridinset.C (idxDelete): remove std:: from swap.
+       (priv_dispatch): ditto
+
+       * math_extern.C: add using statement for std::swap and std::vector
+
+       * math_cursor.C: remove std:: from string
+       (openable): use nucleus instead of operator->
+
+       * math_atom.h: add a const variant of nucleus
+
+       * math_atom.C: add using statement for std::swap
 
 2004-01-15  André Pönitz  <poenitz@gmx.net>
 
@@ -6,7 +22,7 @@
 
 2004-01-15  André Pönitz  <poenitz@gmx.net>
 
-       * *.[Ch]: change signature of priv_dispatch to prepare 
+       * *.[Ch]: change signature of priv_dispatch to prepare
        inset unification
 
 2003-12-15  Ronald Florence <ron@18james.com>
@@ -17,7 +33,7 @@
 
        * math_pos.[Ch]: remove (it's now cursor_slice.[Ch])
 
-       * Makefile.am: 
+       * Makefile.am:
        * math_cursor.[Ch]:
        * math_iterator.[Ch]: adjust
 
@@ -36,7 +52,7 @@
 2003-11-10  André Pönitz  <poenitz@gmx.net>
 
        * formula.C:
-       * formulabase.C:  adjust to removed inset locking 
+       * formulabase.C:  adjust to removed inset locking
 
 2003-11-05  José Matos  <jamatos@lyx.org>
 
index c77a1512eef3609eb3d6905587f0cb7fecb0963d..bd5cda75be3aec9bbe5a9d2be7819ba77e7e862a 100644 (file)
@@ -13,6 +13,7 @@
 #include "math_atom.h"
 #include "math_inset.h"
 
+using std::swap;
 
 
 MathAtom::MathAtom()
@@ -38,7 +39,7 @@ void MathAtom::operator=(MathAtom const & at)
        if (&at == this)
                return;
        MathAtom tmp(at);
-       std::swap(tmp.nucleus_, nucleus_);
+       swap(tmp.nucleus_, nucleus_);
 }
 
 
index 9e02b7a8d30883d17d865cb1a9154433a66681a6..751735e4a2c4bfa58cc0cb5430c3ba9d6cc9576a 100644 (file)
@@ -58,6 +58,7 @@ public:
        void operator=(MathAtom const &);
        /// access to the inset (checked with gprof)
        MathInset       * nucleus()       { return nucleus_; }
+       MathInset const * nucleus() const { return nucleus_; }
        /// access to the inset
        MathInset const * operator->() const { return nucleus_; }
 
index cd65ed5b798c3da05f0260e83ce0d8230cd66d93..b8766d4f1a7c07f6f6bdac124288b20cdd2ebc30 100644 (file)
@@ -78,7 +78,7 @@ namespace mathcursor {
        void eraseSelection(LCursor & cur);
 
        /// the name of the macro we are currently inputting
-       std::string macroName(LCursor & cur);
+       string macroName(LCursor & cur);
        /// where in the curent cell does the macro name start?
        difference_type macroNamePos(LCursor & cur);
        /// can we enter the inset?
@@ -184,7 +184,7 @@ bool openable(MathAtom const & t, bool sel)
                // we can't move into anything new during selection
                if (cur.depth() == Anchor_.size())
                        return false;
-               if (t.operator->() != Anchor_[cur.depth()].asMathInset())
+               if (t.nucleus() != Anchor_[cur.depth()].asMathInset())
                        return false;
        }
 #else
@@ -662,7 +662,7 @@ InsetFormulaBase * formula()
 
 
 void adjust(LCursor & cur, pos_type from, difference_type diff)
-{      
+{
        if (cur.pos() > from)
                cur.pos() += diff;
        if (cur.anchor().pos_ > from)
index ab7e39c904e03d219b88a6e8d6c12663fc536bed..78dcf35092d3125db917b09073f5b4135b502107 100644 (file)
@@ -51,6 +51,8 @@ using std::auto_ptr;
 using std::istringstream;
 using std::ostream;
 using std::ostringstream;
+using std::swap;
+using std::vector;
 
 
 ostream & operator<<(ostream & os, MathArray const & ar)
@@ -290,7 +292,7 @@ void splitScripts(MathArray & ar)
                // create extra script inset and move superscript over
                MathScriptInset * p = ar[i].nucleus()->asScriptInset();
                auto_ptr<MathScriptInset> q(new MathScriptInset(true));
-               std::swap(q->up(), p->up());
+               swap(q->up(), p->up());
                p->removeScript(true);
 
                // insert new inset behind
@@ -982,7 +984,7 @@ namespace {
                        expr.insert(pos,  "*");
                }
 
-               std::vector<string> tmp = getVectorFromString(out, "$$");
+               vector<string> tmp = getVectorFromString(out, "$$");
                if (tmp.size() < 2)
                        return MathArray();
 
index 9909ee8ff1fc6083db5f357951aa73df3856487d..2dbfd74a2877fb2135cd4e39118b3288c929c967 100644 (file)
@@ -884,7 +884,7 @@ bool MathGridInset::idxDelete(idx_type & idx)
 
        // move cells if necessary
        for (idx_type i = index(row(idx), 0); i < idx; ++i)
-               std::swap(cell(i), cell(i + ncols()));
+               swap(cell(i), cell(i + ncols()));
 
        delRow(row(idx));
 
@@ -1087,11 +1087,11 @@ MathGridInset::priv_dispatch(LCursor & cur, FuncRequest const & cmd)
 
                        // split line
                        for (col_type c = col(cur.idx()) + 1; c < ncols(); ++c)
-                               std::swap(cell(index(r, c)), cell(index(r + 1, c)));
+                               swap(cell(index(r, c)), cell(index(r + 1, c)));
 
                        // split cell
                        splitCell(cur);
-                       std::swap(cell(cur.idx()), cell(cur.idx() + ncols() - 1));
+                       swap(cell(cur.idx()), cell(cur.idx() + ncols() - 1));
                        if (cur.idx() > 0)
                                --cur.idx();
                        cur.idx() = cur.lastpos();
index 781cfd08b42a997053d2dd6283372183529fefa5..64c960fb3945e98d1b54eff203877ba22399d4a3 100644 (file)
@@ -42,8 +42,11 @@ using std::max;
 using std::string;
 using std::auto_ptr;
 using std::istringstream;
+using std::ostream;
 using std::ostringstream;
 using std::pair;
+using std::swap;
+using std::vector;
 
 
 namespace {
@@ -319,8 +322,7 @@ bool MathHullInset::display() const
 }
 
 
-void MathHullInset::getLabelList(Buffer const &,
-                                std::vector<string> & labels) const
+void MathHullInset::getLabelList(Buffer const &, vector<string> & labels) const
 {
        for (row_type row = 0; row < nrows(); ++row)
                if (!label_[row].empty() && nonum_[row] != 1)
@@ -449,8 +451,8 @@ void MathHullInset::swapRow(row_type row)
                return;
        if (row + 1 == nrows())
                --row;
-       std::swap(nonum_[row], nonum_[row + 1]);
-       std::swap(label_[row], label_[row + 1]);
+       swap(nonum_[row], nonum_[row + 1]);
+       swap(label_[row], label_[row + 1]);
        MathGridInset::swapRow(row);
 }
 
@@ -690,7 +692,7 @@ void MathHullInset::mathmlize(MathMLStream & os) const
 }
 
 
-void MathHullInset::infoize(std::ostream & os) const
+void MathHullInset::infoize(ostream & os) const
 {
        os << "Type: " << type_;
 }
index 1dec5968edb708a13aa3997c57942645e511ab28..ce19157b87108c685ea68be1b907441cafd8d653 100644 (file)
@@ -55,6 +55,7 @@ using lyx::pos_type;
 using lyx::support::contains;
 using lyx::support::subst;
 
+using std::distance;
 using std::endl;
 using std::list;
 using std::stack;
@@ -518,7 +519,7 @@ void Paragraph::setFont(pos_type pos, LyXFont const & font)
                if (it->pos() >= pos)
                        break;
        }
-       unsigned int i = std::distance(beg, it);
+       unsigned int i = distance(beg, it);
        bool notfound = (it == endit);
 
        if (!notfound && pimpl_->fontlist[i].font() == font)
@@ -712,7 +713,7 @@ InsetBibitem * Paragraph::bibitem() const
 namespace {
 
 // paragraphs inside floats need different alignment tags to avoid
-// unwanted space 
+// unwanted space
 
 bool noTrivlistCentering(UpdatableInset const * inset)
 {
@@ -1338,7 +1339,7 @@ void Paragraph::simpleDocBookOnePar(Buffer const & buf,
        int char_line_count = depth;
        bool label_closed = true;
        bool para_closed = true;
-       
+
        if (style->latextype == LATEX_ITEM_ENVIRONMENT) {
                string ls = "";
                Counters & counters = buf.params().getLyXTextClass().counters();
@@ -1351,11 +1352,11 @@ void Paragraph::simpleDocBookOnePar(Buffer const & buf,
                        if (!defaultstyle->latexparam().empty()) {
                                counters.step("para");
                                ls = tostr(counters.value("para"));
-                               ls = " id=\"" 
+                               ls = " id=\""
                                        + subst(defaultstyle->latexparam(), "#", ls) + '"';
                        }
-                       os << "<" << style->itemtag() << ">\n" 
-                          << string(depth, ' ') << "<" 
+                       os << "<" << style->itemtag() << ">\n"
+                          << string(depth, ' ') << "<"
                           << defaultstyle->latexname() << ls << ">\n";
                        para_closed = false;
                }
@@ -1408,8 +1409,8 @@ void Paragraph::simpleDocBookOnePar(Buffer const & buf,
                                        os << str;
                        } else if (!style->labeltag().empty() && !label_closed) {
                                ++char_line_count;
-                               os << "\n</" << style->labeltag() << "><" 
-                                  << style->itemtag() << "><" 
+                               os << "\n</" << style->labeltag() << "><"
+                                  << style->itemtag() << "><"
                                   << defaultstyle->latexname() << ">";
                                label_closed = true;
                                para_closed = false;
@@ -1431,12 +1432,12 @@ void Paragraph::simpleDocBookOnePar(Buffer const & buf,
        // resets description flag correctly
        if (!label_closed) {
                // <term> not closed...
-               os << "</" << style->labeltag() << ">\n<" 
-                  << style->itemtag() << "><" 
+               os << "</" << style->labeltag() << ">\n<"
+                  << style->itemtag() << "><"
                   << defaultstyle->latexname() << ">&nbsp;";
        }
        if (!para_closed) {
-               os << "\n" << string(depth, ' ') << "</" 
+               os << "\n" << string(depth, ' ') << "</"
                   << defaultstyle->latexname() << ">\n";
        }
        if (style->free_spacing)
index 0a65f4b3b712b8a051731d2132879919c70d6d61..5f0eaee7d0084f77276faeed18765d2f6261d00a 100644 (file)
@@ -1,3 +1,8 @@
+2004-01-28  Lars Gullik Bjonnes  <larsbj@gullik.net>
+
+       * globbing.C: add using statement for std::distance, remove std::
+       from string.
+
 2004-01-08  Angus Leeming  <leeming@lyx.org>
 
        * globbing.[Ch]: add a new class FileFilterList to parse a Qt-style
 2003-12-14  Ronald Florence <ron@18james.com>
 
        * tostr.[hC]: added tostr(long unsigned int i).
-       
+
        * path_defines.C.in: determine system directory and set PATH for
        relocatable LyX/Mac bundle.
-       
+
 2004-01-06  Angus Leeming  <leeming@lyx.org>
 
        * globbing.C (glob): compilation fix for cygwin.
index 61f10d1edf27c4100e396c08855ebb2de9594898..b0d16e88e46e39772e7545478e656909de9240c5 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "glob.h"
 
+using std::distance;
 using std::ostringstream;
 using std::string;
 using std::vector;
@@ -65,7 +66,7 @@ string const convert_brace_glob(string const & glob)
                pattern += boost::regex_merge(tail, block_re, fmt);
 
                // Increment the iterator to the end of the match.
-               it += std::distance(it, what[0].second);
+               it += distance(it, what[0].second);
        }
 
        return pattern;
@@ -86,7 +87,7 @@ vector<string> const glob(string const & pattern, int flags)
 
 
 vector<string> const expand_globs(string const & mask,
-                                 std::string const & directory)
+                                 string const & directory)
 {
        typedef boost::tokenizer<boost::char_separator<char> > Tokenizer;
        boost::char_separator<char> const separator(" ");
@@ -134,7 +135,7 @@ FileFilterList::FileFilterList(string const & qt_style_filter)
                parse_filter(string(what[-1].first, what[-1].second));
 
                // Increment the iterator to the end of the match.
-               it += std::distance(it, what[0].second);
+               it += distance(it, what[0].second);
        }
 }
 
index 24b65382f520de705687c119d7e225412c5020a9..a5f41923b8bbc9a14356aa544acd6f3dee056668 100644 (file)
@@ -58,6 +58,8 @@ using lyx::support::contains;
 using lyx::support::lowercase;
 using lyx::support::uppercase;
 
+using std::advance;
+using std::distance;
 using std::max;
 using std::endl;
 using std::string;
@@ -344,7 +346,7 @@ int LyXText::rightMargin(Paragraph const & par) const
 {
        LyXTextClass const & tclass = bv()->buffer()->params().getLyXTextClass();
 
-       return 
+       return
                RIGHT_MARGIN
                + font_metrics::signedWidth(tclass.rightmargin(),
                                       tclass.defaultfont())
@@ -1404,7 +1406,7 @@ ParagraphList::iterator LyXText::getPar(int par) const
        BOOST_ASSERT(par >= 0);
        BOOST_ASSERT(par < int(paragraphs().size()));
        ParagraphList::iterator pit = paragraphs().begin();
-       std::advance(pit, par);
+       advance(pit, par);
        return pit;
 }
 
@@ -1543,7 +1545,7 @@ string LyXText::selectionAsString(Buffer const & buffer, bool label) const
 
 int LyXText::parOffset(ParagraphList::iterator pit) const
 {
-       return std::distance(paragraphs().begin(), pit);
+       return distance(paragraphs().begin(), pit);
 }
 
 
@@ -1773,7 +1775,7 @@ void LyXText::write(Buffer const & buf, std::ostream & os) const
 
 
 bool LyXText::read(Buffer const & buf, LyXLex & lex)
-{      
+{
        static Change current_change;
 
        bool the_end_read = false;