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();
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);
}
/* 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_; }
// 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;
// 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;
newline_inserted = false;
}
}
- insertStringAsLines(cur, linestr);
+ insertStringAsLines(dit, linestr, font);
}
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;
}
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);
}
}