]> git.lyx.org Git - features.git/commitdiff
Cleanup: Replace a bunch of Cursor arguments with DocIterators.
authorAbdelrazak Younes <younes@lyx.org>
Sun, 9 Aug 2009 16:49:41 +0000 (16:49 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sun, 9 Aug 2009 16:49:41 +0000 (16:49 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30951 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.cpp
src/CutAndPaste.cpp
src/Text.h
src/Text2.cpp
src/Text3.cpp

index 8b720ba6df2aa0be781832831bb2e47f2ecf7142..ee5fffa53a0a9442cd6a95a63f8894b8fd3a9d38 100644 (file)
@@ -2447,9 +2447,9 @@ void BufferView::insertPlaintextFile(FileName const & f, bool asParagraph)
        cap::replaceSelection(cur);
        buffer_.undo().recordUndo(cur);
        if (asParagraph)
-               cur.innerText()->insertStringAsParagraphs(cur, tmpstr);
+               cur.innerText()->insertStringAsParagraphs(cur, tmpstr, cur.current_font);
        else
-               cur.innerText()->insertStringAsLines(cur, tmpstr);
+               cur.innerText()->insertStringAsLines(cur, tmpstr, cur.current_font);
 
        updateMetrics();
        buffer_.changed();
index 1e9b74190d2e9aafa77dac0955b5c774f2abc3ec..317410497602ff19c1d95eebf0d7413fbae52714 100644 (file)
@@ -941,9 +941,9 @@ void pasteClipboardText(Cursor & cur, ErrorList & errorList, bool asParagraphs)
                return;
        cur.recordUndo();
        if (asParagraphs)
-               cur.text()->insertStringAsParagraphs(cur, text);
+               cur.text()->insertStringAsParagraphs(cur, text, cur.current_font);
        else
-               cur.text()->insertStringAsLines(cur, text);
+               cur.text()->insertStringAsLines(cur, text, cur.current_font);
 }
 
 
index 848f45b5ec1c13bd8c27013c166e9a35f49fa4dc..a0c94dab07856130645d0023551ec46dcc97a33b 100644 (file)
@@ -252,11 +252,11 @@ public:
        /* these things are for search and replace */
 
        /// needed to insert the selection
-       /// FIXME: replace Cursor with DocIterator.
-       void insertStringAsLines(Cursor & cur, docstring const & str);
+       void insertStringAsLines(DocIterator const & dit, docstring const & str,
+               Font const & font);
        /// needed to insert the selection
-       /// FIXME: replace Cursor with DocIterator.
-       void insertStringAsParagraphs(Cursor & cur, docstring const & str);
+       void insertStringAsParagraphs(DocIterator const & dit, docstring const & str,
+               Font const & font);
 
        /// access to our paragraphs
        ParagraphList const & paragraphs() const { return pars_; }
index be95232d1271a6da80bfab4c370d7e886e0c0e08..5eedf4f3078bcf079c0844e8ec7924c8f8596f01 100644 (file)
@@ -503,12 +503,12 @@ void Text::insertInset(Cursor & cur, Inset * inset)
 
 
 // needed to insert the selection
-void Text::insertStringAsLines(Cursor & cur, docstring const & str)
+void Text::insertStringAsLines(DocIterator const & dit, docstring const & str,
+               Font const & font)
 {
        BufferParams const & bparams = owner_->buffer().params();
-       pit_type pit = cur.pit();
-       pos_type pos = cur.pos();
-       Font font = cur.current_font;
+       pit_type pit = dit.pit();
+       pos_type pos = dit.pos();
 
        // insert the string, don't insert doublespace
        bool space_inserted = true;
@@ -555,7 +555,8 @@ void Text::insertStringAsLines(Cursor & cur, docstring const & str)
 
 // turn double CR to single CR, others are converted into one
 // blank. Then insertStringAsLines is called
-void Text::insertStringAsParagraphs(Cursor & cur, docstring const & str)
+void Text::insertStringAsParagraphs(DocIterator const & dit, docstring const & str,
+               Font const & font)
 {
        docstring linestr = str;
        bool newline_inserted = false;
@@ -576,7 +577,7 @@ void Text::insertStringAsParagraphs(Cursor & cur, docstring const & str)
                        newline_inserted = false;
                }
        }
-       insertStringAsLines(cur, linestr);
+       insertStringAsLines(dit, linestr, font);
 }
 
 
index 008d66c100967bfb4d8420932d393315a52a51e6..1874607f53ffa4dee0fe8044dd3e662b8abc1734 100644 (file)
@@ -245,7 +245,7 @@ static bool doInsertInset(Cursor & cur, Text * text,
                if (edit)
                        inset->edit(cur, true);
                // Now put this into inset
-               cur.text()->insertStringAsLines(cur, ds);
+               cur.text()->insertStringAsLines(cur, ds, cur.current_font);
                cur.leaveInset(*inset);
                return true;
        }
@@ -2779,9 +2779,9 @@ void Text::pasteString(Cursor & cur, docstring const & clip,
        if (!clip.empty()) {
                cur.recordUndo();
                if (asParagraphs)
-                       insertStringAsParagraphs(cur, clip);
+                       insertStringAsParagraphs(cur, clip, cur.current_font);
                else
-                       insertStringAsLines(cur, clip);
+                       insertStringAsLines(cur, clip, cur.current_font);
        }
 }