From: Jean-Marc Lasgouttes Date: Fri, 15 Sep 2000 21:33:03 +0000 (+0000) Subject: A few tweaks (fix new file name, make sstream.h work for gcc 2.8.1) X-Git-Tag: 1.6.10~21989 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=2d23e8313e2ae3af6511e497fa96fd5bd9c409c2;p=features.git A few tweaks (fix new file name, make sstream.h work for gcc 2.8.1) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1024 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/ChangeLog b/ChangeLog index 3501ed3f8c..0fbb20e66b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2000-09-15 Jean-Marc Lasgouttes + + * src/lyxfunc.C: construct correctly the automatic new file + names. + + * src/text2.C (IsStringInText): change type of variable i to shut + off a warning. + + * src/support/sstream.h: do not use namespaces if the compiler + does not support them. + 2000-09-15 Marko Vendelin * src/frontends/gnome/FormCitation.C * src/frontends/gnome/FormCitation.h diff --git a/src/lyxfunc.C b/src/lyxfunc.C index 0fddfde276..53029a4130 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -3222,12 +3222,13 @@ void LyXFunc::MenuNew(bool fromTemplate) } } } else { - s = lyxrc.document_path + "newfile" + tostr(++newfile_number); + s = AddPath(lyxrc.document_path, + "newfile" + tostr(++newfile_number)); FileInfo fi(s); while (bufferlist.exists(s) || fi.readable()) { ++newfile_number; - s = lyxrc.document_path + "newfile" + - tostr(newfile_number); + s = AddPath(lyxrc.document_path, + "newfile" + tostr(newfile_number)); fi.newFile(s); } } diff --git a/src/support/sstream.h b/src/support/sstream.h index 2d11caad69..5a4d5d68fc 100644 --- a/src/support/sstream.h +++ b/src/support/sstream.h @@ -29,8 +29,6 @@ the executable file might be covered by the GNU General Public License. */ and with lyxstring. Dynamic casts have been replaced by static_casts. One fix to avoid unsigned/signed warnings. - Some further changes might be needed to avoid use of namespaces. - Lars Gullik Bjønnes (larsbj@lyx.org) */ @@ -41,8 +39,11 @@ the executable file might be covered by the GNU General Public License. */ #include #include +#ifdef CXX_WORKING_NAMESPACES namespace std { +#endif + class stringbuf : public streambuf { public: @@ -167,7 +168,10 @@ namespace std stringstreambase(s, which) { } }; + +#ifdef CXX_WORKING_NAMESPACES } +#endif inline int stringbuf::sync() { diff --git a/src/text2.C b/src/text2.C index a1ca4733e3..133f26d4ae 100644 --- a/src/text2.C +++ b/src/text2.C @@ -2434,7 +2434,7 @@ bool LyXText::IsStringInText(LyXParagraph * par, string const & str) const { if (par) { - unsigned int i = 0; + LyXParagraph::size_type i = 0; while (pos + i < par->Last() && i < str.length()&& str[i] == par->GetChar(pos + i)) { ++i;