Kaydet (Commit) e607f1da authored tarafından Eike Rathke's avatar Eike Rathke

Select the current format if multiple instead of first matching format code

This never worked..

Change-Id: I79b8687dde4faac383121abeda70931d0192b33d
Reviewed-on: https://gerrit.libreoffice.org/61290Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: Jenkins
üst 689b6a6c
...@@ -1489,7 +1489,7 @@ void SvxNumberFormatTabPage::EditHdl_Impl(const weld::Entry* pEdFormat) ...@@ -1489,7 +1489,7 @@ void SvxNumberFormatTabPage::EditHdl_Impl(const weld::Entry* pEdFormat)
if (nTmpCurPos != sal_uInt16(-1)) if (nTmpCurPos != sal_uInt16(-1))
set_active_currency(nTmpCurPos); set_active_currency(nTmpCurPos);
} }
short nPosi=pNumFmtShell->GetListPos4Entry(aFormat); short nPosi=pNumFmtShell->GetListPos4Entry( nCurKey);
if(nPosi>=0) if(nPosi>=0)
m_xLbFormat->select(static_cast<sal_uInt16>(nPosi)); m_xLbFormat->select(static_cast<sal_uInt16>(nPosi));
......
...@@ -486,7 +486,17 @@ bool SvxNumberFormatShell::IsUserDefined( const OUString& rFmtString ) ...@@ -486,7 +486,17 @@ bool SvxNumberFormatShell::IsUserDefined( const OUString& rFmtString )
bool SvxNumberFormatShell::FindEntry( const OUString& rFmtString, sal_uInt32* pAt /* = NULL */ ) bool SvxNumberFormatShell::FindEntry( const OUString& rFmtString, sal_uInt32* pAt /* = NULL */ )
{ {
bool bRes=false; bool bRes=false;
sal_uInt32 nFound = pFormatter->TestNewString( rFmtString, eCurLanguage );
sal_uInt32 nFound = NUMBERFORMAT_ENTRY_NOT_FOUND;
// There may be multiple builtin entries with the same format code, first
// try if the current key matches.
const SvNumberformat* pEntry = pFormatter->GetEntry( nCurFormatKey);
if (pEntry && pEntry->GetLanguage() == eCurLanguage && pEntry->GetFormatstring() == rFmtString)
nFound = nCurFormatKey;
if (nFound == NUMBERFORMAT_ENTRY_NOT_FOUND)
// Find the first matching format code.
nFound = pFormatter->TestNewString( rFmtString, eCurLanguage );
if ( nFound == NUMBERFORMAT_ENTRY_NOT_FOUND ) if ( nFound == NUMBERFORMAT_ENTRY_NOT_FOUND )
{ {
......
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