[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - sc/source

Eike Rathke erack at redhat.com
Sat Dec 9 21:02:21 UTC 2017


 sc/source/ui/view/formatsh.cxx |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit dbbf644d22e3a893d83508d2c74e04a7ef9f8020
Author: Eike Rathke <erack at redhat.com>
Date:   Fri Dec 8 22:20:39 2017 +0100

    A "standard" format does not necessarily mean the General format
    
    Actually there can be up to three and most times are at least two
    (short,medium[,long]) of which usually the medium default is
    General.
    
    Change-Id: Iab853fbaa2db3dca488ee40f63271ccd55b6b517
    (cherry picked from commit 4d850442a04b63e4ed92dcd431c8620ce12010c2)
    Reviewed-on: https://gerrit.libreoffice.org/46128
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 005a1c7a5174..82f5ba3fbc97 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -2540,20 +2540,18 @@ void ScFormatShell::GetNumFormatState( SfxItemSet& rSet )
                     if ( rAttrSet.GetItemState( ATTR_VALUE_FORMAT ) >= SfxItemState::DEFAULT ) //Modify for more robust
                     {
                         const SvNumberformat* pFormatEntry = pFormatter->GetEntry( nNumberFormat );
-                        bool bStandard = false;
 
                         if ( pFormatEntry )
                         {
                             aFormatCode = pFormatEntry->GetType();
-                            bStandard = pFormatEntry->IsStandard();
                         }
 
                         switch(aFormatCode)
                         {
                         case css::util::NumberFormat::NUMBER:
                         case css::util::NumberFormat::NUMBER| css::util::NumberFormat::DEFINED:
-                            //use format code and standard format code to judge whether it is General,
-                            if (bStandard)
+                            // Determine if General format.
+                            if ((nNumberFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0)
                                 aFormatCode = 0;
                             else
                                 aFormatCode = 1;


More information about the Libreoffice-commits mailing list