diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-14 17:14:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-11 11:38:15 +0200 |
commit | 1f08bff31238d5818c54a0b86570689644dff087 (patch) | |
tree | d4d6f4b62a3c48ddeb85ba89818247c17f2578c8 /cui | |
parent | ff130af9661a57d290dbf89b54a4c0ce8d0f71ea (diff) |
new loplugin:shouldreturnbool
look for methods returning only 1 and/or 0, which (most of the time)
should be returning bool.
Off by default, because some of this is a matter of taste
Change-Id: Ib17782e629888255196e89d4a178618a9612a0de
Reviewed-on: https://gerrit.libreoffice.org/54379
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/customize/macropg.cxx | 8 | ||||
-rw-r--r-- | cui/source/inc/macropg.hxx | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx index 345438a23cb3..6d87a95f73a5 100644 --- a/cui/source/customize/macropg.cxx +++ b/cui/source/customize/macropg.cxx @@ -564,11 +564,12 @@ IMPL_LINK( SvxMacroTabPage_, AssignDeleteHdl_Impl, Button*, pBtn, void ) IMPL_LINK_NOARG( SvxMacroTabPage_, DoubleClickHdl_Impl, SvTreeListBox*, bool) { - return GenericHandler_Impl( this, nullptr ); + GenericHandler_Impl( this, nullptr ); + return false; } // handler for double click on the listbox, and for the assign/delete buttons -long SvxMacroTabPage_::GenericHandler_Impl( SvxMacroTabPage_* pThis, PushButton* pBtn ) +void SvxMacroTabPage_::GenericHandler_Impl( SvxMacroTabPage_* pThis, PushButton* pBtn ) { SvxMacroTabPage_Impl* pImpl = pThis->mpImpl; SvHeaderTabListBox& rListBox = pImpl->pEventLB->GetListBox(); @@ -576,7 +577,7 @@ long SvxMacroTabPage_::GenericHandler_Impl( SvxMacroTabPage_* pThis, PushButton* if( !pE || LISTBOX_ENTRY_NOTFOUND == rListBox.GetModel()->GetAbsPos( pE ) ) { DBG_ASSERT( pE, "Where does the empty entry come from?" ); - return 0; + return; } const bool bAssEnabled = pBtn != pImpl->pDeletePB && pImpl->pAssignPB->IsEnabled(); @@ -675,7 +676,6 @@ long SvxMacroTabPage_::GenericHandler_Impl( SvxMacroTabPage_* pThis, PushButton* rListBox.SetUpdateMode( true ); pThis->EnableButtons(); - return 0; } // pass in the XNameReplace. diff --git a/cui/source/inc/macropg.hxx b/cui/source/inc/macropg.hxx index 2020c3e4f0bf..040fcc7838d2 100644 --- a/cui/source/inc/macropg.hxx +++ b/cui/source/inc/macropg.hxx @@ -61,7 +61,7 @@ class SvxMacroTabPage_ : public SfxTabPage DECL_LINK( AssignDeleteHdl_Impl, Button *, void ); DECL_LINK( DoubleClickHdl_Impl, SvTreeListBox*, bool ); - static long GenericHandler_Impl( SvxMacroTabPage_* pThis, PushButton* pBtn ); + static void GenericHandler_Impl( SvxMacroTabPage_* pThis, PushButton* pBtn ); css::uno::Reference< css::container::XNameReplace > m_xAppEvents; protected: |