[Libreoffice-commits] core.git: sw/qa sw/source
Michael Stahl
mstahl at redhat.com
Fri Aug 7 11:59:22 PDT 2015
sw/qa/core/data/ooxml/pass/tdf92157-1-minimized.docx |binary
sw/source/core/doc/DocumentLayoutManager.cxx | 11 ++++++++++-
2 files changed, 10 insertions(+), 1 deletion(-)
New commits:
commit 9dbb88fc41e7a91c852795f00a663c0d073dd70a
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Aug 7 20:44:43 2015 +0200
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
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 0000000..6edbe18
Binary files /dev/null and b/sw/qa/core/data/ooxml/pass/tdf92157-1-minimized.docx differ
diff --git a/sw/source/core/doc/DocumentLayoutManager.cxx b/sw/source/core/doc/DocumentLayoutManager.cxx
index 13e50de..020672e 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);
More information about the Libreoffice-commits
mailing list