]> git.lyx.org Git - features.git/commitdiff
small unimportant cleanups
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sat, 20 Jul 2002 15:25:41 +0000 (15:25 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sat, 20 Jul 2002 15:25:41 +0000 (15:25 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4723 a592a061-630c-0410-9148-cb99ea01b6c8

15 files changed:
ChangeLog
configure.in
lib/ChangeLog
lib/bind/sciword.bind
lib/bind/sv_menus.bind
po/POTFILES.in
src/ChangeLog
src/buffer.C
src/frontends/xforms/ChangeLog
src/frontends/xforms/Menubar_pimpl.C
src/frontends/xforms/Menubar_pimpl.h
src/graphics/ChangeLog
src/graphics/GraphicsParams.C
src/support/ChangeLog
src/support/lyxstring.C

index 5b55bef07de384ccac7f1e4bb7410a01ad73f7df..dfe35ed479539023d7f9a8ae63a591fd8dba0f54 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2002-07-20  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
+
+       * configure.in: yet another try at the same thing
+
 2002-07-18  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
        * configure.in: try (again) to fix EOF handling in VERSION_INFO
index 410dcf0463238c233b0203ac976f580e0f3774b0..5a141386579fdb1dfa763dbfdd93c599b71a7b65 100644 (file)
@@ -176,10 +176,8 @@ case "$lyx_use_frontend" in
            FRONTEND_LIBS="@XFORMS_IMAGE_LIB@ @XFORMS_LIB@ @XPM_LIB@"
            ;;
        esac
-       FRONTEND_INFO=`cat <<EOF
-    libXpm version:               ${XPM_VERSION}\n\
-    libforms version:             ${XFORMS_VERSION}\n\
-EOF`
+       FRONTEND_INFO="    libXpm version:               ${XPM_VERSION}\n\
+    libforms version:             ${XFORMS_VERSION}\n"
        ;;
   gnome)
     PKG_CHECK_MODULES(GNOME_FRONTEND, gtkmm-2.0 libglademm-2.0)
@@ -274,8 +272,7 @@ LYX_CHECK_DECL_HDRS(mkstemp,[unistd.h stdlib.h])
 ### Some information on what just happened
 real_bindir=`eval "echo \`eval \"echo ${bindir}\"\`"`
 real_datadir=`eval "echo \`eval \"echo ${datadir}/${PACKAGE}\"\`"`
-VERSION_INFO=`cat <<EOF
-Configuration\n\
+VERSION_INFO="Configuration\n\
   Host type:                      ${host}\n\
   Special build flags:           ${lyx_flags}\n\
   C   Compiler:                   ${CC}\n\
@@ -286,8 +283,8 @@ Configuration\n\
   Frontend:                       ${lyx_use_frontend}\n\
 ${FRONTEND_INFO}\
   LyX binary dir:                 ${real_bindir}\n\
-  LyX files dir:                  ${real_datadir}\n\
-EOF`
+  LyX files dir:                  ${real_datadir}\n"
+
 
 AC_SUBST(VERSION_INFO)
 
index 019b959812731cf49ad8fde924e48d239a8bb6f2..14ca89656e50cf9cfa30a5a153de3ceb31351293 100644 (file)
@@ -1,5 +1,8 @@
 2002-07-20  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
+       * bind/sv_menus.bind: 
+       * bind/sciword.bind: remove some cruft
+
        * tex/iletter.cls:
        * layout/iletter.layout:
        * templates/iletter.lyx: removed all traces of the iletter bundle
index 8e995fbaf2c27021558afdda25dbf904fdbb1d84..db4a56ab6c5f08dc95c2fb2b2a9066bd85b54127 100644 (file)
 \bind "M-m l"                  "math-limits"
 \bind "M-m n"                  "math-number"
 \bind "M-m v"                  "accent-vector"
-\bind "M-m space"              "menu-open Math"
 
 # Sciword mnemonics for math editing:
 
 \bind "Escape"                 "cancel"
 \bind "F9"                     "meta-prefix"
 
-#
-# Visible Menu access menu
-#
-
-#\bind "F10 d"                  "menu-open Documents"
-#\bind "F10 e"                  "menu-open Edit"
-#\bind "F10 f"                  "menu-open File"
-#\bind "F10 h"                  "menu-open Help"
-#\bind "F10 i"                  "menu-open Insert"
-#\bind "F10 l"                  "menu-open Layout"
-#\bind "F10 m"                  "menu-open Math"
-#\bind "F10 o"                  "menu-open Options"
-
-
-
-#
-# File menu
-#
-
-#\bind "M-f a"                  "buffer-write-as"
-#\bind "M-f c"                  "buffer-close"
-#\bind "M-f n"                  "buffer-new"
-#\bind "M-f l"                  "file-last"                      # Not yet implemented.
-#\bind "M-f o"                  "file-open"
-#\bind "M-f p"                  "buffer-print"
-#\bind "M-f q"                  "lyx-quit"
-#\bind "M-f r"                  "buffer-update dvi"
-        # Obsolete
-#\bind "M-f s"                  "buffer-write"
-#\bind "M-f t"                  "buffer-update dvi"
-
-#\bind "M-f x"                  "buffer-view dvi"
-#\bind "M-f g"                  "buffer-view ps"
-#\bind "M-f space"              "menu-open File"
-
-
-#
-# Edit menu
-#
-
-##\bind "M-e b"                  "table"                         # Not yet implemented!
-#\bind "M-e c"                  "cut"
-#\bind "M-e e"                  "error-next"
-#\bind "M-e f"                  "find-replace"
-#\bind "M-e k"                  "line-delete-forward"
-#\bind "M-e m"                  "mark-on"
-#\bind "M-e S-M"                "mark-off"
-#\bind "M-e n"                  "note-next"
-#\bind "M-e o"                  "copy"
-#\bind "M-e p"                  "paste"
-#\bind "M-e r"                  "redo"
-#\bind "M-e s"                  "spellchecker"
-#\bind "M-e t"                  "toc-update"
-#\bind "M-e u"                  "undo"
-#\bind "M-e space"              "menu-open Edit"
-
-
-#
-# Layout menu
-#
-
-#\bind "M-l c"                  "layout-character"
-#\bind "M-l p"                  "layout-paragraph"
-#\bind "M-l d"                  "layout-document"
-#\bind "M-l q"                  "layout-quotes"
-#\bind "M-l l"                  "layout-preamble"
-#\bind "M-l e"                  "font-emph"
-#\bind "M-l n"                  "font-smallcaps"
-#\bind "M-l b"                  "font-bold"
-#\bind "M-l t"                  "ert-insert"
-#\bind "M-l v"                  "depth-increment"
-#\bind "M-l space"              "menu-open Layout"
-
-
-
-#
-# Insert menu
-#
-
-#\bind "M-i c"                  "citation-insert"
-#\bind "M-i f"                  "footnote-insert"
-#\bind "M-i h"                  "hfill-insert"
-#\bind "M-i m"                  "marginpar-insert"
-#\bind "M-i n"                  "note-insert"
-#\bind "M-i l"                  "label-insert"
-#\bind "M-i r"                  "reference-insert"
-#\bind "M-i minus"              "hyphenation-point-insert"
-#\bind "M-i apostrophe"         "quote-insert"
-#\bind "M-i S-quotedbl"         "quote-insert"
-#\bind "M-i space"              "menu-open Insert"
-
-
-
-#
-# Options menu
-#
-
-#\bind "M-o f"                  "screen-font-options"           # Not yet implemented!
-#\bind "M-o s"                  "spellcheck-options"            # Not yet implemented!
-#\bind "M-o k"                  "keyboard-options"              # Not yet implemented!
-#\bind "M-o l"                  "latex-options"                 # Not yet implemented!
-#\bind "M-o space"              "menu-open Options"
-
-
-
-#
-# Documents menu
-#
-
-#\bind "M-d p"                  "buffer-previous"
-#\bind "M-d space"              "menu-open Documents"
-
-
-
-#
-# Help menu
-#
-
-#\bind "M-h d"                  "help-documentation"            # Not yet implemented!
-#\bind "M-h o"                  "help-copyright"                # Not yet implemented!
-#\bind "M-h w"                  "help-warranty"                 # Not yet implemented!
-#\bind "M-h c"                  "help-credits"                  # Not yet implemented!
-#\bind "M-h v"                  "help-version"                  # Not yet implemented!
-#\bind "M-h space"              "menu-open Help"
-
 
 
 #
index 07b0c2e41e9bf85dc6674747818706f31ae477a5..d977bab7dad48dadcfc6a7febb077914f9f27877 100644 (file)
 # laddas automatiskt av LyX i stället för menus.bind då LANG=sv
 # Dessa bindningar kan krocka med andra bindningar; betrakta detta som ett
 # prov. Observera att namnen på menyerna måste stämma med de översatta
-# (File/Fil, Edit/Redigera osv.), för "menu-open"
+# (File/Fil, Edit/Redigera osv.), för "menu-open" 
 # Wed Dec  9 17:15:45 GMT+0100 1998, Joacim Persson <sp2joap1@ida.his.se>
 # 
 #
 
-#\bind "F10 f"                 "menu-open Fil"
-#\bind "F10 r"                 "menu-open Redigera"
-#\bind "F10 s"                 "menu-open Stil"
-#\bind "F10 l"                 "menu-open Lägg in"
-#\bind "F10 m"                 "menu-open Matematik"
-#\bind "F10 i"                 "menu-open Inställningar"
-#\bind "F10 d"                 "menu-open Dokument"
-#\bind "F10 h"                 "menu-open Hjälp"
-
-#
-# Fil
-#
-
-#\bind "M-f n"                 "buffer-new"
-#\bind "M-f m"                 "buffer-new-template"
-#\bind "M-f p"                 "file-open"
-#\bind "M-f g"                 "buffer-close"
-#\bind "M-f s"                 "buffer-write"
-#\bind "M-f o"                 "buffer-write-as"
-#\bind "M-f t"                 "buffer-reload"
-#\bind "M-f v"                 "buffer-view dvi"
-#\bind "M-f i"                 "buffer-view ps"
-#\bind "M-f u"                 "buffer-update dvi"
-#\bind "M-f d"                 "buffer-update ps"
-#\bind "M-f k"                 "buffer-print" 
-#\bind "M-f f"                 "buffer-fax"
-#\bind "M-f l"                 "buffer-export latex"
-#\bind "M-f x"                 "buffer-export linuxdoc"
-#\bind "M-f S-T"               "buffer-export ascii"
-#\bind "M-f h"                 "buffer-export html"
-#\bind "M-f S-A"               "buffer-export custom"
-#\bind "M-f a"                 "lyx-quit"
-#\bind "M-f space"             "menu-open Fil" 
-#bind "M-f l"                  "file-last"             # Not yet implemented.
-
-
-#
-# Edit menu
-#
-
-#\bind "M-r a"                 "table"
-#\bind "M-r k"                 "cut"
-#\bind "M-r f"                 "error-next"
-#\bind "M-r s"                 "find-replace"
-#\bind "M-r k"                 "line-delete-forward"
-#\bind "M-r m"                 "mark-on"
-#\bind "M-r S-M"               "mark-off"
-#\bind "M-r t"                 "note-next"
-#\bind "M-r o"                 "copy"
-#\bind "M-r i"                 "paste"
-#\bind "M-r g"                 "redo"
-#\bind "M-r r"                 "spellchecker"
-#\bind "M-r e"                 "buffer-chktex"
-#\bind "M-r h"                 "toc-view"
-#\bind "M-r n"                 "undo"
-#\bind "M-r x"                 "latex-view-log"
-#\bind "M-r space"             "menu-open Redigera" 
-
-
-#
-# Layout menu
-#
-
-#\bind "M-s c"                 "layout-character"
-#\bind "M-s p"                 "layout-paragraph"
-#\bind "M-s d"                 "layout-document"
-#\bind "M-s a"                 "layout-paper"
-#\bind "M-s q"                 "layout-quotes" 
-#\bind "M-s l"                 "layout-preamble" 
-#\bind "M-s e"                 "font-emph" 
-#\bind "M-s n"                 "font-noun" 
-#\bind "M-s b"                 "font-bold" 
-#\bind "M-s t"                 "ert-insert" 
-#\bind "M-s v"                 "depth-increment"
-#\bind "M-s space"             "menu-open Stil"  
-#\bind "M-s i"                 "buffer-itemize-bullets-select"
-
-
-#
-# Insert menu
-#
-
-#\bind "M-i g"                 "graphics-insert"
-#\bind "M-i b"                 "table-insert"
-#\bind "M-i c"                 "buffer-child-insert"
-#\bind "M-i f"                 "footnote-insert"
-#\bind "M-i m"                 "marginpar-insert"
-
-#\bind "M-i minus"             "hyphenation-point-insert"
-#\bind "M-i p"                 "dots-insert"
-#\bind "M-i e"                 "end-of-sentence-period-insert"
-#\bind "M-i q"                 "quote-insert"
-#\bind "M-i apostrophe"                "quote-insert"
-#\bind "M-i S-quotedbl"                "quote-insert"
-#\bind "M-i s h"                       "hfill-insert"
-#\bind "M-i s minus"           "hyphenation-point-insert"
-#\bind "M-i s b"                       "protected-space-insert"
-#\bind "M-i s l"                       "break-line"
-#\bind "M-i s p"                       "dots-insert"
-#\bind "M-i s e"                       "end-of-sentence-period-insert"
-#\bind "M-i s q"                       "quote-insert"
-
-#\bind "M-i a"                 "loa-insert"
-#\bind "M-i t c"                       "toc-insert"
-#\bind "M-i t f"                       "lof-insert"
-#\bind "M-i t t"                       "lot-insert"
-#\bind "M-i t i"                       "index-print"
-#\bind "M-i t b"                       "bibtex-insert"
-#\bind "M-i t a"                       "loa-insert"
-
-#\bind "M-i n"                 "note-insert"
-#\bind "M-i l"                 "label-insert"
-#\bind "M-i r"                 "reference-insert"
-#\bind "M-i i"                 "citation-insert"
-#\bind "M-i d"                 "index-insert"
-
-#\bind "M-l space"             "menu-open Lägg in"  
-
-
-
-#
-# Math menu
-#
-
-#\bind "M-m space"             "menu-open Matematik" 
-
-#
-# Options menu
-#
-
-#bind "M-o s"                  "screen-font-options"   # Not yet implemented!
-#bind "M-o r"                  "spellcheck-options"    # Not yet implemented!
-#bind "M-o t"                  "keyboard-options"      # Not yet implemented!
-#bind "M-o l"                  "latex-options"         # Not yet implemented!
-#\bind "M-i space"             "menu-open Inställningar"  
-
-
-#
-# Documents menu
-#
-# These are now defined in cua or emacs bind files so their "standard"
-# bindings are available. (eg M-d "word-delete-forward" in emacs) ARRae
-#\bind "M-d p"                 "buffer-previous"
-#\bind "M-d space"             "menu-open Dokument"
-
-
-#
-# Help menu
-#
-
-#bind "M-h i"                  "help-introduction"     # Not yet implemented!
-#bind "M-h t"                  "help-tutorial"         # Not yet implemented!
-#bind "M-h u"                  "help-user-guide"       # Not yet implemented!
-#bind "M-h r"                  "help-reference-guide"  # Not yet implemented!
-#bind "M-h h"                  "help-how-do-i-"        # Not yet implemented!
-#bind "M-h c"                  "help-customization"    # Not yet implemented!
-#bind "M-h s"                  "help-special-tools"    # Not yet implemented!
-#bind "M-h k"                  "help-known-bugs"       # Not yet implemented!
-#bind "M-h a"                  "help-latex-config"     # Not yet implemented!
-#bind "M-h o"                  "help-copyright"        # Not yet implemented!
-#bind "M-h e"                  "help-credits"          # Not yet implemented!
-#bind "M-h v"                  "help-version"          # Not yet implemented!
-#\bind "M-h space"             "menu-open Hjälp" 
-
-
 #
 # Font size menu
 #
index b32f886323e99a08ea5fc268c50a3eee614e7eea..532fdf12084e1396fc3dae468d7362c22812da8c 100644 (file)
@@ -40,6 +40,7 @@ src/frontends/qt2/QBibtexDialog.C
 src/frontends/qt2/QCharacter.C
 src/frontends/qt2/QCitation.C
 src/frontends/qt2/QCitationDialog.C
+src/frontends/qt2/QCommandBuffer.C
 src/frontends/qt2/QDocument.C
 src/frontends/qt2/QError.C
 src/frontends/qt2/QERT.C
index 55eb43b94a2318f05559dd95657109162913edbf..68cbe3c5bfb927426d7aee75b0601aaaab1849eb 100644 (file)
@@ -1,3 +1,7 @@
+2002-07-20  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
+
+       * buffer.C (getLists): ws cleanup
+
 2002-07-20  Dekel Tsur  <dekelts@tau.ac.il>
 
        * language.C (read): Use iso8859-1 encoding in latex_lang
index 03f5c042ac8901a8334cc1a02e7dfdf840967bf8..26898f514c7fae9e60d9ad05a1705be577654b35 100644 (file)
@@ -3772,19 +3772,20 @@ Buffer::Lists const Buffer::getLists() const
        string const layout("Caption");
 
        while (par) {
+#ifdef WITH_WARNINGS
 #warning bogus type (Lgb)
+#endif
                char const labeltype = par->layout()->labeltype;
 
                if (labeltype >= LABEL_COUNTER_CHAPTER
                    && labeltype <= LABEL_COUNTER_CHAPTER + params.tocdepth) {
                                // insert this into the table of contents
                        SingleList & item = l["TOC"];
-                       int depth = max(0,
-                                       labeltype -
-                                       textclass.maxcounter());
-                       item.push_back(TocItem(par, depth, par->asString(this, true)));
+                       int depth = max(0, labeltype - textclass.maxcounter());
+                       item.push_back(TocItem(par, depth,
+                                              par->asString(this, true)));
                }
-               // For each paragrph, traverse its insets and look for
+               // For each paragraph, traverse its insets and look for
                // FLOAT_CODE
 
                if (found) {
index 15c172027041c4337ff6499563f564c2de7fc41f..f97cb60f12799a7dd5d46bfecaba4927270c3c25 100644 (file)
@@ -1,3 +1,10 @@
+2002-07-20  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
+
+       * Menubar_pimpl.C (add_toc): avoid crash when there is no document
+       open 
+
+       * Menubar_pimpl.[Ch]: turn owner_ into a XFormsView, to avoid casting
+
 2002-04-28  Herbert Voss  <voss@perce.de>
 
        * FormGraphics.C:
index cf4799c6c9a9b48620496cf4009e0ab7d880892f..415c7509c785c1ab94f1d3e746a7f23db501c815 100644 (file)
@@ -87,7 +87,8 @@ extern "C" {
 
 
 Menubar::Pimpl::Pimpl(LyXView * view, MenuBackend const & mb)
-       : owner_(view), menubackend_(&mb), current_group_(0)
+       : owner_(static_cast<XFormsView*>(view)), menubackend_(&mb),
+         current_group_(0)
 {
        for (MenuBackend::const_iterator menu = menubackend_->begin();
             menu != menubackend_->end() ; ++menu) {
@@ -108,7 +109,7 @@ Menubar::Pimpl::Pimpl(LyXView * view, MenuBackend const & mb)
 
 void Menubar::Pimpl::makeMenubar(Menu const & menu)
 {
-       FL_FORM * form = static_cast<XFormsView *>(owner_)->getForm();
+       FL_FORM * form = owner_->getForm();
        int moffset = 0;
 
        // Create menu frame if there is non yet.
@@ -331,6 +332,8 @@ void add_toc2(int menu, string const & extra_label,
 void Menubar::Pimpl::add_toc(int menu, string const & extra_label,
                             vector<int> & smn, Window win)
 {
+       if (!owner_->buffer())
+               return;
        Buffer::Lists toc_list = owner_->buffer()->getLists();
        Buffer::Lists::const_iterator cit = toc_list.begin();
        Buffer::Lists::const_iterator end = toc_list.end();
@@ -381,7 +384,7 @@ void Menubar::Pimpl::add_toc(int menu, string const & extra_label,
 }
 
 
-int Menubar::Pimpl::create_submenu(Window win, LyXView * view,
+int Menubar::Pimpl::create_submenu(Window win, XFormsView * view,
                                   string const & menu_name,
                                   vector<int> & smn)
 {
@@ -548,7 +551,7 @@ void Menubar::Pimpl::MenuCallback(FL_OBJECT * ob, long button)
 //            << ", item_=" << iteminfo->item_
 //            << ", obj_=" << iteminfo->obj_ << ")" <<endl;
 
-       LyXView * view = iteminfo->pimpl_->owner_;
+       XFormsView * view = iteminfo->pimpl_->owner_;
        MenuItem const * item = iteminfo->item_.get();
 
        if (button == 1) {
@@ -569,8 +572,8 @@ void Menubar::Pimpl::MenuCallback(FL_OBJECT * ob, long button)
                               item->submenu(), submenus);
        if (menu != -1) {
                // place popup
-               fl_setpup_position(static_cast<XFormsView *>(view)->getForm()->x + ob->x,
-                                  static_cast<XFormsView *>(view)->getForm()->y + ob->y + ob->h + 10);
+               fl_setpup_position(view->getForm()->x + ob->x,
+                                  view->getForm()->y + ob->y + ob->h + 10);
                int choice = fl_dopup(menu);
 
                if (button == 1) {
index 85d895bba93c51e69179ef4bde77ef56eaf5c376..94b96b43d57f3315cb8bfaddb1dd815c81b1c3cb 100644 (file)
@@ -30,6 +30,7 @@
 #include <map>
 
 class LyXView;
+class XFormsView;
 
 /** The LyX GUI independent menubar class
   The GUI interface is implemented in the corresponding Menubar_pimpl class.
@@ -53,7 +54,7 @@ public:
        void add_references(int menu, string const & extra_label,
                            std::vector<int> & smn, Window win);
        ///
-       int create_submenu(Window win, LyXView * view,
+       int create_submenu(Window win, XFormsView * view,
                           string const & menuname,
                           std::vector<int> & smn);
 
@@ -64,7 +65,7 @@ private:
        void makeMenubar(Menu const &menu);
 
        ///
-       LyXView * owner_;
+       XFormsView * owner_;
        ///
        MenuBackend const * menubackend_;
        ///
index ddf0b89cea84ec94cd0462cc7202433565d4c018..9f59ce1112c214e033eae68e6686ea1d66450039 100644 (file)
@@ -1,3 +1,7 @@
+2002-07-20  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
+
+       * GraphicsParams.C: include <cstdlib>
+
 2002-07-19  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
        * PreviewLoader.C (startLoading): use LibScriptSearch to find the
index 230b6628123df51a378e0df74fbb021386c431ee..c8e106efa97af76e4dacd6718f210b2416bdf60a 100644 (file)
 #pragma implementation
 #endif
 
+#include <cstdlib>
+
 #include "GraphicsParams.h"
 #include "Lsstream.h"
 #include "lyxlength.h"
 
+using std::abs;
 
 namespace grfx {
 
index 69d62acebfcdfdce72d75562ff233c5a959843d6..efa10968e6f3a62fa88cccfaf1df7ad998a24279 100644 (file)
@@ -1,3 +1,8 @@
+2002-07-20  Dekel Tsur  <dekelts@tau.ac.il>
+
+       * lyxstring.C (operator>>): replace code which works only with
+       _some_ versions of GNU STL with generic one
+
 2002-07-18  Angus Leeming  <leeming@lyx.org>
 
        * FileMonitor.[Ch]: new files. Monitor a file for any change and emit a
index c31fd08bde2d03098cb9151aeb569d498a18482e..869451135e1705fca21a0f48627a925d828d78a1 100644 (file)
@@ -1732,64 +1732,37 @@ void swap(lyxstring & str1, lyxstring & str2)
 
 #include <iostream>
 
-#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);
-       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<size_type>(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)