From 773ad75b0dbc4dac1cae704c726b5a2d67ae1146 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 4 Dec 2012 13:18:35 +0200 Subject: fdo#46808, Adapt util::NumberFormatsSupplier UNO service to new style Change-Id: I58436d9eea0c38d14cde2dc01aa463d5d71912e9 --- xmloff/source/forms/layerexport.cxx | 24 ++++++++---------------- xmloff/source/forms/strings.hxx | 1 - 2 files changed, 8 insertions(+), 17 deletions(-) (limited to 'xmloff') 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 #include #include +#include #include "eventexport.hxx" #include #include "formevents.hxx" #include #include "xmloff/xformsexport.hxx" +#include "comphelper/processfactory.hxx" #include @@ -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" ); -- cgit