[Libreoffice-commits] core.git: sc/source

Eike Rathke (via logerrit) logerrit at kemper.freedesktop.org
Sat Oct 26 19:53:50 UTC 2019


 sc/source/ui/view/output2.cxx |   10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

New commits:
commit f357831478ca063190eedeef12635117b8360277
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Sat Oct 26 19:00:21 2019 +0200
Commit:     Eike Rathke <erack at redhat.com>
CommitDate: Sat Oct 26 21:53:00 2019 +0200

    Resolves: tdf#128403 Use ScPatternAttr::GetNumberFormat()
    
    ... it does or will do the right thing.
    See also https://bugs.documentfoundation.org/show_bug.cgi?id=117715#c12
    
    Change-Id: I4ecaa6be8b2358d4ea4d84655cde74dce5319c2a
    Reviewed-on: https://gerrit.libreoffice.org/81548
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 6fbb00412663..41a9760cc450 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -454,15 +454,7 @@ void ScDrawStringsVars::SetPatternSimple( const ScPatternAttr* pNew, const SfxIt
     // number format
 
     sal_uLong nOld = nValueFormat;
-    const SfxPoolItem* pFormItem;
-    if ( !pCondSet || pCondSet->GetItemState(ATTR_VALUE_FORMAT,true,&pFormItem) != SfxItemState::SET )
-        pFormItem = &pPattern->GetItem(ATTR_VALUE_FORMAT);
-    const SfxPoolItem* pLangItem;
-    if ( !pCondSet || pCondSet->GetItemState(ATTR_LANGUAGE_FORMAT,true,&pLangItem) != SfxItemState::SET )
-        pLangItem = &pPattern->GetItem(ATTR_LANGUAGE_FORMAT);
-    nValueFormat = pOutput->mpDoc->GetFormatTable()->GetFormatForLanguageIfBuiltIn(
-                    static_cast<const SfxUInt32Item*>(pFormItem)->GetValue(),
-                    static_cast<const SvxLanguageItem*>(pLangItem)->GetLanguage() );
+    nValueFormat = pPattern->GetNumberFormat( pOutput->mpDoc->GetFormatTable(), pCondSet );
 
     if (nValueFormat != nOld)
         maLastCell.clear();           // always reformat


More information about the Libreoffice-commits mailing list