diff options
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/customize/macropg.cxx | 3 | ||||
-rw-r--r-- | cui/source/options/fontsubs.cxx | 18 | ||||
-rw-r--r-- | cui/source/options/optHeaderTabListbox.cxx | 4 | ||||
-rw-r--r-- | cui/source/options/optaboutconfig.cxx | 6 | ||||
-rw-r--r-- | cui/source/options/optfltr.cxx | 32 | ||||
-rw-r--r-- | cui/source/tabpages/autocdlg.cxx | 18 | ||||
-rw-r--r-- | cui/source/tabpages/macroass.cxx | 8 |
7 files changed, 41 insertions, 48 deletions
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx index a57fb4b7ed9c..0e14b0fc2397 100644 --- a/cui/source/customize/macropg.cxx +++ b/cui/source/customize/macropg.cxx @@ -216,8 +216,7 @@ void _SvxMacroTabPage::EnableButtons() const SvTreeListEntry* pE = mpImpl->pEventLB->GetListBox().FirstSelected(); if ( pE ) { - const SvLBoxString* pEventMacro = static_cast<const SvLBoxString*>(pE->GetItem( LB_MACROS_ITEMPOS )); - mpImpl->pDeletePB->Enable( 0 != pEventMacro && !mpImpl->bReadOnly ); + mpImpl->pDeletePB->Enable( !mpImpl->bReadOnly ); mpImpl->pAssignPB->Enable( !mpImpl->bReadOnly ); if( mpImpl->pAssignComponentPB ) diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx index 95bedeef6d6a..f3888b6474bb 100644 --- a/cui/source/options/fontsubs.cxx +++ b/cui/source/options/fontsubs.cxx @@ -502,23 +502,22 @@ bool SvxFontSubstCheckListBox::IsChecked(SvTreeListEntry* pEntry, sal_uInt16 nCo void SvxFontSubstCheckListBox::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 ); @@ -528,12 +527,11 @@ void SvxFontSubstCheckListBox::SetCheckButtonState( SvTreeListEntry* pEntry, sal SvButtonState SvxFontSubstCheckListBox::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/options/optHeaderTabListbox.cxx b/cui/source/options/optHeaderTabListbox.cxx index bba08c097ef6..09c8e7e17c16 100644 --- a/cui/source/options/optHeaderTabListbox.cxx +++ b/cui/source/options/optHeaderTabListbox.cxx @@ -70,8 +70,8 @@ void OptHeaderTabListBox::InitEntry( SvTreeListEntry* pEntry, const OUString& rT for ( sal_uInt16 nCol = 1; nCol < _nTabCount; ++nCol ) { // initialize all columns with own class (column 0 == Bitmap) - SvLBoxString* pCol = static_cast<SvLBoxString*>(pEntry->GetItem( nCol )); - OptLBoxString_Impl* pStr = new OptLBoxString_Impl( pEntry, 0, pCol->GetText() ); + SvLBoxString& rCol = static_cast<SvLBoxString&>(pEntry->GetItem( nCol )); + OptLBoxString_Impl* pStr = new OptLBoxString_Impl( pEntry, 0, rCol.GetText() ); pEntry->ReplaceItem( pStr, nCol ); } } diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx index 3b846b8dda19..02acd7043583 100644 --- a/cui/source/options/optaboutconfig.cxx +++ b/cui/source/options/optaboutconfig.cxx @@ -747,8 +747,8 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl ) SvTreeListEntries::iterator it = std::find_if(m_prefBoxEntries.begin(), m_prefBoxEntries.end(), [&pUserData, &sPropertyName](SvTreeListEntry &entry) -> bool { - return static_cast< SvLBoxString* >( entry.GetItem(1) )->GetText().equals( pUserData->sPropertyPath ) && - static_cast< SvLBoxString* >( entry.GetItem(2) )->GetText().equals( sPropertyName ); + return static_cast< SvLBoxString& >( entry.GetItem(1) ).GetText().equals( pUserData->sPropertyPath ) && + static_cast< SvLBoxString& >( entry.GetItem(2) ).GetText().equals( sPropertyName ); } ); if (it != m_prefBoxEntries.end()) @@ -793,7 +793,7 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, SearchHdl_Impl) for(size_t i = 1; i < it->ItemCount(); ++i) { - OUString scrTxt = static_cast< SvLBoxString* >( it->GetItem(i) )->GetText(); + OUString scrTxt = static_cast< SvLBoxString& >( it->GetItem(i) ).GetText(); endPos = scrTxt.getLength(); if( textSearch.SearchForward( scrTxt, &startPos, &endPos ) ) { diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx index 0de47b4b3b7d..6ee34bf30f4b 100644 --- a/cui/source/options/optfltr.cxx +++ b/cui/source/options/optfltr.cxx @@ -237,10 +237,10 @@ bool OfaMSFilterTabPage2::FillItemSet( SfxItemSet* ) SvTreeListEntry* pEntry = GetEntry4Type( pArr->eType ); if( pEntry ) { - SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetItem( nCol )); - if (pItem && pItem->GetType() == SV_ITEM_ID_LBOXBUTTON) + SvLBoxButton& rItem = static_cast<SvLBoxButton&>(pEntry->GetItem( nCol )); + if (rItem.GetType() == SV_ITEM_ID_LBOXBUTTON) { - SvItemStateFlags nButtonFlags = pItem->GetButtonFlags(); + SvItemStateFlags nButtonFlags = rItem.GetButtonFlags(); bCheck = SV_BUTTON_CHECKED == SvLBoxButtonData::ConvertToButtonState( nButtonFlags ); @@ -305,13 +305,13 @@ void OfaMSFilterTabPage2::Reset( const SfxItemSet* ) SvTreeListEntry* pEntry = GetEntry4Type( static_cast< sal_IntPtr >( pArr->eType ) ); if( pEntry ) { - SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetItem( nCol )); - if (pItem && pItem->GetType() == SV_ITEM_ID_LBOXBUTTON) + SvLBoxButton& rItem = static_cast<SvLBoxButton&>(pEntry->GetItem( nCol )); + if (rItem.GetType() == SV_ITEM_ID_LBOXBUTTON) { if( (rOpt.*pArr->FnIs)() ) - pItem->SetStateChecked(); + rItem.SetStateChecked(); else - pItem->SetStateUnchecked(); + rItem.SetStateUnchecked(); m_pCheckLB->InvalidateEntry( pEntry ); } } @@ -391,23 +391,22 @@ void OfaMSFilterTabPage2::MSFltrSimpleTable::HBarClick() void OfaMSFilterTabPage2::MSFltrSimpleTable::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 ); @@ -418,12 +417,11 @@ SvButtonState OfaMSFilterTabPage2::MSFltrSimpleTable::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/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 ) ) |