use SvNumberformat::GetMaskedType()

... instead of manually masking out css::util::NumberFormat::DEFINED

Change-Id: I0761132800b2b1693df41085695f36cd3cc1236b
This commit is contained in:
Eike Rathke
2017-02-20 20:55:39 +01:00
parent ce315ac121
commit 2f6d2c0c47
4 changed files with 14 additions and 15 deletions

View File

@@ -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 )
{

View File

@@ -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)
{

View File

@@ -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;

View File

@@ -692,7 +692,7 @@ short SvxNumberFormatShell::FillEListWithFormats_Impl( std::vector<OUString>& 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<OUString>& 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<OUString>& 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<OUString>& 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<OUString>& 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<OUString>& 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;