]> git.lyx.org Git - lyx.git/commitdiff
various fixes
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 30 Jul 2001 10:50:37 +0000 (10:50 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 30 Jul 2001 10:50:37 +0000 (10:50 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2387 a592a061-630c-0410-9148-cb99ea01b6c8

14 files changed:
po/POTFILES.in
src/BufferView_pimpl.C
src/ChangeLog
src/bufferlist.h
src/commandtags.h
src/frontends/ChangeLog
src/frontends/Liason.C
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlPrint.C
src/insets/ChangeLog
src/insets/insetfoot.h
src/insets/insetgraphicsParams.C
src/lyxtext.h
src/text2.C

index 0497eaf198862cd76ffd2db1403b347c3216e0f0..a7c774ba2ef5668685bb0e1f98c9074b0e220ccf 100644 (file)
@@ -9,6 +9,7 @@ src/converter.C
 src/CutAndPaste.C
 src/debug.C
 src/exporter.C
+src/ext_l10n.h
 src/figureForm.C
 src/figure_form.C
 src/FontLoader.C
@@ -24,6 +25,7 @@ src/frontends/controllers/ControlPreamble.C
 src/frontends/controllers/ControlPrint.C
 src/frontends/controllers/ControlSearch.C
 src/frontends/controllers/ControlSpellchecker.C
+src/frontends/controllers/ControlThesaurus.C
 src/frontends/controllers/helper_funcs.C
 src/frontends/gnome/FormCitation.C
 src/frontends/gnome/FormIndex.C
index 79205be07dd1714871d839dc9e51509d8a4729eb..8eff02dd2c0f27e06b89f4ed3a589e32d47b81c5 100644 (file)
@@ -2984,19 +2984,11 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
                LyXText * lt = bv_->getLyXText();
                
                if (argument.empty()) {
-                       // Get word or selection
-                       lt->selectWordWhenUnderCursor(bv_, LyXText::PREVIOUS_WORD);
-                       
-                       if (!lt->selection.set()) {
-                               owner_->message(_("Nothing to index!"));
-                               break;
-                       }
-                       if (lt->selection.start.par() != lt->selection.end.par()) {
-                               owner_->message(_("Cannot index more than one paragraph!"));
+                       string const idxstring(bv_->getLyXText()->getStringToIndex(bv_));
+                       if (!idxstring.empty()) 
+                               p.setContents(idxstring);
+                       else
                                break;
-                       }
-                       
-                       p.setContents(lt->selectionAsString(buffer_));
                } else {
                        p.setContents(argument);
                }
@@ -3020,26 +3012,18 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
                    
        case LFUN_INDEX_INSERT_LAST:
        {
-               LyXText * lt = bv_->getLyXText();
-               // Get word or selection
-               lt->selectWordWhenUnderCursor(bv_, LyXText::PREVIOUS_WORD);
-
-               if (!lt->selection.set()) {
-                       owner_->message(_("Nothing to index!"));
-                       break;
-               }
-               if (lt->selection.start.par() != lt->selection.end.par()) {
-                       owner_->message(_("Cannot index more than one paragraph!"));
-                       break;
+               string const idxstring(bv_->getLyXText()->getStringToIndex(bv_));
+               if (!idxstring.empty()) {
+                       owner_->message(_("Word `")
+                                       + idxstring + _(("' indexed.")));
+                       InsetCommandParams p("index", idxstring);
+                       InsetIndex * inset = new InsetIndex(p);
+                       
+                       if (!insertInset(inset))
+                               delete inset;
+                       else
+                               updateInset(inset, true);
                }
-               
-               InsetCommandParams p("index", lt->selectionAsString(buffer_));
-               InsetIndex * inset = new InsetIndex(p);
-
-               if (!insertInset(inset))
-                       delete inset;
-               else
-                       updateInset(inset, true);
        }
        break;
 
index 6eebafc324fd1da76b44a72cb18d9e8f791d83b9..138f1c71a013f29b3524385d9c247d706dddf516 100644 (file)
@@ -1,3 +1,17 @@
+2001-07-30  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * BufferView_pimpl.C (Dispatch): improve handling of
+       LFUN_INDEX_INSERT_LAST and LFUN_INDEX_CREATE
+
+       * commandtags.h: #include lyxfont.h here temporarily to avoid
+       keybinding bug.
+
+       * bufferlist.h: include LString.h here.
+
+2001-07-27  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * text2.C (getStringToIndex): new method.
+
 2001-07-29  Asger Alstrup Nielsen  <alstrup@alstrup>
 
        * *: Reduced header file dependencies all over.
index 8d1c31645ccc0b117bdb34efd78d7839be565775..952060507094263bfeb183f3720852d1eafb88d3 100644 (file)
@@ -23,6 +23,8 @@ class UpdatableInset;
 #include <vector>
 #include <boost/utility.hpp>
 
+#include "LString.h"
+
 /** A class to hold all the buffers in a structure
   The point of this class is to hide from bufferlist what kind
   of structure the buffers are stored in. Should be no concern for
index 2088b5e5893f23ba9bb88f33174fb79864f168d3..d9a2380316b456cc1775e106fe238e8c56a5c1f2 100644 (file)
@@ -12,6 +12,9 @@
 
 #include <iosfwd>
 
+// this will not be needed anymore when NO_LATEX is the default.
+#include "lyxfont.h"
+
 /** These are all the lyxfunctions (as enums).
     Please add new functions at the end of the enum, right
     before LFUN_LASTACTION.
index 60c835ebad5f3be5c8cdf4f6ad4366b85417f874..9945f3c88781455e0fa9bb44ba1f2d13c972dd4d 100644 (file)
@@ -1,3 +1,7 @@
+2001-07-30  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * Liason.C: #include LAssert.h
+
 2001-07-24  John Levon  <moz@compsoc.man.ac.uk>
 
        * Dialogs.h: add showThesaurus
index f916688f2c7b18bb090415caaa7fdb1885cf941e..f4d0082dfb0b43587b54544022484c19e0a58111 100644 (file)
@@ -21,6 +21,7 @@
 #include "lyxrc.h"
 #include "PrinterParams.h"
 #include "lyx_gui_misc.h"
+#include "support/LAssert.h"
 #include "support/lstrings.h"
 #include "support/filetools.h"
 #include "support/path.h"
index 736aa2af66f4adadcc4ca185eaa263e7ed8e33d5..aea5ce8ed99358a8ba297aff0032b80330d79129 100644 (file)
@@ -1,3 +1,7 @@
+2001-07-30  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * ControlPrint.C: #include Lassert.h here.
+
 2001-07-26  Baruch Even  <baruch@lyx.org>
 
        * ControlGraphics.C: changed file search string to cover eps, jpeg, gif
index 77bbf8cdbc51a09b74554d874428bb275abd6009..a9fb35a0c3e0ffd69d845c90202e71914f11730e 100644 (file)
@@ -31,6 +31,7 @@
 #include "lyx_gui_misc.h" // WriteAlert
 #include "gettext.h"
 #include "BufferView.h"
+#include "support/LAssert.h"
 
 using Liason::printBuffer;
 using Liason::getPrinterParams;
index e0ce2691a849092eb20cf919714d13b20277efc0..cf686e226980a21a068a9f0dc048bd5bcb64b45a 100644 (file)
@@ -1,3 +1,9 @@
+2001-07-30  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * insetgraphicsParams.C: #include LOstream.h here.
+
+       * insetfoot.h: remove InsetFoot:: qualifier.
+
 2001-07-30  Baruch Even  <baruch@lyx.org>
 
        * insetgraphics.C (decideOutputImageFormat): when doing postscript output
index d8e1f8cb4dd347a5e613d092d32982eb2082d265..87e9067f66e2b4007f4d413a77cde03b9de9cdae 100644 (file)
@@ -39,7 +39,7 @@ public:
        ///
        string const editMessage() const;
        ///
-       void InsetFoot::validate(LaTeXFeatures & features) const;
+       void validate(LaTeXFeatures & features) const;
 };
 
 #endif
index 6626aea3503cf0c806a70d6fd0bb9dbc42123fb2..ed5980e72a83d0e15f937800b05a84ed93c70015 100644 (file)
@@ -19,6 +19,7 @@
 #include "support/translator.h"
 #include "support/filetools.h"
 #include "support/lyxlib.h"
+#include "support/LOstream.h"
 
 #include "support/LAssert.h"
 
index e446658a6dbcdb8376728cb27e4166a7f5262a9b..6a756e5c80ff3b05fc69f22f8a908429fd4e39d0 100644 (file)
@@ -150,6 +150,9 @@ public:
        
        ///
        void toggleFree(BufferView *, LyXFont const &, bool toggleall = false);
+
+       ///
+       string getStringToIndex(BufferView *);
        
        /** recalculates the heights of all previous rows of the
            specified paragraph.  needed, if the last characters font
index 8898e4cae0d1b33aec344a1556bf0e7cd67e2029..bc975e2d6664d8d8330828bb7f98b1dee412b869 100644 (file)
@@ -1059,6 +1059,39 @@ void LyXText::toggleFree(BufferView * bview,
 }
 
 
+string
+LyXText::getStringToIndex(BufferView * bview)
+{
+       string idxstring;
+       
+       // Try implicit word selection
+       // If there is a change in the language the implicit word selection 
+       // is disabled.
+       LyXCursor resetCursor = cursor;
+       bool implicitSelection = selectWordWhenUnderCursor(bview, PREVIOUS_WORD);
+
+       if (!selection.set()) {
+               bview->owner()->message(_("Nothing to index!"));
+               return string();
+       }
+       if (selection.start.par() != selection.end.par()) {
+               bview->owner()->message(_("Cannot index more than one paragraph!"));
+               return string();
+       }
+
+       idxstring = selectionAsString(bview->buffer());
+       
+       // Implicit selections are cleared afterwards
+       //and cursor is set to the original position.
+       if (implicitSelection) {
+               clearSelection(bview);
+               cursor = resetCursor;
+               setCursor(bview, cursor.par(), cursor.pos());
+               selection.cursor = cursor;
+       }
+       return idxstring;
+}
+
 Paragraph::size_type
 LyXText::beginningOfMainBody(Buffer const * buf,
                             Paragraph const * par) const