This patch renames one private variable, adds some const, adds a binary_function to a functor and some ws changes. Also some code shuffling to avoid some compiler warnings.
Nothing exciting really, but is stuff from my other more controversial patches that should go in now. Will be committed.
? 1 ? Config ? counter-2.diff ? counter-3.diff ? counter.diff ? deptherror.diff ? deptherror.lyx ? dispatch-2.diff ? dispatch-3.diff ? dispatch-4.diff ? distcheck-2.diff ? distcheck.diff ? end.lyx ? kystskipper-a-1.lyx ? lyxserver-1.diff ? lyxserver-2.diff ? lyxserver-3.diff ? mathwarn-1.diff ? morectrs.lyx ? output ? refenum.lyx ? sockcrash-1.diff ? sstream-1.diff ? stuff-1.diff ? unneeded.diff ? intl/CTAGS Index: src/InsetList.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/InsetList.C,v retrieving revision 1.23 diff -u -p -u -r1.23 InsetList.C --- src/InsetList.C 30 Mar 2004 12:36:30 -0000 1.23 +++ src/InsetList.C 24 Jul 2004 23:53:23 -0000 @@ -46,8 +46,8 @@ InsetList::~InsetList() { // If we begin storing a shared_ptr in the List // this code can be removed. (Lgb) - List::iterator it = list.begin(); - List::iterator end = list.end(); + List::iterator it = list_.begin(); + List::iterator end = list_.end(); for (; it != end; ++it) { delete it->inset; } @@ -57,7 +57,7 @@ InsetList::~InsetList() InsetList::iterator InsetList::insetIterator(pos_type pos) { InsetTable search_elem(pos, 0); - return lower_bound(list.begin(), list.end(), search_elem, + return lower_bound(list_.begin(), list_.end(), search_elem, InsetTablePosLess()); } @@ -65,38 +65,38 @@ InsetList::iterator InsetList::insetIter InsetList::const_iterator InsetList::insetIterator(pos_type pos) const { InsetTable search_elem(pos, 0); - return lower_bound(list.begin(), list.end(), search_elem, + return lower_bound(list_.begin(), list_.end(), search_elem, InsetTablePosLess()); } void InsetList::insert(InsetBase * inset, lyx::pos_type pos) { - List::iterator end = list.end(); + List::iterator end = list_.end(); List::iterator it = insetIterator(pos); if (it != end && it->pos == pos) { lyxerr << "ERROR (InsetList::insert): " << "There is an inset in position: " << pos << endl; } else { - list.insert(it, InsetTable(pos, inset)); + list_.insert(it, InsetTable(pos, inset)); } } void InsetList::erase(pos_type pos) { - List::iterator end = list.end(); + List::iterator end = list_.end(); List::iterator it = insetIterator(pos); if (it != end && it->pos == pos) { delete it->inset; - list.erase(it); + list_.erase(it); } } InsetBase * InsetList::release(pos_type pos) { - List::iterator end = list.end(); + List::iterator end = list_.end(); List::iterator it = insetIterator(pos); if (it != end && it->pos == pos) { InsetBase * tmp = it->inset; @@ -109,7 +109,7 @@ InsetBase * InsetList::release(pos_type InsetBase * InsetList::get(pos_type pos) const { - List::const_iterator end = list.end(); + List::const_iterator end = list_.end(); List::const_iterator it = insetIterator(pos); if (it != end && it->pos == pos) return it->inset; @@ -119,7 +119,7 @@ InsetBase * InsetList::get(pos_type pos) void InsetList::increasePosAfterPos(pos_type pos) { - List::iterator end = list.end(); + List::iterator end = list_.end(); List::iterator it = insetIterator(pos); for (; it != end; ++it) { ++it->pos; @@ -129,7 +129,7 @@ void InsetList::increasePosAfterPos(pos_ void InsetList::decreasePosAfterPos(pos_type pos) { - List::iterator end = list.end(); + List::iterator end = list_.end(); List::iterator it = insetIterator(pos); for (; it != end; ++it) { --it->pos; Index: src/InsetList.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/InsetList.h,v retrieving revision 1.13 diff -u -p -u -r1.13 InsetList.h --- src/InsetList.h 3 Apr 2004 08:36:54 -0000 1.13 +++ src/InsetList.h 24 Jul 2004 23:53:23 -0000 @@ -42,15 +42,15 @@ public: /// ~InsetList(); /// - iterator begin() { return list.begin(); } + iterator begin() { return list_.begin(); } /// - iterator end() { return list.end(); } + iterator end() { return list_.end(); } /// - const_iterator begin() const { return list.begin(); } + const_iterator begin() const { return list_.begin(); } /// - const_iterator end() const { return list.end(); } + const_iterator end() const { return list_.end(); } /// - bool empty() const { return list.empty(); } + bool empty() const { return list_.empty(); } /// iterator insetIterator(lyx::pos_type pos); /// @@ -70,7 +70,7 @@ public: private: /// - List list; + List list_; }; #endif Index: src/buffer.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.C,v retrieving revision 1.579 diff -u -p -u -r1.579 buffer.C --- src/buffer.C 24 Jul 2004 10:55:08 -0000 1.579 +++ src/buffer.C 24 Jul 2004 23:53:23 -0000 @@ -751,7 +751,7 @@ bool Buffer::writeFile(string const & fn if (finfo.exist() && !finfo.writable()) return false; - bool retval; + bool retval = false; if (params().compressed) { gz::ogzstream ofs(fname.c_str()); @@ -852,6 +852,7 @@ void Buffer::makeLaTeXFile(ostream & os, lyxerr[Debug::LATEX] << " Buffer validation done." << endl; texrow().reset(); + // The starting paragraph of the coming rows is the // first paragraph of the document. (Asger) texrow().start(paragraphs().begin()->id(), 0); Index: src/converter.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/converter.C,v retrieving revision 1.98 diff -u -p -u -r1.98 converter.C --- src/converter.C 13 May 2004 11:21:58 -0000 1.98 +++ src/converter.C 24 Jul 2004 23:53:23 -0000 @@ -512,10 +512,10 @@ bool Converters::scanLog(Buffer const & namespace { -class showMessage : public boost::signals::trackable { +class showMessage : public std::unary_function<string, void>, public boost::signals::trackable { public: showMessage(Buffer const & b) : buffer_(b) {}; - void operator()(string const & m) + void operator()(string const & m) const { buffer_.message(m); } Index: src/dociterator.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/dociterator.C,v retrieving revision 1.15 diff -u -p -u -r1.15 dociterator.C --- src/dociterator.C 13 Apr 2004 06:27:26 -0000 1.15 +++ src/dociterator.C 24 Jul 2004 23:53:23 -0000 @@ -3,8 +3,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author unknown - * \author Lars Gullik Bjønnes + * \author André Pönitz * * Full author contact details are available in file CREDITS. */ Index: src/lyxlex_pimpl.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxlex_pimpl.C,v retrieving revision 1.42 diff -u -p -u -r1.42 lyxlex_pimpl.C --- src/lyxlex_pimpl.C 31 Jan 2004 15:30:21 -0000 1.42 +++ src/lyxlex_pimpl.C 24 Jul 2004 23:53:24 -0000 @@ -37,9 +37,11 @@ using std::ostream; namespace { -struct compare_tags : public std::binary_function<keyword_item, keyword_item, int> { +struct compare_tags + : public std::binary_function<keyword_item, keyword_item, bool> { // used by lower_bound, sort and sorted - int operator()(keyword_item const & a, keyword_item const & b) const { + bool operator()(keyword_item const & a, keyword_item const & b) const + { // we use the ascii version, because in turkish, 'i' // is not the lowercase version of 'I', and thus // turkish locale breaks parsing of tags. Index: src/output_linuxdoc.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/output_linuxdoc.C,v retrieving revision 1.6 diff -u -p -u -r1.6 output_linuxdoc.C --- src/output_linuxdoc.C 1 Jun 2004 17:54:33 -0000 1.6 +++ src/output_linuxdoc.C 24 Jul 2004 23:53:24 -0000 @@ -23,9 +23,6 @@ #include <stack> -#ifdef HAVE_LOCALE -#endif - using std::ostream; using std::stack; using std::vector; Index: src/output_plaintext.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/output_plaintext.C,v retrieving revision 1.6 diff -u -p -u -r1.6 output_plaintext.C --- src/output_plaintext.C 17 May 2004 11:28:26 -0000 1.6 +++ src/output_plaintext.C 24 Jul 2004 23:53:24 -0000 @@ -25,9 +25,6 @@ #include "support/gzstream.h" #include "support/lstrings.h" -#ifdef HAVE_LOCALE -#endif - using lyx::support::ascii_lowercase; using lyx::support::compare_ascii_no_case; using lyx::support::compare_no_case; Index: src/text.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text.C,v retrieving revision 1.566 diff -u -p -u -r1.566 text.C --- src/text.C 24 Jul 2004 10:55:13 -0000 1.566 +++ src/text.C 24 Jul 2004 23:53:25 -0000 @@ -1765,7 +1765,7 @@ void LyXText::redoParagraphInternal(par_ void LyXText::redoParagraphs(par_type pit, par_type end) { - for ( ; pit != end; ++pit) + for (; pit != end; ++pit) redoParagraphInternal(pit); updateParPositions(); updateCounters(); @@ -1839,7 +1839,7 @@ bool LyXText::isFirstRow(par_type pit, R void LyXText::getWord(CursorSlice & from, CursorSlice & to, word_location const loc) { - Paragraph & from_par = pars_[from.par()]; + Paragraph const & from_par = pars_[from.par()]; switch (loc) { case lyx::WHOLE_WORD_STRICT: if (from.pos() == 0 || from.pos() == from_par.size() @@ -1895,7 +1895,7 @@ bool LyXText::read(Buffer const & buf, L while (lex.isOK()) { lex.nextToken(); - string token = lex.getString(); + string const token = lex.getString(); if (token.empty()) continue; @@ -2025,8 +2025,8 @@ int LyXText::cursorX(CursorSlice const & int LyXText::cursorY(CursorSlice const & cur) const { - Paragraph & par = getPar(cur.par()); - Row & row = *par.getRow(cur.pos()); + Paragraph const & par = getPar(cur.par()); + Row const & row = *par.getRow(cur.pos()); return yo_ + par.y + row.y_offset() + row.baseline(); } Index: src/text3.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text3.C,v retrieving revision 1.254 diff -u -p -u -r1.254 text3.C --- src/text3.C 24 Jul 2004 10:55:16 -0000 1.254 +++ src/text3.C 24 Jul 2004 23:53:25 -0000 @@ -195,10 +195,10 @@ InsetBase * LyXText::checkInsetHit(int x lyxerr << "checkInsetHit: x: " << x << " y: " << y << endl; lyxerr << " pit: " << pit << " end: " << end << endl; - for ( ; pit != end; ++pit) { + for (; pit != end; ++pit) { InsetList::iterator iit = pars_[pit].insetlist.begin(); InsetList::iterator iend = pars_[pit].insetlist.end(); - for ( ; iit != iend; ++iit) { + for (; iit != iend; ++iit) { InsetBase * inset = iit->inset; #if 0 lyxerr << "examining inset " << inset Index: src/frontends/controllers/ControlErrorList.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlErrorList.C,v retrieving revision 1.24 diff -u -p -u -r1.24 ControlErrorList.C --- src/frontends/controllers/ControlErrorList.C 19 May 2004 15:11:30 -0000 1.24 +++ src/frontends/controllers/ControlErrorList.C 24 Jul 2004 23:53:25 -0000 @@ -68,16 +68,15 @@ void ControlErrorList::goTo(int item) return; } - pos_type const end = std::min(err.pos_end, pit->size()); - pos_type const start = std::min(err.pos_start, end); - pos_type const range = end - start; - // Now make the selection. #ifdef WITH_WARNINGS #warning FIXME (goto error) #warning This should be implemented using an LFUN. (Angus) #endif #if 0 + pos_type const end = std::min(err.pos_end, pit->size()); + pos_type const start = std::min(err.pos_start, end); + pos_type const range = end - start; PosIterator const pos(pit, start); kernel().bufferview()->putSelectionAt(pos, range, false); #endif
-- Lgb