[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - include/svtools svtools/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Mon Jun 15 08:06:54 UTC 2020


 include/svtools/valueset.hxx        |    1 
 svtools/source/control/valueset.cxx |   51 +++++++++++-------------------------
 2 files changed, 17 insertions(+), 35 deletions(-)

New commits:
commit dbe8bc3cea4d4cb7b3f90caede01c186c49fa51b
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sun Jun 14 19:41:04 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Jun 15 10:06:04 2020 +0200

    bundle copies of the same ValueSet pattern together as a method
    
    Change-Id: Iea3c1de70ca840371aaffa3de678a622aa450c74
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96296
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit ec336de1bd600a131e6b7b0f2c2fdda98dd04fa3)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96281
    Tested-by: Jenkins

diff --git a/include/svtools/valueset.hxx b/include/svtools/valueset.hxx
index f1bdd154a790..29a17f530483 100644
--- a/include/svtools/valueset.hxx
+++ b/include/svtools/valueset.hxx
@@ -253,6 +253,7 @@ private:
     SVT_DLLPRIVATE void         ImplFireAccessibleEvent( short nEventId, const css::uno::Any& rOldValue, const css::uno::Any& rNewValue );
     SVT_DLLPRIVATE bool         ImplHasAccessibleListeners();
     SVT_DLLPRIVATE void         ImplTracking(const Point& rPos);
+    SVT_DLLPRIVATE void         QueueReformat();
     SVT_DLLPRIVATE void         RecalcScrollBar();
     DECL_DLLPRIVATE_LINK(ImplScrollHdl, weld::ScrolledWindow&, void);
 
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index 4bc20997393f..63d246b289d0 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -507,6 +507,14 @@ bool ValueSet::MouseMove(const MouseEvent& rMouseEvent)
     return CustomWidgetController::MouseMove(rMouseEvent);
 }
 
+void ValueSet::QueueReformat()
+{
+    queue_resize();
+    mbFormat = true;
+    if ( IsReallyVisible() && IsUpdateMode() )
+        Invalidate();
+}
+
 void ValueSet::RemoveItem( sal_uInt16 nItemId )
 {
     size_t nPos = GetItemPos( nItemId );
@@ -527,11 +535,7 @@ void ValueSet::RemoveItem( sal_uInt16 nItemId )
         mbNoSelection   = true;
     }
 
-    queue_resize();
-
-    mbFormat = true;
-    if ( IsReallyVisible() && IsUpdateMode() )
-        Invalidate();
+    QueueReformat();
 }
 
 void ValueSet::RecalcScrollBar()
@@ -687,10 +691,7 @@ void ValueSet::RecalculateItemSizes()
     {
         mnUserItemWidth = aLargestItem.Width();
         mnUserItemHeight = aLargestItem.Height();
-        mbFormat = true;
-        queue_resize();
-        if ( IsReallyVisible() && IsUpdateMode() )
-            Invalidate();
+        QueueReformat();
     }
 }
 
@@ -1456,10 +1457,7 @@ void ValueSet::SetColCount( sal_uInt16 nNewCols )
     if ( mnUserCols != nNewCols )
     {
         mnUserCols = nNewCols;
-        mbFormat = true;
-        queue_resize();
-        if (IsReallyVisible() && IsUpdateMode())
-            Invalidate();
+        QueueReformat();
     }
 }
 
@@ -1636,11 +1634,7 @@ void ValueSet::ImplInsertItem( std::unique_ptr<ValueSetItem> pItem, const size_t
         mItemList.push_back( std::move(pItem) );
     }
 
-    queue_resize();
-
-    mbFormat = true;
-    if ( IsReallyVisible() && IsUpdateMode() )
-        Invalidate();
+    QueueReformat();
 }
 
 int ValueSet::GetScrollWidth() const
@@ -1690,10 +1684,7 @@ void ValueSet::SetLineCount( sal_uInt16 nNewLines )
     if ( mnUserVisLines != nNewLines )
     {
         mnUserVisLines = nNewLines;
-        mbFormat = true;
-        queue_resize();
-        if ( IsReallyVisible() && IsUpdateMode() )
-            Invalidate();
+        QueueReformat();
     }
 }
 
@@ -1702,10 +1693,7 @@ void ValueSet::SetItemWidth( long nNewItemWidth )
     if ( mnUserItemWidth != nNewItemWidth )
     {
         mnUserItemWidth = nNewItemWidth;
-        mbFormat = true;
-        queue_resize();
-        if ( IsReallyVisible() && IsUpdateMode() )
-            Invalidate();
+        QueueReformat();
     }
 }
 
@@ -1727,10 +1715,7 @@ void ValueSet::SetItemHeight( long nNewItemHeight )
     if ( mnUserItemHeight != nNewItemHeight )
     {
         mnUserItemHeight = nNewItemHeight;
-        mbFormat = true;
-        queue_resize();
-        if ( IsReallyVisible() && IsUpdateMode() )
-            Invalidate();
+        QueueReformat();
     }
 }
 
@@ -1762,11 +1747,7 @@ void ValueSet::SetExtraSpacing( sal_uInt16 nNewSpacing )
     if ( GetStyle() & WB_ITEMBORDER )
     {
         mnSpacing = nNewSpacing;
-
-        mbFormat = true;
-        queue_resize();
-        if ( IsReallyVisible() && IsUpdateMode() )
-            Invalidate();
+        QueueReformat();
     }
 }
 


More information about the Libreoffice-commits mailing list