[Libreoffice-commits] core.git: include/vcl svx/source sw/source vcl/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Wed Nov 18 10:43:21 UTC 2020


 include/vcl/GraphicObject.hxx        |    3 +--
 svx/source/svdraw/svdograf.cxx       |    2 +-
 sw/source/core/graphic/ndgrf.cxx     |   12 ++++++------
 vcl/source/graphic/GraphicObject.cxx |    7 +------
 4 files changed, 9 insertions(+), 15 deletions(-)

New commits:
commit 6318f3a9805c9a8831a06e8bd471dea095fcf8ba
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Nov 18 10:04:49 2020 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed Nov 18 11:42:39 2020 +0100

    Remove unused GraphicObject::SetGraphic pCopyObj and rLink parameters
    
    The defaulted pCopyObj parameter of the first SetGraphic overload became unused
    with ea3d755ac949c1b6dada5c341e018f8c23f5d395 "vcl: detach usage and remove
    GraphicManager and GraphicCache", and then the rLink parameter of the second
    overload became unused with e4eb416c3ef81d098ed61caabd2077cbbb2418bc "remove
    swapping and link from GraphicObject and Graphic" (removing the need to have two
    different overloads).
    
    Change-Id: I15a648845ed474ee302e2a9836776ba74b9c44a9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106045
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/include/vcl/GraphicObject.hxx b/include/vcl/GraphicObject.hxx
index c302387995ff..d10b46b92c4c 100644
--- a/include/vcl/GraphicObject.hxx
+++ b/include/vcl/GraphicObject.hxx
@@ -166,8 +166,7 @@ public:
     bool                    operator!=( const GraphicObject& rCacheObj ) const { return !( *this == rCacheObj ); }
 
     const Graphic&          GetGraphic() const;
-    void                    SetGraphic( const Graphic& rGraphic, const GraphicObject* pCopyObj = nullptr);
-    void                    SetGraphic( const Graphic& rGraphic, std::u16string_view rLink );
+    void                    SetGraphic( const Graphic& rGraphic);
 
     /** Get graphic transformed according to given attributes
 
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 217d953d532d..f175f9c33181 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -749,7 +749,7 @@ SdrGrafObj& SdrGrafObj::operator=( const SdrGrafObj& rObj )
     if (mbIsSignatureLine && rObj.mpSignatureLineUnsignedGraphic)
         mpGraphicObject->SetGraphic(rObj.mpSignatureLineUnsignedGraphic);
     else
-        mpGraphicObject->SetGraphic( rObj.GetGraphic(), &rObj.GetGraphicObject() );
+        mpGraphicObject->SetGraphic( rObj.GetGraphic() );
 
     if( rObj.IsLinkedGraphic() )
     {
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index ab4057eaebf9..df244ccf1865 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -106,7 +106,7 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
     mbIsStreamReadOnly( false )
 {
     Graphic aGrf; aGrf.SetDefaultType();
-    maGrfObj.SetGraphic( aGrf, rGrfName );
+    maGrfObj.SetGraphic( aGrf );
 
     mbInSwapIn = mbChangeTwipSize =
         mbFrameInPaint = mbScaleImageMap = false;
@@ -190,7 +190,7 @@ bool SwGrfNode::ReRead(
 
         if( pGraphic )
         {
-            maGrfObj.SetGraphic( *pGraphic, sURLLink );
+            maGrfObj.SetGraphic( *pGraphic );
             onGraphicChanged();
             bReadGrf = true;
         }
@@ -199,7 +199,7 @@ bool SwGrfNode::ReRead(
             // reset data of the old graphic so that the correct placeholder is
             // shown in case the new link could not be loaded
             Graphic aGrf; aGrf.SetDefaultType();
-            maGrfObj.SetGraphic( aGrf, sURLLink );
+            maGrfObj.SetGraphic( aGrf );
 
             if( mxLink.is() )
             {
@@ -235,7 +235,7 @@ bool SwGrfNode::ReRead(
         {
             if( pGraphic )
             {
-                maGrfObj.SetGraphic( *pGraphic, sURLLink );
+                maGrfObj.SetGraphic( *pGraphic );
                 onGraphicChanged();
                 bReadGrf = true;
                 // create connection without update, as we have the graphic
@@ -245,7 +245,7 @@ bool SwGrfNode::ReRead(
             {
                 Graphic aGrf;
                 aGrf.SetDefaultType();
-                maGrfObj.SetGraphic( aGrf, sURLLink );
+                maGrfObj.SetGraphic( aGrf );
                 onGraphicChanged();
                 if ( bNewGrf )
                 {
@@ -356,7 +356,7 @@ void SwGrfNode::onGraphicChanged()
 
 void SwGrfNode::SetGraphic(const Graphic& rGraphic)
 {
-    maGrfObj.SetGraphic(rGraphic, OUString());
+    maGrfObj.SetGraphic(rGraphic);
     onGraphicChanged();
 }
 
diff --git a/vcl/source/graphic/GraphicObject.cxx b/vcl/source/graphic/GraphicObject.cxx
index 6728ab5d170e..aa5435d3ad50 100644
--- a/vcl/source/graphic/GraphicObject.cxx
+++ b/vcl/source/graphic/GraphicObject.cxx
@@ -602,16 +602,11 @@ const Graphic& GraphicObject::GetGraphic() const
     return maGraphic;
 }
 
-void GraphicObject::SetGraphic( const Graphic& rGraphic, const GraphicObject* /*pCopyObj*/)
+void GraphicObject::SetGraphic( const Graphic& rGraphic)
 {
     maGraphic = rGraphic;
 }
 
-void GraphicObject::SetGraphic( const Graphic& rGraphic, std::u16string_view /*rLink*/ )
-{
-    SetGraphic( rGraphic );
-}
-
 Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMode& rDestMap, const GraphicAttr& rAttr ) const
 {
     // #104550# Extracted from svx/source/svdraw/svdograf.cxx


More information about the Libreoffice-commits mailing list