]> git.lyx.org Git - features.git/commitdiff
Fix bug 5374
authorEnrico Forestieri <forenr@lyx.org>
Sun, 19 Oct 2008 20:55:54 +0000 (20:55 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Sun, 19 Oct 2008 20:55:54 +0000 (20:55 +0000)
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

src/CutAndPaste.cpp
src/Paragraph.cpp
src/Paragraph.h

index 8a13b87fdf10ed11db07d370facb4af84f578d99..2f1a715d084608ac194fb568e9c93e73cc3a3f72 100644 (file)
@@ -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();
 }
 
index e46faab4b922848e6487ea7077d4ab64f138aa4b..1bfec20211c7b94bbaf6f4cfa668c353fb96c8cb 100644 (file)
@@ -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);
index 87576afe1f2a31909a3df79d40777a8ac4afd00a..9d7e5f1d4c86063c990994a60f3c2c87302bdbd1 100644 (file)
@@ -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.
 };