Kaydet (Commit) 26b3ca54 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.

(cherry picked from commit 0db37d78)

Change-Id: Ia367b491b71fa7b4480cdd03408c0c0315425dc8
Reviewed-on: https://gerrit.libreoffice.org/17771Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: 's avatarEike Rathke <erack@redhat.com>
üst 0deb8046
......@@ -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,
......
......@@ -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:
......
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