]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfind.C
fix "make dist" target
[lyx.git] / src / lyxfind.C
index 183cb7b3c04967e2cac8220a71ad4deed4e567e0..21d834eab1a40ecc87c3d0f7274166a7ef55eafc 100644 (file)
@@ -7,20 +7,20 @@
 #include "lyxtext.h"
 #include "lyxfind.h"
 #include "LyXView.h"
-#include "minibuffer.h"
 #include "lyx_gui_misc.h"
 #include "support/textutils.h"
 #include "support/lstrings.h"
 #include "BufferView.h"
 #include "buffer.h"
+#include "gettext.h"
 
 int LyXReplace(BufferView * bv,
-               string const & searchstr,
-               string const & replacestr,
-               bool const & casesens,
-               bool const & matchwrd,
-               bool const & forward,
-               bool const & replaceall)
+              string const & searchstr,
+              string const & replacestr,
+              bool const & casesens,
+              bool const & matchwrd,
+              bool const & forward,
+              bool const & replaceall)
 {
    int replace_count = 0;
  
@@ -118,7 +118,7 @@ bool IsStringInText(LyXParagraph * par, LyXParagraph::size_type pos,
    
        string::size_type size = str.length();
        LyXParagraph::size_type i = 0;
-       while (((pos + i) < par->Last())
+       while (((pos + i) < par->size())
               && (string::size_type(i) < size)
               && (cs ? (str[i] == par->GetChar(pos + i))
                   : (toupper(str[i]) == toupper(par->GetChar(pos + i)))))
@@ -129,7 +129,7 @@ bool IsStringInText(LyXParagraph * par, LyXParagraph::size_type pos,
          // if necessary, check whether string matches word
          if (!mw || 
              (mw && ((pos <= 0 || !IsLetterCharOrDigit(par->GetChar(pos - 1)))
-                     && (pos + size >= par->Last()
+                     && (pos + size >= par->size()
                          || !IsLetterCharOrDigit(par->GetChar(pos + size))))
               )
              )
@@ -148,11 +148,11 @@ bool SearchForward(BufferView * bv, string const & str,
        LyXParagraph::size_type pos = bv->text->cursor.pos();
    
        while (par && !IsStringInText(par, pos, str, cs, mw)) {
-               if (pos < par->Last() - 1)
+               if (pos < par->size() - 1)
                        ++pos;
                else {
                        pos = 0;
-                       par = par->Next();
+                       par = par->next();
                }
        }
        if (par) {
@@ -179,9 +179,9 @@ bool SearchBackward(BufferView * bv, string const & str,
                else {
                        // We skip empty paragraphs (Asger)
                        do {
-                               par = par->Previous();
+                               par = par->previous();
                                if (par)
-                                       pos = par->Last() - 1;
+                                       pos = par->size() - 1;
                        } while (par && pos < 0);
                }
        } while (par && !IsStringInText(par, pos, str, cs, mw));