]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfind.cpp
Limit the nopassthurchars case in beamer to URL
[lyx.git] / src / lyxfind.cpp
index 6281b82abc8c143c2ebb7dd4bd5a561c8761028b..ea2f669e13e1c762ea0e5fadfec9af711af554b3 100644 (file)
@@ -281,27 +281,6 @@ bool searchAllowed(docstring const & str)
        return true;
 }
 
-void setSelection(BufferView * bv, DocIterator const & from, DocIterator const & to)
-{
-       DocIterator end = to;
-
-       if (from.pit() != end.pit()) {
-               // there are multiple paragraphs in selection
-               Cursor & bvcur = bv->cursor();
-               bvcur.setCursor(from);
-               bvcur.clearSelection();
-               bvcur.selection(true);
-               bvcur.setCursor(end);
-               bvcur.selection(true);
-       } else {
-               // FIXME LFUN
-               // If we used a LFUN, dispatch would do all of this for us
-               int const size = end.pos() - from.pos();
-               bv->putSelectionAt(from, size, false);
-       }
-       bv->processUpdateFlags(Update::Force | Update::FitCursor);
-}
-
 } // namespace
 
 
@@ -408,7 +387,7 @@ bool findOne(BufferView * bv, docstring const & searchstr,
                // restore original selection
                if (had_selection) {
                        bv->cursor().resetAnchor();
-                       setSelection(bv, startcur, endcur);
+                       bv->setSelection(startcur, endcur);
                }
                return false;
        }
@@ -485,7 +464,7 @@ int replaceAll(BufferView * bv,
        if (had_selection) {
                endcur.fixIfBroken();
                bv->cursor().resetAnchor();
-               setSelection(bv, startcur, endcur);
+               bv->setSelection(startcur, endcur);
        }
 
        return num;
@@ -4152,7 +4131,7 @@ docstring stringifyFromCursor(DocIterator const & cur, int len)
                                (( len == -1 || cs.pos() + len > int(md.size()))
                                 ? md.end()
                                 : md.begin() + cs.pos() + len );
-               MathData md2;
+               MathData md2(cur.buffer());
                for (MathData::const_iterator it = md.begin() + cs.pos(); it != it_end; ++it)
                        md2.push_back(*it);
                docstring res = from_utf8(latexNamesToUtf8(asString(md2), false));
@@ -4218,7 +4197,7 @@ docstring latexifyFromCursor(DocIterator const & cur, int len)
                                ((len == -1 || cs.pos() + len > int(md.size()))
                                 ? md.end()
                                 : md.begin() + cs.pos() + len);
-               MathData md2;
+               MathData md2(cur.buffer());
                for (MathData::const_iterator it = md.begin() + cs.pos();
                     it != it_end; ++it)
                        md2.push_back(*it);
@@ -4882,7 +4861,7 @@ bool findAdv(BufferView * bv, FindAndReplaceOptions & opt)
                                                MathData md = cs.cell();
                                                int len = -1;
                                                MathData::const_iterator it_end = md.end();
-                                               MathData md2;
+                                               MathData md2(cur.buffer());
                                                // Start the check with one character before actual cursor position
                                                for (MathData::const_iterator it = md.begin() + cs.pos() - 1;
                                                    it != it_end; ++it)