Objections?
? Config ? advdist.diff ? positer.diff ? usingstd.diff Index: src/BufferView.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView.C,v retrieving revision 1.223 diff -u -p -b -r1.223 BufferView.C --- src/BufferView.C 26 Jan 2004 10:13:06 -0000 1.223 +++ src/BufferView.C 27 Jan 2004 16:49:40 -0000 @@ -48,8 +48,10 @@ 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 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(); @@ -478,7 +480,7 @@ void BufferView::putSelectionAt(PosItera 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() con { return pimpl_->cursor_; } - Index: src/cursor.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/cursor.C,v retrieving revision 1.39 diff -u -p -b -r1.39 cursor.C --- src/cursor.C 26 Jan 2004 10:13:08 -0000 1.39 +++ src/cursor.C 27 Jan 2004 16:49:41 -0000 @@ -560,11 +560,11 @@ void region(CursorSlice const & i1, Curs 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); } } Index: src/lyxfind.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxfind.C,v retrieving revision 1.70 diff -u -p -b -r1.70 lyxfind.C --- src/lyxfind.C 26 Jan 2004 17:00:09 -0000 1.70 +++ src/lyxfind.C 27 Jan 2004 16:49:41 -0000 @@ -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: src/paragraph.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph.C,v retrieving revision 1.349 diff -u -p -b -r1.349 paragraph.C --- src/paragraph.C 26 Jan 2004 10:13:09 -0000 1.349 +++ src/paragraph.C 27 Jan 2004 16:49:41 -0000 @@ -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, Ly 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) Index: src/text.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text.C,v retrieving revision 1.525 diff -u -p -b -r1.525 text.C --- src/text.C 26 Jan 2004 10:13:10 -0000 1.525 +++ src/text.C 27 Jan 2004 16:49:42 -0000 @@ -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; @@ -1404,7 +1406,7 @@ ParagraphList::iterator LyXText::getPar( 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 int LyXText::parOffset(ParagraphList::iterator pit) const { - return std::distance(paragraphs().begin(), pit); + return distance(paragraphs().begin(), pit); } Index: src/frontends/controllers/ControlExternal.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlExternal.C,v retrieving revision 1.54 diff -u -p -b -r1.54 ControlExternal.C --- src/frontends/controllers/ControlExternal.C 8 Jan 2004 10:59:49 -0000 1.54 +++ src/frontends/controllers/ControlExternal.C 27 Jan 2004 16:49:42 -0000 @@ -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::getT external::TemplateManager::Templates::const_iterator i1 = external::TemplateManager::get().getTemplates().begin(); - std::advance(i1, i); + advance(i1, i); return i1->second; } Index: src/frontends/controllers/ControlSpellchecker.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlSpellchecker.C,v retrieving revision 1.61 diff -u -p -b -r1.61 ControlSpellchecker.C --- src/frontends/controllers/ControlSpellchecker.C 26 Jan 2004 17:00:09 -0000 1.61 +++ src/frontends/controllers/ControlSpellchecker.C 27 Jan 2004 16:49:42 -0000 @@ -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: src/frontends/qt2/QDocument.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QDocument.C,v retrieving revision 1.66 diff -u -p -b -r1.66 QDocument.C --- src/frontends/qt2/QDocument.C 14 Dec 2003 16:33:53 -0000 1.66 +++ src/frontends/qt2/QDocument.C 27 Jan 2004 16:49:42 -0000 @@ -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 co 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: src/frontends/qt2/QLPopupMenu.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QLPopupMenu.C,v retrieving revision 1.27 diff -u -p -b -r1.27 QLPopupMenu.C --- src/frontends/qt2/QLPopupMenu.C 6 Oct 2003 15:42:50 -0000 1.27 +++ src/frontends/qt2/QLPopupMenu.C 27 Jan 2004 16:49:42 -0000 @@ -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: src/frontends/qt2/QPrefs.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QPrefs.C,v retrieving revision 1.49 diff -u -p -b -r1.49 QPrefs.C --- src/frontends/qt2/QPrefs.C 6 Oct 2003 15:42:51 -0000 1.49 +++ src/frontends/qt2/QPrefs.C 27 Jan 2004 16:49:43 -0000 @@ -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: src/frontends/xforms/XFormsMenubar.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/XFormsMenubar.C,v retrieving revision 1.8 diff -u -p -b -r1.8 XFormsMenubar.C --- src/frontends/xforms/XFormsMenubar.C 6 Oct 2003 15:42:57 -0000 1.8 +++ src/frontends/xforms/XFormsMenubar.C 27 Jan 2004 16:49:43 -0000 @@ -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 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: src/frontends/xforms/XFormsToolbar.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/XFormsToolbar.C,v retrieving revision 1.10 diff -u -p -b -r1.10 XFormsToolbar.C --- src/frontends/xforms/XFormsToolbar.C 6 Oct 2003 15:42:57 -0000 1.10 +++ src/frontends/xforms/XFormsToolbar.C 27 Jan 2004 16:49:43 -0000 @@ -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 cons 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: src/insets/insettabular.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettabular.C,v retrieving revision 1.397 diff -u -p -b -r1.397 insettabular.C --- src/insets/insettabular.C 26 Jan 2004 10:13:12 -0000 1.397 +++ src/insets/insettabular.C 27 Jan 2004 16:49:43 -0000 @@ -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 { @@ -1222,7 +1223,7 @@ bool InsetTabular::movePrevCell(LCursor } -bool InsetTabular::tabularFeatures(LCursor & cur, std::string const & what) +bool InsetTabular::tabularFeatures(LCursor & cur, string const & what) { LyXTabular::Feature action = LyXTabular::LAST_ACTION; @@ -1814,7 +1815,7 @@ FuncStatus InsetTabular::getStatus(strin void InsetTabular::getLabelList(Buffer const & buffer, - std::vector<string> & list) const + vector<string> & list) const { tabular.getLabelList(buffer, list); } Index: src/mathed/math_atom.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_atom.C,v retrieving revision 1.24 diff -u -p -b -r1.24 math_atom.C --- src/mathed/math_atom.C 5 Sep 2003 02:53:05 -0000 1.24 +++ src/mathed/math_atom.C 27 Jan 2004 16:49:43 -0000 @@ -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 if (&at == this) return; MathAtom tmp(at); - std::swap(tmp.nucleus_, nucleus_); + swap(tmp.nucleus_, nucleus_); } Index: src/mathed/math_cursor.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_cursor.C,v retrieving revision 1.382 diff -u -p -b -r1.382 math_cursor.C --- src/mathed/math_cursor.C 20 Jan 2004 14:25:17 -0000 1.382 +++ src/mathed/math_cursor.C 27 Jan 2004 16:49:44 -0000 @@ -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? Index: src/mathed/math_extern.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_extern.C,v retrieving revision 1.64 diff -u -p -b -r1.64 math_extern.C --- src/mathed/math_extern.C 3 Nov 2003 17:47:27 -0000 1.64 +++ src/mathed/math_extern.C 27 Jan 2004 16:49:44 -0000 @@ -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: src/mathed/math_gridinset.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_gridinset.C,v retrieving revision 1.136 diff -u -p -b -r1.136 math_gridinset.C --- src/mathed/math_gridinset.C 26 Jan 2004 10:13:13 -0000 1.136 +++ src/mathed/math_gridinset.C 27 Jan 2004 16:49:44 -0000 @@ -884,7 +884,7 @@ bool MathGridInset::idxDelete(idx_type & // 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 & c // 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: src/mathed/math_hullinset.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_hullinset.C,v retrieving revision 1.108 diff -u -p -b -r1.108 math_hullinset.C --- src/mathed/math_hullinset.C 26 Jan 2004 10:13:13 -0000 1.108 +++ src/mathed/math_hullinset.C 27 Jan 2004 16:49:45 -0000 @@ -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(MathMLStre } -void MathHullInset::infoize(std::ostream & os) const +void MathHullInset::infoize(ostream & os) const { os << "Type: " << type_; } Index: src/support/globbing.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/globbing.C,v retrieving revision 1.3 diff -u -p -b -r1.3 globbing.C --- src/support/globbing.C 8 Jan 2004 10:59:50 -0000 1.3 +++ src/support/globbing.C 27 Jan 2004 16:49:45 -0000 @@ -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 c 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 & 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 co 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); } }
-- Lgb