include/svl/numformat.hxx        |    2 +-
 sc/source/ui/view/formatsh.cxx   |    2 +-
 svl/source/numbers/zforlist.cxx  |    4 ++--
 svx/source/items/numfmtsh.cxx    |    2 +-
 sw/source/core/fields/fldbas.cxx |   10 ++++------
 xmloff/source/style/xmlnumfe.cxx |    2 +-
 xmloff/source/style/xmlnumfi.cxx |    2 +-
 7 files changed, 11 insertions(+), 13 deletions(-)

New commits:
commit ba5cbbccefb5d55e19ed928cf900f8afb8337e9d
Author:     Caolán McNamara <[email protected]>
AuthorDate: Wed Mar 20 16:43:26 2024 +0000
Commit:     Adolfo Jayme Barrientos <[email protected]>
CommitDate: Mon Apr 15 05:54:43 2024 +0200

    Related: tdf#160056 this can be static
    
    Change-Id: I1172854a1bf00e74adbe350c54e4e98ea38b0b35
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165072
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>
    (cherry picked from commit 49189bb8823adc6a76d3f33b34c02d6a640df96a)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165746
    Reviewed-by: Adolfo Jayme Barrientos <[email protected]>

diff --git a/include/svl/numformat.hxx b/include/svl/numformat.hxx
index 6a007d1bd057..8a6c55b7fd9e 100644
--- a/include/svl/numformat.hxx
+++ b/include/svl/numformat.hxx
@@ -359,7 +359,7 @@ public:
         NF_INDEX_TABLE_ENTRIES if it's not a builtin format.
         @see NfIndexTableOffset
      */
-    NfIndexTableOffset GetIndexTableOffset(sal_uInt32 nFormat) const;
+    static NfIndexTableOffset GetIndexTableOffset(sal_uInt32 nFormat);
 
     /** Set evaluation type and order of input date strings
         @see NfEvalDateFormat
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 93a456e46b53..8381209e7c72 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1736,7 +1736,7 @@ void ScFormatShell::GetNumFormatState( SfxItemSet& rSet )
                                       // SvNumFormatType::DEFINED bit.
     const SvNumFormatType nType     = (eItemState >= SfxItemState::DEFAULT ? 
pFormatter->GetType( nNumberFormat) :
                                        GetCurrentNumberFormatType());
-    NfIndexTableOffset nOffset      = 
pFormatter->GetIndexTableOffset(nNumberFormat);
+    NfIndexTableOffset nOffset      = 
SvNumberFormatter::GetIndexTableOffset(nNumberFormat);
 
     SfxWhichIter aIter(rSet);
     sal_uInt16 nWhich = aIter.FirstWhich();
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 665f70948a78..7251692ca7d0 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -3573,8 +3573,8 @@ sal_uInt32 SvNumberFormatter::GetFormatIndex( 
NfIndexTableOffset nTabOff,
     return nCLOffset + indexTable[nTabOff];
 }
 
-
-NfIndexTableOffset SvNumberFormatter::GetIndexTableOffset( sal_uInt32 nFormat 
) const
+//static
+NfIndexTableOffset SvNumberFormatter::GetIndexTableOffset(sal_uInt32 nFormat)
 {
     sal_uInt32 nOffset = nFormat % SV_COUNTRY_LANGUAGE_OFFSET;      // 
relative index
     if ( nOffset > SV_MAX_COUNT_STANDARD_FORMATS )
diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx
index 8605817491ba..a1a4c70cecb9 100644
--- a/svx/source/items/numfmtsh.cxx
+++ b/svx/source/items/numfmtsh.cxx
@@ -713,7 +713,7 @@ bool 
SvxNumberFormatShell::IsEssentialFormat_Impl(SvNumFormatType eType, sal_uIn
     if (nKey == nCurFormatKey)
         return true;
 
-    const NfIndexTableOffset nIndex = pFormatter->GetIndexTableOffset(nKey);
+    const NfIndexTableOffset nIndex = 
SvNumberFormatter::GetIndexTableOffset(nKey);
     switch (nIndex)
     {
         // These are preferred or edit formats.
diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx
index b3fab811f1c2..69f08a4eab56 100644
--- a/sw/source/core/fields/fldbas.cxx
+++ b/sw/source/core/fields/fldbas.cxx
@@ -48,13 +48,12 @@
 using namespace ::com::sun::star;
 using namespace nsSwDocInfoSubType;
 
-static LanguageType lcl_GetLanguageOfFormat( LanguageType nLng, sal_uLong 
nFormat,
-                                const SvNumberFormatter& rFormatter )
+static LanguageType lcl_GetLanguageOfFormat(LanguageType nLng, sal_uLong 
nFormat)
 {
     if( nLng == LANGUAGE_NONE ) // Bug #60010
         nLng = LANGUAGE_SYSTEM;
     else if( nLng == ::GetAppLanguage() )
-        switch( rFormatter.GetIndexTableOffset( nFormat ))
+        switch( SvNumberFormatter::GetIndexTableOffset( nFormat ))
         {
         case NF_NUMBER_SYSTEM:
         case NF_DATE_SYSTEM_SHORT:
@@ -583,7 +582,7 @@ OUString SwValueFieldType::ExpandValue( const double& rVal,
     const Color* pCol = nullptr;
 
     // Bug #60010
-    LanguageType nFormatLng = ::lcl_GetLanguageOfFormat( nLng, nFormat, 
*pFormatter );
+    LanguageType nFormatLng = ::lcl_GetLanguageOfFormat( nLng, nFormat );
 
     if( nFormat < SV_COUNTRY_LANGUAGE_OFFSET && LANGUAGE_SYSTEM != nFormatLng )
     {
@@ -752,8 +751,7 @@ void SwValueField::SetLanguage( LanguageType nLng )
     {
         // Bug #60010
         SvNumberFormatter* pFormatter = GetDoc()->GetNumberFormatter();
-        LanguageType nFormatLng = ::lcl_GetLanguageOfFormat( nLng, GetFormat(),
-                                                    *pFormatter );
+        LanguageType nFormatLng = ::lcl_GetLanguageOfFormat( nLng, GetFormat() 
);
 
         if( (GetFormat() >= SV_COUNTRY_LANGUAGE_OFFSET ||
              LANGUAGE_SYSTEM != nFormatLng ) &&
diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx
index 406c22236a71..f86893c6708e 100644
--- a/xmloff/source/style/xmlnumfe.cxx
+++ b/xmloff/source/style/xmlnumfe.cxx
@@ -1100,7 +1100,7 @@ void SvXMLNumFmtExport::ExportPart_Impl( const 
SvNumberformat& rFormat, sal_uInt
 
     //  element name
 
-    NfIndexTableOffset eBuiltIn = m_pFormatter->GetIndexTableOffset( nRealKey 
);
+    NfIndexTableOffset eBuiltIn = SvNumberFormatter::GetIndexTableOffset( 
nRealKey );
 
     SvNumFormatType nFmtType = SvNumFormatType::ALL;
     bool bThousand = false;
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index f6d05e94c1bf..261c83915478 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -1690,7 +1690,7 @@ sal_Int32 
SvXMLNumFormatContext::CreateAndInsert(SvNumberFormatter* pFormatter)
         //  use fixed-order formats instead of SYS... if bAutoOrder is false
         //  (only if the format strings are equal for the locale)
 
-        NfIndexTableOffset eOffset = pFormatter->GetIndexTableOffset( nIndex );
+        NfIndexTableOffset eOffset = SvNumberFormatter::GetIndexTableOffset( 
nIndex );
         if ( eOffset == NF_DATE_SYS_DMMMYYYY )
         {
             sal_uInt32 nNewIndex = pFormatter->GetFormatIndex( 
NF_DATE_DIN_DMMMYYYY, m_nFormatLang );

Reply via email to