include/vcl/outdev.hxx       |    5 ++---
 include/vcl/print.hxx        |    2 +-
 vcl/inc/windowdev.hxx        |    2 +-
 vcl/source/gdi/print.cxx     |    3 +--
 vcl/source/outdev/outdev.cxx |    7 +++----
 vcl/source/window/window.cxx |   22 ++--------------------
 6 files changed, 10 insertions(+), 31 deletions(-)

New commits:
commit 73fa9ad58cd29a1f74dbe3ca3831c401f9e8886f
Author:     Noel Grandin <[email protected]>
AuthorDate: Mon Jan 26 10:09:04 2026 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Mon Jan 26 12:32:16 2026 +0100

    loplugin:constantparam OutputDevice::CopyArea
    
    always has bWindowInvalidate == false
    
    Change-Id: I4c911d4f38930242cd2a26117e55f9e158434548
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198122
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 5ec3694ddad0..a6a8607b8f7c 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -437,12 +437,11 @@ public:
 
     virtual void                CopyArea(
                                     const Point& rDestPt,
-                                    const Point& rSrcPt,  const Size& rSrcSize,
-                                    bool bWindowInvalidate = false );
+                                    const Point& rSrcPt,  const Size& rSrcSize 
);
 
 protected:
 
-    virtual void                CopyDeviceArea( SalTwoRect& aPosAry, bool 
bWindowInvalidate);
+    virtual void                CopyDeviceArea( SalTwoRect& aPosAry );
 
     virtual tools::Rectangle    GetBackgroundComponentBounds() const;
 
diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx
index 78e5809819ed..0bb322624e90 100644
--- a/include/vcl/print.hxx
+++ b/include/vcl/print.hxx
@@ -297,7 +297,7 @@ public:
                                     const OutputDevice& rOutDev ) override;
 
     virtual void                CopyArea( const Point& rDestPt, const Point& 
rSrcPt,
-                                    const Size& rSrcSize, bool 
bWindowInvalidate = false ) override;
+                                    const Size& rSrcSize ) override;
 
     virtual tools::Rectangle    GetBackgroundComponentBounds() const override;
 
diff --git a/vcl/inc/windowdev.hxx b/vcl/inc/windowdev.hxx
index 13522ae0fe23..2d7edffdc845 100644
--- a/vcl/inc/windowdev.hxx
+++ b/vcl/inc/windowdev.hxx
@@ -71,7 +71,7 @@ private:
     void ImplRefreshFontData(bool bNewFontLists) override;
     void ImplInitMapModeObjects() override;
 
-    virtual void CopyDeviceArea(SalTwoRect& aPosAry, bool bWindowInvalidate) 
override;
+    virtual void CopyDeviceArea(SalTwoRect& aPosAry) override;
     virtual const OutputDevice* DrawOutDevDirectCheck(const OutputDevice& 
rSrcDev) const override;
     virtual void DrawOutDevDirectProcess(const OutputDevice& rSrcDev, 
SalTwoRect& rPosAry,
                                          SalGraphics* pSrcGraphics) override;
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 0c8e6e7bf31c..526cdf2dc5d2 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -284,8 +284,7 @@ void Printer::DrawOutDev( const Point& /*rDestPt*/, const 
Size& /*rDestSize*/,
 }
 
 void Printer::CopyArea( const Point& /*rDestPt*/,
-                        const Point& /*rSrcPt*/,  const Size& /*rSrcSize*/,
-                        bool /*bWindowInvalidate*/ )
+                        const Point& /*rSrcPt*/,  const Size& /*rSrcSize*/ )
 {
     SAL_WARN( "vcl.gdi", "Don't use OutputDevice::CopyArea(...) with printer 
devices!" );
 }
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx
index 7cc13831015e..e563ccdc8aeb 100644
--- a/vcl/source/outdev/outdev.cxx
+++ b/vcl/source/outdev/outdev.cxx
@@ -499,8 +499,7 @@ void OutputDevice::DrawOutDev( const Point& rDestPt, const 
Size& rDestSize,
 }
 
 void OutputDevice::CopyArea( const Point& rDestPt,
-                             const Point& rSrcPt,  const Size& rSrcSize,
-                             bool bWindowInvalidate )
+                             const Point& rSrcPt,  const Size& rSrcSize )
 {
     if ( ImplIsRecordLayout() )
         return;
@@ -532,7 +531,7 @@ void OutputDevice::CopyArea( const Point& rDestPt,
 
         AdjustTwoRect( aPosAry, GetOutputRectPixel() );
 
-        CopyDeviceArea( aPosAry, bWindowInvalidate );
+        CopyDeviceArea( aPosAry );
     }
 
     SetRasterOp( eOldRop );
@@ -540,7 +539,7 @@ void OutputDevice::CopyArea( const Point& rDestPt,
 
 // Direct OutputDevice drawing protected function
 
-void OutputDevice::CopyDeviceArea( SalTwoRect& aPosAry, bool 
/*bWindowInvalidate*/)
+void OutputDevice::CopyDeviceArea( SalTwoRect& aPosAry )
 {
     if (aPosAry.mnSrcWidth == 0 || aPosAry.mnSrcHeight == 0 || 
aPosAry.mnDestWidth == 0 || aPosAry.mnDestHeight == 0)
         return;
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 958e72dd75f9..c2ad8872878c 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -1240,30 +1240,12 @@ ImplWinData* Window::ImplGetWinData() const
 }
 
 
-void WindowOutputDevice::CopyDeviceArea( SalTwoRect& aPosAry, bool 
bWindowInvalidate )
+void WindowOutputDevice::CopyDeviceArea( SalTwoRect& aPosAry )
 {
     if (aPosAry.mnSrcWidth == 0 || aPosAry.mnSrcHeight == 0 || 
aPosAry.mnDestWidth == 0 || aPosAry.mnDestHeight == 0)
         return;
 
-    if (bWindowInvalidate)
-    {
-        const tools::Rectangle aSrcRect(Point(aPosAry.mnSrcX, aPosAry.mnSrcY),
-                Size(aPosAry.mnSrcWidth, aPosAry.mnSrcHeight));
-
-        mxOwnerWindow->ImplMoveAllInvalidateRegions(aSrcRect,
-                aPosAry.mnDestX-aPosAry.mnSrcX,
-                aPosAry.mnDestY-aPosAry.mnSrcY,
-                false);
-
-        mpGraphics->CopyArea(aPosAry.mnDestX, aPosAry.mnDestY,
-                aPosAry.mnSrcX, aPosAry.mnSrcY,
-                aPosAry.mnSrcWidth, aPosAry.mnSrcHeight,
-                *this);
-
-        return;
-    }
-
-    OutputDevice::CopyDeviceArea(aPosAry, bWindowInvalidate);
+    OutputDevice::CopyDeviceArea(aPosAry);
 }
 
 const OutputDevice* WindowOutputDevice::DrawOutDevDirectCheck(const 
OutputDevice& rSrcDev) const

Reply via email to