diff options
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/xml/xmlgrhlp.cxx | 17 | ||||
-rw-r--r-- | svx/source/xoutdev/xattrbmp.cxx | 6 |
2 files changed, 12 insertions, 11 deletions
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index 0212dc95b36b..4ef3bfe43dff 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -208,7 +208,7 @@ private: ::utl::TempFile* mpTmp; SvStream* mpOStm; Reference< XOutputStream > mxStmWrapper; - GraphicObject maGrfObj; + std::unique_ptr<GraphicObject> mxGrfObj; bool mbClosed; public: @@ -222,9 +222,10 @@ public: const GraphicObject& GetGraphicObject(); }; -SvXMLGraphicOutputStream::SvXMLGraphicOutputStream() : - mpTmp( new ::utl::TempFile ), - mbClosed( false ) +SvXMLGraphicOutputStream::SvXMLGraphicOutputStream() + : mpTmp(new ::utl::TempFile) + , mxGrfObj(new GraphicObject) + , mbClosed(false) { mpTmp->EnableKillingFile(); @@ -272,7 +273,7 @@ void SAL_CALL SvXMLGraphicOutputStream::closeOutput() const GraphicObject& SvXMLGraphicOutputStream::GetGraphicObject() { - if( mbClosed && ( maGrfObj.GetType() == GraphicType::NONE ) && mpOStm ) + if (mbClosed && mxGrfObj->GetType() == GraphicType::NONE && mpOStm) { Graphic aGraphic; @@ -329,8 +330,8 @@ const GraphicObject& SvXMLGraphicOutputStream::GetGraphicObject() } } - maGrfObj = aGraphic; - if( maGrfObj.GetType() != GraphicType::NONE ) + mxGrfObj.reset(new GraphicObject(aGraphic)); + if (mxGrfObj->GetType() != GraphicType::NONE) { delete mpOStm; mpOStm = nullptr; @@ -339,7 +340,7 @@ const GraphicObject& SvXMLGraphicOutputStream::GetGraphicObject() } } - return maGrfObj; + return *mxGrfObj; } } diff --git a/svx/source/xoutdev/xattrbmp.cxx b/svx/source/xoutdev/xattrbmp.cxx index 343c0f859ac4..f6fd2c967466 100644 --- a/svx/source/xoutdev/xattrbmp.cxx +++ b/svx/source/xoutdev/xattrbmp.cxx @@ -46,7 +46,7 @@ using namespace ::com::sun::star; XOBitmap::XOBitmap( const Bitmap& rBmp ) : eType ( XBitmapType::Import ), - aGraphicObject ( rBmp ), + xGraphicObject (new GraphicObject(rBmp)), pPixelArray ( nullptr ), bGraphicDirty ( false ) { @@ -67,7 +67,7 @@ const GraphicObject& XOBitmap::GetGraphicObject() const if( bGraphicDirty ) const_cast<XOBitmap*>(this)->Array2Bitmap(); - return aGraphicObject; + return *xGraphicObject; } void XOBitmap::Bitmap2Array() @@ -127,7 +127,7 @@ void XOBitmap::Array2Bitmap() } } - aGraphicObject = GraphicObject( pVDev->GetBitmap( Point(), Size( nLines, nLines ) ) ); + xGraphicObject.reset(new GraphicObject(pVDev->GetBitmap(Point(), Size(nLines, nLines)))); bGraphicDirty = false; } |