diff options
author | Noel Grandin <noel@peralex.com> | 2015-07-03 11:31:14 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-07-06 07:04:50 +0000 |
commit | e9c3583c2cc27fc88ee81047c236ec99dd51e8de (patch) | |
tree | b3e8394ca1ec402a31b227339366fc790124c1f8 /cui/source/tabpages | |
parent | 89c77994d4638c86635c70535fab6508e2f3d900 (diff) |
improve the returnbyref loplugin
Change-Id: I1b510a6194282dfa4a9001d473127c5ebc8b44eb
Reviewed-on: https://gerrit.libreoffice.org/16731
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'cui/source/tabpages')
-rw-r--r-- | cui/source/tabpages/autocdlg.cxx | 18 | ||||
-rw-r--r-- | cui/source/tabpages/macroass.cxx | 8 |
2 files changed, 12 insertions, 14 deletions
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 69f51472da7a..ca6f66834a74 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -795,23 +795,22 @@ bool OfaACorrCheckListBox::IsChecked(sal_uLong nPos, sal_uInt16 nCol) void OfaACorrCheckListBox::SetCheckButtonState( SvTreeListEntry* pEntry, sal_uInt16 nCol, SvButtonState eState) { - SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetItem(nCol + 1)); + SvLBoxButton& rItem = static_cast<SvLBoxButton&>(pEntry->GetItem(nCol + 1)); - DBG_ASSERT(pItem,"SetCheckButton:Item not found"); - if (pItem->GetType() == SV_ITEM_ID_LBOXBUTTON) + if (rItem.GetType() == SV_ITEM_ID_LBOXBUTTON) { switch( eState ) { case SV_BUTTON_CHECKED: - pItem->SetStateChecked(); + rItem.SetStateChecked(); break; case SV_BUTTON_UNCHECKED: - pItem->SetStateUnchecked(); + rItem.SetStateUnchecked(); break; case SV_BUTTON_TRISTATE: - pItem->SetStateTristate(); + rItem.SetStateTristate(); break; } InvalidateEntry( pEntry ); @@ -821,12 +820,11 @@ void OfaACorrCheckListBox::SetCheckButtonState( SvTreeListEntry* pEntry, sal_uIn SvButtonState OfaACorrCheckListBox::GetCheckButtonState( SvTreeListEntry* pEntry, sal_uInt16 nCol ) { SvButtonState eState = SV_BUTTON_UNCHECKED; - SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetItem(nCol + 1)); - DBG_ASSERT(pItem,"GetChButnState:Item not found"); + SvLBoxButton& rItem = static_cast<SvLBoxButton&>(pEntry->GetItem(nCol + 1)); - if (pItem->GetType() == SV_ITEM_ID_LBOXBUTTON) + if (rItem.GetType() == SV_ITEM_ID_LBOXBUTTON) { - SvItemStateFlags nButtonFlags = pItem->GetButtonFlags(); + SvItemStateFlags nButtonFlags = rItem.GetButtonFlags(); eState = SvLBoxButtonData::ConvertToButtonState( nButtonFlags ); } diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx index cb096cab7018..5bc3697056f6 100644 --- a/cui/source/tabpages/macroass.cxx +++ b/cui/source/tabpages/macroass.cxx @@ -126,7 +126,7 @@ void _SfxMacroTabPage::EnableButtons() const SvxMacro* pM = aTbl.Get( (sal_uInt16)reinterpret_cast<sal_uLong>(pE->GetUserData()) ); mpImpl->pDeletePB->Enable( 0 != pM && !mpImpl->bReadOnly ); - OUString sEventMacro = static_cast<const SvLBoxString*>(pE->GetItem( LB_MACROS_ITEMPOS ))->GetText(); + OUString sEventMacro = static_cast<const SvLBoxString&>(pE->GetItem( LB_MACROS_ITEMPOS )).GetText(); OUString sScriptURI = mpImpl->pMacroLB->GetSelectedScriptURI(); mpImpl->pAssignPB->Enable( !mpImpl->bReadOnly && !sScriptURI.equalsIgnoreAsciiCase( sEventMacro ) ); @@ -415,10 +415,10 @@ void _SfxMacroTabPage::FillEvents() SvTreeListEntry* pE = rListBox.GetEntry( n ); if( pE ) { - SvLBoxString* pLItem = static_cast<SvLBoxString*>( pE->GetItem( LB_MACROS_ITEMPOS ) ); - DBG_ASSERT( pLItem && SV_ITEM_ID_LBOXSTRING == pLItem->GetType(), "_SfxMacroTabPage::FillEvents(): no LBoxString" ); + SvLBoxString& rLItem = static_cast<SvLBoxString&>( pE->GetItem( LB_MACROS_ITEMPOS ) ); + DBG_ASSERT( SV_ITEM_ID_LBOXSTRING == rLItem.GetType(), "_SfxMacroTabPage::FillEvents(): no LBoxString" ); - OUString sOld( pLItem->GetText() ); + OUString sOld( rLItem.GetText() ); OUString sNew; sal_uInt16 nEventId = ( sal_uInt16 ) reinterpret_cast<sal_uLong>( pE->GetUserData() ); if( aTbl.IsKeyValid( nEventId ) ) |