]> git.lyx.org Git - lyx.git/blobdiff - src/Text.cpp
* Call metrics of the parameters with the correct font in MathMacros, for example
[lyx.git] / src / Text.cpp
index f0b474cc57486a3419e3d101a9bcf1abfc0d3005..f6b676b57deb7b6d29fb3edd95776c6a41251552 100644 (file)
@@ -922,7 +922,7 @@ void Text::deleteWordForward(Cursor & cur)
                cursorForward(cur);
        else {
                cur.resetAnchor();
-               cur.selection() = true;
+               cur.setSelection(true);
                cursorForwardOneWord(cur);
                cur.setSelection();
                cutSelection(cur, true, false);
@@ -938,7 +938,7 @@ void Text::deleteWordBackward(Cursor & cur)
                cursorBackward(cur);
        else {
                cur.resetAnchor();
-               cur.selection() = true;
+               cur.setSelection(true);
                cursorBackwardOneWord(cur);
                cur.setSelection();
                cutSelection(cur, true, false);
@@ -1180,14 +1180,15 @@ bool Text::backspace(Cursor & cur)
 }
 
 
-bool Text::dissolveInset(Cursor & cur) {
-       LASSERT(this == cur.text(), /**/);
+bool Text::dissolveInset(Cursor & cur)
+{
+       LASSERT(this == cur.text(), return false);
 
        if (isMainText(cur.bv().buffer()) || cur.inset().nargs() != 1)
                return false;
 
        cur.recordUndoInset();
-       cur.mark() = false;
+       cur.setMark(false);
        cur.selHandle(false);
        // save position
        pos_type spos = cur.pos();
@@ -1488,6 +1489,25 @@ docstring Text::getPossibleLabel(Cursor const & cur) const
 }
 
 
+docstring Text::asString(int options) const
+{
+       return asString(0, pars_.size(), options);
+}
+
+
+docstring Text::asString(pit_type beg, pit_type end, int options) const
+{
+       size_t i = size_t(beg);
+       docstring str = pars_[i].asString(options);
+       for (++i; i != size_t(end); ++i) {
+               str += '\n';
+               str += pars_[i].asString(options);
+       }
+       return str;
+}
+
+
+
 void Text::charsTranspose(Cursor & cur)
 {
        LASSERT(this == cur.text(), /**/);