Kaydet (Commit) e98eda6c authored tarafından Michael Stahl's avatar Michael Stahl Kaydeden (comit) Andras Timar

sw: fix ~SwIndexReg() assertion on import of tdf92157-1.docx

Problem is that the TextBox SwFrmFmt of a draw object gets a FLY_AS_CHAR
anchor set, which is then not updated later before nodes are deleted.

(regression from c7307c77)

(cherry picked from commit 9dbb88fc)

Change-Id: I906ee47b5c30944a08fd8a0d7d6ea8b8c9e6a6a8
Reviewed-on: https://gerrit.libreoffice.org/17580Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst 085de505
......@@ -496,7 +496,14 @@ SwFrameFormat *DocumentLayoutManager::CopyLayoutFormat(
// If the draw format has a TextBox, then copy its fly format as well.
if (SwFrameFormat* pSourceTextBox = SwTextBoxHelper::findTextBox(&rSource))
{
SwFrameFormat* pDestTextBox = CopyLayoutFormat(*pSourceTextBox, rNewAnchor, bSetTextFlyAtt, bMakeFrms);
SwFormatAnchor boxAnchor(rNewAnchor);
if (FLY_AS_CHAR == boxAnchor.GetAnchorId())
{
// AS_CHAR *must not* be set on textbox fly-frame
boxAnchor.SetType(FLY_AT_CHAR);
}
SwFrameFormat* pDestTextBox = CopyLayoutFormat(*pSourceTextBox,
boxAnchor, bSetTextFlyAtt, bMakeFrms);
SwAttrSet aSet(pDest->GetAttrSet());
SwFormatContent aContent(pDestTextBox->GetContent().GetContentIdx()->GetNode().GetStartNode());
aSet.Put(aContent);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment