diff options
author | Kohei Yoshida <kohei@libreoffice.org> | 2019-08-26 22:34:39 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei@libreoffice.org> | 2019-08-27 18:02:23 +0200 |
commit | e5b23bc96770b795b4a6014d0b167c6d67508c71 (patch) | |
tree | e968a2a90d1398ac2c1673565a24ffaac7d0863d /sc/source | |
parent | e49d35c1f4f86e27a4a6603e5e7a60350ed400d0 (diff) |
You can just check for nCheckPos being 0 for non-error condition.
If I read the method doc of PutEntry correctly, the boolean return
type only indicates whether the string being inserted is a new one
or not. You can still set the format even when the string already
exists in the format table.
Change-Id: Id3165323aada47e8d4fe19683008011bd69caac2
Reviewed-on: https://gerrit.libreoffice.org/78160
Tested-by: Jenkins
Reviewed-by: Kohei Yoshida <kohei@libreoffice.org>
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/filter/orcus/interface.cxx | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx index fbd384be5a76..efd7f55a73e3 100644 --- a/sc/source/filter/orcus/interface.cxx +++ b/sc/source/filter/orcus/interface.cxx @@ -1457,15 +1457,9 @@ void ScOrcusStyles::number_format::applyToItemSet(SfxItemSet& rSet, const ScDocu OUString Code = maCode; /* <-- Done because the SvNumberFormatter::PutEntry demands a non const NumFormat Code*/ SvNumFormatType type = SvNumFormatType::ALL; - if (pFormatter->PutEntry(Code, nCheckPos, type, nKey, LANGUAGE_ENGLISH_US)) - { - if (nCheckPos == 0) - { - rSet.Put(SfxUInt32Item(ATTR_VALUE_FORMAT, nKey)); - } - } - else - SAL_WARN("sc.orcus.style", "Cannot set Number Format"); + pFormatter->PutEntry(Code, nCheckPos, type, nKey, LANGUAGE_ENGLISH_US); + if (!nCheckPos) + rSet.Put(SfxUInt32Item(ATTR_VALUE_FORMAT, nKey)); } ScOrcusStyles::xf::xf(): |