From 3c3c8a968ff03314ea7768d5f58137835a197127 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Sat, 20 Jul 2002 15:18:53 +0000 Subject: [PATCH] try to make VERSION_INFO more portable in configure; apply older patch from dekel for lyxstring::operator>> git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH-1_2_X@4722 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 5 ++++ configure.in | 12 +++----- src/support/ChangeLog | 5 ++++ src/support/lyxstring.C | 65 ++++++++++++----------------------------- status.12x | 4 ++- 5 files changed, 36 insertions(+), 55 deletions(-) diff --git a/ChangeLog b/ChangeLog index 72e829a507..90d89c4eae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-07-20 Jean-Marc Lasgouttes + + * configure.in: try to fix the shell code that builds VERSION_INFO + to be compatible with more shells + 2002-07-04 Kayvan A. Sylvan * configure.in (LYX_USE_FRONTEND): The order of libraries is diff --git a/configure.in b/configure.in index 0d18e30d5f..ec24951e84 100644 --- a/configure.in +++ b/configure.in @@ -201,10 +201,8 @@ case "$lyx_use_frontend" in FRONTEND_LIBS="@XFORMS_IMAGE_LIB@ @XFORMS_LIB@ @XPM_LIB@" ;; esac - FRONTEND_INFO=`cat < + + * lyxstring.C (operator>>): replace code which works only with + _some_ versions of GNU STL with generic one + 2002-06-20 Herbert Voss * filetools.[C]: (readExtFromCOntents) add support for diff --git a/src/support/lyxstring.C b/src/support/lyxstring.C index c31fd08bde..869451135e 100644 --- a/src/support/lyxstring.C +++ b/src/support/lyxstring.C @@ -1732,64 +1732,37 @@ void swap(lyxstring & str1, lyxstring & str2) #include -#if 0 istream & operator>>(istream & is, lyxstring & s) { +#if 0 + // very bad solution + char * nome = new char[1024]; + is >> nome; + lyxstring tmp(nome); + delete [] nome; + if (!tmp.empty()) s = tmp; +#else // better solution int w = is.width(0); s.clear(); char c = 0; + bool skipspace = true; while (is.get(c)) { - if (isspace(c)) { is.putback(c); break; } - s += c; + if (isspace(c)) { + if (!skipspace) { + is.putback(c); + break; + } + } else { + s += c; + skipspace = false; + } if (--w == 1) break; } if (s.empty()) is.setstate(std::ios::failbit); +#endif return is; } -#else -istream & operator>>(istream & is, lyxstring & str) -{ - typedef istream istream_type; - typedef int int_type; - typedef std::streambuf streambuf_type; - typedef string string_type; - typedef string::size_type size_type; - size_type extracted = 0; - -#if 0 - istream_type::sentry cerb(is, false); - if (cerb) { -#else - if (is.ipfx0()) { -#endif - str.erase(); - std::streamsize w = is.width(); - size_type n; - n = w > 0 ? static_cast(w) : str.max_size(); - - int_type const eof = EOF; - streambuf_type * sb = is.rdbuf(); - int_type c = sb->sgetc(); - - while (extracted < n - && c != eof && !isspace(c)) { - str += c; - ++extracted; - c = sb->snextc(); - } - if (c == eof) - is.setstate(std::ios::eofbit); - is.width(0); - } -#if 1 - is.isfx(); -#endif - if (!extracted) - is.setstate(std::ios::failbit); - return is; -} -#endif ostream & operator<<(ostream & o, lyxstring const & s) diff --git a/status.12x b/status.12x index efed47ef9e..816115c9b6 100644 --- a/status.12x +++ b/status.12x @@ -51,10 +51,12 @@ What's new - fix bug where error insets were not correctly removed -- fix some cursor bugs with right-to-ledft languages +- fix some cursor bugs with right-to-left languages - fix Arabic text rendering +- fix a crash when using iso10646-1 encoding + - fix bug where using case changing commands on the last word of a paragraph would change the whole document (without any undo possible!)