From 2f6d2c0c47ebfd1b98f9610aec99566fe3a1a982 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Mon, 20 Feb 2017 20:55:39 +0100 Subject: [PATCH] use SvNumberformat::GetMaskedType() ... instead of manually masking out css::util::NumberFormat::DEFINED Change-Id: I0761132800b2b1693df41085695f36cd3cc1236b --- sc/source/core/data/column3.cxx | 2 +- sc/source/ui/view/viewfun6.cxx | 2 +- svl/source/numbers/zforlist.cxx | 11 +++++------ svx/source/items/numfmtsh.cxx | 14 +++++++------- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index dd332880c269..9bd32c0aec8c 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -1700,7 +1700,7 @@ bool ScColumn::ParseString( bool bOverwrite = false; if ( pOldFormat ) { - short nOldType = pOldFormat->GetType() & ~css::util::NumberFormat::DEFINED; + short nOldType = pOldFormat->GetMaskedType(); if ( nOldType == css::util::NumberFormat::NUMBER || nOldType == css::util::NumberFormat::DATE || nOldType == css::util::NumberFormat::TIME || nOldType == css::util::NumberFormat::LOGICAL ) { diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx index 92a18048dbf0..97ca1bdb4f23 100644 --- a/sc/source/ui/view/viewfun6.cxx +++ b/sc/source/ui/view/viewfun6.cxx @@ -269,7 +269,7 @@ void ScViewFunc::InsertCurrentTime(short nReqFmt, const OUString& rUndoStr) SvNumberFormatter* pFormatter = rDoc.GetFormatTable(); const SvNumberformat* pCurNumFormatEntry = pFormatter->GetEntry(nCurNumFormat); const short nCurNumFormatType = (pCurNumFormatEntry ? - (pCurNumFormatEntry->GetType() & ~css::util::NumberFormat::DEFINED) : css::util::NumberFormat::UNDEFINED); + pCurNumFormatEntry->GetMaskedType() : css::util::NumberFormat::UNDEFINED); if (bInputMode) { diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 71a071825a0a..2ddd6424918f 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -928,7 +928,7 @@ SvNumberFormatTable& SvNumberFormatter::GetFirstEntryTable( else { rLnge = pFormat->GetLanguage(); - eType = pFormat->GetType()&~css::util::NumberFormat::DEFINED; + eType = pFormat->GetMaskedType(); if (eType == 0) { eType = css::util::NumberFormat::DEFINED; @@ -1081,7 +1081,7 @@ bool SvNumberFormatter::IsNumberFormat(const OUString& sString, } else { - FType = pFormat->GetType() &~css::util::NumberFormat::DEFINED; + FType = pFormat->GetMaskedType(); if (FType == 0) { FType = css::util::NumberFormat::DEFINED; @@ -1249,8 +1249,7 @@ sal_uInt32 SvNumberFormatter::ImpGetDefaultFormat( short nType ) while ( it2 != aFTable.end() && (nKey = it2->first ) >= CLOffset && nKey < nStopKey ) { const SvNumberformat* pEntry = it2->second; - if ( pEntry->IsStandard() && ((pEntry->GetType() & - ~css::util::NumberFormat::DEFINED) == nType) ) + if ( pEntry->IsStandard() && (pEntry->GetMaskedType() == nType) ) { nDefaultFormat = nKey; break; // while @@ -1490,7 +1489,7 @@ void SvNumberFormatter::GetInputLineString(const double& fOutNumber, LanguageType eLang = pFormat->GetLanguage(); ChangeIntl( eLang ); - short eType = pFormat->GetType() & ~css::util::NumberFormat::DEFINED; + short eType = pFormat->GetMaskedType(); if (eType == 0) { // Mixed types in subformats, use first. @@ -3039,7 +3038,7 @@ short SvNumberFormatter::GetType(sal_uInt32 nFIndex) } else { - eType = pFormat->GetType() &~css::util::NumberFormat::DEFINED; + eType = pFormat->GetMaskedType(); if (eType == 0) { eType = css::util::NumberFormat::DEFINED; diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx index 765ec8da8949..b0a8d9211e9d 100644 --- a/svx/source/items/numfmtsh.cxx +++ b/svx/source/items/numfmtsh.cxx @@ -692,7 +692,7 @@ short SvxNumberFormatShell::FillEListWithFormats_Impl( std::vector& rL if(pNumEntry==nullptr) continue; - nMyCat=pNumEntry->GetType() & ~css::util::NumberFormat::DEFINED; + nMyCat=pNumEntry->GetMaskedType(); aStrComment=pNumEntry->GetComment(); CategoryToPos_Impl(nMyCat,nMyType); aNewFormNInfo= pNumEntry->GetFormatstring(); @@ -727,7 +727,7 @@ short SvxNumberFormatShell::FillEListWithDateTime_Impl( std::vector& r const SvNumberformat* pNumEntry = pFormatter->GetEntry(nNFEntry); if(pNumEntry!=nullptr) { - nMyCat=pNumEntry->GetType() & ~css::util::NumberFormat::DEFINED; + nMyCat=pNumEntry->GetMaskedType(); aStrComment=pNumEntry->GetComment(); CategoryToPos_Impl(nMyCat,nMyType); aNewFormNInfo= pNumEntry->GetFormatstring(); @@ -811,7 +811,7 @@ short SvxNumberFormatShell::FillEListWithSysCurrencys( std::vector& rL if(pNumEntry==nullptr) continue; - nMyCat=pNumEntry->GetType() & ~css::util::NumberFormat::DEFINED; + nMyCat=pNumEntry->GetMaskedType(); aStrComment=pNumEntry->GetComment(); CategoryToPos_Impl(nMyCat,nMyType); aNewFormNInfo= pNumEntry->GetFormatstring(); @@ -850,7 +850,7 @@ short SvxNumberFormatShell::FillEListWithSysCurrencys( std::vector& rL if(!bUserNewCurrency &&(pNumEntry->GetType() & css::util::NumberFormat::DEFINED)) { - nMyCat=pNumEntry->GetType() & ~css::util::NumberFormat::DEFINED; + nMyCat=pNumEntry->GetMaskedType(); aStrComment=pNumEntry->GetComment(); CategoryToPos_Impl(nMyCat,nMyType); aNewFormNInfo= pNumEntry->GetFormatstring(); @@ -935,7 +935,7 @@ short SvxNumberFormatShell::FillEListWithUserCurrencys( std::vector& r if( pNumEntry->GetType() & css::util::NumberFormat::DEFINED || pNumEntry->IsAdditionalBuiltin() ) { - nMyCat=pNumEntry->GetType() & ~css::util::NumberFormat::DEFINED; + nMyCat=pNumEntry->GetMaskedType(); aStrComment = pNumEntry->GetComment(); CategoryToPos_Impl(nMyCat,nMyType); aNewFormNInfo = pNumEntry->GetFormatstring(); @@ -1086,7 +1086,7 @@ short SvxNumberFormatShell::FillEListWithUsD_Impl( std::vector& rList, if( (pNumEntry->GetType() & css::util::NumberFormat::DEFINED) || (bAdditional && pNumEntry->IsAdditionalBuiltin()) ) { - nMyCat=pNumEntry->GetType() & ~css::util::NumberFormat::DEFINED; + nMyCat=pNumEntry->GetMaskedType(); aStrComment=pNumEntry->GetComment(); CategoryToPos_Impl(nMyCat,nMyType); aNewFormNInfo= pNumEntry->GetFormatstring(); @@ -1262,7 +1262,7 @@ short SvxNumberFormatShell::GetCategory4Entry(short nEntry) const sal_uInt16 nMyCat,nMyType; if(pNumEntry!=nullptr) { - nMyCat=pNumEntry->GetType() & ~css::util::NumberFormat::DEFINED; + nMyCat=pNumEntry->GetMaskedType(); CategoryToPos_Impl(nMyCat,nMyType); return (short) nMyType;