summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-08-07 20:44:43 +0200
committerMichael Stahl <mstahl@redhat.com>2015-08-07 20:51:35 +0200
commit9dbb88fc41e7a91c852795f00a663c0d073dd70a (patch)
treef3cc260d259be067a3a1880b29154535dbb597eb /sw
parent2d76030d985b53779e2363b559f441613f5c677c (diff)
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 c7307c77254557646f33017af915f6808a861e29) Change-Id: I906ee47b5c30944a08fd8a0d7d6ea8b8c9e6a6a8
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/core/data/ooxml/pass/tdf92157-1-minimized.docxbin0 -> 14648 bytes
-rw-r--r--sw/source/core/doc/DocumentLayoutManager.cxx11
2 files changed, 10 insertions, 1 deletions
diff --git a/sw/qa/core/data/ooxml/pass/tdf92157-1-minimized.docx b/sw/qa/core/data/ooxml/pass/tdf92157-1-minimized.docx
new file mode 100644
index 000000000000..6edbe18095dd
--- /dev/null
+++ b/sw/qa/core/data/ooxml/pass/tdf92157-1-minimized.docx
Binary files differ
diff --git a/sw/source/core/doc/DocumentLayoutManager.cxx b/sw/source/core/doc/DocumentLayoutManager.cxx
index 13e50de4b859..020672e0d923 100644
--- a/sw/source/core/doc/DocumentLayoutManager.cxx
+++ b/sw/source/core/doc/DocumentLayoutManager.cxx
@@ -496,7 +496,16 @@ 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);
+ }
+ // presumably these anchors are supported though not sure
+ assert(FLY_AT_CHAR == boxAnchor.GetAnchorId() || FLY_AT_PARA == boxAnchor.GetAnchorId());
+ SwFrameFormat* pDestTextBox = CopyLayoutFormat(*pSourceTextBox,
+ boxAnchor, bSetTextFlyAtt, bMakeFrms);
SwAttrSet aSet(pDest->GetAttrSet());
SwFormatContent aContent(pDestTextBox->GetContent().GetContentIdx()->GetNode().GetStartNode());
aSet.Put(aContent);