From e8e558488217b8d2c381191389f2a785aaa5ca27 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 23 Aug 2018 15:43:40 +0200 Subject: pass DelFormats around using std::vector instead of an array and a separate count Change-Id: Ia12a549da7e35092da2db35f8b2b9fc6a9e9c2be Reviewed-on: https://gerrit.libreoffice.org/59506 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/source/uibase/shells/tabsh.cxx | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'sw/source/uibase/shells/tabsh.cxx') diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index c319c895483c..fecda67dd7cf 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -681,26 +681,23 @@ void SwTableShell::Execute(SfxRequest &rReq) if (RET_OK == pDlg->Execute()) { - const SfxPoolItem* pNumberFormatItem = GetView().GetDocShell()-> - GetItem( SID_ATTR_NUMBERFORMAT_INFO ); + const SvxNumberInfoItem* pNumberFormatItem + = GetView().GetDocShell()->GetItem( SID_ATTR_NUMBERFORMAT_INFO ); - if( pNumberFormatItem && 0 != static_cast(pNumberFormatItem)->GetDelCount() ) + if( pNumberFormatItem ) { - const sal_uInt32* pDelArr = static_cast( - pNumberFormatItem)->GetDelArray(); - - for ( sal_uInt32 i = 0; i < static_cast(pNumberFormatItem)->GetDelCount(); i++ ) - static_cast(pNumberFormatItem)-> - GetNumberFormatter()->DeleteEntry( pDelArr[i] ); + for ( sal_uInt32 key : pNumberFormatItem->GetDelFormats() ) + pNumberFormatItem->GetNumberFormatter()->DeleteEntry( key ); } + const SfxPoolItem* pNumberFormatValueItem = nullptr; if( SfxItemState::SET == pDlg->GetOutputItemSet()->GetItemState( - SID_ATTR_NUMBERFORMAT_VALUE, false, &pNumberFormatItem )) + SID_ATTR_NUMBERFORMAT_VALUE, false, &pNumberFormatValueItem )) { SfxItemSet aBoxFormatSet( *aCoreSet.GetPool(), svl::Items{} ); aBoxFormatSet.Put( SwTableBoxNumFormat( - static_cast(pNumberFormatItem)->GetValue() )); + static_cast(pNumberFormatValueItem)->GetValue() )); rSh.SetTableBoxFormulaAttrs( aBoxFormatSet ); } -- cgit