forked from amazingfate/loongoffice
Go to the end of the 3rd paragraph of the bugdoc, press Enter, list level of both the old and new paragraphs change from 5 to 4, unexpectedly. It seems what happens is that the paragraph in question has a style which has its outline level set to 4. So once the node is split, the newly inserted node will host the old text (so need to set the style on it to the old style, which sets list level to the outline level from the style as a side effect) and the old node will host what looks like a new bullet point on the UI, so there we need to set the paragraph style to the follow style. This second set-style also drops the list level direct formatting and takes the outline level from the style. Fix the problem by keeping the old scenario (paragraph style with a different follow style) unchanged, since a different list level on an actual paragraph style change can be expected -- but avoid setting a list level when this is a simple node split with just the same style on both nodes. That's not seen as an explicit "set style" by the user, so changing the list level there is confusing. In fact the list level is fine after copying the text node's item set from the old node to the new node, just make sure that SwTextNode::ChgTextCollUpdateNum() doesn't set a new list level in the "effectively no style change" case. Make sure to not set a new list level at both places (SwTextNode::MakeNewTextNode() does this for the previous node, SwTextNode::ChgFormatColl() does this for the next node). Change-Id: Ifdf9048f01fef7bb8e99098ebeb5d1ec339fdaa6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182869 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182881