diff options
Diffstat (limited to 'svx/source/items/numfmtsh.cxx')
-rw-r--r-- | svx/source/items/numfmtsh.cxx | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx index 87fe7fa79b39..b38317f5c579 100644 --- a/svx/source/items/numfmtsh.cxx +++ b/svx/source/items/numfmtsh.cxx @@ -192,21 +192,21 @@ void SvxNumberFormatShell::LanguageChanged(LanguageType eLangType, short& rFmtSe void SvxNumberFormatShell::FormatChanged(sal_uInt16 nFmtLbPos, OUString& rPreviewStr, const Color*& rpFontColor) { - if (static_cast<size_t>(nFmtLbPos) < aCurEntryList.size()) - { - nCurFormatKey = aCurEntryList[nFmtLbPos]; + if (static_cast<size_t>(nFmtLbPos) >= aCurEntryList.size()) + return; - if (nCurFormatKey != NUMBERFORMAT_ENTRY_NOT_FOUND) - { - GetPreviewString_Impl(rPreviewStr, rpFontColor); - } - else if (nCurCategory == SvNumFormatType::CURRENCY) + nCurFormatKey = aCurEntryList[nFmtLbPos]; + + if (nCurFormatKey != NUMBERFORMAT_ENTRY_NOT_FOUND) + { + GetPreviewString_Impl(rPreviewStr, rpFontColor); + } + else if (nCurCategory == SvNumFormatType::CURRENCY) + { + if (static_cast<size_t>(nFmtLbPos) < aCurrencyFormatList.size()) { - if (static_cast<size_t>(nFmtLbPos) < aCurrencyFormatList.size()) - { - MakePrevStringFromVal(aCurrencyFormatList[nFmtLbPos], rPreviewStr, rpFontColor, - nValNum); - } + MakePrevStringFromVal(aCurrencyFormatList[nFmtLbPos], rPreviewStr, rpFontColor, + nValNum); } } } |