tostr and lyxstring::find fixes

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@264 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 1999-10-27 23:21:38 +00:00
parent f88f9c8092
commit 25e9d75386
3 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,11 @@
1999-10-28 Lars Gullik Bjønnes <larsbj@lyx.org>
* src/support/lstrings.C (tostr(char)): fix it to handle param as
a character not as a small integer.
* src/support/lyxstring.C (find): removed Assert and added i >=
rep->sz to the first if.
1999-10-27 Lars Gullik Bjønnes <larsbj@lyx.org>
* src/LyXAction.C (LookupFunc): added a workaround for sun

View File

@ -86,7 +86,7 @@ string tostr(unsigned int ui)
string tostr(char c)
{
return tostr(long(c));
return string(1, c);
}
string tostr(bool b)

View File

@ -864,9 +864,8 @@ void lyxstring::insert(iterator p, iterator first, iterator last)
lyxstring::size_type lyxstring::find(lyxstring const & a, size_type i) const
{
if (!rep->sz) return npos;
if (!rep->sz || i >= rep->sz) return npos;
Assert(i < rep->sz);
TestlyxstringInvariant(this);
for (size_type t = i; rep->sz - t >= a.length(); ++t) {