vcl/source/outdev/eps.cxx |   50 +++++++++++++++++++++++-----------------------
 1 file changed, 25 insertions(+), 25 deletions(-)

New commits:
commit b914d1853e047452ed441a89db3b56e9fddd21a5
Author:     Christopher Sherlock <chris.sherloc...@gmail.com>
AuthorDate: Thu Aug 14 23:27:40 2025 +1000
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Aug 15 10:06:38 2025 +0200

    vcl: flatten OutputDevice::DrawEPS(()
    
    Change-Id: I023a773b25998405f4bd7693b93d33eddfcd06a4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189606
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/vcl/source/outdev/eps.cxx b/vcl/source/outdev/eps.cxx
index 4d529d11919b..397e10b16618 100644
--- a/vcl/source/outdev/eps.cxx
+++ b/vcl/source/outdev/eps.cxx
@@ -45,34 +45,34 @@ bool OutputDevice::DrawEPS( const Point& rPoint, const 
Size& rSize,
 
     tools::Rectangle aRect( ImplLogicToDevicePixel( tools::Rectangle( rPoint, 
rSize ) ) );
 
+    if (aRect.IsEmpty())
+        return true;
+
     bool bDrawn = true;
 
-    if( !aRect.IsEmpty() )
+    // draw the real EPS graphics
+    if( rGfxLink.GetData() && rGfxLink.GetDataSize() )
+    {
+        if( !mpGraphics && !AcquireGraphics() )
+            return bDrawn;
+        assert(mpGraphics);
+
+        if( mbInitClipRegion )
+            InitClipRegion();
+
+        aRect.Normalize();
+        bDrawn = mpGraphics->DrawEPS( aRect.Left(), aRect.Top(), 
aRect.GetWidth(), aRect.GetHeight(),
+                     const_cast<sal_uInt8*>(rGfxLink.GetData()), 
rGfxLink.GetDataSize(), *this );
+    }
+
+    // else draw the substitution graphics
+    if( !bDrawn && pSubst )
     {
-        // draw the real EPS graphics
-        if( rGfxLink.GetData() && rGfxLink.GetDataSize() )
-        {
-            if( !mpGraphics && !AcquireGraphics() )
-                return bDrawn;
-            assert(mpGraphics);
-
-            if( mbInitClipRegion )
-                InitClipRegion();
-
-            aRect.Normalize();
-            bDrawn = mpGraphics->DrawEPS( aRect.Left(), aRect.Top(), 
aRect.GetWidth(), aRect.GetHeight(),
-                         const_cast<sal_uInt8*>(rGfxLink.GetData()), 
rGfxLink.GetDataSize(), *this );
-        }
-
-        // else draw the substitution graphics
-        if( !bDrawn && pSubst )
-        {
-            GDIMetaFile* pOldMetaFile = mpMetaFile;
-
-            mpMetaFile = nullptr;
-            Graphic(*pSubst).Draw(*this, rPoint, rSize);
-            mpMetaFile = pOldMetaFile;
-        }
+        GDIMetaFile* pOldMetaFile = mpMetaFile;
+
+        mpMetaFile = nullptr;
+        Graphic(*pSubst).Draw(*this, rPoint, rSize);
+        mpMetaFile = pOldMetaFile;
     }
 
     return bDrawn;

Reply via email to