commit e09faf7ce625b9297a8b59a105680db190e40df8
Author: Georg Baum <[email protected]>
Date: Sat Feb 22 11:02:50 2014 +0100
Fix bug #8891 (wrong depth of copied text)
This was an obvious thinko: When pasting a paragraph list the depth of the
pasted paragraphs need to be adjusted, so that no paragraph has a negative
depth afterwards. However, the maximum allowed depth was only adjusted after
the second and following pasted paragraphs. Since the computed value was
only
used for the subsequent paragrph this meant that the second paragraph did
still use the same maximum allowed depth as the first one, which came from
the
paragraph the text as pasted into. This was wrong e.g. in case the outside
paragraph was a standard paragraph (max_depth = 0), and the first pasted
paragraph was an enumeration (max_depth = 1). Therefore, max_depth needs to
be adjusted also after the first pasted paragaph. Since the adjustment is
done aftre max_depth was used for the current paragraph the condition
mentioned in the comment is still met.
(cherry picked from commit 270201ed67f6aec9a075f7dae65085ac64b5a36d)
diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp
index ec19695..dc405e3 100644
--- a/src/CutAndPaste.cpp
+++ b/src/CutAndPaste.cpp
@@ -196,10 +196,8 @@ pasteSelectionHelper(Cursor const & cur, ParagraphList
const & parlist,
if (tmpbuf->params().depth() > max_depth)
tmpbuf->params().depth(max_depth);
- // Only set this from the 2nd on as the 2nd depends
- // for maxDepth still on pit.
- if (tmpbuf != insertion.begin())
- max_depth = tmpbuf->getMaxDepthAfter();
+ // Set max_depth for the next paragraph
+ max_depth = tmpbuf->getMaxDepthAfter();
// Set the inset owner of this paragraph.
tmpbuf->setInsetOwner(target_inset);
diff --git a/status.20x b/status.20x
index 7d4af94..c65ca55 100644
--- a/status.20x
+++ b/status.20x
@@ -61,7 +61,9 @@ What's new
- Support (black) card suites in text mode (bug 8971).
-- Use universal newlines when reading CSVs
+- Use universal newlines when reading CSVs.
+
+- Fix bug where depth of pasted text was incorrectly set (bug 8891).
* USER INTERFACE