]> git.lyx.org Git - lyx.git/blobdiff - src/Text.cpp
inset-edit should not make a buffer dirty (it edits the external files used by the...
[lyx.git] / src / Text.cpp
index 0a4c1d1da740b9d8bf741dd271613e95c5025bba..3465a0850e5087d2358b9420bbfa9bd99797f321 100644 (file)
@@ -1489,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(), /**/);
@@ -1522,11 +1541,11 @@ void Text::charsTranspose(Cursor & cur)
 
        // Store the characters to be transposed (including font information).
        char_type char1 = par.getChar(pos1);
-       Font const font1 =
+       Font const font1 =
                par.getFontSettings(cur.buffer().params(), pos1);
 
        char_type char2 = par.getChar(pos2);
-       Font const font2 =
+       Font const font2 =
                par.getFontSettings(cur.buffer().params(), pos2);
 
        // And finally, we are ready to perform the transposition.