diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-08-07 20:44:43 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-08-10 09:49:38 +0000 |
commit | 0ecc9fe7ac1358d9bbcfcebcc348906cca73872b (patch) | |
tree | 522e53b2c9563670f0d48bb468e3fd11c817c96c | |
parent | 53e86198f2a40f40f291fb6a9cf5cc67e45df94c (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)
(cherry picked from commit 9dbb88fc41e7a91c852795f00a663c0d073dd70a)
Change-Id: I906ee47b5c30944a08fd8a0d7d6ea8b8c9e6a6a8
Reviewed-on: https://gerrit.libreoffice.org/17581
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r-- | sw/qa/core/data/ooxml/pass/tdf92157-1-minimized.docx | bin | 0 -> 14648 bytes | |||
-rw-r--r-- | sw/source/core/doc/DocumentLayoutManager.cxx | 9 |
2 files changed, 8 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 Binary files differnew file mode 100644 index 000000000000..6edbe18095dd --- /dev/null +++ b/sw/qa/core/data/ooxml/pass/tdf92157-1-minimized.docx diff --git a/sw/source/core/doc/DocumentLayoutManager.cxx b/sw/source/core/doc/DocumentLayoutManager.cxx index 450fac11da72..08b8fa2a092d 100644 --- a/sw/source/core/doc/DocumentLayoutManager.cxx +++ b/sw/source/core/doc/DocumentLayoutManager.cxx @@ -496,7 +496,14 @@ SwFrmFmt *DocumentLayoutManager::CopyLayoutFmt( // If the draw format has a TextBox, then copy its fly format as well. if (SwFrmFmt* pSourceTextBox = SwTextBoxHelper::findTextBox(&rSource)) { - SwFrmFmt* pDestTextBox = CopyLayoutFmt(*pSourceTextBox, rNewAnchor, bSetTxtFlyAtt, bMakeFrms); + SwFmtAnchor boxAnchor(rNewAnchor); + if (FLY_AS_CHAR == boxAnchor.GetAnchorId()) + { + // AS_CHAR *must not* be set on textbox fly-frame + boxAnchor.SetType(FLY_AT_CHAR); + } + SwFrmFmt* pDestTextBox = CopyLayoutFmt(*pSourceTextBox, + boxAnchor, bSetTxtFlyAtt, bMakeFrms); SwAttrSet aSet(pDest->GetAttrSet()); SwFmtCntnt aCntnt(pDestTextBox->GetCntnt().GetCntntIdx()->GetNode().GetStartNode()); aSet.Put(aCntnt); |