summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-10-18 14:42:58 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-10-19 07:57:11 +0000
commit423936ffacb72f85b37961e4cd585fe2719799b7 (patch)
tree3c08c99af64762429d97bf8dcfe7cbac9c56c6ab
parente7782a99a5b5248e3c133a7b085737ceb0ecea57 (diff)
loplugin:expandablemethodds in formula..framework
Change-Id: I6c8b1bb3b664faa92b2dc05955c30bfd35f6dfaa Reviewed-on: https://gerrit.libreoffice.org/30015 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--formula/source/ui/dlg/ControlHelper.hxx8
-rw-r--r--formula/source/ui/dlg/funcutl.cxx36
-rw-r--r--formula/source/ui/dlg/parawin.cxx30
-rw-r--r--formula/source/ui/dlg/parawin.hxx4
-rw-r--r--fpicker/source/office/iodlgimp.cxx8
-rw-r--r--fpicker/source/office/iodlgimp.hxx3
-rw-r--r--framework/inc/helper/ocomponentaccess.hxx24
-rw-r--r--framework/inc/helper/oframes.hxx2
-rw-r--r--framework/inc/services/desktop.hxx11
-rw-r--r--framework/inc/uielement/toolbarsmenucontroller.hxx1
-rw-r--r--framework/source/helper/ocomponentaccess.cxx18
-rw-r--r--framework/source/helper/oframes.cxx17
-rw-r--r--framework/source/services/desktop.cxx16
-rw-r--r--framework/source/uielement/toolbarsmenucontroller.cxx2
14 files changed, 18 insertions, 162 deletions
diff --git a/formula/source/ui/dlg/ControlHelper.hxx b/formula/source/ui/dlg/ControlHelper.hxx
index 4fc48cc69f8d..00da7a77c8f1 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 f1f014cebb0c..9e9777a7d6e7 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 51a87c187985..a6d5f413677b 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 8c41581ced6a..a1c1ad6c79af 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 7d07f6e620f7..cd4542c13612 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 7781a2e73f52..fe4963112565 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 1d541b15f8fb..31091927afdf 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 9f82c478a186..af330aa0822e 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 8e90ba671ebf..8aa56efaf9a8 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 55733037cb70..370e35bbf9f3 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 6b13cecfe032..f120a79380f4 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 3759a3adcbe7..4f96df15f476 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 e99bec83b99e..c8bf51fe6a8e 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 1b649c8f6326..44ae069fa0a9 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 );
}
}