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

Laurent Balland-Poirier laurent.balland-poirier at laposte.net
Mon Aug 17 03:20:08 PDT 2015


 cui/source/tabpages/numfmt.cxx                     |    9 ++++++++-
 sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx |    5 ++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 26b3ca54aff24c34718c572675ad72b9687b3adb
Author: Laurent Balland-Poirier <laurent.balland-poirier at laposte.net>
Date:   Thu Jul 30 20:49:46 2015 +0200

    tdf#44399 Do not display 0 decimal for General format
    
    For General (Standard) format, "0" is not the number of decimal places
    Replaced by an empty string in dialog UI and Sidebar.
    
    (cherry picked from commit 0db37d785311aa2294f60b750fce4dadff6c75e0)
    
    Change-Id: Ia367b491b71fa7b4480cdd03408c0c0315425dc8
    Reviewed-on: https://gerrit.libreoffice.org/17771
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index 197ca95..09bb1a6 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -984,7 +984,10 @@ void SvxNumberFormatTabPage::UpdateOptions_Impl( bool bCheckCatChange /*= sal_Fa
             m_pEdLeadZeroes->Enable();
             m_pBtnNegRed->Enable();
             m_pBtnThousand->Enable();
-            m_pEdDecimals->SetText( OUString::number( nDecimals ) );
+            if ( nCategory == CAT_NUMBER && m_pLbFormat->GetSelectEntryPos() == 0 )
+                m_pEdDecimals->SetText( "" ); //General format tdf#44399
+            else
+                m_pEdDecimals->SetText( OUString::number( nDecimals ) );
             m_pEdLeadZeroes->SetText( OUString::number( nZeroes ) );
             m_pBtnNegRed->Check( bNegRed );
             m_pBtnThousand->Check( bThousand );
@@ -1571,6 +1574,10 @@ IMPL_LINK( SvxNumberFormatTabPage, OptHdl_Impl, void *, pOptCtrl )
         sal_uInt16        nLeadZeroes   = (m_pEdLeadZeroes->IsEnabled())
                                         ? (sal_uInt16)m_pEdLeadZeroes->GetValue()
                                         : (sal_uInt16)0;
+        if ( pNumFmtShell->GetStandardName() == m_pEdFormat->GetText() )
+        {
+            m_pEdDecimals->SetValue( nPrecision );
+        }
 
         pNumFmtShell->MakeFormat( aFormat,
                                   bThousand, bNegRed,
diff --git a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
index b832400..4ec8606 100644
--- a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
+++ b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
@@ -320,7 +320,10 @@ void NumberFormatPropertyPanel::NotifyItemUpdate(
             }
             mpBtnThousand->Check(bThousand);
             mpBtnNegRed->Check(bNegRed);
-            mpEdDecimals->SetValue(nPrecision);
+            if ( mpLbCategory->GetSelectEntryPos() == 0 )
+                mpEdDecimals->SetText(""); // tdf#44399
+            else
+                mpEdDecimals->SetValue(nPrecision);
             mpEdLeadZeroes->SetValue(nLeadZeroes);
         }
     default:


More information about the Libreoffice-commits mailing list