diff options
-rw-r--r-- | include/svl/zforlist.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/column.cxx | 2 | ||||
-rw-r--r-- | svl/source/numbers/numfmuno.cxx | 9 | ||||
-rw-r--r-- | svl/source/numbers/zforlist.cxx | 6 |
4 files changed, 6 insertions, 13 deletions
diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx index d87641e46843..1fdb306d274c 100644 --- a/include/svl/zforlist.hxx +++ b/include/svl/zforlist.hxx @@ -339,7 +339,7 @@ public: LanguageType GetLanguage() const; // Determine whether two format types are input compatible or not - bool IsCompatible(short eOldType, short eNewType); + static bool IsCompatible(short eOldType, short eNewType); /** Get table of formats of a specific type of a locale. A format FIndex is tested whether it has the type and locale requested, if it doesn't diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 548efca6861d..40132082f46d 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -524,7 +524,7 @@ void ScColumn::ApplyPatternIfNumberformatIncompatible( const ScRange& rRange, nRow1, nRow2, nRow ); sal_uInt32 nFormat = pPattern->GetNumberFormat( pFormatter ); short nOldType = pFormatter->GetType( nFormat ); - if ( nOldType == nNewType || pFormatter->IsCompatible( nOldType, nNewType ) ) + if ( nOldType == nNewType || SvNumberFormatter::IsCompatible( nOldType, nNewType ) ) nRow = nRow2; else { diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx index 0f87d6809b5e..0047c3478936 100644 --- a/svl/source/numbers/numfmuno.cxx +++ b/svl/source/numbers/numfmuno.cxx @@ -622,14 +622,7 @@ sal_Bool SAL_CALL SvNumberFormatsObj::isTypeCompatible( sal_Int16 nOldType, sal_ { ::osl::MutexGuard aGuard( m_aMutex ); - bool bRet = false; - SvNumberFormatter* pFormatter = rSupplier.GetNumberFormatter(); - if (pFormatter) - bRet = pFormatter->IsCompatible( nOldType, nNewType ); - else - throw uno::RuntimeException(); - - return bRet; + return SvNumberFormatter::IsCompatible( nOldType, nNewType ); } sal_Int32 SAL_CALL SvNumberFormatsObj::getFormatForLocale( sal_Int32 nKey, const lang::Locale& nLocale ) diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 0747e0c2a326..9cfe4cc2e85a 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -1146,8 +1146,8 @@ LanguageType SvNumberFormatter::GetLanguage() const return IniLnge; } -bool SvNumberFormatter::IsCompatible(short eOldType, - short eNewType) +// static +bool SvNumberFormatter::IsCompatible(short eOldType, short eNewType) { if (eOldType == eNewType) { @@ -1168,9 +1168,9 @@ bool SvNumberFormatter::IsCompatible(short eOldType, case css::util::NumberFormat::CURRENCY: case css::util::NumberFormat::SCIENTIFIC: case css::util::NumberFormat::FRACTION: -// case css::util::NumberFormat::LOGICAL: case css::util::NumberFormat::DEFINED: return true; + case css::util::NumberFormat::LOGICAL: default: return false; } |