[Libreoffice-commits] core.git: 2 commits - embeddedobj/source filter/source include/svx sd/source sfx2/source slideshow/source svx/source

Caolán McNamara caolanm at redhat.com
Thu Jan 12 11:19:26 UTC 2017


 embeddedobj/source/msole/oleembed.cxx            |   61 +++++++++++++++++++++--
 filter/source/msfilter/escherex.cxx              |   52 +++++++++----------
 include/svx/xbitmap.hxx                          |    2 
 sd/source/filter/eppt/epptso.cxx                 |    8 +--
 sfx2/source/view/ipclient.cxx                    |    2 
 slideshow/source/engine/shapes/shapeimporter.cxx |   39 +++++++-------
 svx/source/xml/xmlgrhlp.cxx                      |   17 +++---
 svx/source/xoutdev/xattrbmp.cxx                  |    6 +-
 8 files changed, 119 insertions(+), 68 deletions(-)

New commits:
commit 75367918028dffb7a137d29644a7a6e1f7af7c9b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jan 12 09:49:36 2017 +0000

    in extremis dump Ole10Native payload and launch system viewer on it
    
    so embedded plain text documents/source code/etc in word documents can be viewed
    by us under Linux
    
    Change-Id: I19e19619070841fe097c70297adc2e8b96d1c581

diff --git a/embeddedobj/source/msole/oleembed.cxx b/embeddedobj/source/msole/oleembed.cxx
index 91bc27c..c15962c 100644
--- a/embeddedobj/source/msole/oleembed.cxx
+++ b/embeddedobj/source/msole/oleembed.cxx
@@ -665,18 +665,25 @@ sal_Int32 SAL_CALL OleEmbeddedObject::getCurrentState()
 namespace
 {
 #ifndef _WIN32
-    bool lcl_CopyStream(const uno::Reference<io::XInputStream>& xIn, const uno::Reference<io::XOutputStream>& xOut)
+    bool lcl_CopyStream(const uno::Reference<io::XInputStream>& xIn, const uno::Reference<io::XOutputStream>& xOut, sal_Int32 nMaxCopy = SAL_MAX_INT32)
     {
+        if (nMaxCopy == 0)
+            return false;
+
         const sal_Int32 nChunkSize = 4096;
         uno::Sequence< sal_Int8 > aData(nChunkSize);
         sal_Int32 nTotalRead = 0;
         sal_Int32 nRead;
         do
         {
-            nRead = xIn->readBytes(aData, nChunkSize);
+            if (nTotalRead + aData.getLength() > nMaxCopy)
+            {
+                aData.realloc(nMaxCopy - nTotalRead);
+            }
+            nRead = xIn->readBytes(aData, aData.getLength());
             nTotalRead += nRead;
             xOut->writeBytes(aData);
-        } while (nRead == nChunkSize);
+        } while (nRead == nChunkSize && nTotalRead <= nMaxCopy);
         return nTotalRead != 0;
     }
 #endif
@@ -716,6 +723,52 @@ namespace
 
         bool bCopied = xCONTENTS.is() && lcl_CopyStream(xCONTENTS->getInputStream(), xStream->getOutputStream());
 
+        if (!bCopied)
+        {
+            uno::Reference< io::XStream > xOle10Native;
+            try
+            {
+                xNameContainer->getByName("\1Ole10Native") >>= xOle10Native;
+            }
+            catch (container::NoSuchElementException const&)
+            {
+                // ignore
+            }
+            if (xOle10Native.is())
+            {
+                const uno::Reference<io::XInputStream> xIn = xOle10Native->getInputStream();
+                xIn->skipBytes(4); //size of the entire stream minus 4 bytes
+                xIn->skipBytes(2); //word that represent the directory type
+                uno::Sequence< sal_Int8 > aData(1);
+                sal_Int32 nRead;
+                do
+                {
+                    nRead = xIn->readBytes(aData, 1);
+                } while (nRead == 1 && aData[0] != 0);  // file name plus extension of the attachment null terminated
+                do
+                {
+                    nRead = xIn->readBytes(aData, 1);
+                } while (nRead == 1 && aData[0] != 0);  // Fully Qualified File name with extension
+                xIn->skipBytes(1); //single byte
+                xIn->skipBytes(1); //single byte
+                xIn->skipBytes(2); //Word that represent the directory type
+                xIn->skipBytes(4); //len of string
+                do
+                {
+                    nRead = xIn->readBytes(aData, 1);
+                } while (nRead == 1 && aData[0] != 0);  // Actual string representing the file path
+                uno::Sequence< sal_Int8 > aLenData(4);
+                xIn->readBytes(aLenData, 4); //len of attachment
+                sal_uInt32 nLen = static_cast<sal_uInt32>
+                                              ((sal_uInt32)aLenData[0]
+                                            + ((sal_uInt32)aLenData[1] <<  8)
+                                            + ((sal_uInt32)aLenData[2] << 16)
+                                            + ((sal_uInt32)aLenData[3] << 24));
+
+                bCopied = lcl_CopyStream(xIn, xStream->getOutputStream(), nLen);
+            }
+        }
+
         uno::Reference< io::XSeekable > xSeekableStor(xObjectStream, uno::UNO_QUERY);
         if (xSeekableStor.is())
             xSeekableStor->seek(0);
@@ -862,7 +915,7 @@ void SAL_CALL OleEmbeddedObject::doVerb( sal_Int32 nVerbID )
                 }
             }
 
-            if ( m_aFilterName != "Text" && (!m_pOwnView || !m_pOwnView->Open()) )
+            if (!m_pOwnView || !m_pOwnView->Open())
             {
                 //Make a RO copy and see if the OS can find something to at
                 //least display the content for us
diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx
index 815d0f2..3826646 100644
--- a/sfx2/source/view/ipclient.cxx
+++ b/sfx2/source/view/ipclient.cxx
@@ -932,7 +932,7 @@ ErrCode SfxInPlaceClient::DoVerb( long nVerb )
                 }
                 catch ( embed::UnreachableStateException& )
                 {
-                    if ( nVerb == 0 || nVerb == embed::EmbedVerbs::MS_OLEVERB_OPEN )
+                    if (nVerb == embed::EmbedVerbs::MS_OLEVERB_PRIMARY || nVerb == embed::EmbedVerbs::MS_OLEVERB_OPEN || embed::EmbedVerbs::MS_OLEVERB_SHOW)
                     {
                         // a workaround for the default verb, usually makes sense for alien objects
                         try
commit a70a62c013318b45eb23d6451d442bc6f702a282
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jan 11 08:57:51 2017 +0000

    silence coverity#1371305 Missing move assignment operator
    
    Change-Id: I761e07d1583262d83074addbff4ca67b01640387

diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 80e09f9..575cb6e 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -1266,8 +1266,8 @@ bool EscherPropertyContainer::CreateOLEGraphicProperties(
             const Graphic* pGraphic = static_cast<SdrOle2Obj*>(pSdrOLE2)->GetGraphic();
             if ( pGraphic )
             {
-                GraphicObject aGraphicObject( *pGraphic );
-                bRetValue = CreateGraphicProperties( rXShape,aGraphicObject );
+                std::unique_ptr<GraphicObject> xGraphicObject(new GraphicObject(*pGraphic));
+                bRetValue = CreateGraphicProperties(rXShape, *xGraphicObject);
             }
         }
     }
@@ -1314,8 +1314,8 @@ bool EscherPropertyContainer::CreateMediaGraphicProperties(
         SdrObject* pSdrMedia( GetSdrObjectFromXShape( rXShape ) );  // SJ: leaving unoapi, because currently there is
         if ( dynamic_cast<const SdrMediaObj* >(pSdrMedia) !=  nullptr )               // no access to the native graphic object
         {
-            GraphicObject aGraphicObject( static_cast<SdrMediaObj*>(pSdrMedia)->getSnapshot() );
-            bRetValue = CreateGraphicProperties( rXShape, aGraphicObject );
+            std::unique_ptr<GraphicObject> xGraphicObject(new GraphicObject(static_cast<SdrMediaObj*>(pSdrMedia)->getSnapshot()));
+            bRetValue = CreateGraphicProperties(rXShape, *xGraphicObject);
         }
     }
     return bRetValue;
@@ -1367,7 +1367,7 @@ void EscherPropertyContainer::CreateEmbeddedBitmapProperties(
 
 namespace {
 
-GraphicObject lclDrawHatch( const css::drawing::Hatch& rHatch, const Color& rBackColor, bool bFillBackground, const Rectangle& rRect )
+GraphicObject* lclDrawHatch( const css::drawing::Hatch& rHatch, const Color& rBackColor, bool bFillBackground, const Rectangle& rRect )
 {
     // #i121183# For hatch, do no longer create a bitmap with the fixed size of 28x28 pixels. Also
     // do not create a bitmap in page size, that would explode file sizes (and have no good quality).
@@ -1390,23 +1390,21 @@ GraphicObject lclDrawHatch( const css::drawing::Hatch& rHatch, const Color& rBac
     aMtf.SetPrefMapMode(MapMode(MapUnit::Map100thMM));
     aMtf.SetPrefSize(rRect.GetSize());
 
-    return GraphicObject(Graphic(aMtf));
+    return new GraphicObject(Graphic(aMtf));
 }
 
 } // namespace
 
-
 void EscherPropertyContainer::CreateEmbeddedHatchProperties( const css::drawing::Hatch& rHatch, const Color& rBackColor, bool bFillBackground )
 {
     const Rectangle aRect(pShapeBoundRect ? *pShapeBoundRect : Rectangle(Point(0,0), Size(28000, 21000)));
-    GraphicObject aGraphicObject = lclDrawHatch( rHatch, rBackColor, bFillBackground, aRect );
-    OString aUniqueId = aGraphicObject.GetUniqueID();
+    std::unique_ptr<GraphicObject> xGraphicObject(lclDrawHatch(rHatch, rBackColor, bFillBackground, aRect));
+    OString aUniqueId = xGraphicObject->GetUniqueID();
     bool bRetValue = ImplCreateEmbeddedBmp( aUniqueId );
     if ( bRetValue )
         AddOpt( ESCHER_Prop_fillType, ESCHER_FillTexture );
 }
 
-
 bool EscherPropertyContainer::CreateGraphicProperties(
     const css::uno::Reference< css::beans::XPropertySet > & rXPropSet,
         const OUString& rSource, const bool bCreateFillBitmap, const bool bCreateCroppingAttributes,
@@ -1416,7 +1414,7 @@ bool EscherPropertyContainer::CreateGraphicProperties(
     bool        bCreateFillStyles = false;
 
     std::unique_ptr<GraphicAttr> pGraphicAttr;
-    GraphicObject   aGraphicObject;
+    std::unique_ptr<GraphicObject> xGraphicObject(new GraphicObject);
     OUString        aGraphicUrl;
     OString         aUniqueId;
 
@@ -1451,9 +1449,9 @@ bool EscherPropertyContainer::CreateGraphicProperties(
                 sal_uInt32 nErrCode = GraphicConverter::Import( aTemp, aGraphic, ConvertDataFormat::WMF );
                 if ( nErrCode == ERRCODE_NONE )
                 {
-                    aGraphicObject = aGraphic;
-                    aUniqueId = aGraphicObject.GetUniqueID();
-                    bIsGraphicMtf = aGraphicObject.GetType() == GraphicType::GdiMetafile;
+                    xGraphicObject.reset(new GraphicObject(aGraphic));
+                    aUniqueId = xGraphicObject->GetUniqueID();
+                    bIsGraphicMtf = xGraphicObject->GetType() == GraphicType::GdiMetafile;
                 }
             }
         }
@@ -1468,9 +1466,9 @@ bool EscherPropertyContainer::CreateGraphicProperties(
                 {
                     BitmapEx    aBitmapEx( VCLUnoHelper::GetBitmap( xBmp ) );
                     Graphic     aGraphic( aBitmapEx );
-                    aGraphicObject = aGraphic;
-                    aUniqueId = aGraphicObject.GetUniqueID();
-                    bIsGraphicMtf = aGraphicObject.GetType() == GraphicType::GdiMetafile;
+                    xGraphicObject.reset(new GraphicObject(aGraphic));
+                    aUniqueId = xGraphicObject->GetUniqueID();
+                    bIsGraphicMtf = xGraphicObject->GetType() == GraphicType::GdiMetafile;
                 }
             }
         }
@@ -1500,10 +1498,10 @@ bool EscherPropertyContainer::CreateGraphicProperties(
                 }
 
                 const Rectangle aRect(Point(0, 0), pShapeBoundRect ? pShapeBoundRect->GetSize() : Size(28000, 21000));
-                aGraphicObject = lclDrawHatch( aHatch, aBackColor, bFillBackground, aRect );
-                aUniqueId = aGraphicObject.GetUniqueID();
+                xGraphicObject.reset(lclDrawHatch(aHatch, aBackColor, bFillBackground, aRect));
+                aUniqueId = xGraphicObject->GetUniqueID();
                 eBitmapMode = css::drawing::BitmapMode_REPEAT;
-                bIsGraphicMtf = aGraphicObject.GetType() == GraphicType::GdiMetafile;
+                bIsGraphicMtf = xGraphicObject->GetType() == GraphicType::GdiMetafile;
             }
         }
 
@@ -1593,8 +1591,8 @@ bool EscherPropertyContainer::CreateGraphicProperties(
                         if ( nErrCode == ERRCODE_NONE )
                         {
                             // no
-                            aGraphicObject = aGraphic;
-                            aUniqueId = aGraphicObject.GetUniqueID();
+                            xGraphicObject.reset(new GraphicObject(aGraphic));
+                            aUniqueId = xGraphicObject->GetUniqueID();
                         }
                         // else: simply keep the graphic link
                     }
@@ -3809,8 +3807,8 @@ bool   EscherPropertyContainer::CreateBlipPropertiesforOLEControl(const css::uno
         SdrModel* pMod = pShape->GetModel();
         Graphic aGraphic(SdrExchangeView::GetObjGraphic( pMod, pShape));
 
-        GraphicObject   aGraphicObject = aGraphic;
-        OString  aUniqueId = aGraphicObject.GetUniqueID();
+        std::unique_ptr<GraphicObject> xGraphicObject(new GraphicObject(aGraphic));
+        OString aUniqueId = xGraphicObject->GetUniqueID();
         if ( aUniqueId.getLength() )
         {
             if ( pGraphicProvider && pPicOutStrm && pShapeBoundRect )
@@ -4198,9 +4196,9 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const OStrin
                                             const GraphicAttr* pGraphicAttr, const bool bOOxmlExport )
 {
     sal_uInt32          nBlibId = 0;
-    GraphicObject       aGraphicObject( rId );
+    std::unique_ptr<GraphicObject> xGraphicObject(new GraphicObject(rId));
 
-    EscherBlibEntry* p_EscherBlibEntry = new EscherBlibEntry( rPicOutStrm.Tell(), aGraphicObject, rId, pGraphicAttr );
+    EscherBlibEntry* p_EscherBlibEntry = new EscherBlibEntry( rPicOutStrm.Tell(), *xGraphicObject, rId, pGraphicAttr );
     if ( !p_EscherBlibEntry->IsEmpty() )
     {
         for ( sal_uInt32 i = 0; i < mnBlibEntrys; i++ )
@@ -4215,7 +4213,7 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const OStrin
 
         bool            bUseNativeGraphic( false );
 
-        Graphic             aGraphic( aGraphicObject.GetTransformedGraphic( pGraphicAttr ) );
+        Graphic             aGraphic(xGraphicObject->GetTransformedGraphic(pGraphicAttr));
         GfxLink             aGraphicLink;
         SvMemoryStream      aStream;
 
diff --git a/include/svx/xbitmap.hxx b/include/svx/xbitmap.hxx
index 0a2128e..761e8e1 100644
--- a/include/svx/xbitmap.hxx
+++ b/include/svx/xbitmap.hxx
@@ -30,7 +30,7 @@ class SVX_DLLPUBLIC XOBitmap
 {
 private:
     XBitmapType     eType;
-    GraphicObject   aGraphicObject;
+    std::unique_ptr<GraphicObject> xGraphicObject;
     sal_uInt16*     pPixelArray;
     Size            aArraySize;
     Color           aPixelColor;
diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index 69f2fc0..aa1ffcb0 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -113,8 +113,8 @@ sal_uInt16 PPTExBulletProvider::GetId( const OString& rUniqueId, Size& rGraphicS
     if ( !rUniqueId.isEmpty() )
     {
         Rectangle       aRect;
-        GraphicObject   aGraphicObject( rUniqueId );
-        Graphic         aMappedGraphic, aGraphic( aGraphicObject.GetGraphic() );
+        std::unique_ptr<GraphicObject> xGraphicObject(new GraphicObject(rUniqueId));
+        Graphic         aMappedGraphic, aGraphic(xGraphicObject->GetGraphic());
         Size            aPrefSize( aGraphic.GetPrefSize() );
         BitmapEx        aBmpEx( aGraphic.GetBitmapEx() );
 
@@ -139,10 +139,10 @@ sal_uInt16 PPTExBulletProvider::GetId( const OString& rUniqueId, Size& rGraphicS
                 rGraphicSize = aNewSize;
 
                 aMappedGraphic = Graphic( aBmpEx );
-                aGraphicObject = GraphicObject( aMappedGraphic );
+                xGraphicObject.reset(new GraphicObject(aMappedGraphic));
             }
         }
-        sal_uInt32 nId = pGraphicProv->GetBlibID( aBuExPictureStream, aGraphicObject.GetUniqueID(), aRect );
+        sal_uInt32 nId = pGraphicProv->GetBlibID(aBuExPictureStream, xGraphicObject->GetUniqueID(), aRect);
 
         if ( nId && ( nId < 0x10000 ) )
             nRetValue = (sal_uInt16)nId - 1;
diff --git a/slideshow/source/engine/shapes/shapeimporter.cxx b/slideshow/source/engine/shapes/shapeimporter.cxx
index 4caa9bc..1add738 100644
--- a/slideshow/source/engine/shapes/shapeimporter.cxx
+++ b/slideshow/source/engine/shapes/shapeimporter.cxx
@@ -60,16 +60,16 @@ namespace internal {
 
 namespace {
 
-bool importShapeGraphic(
-    GraphicObject & o_rGraphic,
-    uno::Reference<beans::XPropertySet> const& xPropSet )
+std::unique_ptr<GraphicObject> importShapeGraphic(uno::Reference<beans::XPropertySet> const& xPropSet)
 {
+    std::unique_ptr<GraphicObject> xRet;
+
     OUString aURL;
     if( !getPropertyValue( aURL, xPropSet, "GraphicURL") ||
         aURL.isEmpty() )
     {
         // no or empty property - cannot import shape graphic
-        return false;
+        return xRet;
     }
 
     OUString const aVndUrl(
@@ -85,7 +85,7 @@ bool importShapeGraphic(
         {
             OSL_FAIL( "ShapeImporter::importShape(): "
                         "embedded graphic has no graphic ID" );
-            return false;
+            return nullptr;
         }
 
         // unique ID string found in URL, extract
@@ -100,14 +100,14 @@ bool importShapeGraphic(
         // fetch already loaded graphic from graphic manager.
         OString const aOldString(OUStringToOString(aUniqueId,
             RTL_TEXTENCODING_UTF8));
-        o_rGraphic = GraphicObject( aOldString );
+        xRet.reset(new GraphicObject(aOldString));
 
 
-        if( GraphicType::Default == o_rGraphic.GetType()
-            || GraphicType::NONE == o_rGraphic.GetType() )
+        if (GraphicType::Default == xRet->GetType()
+            || GraphicType::NONE == xRet->GetType())
         {
             // even the GrfMgr does not seem to know this graphic
-            return false;
+            return nullptr;
         }
     }
     else
@@ -123,7 +123,7 @@ bool importShapeGraphic(
         {
             OSL_FAIL( "ShapeImporter::importShape(): "
                         "cannot create input stream for graphic" );
-            return false;
+            return nullptr;
         }
 
         Graphic aTmpGraphic;
@@ -132,12 +132,12 @@ bool importShapeGraphic(
         {
             OSL_FAIL( "ShapeImporter::importShape(): "
                         "Failed to import shape graphic from given URL" );
-            return false;
+            return nullptr;
         }
 
-        o_rGraphic = GraphicObject( aTmpGraphic );
+        xRet.reset(new GraphicObject(aTmpGraphic));
     }
-    return true;
+    return xRet;
 }
 
 /** This shape implementation just acts as a dummy for the layermanager.
@@ -307,18 +307,17 @@ ShapeSharedPtr ShapeImporter::createShape(
     }
     else if( shapeType == "com.sun.star.drawing.GraphicObjectShape" || shapeType == "com.sun.star.presentation.GraphicObjectShape" )
     {
-        GraphicObject aGraphicObject;
-
         // to get hold of GIF animations, inspect Graphic
         // objects more thoroughly (the plain-jane shape
         // metafile of course would only contain the first
         // animation frame)
-        if( !importShapeGraphic( aGraphicObject, xPropSet ) )
+        std::unique_ptr<GraphicObject> xGraphicObject(importShapeGraphic(xPropSet));
+        if (!xGraphicObject)
             return ShapeSharedPtr(); // error loading graphic -
                                      // no placeholders in
                                      // slideshow
 
-        if( !aGraphicObject.IsAnimated() )
+        if (!xGraphicObject->IsAnimated())
         {
             // no animation - simply utilize plain draw shape import
 
@@ -381,9 +380,9 @@ ShapeSharedPtr ShapeImporter::createShape(
 
 
         Graphic aGraphic(
-            aGraphicObject.GetTransformedGraphic(
-                aGraphicObject.GetPrefSize(),
-                aGraphicObject.GetPrefMapMode(),
+            xGraphicObject->GetTransformedGraphic(
+                xGraphicObject->GetPrefSize(),
+                xGraphicObject->GetPrefMapMode(),
                 aGraphAttrs ) );
 
         return DrawShape::create( xCurrShape,
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index 0212dc9..4ef3bfe 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 343c0f8..f6fd2c9 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;
 }
 


More information about the Libreoffice-commits mailing list