summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-12-04 13:18:35 +0200
committerNoel Grandin <noel@peralex.com>2012-12-06 13:20:31 +0200
commit773ad75b0dbc4dac1cae704c726b5a2d67ae1146 (patch)
treeb95386a6639835d7751a6b3aa7bcdfb114f026f8 /xmloff
parent584cd8d1c23d47becb776e382f853ffe77ce9fc2 (diff)
fdo#46808, Adapt util::NumberFormatsSupplier UNO service to new style
Change-Id: I58436d9eea0c38d14cde2dc01aa463d5d71912e9
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/forms/layerexport.cxx24
-rw-r--r--xmloff/source/forms/strings.hxx1
2 files changed, 8 insertions, 17 deletions
diff --git a/xmloff/source/forms/layerexport.cxx b/xmloff/source/forms/layerexport.cxx
index fbee65728127..bb3838102f8d 100644
--- a/xmloff/source/forms/layerexport.cxx
+++ b/xmloff/source/forms/layerexport.cxx
@@ -40,11 +40,13 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/script/XEventAttacherManager.hpp>
+#include <com/sun/star/util/NumberFormatsSupplier.hpp>
#include "eventexport.hxx"
#include <xmloff/XMLEventExport.hxx>
#include "formevents.hxx"
#include <xmloff/xmlnumfe.hxx>
#include "xmloff/xformsexport.hxx"
+#include "comphelper/processfactory.hxx"
#include <com/sun/star/text/XText.hpp>
@@ -760,22 +762,12 @@ namespace xmloff
{
// create it for en-US (does not really matter, as we will specify a locale for every
// concrete language to use)
- Sequence< Any > aSupplierArgs(1);
- aSupplierArgs[0] <<= Locale ( ::rtl::OUString("en"),
- ::rtl::OUString("US"),
- ::rtl::OUString()
- );
-
- Reference< XInterface > xFormatsSupplierUntyped =
- m_rContext.getServiceFactory()->createInstanceWithArguments(
- SERVICE_NUMBERFORMATSSUPPLIER,
- aSupplierArgs
- );
- OSL_ENSURE(xFormatsSupplierUntyped.is(), "OFormLayerXMLExport_Impl::getControlNumberStyleExport: could not instantiate a number formats supplier!");
-
- xFormatsSupplier = Reference< XNumberFormatsSupplier >(xFormatsSupplierUntyped, UNO_QUERY);
- if (xFormatsSupplier.is())
- m_xControlNumberFormats = xFormatsSupplier->getNumberFormats();
+ Locale aLocale ( ::rtl::OUString("en"),
+ ::rtl::OUString("US"),
+ ::rtl::OUString()
+ );
+ xFormatsSupplier = NumberFormatsSupplier::createWithLocale( comphelper::getComponentContext(m_rContext.getServiceFactory()), aLocale );
+ m_xControlNumberFormats = xFormatsSupplier->getNumberFormats();
}
catch(const Exception&)
{
diff --git a/xmloff/source/forms/strings.hxx b/xmloff/source/forms/strings.hxx
index 1840a6f52c59..3d273649b58f 100644
--- a/xmloff/source/forms/strings.hxx
+++ b/xmloff/source/forms/strings.hxx
@@ -158,7 +158,6 @@ namespace xmloff
// services
XMLFORM_CONSTASCII_STRING( SERVICE_FORMSCOLLECTION, "com.sun.star.form.Forms" );
- XMLFORM_CONSTASCII_STRING( SERVICE_NUMBERFORMATSSUPPLIER, "com.sun.star.util.NumberFormatsSupplier" );
XMLFORM_CONSTASCII_STRING( SERVICE_SPREADSHEET_DOCUMENT, "com.sun.star.sheet.SpreadsheetDocument");
XMLFORM_CONSTASCII_STRING( SERVICE_CELLVALUEBINDING, "com.sun.star.table.CellValueBinding" );
XMLFORM_CONSTASCII_STRING( SERVICE_LISTINDEXCELLBINDING, "com.sun.star.table.ListPositionCellBinding" );