[Libreoffice-commits] core.git: vcl/inc vcl/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu May 6 10:37:13 UTC 2021


 vcl/inc/window.h             |    4 +++-
 vcl/source/gdi/impanmvw.cxx  |    4 ++--
 vcl/source/window/cursor.cxx |    2 +-
 vcl/source/window/paint.cxx  |    2 +-
 4 files changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 500e59e4825c0a140ed4bb4576ddb6a46f08c860
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu May 6 10:16:16 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu May 6 12:36:34 2021 +0200

    cid#1401334 silence Uncaught exception
    
    Change-Id: I7d0d9324afdfd5e06e2def62919dbefb78abdb3a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115173
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index b4a53a580a5c..6ca9b9a37031 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -28,6 +28,7 @@
 #include <vcl/inputctx.hxx>
 #include <vcl/window.hxx>
 #include <vcl/settings.hxx>
+#include <o3tl/deleter.hxx>
 #include <o3tl/typed_flags_set.hxx>
 
 #include <optional>
@@ -402,12 +403,13 @@ class VCL_DLLPUBLIC PaintBufferGuard
     tools::Rectangle m_aPaintRect;
 public:
     PaintBufferGuard(ImplFrameData* pFrameData, vcl::Window* pWindow);
-    ~PaintBufferGuard();
+    ~PaintBufferGuard() COVERITY_NOEXCEPT_FALSE;
     /// If this is called, then the dtor will also copy rRectangle to the window from the buffer, before restoring the state.
     void SetPaintRect(const tools::Rectangle& rRectangle);
     /// Returns either the frame's buffer or the window, in case of no buffering.
     vcl::RenderContext* GetRenderContext();
 };
+typedef std::unique_ptr<PaintBufferGuard, o3tl::default_delete<PaintBufferGuard>> PaintBufferGuardPtr;
 }
 
 // helper methods
diff --git a/vcl/source/gdi/impanmvw.cxx b/vcl/source/gdi/impanmvw.cxx
index be89b6247858..0091f6878182 100644
--- a/vcl/source/gdi/impanmvw.cxx
+++ b/vcl/source/gdi/impanmvw.cxx
@@ -142,7 +142,7 @@ void ImplAnimView::drawToPos( sal_uLong nPos )
 {
     VclPtr<vcl::RenderContext> pRenderContext = mpRenderContext;
 
-    std::unique_ptr<vcl::PaintBufferGuard> pGuard;
+    vcl::PaintBufferGuardPtr pGuard;
     if (mpRenderContext->GetOutDevType() == OUTDEV_WINDOW)
     {
         vcl::Window* pWindow = static_cast<vcl::Window*>(mpRenderContext.get());
@@ -174,7 +174,7 @@ void ImplAnimView::draw( sal_uLong nPos, VirtualDevice* pVDev )
 {
     VclPtr<vcl::RenderContext> pRenderContext = mpRenderContext;
 
-    std::unique_ptr<vcl::PaintBufferGuard> pGuard;
+    vcl::PaintBufferGuardPtr pGuard;
     if (!pVDev && mpRenderContext->GetOutDevType() == OUTDEV_WINDOW)
     {
         vcl::Window* pWindow = static_cast<vcl::Window*>(mpRenderContext.get());
diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx
index c8e9b5ab14ed..d7f2b56aab28 100644
--- a/vcl/source/window/cursor.cxx
+++ b/vcl/source/window/cursor.cxx
@@ -118,7 +118,7 @@ static void ImplCursorInvert(vcl::Window* pWindow, ImplCursorData const * pData)
     if (!pWindow || pWindow->IsDisposed())
         return;
 
-    std::unique_ptr<vcl::PaintBufferGuard> pGuard;
+    vcl::PaintBufferGuardPtr pGuard;
     const bool bDoubleBuffering = pWindow->SupportsDoubleBuffering();
     if (bDoubleBuffering)
         pGuard.reset(new vcl::PaintBufferGuard(pWindow->ImplGetWindowImpl()->mpFrameData, pWindow));
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index d991b0bdd3b2..f692bc64342f 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -105,7 +105,7 @@ PaintBufferGuard::PaintBufferGuard(ImplFrameData* pFrameData, vcl::Window* pWind
     pFrameData->mpBuffer->EnableRTL(pWindow->IsRTLEnabled());
 }
 
-PaintBufferGuard::~PaintBufferGuard()
+PaintBufferGuard::~PaintBufferGuard() COVERITY_NOEXCEPT_FALSE
 {
     if (!mpFrameData->mpBuffer)
         return;


More information about the Libreoffice-commits mailing list