sc/inc/patattr.hxx | 2 +- sc/source/core/data/patattr.cxx | 2 +- sc/source/ui/view/tabvwsha.cxx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
New commits: commit c9cb84cc8eb4ecd8e76ef3bf5c787b71e2dc2aab Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Sun Jun 22 19:35:08 2025 +0500 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Sun Jun 22 18:38:45 2025 +0200 HasNumberFormat -> HasValidNumberFormat Rename the function to better reflect its purpose. It only returns false, when the pattern has one of attributes defining the number format invalidated. When it returns false, the UI effect is that the number format dialog has no number format / language selection (see SvxNumberFormatTabPage::Obstructing). Change-Id: I96b853510fe7f80b6f193697adc2768fe7243a1d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186796 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/sc/inc/patattr.hxx b/sc/inc/patattr.hxx index 99d0d1e51788..e818df60a197 100644 --- a/sc/inc/patattr.hxx +++ b/sc/inc/patattr.hxx @@ -262,7 +262,7 @@ public: with text encoding RTL_TEXTENC_SYMBOL */ bool IsSymbolFont() const; - bool HasNumberFormat() const; // Returns false e.g. for multiformat selection + bool HasValidNumberFormat() const; // Returns false e.g. for multiformat selection SC_DLLPUBLIC sal_uInt32 GetNumberFormat( SvNumberFormatter* ) const; sal_uInt32 GetNumberFormat( const ScInterpreterContext& rContext ) const; sal_uInt32 GetNumberFormat( SvNumberFormatter* pFormatter, diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index 3a0a6aa2d6ae..541e94c319f1 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -1649,7 +1649,7 @@ LanguageType getLanguageType(const SfxItemSet& rSet) } -bool ScPatternAttr::HasNumberFormat() const +bool ScPatternAttr::HasValidNumberFormat() const { // If either ATTR_VALUE_FORMAT or ATTR_LANGUAGE_FORMAT are invalid in the pattern, // it means a multiselection with different formats diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx index 461d363d0f3a..5c77c71dab7e 100644 --- a/sc/source/ui/view/tabvwsha.cxx +++ b/sc/source/ui/view/tabvwsha.cxx @@ -598,7 +598,7 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OUString &rNam xOldSet->Put( *aLineInner ); // Generate NumberFormat Value from Value and Language and box it. - if (pOldAttrs->HasNumberFormat()) // tdf#42989: don't set it for multi-format selection + if (pOldAttrs->HasValidNumberFormat()) // tdf#42989: don't set it for multi-format selection xOldSet->Put( SfxUInt32Item(ATTR_VALUE_FORMAT, pOldAttrs->GetNumberFormat(rDoc.GetFormatTable()))); else // Make sure it's invalid, when ATTR_LANGUAGE_FORMAT is invalid