diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-08-15 21:28:31 +0200 |
---|---|---|
committer | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-08-16 07:11:47 +0000 |
commit | aff3d8dbacf67c4109ea70770719f8ebfa326873 (patch) | |
tree | a51f56ae086bf3409233c64332af55d971ce2934 /cui | |
parent | af97c180983e5a8ac147b97f7773d483bba8cfef (diff) |
remove casts
XPropertyList members take long for position
Change-Id: I39b064f0934f9d4b30f71065537983dd8bce3697
Reviewed-on: https://gerrit.libreoffice.org/28150
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/tabpages/tpbitmap.cxx | 4 | ||||
-rw-r--r-- | cui/source/tabpages/tpgradnt.cxx | 10 | ||||
-rw-r--r-- | cui/source/tabpages/tphatch.cxx | 8 | ||||
-rw-r--r-- | cui/source/tabpages/tppattern.cxx | 8 |
4 files changed, 15 insertions, 15 deletions
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx index 2e8705534d91..b298a7cb8c83 100644 --- a/cui/source/tabpages/tpbitmap.cxx +++ b/cui/source/tabpages/tpbitmap.cxx @@ -195,7 +195,7 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ModifyBitmapHdl, ValueSet*, void) size_t nPos = m_pBitmapLB->GetSelectItemPos(); if( nPos != VALUESET_ITEM_NOTFOUND ) { - pGraphicObject.reset(new GraphicObject(m_pBitmapList->GetBitmap( static_cast<sal_uInt16>(nPos) )->GetGraphicObject())); + pGraphicObject.reset(new GraphicObject(m_pBitmapList->GetBitmap(nPos)->GetGraphicObject())); } else { @@ -283,7 +283,7 @@ IMPL_LINK_NOARG_TYPED(SvxBitmapTabPage, ClickDeleteHdl, SvxPresetListBox*, void) if( aQueryBox->Execute() == RET_YES ) { - m_pBitmapList->Remove( static_cast<sal_uInt16>(nPos) ); + m_pBitmapList->Remove(nPos); m_pBitmapLB->RemoveItem( nId ); nId = m_pBitmapLB->GetItemId(0); m_pBitmapLB->SelectItem( nId ); diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx index 0125b0fb1ea2..7f343595f42d 100644 --- a/cui/source/tabpages/tpgradnt.cxx +++ b/cui/source/tabpages/tpgradnt.cxx @@ -278,7 +278,7 @@ long SvxGradientTabPage::CheckChanges_Impl() size_t nPos = m_pGradientLB->GetSelectItemPos(); if( nPos != VALUESET_ITEM_NOTFOUND ) { - XGradient aGradient = m_pGradientList->GetGradient( static_cast<sal_uInt16>(nPos) )->GetGradient(); + XGradient aGradient = m_pGradientList->GetGradient(nPos)->GetGradient(); if( !( aTmpGradient == aGradient ) ) { @@ -335,7 +335,7 @@ bool SvxGradientTabPage::FillItemSet( SfxItemSet* rSet ) size_t nPos = m_pGradientLB->GetSelectItemPos(); if( nPos != VALUESET_ITEM_NOTFOUND ) { - pXGradient.reset(new XGradient( m_pGradientList->GetGradient( static_cast<sal_uInt16>(nPos) )->GetGradient() )); + pXGradient.reset(new XGradient(m_pGradientList->GetGradient(nPos)->GetGradient())); aString = m_pGradientLB->GetItemText( m_pGradientLB->GetSelectItemId() ); } else @@ -540,7 +540,7 @@ IMPL_LINK_NOARG_TYPED(SvxGradientTabPage, ClickModifyHdl_Impl, Button*, void) if ( nPos != VALUESET_ITEM_NOTFOUND ) { - OUString aName( m_pGradientList->GetGradient( static_cast<sal_uInt16>(nPos) )->GetName() ); + OUString aName(m_pGradientList->GetGradient(nPos)->GetName()); XGradient aXGradient( m_pLbColorFrom->GetSelectEntryColor(), m_pLbColorTo->GetSelectEntryColor(), @@ -554,7 +554,7 @@ IMPL_LINK_NOARG_TYPED(SvxGradientTabPage, ClickModifyHdl_Impl, Button*, void) m_pGradientList->Replace(o3tl::make_unique<XGradientEntry>(aXGradient, aName), nPos); - Bitmap aBitmap = m_pGradientList->GetBitmapForPreview( static_cast<sal_uInt16>(nPos), m_pGradientLB->GetIconSize() ); + Bitmap aBitmap = m_pGradientList->GetBitmapForPreview(nPos, m_pGradientLB->GetIconSize()); m_pGradientLB->RemoveItem( nId ); m_pGradientLB->InsertItem( nId, Image(aBitmap), aName, static_cast<sal_uInt16>(nPos) ); m_pGradientLB->SelectItem( nId ); @@ -646,7 +646,7 @@ void SvxGradientTabPage::ChangeGradientHdl_Impl() size_t nPos = m_pGradientLB->GetSelectItemPos(); if( nPos != VALUESET_ITEM_NOTFOUND ) - pGradient.reset(new XGradient( m_pGradientList->GetGradient( static_cast<sal_uInt16>( nPos ) )->GetGradient() )); + pGradient.reset(new XGradient(m_pGradientList->GetGradient(nPos)->GetGradient())); else { const SfxPoolItem* pPoolItem = nullptr; diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx index 7082fedf80e4..2c59788f7b4f 100644 --- a/cui/source/tabpages/tphatch.cxx +++ b/cui/source/tabpages/tphatch.cxx @@ -340,7 +340,7 @@ bool SvxHatchTabPage::FillItemSet( SfxItemSet* rSet ) size_t nPos = m_pHatchLB->GetSelectItemPos(); if( nPos != VALUESET_ITEM_NOTFOUND ) { - pXHatch.reset(new XHatch( m_pHatchingList->GetHatch( static_cast<sal_uInt16>(nPos) )->GetHatch() )); + pXHatch.reset(new XHatch(m_pHatchingList->GetHatch(nPos)->GetHatch())); aString = m_pHatchLB->GetItemText( m_pHatchLB->GetSelectItemId() ); } // gradient has been (unidentifiedly) passed @@ -468,7 +468,7 @@ void SvxHatchTabPage::ChangeHatchHdl_Impl() size_t nPos = m_pHatchLB->GetSelectItemPos(); if( nPos != VALUESET_ITEM_NOTFOUND ) - pHatch.reset(new XHatch( m_pHatchingList->GetHatch( static_cast<sal_uInt16>(nPos) )->GetHatch() )); + pHatch.reset(new XHatch(m_pHatchingList->GetHatch(nPos)->GetHatch())); else { const SfxPoolItem* pPoolItem = nullptr; @@ -597,7 +597,7 @@ IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ClickModifyHdl_Impl, Button*, void) if( nPos != VALUESET_ITEM_NOTFOUND ) { - OUString aName( m_pHatchingList->GetHatch( static_cast<sal_uInt16>(nPos) )->GetName() ); + OUString aName(m_pHatchingList->GetHatch(nPos)->GetName()); XHatch aXHatch( m_pLbLineColor->GetSelectEntryColor(), (css::drawing::HatchStyle) m_pLbLineType->GetSelectEntryPos(), @@ -606,7 +606,7 @@ IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ClickModifyHdl_Impl, Button*, void) m_pHatchingList->Replace(o3tl::make_unique<XHatchEntry>(aXHatch, aName), nPos); - Bitmap aBitmap = m_pHatchingList->GetBitmapForPreview( static_cast<sal_uInt16>(nPos), m_pHatchLB->GetIconSize() ); + Bitmap aBitmap = m_pHatchingList->GetBitmapForPreview(nPos, m_pHatchLB->GetIconSize()); m_pHatchLB->RemoveItem( nId ); m_pHatchLB->InsertItem( nId, Image(aBitmap), aName, static_cast<sal_uInt16>(nPos) ); m_pHatchLB->SelectItem( nId ); diff --git a/cui/source/tabpages/tppattern.cxx b/cui/source/tabpages/tppattern.cxx index 92a0edfb96f8..773b7440f0b8 100644 --- a/cui/source/tabpages/tppattern.cxx +++ b/cui/source/tabpages/tppattern.cxx @@ -263,7 +263,7 @@ bool SvxPatternTabPage::FillItemSet( SfxItemSet* _rOutAttrs ) size_t nPos = m_pPatternLB->GetSelectItemPos(); if(VALUESET_ITEM_NOTFOUND != nPos) { - const XBitmapEntry* pXBitmapEntry = m_pPatternList->GetBitmap( static_cast<sal_uInt16>(nPos) ); + const XBitmapEntry* pXBitmapEntry = m_pPatternList->GetBitmap(nPos); const OUString aString( m_pPatternLB->GetItemText( m_pPatternLB->GetSelectItemId() ) ); _rOutAttrs->Put(XFillBitmapItem(aString, pXBitmapEntry->GetGraphicObject())); @@ -322,7 +322,7 @@ IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ChangePatternHdl_Impl, ValueSet*, void) if(VALUESET_ITEM_NOTFOUND != nPos) { - pGraphicObject.reset(new GraphicObject(m_pPatternList->GetBitmap( static_cast<sal_uInt16>(nPos) )->GetGraphicObject())); + pGraphicObject.reset(new GraphicObject(m_pPatternList->GetBitmap(nPos)->GetGraphicObject())); } else { @@ -578,14 +578,14 @@ IMPL_LINK_NOARG_TYPED(SvxPatternTabPage, ClickModifyHdl_Impl, Button*, void) if ( nPos != VALUESET_ITEM_NOTFOUND ) { - OUString aName( m_pPatternList->GetBitmap( static_cast<sal_uInt16>(nPos) )->GetName() ); + OUString aName(m_pPatternList->GetBitmap(nPos)->GetName()); const BitmapEx aBitmapEx(m_pBitmapCtl->GetBitmapEx()); // #i123497# Need to replace the existing entry with a new one (old returned needs to be deleted) m_pPatternList->Replace(o3tl::make_unique<XBitmapEntry>(Graphic(aBitmapEx), aName), nPos); - Bitmap aBitmap = m_pPatternList->GetBitmapForPreview( static_cast<sal_uInt16>( nPos ), m_pPatternLB->GetIconSize() ); + Bitmap aBitmap = m_pPatternList->GetBitmapForPreview(nPos, m_pPatternLB->GetIconSize()); m_pPatternLB->RemoveItem(nId); m_pPatternLB->InsertItem( nId, Image(aBitmap), aName, static_cast<sal_uInt16>(nPos) ); m_pPatternLB->SelectItem( nId ); |