Kaydet (Commit) 0db37d78 authored tarafından Laurent Balland-Poirier's avatar Laurent Balland-Poirier Kaydeden (comit) Eike Rathke

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/17439Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: 's avatarEike Rathke <erack@redhat.com>
üst dd4befa9
...@@ -982,7 +982,10 @@ void SvxNumberFormatTabPage::UpdateOptions_Impl( bool bCheckCatChange /*= sal_Fa ...@@ -982,7 +982,10 @@ void SvxNumberFormatTabPage::UpdateOptions_Impl( bool bCheckCatChange /*= sal_Fa
m_pEdLeadZeroes->Enable(); m_pEdLeadZeroes->Enable();
m_pBtnNegRed->Enable(); m_pBtnNegRed->Enable();
m_pBtnThousand->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_pEdLeadZeroes->SetText( OUString::number( nZeroes ) );
m_pBtnNegRed->Check( bNegRed ); m_pBtnNegRed->Check( bNegRed );
m_pBtnThousand->Check( bThousand ); m_pBtnThousand->Check( bThousand );
...@@ -1569,6 +1572,10 @@ IMPL_LINK( SvxNumberFormatTabPage, OptHdl_Impl, void *, pOptCtrl ) ...@@ -1569,6 +1572,10 @@ IMPL_LINK( SvxNumberFormatTabPage, OptHdl_Impl, void *, pOptCtrl )
sal_uInt16 nLeadZeroes = (m_pEdLeadZeroes->IsEnabled()) sal_uInt16 nLeadZeroes = (m_pEdLeadZeroes->IsEnabled())
? (sal_uInt16)m_pEdLeadZeroes->GetValue() ? (sal_uInt16)m_pEdLeadZeroes->GetValue()
: (sal_uInt16)0; : (sal_uInt16)0;
if ( pNumFmtShell->GetStandardName() == m_pEdFormat->GetText() )
{
m_pEdDecimals->SetValue( nPrecision );
}
pNumFmtShell->MakeFormat( aFormat, pNumFmtShell->MakeFormat( aFormat,
bThousand, bNegRed, bThousand, bNegRed,
......
...@@ -320,7 +320,10 @@ void NumberFormatPropertyPanel::NotifyItemUpdate( ...@@ -320,7 +320,10 @@ void NumberFormatPropertyPanel::NotifyItemUpdate(
} }
mpBtnThousand->Check(bThousand); mpBtnThousand->Check(bThousand);
mpBtnNegRed->Check(bNegRed); mpBtnNegRed->Check(bNegRed);
mpEdDecimals->SetValue(nPrecision); if ( mpLbCategory->GetSelectEntryPos() == 0 )
mpEdDecimals->SetText(""); // tdf#44399
else
mpEdDecimals->SetValue(nPrecision);
mpEdLeadZeroes->SetValue(nLeadZeroes); mpEdLeadZeroes->SetValue(nLeadZeroes);
} }
default: default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment