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

Noel Grandin noel.grandin at collabora.co.uk
Fri Oct 21 09:09:11 UTC 2016


 include/vcl/button.hxx          |    1 -
 include/vcl/dockwin.hxx         |    1 -
 include/vcl/field.hxx           |    8 --------
 include/vcl/layout.hxx          |    9 ---------
 include/vcl/openglwin.hxx       |    2 --
 include/vcl/tabctrl.hxx         |    5 -----
 include/vcl/unohelp2.hxx        |    2 --
 include/vcl/virdev.hxx          |    2 --
 vcl/source/app/unohelp2.cxx     |    2 +-
 vcl/source/control/button.cxx   |    2 +-
 vcl/source/control/field.cxx    |    7 +------
 vcl/source/control/field2.cxx   |   11 +++--------
 vcl/source/control/tabctrl.cxx  |    2 +-
 vcl/source/gdi/virdev.cxx       |    2 +-
 vcl/source/window/dockwin.cxx   |    2 +-
 vcl/source/window/layout.cxx    |    4 ++--
 vcl/source/window/openglwin.cxx |    7 +------
 17 files changed, 12 insertions(+), 57 deletions(-)

New commits:
commit d24bc6089c13413e5d702f5606de0b8573a14f20
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Oct 21 09:55:09 2016 +0200

    loplugin:expandablemethodds in include/vcl
    
    Change-Id: I9ff378d9c7c9a221599c0a84df638b3acf8f069f
    Reviewed-on: https://gerrit.libreoffice.org/30121
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx
index 6ce35fa..c7976b4 100644
--- a/include/vcl/button.hxx
+++ b/include/vcl/button.hxx
@@ -130,7 +130,6 @@ protected:
     using Button::ImplGetTextStyle;
     SAL_DLLPRIVATE DrawTextFlags   ImplGetTextStyle( DrawFlags nDrawFlags ) const;
     SAL_DLLPRIVATE bool            IsSymbol() const { return ( (meSymbol != SymbolType::DONTKNOW) && (meSymbol != SymbolType::IMAGE) ); }
-    SAL_DLLPRIVATE bool            IsImage() const { return Button::HasImage(); }
 
                                    PushButton( const PushButton & ) = delete;
                                    PushButton& operator=( const PushButton & )
diff --git a/include/vcl/dockwin.hxx b/include/vcl/dockwin.hxx
index f0543ff..bbaef0f 100644
--- a/include/vcl/dockwin.hxx
+++ b/include/vcl/dockwin.hxx
@@ -267,7 +267,6 @@ public:
 
     SAL_DLLPRIVATE bool    ImplStartDocking( const Point& rPos );
     SAL_DLLPRIVATE bool    isDeferredInit() const { return mbIsDefferedInit; }
-    SAL_DLLPRIVATE bool    hasPendingLayout() const { return maLayoutIdle.IsActive(); }
     virtual        void    doDeferredInit(WinBits nBits);
 protected:
                     DockingWindow( WindowType nType );
diff --git a/include/vcl/field.hxx b/include/vcl/field.hxx
index d6612fd..09e9a4e 100644
--- a/include/vcl/field.hxx
+++ b/include/vcl/field.hxx
@@ -249,9 +249,6 @@ public:
 
 class VCL_DLLPUBLIC CurrencyFormatter : public NumericFormatter
 {
-private:
-    SAL_DLLPRIVATE void     ImplInit();
-
 protected:
                             CurrencyFormatter();
     SAL_DLLPRIVATE bool     ImplCurrencyReformat( const OUString& rStr, OUString& rOutStr );
@@ -329,7 +326,6 @@ public:
 
 
     void                    SetDate( const Date& rNewDate );
-    void                    SetUserDate( const Date& rNewDate );
     Date                    GetDate() const;
     void                    SetEmptyDate();
     bool                    IsEmptyDate() const;
@@ -339,8 +335,6 @@ public:
     static void             ExpandCentury( Date& rDate );
     static void             ExpandCentury( Date& rDate, sal_uInt16 nTwoDigitYearStart );
 
-    static Date             GetInvalidDate() { return Date( Date::EMPTY ); }
-
     /** enables or disables the enforcement of valid values
 
         If this is set to true (which is the default), then GetDate will always return a valid
@@ -414,8 +408,6 @@ public:
     void                    SetEmptyTime() { FormatterBase::SetEmptyFieldValue(); }
     bool                    IsEmptyTime() const { return FormatterBase::IsEmptyFieldValue(); }
 
-    static tools::Time      GetInvalidTime() { return tools::Time( 99, 99, 99 ); }
-
     /** enables or disables the enforcement of valid values
 
         If this is set to true (which is the default), then GetTime will always return a valid
diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index 8623260..7404630 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -39,11 +39,6 @@ public:
     //the rWindows alignment desires within that allocation
     static void setLayoutAllocation(vcl::Window &rWindow, const Point &rPos, const Size &rSize);
 
-    void markLayoutDirty()
-    {
-        m_bLayoutDirty = true;
-    }
-
     virtual void queue_resize(StateChangedType eReason = StateChangedType::Layout) override;
 protected:
     //these are the two that need to be implemented by
@@ -208,10 +203,6 @@ public:
         , m_eLayoutStyle(VCL_BUTTONBOX_DEFAULT_STYLE)
     {
     }
-    void set_layout(VclButtonBoxStyle eStyle)
-    {
-        m_eLayoutStyle = eStyle;
-    }
     virtual bool set_property(const OString &rKey, const OString &rValue) override;
     void sort_native_button_order();
 protected:
diff --git a/include/vcl/openglwin.hxx b/include/vcl/openglwin.hxx
index da89831..00a9643 100644
--- a/include/vcl/openglwin.hxx
+++ b/include/vcl/openglwin.hxx
@@ -48,8 +48,6 @@ public:
     virtual void MouseMove( const MouseEvent& rMEvt ) override;
     virtual void Command( const CommandEvent& rCEvt ) override;
 
-    bool IsInitialized() const;
-
     void Initialize();
 
 private:
diff --git a/include/vcl/tabctrl.hxx b/include/vcl/tabctrl.hxx
index 4e2ae4f..8783895 100644
--- a/include/vcl/tabctrl.hxx
+++ b/include/vcl/tabctrl.hxx
@@ -183,11 +183,6 @@ public:
     virtual Size calculateRequisition() const;
     void setAllocation(const Size &rAllocation);
 
-    void markLayoutDirty()
-    {
-        mbLayoutDirty = true;
-    }
-
     std::vector<sal_uInt16> GetPageIDs() const;
 
     virtual FactoryFunction GetUITestFactory() const override;
diff --git a/include/vcl/unohelp2.hxx b/include/vcl/unohelp2.hxx
index 7b7ebe9..84d08c5 100644
--- a/include/vcl/unohelp2.hxx
+++ b/include/vcl/unohelp2.hxx
@@ -43,8 +43,6 @@ namespace vcl { namespace unohelper {
                         TextDataObject( const OUString& rText );
                         virtual ~TextDataObject() override;
 
-        OUString&       GetString() { return maText; }
-
         // css::uno::XInterface
         css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) throw(css::uno::RuntimeException, std::exception) override;
         void          SAL_CALL acquire() throw() override  { OWeakObject::acquire(); }
diff --git a/include/vcl/virdev.hxx b/include/vcl/virdev.hxx
index 88792f1..9184ef8 100644
--- a/include/vcl/virdev.hxx
+++ b/include/vcl/virdev.hxx
@@ -68,8 +68,6 @@ private:
      */
     SAL_DLLPRIVATE void ImplFillOpaqueRectangle( const Rectangle& rRect );
 
-    SAL_DLLPRIVATE bool ForceZeroExtleadBug() const { return mbForceZeroExtleadBug; }
-
 protected:
     virtual bool AcquireGraphics() const override;
     virtual void ReleaseGraphics( bool bRelease = true ) override;
diff --git a/vcl/source/app/unohelp2.cxx b/vcl/source/app/unohelp2.cxx
index 125a8ad..3d98b12 100644
--- a/vcl/source/app/unohelp2.cxx
+++ b/vcl/source/app/unohelp2.cxx
@@ -76,7 +76,7 @@ namespace vcl { namespace unohelper {
         SotClipboardFormatId nT = SotExchange::GetFormat( rFlavor );
         if ( nT == SotClipboardFormatId::STRING )
         {
-            aAny <<= GetString();
+            aAny <<= maText;
         }
         else
         {
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index c5eed69..ebbe3c9 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -1653,7 +1653,7 @@ Size PushButton::CalcMinimumSize() const
         else
             aSize = Size( 26, 24 );
     }
-    else if ( IsImage() && ! (ImplGetButtonState() & DrawButtonFlags::NoImage) )
+    else if ( Button::HasImage() && ! (ImplGetButtonState() & DrawButtonFlags::NoImage) )
         aSize = GetModeImage().GetSizePixel();
     if( mnDDStyle == PushButtonDropdownStyle::MenuButton )
     {
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index 6e44a9d..8765e34 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -1836,14 +1836,9 @@ bool CurrencyFormatter::ImplCurrencyReformat( const OUString& rStr, OUString& rO
     }
 }
 
-inline void CurrencyFormatter::ImplInit()
-{
-    mnType = FORMAT_CURRENCY;
-}
-
 CurrencyFormatter::CurrencyFormatter()
 {
-    ImplInit();
+    mnType = FORMAT_CURRENCY;
 }
 
 CurrencyFormatter::~CurrencyFormatter()
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index 80861d6..499babe 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -1567,16 +1567,11 @@ void DateFormatter::SetShowDateCentury( bool bShowDateCentury )
 
 void DateFormatter::SetDate( const Date& rNewDate )
 {
-    SetUserDate( rNewDate );
+    ImplSetUserDate( rNewDate );
     maFieldDate = maLastDate;
     maLastDate = GetDate();
 }
 
-void DateFormatter::SetUserDate( const Date& rNewDate )
-{
-    ImplSetUserDate( rNewDate );
-}
-
 void DateFormatter::ImplSetUserDate( const Date& rNewDate, Selection* pNewSelection )
 {
     Date aNewDate = rNewDate;
@@ -1645,7 +1640,7 @@ Date DateFormatter::GetDate() const
                     aDate = Date( Date::SYSTEM );
             }
             else
-                aDate = GetInvalidDate();
+                aDate = Date( Date::EMPTY ); // set invalid date
         }
     }
 
@@ -2478,7 +2473,7 @@ tools::Time TimeFormatter::GetTime() const
         else
         {
             if ( bAllowMailformed )
-                aTime = GetInvalidTime();
+                aTime = tools::Time( 99, 99, 99 ); // set invalid time
             else
                 aTime = maLastTime;
         }
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 8456228..2e1635f 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -2180,7 +2180,7 @@ Size TabControl::GetOptimalSize() const
 
 void TabControl::queue_resize(StateChangedType eReason)
 {
-    markLayoutDirty();
+    mbLayoutDirty = true;
     Window::queue_resize(eReason);
 }
 
diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx
index dfc2f1e..4d5c197 100644
--- a/vcl/source/gdi/virdev.cxx
+++ b/vcl/source/gdi/virdev.cxx
@@ -553,7 +553,7 @@ long VirtualDevice::GetFontExtLeading() const
 {
 #ifdef UNX
     // backwards compatible line metrics after fixing #i60945#
-    if ( ForceZeroExtleadBug() )
+    if ( mbForceZeroExtleadBug )
         return 0;
 #endif
 
diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index 0b82598..e48df2e 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -1043,7 +1043,7 @@ Size DockingWindow::GetOptimalSize() const
 void DockingWindow::queue_resize(StateChangedType eReason)
 {
     bool bTriggerLayout = true;
-    if (hasPendingLayout() || isCalculatingInitialLayoutSize())
+    if (maLayoutIdle.IsActive() || isCalculatingInitialLayoutSize())
     {
         bTriggerLayout = false;
     }
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 7b4d12a..cfaec6b 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -166,7 +166,7 @@ void VclContainer::SetSizePixel(const Size& rAllocation)
 
 void VclContainer::queue_resize(StateChangedType eReason)
 {
-    markLayoutDirty();
+    m_bLayoutDirty = true;
     Window::queue_resize(eReason);
 }
 
@@ -716,7 +716,7 @@ bool VclButtonBox::set_property(const OString &rKey, const OString &rValue)
         {
             SAL_WARN("vcl.layout", "unknown layout style " << rValue.getStr());
         }
-        set_layout(eStyle);
+        m_eLayoutStyle = eStyle;
     }
     else
         return VclBox::set_property(rKey, rValue);
diff --git a/vcl/source/window/openglwin.cxx b/vcl/source/window/openglwin.cxx
index b7c309c..7d20fd7 100644
--- a/vcl/source/window/openglwin.cxx
+++ b/vcl/source/window/openglwin.cxx
@@ -141,14 +141,9 @@ void OpenGLWindow::setRenderer(IRenderer* pRenderer)
     mpRenderer = pRenderer;
 }
 
-bool OpenGLWindow::IsInitialized() const
-{
-    return mxImpl->IsInitialized();
-}
-
 void OpenGLWindow::Initialize()
 {
-    if (!IsInitialized())
+    if (!mxImpl->IsInitialized())
         mxImpl->Initialize();
 }
 


More information about the Libreoffice-commits mailing list