summaryrefslogtreecommitdiff
path: root/svx/source/fmcomp
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/fmcomp
parentd40dceb75b3a2b717a36919d5f30189d918940e2 (diff)
fdo#46808, fix up some NumberFormatter createInstance calls I missed
Change-Id: Ieb3ce841243797a119f1d1d40379ff2a4614168f
Diffstat (limited to 'svx/source/fmcomp')
-rw-r--r--svx/source/fmcomp/gridctrl.cxx28
1 files changed, 13 insertions, 15 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&)
+ {
}
}