]> git.lyx.org Git - features.git/commitdiff
Renamed selectNextWord as selectNextWordToSpellcheck.
authorAngus Leeming <leeming@lyx.org>
Fri, 21 Sep 2001 16:21:23 +0000 (16:21 +0000)
committerAngus Leeming <leeming@lyx.org>
Fri, 21 Sep 2001 16:21:23 +0000 (16:21 +0000)
Modified selectNextWordToSpellcheck to not select words inside an ERT inset.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2785 a592a061-630c-0410-9148-cb99ea01b6c8

13 files changed:
src/BufferView2.C
src/ChangeLog
src/insets/ChangeLog
src/insets/inset.C
src/insets/inset.h
src/insets/insetcollapsable.C
src/insets/insetcollapsable.h
src/insets/insettabular.C
src/insets/insettabular.h
src/insets/insettext.C
src/insets/insettext.h
src/lyxtext.h
src/text.C

index 6226a7edafdb902e692d37b9fdb6b09d4ecc372c..6f84e5f5b0efcd6db583435569abd78e6adae09d 100644 (file)
@@ -339,7 +339,7 @@ string const BufferView::nextWord(float & value)
                return string();
        }
 
-       return text->selectNextWord(this, value);
+       return text->selectNextWordToSpellcheck(this, value);
 }
 
   
index f48b589e2f8d3d6ffcb4c3a255a74429c4ae38f7..b39cc43482170ecd91311e8799ee0896eeb78200 100644 (file)
@@ -1,3 +1,11 @@
+2001-09-21  Angus Leeming  <a.leeming@ic.ac.uk>
+
+       * lyxtext.h, text.C (selectNextWord): renamed as
+       selectNextWordToSpellcheck.
+
+       * text.C (selectNextWordToSpellcheck): Modified to not select
+       words inside an ERT inset.
+
 2001-09-21  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * lyx_cb.C (MenuLayoutSave): change a bit the question
index 6c80888f14ede0be72319221aeae44b4fc4a172c..f0538d91466481a26240b49d142bc7cdd5209649 100644 (file)
@@ -1,5 +1,8 @@
 2001-09-21  Angus Leeming  <a.leeming@ic.ac.uk>
 
+       * various files (selectNextWord): renamed as
+       selectNextWordToSpellcheck.
+
        * insetgraphics.C (draw): remove the previous change. Right place
        is in imageLoaderXPM.C.
        (draw): don't display the image if params.display == NONE.
index 151107a2c48b509137a37f1110264bf1091e0ce1..94b4eef8c367d555cb31508ab1aecac191dfd33e 100644 (file)
@@ -345,7 +345,7 @@ LyXCursor const & Inset::cursor(BufferView * bv) const
 }
 
 
-string const UpdatableInset::selectNextWord(BufferView *bv,
+string const UpdatableInset::selectNextWordToSpellcheck(BufferView *bv,
                                            float & value) const
 {
        // we have to unlock ourself in this function by default!
index bc36d77a98b663b81066d802dfb4c6d271a5d5a0..9c03cdf90fff379c74e0a5d3dd9e4e7e30e2062a 100644 (file)
@@ -471,7 +471,7 @@ public:
        ///
        // needed for spellchecking text
        ///
-       virtual string const selectNextWord(BufferView *, float & value) const;
+       virtual string const selectNextWordToSpellcheck(BufferView *, float & value) const;
        ///
        virtual void selectSelectedWord(BufferView *) { return; }
        ///
index 408447e7fb52b5dbe451b83b35de41c20d826f66..fae885ce60fd30802741addd5ea1589f1c74bf48 100644 (file)
@@ -644,10 +644,10 @@ bool InsetCollapsable::searchBackward(BufferView * bv, string const & str,
 }
 
 
-string const InsetCollapsable::selectNextWord(BufferView * bv,
+string const InsetCollapsable::selectNextWordToSpellcheck(BufferView * bv,
                                              float & value) const
 {
-       string const str = inset.selectNextWord(bv, value);
+       string const str = inset.selectNextWordToSpellcheck(bv, value);
        if (first_after_edit && str.empty())
                close(bv);
        first_after_edit = false;
index a8547cab5257b0d6024f772c172ff1c2c44a4987..a4bad868e1f1dc268f6e5060e0f4780af2a5f7a7 100644 (file)
@@ -175,7 +175,7 @@ public:
        ///
        void close(BufferView *) const;
        ///
-       string const selectNextWord(BufferView * bv, float & value) const;
+       string const selectNextWordToSpellcheck(BufferView * bv, float & value) const;
 
        void selectSelectedWord(BufferView * bv) {
                inset.selectSelectedWord(bv);
index 75d27bd9a7a625cb5757dcbd94986358b97b872e..5fbe7fdeea75f4f5b4ee60fe49df82d42a65c2e0 100644 (file)
@@ -2490,10 +2490,10 @@ Inset * InsetTabular::getInsetFromID(int id_arg) const
 }
 
 
-string const InsetTabular::selectNextWord(BufferView * bv, float & value) const
+string const InsetTabular::selectNextWordToSpellcheck(BufferView * bv, float & value) const
 {
        if (the_locking_inset) {
-               string const str(the_locking_inset->selectNextWord(bv, value));
+               string const str(the_locking_inset->selectNextWordToSpellcheck(bv, value));
                if (!str.empty())
                        return str;
                if (tabular->IsLastCell(actcell)) {
@@ -2520,7 +2520,7 @@ string InsetTabular::selectNextWordInt(BufferView * bv, float & value) const
        // when entering this function the inset should be ALWAYS locked!
        lyx::Assert(the_locking_inset);
 
-       string const str(the_locking_inset->selectNextWord(bv, value));
+       string const str(the_locking_inset->selectNextWordToSpellcheck(bv, value));
        if (!str.empty())
                return str;
 
index 2c2b6664f91bfcc4cdae9c05940ff53ba401d0fc..82123ab565ba6ca62454c2a95b129e2854f57502 100644 (file)
@@ -212,7 +212,7 @@ public:
        ///
        LyXCursor const & cursor(BufferView *) const;
        ///
-       string const selectNextWord(BufferView *, float & value) const;
+       string const selectNextWordToSpellcheck(BufferView *, float & value) const;
        void selectSelectedWord(BufferView *);
        void toggleSelection(BufferView *, bool kill_selection);
        ///
index 79ba5e635a83f3389f83754daa192842e03a2975..e556322a70782948e763965af791d1244c1a548f 100644 (file)
@@ -2186,7 +2186,7 @@ Inset * InsetText::getInsetFromID(int id_arg) const
 }
 
 
-string const InsetText::selectNextWord(BufferView * bv, float & value) const
+string const InsetText::selectNextWordToSpellcheck(BufferView * bv, float & value) const
 {
        bool clear = false;
        string str;
@@ -2196,7 +2196,7 @@ string const InsetText::selectNextWord(BufferView * bv, float & value) const
                clear = true;
        }
        if (the_locking_inset) {
-               str = the_locking_inset->selectNextWord(bv, value);
+               str = the_locking_inset->selectNextWordToSpellcheck(bv, value);
                if (!str.empty()) {
                        value += cy(bv);
                        if (clear)
@@ -2208,7 +2208,7 @@ string const InsetText::selectNextWord(BufferView * bv, float & value) const
                // we have to go on checking so move cusor to the right
                lt->cursor.pos(lt->cursor.pos() + 1);
        }
-       str = lt->selectNextWord(bv, value);
+       str = lt->selectNextWordToSpellcheck(bv, value);
        if (str.empty())
                bv->unlockInset(const_cast<InsetText *>(this));
        else
index 8b5eace5eef0c7d1335e8ef8e4dfd9400a3bd456..a304a1d18dd3a6c8a2c5336af415633477d8c4e4 100644 (file)
@@ -229,7 +229,7 @@ public:
        ///
        void paragraph(Paragraph *);
        ///
-       string const selectNextWord(BufferView *, float & value) const;
+       string const selectNextWordToSpellcheck(BufferView *, float & value) const;
        void selectSelectedWord(BufferView *);
        void toggleSelection(BufferView *, bool kill_selection);
        ///
index 8e35b20d518104ad3ea0fece4d3b04b5a80adaa2..e95f3079ff169e5da6c5bd83f6de2ad937139e36 100644 (file)
@@ -295,7 +295,7 @@ public:
         to the beginning of this word. 
         With SelectSelectedWord can this be highlighted really
         */ 
-       string const selectNextWord(BufferView *, float & value) const;
+       string const selectNextWordToSpellcheck(BufferView *, float & value) const;
        ///
        void selectSelectedWord(BufferView *);
        ///
index 58cb13af98612f8d1c81e3a3956da9cbb70483c1..d636ec2c22e9764c7b475ccb1ee5cfdb9af4285f 100644 (file)
@@ -2271,11 +2271,11 @@ bool LyXText::selectWordWhenUnderCursor(BufferView * bview,
 
 // This function is only used by the spellchecker for NextWord().
 // It doesn't handle LYX_ACCENTs and probably never will.
-string const LyXText::selectNextWord(BufferView * bview,
+string const LyXText::selectNextWordToSpellcheck(BufferView * bview,
                                      float & value) const
 {
        if (the_locking_inset) {
-               string str = the_locking_inset->selectNextWord(bview, value);
+               string str = the_locking_inset->selectNextWordToSpellcheck(bview, value);
                if (!str.empty()) {
                        value += float(cursor.y())/float(height);
                        return str;
@@ -2306,10 +2306,12 @@ string const LyXText::selectNextWord(BufferView * bview,
        while ((cursor.par()->size() > cursor.pos()
               && (!cursor.par()->isLetter(cursor.pos()))
               && (!cursor.par()->isInset(cursor.pos()) ||
-                  !cursor.par()->getInset(cursor.pos())->isTextInset()))
+                  !(cursor.par()->getInset(cursor.pos())->isTextInset() &&
+                    cursor.par()->getInset(cursor.pos())->lyxCode() !=
+                    Inset::ERT_CODE)))
               || (cursor.par()->size() == cursor.pos()
                   && cursor.par()->next()))
-       {
+       {      
                if (cursor.pos() == cursor.par()->size()) {
                        cursor.par(cursor.par()->next());
                        cursor.pos(0);
@@ -2319,13 +2321,13 @@ string const LyXText::selectNextWord(BufferView * bview,
 
        // now check if we hit an inset so it has to be a inset containing text!
        if (cursor.pos() < cursor.par()->size() &&
-               cursor.par()->isInset(cursor.pos()))
+           cursor.par()->isInset(cursor.pos()))
        {
                // lock the inset!
                cursor.par()->getInset(cursor.pos())->edit(bview);
                // now call us again to do the above trick
                // but obviously we have to start from down below ;)
-               return bview->text->selectNextWord(bview, value);
+               return bview->text->selectNextWordToSpellcheck(bview, value);
        }               
   
        // Update the value if we changed paragraphs