bin/find-can-be-private-symbols.functions.results |    1 -
 include/svl/numformat.hxx                         |    3 ++-
 include/svl/zformat.hxx                           |   18 +++++++++---------
 sc/source/ui/view/viewfunc.cxx                    |    2 +-
 svl/source/numbers/zformat.cxx                    |   18 +++++++++---------
 sw/source/uibase/utlui/numfmtlb.cxx               |    2 +-
 6 files changed, 22 insertions(+), 22 deletions(-)

New commits:
commit 80570de114d31f4ae5114b6fd6fd3ea365b14d63
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Thu Mar 21 17:44:13 2024 +0000
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Mar 22 07:57:21 2024 +0100

    Related: tdf#160056 these methods can be const
    
    Change-Id: Icf52f1665561eef0aa10febc9ca2f946e89b689b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165141
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx
index 30f74af23a88..f60e74783d5c 100644
--- a/include/svl/zformat.hxx
+++ b/include/svl/zformat.hxx
@@ -242,8 +242,8 @@ public:
     bool GetOutputString( double fNumber, sal_uInt16 nCharCount, OUString& 
rOutString ) const;
 
     // bStarFlag: Take *n format as ESC n
-    bool GetOutputString( double fNumber, OUString& OutString, const Color** 
ppColor, bool bStarFlag = false );
-    void GetOutputString( std::u16string_view sString, OUString& OutString, 
const Color** ppColor, bool bStarFlag = false );
+    bool GetOutputString( double fNumber, OUString& OutString, const Color** 
ppColor, bool bStarFlag = false ) const;
+    void GetOutputString( std::u16string_view sString, OUString& OutString, 
const Color** ppColor, bool bStarFlag = false ) const;
 
     // True if type text
     bool IsTextFormat() const { return bool(eType & SvNumFormatType::TEXT); }
@@ -628,7 +628,7 @@ private:
                     sal_uInt16 nIx,
                     short eSymbolType,
                     bool bStarFlag,
-                    bool bInsertRightBlank = false );
+                    bool bInsertRightBlank = false ) const;
 
     // Helper function to fill in the integer part and the group (AKA 
thousand) separators
     SVL_DLLPRIVATE bool ImpNumberFillWithThousands(OUStringBuffer& sStr,
@@ -673,31 +673,31 @@ private:
     SVL_DLLPRIVATE bool ImpGetFractionOutput(double fNumber,
                                              sal_uInt16 nIx,
                                              bool bStarFlag,
-                                             OUStringBuffer& OutString);
+                                             OUStringBuffer& OutString) const;
     SVL_DLLPRIVATE bool ImpGetScientificOutput(double fNumber,
                                                sal_uInt16 nIx,
                                                bool bStarFlag,
-                                               OUStringBuffer& OutString);
+                                               OUStringBuffer& OutString) 
const;
 
     SVL_DLLPRIVATE bool ImpGetDateOutput( double fNumber,
                                           sal_uInt16 nIx,
                                           bool bStarFlag,
-                                          OUStringBuffer& OutString );
+                                          OUStringBuffer& OutString ) const;
     SVL_DLLPRIVATE bool ImpGetTimeOutput( double fNumber,
                                           sal_uInt16 nIx,
                                           bool bStarFlag,
-                                          OUStringBuffer& OutString );
+                                          OUStringBuffer& OutString ) const;
     SVL_DLLPRIVATE bool ImpGetDateTimeOutput( double fNumber,
                                               sal_uInt16 nIx,
                                               bool bStarFlag,
-                                              OUStringBuffer& OutString );
+                                              OUStringBuffer& OutString ) 
const;
 
     // Switches to the "gregorian" calendar if the current calendar is
     // non-"gregorian" and the era is a "Dummy" era of a calendar which doesn't
     // know a "before" era (like zh_TW ROC or ja_JP Gengou). If switched and
     // rOrgCalendar was "gregorian" the string is emptied. If rOrgCalendar was
     // empty the previous calendar name and date/time are returned.
-    SVL_DLLPRIVATE bool ImpFallBackToGregorianCalendar( OUString& 
rOrgCalendar, double& fOrgDateTime );
+    SVL_DLLPRIVATE bool ImpFallBackToGregorianCalendar(OUString& rOrgCalendar, 
double& fOrgDateTime) const;
 
     // Append a "G" short era string of the given calendar. In the case of a
     // Gengou calendar this is a one character abbreviation, for other
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index e4153cb0d826..370097507f06 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -2991,7 +2991,7 @@ void ScViewFunc::ChangeNumFmtDecimals( bool bIncrement )
         //  the ways of the Numberformatters are unfathomable, so try:
         OUString aOut;
         const Color* pCol;
-        const_cast<SvNumberformat*>(pOldEntry)->GetOutputString( nVal, aOut, 
&pCol );
+        pOldEntry->GetOutputString( nVal, aOut, &pCol );
 
         nPrecision = 0;
         // 'E' for exponential is fixed in Numberformatter
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index db720493943c..69d3335ef71b 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -2198,7 +2198,7 @@ static bool lcl_insertStarFillChar( OUStringBuffer& rBuf, 
sal_Int32 nPos, std::u
 void SvNumberformat::GetOutputString(std::u16string_view sString,
                                      OUString& OutString,
                                      const Color** ppColor,
-                                     bool bStarFlag)
+                                     bool bStarFlag) const
 {
     OUStringBuffer sOutBuff;
     sal_uInt16 nIx;
@@ -2476,7 +2476,7 @@ sal_uInt16 SvNumberformat::GetSubformatIndex (double 
fNumber ) const
 bool SvNumberformat::GetOutputString(double fNumber,
                                      OUString& OutString,
                                      const Color** ppColor,
-                                     bool bStarFlag)
+                                     bool bStarFlag) const
 {
     bool bRes = false;
     OutString.clear();
@@ -2666,7 +2666,7 @@ bool SvNumberformat::GetOutputString(double fNumber,
 bool SvNumberformat::ImpGetScientificOutput(double fNumber,
                                             sal_uInt16 nIx,
                                             bool bStarFlag,
-                                            OUStringBuffer& sStr)
+                                            OUStringBuffer& sStr) const
 {
     bool bRes = false;
     bool bSign = false;
@@ -2900,7 +2900,7 @@ void SvNumberformat::ImpGetFractionElements ( double& 
fNumber, sal_uInt16 nIx,
 bool SvNumberformat::ImpGetFractionOutput(double fNumber,
                                           sal_uInt16 nIx,
                                           bool bStarFlag,
-                                          OUStringBuffer& sBuff)
+                                          OUStringBuffer& sBuff) const
 {
     bool bRes = false;
     const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info();
@@ -3089,7 +3089,7 @@ sal_uInt16 SvNumberformat::ImpGetFractionOfSecondString( 
OUStringBuffer& rBuf, d
 bool SvNumberformat::ImpGetTimeOutput(double fNumber,
                                       sal_uInt16 nIx,
                                       bool bStarFlag,
-                                      OUStringBuffer& sBuff)
+                                      OUStringBuffer& sBuff) const
 {
     using namespace ::com::sun::star::i18n;
     bool bCalendarSet = false;
@@ -3479,7 +3479,7 @@ void SvNumberformat::SwitchToGregorianCalendar( 
std::u16string_view rOrgCalendar
     }
 }
 
-bool SvNumberformat::ImpFallBackToGregorianCalendar( OUString& rOrgCalendar, 
double& fOrgDateTime )
+bool SvNumberformat::ImpFallBackToGregorianCalendar( OUString& rOrgCalendar, 
double& fOrgDateTime ) const
 {
     using namespace ::com::sun::star::i18n;
     CalendarWrapper& rCal = GetCal();
@@ -3709,7 +3709,7 @@ static bool lcl_getValidDate( const DateTime& rNullDate, 
const DateTime& rEpochS
 bool SvNumberformat::ImpGetDateOutput(double fNumber,
                                       sal_uInt16 nIx,
                                       bool bStarFlag,
-                                      OUStringBuffer& sBuff)
+                                      OUStringBuffer& sBuff) const
 {
     using namespace ::com::sun::star::i18n;
     bool bRes = false;
@@ -3980,7 +3980,7 @@ bool SvNumberformat::ImpGetDateOutput(double fNumber,
 bool SvNumberformat::ImpGetDateTimeOutput(double fNumber,
                                           sal_uInt16 nIx,
                                           bool bStarFlag,
-                                          OUStringBuffer& sBuff)
+                                          OUStringBuffer& sBuff) const
 {
     using namespace ::com::sun::star::i18n;
     bool bRes = false;
@@ -4791,7 +4791,7 @@ bool SvNumberformat::ImpNumberFill( OUStringBuffer& 
sBuff, // number string
                                     sal_uInt16 nIx,        // subformat index
                                     short eSymbolType,     // type of stop 
condition
                                     bool bStarFlag,        // Take *n format 
as ESC n
-                                    bool bInsertRightBlank)// insert blank on 
right for denominator (default = false)
+                                    bool bInsertRightBlank) const // insert 
blank on right for denominator (default = false)
 {
     bool bRes = false;
     bool bStop = false;
diff --git a/sw/source/uibase/utlui/numfmtlb.cxx 
b/sw/source/uibase/utlui/numfmtlb.cxx
index 4dffed15d219..ad601c981716 100644
--- a/sw/source/uibase/utlui/numfmtlb.cxx
+++ b/sw/source/uibase/utlui/numfmtlb.cxx
@@ -263,7 +263,7 @@ void SwNumFormatBase::SetFormatType(const SvNumFormatType 
nFormatType)
 
         if( nFormat == pFormatter->GetFormatIndex( NF_NUMBER_STANDARD,
                                                     m_eCurLanguage )
-            || const_cast<SvNumberformat*>(pFormat)->GetOutputString( fVal, 
sValue, &pCol )
+            || pFormat->GetOutputString( fVal, sValue, &pCol )
             || nFormatType == SvNumFormatType::UNDEFINED )
         {
             sValue = pFormat->GetFormatstring();
commit 472713123b898470a9ce54ee9f19d900dd993d2d
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Thu Mar 21 17:12:49 2024 +0000
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Mar 22 07:57:08 2024 +0100

    Related: tdf#160056 ImpSubstituteEntry can be private and not exported
    
    Change-Id: I895db1f02338b6c2a1fec8bdfc15c2857fbee38f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165138
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/bin/find-can-be-private-symbols.functions.results 
b/bin/find-can-be-private-symbols.functions.results
index baeda98d9686..50de2e5acae0 100644
--- a/bin/find-can-be-private-symbols.functions.results
+++ b/bin/find-can-be-private-symbols.functions.results
@@ -6491,7 +6491,6 @@ SvNumberFormatter::GetNumThousandSep() const
 SvNumberFormatter::GetTransliteration() const
 SvNumberFormatter::GetUserDefColor(unsigned short) const
 SvNumberFormatter::ImpLookupCurrencyEntryLoopBody(NfCurrencyEntry const*&, 
bool&, NfCurrencyEntry const*, unsigned short, std::basic_string_view<char16_t, 
std::char_traits<char16_t> >)
-SvNumberFormatter::ImpSubstituteEntry(SvNumberformat*, unsigned int*)
 SvNumberFormatter::InvalidateDateAcceptancePatterns()
 SvNumberFormatter::IsDecimalSep(std::basic_string_view<char16_t, 
std::char_traits<char16_t> >) const
 SvNumberFormatter::IsLocaleInstalled(o3tl::strong_int<unsigned short, 
LanguageTypeTag>)
diff --git a/include/svl/numformat.hxx b/include/svl/numformat.hxx
index 076994eb9f76..2ebed94959cc 100644
--- a/include/svl/numformat.hxx
+++ b/include/svl/numformat.hxx
@@ -674,7 +674,8 @@ private:
     DECL_DLLPRIVATE_STATIC_LINK(SvNumberFormatter, CurrencyChangeLink, 
LinkParamNone*, void);
 
     // Substitute a format during GetFormatEntry(), i.e. system formats.
-    SvNumberformat* ImpSubstituteEntry(SvNumberformat* pFormat, sal_uInt32* 
o_pRealKey = nullptr);
+    SVL_DLLPRIVATE SvNumberformat* ImpSubstituteEntry(SvNumberformat* pFormat,
+                                                      sal_uInt32* o_pRealKey = 
nullptr);
 
     // Whether nFIndex is a special builtin format
     SVL_DLLPRIVATE bool ImpIsSpecialStandardFormat(sal_uInt32 nFIndex, 
LanguageType eLnge);

Reply via email to