From: Enrico Forestieri Date: Sun, 19 Oct 2008 20:55:54 +0000 (+0000) Subject: Fix bug 5374 X-Git-Tag: 1.6.10~2965 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=96007ce5ac7944bbb30366e21730979498ef296c;p=features.git Fix bug 5374 http://bugzilla.lyx.org/show_bug.cgi?id=5374 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26983 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp index 8a13b87fdf..2f1a715d08 100644 --- a/src/CutAndPaste.cpp +++ b/src/CutAndPaste.cpp @@ -801,7 +801,7 @@ void clearCutStack() docstring selection(size_t sel_index) { return sel_index < theCuts.size() - ? theCuts[sel_index].first.back().asString(AS_STR_INSETS) + ? theCuts[sel_index].first.back().asString(AS_STR_INSETS | AS_STR_NEWLINES) : docstring(); } diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index e46faab4b9..1bfec20211 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -2422,7 +2422,8 @@ docstring Paragraph::asString(pos_type beg, pos_type end, int options) const for (pos_type i = beg; i < end; ++i) { char_type const c = d->text_[i]; - if (isPrintable(c) || c == '\t') + if (isPrintable(c) || c == '\t' + || (c == '\n' && options & AS_STR_NEWLINES)) os.put(c); else if (c == META_INSET && options & AS_STR_INSETS) getInset(i)->textString(os); diff --git a/src/Paragraph.h b/src/Paragraph.h index 87576afe1f..9d7e5f1d4c 100644 --- a/src/Paragraph.h +++ b/src/Paragraph.h @@ -78,7 +78,8 @@ enum AsStringParameter { AS_STR_NONE = 0, ///< No option, only printable characters. AS_STR_LABEL = 1, ///< Prefix with paragraph label. - AS_STR_INSETS = 2 ///< Go into insets. + AS_STR_INSETS = 2, ///< Go into insets. + AS_STR_NEWLINES = 4 ///< Get also newline characters. };