mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Another fix for lyxstring::rfind
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1311 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
1c2ba9dd5c
commit
7a837013fd
@ -1,3 +1,9 @@
|
||||
2001-01-10 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||
|
||||
* src/support/lyxstring.C (rfind): better fix (from Dekel).
|
||||
|
||||
* src/tabular.h: add a couple std:: qualifiers.
|
||||
|
||||
2001-01-10 Lars Gullik Bjønnes <larsbj@lyx.org>
|
||||
|
||||
* src/support/lyxstring.C (rfind): also test the first char in the
|
||||
|
@ -23,6 +23,8 @@
|
||||
|
||||
#include "LAssert.h"
|
||||
|
||||
#include "debug.h"
|
||||
|
||||
using std::min;
|
||||
using std::istream;
|
||||
using std::ostream;
|
||||
@ -1027,11 +1029,13 @@ lyxstring::size_type lyxstring::rfind(value_type c, size_type i) const
|
||||
{
|
||||
TestlyxstringInvariant(this);
|
||||
|
||||
size_type ii = min(rep->sz - 1, i);
|
||||
for (size_type t = ii; t >= 0; --t) {
|
||||
if (rep->s[t] == c) return t;
|
||||
}
|
||||
return npos;
|
||||
size_type const sz = rep->sz;
|
||||
if (sz < 1) return npos;
|
||||
size_type ii = min(sz - 1, i);
|
||||
do {
|
||||
if (rep->s[ii] == c) return ii;
|
||||
} while (ii-- > 0);
|
||||
return npos;
|
||||
}
|
||||
|
||||
|
||||
|
@ -455,10 +455,10 @@ private: //////////////////////////////////////////////////////////////////
|
||||
typedef std::vector<columnstruct> column_vector;
|
||||
|
||||
///
|
||||
void ReadNew(Buffer const * buf, istream & is,
|
||||
void ReadNew(Buffer const * buf, std::istream & is,
|
||||
LyXLex & lex, string const & l);
|
||||
///
|
||||
void ReadOld(Buffer const * buf, istream & is,
|
||||
void ReadOld(Buffer const * buf, std::istream & is,
|
||||
LyXLex & lex, string const & l);
|
||||
///
|
||||
int rows_;
|
||||
|
Loading…
Reference in New Issue
Block a user