[Libreoffice-commits] core.git: include/vcl sfx2/source svtools/source vcl/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 6 15:24:15 UTC 2021


 include/vcl/event.hxx               |    9 ++-------
 sfx2/source/statbar/stbitem.cxx     |    2 +-
 svtools/source/control/valueset.cxx |    2 +-
 vcl/source/control/combobox.cxx     |    1 -
 vcl/source/control/imp_listbox.cxx  |    2 +-
 vcl/source/window/status.cxx        |    4 ++--
 6 files changed, 7 insertions(+), 13 deletions(-)

New commits:
commit ca4a3868c8314ae2f6246cc513baf78513042738
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Apr 6 08:54:27 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Apr 6 17:23:36 2021 +0200

    remove newly unused mpWindow member of UserDrawEvent
    
    Change-Id: I4c8c2b1c894ea55195be4b8b97926b16b8106edb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113630
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/vcl/event.hxx b/include/vcl/event.hxx
index ef87d7728f6d..229c1f5988d0 100644
--- a/include/vcl/event.hxx
+++ b/include/vcl/event.hxx
@@ -218,9 +218,6 @@ inline HelpEvent::HelpEvent( const Point& rMousePos, HelpEventMode nHelpMode ) :
 class VCL_DLLPUBLIC UserDrawEvent
 {
 private:
-    /// Window that owns the user draw.
-    VclPtr<vcl::Window> mpWindow;
-
     /// RenderContext to which we should draw - can be a VirtualDevice or anything.
     VclPtr<vcl::RenderContext> mpRenderContext;
 
@@ -229,17 +226,15 @@ private:
     bool                mbSelected;
 
 public:
-    UserDrawEvent(vcl::Window* pWindow, vcl::RenderContext* pRenderContext,
+    UserDrawEvent(vcl::RenderContext* pRenderContext,
                   const tools::Rectangle& rOutRect, sal_uInt16 nId, bool bSelected = false)
-        : mpWindow(pWindow)
-        , mpRenderContext(pRenderContext)
+        : mpRenderContext(pRenderContext)
         , maOutRect( rOutRect )
         , mnItemId(nId)
         , mbSelected(bSelected)
     {
     }
 
-    vcl::Window*        GetWindow() const { return mpWindow; }
     vcl::RenderContext* GetRenderContext() const { return mpRenderContext; }
     const tools::Rectangle&    GetRect() const { return maOutRect; }
     sal_uInt16          GetItemId() const { return mnItemId; }
diff --git a/sfx2/source/statbar/stbitem.cxx b/sfx2/source/statbar/stbitem.cxx
index d8a360a54a62..5f77b3de952a 100644
--- a/sfx2/source/statbar/stbitem.cxx
+++ b/sfx2/source/statbar/stbitem.cxx
@@ -340,7 +340,7 @@ void SAL_CALL SfxStatusBarControl::paint(
     if ( pOutDev )
     {
         ::tools::Rectangle aRect = VCLRectangle( rOutputRectangle );
-        UserDrawEvent aUserDrawEvent(nullptr, pOutDev, aRect, pBar->GetCurItemId());
+        UserDrawEvent aUserDrawEvent(pOutDev, aRect, pBar->GetCurItemId());
         Paint( aUserDrawEvent );
     }
 }
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index c36605225faa..c4456b1364ac 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -1393,7 +1393,7 @@ void ValueSet::ImplFormatItem(vcl::RenderContext const & rRenderContext, ValueSe
 
         if (pItem->meType == VALUESETITEM_USERDRAW)
         {
-            UserDrawEvent aUDEvt(nullptr, maVirDev.get(), aRect, pItem->mnId);
+            UserDrawEvent aUDEvt(maVirDev.get(), aRect, pItem->mnId);
             UserDraw(aUDEvt);
         }
         else
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 6ba717abab5a..cf6e0cfec9eb 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -1278,7 +1278,6 @@ bool ComboBox::IsUserDrawEnabled() const
 
 void ComboBox::DrawEntry(const UserDrawEvent& rEvt)
 {
-    SAL_WARN_IF(rEvt.GetWindow() != GetMainWindow(), "vcl", "DrawEntry?!");
     GetMainWindow()->DrawEntry(*rEvt.GetRenderContext(), rEvt.GetItemId(), /*bDrawImage*/false, /*bDrawText*/false);
 }
 
diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx
index 8f2269941986..25b42371e1c5 100644
--- a/vcl/source/control/imp_listbox.cxx
+++ b/vcl/source/control/imp_listbox.cxx
@@ -1634,7 +1634,7 @@ void ImplListBoxWindow::ImplPaint(vcl::RenderContext& rRenderContext, sal_Int32
             nPos = GetEntryList()->FindEntry(GetEntryList()->GetEntryText(nPos));
         nPos = nPos - GetEntryList()->GetMRUCount();
 
-        UserDrawEvent aUDEvt(this, &rRenderContext, aRect, nPos, bSelected);
+        UserDrawEvent aUDEvt(&rRenderContext, aRect, nPos, bSelected);
         maUserDrawHdl.Call( &aUDEvt );
         mbInUserDraw = false;
     }
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index e46147e1a87a..73b6ea80515a 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -430,14 +430,14 @@ void StatusBar::ImplDrawItem(vcl::RenderContext& rRenderContext, bool bOffScreen
         {
             mbInUserDraw = true;
             mpImplData->mpVirDev->EnableRTL( IsRTLEnabled() );
-            UserDrawEvent aODEvt(this, mpImplData->mpVirDev, tools::Rectangle(Point(), aTextRectSize), pItem->mnId);
+            UserDrawEvent aODEvt(mpImplData->mpVirDev, tools::Rectangle(Point(), aTextRectSize), pItem->mnId);
             UserDraw(aODEvt);
             mpImplData->mpVirDev->EnableRTL(false);
             mbInUserDraw = false;
         }
         else
         {
-            UserDrawEvent aODEvt(this, &rRenderContext, aTextRect, pItem->mnId);
+            UserDrawEvent aODEvt(&rRenderContext, aTextRect, pItem->mnId);
             UserDraw(aODEvt);
         }
     }


More information about the Libreoffice-commits mailing list