From 7298a2b0c721004b09a0fd3c7e287d655f42286b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 21 May 2013 16:22:38 +0200 Subject: fdo#46808, Convert XMultiServiceFactory to XComponentContext Change-Id: I3a74d4edaa3ff3c2498c3db2720b0e4e5305c2e4 --- connectivity/source/drivers/flat/EDriver.cxx | 3 ++- connectivity/source/drivers/flat/ETable.cxx | 8 +++----- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'connectivity/source/drivers/flat') diff --git a/connectivity/source/drivers/flat/EDriver.cxx b/connectivity/source/drivers/flat/EDriver.cxx index d83e435216b7..c9b5fac684a4 100644 --- a/connectivity/source/drivers/flat/EDriver.cxx +++ b/connectivity/source/drivers/flat/EDriver.cxx @@ -24,6 +24,7 @@ #include #include "resource/common_res.hrc" #include "resource/sharedresources.hxx" +#include "comphelper/processfactory.hxx" using namespace connectivity::flat; @@ -51,7 +52,7 @@ OUString SAL_CALL ODriver::getImplementationName( ) throw(RuntimeException) //------------------------------------------------------------------ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL connectivity::flat::ODriver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception ) { - return *(new ODriver(_rxFactory)); + return *(new ODriver( comphelper::getComponentContext(_rxFactory) )); } // -------------------------------------------------------------------------------- Reference< XConnection > SAL_CALL ODriver::connect( const OUString& url, const Sequence< PropertyValue >& info ) throw(SQLException, RuntimeException) diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx index f777e636dee8..a6b5a67d9ce2 100644 --- a/connectivity/source/drivers/flat/ETable.cxx +++ b/connectivity/source/drivers/flat/ETable.cxx @@ -124,7 +124,7 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale) m_aScales.assign(nFieldCount+1,-1); const sal_Bool bCase = m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers(); - CharClass aCharClass( comphelper::getComponentContext(pConnection->getDriver()->getFactory()), LanguageTag( _aLocale)); + CharClass aCharClass( pConnection->getDriver()->getComponentContext(), LanguageTag( _aLocale)); // read description const sal_Unicode cDecimalDelimiter = pConnection->getDecimalDelimiter(); const sal_Unicode cThousandDelimiter = pConnection->getThousandDelimiter(); @@ -435,10 +435,8 @@ void OFlatTable::construct() SvtSysLocale aLocale; ::com::sun::star::lang::Locale aAppLocale(aLocale.GetLanguageTag().getLocale()); - Reference< XNumberFormatsSupplier > xSupplier = NumberFormatsSupplier::createWithLocale( getComponentContext(m_pConnection->getDriver()->getFactory()), aAppLocale ); - m_xNumberFormatter = Reference< XNumberFormatter >( NumberFormatter::create( - comphelper::getComponentContext(m_pConnection->getDriver()->getFactory())), - UNO_QUERY_THROW); + Reference< XNumberFormatsSupplier > xSupplier = NumberFormatsSupplier::createWithLocale( m_pConnection->getDriver()->getComponentContext(), aAppLocale ); + m_xNumberFormatter.set( NumberFormatter::create( m_pConnection->getDriver()->getComponentContext()), UNO_QUERY_THROW); m_xNumberFormatter->attachNumberFormatsSupplier(xSupplier); Reference xProp(xSupplier->getNumberFormatSettings(),UNO_QUERY); xProp->getPropertyValue(OUString("NullDate")) >>= m_aNullDate; -- cgit