diff options
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/commontools/formattedcolumnvalue.cxx | 5 | ||||
-rw-r--r-- | connectivity/source/commontools/predicateinput.cxx | 11 | ||||
-rw-r--r-- | connectivity/source/drivers/flat/ETable.cxx | 7 |
3 files changed, 16 insertions, 7 deletions
diff --git a/connectivity/source/commontools/formattedcolumnvalue.cxx b/connectivity/source/commontools/formattedcolumnvalue.cxx index ec509e78a28e..3298764be85b 100644 --- a/connectivity/source/commontools/formattedcolumnvalue.cxx +++ b/connectivity/source/commontools/formattedcolumnvalue.cxx @@ -22,7 +22,7 @@ #include "connectivity/dbtools.hxx" #include "connectivity/dbconversion.hxx" -#include <com/sun/star/util/XNumberFormatter.hpp> +#include <com/sun/star/util/NumberFormatter.hpp> #include <com/sun/star/util/Date.hpp> #include <com/sun/star/sdbc/XConnection.hpp> #include <com/sun/star/util/XNumberFormatTypes.hpp> @@ -51,6 +51,7 @@ namespace dbtools using ::com::sun::star::uno::makeAny; using ::com::sun::star::sdbc::XRowSet; using ::com::sun::star::beans::XPropertySet; + using ::com::sun::star::util::NumberFormatter; using ::com::sun::star::util::XNumberFormatter; using ::com::sun::star::util::Date; using ::com::sun::star::sdbc::XConnection; @@ -199,7 +200,7 @@ namespace dbtools Reference< XNumberFormatsSupplier > xSupplier( getNumberFormats( xConnection, sal_True, i_rContext.getLegacyServiceFactory() ), UNO_SET_THROW ); // create a number formatter for it - xNumberFormatter.set( i_rContext.createComponent( "com.sun.star.util.NumberFormatter" ), UNO_QUERY_THROW ); + xNumberFormatter.set( NumberFormatter::create(i_rContext.getUNOContext()), UNO_QUERY_THROW ); xNumberFormatter->attachNumberFormatsSupplier( xSupplier ); } catch( const Exception& ) diff --git a/connectivity/source/commontools/predicateinput.cxx b/connectivity/source/commontools/predicateinput.cxx index 0fa5443a8b71..f72b1163ab36 100644 --- a/connectivity/source/commontools/predicateinput.cxx +++ b/connectivity/source/commontools/predicateinput.cxx @@ -23,6 +23,7 @@ #include <connectivity/dbtools.hxx> #include <com/sun/star/sdbc/DataType.hpp> #include <com/sun/star/sdbc/ColumnValue.hpp> +#include <com/sun/star/util/NumberFormatter.hpp> #include <osl/diagnose.h> #include <connectivity/sqlnode.hxx> #include <connectivity/PColumn.hxx> @@ -38,8 +39,10 @@ namespace dbtools using ::com::sun::star::sdbc::XConnection; using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::util::XNumberFormatsSupplier; + using ::com::sun::star::util::NumberFormatter; using ::com::sun::star::util::XNumberFormatter; using ::com::sun::star::uno::UNO_QUERY; + using ::com::sun::star::uno::UNO_QUERY_THROW; using ::com::sun::star::beans::XPropertySet; using ::com::sun::star::beans::XPropertySetInfo; using ::com::sun::star::lang::Locale; @@ -105,16 +108,16 @@ namespace dbtools OSL_ENSURE( m_xORB.is(), "OPredicateInputController::OPredicateInputController: need a service factory!" ); if ( m_xORB.is() ) { - m_xFormatter = Reference< XNumberFormatter >( m_xORB->createInstance( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.NumberFormatter" ) ) ), - UNO_QUERY + m_xFormatter = Reference< XNumberFormatter >( + NumberFormatter::create(comphelper::ComponentContext(m_xORB).getUNOContext()), + UNO_QUERY_THROW ); } Reference< XNumberFormatsSupplier > xNumberFormats = ::dbtools::getNumberFormats( m_xConnection, sal_True ); if ( !xNumberFormats.is() ) ::comphelper::disposeComponent( m_xFormatter ); - else if ( m_xFormatter.is() ) + else m_xFormatter->attachNumberFormatsSupplier( xNumberFormats ); // create the locale data diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx index 4d9a6036a554..c874ccf8a0f0 100644 --- a/connectivity/source/drivers/flat/ETable.cxx +++ b/connectivity/source/drivers/flat/ETable.cxx @@ -36,6 +36,7 @@ #include <comphelper/types.hxx> #include "flat/EDriver.hxx" #include <com/sun/star/util/NumberFormat.hpp> +#include <com/sun/star/util/NumberFormatter.hpp> #include <unotools/configmgr.hxx> #include <i18npool/mslangid.hxx> #include "connectivity/dbconversion.hxx" @@ -49,6 +50,7 @@ using namespace connectivity::flat; using namespace connectivity::file; using namespace ::cppu; using namespace utl; +using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::ucb; using namespace ::com::sun::star::beans; @@ -420,7 +422,10 @@ void OFlatTable::construct() aArg[0] <<= aAppLocale; Reference< ::com::sun::star::util::XNumberFormatsSupplier > xSupplier(m_pConnection->getDriver()->getFactory()->createInstanceWithArguments(::rtl::OUString("com.sun.star.util.NumberFormatsSupplier"),aArg),UNO_QUERY); - m_xNumberFormatter = Reference< ::com::sun::star::util::XNumberFormatter >(m_pConnection->getDriver()->getFactory()->createInstance(::rtl::OUString("com.sun.star.util.NumberFormatter")),UNO_QUERY); + m_xNumberFormatter = Reference< util::XNumberFormatter >( + util::NumberFormatter::create( + comphelper::ComponentContext(m_pConnection->getDriver()->getFactory()).getUNOContext()), + UNO_QUERY_THROW); m_xNumberFormatter->attachNumberFormatsSupplier(xSupplier); Reference<XPropertySet> xProp(xSupplier->getNumberFormatSettings(),UNO_QUERY); xProp->getPropertyValue(::rtl::OUString("NullDate")) >>= m_aNullDate; |