[Libreoffice-commits] core.git: include/svtools svtools/source

Caolán McNamara caolanm at redhat.com
Tue Jan 10 08:53:59 UTC 2017


 include/svtools/grfmgr.hxx        |    1 -
 svtools/source/graphic/grfmgr.cxx |   20 ++++++++++----------
 2 files changed, 10 insertions(+), 11 deletions(-)

New commits:
commit 8564b5beb1c49104d555e70d3c6134908fc0811f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jan 9 15:48:36 2017 +0000

    first GraphicManager* arg of ImplSetGraphicManager is thus always null
    
    Change-Id: I3da98280d3c1d95663e6e43ce7a5ca82c001c334

diff --git a/include/svtools/grfmgr.hxx b/include/svtools/grfmgr.hxx
index 929fe89..7a8291f 100644
--- a/include/svtools/grfmgr.hxx
+++ b/include/svtools/grfmgr.hxx
@@ -203,7 +203,6 @@ private:
     void                    SVT_DLLPRIVATE ImplConstruct();
     void                    SVT_DLLPRIVATE ImplAssignGraphicData();
     void                    SVT_DLLPRIVATE ImplSetGraphicManager(
-                                const GraphicManager* pMgr,
                                 const OString* pID = nullptr,
                                 const GraphicObject* pCopyObj = nullptr
                             );
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index 0b04656..d0e27c4 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -77,7 +77,7 @@ GraphicObject::GraphicObject() :
 {
     ImplConstruct();
     ImplAssignGraphicData();
-    ImplSetGraphicManager( nullptr );
+    ImplSetGraphicManager();
 }
 
 GraphicObject::GraphicObject( const Graphic& rGraphic ) :
@@ -87,7 +87,7 @@ GraphicObject::GraphicObject( const Graphic& rGraphic ) :
 {
     ImplConstruct();
     ImplAssignGraphicData();
-    ImplSetGraphicManager( nullptr );
+    ImplSetGraphicManager();
 }
 
 GraphicObject::GraphicObject( const GraphicObject& rGraphicObj ) :
@@ -98,7 +98,7 @@ GraphicObject::GraphicObject( const GraphicObject& rGraphicObj ) :
 {
     ImplConstruct();
     ImplAssignGraphicData();
-    ImplSetGraphicManager( nullptr, nullptr, &rGraphicObj );
+    ImplSetGraphicManager(nullptr, &rGraphicObj);
     if( rGraphicObj.HasUserData() && rGraphicObj.IsSwappedOut() )
         SetSwapState();
 }
@@ -112,7 +112,7 @@ GraphicObject::GraphicObject( const OString& rUniqueID ) :
     // assign default properties
     ImplAssignGraphicData();
 
-    ImplSetGraphicManager( nullptr, &rUniqueID );
+    ImplSetGraphicManager(&rUniqueID);
 
     // update properties
     ImplAssignGraphicData();
@@ -161,11 +161,11 @@ void GraphicObject::ImplAssignGraphicData()
     ImplAfterDataChange();
 }
 
-void GraphicObject::ImplSetGraphicManager( const GraphicManager* pMgr, const OString* pID, const GraphicObject* pCopyObj )
+void GraphicObject::ImplSetGraphicManager(const OString* pID, const GraphicObject* pCopyObj)
 {
-    if( !mpMgr || ( pMgr != mpMgr ) )
+    if (!mpMgr || mpMgr)
     {
-        if( !pMgr && mpMgr && ( mpMgr == mpGlobalMgr ) )
+        if (mpMgr && mpMgr == mpGlobalMgr)
             return;
         else
         {
@@ -180,7 +180,7 @@ void GraphicObject::ImplSetGraphicManager( const GraphicManager* pMgr, const OSt
                 }
             }
 
-            if( !pMgr )
+            if (true)
             {
                 if( !mpGlobalMgr )
                 {
@@ -208,7 +208,7 @@ void GraphicObject::ImplSetGraphicManager( const GraphicManager* pMgr, const OSt
                 mpMgr = mpGlobalMgr;
             }
             else
-                mpMgr = const_cast<GraphicManager*>(pMgr);
+                mpMgr = nullptr;
 
             mpMgr->ImplRegisterObj( *this, maGraphic, pID, pCopyObj );
         }
@@ -473,7 +473,7 @@ void GraphicObject::GraphicManagerDestroyed()
 {
     // we're alive, but our manager doesn't live anymore ==> connect to default manager
     mpMgr = nullptr;
-    ImplSetGraphicManager( nullptr );
+    ImplSetGraphicManager();
 }
 
 bool GraphicObject::IsCached( OutputDevice* pOut, const Point& rPt, const Size& rSz,


More information about the Libreoffice-commits mailing list