From 0db37d785311aa2294f60b750fce4dadff6c75e0 Mon Sep 17 00:00:00 2001 From: Laurent Balland-Poirier Date: Thu, 30 Jul 2015 20:49:46 +0200 Subject: 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 Tested-by: Eike Rathke --- cui/source/tabpages/numfmt.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'cui') 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, -- cgit