]> git.lyx.org Git - lyx.git/commitdiff
Follow-up to r37932: We do not need a skipOnSearch variable, since we know the condit...
authorJürgen Spitzmüller <spitz@lyx.org>
Tue, 15 Mar 2011 13:19:55 +0000 (13:19 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Tue, 15 Mar 2011 13:19:55 +0000 (13:19 +0000)
Thanks, JMarc,

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

src/Paragraph.cpp
src/insets/Inset.h
src/insets/InsetSpecialChar.cpp
src/insets/InsetSpecialChar.h

index f78cefb9746456d6c2624ca71f881c664ae10c0e..b4a33fad047756fc0ed8cabb0577150d682b516e 100644 (file)
@@ -3343,10 +3343,13 @@ int Paragraph::find(docstring const & str, bool cs, bool mw,
        int const strsize = str.length();
        int i = 0;
        pos_type const parsize = d->text_.size();
+       odocstringstream os;
        for (i = 0; i < strsize && pos < parsize; ++i, ++pos) {
-               // Ignore ligature break and hyphenation chars while searching
+               // Ignore "invisible" letters such as ligature breaks
+               // and hyphenation chars while searching
                while (pos < parsize - 1 && isInset(pos)) {
-                       if (!getInset(pos)->skipOnSearch())
+                       getInset(pos)->toString(os);
+                       if (!getInset(pos)->isLetter() || !os.str().empty())
                                break;
                        pos++;
                }
index 7b2c04c6276d69a1be30822a47ca7709009384cf..3b3e4306d32c5fe5eb8b982c7cf82f3999aace46 100644 (file)
@@ -402,9 +402,6 @@ public:
        /// Is the content of this inset part of the output document?
        virtual bool producesOutput() const { return true; }
 
-       /// Skip this inset while searching?
-       virtual bool skipOnSearch() const { return false; }
-
        /// \return Tool tip for this inset.
        /// This default implementation returns an empty string.
        virtual docstring toolTip(BufferView const & bv, int x, int y) const;
index 6550ac90940ec6984999b034fd12c3fcc15c3ee6..106755076b5d556eb3b3c66bc0c798d1dff2d7ae 100644 (file)
@@ -346,12 +346,6 @@ bool InsetSpecialChar::isLetter() const
 }
 
 
-bool InsetSpecialChar::skipOnSearch() const
-{
-       return kind_ == HYPHENATION || kind_ == LIGATURE_BREAK;
-}
-
-
 bool InsetSpecialChar::isLineSeparator() const
 {
 #if 0
index b96863a732d0798863fdc2bba1e49b210dde143c..70741ec787a5a304927f53ce6178484e3a7f6152 100644 (file)
@@ -77,13 +77,11 @@ public:
        ///
        void validate(LaTeXFeatures &) const;
 
-       // should this inset be handled like a normal charater
+       /// should this inset be handled like a normal charater
        bool isChar() const { return true; }
        /// is this equivalent to a letter?
        bool isLetter() const;
-       /// Skip this inset while searching?
-       bool skipOnSearch() const;
-       // should we break lines after this inset?
+       /// should we break lines after this inset?
        bool isLineSeparator() const;
 private:
        Inset * clone() const { return new InsetSpecialChar(*this); };