diff options
Diffstat (limited to 'include/svl')
-rw-r--r-- | include/svl/IndexedStyleSheets.hxx | 1 | ||||
-rw-r--r-- | include/svl/numformat.hxx | 46 | ||||
-rw-r--r-- | include/svl/style.hxx | 1 | ||||
-rw-r--r-- | include/svl/zformat.hxx | 12 |
4 files changed, 28 insertions, 32 deletions
diff --git a/include/svl/IndexedStyleSheets.hxx b/include/svl/IndexedStyleSheets.hxx index 910acd9e25..c58a4b7367 100644 --- a/include/svl/IndexedStyleSheets.hxx +++ b/include/svl/IndexedStyleSheets.hxx @@ -144,6 +144,7 @@ public: void Clear(StyleSheetDisposer& cleanup); void Reindex(); + void ReindexOnNameChange(const OUString& rOldName, const OUString& rNewName); /** Warning: counting for n starts at 0, i.e., the 0th style sheet is the first that is found. */ SfxStyleSheetBase* GetNthStyleSheetThatMatchesPredicate(sal_Int32 n, diff --git a/include/svl/numformat.hxx b/include/svl/numformat.hxx index 0a374f3c33..2ebed94959 100644 --- a/include/svl/numformat.hxx +++ b/include/svl/numformat.hxx @@ -53,7 +53,7 @@ public: */ static const sal_uInt16 INPUTSTRING_PRECISION; - /// Preferred ctor with service manager and language/country enum + /// ctor with service manager and language/country enum SvNumberFormatter(const css::uno::Reference<css::uno::XComponentContext>& rxContext, LanguageType eLang); @@ -62,7 +62,7 @@ public: /// Set CallBack to ColorTable void SetColorLink(const Link<sal_uInt16, Color*>& rColorTableCallBack); /// Do the CallBack to ColorTable - Color* GetUserDefColor(sal_uInt16 nIndex); + Color* GetUserDefColor(sal_uInt16 nIndex) const; /// Change language/country, also input and format scanner void ChangeIntl(LanguageType eLnge); @@ -297,9 +297,6 @@ public: sal_uInt32 GetStandardFormat(double fNumber, sal_uInt32 nFIndex, SvNumFormatType eType, LanguageType eLnge); - /// Whether nFIndex is a special builtin format - bool IsSpecialStandardFormat(sal_uInt32 nFIndex, LanguageType eLnge); - /** Return a time format that best matches fNumber. */ sal_uInt32 GetTimeFormat(double fNumber, LanguageType eLnge, bool bForceDuration); @@ -359,7 +356,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 @@ -573,6 +570,8 @@ public: private: mutable ::osl::Mutex m_aMutex; css::uno::Reference<css::uno::XComponentContext> m_xContext; + const LanguageType IniLnge; // Initialized setting language/country + LanguageType ActLnge; // Current setting language/country LanguageTag maLanguageTag; std::map<sal_uInt32, std::unique_ptr<SvNumberformat>> aFTable; // Table of format keys to format entries @@ -591,8 +590,6 @@ private: Link<sal_uInt16, Color*> aColorLink; // User defined color table CallBack sal_uInt32 MaxCLOffset; // Max language/country offset used sal_uInt32 nDefaultSystemCurrencyFormat; // NewCurrency matching SYSTEM locale - LanguageType IniLnge; // Initialized setting language/country - LanguageType ActLnge; // Current setting language/country NfEvalDateFormat eEvalDateFormat; // DateFormat evaluation bool bNoZero; // Zero value suppression @@ -609,9 +606,6 @@ private: // get the registry, create one if none exists SVL_DLLPRIVATE static SvNumberFormatterRegistry_Impl& GetFormatterRegistry(); - // called by ctors - SVL_DLLPRIVATE void ImpConstruct(LanguageType eLang); - // Generate builtin formats provided by i18n behind CLOffset, // if bNoAdditionalFormats==false also generate additional i18n formats. SVL_DLLPRIVATE void ImpGenerateFormats(sal_uInt32 CLOffset, bool bNoAdditionalFormats); @@ -633,7 +627,7 @@ private: // Test whether format code already exists, then return index key, // otherwise NUMBERFORMAT_ENTRY_NOT_FOUND SVL_DLLPRIVATE sal_uInt32 ImpIsEntry(std::u16string_view rString, sal_uInt32 CLOffset, - LanguageType eLnge); + LanguageType eLnge) const; // Create builtin formats for language/country if necessary, return CLOffset SVL_DLLPRIVATE sal_uInt32 ImpGenerateCL(LanguageType eLnge); @@ -679,31 +673,31 @@ private: // link to be set at <method>SvtSysLocaleOptions::SetCurrencyChangeLink()</method> DECL_DLLPRIVATE_STATIC_LINK(SvNumberFormatter, CurrencyChangeLink, LinkParamNone*, void); - // return position of a special character - sal_Int32 ImpPosToken(const OUStringBuffer& sFormat, sal_Unicode token, - sal_Int32 nStartPos = 0) const; - // 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); + + // called by SvNumberFormatterRegistry_Impl::Notify if the default system currency changes + SVL_DLLPRIVATE void ResetDefaultSystemCurrency(); + + // Replace the SYSTEM language/country format codes. Called upon change of + // the user configurable locale. + // Old compatibility codes are replaced, user defined are converted, and + // new format codes are appended. + SVL_DLLPRIVATE void ReplaceSystemCL(LanguageType eOldLanguage); // own mutex, may also be used by internal class SvNumberFormatterRegistry_Impl static ::osl::Mutex& GetGlobalMutex(); ::osl::Mutex& GetInstanceMutex() const { return m_aMutex; } public: - // called by SvNumberFormatterRegistry_Impl::Notify if the default system currency changes - void ResetDefaultSystemCurrency(); - // Called by SvNumberFormatterRegistry_Impl::Notify if the system locale's // date acceptance patterns change. void InvalidateDateAcceptancePatterns(); - // Replace the SYSTEM language/country format codes. Called upon change of - // the user configurable locale. - // Old compatibility codes are replaced, user defined are converted, and - // new format codes are appended. - void ReplaceSystemCL(LanguageType eOldLanguage); - const css::uno::Reference<css::uno::XComponentContext>& GetComponentContext() const; //! The following method is not to be used from outside but must be diff --git a/include/svl/style.hxx b/include/svl/style.hxx index fc12dc0be7..87c5563ed5 100644 --- a/include/svl/style.hxx +++ b/include/svl/style.hxx @@ -275,6 +275,7 @@ public: virtual SfxStyleSheetBase* Find( const OUString&, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All ); void Reindex(); + void ReindexOnNameChange(const OUString& rOldName, const OUString& rNewName); /** Add a style sheet. * Not an actual public function. Do not call it from non-subclasses. */ diff --git a/include/svl/zformat.hxx b/include/svl/zformat.hxx index 1fa52c3384..b4d7ddb0ac 100644 --- a/include/svl/zformat.hxx +++ b/include/svl/zformat.hxx @@ -638,7 +638,7 @@ private: sal_uInt16 j, sal_uInt16 nIx, sal_Int32 nDigCnt, - bool bAddDecSep = true ); + bool bAddDecSep = true ) const; // Helper function to fill in the group (AKA thousand) separators // or to skip additional digits @@ -647,14 +647,14 @@ private: sal_Int32& k, sal_uInt16 nIx, sal_Int32 & nDigitCount, - utl::DigitGroupingIterator & ); + utl::DigitGroupingIterator & ) const; SVL_DLLPRIVATE bool ImpDecimalFill( OUStringBuffer& sStr, double& rNumber, sal_Int32 nDecPos, sal_uInt16 j, sal_uInt16 nIx, - bool bInteger ); + bool bInteger ) const; /** Calculate each element of fraction: * integer part, numerator part, denominator part @@ -701,11 +701,11 @@ private: SVL_DLLPRIVATE bool ImpGetLogicalOutput( double fNumber, sal_uInt16 nIx, - OUStringBuffer& OutString ); + OUStringBuffer& OutString ) const; SVL_DLLPRIVATE bool ImpGetNumberOutput( double fNumber, sal_uInt16 nIx, - OUStringBuffer& OutString ); + OUStringBuffer& OutString ) const; SVL_DLLPRIVATE void ImpCopyNumberformat( const SvNumberformat& rFormat ); @@ -731,7 +731,7 @@ private: // nFractionDecimals, unless nMinimumInputLineDecimals>0 is given for input // line string where extra trailing "0" are discarded. SVL_DLLPRIVATE sal_uInt16 ImpGetFractionOfSecondString( OUStringBuffer& rBuf, double fFractionOfSecond, - int nFractionDecimals, bool bAddOneRoundingDecimal, sal_uInt16 nIx, sal_uInt16 nMinimumInputLineDecimals ); + int nFractionDecimals, bool bAddOneRoundingDecimal, sal_uInt16 nIx, sal_uInt16 nMinimumInputLineDecimals ) const; // transliterate according to NativeNumber SVL_DLLPRIVATE OUString impTransliterateImpl(const OUString& rStr, const SvNumberNatNum& rNum) const; |