summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-09-19 15:29:46 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-10-23 11:33:14 +0200
commitf4776bf465ee682f65d1e978b031c928d9d310a5 (patch)
treec361f3415fbb33e363f408579184ec224b18ed16 /svx/source
parentd40dceb75b3a2b717a36919d5f30189d918940e2 (diff)
fdo#46808, fix up some NumberFormatter createInstance calls I missed
Change-Id: Ieb3ce841243797a119f1d1d40379ff2a4614168f
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/fmcomp/gridctrl.cxx28
-rw-r--r--svx/source/form/filtnav.cxx7
-rw-r--r--svx/source/form/fmsrcimp.cxx10
-rw-r--r--svx/source/inc/fmservs.hxx1
4 files changed, 23 insertions, 23 deletions
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index 61491ba16824..6f7c70056edf 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -44,12 +44,13 @@
#include <com/sun/star/sdbc/XResultSetUpdate.hpp>
#include <com/sun/star/sdbcx/Privilege.hpp>
#include <com/sun/star/container/XChild.hpp>
-#include <com/sun/star/util/XNumberFormatter.hpp>
+#include <com/sun/star/util/NumberFormatter.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <com/sun/star/util/XCloneable.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/PropertyChangeEvent.hpp>
#include <comphelper/extract.hxx>
+#include <comphelper/processfactory.hxx>
#include <tools/resid.hxx>
#include <tools/diagnose_ex.h>
#include <vcl/menu.hxx>
@@ -1451,23 +1452,20 @@ void DbGridControl::setDataSource(const Reference< XRowSet >& _xCursor, sal_uInt
m_xFormatter = NULL;
OStaticDataAccessTools aStaticTools;
Reference< ::com::sun::star::util::XNumberFormatsSupplier > xSupplier = aStaticTools.getNumberFormats(aStaticTools.getRowSetConnection(_xCursor), sal_True);
- if (xSupplier.is() && m_xServiceFactory.is())
+ if (xSupplier.is())
{
- m_xFormatter = Reference< ::com::sun::star::util::XNumberFormatter >(
- m_xServiceFactory->createInstance(FM_NUMBER_FORMATTER),
+ m_xFormatter = Reference< ::com::sun::star::util::XNumberFormatter >(
+ ::com::sun::star::util::NumberFormatter::create(comphelper::getComponentContext(m_xServiceFactory)),
UNO_QUERY);
- if (m_xFormatter.is())
- {
- m_xFormatter->attachNumberFormatsSupplier(xSupplier);
+ m_xFormatter->attachNumberFormatsSupplier(xSupplier);
- // retrieve the datebase of the Numberformatter
- try
- {
- xSupplier->getNumberFormatSettings()->getPropertyValue(rtl::OUString("NullDate")) >>= m_aNullDate;
- }
- catch(Exception&)
- {
- }
+ // retrieve the datebase of the Numberformatter
+ try
+ {
+ xSupplier->getNumberFormatSettings()->getPropertyValue(rtl::OUString("NullDate")) >>= m_aNullDate;
+ }
+ catch(Exception&)
+ {
}
}
diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index 7dd1032b9555..4b2cec0b4b35 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -38,9 +38,10 @@
#include <com/sun/star/awt/XTextComponent.hpp>
#include <com/sun/star/form/runtime/XFormController.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <com/sun/star/util/XNumberFormatter.hpp>
+#include <com/sun/star/util/NumberFormatter.hpp>
#include <com/sun/star/beans/XFastPropertySet.hpp>
+#include <comphelper/componentcontext.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/property.hxx>
#include <comphelper/sequence.hxx>
@@ -103,6 +104,8 @@ namespace svxform
using ::com::sun::star::util::XNumberFormatsSupplier;
using ::com::sun::star::beans::XPropertySet;
using ::com::sun::star::util::XNumberFormatter;
+ using ::com::sun::star::util::XNumberFormatter2;
+ using ::com::sun::star::util::NumberFormatter;
using ::com::sun::star::sdbc::XRowSet;
using ::com::sun::star::lang::Locale;
using ::com::sun::star::sdb::SQLContext;
@@ -895,7 +898,7 @@ sal_Bool FmFilterModel::ValidateText(FmFilterItem* pItem, UniString& rText, UniS
// obtain a number formatter for this connection
// TODO: shouldn't this be cached?
Reference< XNumberFormatsSupplier > xFormatSupplier = aStaticTools.getNumberFormats( xConnection, sal_True );
- Reference< XNumberFormatter > xFormatter( m_xORB->createInstance( FM_NUMBER_FORMATTER ), UNO_QUERY );
+ Reference< XNumberFormatter > xFormatter( NumberFormatter::create( comphelper::getComponentContext(m_xORB) ), UNO_QUERY_THROW );
xFormatter->attachNumberFormatsSupplier( xFormatSupplier );
// get the field (database column) which the item is responsible for
diff --git a/svx/source/form/fmsrcimp.cxx b/svx/source/form/fmsrcimp.cxx
index f9d6a85f864a..63d04a43a343 100644
--- a/svx/source/form/fmsrcimp.cxx
+++ b/svx/source/form/fmsrcimp.cxx
@@ -49,7 +49,7 @@
#include <com/sun/star/i18n/CollatorOptions.hpp>
#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
-#include <com/sun/star/util/XNumberFormatter.hpp>
+#include <com/sun/star/util/NumberFormatter.hpp>
#include <com/sun/star/util/NumberFormat.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <com/sun/star/util/XNumberFormats.hpp>
@@ -710,10 +710,10 @@ FmSearchEngine::FmSearchEngine(const Reference< XMultiServiceFactory >& _rxORB,
{
DBG_CTOR(FmSearchEngine,NULL);
- m_xFormatter = Reference< ::com::sun::star::util::XNumberFormatter > (::comphelper::getProcessServiceFactory()
- ->createInstance(FM_NUMBER_FORMATTER), UNO_QUERY);
- if (m_xFormatter.is())
- m_xFormatter->attachNumberFormatsSupplier(m_xFormatSupplier);
+ m_xFormatter = Reference< ::com::sun::star::util::XNumberFormatter >(
+ ::com::sun::star::util::NumberFormatter::create( ::comphelper::getProcessComponentContext() ),
+ UNO_QUERY_THROW);
+ m_xFormatter->attachNumberFormatsSupplier(m_xFormatSupplier);
Init(sVisibleFields);
}
diff --git a/svx/source/inc/fmservs.hxx b/svx/source/inc/fmservs.hxx
index fe1c9273bc18..61ad6dc6150b 100644
--- a/svx/source/inc/fmservs.hxx
+++ b/svx/source/inc/fmservs.hxx
@@ -21,7 +21,6 @@
#include <svx/svxdllapi.h>
-#define FM_NUMBER_FORMATTER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.NumberFormatter" ) )
#define FM_COMPONENT_EDIT rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.Edit" ) )
#define FM_COMPONENT_TEXTFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.TextField" ) )
#define FM_COMPONENT_LISTBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.component.ListBox" ) )