sw/source/core/view/viewsh.cxx |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

New commits:
commit c6b9b0045e9fa8eb0afc59b6620c17bed866f3d4
Author:     Mike Kaganski <[email protected]>
AuthorDate: Mon Feb 23 09:55:49 2026 +0100
Commit:     Mike Kaganski <[email protected]>
CommitDate: Mon Feb 23 11:30:09 2026 +0100

    Use ScopedVclPrtInstance to simplify lifetime management
    
    Change-Id: I8d9b567f2acbc8dd8e066c77d9ca5882be1cee64
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200033
    Reviewed-by: Mike Kaganski <[email protected]>
    Tested-by: Jenkins

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index d7492c040809..f80106b069f2 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -480,7 +480,7 @@ void 
SwViewShell::ImplUnlockPaint(std::vector<LockPaintReason>& rReasons, bool b
         if ( (bInSizeNotify || bVirDev ) && VisArea().HasArea() && 
!comphelper::LibreOfficeKit::isActive())
         {
             //Refresh with virtual device to avoid flickering.
-            VclPtrInstance<VirtualDevice> pVout( *mpOut );
+            ScopedVclPtrInstance<VirtualDevice> pVout(*mpOut);
             pVout->SetMapMode( mpOut->GetMapMode() );
             Size aSize( VisArea().SSize() );
             aSize.AdjustWidth(20 );
@@ -522,7 +522,6 @@ void 
SwViewShell::ImplUnlockPaint(std::vector<LockPaintReason>& rReasons, bool b
                 GetWin()->EnablePaint( true );
                 InvalidateAll(rReasons);
             }
-            pVout.disposeAndClear();
         }
         else
         {
@@ -1531,7 +1530,7 @@ bool SwViewShell::SmoothScroll( tools::Long lXDiff, 
tools::Long lYDiff, const to
 
         //create virtual device and set.
         const Size aPixSz = GetWin()->PixelToLogic(Size(1,1));
-        VclPtrInstance<VirtualDevice> pVout( *GetWin()->GetOutDev() );
+        ScopedVclPtrInstance<VirtualDevice> pVout(*GetWin()->GetOutDev());
         pVout->SetLineColor( GetWin()->GetOutDev()->GetLineColor() );
         pVout->SetFillColor( GetWin()->GetOutDev()->GetFillColor() );
         MapMode aMapMode( GetWin()->GetMapMode() );
@@ -1708,14 +1707,12 @@ bool SwViewShell::SmoothScroll( tools::Long lXDiff, 
tools::Long lYDiff, const to
                         --mnLockPaint;
                 }
             }
-            pVout.disposeAndClear();
             GetWin()->PaintImmediately();
             if ( !Imp()->m_bStopSmooth )
                 --mnLockPaint;
             SetFirstVisPageInvalid();
             return true;
         }
-        pVout.disposeAndClear();
     }
 #endif
 

Reply via email to