[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source

Michael Stahl mstahl at redhat.com
Mon Jun 15 13:00:38 PDT 2015


 sw/source/core/doc/docedt.cxx |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit d0a6b46a293197d293ffa86d94877805e620959c
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon Jun 15 21:15:54 2015 +0200

    sw: fix assert on exporting ooo24533-1.sxw to WW8
    
    There's a fly anchored at a paragraph inside of a table inside of a
    redline, and for some reason MoveRange() calls SwTableNode::MakeFrms(),
    which asserts in frmtool.cxx AppendObjs().
    
    The problem is that _SaveFlyInRange() removes the frame format from the
    SpzFrmFmts but it is still reachable from the SwNode::m_pAnchoredFlys.
    
    Change-Id: I3853c0072662bfb4f71f78451d3604ed567cd584
    (cherry picked from commit a624cf52ab08b18b08711567799a08f47c48f89b)

diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 8bc9e08..dafbb2a 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -44,6 +44,7 @@
 #include <unoflatpara.hxx>
 #include <SwGrammarMarkUp.hxx>
 #include <docedt.hxx>
+#include <atrfrm.hxx>
 
 #include <vector>
 
@@ -77,10 +78,13 @@ void _RestFlyInRange( _SaveFlyArr & rArr, const SwNodeIndex& rSttIdx,
         aAnchor.SetAnchor( &aPos );
         pFormat->GetDoc()->GetSpzFrameFormats()->push_back( pFormat );
         pFormat->SetFormatAttr( aAnchor );
+        // SetFormatAttr will not call Modify() because the node is the same :-/
+        aPos.nNode.GetNode().AddAnchoredFly(pFormat);
         SwContentNode* pCNd = aPos.nNode.GetNode().GetContentNode();
         if( pCNd && pCNd->getLayoutFrm( pFormat->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), 0, 0, false ) )
             pFormat->MakeFrms();
     }
+    sw::CheckAnchoredFlyConsistency(*rSttIdx.GetNode().GetDoc());
 }
 
 void _SaveFlyInRange( const SwNodeRange& rRg, _SaveFlyArr& rArr )
@@ -100,9 +104,11 @@ void _SaveFlyInRange( const SwNodeRange& rRg, _SaveFlyArr& rArr )
                             pFormat, false );
             rArr.push_back( aSave );
             pFormat->DelFrms();
+            pAPos->nNode.GetNode().RemoveAnchoredFly(pFormat);
             rFormats.erase( rFormats.begin() + n-- );
         }
     }
+    sw::CheckAnchoredFlyConsistency(*rRg.aStart.GetNode().GetDoc());
 }
 
 void _SaveFlyInRange( const SwPaM& rPam, const SwNodeIndex& rInsPos,
@@ -162,10 +168,12 @@ void _SaveFlyInRange( const SwPaM& rPam, const SwNodeIndex& rInsPos,
                                 pFormat, bInsPos );
                 rArr.push_back( aSave );
                 pFormat->DelFrms();
+                pAPos->nNode.GetNode().RemoveAnchoredFly(pFormat);
                 rFormats.erase( rFormats.begin() + n-- );
             }
         }
     }
+    sw::CheckAnchoredFlyConsistency(*rPam.GetPoint()->nNode.GetNode().GetDoc());
 }
 
 /// Delete and move all Flys at the paragraph, that are within the selection.


More information about the Libreoffice-commits mailing list