]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfind.C
Remove the inset and view member functions from PreviewedInset.
[lyx.git] / src / lyxfind.C
index fe37598adb0a24526c7145427b938958053c54a6..dfa961eb181a8593628c0dbf2bff82e0f690c521 100644 (file)
 
 #include <config.h>
 
-#include "lyxtext.h"
 #include "lyxfind.h"
-#include "paragraph.h"
-#include "frontends/LyXView.h"
-#include "frontends/Alert.h"
-#include "support/textutils.h"
-#include "support/lstrings.h"
-#include "BufferView.h"
+
 #include "buffer.h"
-#include "debug.h"
+#include "BufferView.h"
 #include "gettext.h"
+#include "lyxtext.h"
+#include "paragraph.h"
+
+#include "frontends/Alert.h"
+
 #include "insets/insettext.h"
-#include "changes.h"
 
-using namespace lyx::support;
+#include "support/textutils.h"
 
-using lyx::pos_type;
-using std::endl;
+using lyx::support::lowercase;
+using lyx::support::uppercase;
+
+using std::string;
 
 namespace lyx {
 namespace find {
 
+
 namespace {
 
 // returns true if the specified string is at the specified position
@@ -44,7 +45,7 @@ bool isStringInText(Paragraph const & par, pos_type pos,
        string::size_type size = str.length();
        pos_type i = 0;
        pos_type parsize = par.size();
-       while (((pos + i) < parsize)
+       while ((pos + i < parsize)
               && (string::size_type(i) < size)
               && (cs ? (str[i] == par.getChar(pos + i))
                   : (uppercase(str[i]) == uppercase(par.getChar(pos + i))))) {
@@ -70,7 +71,7 @@ bool isStringInText(Paragraph const & par, pos_type pos,
 SearchResult searchForward(BufferView * bv, LyXText * text, string const & str,
                           bool const & cs, bool const & mw)
 {
-       ParagraphList::iterator pit = text->cursor.par();
+       ParagraphList::iterator pit = text->cursorPar();
        ParagraphList::iterator pend = text->ownerParagraphs().end();
        pos_type pos = text->cursor.pos();
        UpdatableInset * inset;
@@ -92,8 +93,8 @@ SearchResult searchForward(BufferView * bv, LyXText * text, string const & str,
        if (pit != pend) {
                text->setCursor(pit, pos);
                return SR_FOUND;
-       } else
-               return SR_NOT_FOUND;
+       }
+       return SR_NOT_FOUND;
 }
 
 
@@ -104,7 +105,7 @@ SearchResult searchBackward(BufferView * bv, LyXText * text,
                            string const & str,
                            bool const & cs, bool const & mw)
 {
-       ParagraphList::iterator pit = text->cursor.par();
+       ParagraphList::iterator pit = text->cursorPar();
        ParagraphList::iterator pbegin = text->ownerParagraphs().begin();
        pos_type pos = text->cursor.pos();
 
@@ -149,6 +150,7 @@ SearchResult searchBackward(BufferView * bv, LyXText * text,
 } // anon namespace
 
 
+
 int replace(BufferView * bv,
               string const & searchstr, string const & replacestr,
               bool forward, bool casesens, bool matchwrd, bool replaceall,
@@ -302,7 +304,7 @@ SearchResult find(BufferView * bv, LyXText * text,
 
 SearchResult nextChange(BufferView * bv, LyXText * text, pos_type & length)
 {
-       ParagraphList::iterator pit = text->cursor.par();
+       ParagraphList::iterator pit = text->cursorPar();
        ParagraphList::iterator pend = text->ownerParagraphs().end();
        pos_type pos = text->cursor.pos();