diff options
author | Laurent Balland-Poirier <laurent.balland-poirier@laposte.net> | 2015-07-30 20:49:46 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-07-31 11:30:19 +0000 |
commit | 0db37d785311aa2294f60b750fce4dadff6c75e0 (patch) | |
tree | c04a76f78bbd01abf962a82d2735a712dfda7f29 | |
parent | dd4befa992300cc068467021c81594ffcea1be0c (diff) |
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.
Change-Id: Ia367b491b71fa7b4480cdd03408c0c0315425dc8
Reviewed-on: https://gerrit.libreoffice.org/17439
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r-- | cui/source/tabpages/numfmt.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx | 5 |
2 files changed, 12 insertions, 2 deletions
diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx index 61efd7c754e0..6883044bb8e6 100644 --- a/cui/source/tabpages/numfmt.cxx +++ b/cui/source/tabpages/numfmt.cxx @@ -982,7 +982,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 ); @@ -1569,6 +1572,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 b832400f231e..4ec8606c41b3 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: |