[Libreoffice-commits] core.git: formula/source fpicker/source framework/inc framework/source

Noel Grandin noel.grandin at collabora.co.uk
Wed Oct 19 07:57:34 UTC 2016


 formula/source/ui/dlg/ControlHelper.hxx               |    8 ----
 formula/source/ui/dlg/funcutl.cxx                     |   36 ++----------------
 formula/source/ui/dlg/parawin.cxx                     |   30 ++-------------
 formula/source/ui/dlg/parawin.hxx                     |    4 --
 fpicker/source/office/iodlgimp.cxx                    |    8 ----
 fpicker/source/office/iodlgimp.hxx                    |    3 -
 framework/inc/helper/ocomponentaccess.hxx             |   24 ------------
 framework/inc/helper/oframes.hxx                      |    2 -
 framework/inc/services/desktop.hxx                    |   11 -----
 framework/inc/uielement/toolbarsmenucontroller.hxx    |    1 
 framework/source/helper/ocomponentaccess.cxx          |   18 ---------
 framework/source/helper/oframes.cxx                   |   17 +-------
 framework/source/services/desktop.cxx                 |   16 +-------
 framework/source/uielement/toolbarsmenucontroller.cxx |    2 -
 14 files changed, 18 insertions(+), 162 deletions(-)

New commits:
commit 423936ffacb72f85b37961e4cd585fe2719799b7
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Oct 18 14:42:58 2016 +0200

    loplugin:expandablemethodds in formula..framework
    
    Change-Id: I6c8b1bb3b664faa92b2dc05955c30bfd35f6dfaa
    Reviewed-on: https://gerrit.libreoffice.org/30015
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/formula/source/ui/dlg/ControlHelper.hxx b/formula/source/ui/dlg/ControlHelper.hxx
index 4fc48cc..00da7a7 100644
--- a/formula/source/ui/dlg/ControlHelper.hxx
+++ b/formula/source/ui/dlg/ControlHelper.hxx
@@ -39,7 +39,6 @@ private:
 protected:
 
     virtual bool    PreNotify( NotifyEvent& rNEvt ) override;
-    void            SelectionChanged();
     virtual void    Resize() override;
     virtual void    GetFocus() override;
 
@@ -101,13 +100,6 @@ private:
     DECL_LINK( EdFocusHdl, Control&, void );
     DECL_LINK( EdModifyHdl, Edit&, void );
 
-protected:
-
-    void    FxClick();
-    void    FxFocus();
-    void    EdFocus();
-    void    EdModify();
-
 public:
 
     ArgInput();
diff --git a/formula/source/ui/dlg/funcutl.cxx b/formula/source/ui/dlg/funcutl.cxx
index f1f014c..9e9777a 100644
--- a/formula/source/ui/dlg/funcutl.cxx
+++ b/formula/source/ui/dlg/funcutl.cxx
@@ -260,48 +260,28 @@ void ArgInput::UpdateAccessibleNames()
     pRefBtn->SetAccessibleName(aName);
 }
 
-void ArgInput::FxClick()
-{
-    aFxClickLink.Call(*this);
-}
-
-void ArgInput::FxFocus()
-{
-    aFxFocusLink.Call(*this);
-}
-
-void ArgInput::EdFocus()
-{
-    aEdFocusLink.Call(*this);
-}
-
-void ArgInput::EdModify()
-{
-    aEdModifyLink.Call(*this);
-}
-
 IMPL_LINK( ArgInput, FxBtnClickHdl, Button*, pBtn, void )
 {
     if(pBtn == pBtnFx)
-        FxClick();
+        aFxClickLink.Call(*this);
 }
 
 IMPL_LINK( ArgInput, FxBtnFocusHdl, Control&, rControl, void )
 {
     if(&rControl == pBtnFx)
-        FxFocus();
+        aFxFocusLink.Call(*this);
 }
 
 IMPL_LINK( ArgInput, EdFocusHdl, Control&, rControl, void )
 {
     if(&rControl == pEdArg)
-        EdFocus();
+        aEdFocusLink.Call(*this);
 }
 
 IMPL_LINK( ArgInput, EdModifyHdl, Edit&, rEdit, void )
 {
     if(&rEdit == pEdArg)
-        EdModify();
+        aEdModifyLink.Call(*this);
 }
 
 // class EditBox
@@ -341,12 +321,6 @@ void EditBox::dispose()
     Control::dispose();
 }
 
-// When the selection is changed this function will be called
-void EditBox::SelectionChanged()
-{
-    aSelChangedLink.Call(*this);
-}
-
 // When the size is changed, MultiLineEdit must be adapted..
 void EditBox::Resize()
 {
@@ -411,7 +385,7 @@ IMPL_LINK_NOARG(EditBox, ChangedHdl, void*, void)
 
         if(aNewSel.Min()!=aOldSel.Min() || aNewSel.Max()!=aOldSel.Max())
         {
-            SelectionChanged();
+            aSelChangedLink.Call(*this);
             aOldSel=aNewSel;
         }
     }
diff --git a/formula/source/ui/dlg/parawin.cxx b/formula/source/ui/dlg/parawin.cxx
index 51a87c1..a6d5f41 100644
--- a/formula/source/ui/dlg/parawin.cxx
+++ b/formula/source/ui/dlg/parawin.cxx
@@ -223,7 +223,7 @@ void ParaWin::UpdateArgInput( sal_uInt16 nOffset, sal_uInt16 i )
             SetArgName( i, pFuncDesc->getParameterName(nRealArg) );
     }
     if (nArg<nArgs)
-        SetArgVal(i,aParaArray[nArg]);
+        aArgInput[i].SetArgVal(aParaArray[nArg]);
 }
 
 ParaWin::~ParaWin()
@@ -398,21 +398,6 @@ void ParaWin::SetArgNameFont(sal_uInt16 no,const vcl::Font& aFont)
     aArgInput[no].SetArgNameFont(aFont);
 }
 
-void ParaWin::SetArgVal(sal_uInt16 no,const OUString& aText)
-{
-    aArgInput[no].SetArgVal(aText);
-}
-
-void ParaWin::HideParaLine(sal_uInt16 no)
-{
-    aArgInput[no].Hide();
-}
-
-void ParaWin::ShowParaLine(sal_uInt16 no)
-{
-    aArgInput[no].Show();
-}
-
 void ParaWin::SetEdFocus()
 {
     UpdateArgDesc(0);
@@ -492,11 +477,12 @@ void ParaWin::UpdateParas()
         for ( i=0; (i<nArgs) && (i<4); i++ )
         {
             UpdateArgInput( nOffset, i );
-            ShowParaLine(i);
+            aArgInput[i].Show();
         }
     }
 
-    for ( i=nArgs; i<4; i++ ) HideParaLine(i);
+    for ( i=nArgs; i<4; i++ )
+        aArgInput[i].Hide();
 }
 
 
@@ -542,12 +528,6 @@ void ParaWin::ArgumentModified()
     aArgModifiedLink.Call(*this);
 }
 
-void ParaWin::FxClick()
-{
-    aFxLink.Call(*this);
-}
-
-
 IMPL_LINK( ParaWin, GetFxHdl, ArgInput&, rPtr, void )
 {
     sal_uInt16 nOffset = GetSliderPos();
@@ -565,7 +545,7 @@ IMPL_LINK( ParaWin, GetFxHdl, ArgInput&, rPtr, void )
     {
         aArgInput[nEdFocus].SetArgSelection(Selection(0,SELECTION_MAX ));
         nActiveLine=nEdFocus+nOffset;
-        FxClick();
+        aFxLink.Call(*this);
     }
 }
 
diff --git a/formula/source/ui/dlg/parawin.hxx b/formula/source/ui/dlg/parawin.hxx
index 8c41581..a1c1ad6 100644
--- a/formula/source/ui/dlg/parawin.hxx
+++ b/formula/source/ui/dlg/parawin.hxx
@@ -102,7 +102,6 @@ protected:
 
         void            SliderMoved();
         void            ArgumentModified();
-        void            FxClick();
 
         void            InitArgInput( sal_uInt16 nPos, FixedText& rFtArg, PushButton& rBtnFx,
                                         ArgEdit& rEdArg, RefButton& rRefBtn);
@@ -114,10 +113,7 @@ protected:
 
         void            SetArgName      (sal_uInt16 no,const OUString &aArg);
         void            SetArgNameFont  (sal_uInt16 no,const vcl::Font&);
-        void            SetArgVal       (sal_uInt16 no,const OUString &aArg);
 
-        void            HideParaLine(sal_uInt16 no);
-        void            ShowParaLine(sal_uInt16 no);
         void            UpdateArgDesc( sal_uInt16 nArg );
         void            UpdateArgInput( sal_uInt16 nOffset, sal_uInt16 i );
 
diff --git a/fpicker/source/office/iodlgimp.cxx b/fpicker/source/office/iodlgimp.cxx
index 7d07f6e..cd4542c 100644
--- a/fpicker/source/office/iodlgimp.cxx
+++ b/fpicker/source/office/iodlgimp.cxx
@@ -265,12 +265,6 @@ namespace {
     }
 }
 
-void SvtExpFileDlg_Impl::ClearFilterList( )
-{
-    _pLbFilter->Clear();
-}
-
-
 void SvtExpFileDlg_Impl::SetCurFilter( SvtFileDialogFilter_Impl* pFilter, const OUString& rDisplayName )
 {
     DBG_ASSERT( pFilter, "SvtExpFileDlg_Impl::SetCurFilter: invalid filter!" );
@@ -300,7 +294,7 @@ void SvtExpFileDlg_Impl::InsertFilterListEntry( const SvtFileDialogFilter_Impl*
 void SvtExpFileDlg_Impl::InitFilterList( )
 {
     // clear the current list
-    ClearFilterList( );
+    _pLbFilter->Clear();
 
     // reinit it
     sal_uInt16 nPos = m_aFilter.size();
diff --git a/fpicker/source/office/iodlgimp.hxx b/fpicker/source/office/iodlgimp.hxx
index 7781a2e..fe49631 100644
--- a/fpicker/source/office/iodlgimp.hxx
+++ b/fpicker/source/office/iodlgimp.hxx
@@ -192,9 +192,8 @@ public:
     inline  void            SetFilterListSelectHdl( const Link<ListBox&,void>& _rHandler );
 
     // inits the listbox for the filters from the filter list (_pFilter)
-            void            ClearFilterList( );
             void            InitFilterList( );
-    inline  bool        HasFilterListEntry( const OUString& _rFilterName );
+    inline  bool            HasFilterListEntry( const OUString& _rFilterName );
     inline  void            SelectFilterListEntry( const OUString& _rFilterName );
     inline  void            SetNoFilterListSelection( );
             void            InsertFilterListEntry( const SvtFileDialogFilter_Impl* _pFilterDesc );
diff --git a/framework/inc/helper/ocomponentaccess.hxx b/framework/inc/helper/ocomponentaccess.hxx
index 1d541b1..3109192 100644
--- a/framework/inc/helper/ocomponentaccess.hxx
+++ b/framework/inc/helper/ocomponentaccess.hxx
@@ -160,30 +160,6 @@ class OComponentAccess  :   public ::cppu::WeakImplHelper< css::container::XEnum
 
         css::uno::Reference< css::lang::XComponent > impl_getFrameComponent( const css::uno::Reference< css::frame::XFrame >& xFrame ) const;
 
-    //  debug methods
-    //  (should be private everyway!)
-
-        /*-****************************************************************************************************
-            @short      debug-method to check incoming parameter of some other mehods of this class
-            @descr      The following methods are used to check parameters for other methods
-                        of this class. The return value is used directly for an ASSERT(...).
-
-            @seealso    ASSERTs in implementation!
-
-            @param      references to checking variables
-            @return     sal_False ,on invalid parameter.
-            @return     sal_True  ,otherwise
-        *//*-*****************************************************************************************************/
-
-    private:
-
-        static bool impldbg_checkParameter_OComponentAccessCtor( const css::uno::Reference< css::frame::XDesktop >& xOwner );
-
-    //  variables
-    //  (should be private everyway!)
-
-    private:
-
         css::uno::WeakReference< css::frame::XDesktop >     m_xOwner;   /// weak reference to the desktop object!
 
 };      //  class OComponentAccess
diff --git a/framework/inc/helper/oframes.hxx b/framework/inc/helper/oframes.hxx
index 9f82c47..af330aa 100644
--- a/framework/inc/helper/oframes.hxx
+++ b/framework/inc/helper/oframes.hxx
@@ -212,8 +212,6 @@ class OFrames   :   public ::cppu::WeakImplHelper< css::frame::XFrames >
     private:
         static bool impldbg_checkParameter_OFramesCtor  (   const   css::uno::Reference< css::frame::XFrame >&              xOwner          ,
                                                                         FrameContainer*                                         pFrameContainer );
-        static bool impldbg_checkParameter_append       (   const   css::uno::Reference< css::frame::XFrame >&              xFrame          );
-        static bool impldbg_checkParameter_remove       (   const   css::uno::Reference< css::frame::XFrame >&              xFrame          );
         static bool impldbg_checkParameter_queryFrames  (           sal_Int32                                               nSearchFlags    );
 
     //  variables
diff --git a/framework/inc/services/desktop.hxx b/framework/inc/services/desktop.hxx
index 8e90ba6..8aa56ef 100644
--- a/framework/inc/services/desktop.hxx
+++ b/framework/inc/services/desktop.hxx
@@ -386,22 +386,11 @@ class Desktop : private cppu::BaseMutex,
          */
         bool impl_closeFrames(bool bAllowUI);
 
-    //  debug methods
-    //  (should be private every time!)
-
     private:
 
-        static bool implcp_addEventListener         ( const css::uno::Reference< css::lang::XEventListener >&           xListener        );
-        static bool implcp_removeEventListener      ( const css::uno::Reference< css::lang::XEventListener >&           xListener        );
-
         bool m_bIsTerminated;  /// check flag to protect us against dispose before terminate!
                                     /// see dispose() for further information!
 
-    //  variables
-    //  (should be private every time!)
-
-    private:
-
         css::uno::Reference< css::uno::XComponentContext >              m_xContext;               /// reference to factory, which has create this instance
         FrameContainer                                                  m_aChildTaskContainer;    /// array of child tasks (children of desktop are tasks; and tasks are also frames - But pure frames are not accepted!)
         ::cppu::OMultiTypeInterfaceContainerHelper                      m_aListenerContainer;     /// container for ALL Listener
diff --git a/framework/inc/uielement/toolbarsmenucontroller.hxx b/framework/inc/uielement/toolbarsmenucontroller.hxx
index 5573303..370e35b 100644
--- a/framework/inc/uielement/toolbarsmenucontroller.hxx
+++ b/framework/inc/uielement/toolbarsmenucontroller.hxx
@@ -87,7 +87,6 @@ namespace framework
             css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > getLayoutManagerToolbars( const css::uno::Reference< css::frame::XLayoutManager >& rLayoutManager );
             css::uno::Reference< css::frame::XDispatch > getDispatchFromCommandURL( const OUString& rCommandURL );
             void addCommand( css::uno::Reference< css::awt::XPopupMenu >& rPopupMenu, const OUString& rCommandURL, const OUString& aLabel );
-            bool isContextSensitiveToolbarNonVisible() { return m_bResetActive;}
 
             css::uno::Reference< css::uno::XComponentContext >        m_xContext;
             css::uno::Reference< css::container::XNameAccess >        m_xPersistentWindowState;
diff --git a/framework/source/helper/ocomponentaccess.cxx b/framework/source/helper/ocomponentaccess.cxx
index 6b13cec..f120a79 100644
--- a/framework/source/helper/ocomponentaccess.cxx
+++ b/framework/source/helper/ocomponentaccess.cxx
@@ -39,7 +39,7 @@ OComponentAccess::OComponentAccess( const css::uno::Reference< XDesktop >& xOwne
         :   m_xOwner        ( xOwner                        )
 {
     // Safe impossible cases
-    SAL_WARN_IF( !impldbg_checkParameter_OComponentAccessCtor( xOwner ), "fwk", "OComponentAccess::OComponentAccess(): Invalid parameter detected!" );
+    SAL_WARN_IF( !xOwner.is(), "fwk", "OComponentAccess::OComponentAccess(): Invalid parameter detected!" );
 }
 
 //  destructor
@@ -161,22 +161,6 @@ css::uno::Reference< XComponent > OComponentAccess::impl_getFrameComponent( cons
     return xComponent;
 }
 
-//  debug methods
-
-/*-----------------------------------------------------------------------------------------------------------------
-    The follow methods checks the parameter for other functions. If a parameter or his value is non valid,
-    we return "sal_False". (else sal_True) This mechanism is used to throw an ASSERT!
-
-    ATTENTION
-
-        If you miss a test for one of this parameters, contact the author or add it himself !(?)
-        But ... look for right testing! See using of this methods!
------------------------------------------------------------------------------------------------------------------*/
-
-bool OComponentAccess::impldbg_checkParameter_OComponentAccessCtor( const   css::uno::Reference< XDesktop >&      xOwner  )
-{
-    return xOwner.is();
-}
 
 }       //  namespace framework
 
diff --git a/framework/source/helper/oframes.cxx b/framework/source/helper/oframes.cxx
index 3759a3a..4f96df1 100644
--- a/framework/source/helper/oframes.cxx
+++ b/framework/source/helper/oframes.cxx
@@ -62,7 +62,7 @@ void SAL_CALL OFrames::append( const css::uno::Reference< XFrame >& xFrame ) thr
 
     // Safe impossible cases
     // Method is not defined for ALL incoming parameters!
-    SAL_WARN_IF( !impldbg_checkParameter_append( xFrame ), "fwk", "OFrames::append(): Invalid parameter detected!" );
+    SAL_WARN_IF( !xFrame.is(), "fwk", "OFrames::append(): Invalid parameter detected!" );
 
     // Do the follow only, if owner instance valid!
     // Lock owner for follow operations - make a "hard reference"!
@@ -85,7 +85,7 @@ void SAL_CALL OFrames::remove( const css::uno::Reference< XFrame >& xFrame ) thr
 
     // Safe impossible cases
     // Method is not defined for ALL incoming parameters!
-    SAL_WARN_IF( !impldbg_checkParameter_remove( xFrame ), "fwk", "OFrames::remove(): Invalid parameter detected!" );
+    SAL_WARN_IF( !xFrame.is(), "fwk", "OFrames::remove(): Invalid parameter detected!" );
 
     // Do the follow only, if owner instance valid!
     // Lock owner for follow operations - make a "hard reference"!
@@ -354,19 +354,6 @@ bool OFrames::impldbg_checkParameter_OFramesCtor(   const   css::uno::Reference<
     return xOwner.is() && pFrameContainer != nullptr;
 }
 
-// Its only allowed to add valid references to container.
-// AND - alle frames must support XFrames-interface!
-bool OFrames::impldbg_checkParameter_append( const css::uno::Reference< XFrame >& xFrame )
-{
-    return xFrame.is();
-}
-
-// Its only allowed to add valid references to container...
-// ... => You can only delete valid references!
-bool OFrames::impldbg_checkParameter_remove( const css::uno::Reference< XFrame >& xFrame )
-{
-    return xFrame.is();
-}
 
 // A search for frames must initiate with right flags.
 // Some one are superflous and not supported yet. But here we control only the range of incoming parameter!
diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx
index e99bec8..c8bf51f 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -1117,7 +1117,7 @@ void SAL_CALL Desktop::addEventListener( const css::uno::Reference< css::lang::X
     /* UNSAFE AREA --------------------------------------------------------------------------------------------- */
     // Safe impossible cases
     // Method not defined for all incoming parameter.
-    SAL_WARN_IF( implcp_addEventListener( xListener ), "fwk", "Desktop::addEventListener(): Invalid parameter detected!" );
+    SAL_WARN_IF( !xListener.is(), "fwk", "Desktop::addEventListener(): Invalid parameter detected!" );
     // Register transaction and reject wrong calls.
     TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS );
 
@@ -1129,7 +1129,7 @@ void SAL_CALL Desktop::removeEventListener( const css::uno::Reference< css::lang
     /* UNSAFE AREA --------------------------------------------------------------------------------------------- */
     // Safe impossible cases
     // Method not defined for all incoming parameter.
-    SAL_WARN_IF( implcp_removeEventListener( xListener ), "fwk", "Desktop::removeEventListener(): Invalid parameter detected!" );
+    SAL_WARN_IF( !xListener.is(), "fwk", "Desktop::removeEventListener(): Invalid parameter detected!" );
     // Register transaction and reject wrong calls.
     TransactionGuard aTransaction( m_aTransactionManager, E_SOFTEXCEPTIONS );
 
@@ -1738,18 +1738,6 @@ bool Desktop::impl_closeFrames(bool bAllowUI)
     return (nNonClosedFrames < 1);
 }
 
-//  We work with valid listener only.
-bool Desktop::implcp_addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener )
-{
-    return !xListener.is();
-}
-
-//  We work with valid listener only.
-bool Desktop::implcp_removeEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener )
-{
-    return !xListener.is();
-}
-
 }   // namespace framework
 
 namespace {
diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx
index 1b649c8..44ae069 100644
--- a/framework/source/uielement/toolbarsmenucontroller.cxx
+++ b/framework/source/uielement/toolbarsmenucontroller.cxx
@@ -737,7 +737,7 @@ void SAL_CALL ToolbarsMenuController::itemActivated( const css::awt::MenuEvent&
             // Special code to determine the enable/disable state of this command
             FeatureStateEvent aFeatureStateEvent;
             aFeatureStateEvent.FeatureURL.Complete = aCmdVector[i];
-            aFeatureStateEvent.IsEnabled = isContextSensitiveToolbarNonVisible();
+            aFeatureStateEvent.IsEnabled = m_bResetActive; // is context sensitive toolbar non visible
             statusChanged( aFeatureStateEvent );
         }
     }


More information about the Libreoffice-commits mailing list