Author: spitz
Date: Tue Mar 15 14:19:55 2011
New Revision: 37934
URL: http://www.lyx.org/trac/changeset/37934

Log:
Follow-up to r37932: We do not need a skipOnSearch variable, since we know the 
conditions anyway.

Thanks, JMarc,

Modified:
   lyx-devel/trunk/src/Paragraph.cpp
   lyx-devel/trunk/src/insets/Inset.h
   lyx-devel/trunk/src/insets/InsetSpecialChar.cpp
   lyx-devel/trunk/src/insets/InsetSpecialChar.h

Modified: lyx-devel/trunk/src/Paragraph.cpp
==============================================================================
--- lyx-devel/trunk/src/Paragraph.cpp   Tue Mar 15 12:26:14 2011        (r37933)
+++ lyx-devel/trunk/src/Paragraph.cpp   Tue Mar 15 14:19:55 2011        (r37934)
@@ -3343,10 +3343,13 @@
        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++;
                }

Modified: lyx-devel/trunk/src/insets/Inset.h
==============================================================================
--- lyx-devel/trunk/src/insets/Inset.h  Tue Mar 15 12:26:14 2011        (r37933)
+++ lyx-devel/trunk/src/insets/Inset.h  Tue Mar 15 14:19:55 2011        (r37934)
@@ -402,9 +402,6 @@
        /// 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;

Modified: lyx-devel/trunk/src/insets/InsetSpecialChar.cpp
==============================================================================
--- lyx-devel/trunk/src/insets/InsetSpecialChar.cpp     Tue Mar 15 12:26:14 
2011        (r37933)
+++ lyx-devel/trunk/src/insets/InsetSpecialChar.cpp     Tue Mar 15 14:19:55 
2011        (r37934)
@@ -346,12 +346,6 @@
 }
 
 
-bool InsetSpecialChar::skipOnSearch() const
-{
-       return kind_ == HYPHENATION || kind_ == LIGATURE_BREAK;
-}
-
-
 bool InsetSpecialChar::isLineSeparator() const
 {
 #if 0

Modified: lyx-devel/trunk/src/insets/InsetSpecialChar.h
==============================================================================
--- lyx-devel/trunk/src/insets/InsetSpecialChar.h       Tue Mar 15 12:26:14 
2011        (r37933)
+++ lyx-devel/trunk/src/insets/InsetSpecialChar.h       Tue Mar 15 14:19:55 
2011        (r37934)
@@ -77,13 +77,11 @@
        ///
        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); };

Reply via email to