summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-10-15 12:28:31 +0200
committerNoel Grandin <noel@peralex.com>2015-10-15 12:29:01 +0200
commit0e8a40e8b8c883611b6d34e47dc6e33ba60e0f91 (patch)
tree92e49014bb9b368309c98d85dcfbd2f673e23d54 /dbaccess
parentcfc7307a23eed561152c1b016cd0ec22bc7af145 (diff)
calling IsSet() before Call() on Link<> is unnecessary
the Call() already does a check Found with: git grep -A 1 -w 'IsSet()' | grep -B 1 '.Call(' | grep ':' | cut -d ':' -f 1 Change-Id: Ia7248f5d62640b75f705e539c3d1183e39c0d847
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/browser/AsynchronousLink.cxx3
-rw-r--r--dbaccess/source/ui/control/dbtreelistbox.cxx16
-rw-r--r--dbaccess/source/ui/control/marktree.cxx3
-rw-r--r--dbaccess/source/ui/dlg/generalpage.cxx9
-rw-r--r--dbaccess/source/ui/dlg/indexdialog.cxx2
-rw-r--r--dbaccess/source/ui/dlg/indexfieldscontrol.cxx8
6 files changed, 15 insertions, 26 deletions
diff --git a/dbaccess/source/ui/browser/AsynchronousLink.cxx b/dbaccess/source/ui/browser/AsynchronousLink.cxx
index 92ce231abacb..7715c91bd5f0 100644
--- a/dbaccess/source/ui/browser/AsynchronousLink.cxx
+++ b/dbaccess/source/ui/browser/AsynchronousLink.cxx
@@ -78,8 +78,7 @@ IMPL_LINK_TYPED(OAsynchronousLink, OnAsyncCall, void*, _pArg, void)
m_nEventId = 0;
}
}
- if (m_aHandler.IsSet())
- m_aHandler.Call(_pArg);
+ m_aHandler.Call(_pArg);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx
index 5c0075d0fe27..1db0893962b8 100644
--- a/dbaccess/source/ui/control/dbtreelistbox.cxx
+++ b/dbaccess/source/ui/control/dbtreelistbox.cxx
@@ -126,15 +126,12 @@ void DBTreeListBox::EnableExpandHandler(SvTreeListEntry* _pEntry)
void DBTreeListBox::RequestingChildren( SvTreeListEntry* pParent )
{
- if (m_aPreExpandHandler.IsSet())
+ if (m_aPreExpandHandler.IsSet() && !m_aPreExpandHandler.Call(pParent))
{
- if (!m_aPreExpandHandler.Call(pParent))
- {
- // an error occurred. The method calling us will reset the entry flags, so it can't be expanded again.
- // But we want that the user may do a second try (i.e. because he misstypes a password in this try), so
- // we have to reset these flags controlling the expand ability
- PostUserEvent(LINK(this, DBTreeListBox, OnResetEntry), pParent, true);
- }
+ // an error occurred. The method calling us will reset the entry flags, so it can't be expanded again.
+ // But we want that the user may do a second try (i.e. because he misstypes a password in this try), so
+ // we have to reset these flags controlling the expand ability
+ PostUserEvent(LINK(this, DBTreeListBox, OnResetEntry), pParent, true);
}
}
@@ -349,8 +346,7 @@ void DBTreeListBox::KeyInput( const KeyEvent& rKEvt )
if ( KEY_RETURN == nCode )
{
bHandled = m_bHandleEnterKey;
- if ( m_aEnterKeyHdl.IsSet() )
- m_aEnterKeyHdl.Call(this);
+ m_aEnterKeyHdl.Call(this);
// this is a HACK. If the data source browser is opened in the "beamer", while the main frame
//
// contains a writer document, then pressing enter in the DSB would be rerouted to the writer
diff --git a/dbaccess/source/ui/control/marktree.cxx b/dbaccess/source/ui/control/marktree.cxx
index 0291f06e9c25..60804e129908 100644
--- a/dbaccess/source/ui/control/marktree.cxx
+++ b/dbaccess/source/ui/control/marktree.cxx
@@ -165,8 +165,7 @@ void OMarkableTreeListBox::CheckButtons()
void OMarkableTreeListBox::CheckButtonHdl()
{
checkedButton_noBroadcast(GetHdlEntry());
- if (m_aCheckButtonHandler.IsSet())
- m_aCheckButtonHandler.Call(this);
+ m_aCheckButtonHandler.Call(this);
}
void OMarkableTreeListBox::checkedButton_noBroadcast(SvTreeListEntry* _pEntry)
diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx
index 23ecc2a54ed3..565e1babb012 100644
--- a/dbaccess/source/ui/dlg/generalpage.cxx
+++ b/dbaccess/source/ui/dlg/generalpage.cxx
@@ -217,8 +217,7 @@ namespace dbaui
switchMessage(_sURLPrefix);
- if ( m_aTypeSelectHandler.IsSet() )
- m_aTypeSelectHandler.Call(*this);
+ m_aTypeSelectHandler.Call(*this);
}
void OGeneralPage::implInitControls( const SfxItemSet& _rSet, bool _bSaveValue )
@@ -699,16 +698,14 @@ namespace dbaui
IMPL_LINK_NOARG_TYPED( OGeneralPageWizard, OnCreateDatabaseModeSelected, Button*, void )
{
- if ( m_aCreationModeHandler.IsSet() )
- m_aCreationModeHandler.Call( *this );
+ m_aCreationModeHandler.Call( *this );
OnEmbeddedDBTypeSelected( *m_pEmbeddedDBType );
}
IMPL_LINK_NOARG_TYPED( OGeneralPageWizard, OnSetupModeSelected, Button*, void )
{
- if ( m_aCreationModeHandler.IsSet() )
- m_aCreationModeHandler.Call( *this );
+ m_aCreationModeHandler.Call( *this );
OnDatasourceTypeSelected(*m_pDatasourceType);
}
diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx
index 3ab7db66c55a..6506bd90d089 100644
--- a/dbaccess/source/ui/dlg/indexdialog.cxx
+++ b/dbaccess/source/ui/dlg/indexdialog.cxx
@@ -153,7 +153,7 @@ namespace dbaui
{
bool bReturn = SvTreeListBox::Select(pEntry, _bSelect);
- if (m_aSelectHdl.IsSet() && !m_bSuspendSelectHdl && _bSelect)
+ if (!m_bSuspendSelectHdl && _bSelect)
m_aSelectHdl.Call(*this);
return bReturn;
diff --git a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx
index abe080af2f0e..26004ae68ba8 100644
--- a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx
+++ b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx
@@ -74,10 +74,8 @@ namespace dbaui
IMPL_LINK( DbaMouseDownListBoxController, OnMultiplexModify, void*, _pArg )
{
- if (m_aAdditionalModifyHdl.IsSet())
- m_aAdditionalModifyHdl.Call(_pArg);
- if (m_aOriginalModifyHdl.IsSet())
- m_aOriginalModifyHdl.Call(_pArg);
+ m_aAdditionalModifyHdl.Call(_pArg);
+ m_aOriginalModifyHdl.Call(_pArg);
return 0L;
}
@@ -409,7 +407,7 @@ namespace dbaui
IMPL_LINK( IndexFieldsControl, OnListEntrySelected, void*, p )
{
ListBox* _pBox = static_cast<ListBox*>(p);
- if (!_pBox->IsTravelSelect() && m_aModifyHdl.IsSet())
+ if (!_pBox->IsTravelSelect())
m_aModifyHdl.Call(this);
if (_pBox == m_pFieldNameCell)