diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2013-09-27 16:39:56 +0200 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2013-09-27 16:39:56 +0200 |
commit | 134741211d5c95a1a0ef07e13eb4846c62adce22 (patch) | |
tree | 9b220785f4b9f5e0775ef848e76ea9ff08a1acfb /sc/source | |
parent | 0854f0566c5d18b919b76df10b4bbd5a3606b7d6 (diff) |
Save Commit: must be squashed!!! ObjectGraphic refactor
Change-Id: I69f0b8bef3a08d1a325ccbe2b5f128df9cc14880
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/drawfunc/graphsh.cxx | 13 | ||||
-rw-r--r-- | sc/source/ui/view/printfun.cxx | 8 |
2 files changed, 11 insertions, 10 deletions
diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx index 6276575cd712..9b295b685266 100644 --- a/sc/source/ui/drawfunc/graphsh.cxx +++ b/sc/source/ui/drawfunc/graphsh.cxx @@ -59,7 +59,7 @@ public: aStr.Append( sal_Unicode(' ') ); aStr.Append( String( "External Edit" ) ); m_pView->BegUndo( aStr ); - pNewObj->SetGraphicObject( aGraphic ); + pNewObj->SetGraphicObject( GraphicObject::Create(aGraphic) ); m_pView->ReplaceObjectAtView( m_pObj, *pPageView, pNewObj ); m_pView->EndUndo(); } @@ -135,10 +135,10 @@ void ScGraphicShell::ExecuteFilter( SfxRequest& rReq ) if( pObj && pObj->ISA( SdrGrafObj ) && ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP ) { - GraphicObject aFilterObj( ( (SdrGrafObj*) pObj )->GetGraphicObject() ); + Graphic* pFilterObj = new Graphic( ( (SdrGrafObj*) pObj )->GetGraphicObject()->GetGraphic() ); if( SVX_GRAPHICFILTER_ERRCODE_NONE == - SvxGraphicFilter::ExecuteGrfFilterSlot( rReq, aFilterObj ) ) + SvxGraphicFilter::ExecuteGrfFilterSlot( rReq, &pFilterObj ) ) { SdrPageView* pPageView = pView->GetSdrPageView(); @@ -150,11 +150,12 @@ void ScGraphicShell::ExecuteFilter( SfxRequest& rReq ) aStr.Append( sal_Unicode(' ') ); aStr.Append( String( ScResId( SCSTR_UNDO_GRAFFILTER ) ) ); pView->BegUndo( aStr ); - pFilteredObj->SetGraphicObject( aFilterObj ); + pFilteredObj->SetGraphicObject( GraphicObject::Create(*pFilterObj )); pView->ReplaceObjectAtView( pObj, *pPageView, pFilteredObj ); pView->EndUndo(); } } + delete pFilterObj; } } @@ -189,9 +190,9 @@ void ScGraphicShell::ExecuteExternalEdit( SfxRequest& ) if( pObj && pObj->ISA( SdrGrafObj ) && ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP ) { - GraphicObject aGraphicObject( ( (SdrGrafObj*) pObj )->GetGraphicObject() ); + rtl::Reference<GraphicObject> xGraphicObject = ( (SdrGrafObj*) pObj )->GetGraphicObject(); ScExternalToolEdit* aExternalToolEdit = new ScExternalToolEdit( pView, pObj ); - aExternalToolEdit->Edit( &aGraphicObject ); + aExternalToolEdit->Edit( xGraphicObject ); } } diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index e7fa2bb3b623..8d0f1f802cce 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -1146,10 +1146,10 @@ static void lcl_DrawGraphic( const SvxBrushItem &rBrush, OutputDevice *pOut, Out // (pixel rounding is handled correctly, and a very small bitmap // is duplicated into a bigger one for better performance) - GraphicObject aObject( *pGraphic ); + rtl::Reference<GraphicObject> xObject = GraphicObject::Create( *pGraphic ); if( pOut->GetPDFWriter() && - (aObject.GetType() == GRAPHIC_BITMAP || aObject.GetType() == GRAPHIC_DEFAULT) ) + (xObject->GetType() == GRAPHIC_BITMAP || xObject->GetType() == GRAPHIC_DEFAULT) ) { // For PDF export, every draw // operation for bitmaps takes a noticeable @@ -1178,13 +1178,13 @@ static void lcl_DrawGraphic( const SvxBrushItem &rBrush, OutputDevice *pOut, Out const Size aSize( rOrg.GetSize() ); const double Abitmap( k1/k2 * aSize.Width()*aSize.Height() ); - aObject.DrawTiled( pOut, rOrg, aGrfSize, Size(0,0), + xObject->DrawTiled( pOut, rOrg, aGrfSize, Size(0,0), NULL, GRFMGR_DRAW_STANDARD, ::std::max( 128, static_cast<int>( sqrt(sqrt( Abitmap)) + .5 ) ) ); } else { - aObject.DrawTiled( pOut, rOrg, aGrfSize, Size(0,0) ); + xObject->DrawTiled( pOut, rOrg, aGrfSize, Size(0,0) ); } bDraw = false; |