sd/qa/unit/data/xml/fdo64586_0.xml |    4 -
 sd/qa/unit/data/xml/n758621_0.xml  |    4 -
 sd/qa/unit/data/xml/n758621_1.xml  |    4 -
 sd/qa/unit/data/xml/n819614_0.xml  |    2 
 vcl/source/gdi/impgraph.cxx        |   79 +++++++++++++++++--------------------
 5 files changed, 44 insertions(+), 49 deletions(-)

New commits:
commit 001e99d683b8a386b623e8641d07b40819c5fd88
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Wed Aug 30 21:47:41 2023 +0200
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Sun Sep 3 21:20:03 2023 +0200

    fix ImpGraphic::operator==
    
    This was broken in
        commit 7b355669c6ddeab2e6cec692d6afdff41c61d0fb
        Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
        Date:   Sat Apr 14 15:13:05 2018 +0900
        Function to load graphic swapped out (loaded on demand)
    
    Change-Id: I8ad120b65da5a7c53e8f90c6e01207f75da11c34
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156310
    Tested-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    (cherry picked from commit 6d8c6e8d60956fd36094035a526c1a29a902204b)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156442
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/sd/qa/unit/data/xml/fdo64586_0.xml 
b/sd/qa/unit/data/xml/fdo64586_0.xml
index d8ae745787aa..cdabdd2119ad 100644
--- a/sd/qa/unit/data/xml/fdo64586_0.xml
+++ b/sd/qa/unit/data/xml/fdo64586_0.xml
@@ -4,7 +4,7 @@
   <FillTransparenceGradient style="LINEAR" startColor="000000" 
endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" 
startIntensity="100" endIntensity="100" stepCount="0"/>
   <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" 
border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" 
stepCount="0"/>
   <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
-  <FillBitmap width="32" height="32"/>
+  <FillBitmap/>
   <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" 
distance="20"/>
   <LineStart/>
   <LineEnd/>
@@ -18,7 +18,7 @@
   <FillTransparenceGradient style="LINEAR" startColor="000000" 
endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" 
startIntensity="100" endIntensity="100" stepCount="0"/>
   <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" 
border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" 
stepCount="0"/>
   <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
-  <FillBitmap width="32" height="32"/>
+  <FillBitmap/>
   <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" 
distance="20"/>
   <LineStart/>
   <LineEnd/>
diff --git a/sd/qa/unit/data/xml/n758621_0.xml 
b/sd/qa/unit/data/xml/n758621_0.xml
index aba12ebe685f..3284a1da87f9 100644
--- a/sd/qa/unit/data/xml/n758621_0.xml
+++ b/sd/qa/unit/data/xml/n758621_0.xml
@@ -4,7 +4,7 @@
   <FillTransparenceGradient style="LINEAR" startColor="000000" 
endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" 
startIntensity="100" endIntensity="100" stepCount="0"/>
   <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" 
border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" 
stepCount="0"/>
   <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
-  <FillBitmap width="32" height="32"/>
+  <FillBitmap/>
   <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" 
distance="20"/>
   <LineStart/>
   <LineEnd/>
@@ -18,7 +18,7 @@
   <FillTransparenceGradient style="LINEAR" startColor="000000" 
endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" 
startIntensity="100" endIntensity="100" stepCount="0"/>
   <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" 
border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" 
stepCount="0"/>
   <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
-  <FillBitmap width="32" height="32"/>
+  <FillBitmap/>
   <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" 
distance="20"/>
   <LineStart/>
   <LineEnd/>
diff --git a/sd/qa/unit/data/xml/n758621_1.xml 
b/sd/qa/unit/data/xml/n758621_1.xml
index 556c18673065..5d24431bed58 100644
--- a/sd/qa/unit/data/xml/n758621_1.xml
+++ b/sd/qa/unit/data/xml/n758621_1.xml
@@ -4,7 +4,7 @@
   <FillTransparenceGradient style="LINEAR" startColor="000000" 
endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" 
startIntensity="100" endIntensity="100" stepCount="0"/>
   <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" 
border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" 
stepCount="0"/>
   <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
-  <FillBitmap width="32" height="32"/>
+  <FillBitmap/>
   <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" 
distance="20"/>
   <LineStart/>
   <LineEnd/>
@@ -18,7 +18,7 @@
   <FillTransparenceGradient style="LINEAR" startColor="000000" 
endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" 
startIntensity="100" endIntensity="100" stepCount="0"/>
   <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" 
border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" 
stepCount="0"/>
   <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
-  <FillBitmap width="32" height="32"/>
+  <FillBitmap/>
   <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" 
distance="20"/>
   <LineStart/>
   <LineEnd/>
diff --git a/sd/qa/unit/data/xml/n819614_0.xml 
b/sd/qa/unit/data/xml/n819614_0.xml
index 3635f2d26d3e..c889b00c343a 100644
--- a/sd/qa/unit/data/xml/n819614_0.xml
+++ b/sd/qa/unit/data/xml/n819614_0.xml
@@ -4,7 +4,7 @@
   <FillTransparenceGradient style="LINEAR" startColor="000000" 
endColor="000000" angle="0" border="0" xOffset="50" yOffset="50" 
startIntensity="100" endIntensity="100" stepCount="0"/>
   <FillGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" 
border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" 
stepCount="0"/>
   <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
-  <FillBitmap width="32" height="32"/>
+  <FillBitmap/>
   <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" 
distance="20"/>
   <LineStart/>
   <LineEnd/>
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 54adbbf5bf5a..9d86f29fec51 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -283,61 +283,56 @@ ImpGraphic& ImpGraphic::operator=(ImpGraphic&& 
rImpGraphic)
     return *this;
 }
 
-bool ImpGraphic::operator==( const ImpGraphic& rImpGraphic ) const
+bool ImpGraphic::operator==( const ImpGraphic& rOther ) const
 {
-    bool bRet = false;
+    if( this == &rOther )
+        return true;
 
-    if( this == &rImpGraphic )
-        bRet = true;
-    else if (mbPrepared && rImpGraphic.mbPrepared)
-    {
-        bRet = (*mpGfxLink == *rImpGraphic.mpGfxLink);
-    }
-    else if (isAvailable() && rImpGraphic.isAvailable())
+    if (mbPrepared && rOther.mbPrepared)
+        return (*mpGfxLink == *rOther.mpGfxLink);
+
+    if (!isAvailable() || !rOther.isAvailable())
+        return false;
+
+    if ( meType != rOther.meType )
+        return false;
+
+    bool bRet = false;
+    switch( meType )
     {
-        switch( meType )
-        {
-            case GraphicType::NONE:
-                bRet = true;
-            break;
+        case GraphicType::NONE:
+        case GraphicType::Default:
+            return true;
 
-            case GraphicType::GdiMetafile:
-            {
-                if( rImpGraphic.maMetaFile == maMetaFile )
-                    bRet = true;
-            }
-            break;
+        case GraphicType::GdiMetafile:
+            return ( rOther.maMetaFile == maMetaFile );
 
-            case GraphicType::Bitmap:
+        case GraphicType::Bitmap:
+        {
+            if(maVectorGraphicData)
             {
-                if(maVectorGraphicData)
+                if(maVectorGraphicData == rOther.maVectorGraphicData)
                 {
-                    if(maVectorGraphicData == rImpGraphic.maVectorGraphicData)
-                    {
-                        // equal instances
-                        bRet = true;
-                    }
-                    else if(rImpGraphic.maVectorGraphicData)
-                    {
-                        // equal content
-                        bRet = (*maVectorGraphicData) == 
(*rImpGraphic.maVectorGraphicData);
-                    }
+                    // equal instances
+                    bRet = true;
                 }
-                else if( mpAnimation )
+                else if(rOther.maVectorGraphicData)
                 {
-                    if( rImpGraphic.mpAnimation && ( *rImpGraphic.mpAnimation 
== *mpAnimation ) )
-                        bRet = true;
+                    // equal content
+                    bRet = (*maVectorGraphicData) == 
(*rOther.maVectorGraphicData);
                 }
-                else if( !rImpGraphic.mpAnimation && ( rImpGraphic.maBitmapEx 
== maBitmapEx ) )
-                {
+            }
+            else if( mpAnimation )
+            {
+                if( rOther.mpAnimation && ( *rOther.mpAnimation == 
*mpAnimation ) )
                     bRet = true;
-                }
             }
-            break;
-
-            case GraphicType::Default:
-            break;
+            else if( !rOther.mpAnimation && ( rOther.maBitmapEx == maBitmapEx 
) )
+            {
+                bRet = true;
+            }
         }
+        break;
     }
 
     return bRet;

Reply via email to