Kaydet (Commit) 99b353e0 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

use ScDocument's number formatter

Change-Id: Iff04869b8e8ba73575bd5d336db42f1e08cec5d8
üst 6efdcc4c
...@@ -333,7 +333,7 @@ private: ...@@ -333,7 +333,7 @@ private:
bool mbHasNumberFormatAttr; bool mbHasNumberFormatAttr;
number_format(); number_format();
void applyToItemSet(SfxItemSet& rSet) const; void applyToItemSet(SfxItemSet& rSet, ScDocument& rDoc) const;
}; };
number_format maCurrentNumberFormat; number_format maCurrentNumberFormat;
......
...@@ -894,15 +894,15 @@ void ScOrcusStyles::border::applyToItemSet(SfxItemSet& rSet) const ...@@ -894,15 +894,15 @@ void ScOrcusStyles::border::applyToItemSet(SfxItemSet& rSet) const
rSet.Put(aBoxItem); rSet.Put(aBoxItem);
} }
void ScOrcusStyles::number_format::applyToItemSet(SfxItemSet& rSet) const void ScOrcusStyles::number_format::applyToItemSet(SfxItemSet& rSet, ScDocument& rDoc) const
{ {
sal_uInt32 nKey; sal_uInt32 nKey;
sal_Int32 nCheckPos; sal_Int32 nCheckPos;
SvNumberFormatter NumberFormatter(comphelper::getProcessComponentContext(), LANGUAGE_ENGLISH_US); SvNumberFormatter* pFormatter = rDoc.GetFormatTable();
OUString Code = maCode; /* <-- Done because the SvNumberFormatter::PutEntry demands a non const NumFormat Code*/ OUString Code = maCode; /* <-- Done because the SvNumberFormatter::PutEntry demands a non const NumFormat Code*/
sal_Int16 type = css::util::NumberFormat::ALL; sal_Int16 type = css::util::NumberFormat::ALL;
if (NumberFormatter.PutEntry(Code, nCheckPos, type, nKey, LANGUAGE_ENGLISH_US)) if (pFormatter->PutEntry(Code, nCheckPos, type, nKey, LANGUAGE_ENGLISH_US))
{ {
if (nCheckPos == 0) if (nCheckPos == 0)
{ {
...@@ -981,7 +981,7 @@ void ScOrcusStyles::applyXfToItemSet(SfxItemSet& rSet, const xf& rXf) ...@@ -981,7 +981,7 @@ void ScOrcusStyles::applyXfToItemSet(SfxItemSet& rSet, const xf& rXf)
} }
const number_format& rFormat = maNumberFormats[nNumberFormatId]; const number_format& rFormat = maNumberFormats[nNumberFormatId];
if (rFormat.mbHasNumberFormatAttr) if (rFormat.mbHasNumberFormatAttr)
rFormat.applyToItemSet(rSet); rFormat.applyToItemSet(rSet, mrDoc);
} }
void ScOrcusStyles::applyXfToItemSet(SfxItemSet& rSet, size_t xfId) void ScOrcusStyles::applyXfToItemSet(SfxItemSet& rSet, size_t xfId)
......
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