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

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Wed May 5 19:21:23 UTC 2021


 include/vcl/formatter.hxx         |    1 
 include/vcl/settings.hxx          |   71 +++++++++++++-------------
 sc/source/ui/cctrl/cbuttonw.cxx   |    2 
 svtools/source/brwbox/brwbox1.cxx |    2 
 vcl/source/app/help.cxx           |    2 
 vcl/source/app/settings.cxx       |  100 +++++++++++++++++++-------------------
 vcl/source/control/spinbtn.cxx    |    2 
 vcl/source/control/spinfld.cxx    |    2 
 8 files changed, 91 insertions(+), 91 deletions(-)

New commits:
commit eff90f57b75c5aa0c18f0c87aa7bce36e414a68e
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Tue May 4 20:11:21 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed May 5 21:20:39 2021 +0200

    convert sal_uLong and tools::Long in vcl/settings
    
    Change-Id: I69711b791884218f4a14c85fe69072b9ea06dc79
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115109
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/vcl/formatter.hxx b/include/vcl/formatter.hxx
index 1657d5be01ba..e2879dc36076 100644
--- a/include/vcl/formatter.hxx
+++ b/include/vcl/formatter.hxx
@@ -22,6 +22,7 @@
 #include <config_options.h>
 #include <i18nlangtag/lang.h>
 #include <tools/link.hxx>
+#include <tools/solar.h>
 #include <vcl/settings.hxx>
 #include <map>
 #include <memory>
diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx
index 060e85beba4a..3130f22ed205 100644
--- a/include/vcl/settings.hxx
+++ b/include/vcl/settings.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_VCL_SETTINGS_HXX
 #define INCLUDED_VCL_SETTINGS_HXX
 
-#include <tools/solar.h>
 #include <vcl/dllapi.h>
 #include <tools/color.hxx>
 #include <tools/gen.hxx>
@@ -95,17 +94,17 @@ public:
     void                            SetDoubleClickTime( sal_uInt64 nDoubleClkTime );
     sal_uInt64                      GetDoubleClickTime() const;
 
-    void                            SetDoubleClickWidth( tools::Long nDoubleClkWidth );
-    tools::Long                            GetDoubleClickWidth() const;
+    void                            SetDoubleClickWidth( sal_Int32 nDoubleClkWidth );
+    sal_Int32                       GetDoubleClickWidth() const;
 
-    void                            SetDoubleClickHeight( tools::Long nDoubleClkHeight );
-    tools::Long                            GetDoubleClickHeight() const;
+    void                            SetDoubleClickHeight( sal_Int32 nDoubleClkHeight );
+    sal_Int32                       GetDoubleClickHeight() const;
 
-    void                            SetStartDragWidth( tools::Long nDragWidth );
-    tools::Long                            GetStartDragWidth() const;
+    void                            SetStartDragWidth( sal_Int32 nDragWidth );
+    sal_Int32                       GetStartDragWidth() const;
 
-    void                            SetStartDragHeight( tools::Long nDragHeight );
-    tools::Long                            GetStartDragHeight() const;
+    void                            SetStartDragHeight( sal_Int32 nDragHeight );
+    sal_Int32                       GetStartDragHeight() const;
 
     static sal_uInt16               GetStartDragCode();
 
@@ -113,17 +112,17 @@ public:
 
     static sal_uInt16               GetContextMenuClicks();
 
-    static sal_uLong                GetScrollRepeat();
+    static sal_Int32                GetScrollRepeat();
 
-    static sal_uLong                GetButtonStartRepeat();
+    static sal_Int32                GetButtonStartRepeat();
 
-    void                            SetButtonRepeat( sal_uLong nRepeat );
-    sal_uLong                       GetButtonRepeat() const;
+    void                            SetButtonRepeat( sal_Int32 nRepeat );
+    sal_Int32                       GetButtonRepeat() const;
 
-    static sal_uLong                GetActionDelay();
+    static sal_Int32                GetActionDelay();
 
-    void                            SetMenuDelay( sal_uLong nDelay );
-    sal_uLong                       GetMenuDelay() const;
+    void                            SetMenuDelay( sal_Int32 nDelay );
+    sal_Int32                       GetMenuDelay() const;
 
     void                            SetFollow( MouseFollowFlags nFollow );
     MouseFollowFlags                GetFollow() const;
@@ -487,27 +486,27 @@ public:
     void                            SetTabFont( const vcl::Font& rFont );
     const vcl::Font&                GetTabFont() const;
 
-    static tools::Long                     GetBorderSize();
+    static sal_Int32                GetBorderSize();
 
-    void                            SetTitleHeight( tools::Long nSize );
-    tools::Long                            GetTitleHeight() const;
+    void                            SetTitleHeight( sal_Int32 nSize );
+    sal_Int32                       GetTitleHeight() const;
 
-    void                            SetFloatTitleHeight( tools::Long nSize );
-    tools::Long                            GetFloatTitleHeight() const;
+    void                            SetFloatTitleHeight( sal_Int32 nSize );
+    sal_Int32                       GetFloatTitleHeight() const;
 
-    void                            SetScrollBarSize( tools::Long nSize );
-    tools::Long                            GetScrollBarSize() const;
+    void                            SetScrollBarSize( sal_Int32 nSize );
+    sal_Int32                       GetScrollBarSize() const;
 
-    void                            SetMinThumbSize( tools::Long nSize );
-    tools::Long                            GetMinThumbSize() const;
+    void                            SetMinThumbSize( sal_Int32 nSize );
+    sal_Int32                       GetMinThumbSize() const;
 
-    void                            SetSpinSize( tools::Long nSize );
-    tools::Long                            GetSpinSize() const;
+    void                            SetSpinSize( sal_Int32 nSize );
+    sal_Int32                       GetSpinSize() const;
 
-    static tools::Long                     GetSplitSize();
+    static sal_Int32                GetSplitSize();
 
-    void                            SetCursorSize( tools::Long nSize );
-    tools::Long                            GetCursorSize() const;
+    void                            SetCursorSize( sal_Int32 nSize );
+    sal_Int32                       GetCursorSize() const;
 
     void                            SetCursorBlinkTime( sal_uInt64 nBlinkTime );
     sal_uInt64                      GetCursorBlinkTime() const;
@@ -521,8 +520,8 @@ public:
     void                            SetDisplayOptions( DisplayOptions nOptions );
     DisplayOptions                  GetDisplayOptions() const;
 
-    void                            SetAntialiasingMinPixelHeight( tools::Long nMinPixel );
-    sal_uLong                       GetAntialiasingMinPixelHeight() const;
+    void                            SetAntialiasingMinPixelHeight( sal_Int32 nMinPixel );
+    sal_Int32                       GetAntialiasingMinPixelHeight() const;
 
     void                            SetOptions( StyleSettingsOptions nOptions );
     StyleSettingsOptions            GetOptions() const;
@@ -646,10 +645,10 @@ class VCL_DLLPUBLIC HelpSettings
 public:
                                     HelpSettings();
 
-    static sal_uLong                GetTipDelay();
-    void                            SetTipTimeout( sal_uLong nTipTimeout );
-    sal_uLong                       GetTipTimeout() const;
-    static sal_uLong                GetBalloonDelay();
+    static sal_Int32                GetTipDelay();
+    void                            SetTipTimeout( sal_Int32 nTipTimeout );
+    sal_Int32                       GetTipTimeout() const;
+    static sal_Int32                GetBalloonDelay();
 
     bool                            operator ==( const HelpSettings& rSet ) const;
     bool                            operator !=( const HelpSettings& rSet ) const;
diff --git a/sc/source/ui/cctrl/cbuttonw.cxx b/sc/source/ui/cctrl/cbuttonw.cxx
index 52660ee7a28d..b7f99f73181b 100644
--- a/sc/source/ui/cctrl/cbuttonw.cxx
+++ b/sc/source/ui/cctrl/cbuttonw.cxx
@@ -43,7 +43,7 @@ void ScDDComboBoxButton::SetOutputDevice( OutputDevice* pOutputDevice )
 void ScDDComboBoxButton::SetOptSizePixel()
 {
     aBtnSize = pOut->LogicToPixel(Size(8, 11), MapMode(MapUnit::MapAppFont));
-    aBtnSize.setWidth( std::max(aBtnSize.Width(), pOut->GetSettings().GetStyleSettings().GetScrollBarSize()) );
+    aBtnSize.setWidth( std::max(aBtnSize.Width(), static_cast<tools::Long>(pOut->GetSettings().GetStyleSettings().GetScrollBarSize())) );
 }
 
 void ScDDComboBoxButton::Draw( const Point& rAt,
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx
index a8d778ffb2f4..f815556553a9 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -154,7 +154,7 @@ tools::Long BrowseBox::GetBarHeight() const
     // (we can't ask the scrollbars for their size cause if we're zoomed they still have to be
     // resized - which is done in UpdateScrollbars)
 
-    return std::max(aStatusBarHeight->GetSizePixel().Height(), GetSettings().GetStyleSettings().GetScrollBarSize());
+    return std::max(aStatusBarHeight->GetSizePixel().Height(), static_cast<tools::Long>(GetSettings().GetStyleSettings().GetScrollBarSize()));
 }
 
 BrowseBox::BrowseBox( vcl::Window* pParent, WinBits nBits, BrowserMode nMode )
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx
index 4785b47aca3a..b630bc086aee 100644
--- a/vcl/source/app/help.cxx
+++ b/vcl/source/app/help.cxx
@@ -530,7 +530,7 @@ void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, QuickHe
         return;
 
     sal_uInt64 nCurTime = tools::Time::GetSystemTicks();
-    if ( ( nCurTime - aHelpData.mnLastHelpHideTime ) < HelpSettings::GetTipDelay() )
+    if ( ( nCurTime - aHelpData.mnLastHelpHideTime ) < o3tl::make_unsigned(HelpSettings::GetTipDelay()) )
         bNoDelay = true;
 
     pHelpWin = VclPtr<HelpTextWindow>::Create( pParent, rHelpText, nHelpWinStyle, nStyle );
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index a631b816e594..423e3eed679c 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -59,12 +59,12 @@ struct ImplMouseData
 {
     MouseSettingsOptions            mnOptions           = MouseSettingsOptions::NONE;
     sal_uInt64                      mnDoubleClkTime     = 500;
-    tools::Long                            mnDoubleClkWidth    = 2;
-    tools::Long                            mnDoubleClkHeight   = 2;
-    tools::Long                            mnStartDragWidth    = 2 ;
-    tools::Long                            mnStartDragHeight   = 2;
-    sal_uLong                       mnButtonRepeat      = 90;
-    sal_uLong                       mnMenuDelay         = 150;
+    sal_Int32                       mnDoubleClkWidth    = 2;
+    sal_Int32                       mnDoubleClkHeight   = 2;
+    sal_Int32                       mnStartDragWidth    = 2 ;
+    sal_Int32                       mnStartDragHeight   = 2;
+    sal_Int32                       mnButtonRepeat      = 90;
+    sal_Int32                       mnMenuDelay         = 150;
     MouseFollowFlags                mnFollow            = MouseFollowFlags::Menu;
     MouseMiddleButtonAction         mnMiddleButtonAction= MouseMiddleButtonAction::AutoScroll;
     MouseWheelBehaviour             mnWheelBehavior     = MouseWheelBehaviour::ALWAYS;
@@ -154,12 +154,12 @@ struct ImplStyleData
     vcl::Font                       maIconFont;
     vcl::Font                       maTabFont;
     vcl::Font                       maGroupFont;
-    tools::Long                            mnTitleHeight;
-    tools::Long                            mnFloatTitleHeight;
-    tools::Long                            mnScrollBarSize;
-    tools::Long                            mnSpinSize;
-    tools::Long                            mnCursorSize;
-    tools::Long                            mnAntialiasedMin;
+    sal_Int32                       mnTitleHeight;
+    sal_Int32                       mnFloatTitleHeight;
+    sal_Int32                       mnScrollBarSize;
+    sal_Int32                       mnSpinSize;
+    sal_Int32                       mnCursorSize;
+    sal_Int32                       mnAntialiasedMin;
     sal_uInt64                      mnCursorBlinkTime;
     DragFullOptions                 mnDragFullOptions;
     SelectionOptions                mnSelectionOptions;
@@ -178,7 +178,7 @@ struct ImplStyleData
     TriState                        meUseImagesInMenus;
     bool                            mnUseFlatBorders;
     bool                            mbPreferredUseImagesInMenus;
-    tools::Long                            mnMinThumbSize;
+    sal_Int32                       mnMinThumbSize;
     std::shared_ptr<vcl::IconThemeScanner>
                                     mIconThemeScanner;
     std::shared_ptr<vcl::IconThemeSelector>
@@ -220,7 +220,7 @@ struct ImplMiscData
 
 struct ImplHelpData
 {
-    sal_uLong                           mnTipTimeout = 3000;
+    sal_Int32                       mnTipTimeout = 3000;
 };
 
 struct ImplAllSettingsData
@@ -270,52 +270,52 @@ MouseSettings::GetDoubleClickTime() const
 }
 
 void
-MouseSettings::SetDoubleClickWidth( tools::Long nDoubleClkWidth )
+MouseSettings::SetDoubleClickWidth( sal_Int32 nDoubleClkWidth )
 {
     CopyData();
     mxData->mnDoubleClkWidth = nDoubleClkWidth;
 }
 
-tools::Long
+sal_Int32
 MouseSettings::GetDoubleClickWidth() const
 {
     return mxData->mnDoubleClkWidth;
 }
 
 void
-MouseSettings::SetDoubleClickHeight( tools::Long nDoubleClkHeight )
+MouseSettings::SetDoubleClickHeight( sal_Int32 nDoubleClkHeight )
 {
     CopyData();
     mxData->mnDoubleClkHeight = nDoubleClkHeight;
 }
 
-tools::Long
+sal_Int32
 MouseSettings::GetDoubleClickHeight() const
 {
     return mxData->mnDoubleClkHeight;
 }
 
 void
-MouseSettings::SetStartDragWidth( tools::Long nDragWidth )
+MouseSettings::SetStartDragWidth( sal_Int32 nDragWidth )
 {
     CopyData();
     mxData->mnStartDragWidth = nDragWidth;
 }
 
-tools::Long
+sal_Int32
 MouseSettings::GetStartDragWidth() const
 {
     return mxData->mnStartDragWidth;
 }
 
 void
-MouseSettings::SetStartDragHeight( tools::Long nDragHeight )
+MouseSettings::SetStartDragHeight( sal_Int32 nDragHeight )
 {
     CopyData();
     mxData->mnStartDragHeight = nDragHeight;
 }
 
-tools::Long
+sal_Int32
 MouseSettings::GetStartDragHeight() const
 {
     return mxData->mnStartDragHeight;
@@ -339,45 +339,45 @@ MouseSettings::GetContextMenuClicks()
     return 1;
 }
 
-sal_uLong
+sal_Int32
 MouseSettings::GetScrollRepeat()
 {
     return 100;
 }
 
-sal_uLong
+sal_Int32
 MouseSettings::GetButtonStartRepeat()
 {
     return 370;
 }
 
 void
-MouseSettings::SetButtonRepeat( sal_uLong nRepeat )
+MouseSettings::SetButtonRepeat( sal_Int32 nRepeat )
 {
     CopyData();
     mxData->mnButtonRepeat = nRepeat;
 }
 
-sal_uLong
+sal_Int32
 MouseSettings::GetButtonRepeat() const
 {
     return mxData->mnButtonRepeat;
 }
 
-sal_uLong
+sal_Int32
 MouseSettings::GetActionDelay()
 {
     return 250;
 }
 
 void
-MouseSettings::SetMenuDelay( sal_uLong nDelay )
+MouseSettings::SetMenuDelay( sal_Int32 nDelay )
 {
     CopyData();
     mxData->mnMenuDelay = nDelay;
 }
 
-sal_uLong
+sal_Int32
 MouseSettings::GetMenuDelay() const
 {
     return mxData->mnMenuDelay;
@@ -1862,91 +1862,91 @@ StyleSettings::GetTabFont() const
     return mxData->maTabFont;
 }
 
-tools::Long
+sal_Int32
 StyleSettings::GetBorderSize()
 {
     return 1;
 }
 
 void
-StyleSettings::SetTitleHeight( tools::Long nSize )
+StyleSettings::SetTitleHeight( sal_Int32 nSize )
 {
     CopyData();
     mxData->mnTitleHeight = nSize;
 }
 
-tools::Long
+sal_Int32
 StyleSettings::GetTitleHeight() const
 {
     return mxData->mnTitleHeight;
 }
 
 void
-StyleSettings::SetFloatTitleHeight( tools::Long nSize )
+StyleSettings::SetFloatTitleHeight( sal_Int32 nSize )
 {
     CopyData();
     mxData->mnFloatTitleHeight = nSize;
 }
 
-tools::Long
+sal_Int32
 StyleSettings::GetFloatTitleHeight() const
 {
     return mxData->mnFloatTitleHeight;
 }
 
 void
-StyleSettings::SetScrollBarSize( tools::Long nSize )
+StyleSettings::SetScrollBarSize( sal_Int32 nSize )
 {
     CopyData();
     mxData->mnScrollBarSize = nSize;
 }
 
-tools::Long
+sal_Int32
 StyleSettings::GetScrollBarSize() const
 {
     return mxData->mnScrollBarSize;
 }
 
 void
-StyleSettings::SetMinThumbSize( tools::Long nSize )
+StyleSettings::SetMinThumbSize( sal_Int32 nSize )
 {
     CopyData();
     mxData->mnMinThumbSize = nSize;
 }
 
-tools::Long
+sal_Int32
 StyleSettings::GetMinThumbSize() const
 {
     return mxData->mnMinThumbSize;
 }
 
 void
-StyleSettings::SetSpinSize( tools::Long nSize )
+StyleSettings::SetSpinSize( sal_Int32 nSize )
 {
     CopyData();
     mxData->mnSpinSize = nSize;
 }
 
-tools::Long
+sal_Int32
 StyleSettings::GetSpinSize() const
 {
     return mxData->mnSpinSize;
 }
 
-tools::Long
+sal_Int32
 StyleSettings::GetSplitSize()
 {
     return 3;
 }
 
 void
-StyleSettings::SetCursorSize( tools::Long nSize )
+StyleSettings::SetCursorSize( sal_Int32 nSize )
 {
     CopyData();
     mxData->mnCursorSize = nSize;
 }
 
-tools::Long
+sal_Int32
 StyleSettings::GetCursorSize() const
 {
     return mxData->mnCursorSize;
@@ -1962,7 +1962,7 @@ StyleSettings::SetCursorBlinkTime( sal_uInt64 nBlinkTime )
 sal_uInt64
 StyleSettings::GetCursorBlinkTime() const
 {
-    return static_cast<tools::Long>(mxData->mnCursorBlinkTime);
+    return mxData->mnCursorBlinkTime;
 }
 
 void
@@ -2005,13 +2005,13 @@ StyleSettings::GetDisplayOptions() const
 }
 
 void
-StyleSettings::SetAntialiasingMinPixelHeight( tools::Long nMinPixel )
+StyleSettings::SetAntialiasingMinPixelHeight( sal_Int32 nMinPixel )
 {
     CopyData();
     mxData->mnAntialiasedMin = nMinPixel;
 }
 
-sal_uLong
+sal_Int32
 StyleSettings::GetAntialiasingMinPixelHeight() const
 {
     return mxData->mnAntialiasedMin;
@@ -2689,14 +2689,14 @@ bool HelpSettings::operator ==( const HelpSettings& rSet ) const
     return (mxData->mnTipTimeout      == rSet.mxData->mnTipTimeout );
 }
 
-sal_uLong
+sal_Int32
 HelpSettings::GetTipDelay()
 {
     return 500;
 }
 
 void
-HelpSettings::SetTipTimeout( sal_uLong nTipTimeout )
+HelpSettings::SetTipTimeout( sal_Int32 nTipTimeout )
 {
     // copy if other references exist
     if (mxData.use_count() > 1)
@@ -2706,13 +2706,13 @@ HelpSettings::SetTipTimeout( sal_uLong nTipTimeout )
     mxData->mnTipTimeout = nTipTimeout;
 }
 
-sal_uLong
+sal_Int32
 HelpSettings::GetTipTimeout() const
 {
     return mxData->mnTipTimeout;
 }
 
-sal_uLong
+sal_Int32
 HelpSettings::GetBalloonDelay()
 {
     return 1500;
diff --git a/vcl/source/control/spinbtn.cxx b/vcl/source/control/spinbtn.cxx
index db8ca2b13e8f..90e2676eda52 100644
--- a/vcl/source/control/spinbtn.cxx
+++ b/vcl/source/control/spinbtn.cxx
@@ -58,7 +58,7 @@ SpinButton::SpinButton( vcl::Window* pParent, WinBits nStyle )
 
 IMPL_LINK(SpinButton, ImplTimeout, Timer*, pTimer, void)
 {
-    if (pTimer->GetTimeout() == MouseSettings::GetButtonStartRepeat())
+    if (pTimer->GetTimeout() == static_cast<sal_uInt64>(MouseSettings::GetButtonStartRepeat()))
     {
         pTimer->SetTimeout( GetSettings().GetMouseSettings().GetButtonRepeat() );
         pTimer->Start();
diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx
index 090579322fbe..bc47d369d7ae 100644
--- a/vcl/source/control/spinfld.cxx
+++ b/vcl/source/control/spinfld.cxx
@@ -940,7 +940,7 @@ Size SpinField::CalcSize(sal_Int32 nChars) const
 
 IMPL_LINK( SpinField, ImplTimeout, Timer*, pTimer, void )
 {
-    if ( pTimer->GetTimeout() == MouseSettings::GetButtonStartRepeat() )
+    if ( pTimer->GetTimeout() == static_cast<sal_uInt64>(MouseSettings::GetButtonStartRepeat()) )
     {
         pTimer->SetTimeout( GetSettings().GetMouseSettings().GetButtonRepeat() );
         pTimer->Start();


More information about the Libreoffice-commits mailing list