diff options
Diffstat (limited to 'sw/source/core/doc')
-rw-r--r-- | sw/source/core/doc/doc.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/doc/notxtfrm.cxx | 21 |
2 files changed, 22 insertions, 13 deletions
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index c6a5c444c85f..670059091ebe 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -1039,11 +1039,14 @@ SwFlyFrmFmt* SwDoc::Insert( const SwPaM &rRg, { if( !pFrmFmt ) pFrmFmt = GetFrmFmtFromPool( RES_POOLFRM_GRAPHIC ); - return _InsNoTxtNode( *rRg.GetPoint(), GetNodes().MakeGrfNode( + SwGrfNode* pSwGrfNode = GetNodes().MakeGrfNode( SwNodeIndex( GetNodes().GetEndOfAutotext() ), rGrfName, rFltName, pGraphic, - mpDfltGrfFmtColl ), + mpDfltGrfFmtColl ); + SwFlyFrmFmt* pSwFlyFrmFmt = _InsNoTxtNode( *rRg.GetPoint(), pSwGrfNode, pFlyAttrSet, pGrfAttrSet, pFrmFmt ); + pSwGrfNode->onGraphicChanged(); + return pSwFlyFrmFmt; } SwFlyFrmFmt* SwDoc::Insert( const SwPaM &rRg, const GraphicObject& rGrfObj, @@ -1053,10 +1056,13 @@ SwFlyFrmFmt* SwDoc::Insert( const SwPaM &rRg, const GraphicObject& rGrfObj, { if( !pFrmFmt ) pFrmFmt = GetFrmFmtFromPool( RES_POOLFRM_GRAPHIC ); - return _InsNoTxtNode( *rRg.GetPoint(), GetNodes().MakeGrfNode( + SwGrfNode* pSwGrfNode = GetNodes().MakeGrfNode( SwNodeIndex( GetNodes().GetEndOfAutotext() ), - rGrfObj, mpDfltGrfFmtColl ), + rGrfObj, mpDfltGrfFmtColl ); + SwFlyFrmFmt* pSwFlyFrmFmt = _InsNoTxtNode( *rRg.GetPoint(), pSwGrfNode, pFlyAttrSet, pGrfAttrSet, pFrmFmt ); + pSwGrfNode->onGraphicChanged(); + return pSwFlyFrmFmt; } SwFlyFrmFmt* SwDoc::Insert(const SwPaM &rRg, const svt::EmbeddedObjectRef& xObj, diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index 05935356fc0f..c42d80201065 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -609,7 +609,7 @@ sal_Bool SwNoTxtFrm::GetCrsrOfst(SwPosition* pPos, Point& , } #define CLEARCACHE( pNd ) {\ - (pNd)->GetGrfObj().ReleaseFromCache();\ + (pNd)->ReleaseGraphicFromCache();\ SwFlyFrm* pFly = FindFlyFrm();\ if( pFly && pFly->GetFmt()->GetSurround().IsContour() )\ {\ @@ -907,7 +907,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons } bool bForceSwap = false, bContinue = true; - GraphicObject& rGrfObj = pGrfNd->GetGrfObj(); + const GraphicObject& rGrfObj = pGrfNd->GetGrfObj(); GraphicAttr aGrfAttr; pGrfNd->GetGraphicAttr( aGrfAttr, this ); @@ -944,9 +944,9 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons else if( rGrfObj.IsCached( pOut, aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), &aGrfAttr )) { - rGrfObj.DrawWithPDFHandling( *pOut, - aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), - &aGrfAttr ); + pGrfNd->DrawGraphicWithPDFHandling(*pOut, + aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), + &aGrfAttr ); bContinue = false; } } @@ -979,7 +979,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons pShell->GetViewOptions()->IsPDFExport(), "pOut should not be a virtual device" ); - rGrfObj.StartAnimation( pOut, aAlignedGrfArea.Pos(), + pGrfNd->StartGraphicAnimation(pOut, aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), long(this), 0, GRFMGR_DRAW_STANDARD, pVout ); } @@ -1012,7 +1012,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons if(!bDone) { // fallback paint, uses replacement image - rGrfObj.DrawWithPDFHandling(*pOut, aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), &aGrfAttr); + pGrfNd->DrawGraphicWithPDFHandling(*pOut, aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), &aGrfAttr); } } } @@ -1170,9 +1170,12 @@ sal_Bool SwNoTxtFrm::IsTransparent() const void SwNoTxtFrm::StopAnimation( OutputDevice* pOut ) const { // Stop animated graphics - SwGrfNode* pGrfNd = (SwGrfNode*)GetNode()->GetGrfNode(); + const SwGrfNode* pGrfNd = dynamic_cast< const SwGrfNode* >(GetNode()->GetGrfNode()); + if( pGrfNd && pGrfNd->IsAnimated() ) - pGrfNd->GetGrfObj().StopAnimation( pOut, long(this) ); + { + const_cast< SwGrfNode* >(pGrfNd)->StopGraphicAnimation( pOut, long(this) ); + } } |