Kaydet (Commit) d1c88e82 authored tarafından Michael Stahl's avatar Michael Stahl Kaydeden (comit) Andras Timar

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 a624cf52)
üst 52da9806
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment