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
This commit is contained in:
Enrico Forestieri 2008-10-19 20:55:54 +00:00
parent f3117747ff
commit 96007ce5ac
3 changed files with 5 additions and 3 deletions

View 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();
}

View 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);

View 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.
};