sw/qa/core/data/ooxml/pass/tdf92157-1-minimized.docx |binary
 sw/source/core/doc/DocumentLayoutManager.cxx         |    9 ++++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 0ecc9fe7ac1358d9bbcfcebcc348906cca73872b
Author: Michael Stahl <mst...@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)
    
    (cherry picked from commit 9dbb88fc41e7a91c852795f00a663c0d073dd70a)
    
    Change-Id: I906ee47b5c30944a08fd8a0d7d6ea8b8c9e6a6a8
    Reviewed-on: https://gerrit.libreoffice.org/17581
    Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>
    Tested-by: Miklos Vajna <vmik...@collabora.co.uk>

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 450fac1..08b8fa2 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);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to