diff options
author | Noel Grandin <noel@peralex.com> | 2012-12-04 13:18:35 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2012-12-06 13:20:31 +0200 |
commit | 773ad75b0dbc4dac1cae704c726b5a2d67ae1146 (patch) | |
tree | b95386a6639835d7751a6b3aa7bcdfb114f026f8 /dbaccess | |
parent | 584cd8d1c23d47becb776e382f853ffe77ce9fc2 (diff) |
fdo#46808, Adapt util::NumberFormatsSupplier UNO service to new style
Change-Id: I58436d9eea0c38d14cde2dc01aa463d5d71912e9
Diffstat (limited to 'dbaccess')
19 files changed, 49 insertions, 48 deletions
diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index 837836d311f9..6f1c57f4cccc 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -257,7 +257,7 @@ OSingleSelectQueryComposer::OSingleSelectQueryComposer(const Reference< XNameAcc m_aCurrentColumns.resize(4); m_aLocale = SvtSysLocale().GetLanguageTag().getLocale(); - m_xNumberFormatsSupplier = dbtools::getNumberFormats( m_xConnection, sal_True, m_aContext.getLegacyServiceFactory() ); + m_xNumberFormatsSupplier = dbtools::getNumberFormats( m_xConnection, sal_True, m_aContext.getUNOContext() ); Reference< XLocaleData4 > xLocaleData( LocaleData::create(m_aContext.getUNOContext()) ); LocaleDataItem aData = xLocaleData->getLocaleItem(m_aLocale); m_sDecimalSep = aData.decimalSeparator; diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx index 543237590687..de74b4fc9648 100644 --- a/dbaccess/source/core/dataaccess/ModelImpl.cxx +++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx @@ -40,6 +40,7 @@ #include <com/sun/star/script/DocumentDialogLibraryContainer.hpp> #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> #include <com/sun/star/form/XLoadable.hpp> +#include <com/sun/star/util/NumberFormatsSupplier.hpp> #include <comphelper/interaction.hxx> #include <comphelper/mediadescriptor.hxx> @@ -760,12 +761,9 @@ const Reference< XNumberFormatsSupplier > & ODatabaseModelImpl::getNumberFormats { // the arguments : the locale of the current user UserInformation aUserInfo; - Sequence< Any > aArguments(1); - aArguments.getArray()[0] <<= aUserInfo.getUserLanguage(); + Locale aLocale = aUserInfo.getUserLanguage(); - m_xNumberFormatsSupplier.set( - m_aContext.createComponentWithArguments( "com.sun.star.util.NumberFormatsSupplier", aArguments ), UNO_QUERY_THROW ); - OSL_ENSURE(m_xNumberFormatsSupplier.is(), "ODatabaseModelImpl::getNumberFormatsSupplier : could not instantiate the formats supplier !"); + m_xNumberFormatsSupplier.set( NumberFormatsSupplier::createWithLocale( m_aContext.getUNOContext(), aLocale ) ); } return m_xNumberFormatsSupplier; } diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx index 6ed5db02d53f..763c9789aafb 100644 --- a/dbaccess/source/ui/app/AppControllerDnD.cxx +++ b/dbaccess/source/ui/app/AppControllerDnD.cxx @@ -21,6 +21,7 @@ #include "AppController.hxx" #include <comphelper/sequence.hxx> #include <comphelper/property.hxx> +#include <comphelper/processfactory.hxx> #include "dbustrings.hrc" #include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp> #include <com/sun/star/sdbcx/XAppend.hpp> @@ -505,11 +506,11 @@ TransferableHelper* OApplicationController::copyObject() if ( eType == E_TABLE ) { - pData = new ODataClipboard(sDataSource, CommandType::TABLE, sName, xConnection, getNumberFormatter(xConnection,getORB()), getORB()); + pData = new ODataClipboard(sDataSource, CommandType::TABLE, sName, xConnection, getNumberFormatter(xConnection, comphelper::getComponentContext(getORB())), getORB()); } else { - pData = new ODataClipboard(sDataSource, CommandType::QUERY, sName, getNumberFormatter(xConnection,getORB()), getORB()); + pData = new ODataClipboard(sDataSource, CommandType::QUERY, sName, getNumberFormatter(xConnection, comphelper::getComponentContext(getORB())), getORB()); } } } diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index 8fec4ff329c1..ccd75ae01d0d 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -773,7 +773,7 @@ void SbaXDataBrowserController::initFormatter() RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::initFormatter" ); // --------------------------------------------------------------- // create a formatter working with the connections format supplier - Reference< ::com::sun::star::util::XNumberFormatsSupplier > xSupplier(::dbtools::getNumberFormats(::dbtools::getConnection(m_xRowSet), sal_True,getORB())); + Reference< ::com::sun::star::util::XNumberFormatsSupplier > xSupplier(::dbtools::getNumberFormats(::dbtools::getConnection(m_xRowSet), sal_True, comphelper::getComponentContext(getORB()))); if(xSupplier.is()) { @@ -2004,7 +2004,7 @@ void SbaXDataBrowserController::ExecuteSearch() xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AlwaysShowCursor")), ::comphelper::makeBoolAny(sal_Bool(sal_True))); xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CursorColor")), makeAny(sal_Int32(COL_LIGHTRED))); - Reference< ::com::sun::star::util::XNumberFormatsSupplier > xNFS(::dbtools::getNumberFormats(::dbtools::getConnection(m_xRowSet), sal_True,getORB())); + Reference< ::com::sun::star::util::XNumberFormatsSupplier > xNFS(::dbtools::getNumberFormats(::dbtools::getConnection(m_xRowSet), sal_True, comphelper::getComponentContext(getORB()))); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); AbstractFmSearchDialog* pDialog = NULL; diff --git a/dbaccess/source/ui/browser/dbexchange.cxx b/dbaccess/source/ui/browser/dbexchange.cxx index fa2abaa9906d..6bf1451b9760 100644 --- a/dbaccess/source/ui/browser/dbexchange.cxx +++ b/dbaccess/source/ui/browser/dbexchange.cxx @@ -29,6 +29,7 @@ #include <comphelper/uno3.hxx> #include <svx/dataaccessdescriptor.hxx> #include "UITools.hxx" +#include <comphelper/processfactory.hxx> namespace dbaui @@ -128,7 +129,7 @@ namespace dbaui if ( xConnection.is() && i_rORB.is() ) { - Reference< XNumberFormatter > xFormatter( getNumberFormatter( xConnection, i_rORB ) ); + Reference< XNumberFormatter > xFormatter( getNumberFormatter( xConnection, comphelper::getComponentContext(i_rORB) ) ); if ( xFormatter.is() ) { m_pHtml.set( new OHTMLImportExport( getDescriptor(), i_rORB, xFormatter ) ); diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index 3a8ac73c81bb..d98a67147926 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -836,7 +836,7 @@ void SbaGridControl::PreExecuteRowContextMenu(sal_uInt16 nRow, PopupMenu& rMenu) //------------------------------------------------------------------------------ SvNumberFormatter* SbaGridControl::GetDatasourceFormatter() { - Reference< ::com::sun::star::util::XNumberFormatsSupplier > xSupplier = ::dbtools::getNumberFormats(::dbtools::getConnection(Reference< XRowSet > (getDataSource(),UNO_QUERY)), sal_True,getServiceManager()); + Reference< ::com::sun::star::util::XNumberFormatsSupplier > xSupplier = ::dbtools::getNumberFormats(::dbtools::getConnection(Reference< XRowSet > (getDataSource(),UNO_QUERY)), sal_True, comphelper::getComponentContext(getServiceManager())); SvNumberFormatsSupplierObj* pSupplierImpl = SvNumberFormatsSupplierObj::getImplementation( xSupplier ); if ( !pSupplierImpl ) diff --git a/dbaccess/source/ui/control/ColumnControlWindow.cxx b/dbaccess/source/ui/control/ColumnControlWindow.cxx index 2c12e84d07ba..873ba4d2ccea 100644 --- a/dbaccess/source/ui/control/ColumnControlWindow.cxx +++ b/dbaccess/source/ui/control/ColumnControlWindow.cxx @@ -41,9 +41,9 @@ using namespace ::com::sun::star::lang; DBG_NAME(OColumnControlWindow) //======================================================================== OColumnControlWindow::OColumnControlWindow(Window* pParent - ,const Reference<XMultiServiceFactory>& _rxFactory) + ,const Reference<XComponentContext>& _rxContext) : OFieldDescControl(pParent,NULL) - , m_xORB(_rxFactory) + , m_xContext(_rxContext) , m_sTypeNames(ModuleRes(STR_TABLEDESIGN_DBFIELDTYPES)) , m_bAutoIncrementEnabled(sal_True) { @@ -100,12 +100,12 @@ Reference< XNumberFormatter > OColumnControlWindow::GetFormatter() const if ( !m_xFormatter.is() ) try { - Reference< XNumberFormatsSupplier > xSupplier(::dbtools::getNumberFormats(m_xConnection, sal_True,m_xORB)); + Reference< XNumberFormatsSupplier > xSupplier(::dbtools::getNumberFormats(m_xConnection, sal_True, m_xContext)); if ( xSupplier.is() ) { // create a new formatter - m_xFormatter.set( NumberFormatter::create(comphelper::getComponentContext(m_xORB)), UNO_QUERY_THROW); + m_xFormatter.set( NumberFormatter::create(m_xContext), UNO_QUERY_THROW); m_xFormatter->attachNumberFormatsSupplier(xSupplier); } } diff --git a/dbaccess/source/ui/inc/ColumnControlWindow.hxx b/dbaccess/source/ui/inc/ColumnControlWindow.hxx index 6e5637a68fc1..81c7d8e20f23 100644 --- a/dbaccess/source/ui/inc/ColumnControlWindow.hxx +++ b/dbaccess/source/ui/inc/ColumnControlWindow.hxx @@ -21,7 +21,7 @@ #include "FieldDescControl.hxx" #include "TypeInfo.hxx" -#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/util/XNumberFormatter.hpp> //......................................................................... @@ -34,7 +34,7 @@ namespace dbaui class OColumnControlWindow : public OFieldDescControl { ::com::sun::star::lang::Locale m_aLocale; - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> m_xORB; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> m_xContext; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> m_xConnection; mutable ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > m_xFormatter; // a number formatter working with the connection's NumberFormatsSupplier @@ -58,7 +58,7 @@ namespace dbaui public: OColumnControlWindow(Window* pParent - ,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext); virtual ~OColumnControlWindow(); void setConnection(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xCon); diff --git a/dbaccess/source/ui/inc/UITools.hxx b/dbaccess/source/ui/inc/UITools.hxx index df0c4b18b675..9b30fce17ce5 100644 --- a/dbaccess/source/ui/inc/UITools.hxx +++ b/dbaccess/source/ui/inc/UITools.hxx @@ -415,7 +415,7 @@ namespace dbaui @param _rMF The multi service factory */ - ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > getNumberFormatter(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rMF ); + ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > getNumberFormatter(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext ); // this completes a help url with the system parameters "Language" and "System" // detect installed locale diff --git a/dbaccess/source/ui/inc/WCopyTable.hxx b/dbaccess/source/ui/inc/WCopyTable.hxx index bc0e07b1c60b..87098f600e27 100644 --- a/dbaccess/source/ui/inc/WCopyTable.hxx +++ b/dbaccess/source/ui/inc/WCopyTable.hxx @@ -25,6 +25,7 @@ #include <com/sun/star/sdbc/XResultSet.hpp> #include <com/sun/star/sdbc/XResultSetMetaData.hpp> #include <com/sun/star/sdbc/XDatabaseMetaData.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <comphelper/stl_types.hxx> #include "TypeInfo.hxx" @@ -264,7 +265,7 @@ namespace dbaui const ICopyTableSourceObject& m_rSourceObject; ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > m_xFormatter; - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> m_xFactory; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> m_xContext; ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler> m_xInteractionHandler; String m_sTypeNames; // these type names are the ones out of the resource file @@ -310,7 +311,7 @@ namespace dbaui const ICopyTableSourceObject& _rSourceObject, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xSourceConnection, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext, const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler>& _xInteractionHandler ); @@ -325,7 +326,7 @@ namespace dbaui const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _xFormatter, TypeSelectionPageFactory _pTypeSelectionPageFactory, SvStream& _rTypeSelectionPageArg, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext ); virtual ~OCopyTableWizard(); @@ -382,7 +383,7 @@ namespace dbaui ::com::sun::star::lang::Locale GetLocale() const { return m_aLocale; } ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > GetFormatter() const { return m_xFormatter; } - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> GetFactory() const { return m_xFactory; } + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> GetComponentContext() const { return m_xContext; } const ODatabaseExport::TColumns* getSourceColumns() const{ return &m_vSourceColumns; } const ODatabaseExport::TColumnVector* getSrcVector() const { return &m_vSourceVec; } diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx index eb3a755d7115..1599bed21890 100644 --- a/dbaccess/source/ui/misc/DExport.cxx +++ b/dbaccess/source/ui/misc/DExport.cxx @@ -715,7 +715,7 @@ sal_Bool ODatabaseExport::executeWizard(const ::rtl::OUString& _rTableName,const m_xFormatter, getTypeSelectionPageFactory(), m_rInputStream, - m_xFactory + comphelper::getComponentContext(m_xFactory) ); sal_Bool bError = sal_False; diff --git a/dbaccess/source/ui/misc/TableCopyHelper.cxx b/dbaccess/source/ui/misc/TableCopyHelper.cxx index 83b73a894d04..b57bf8e0072f 100644 --- a/dbaccess/source/ui/misc/TableCopyHelper.cxx +++ b/dbaccess/source/ui/misc/TableCopyHelper.cxx @@ -40,6 +40,7 @@ #include <tools/urlobj.hxx> #include <tools/diagnose_ex.h> #include <comphelper/componentcontext.hxx> +#include <comphelper/processfactory.hxx> #include <com/sun/star/sdbcx/XTablesSupplier.hpp> #include <com/sun/star/sdbcx/XViewsSupplier.hpp> #include <com/sun/star/sdb/XQueryDefinitionsSupplier.hpp> @@ -246,9 +247,9 @@ sal_Bool OTableCopyHelper::copyTagTable(OTableCopyHelper::DropDescriptor& _rDesc Reference<XEventListener> xEvt; ODatabaseImportExport* pImport = NULL; if ( _rDesc.bHtml ) - pImport = new OHTMLImportExport(_xConnection,getNumberFormatter(_xConnection,m_pController->getORB()),m_pController->getORB()); + pImport = new OHTMLImportExport(_xConnection,getNumberFormatter(_xConnection, comphelper::getComponentContext(m_pController->getORB())),m_pController->getORB()); else - pImport = new ORTFImportExport(_xConnection,getNumberFormatter(_xConnection,m_pController->getORB()),m_pController->getORB()); + pImport = new ORTFImportExport(_xConnection,getNumberFormatter(_xConnection, comphelper::getComponentContext(m_pController->getORB())),m_pController->getORB()); xEvt = pImport; SvStream* pStream = (SvStream*)(SotStorageStream*)_rDesc.aHtmlRtfStorage; diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index e28ad805f397..b781a71f96ba 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -1604,7 +1604,7 @@ sal_Bool insertHierachyElement( Window* _pParent, const Reference< XMultiService return sal_True; } // ----------------------------------------------------------------------------- -Reference< XNumberFormatter > getNumberFormatter(const Reference< XConnection >& _rxConnection,const Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rMF ) +Reference< XNumberFormatter > getNumberFormatter(const Reference< XConnection >& _rxConnection, const Reference< ::com::sun::star::uno::XComponentContext >& _rxContext ) { // --------------------------------------------------------------- // create a formatter working with the connections format supplier @@ -1612,13 +1612,13 @@ Reference< XNumberFormatter > getNumberFormatter(const Reference< XConnection >& try { - Reference< ::com::sun::star::util::XNumberFormatsSupplier > xSupplier(::dbtools::getNumberFormats(_rxConnection, sal_True,_rMF)); + Reference< ::com::sun::star::util::XNumberFormatsSupplier > xSupplier(::dbtools::getNumberFormats(_rxConnection, sal_True, _rxContext)); if ( xSupplier.is() ) { // create a new formatter xFormatter = Reference< util::XNumberFormatter > ( - util::NumberFormatter::create(comphelper::getComponentContext(_rMF)), UNO_QUERY_THROW); + util::NumberFormatter::create( _rxContext ), UNO_QUERY_THROW); xFormatter->attachNumberFormatsSupplier(xSupplier); } } diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index b468478b5d50..5edb86e1b2b4 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -548,7 +548,7 @@ namespace //------------------------------------------------------------------------ OCopyTableWizard::OCopyTableWizard( Window * pParent, const ::rtl::OUString& _rDefaultName, sal_Int16 _nOperation, const ICopyTableSourceObject& _rSourceObject, const Reference< XConnection >& _xSourceConnection, - const Reference< XConnection >& _xConnection, const Reference< XMultiServiceFactory >& _rxORB, + const Reference< XConnection >& _xConnection, const Reference< XComponentContext >& _rxContext, const Reference< XInteractionHandler>& _xInteractionHandler) : WizardDialog( pParent, ModuleRes(WIZ_RTFCOPYTABLE)) ,m_pbHelp( this , ModuleRes(PB_HELP)) @@ -559,8 +559,8 @@ OCopyTableWizard::OCopyTableWizard( Window * pParent, const ::rtl::OUString& _rD ,m_mNameMapping(_xConnection->getMetaData().is() && _xConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers()) ,m_xDestConnection( _xConnection ) ,m_rSourceObject( _rSourceObject ) - ,m_xFormatter( getNumberFormatter( _xConnection, _rxORB ) ) - ,m_xFactory(_rxORB) + ,m_xFormatter( getNumberFormatter( _xConnection, _rxContext ) ) + ,m_xContext(_rxContext) ,m_xInteractionHandler(_xInteractionHandler) ,m_sTypeNames(ModuleRes(STR_TABLEDESIGN_DBFIELDTYPES)) ,m_nPageCount(0) @@ -649,7 +649,7 @@ OCopyTableWizard::OCopyTableWizard( Window * pParent, const ::rtl::OUString& _rD OCopyTableWizard::OCopyTableWizard( Window* pParent, const ::rtl::OUString& _rDefaultName, sal_Int16 _nOperation, const ODatabaseExport::TColumns& _rSourceColumns, const ODatabaseExport::TColumnVector& _rSourceColVec, const Reference< XConnection >& _xConnection, const Reference< XNumberFormatter >& _xFormatter, - TypeSelectionPageFactory _pTypeSelectionPageFactory, SvStream& _rTypeSelectionPageArg, const Reference< XMultiServiceFactory >& _rM ) + TypeSelectionPageFactory _pTypeSelectionPageFactory, SvStream& _rTypeSelectionPageArg, const Reference< XComponentContext >& _rxContext ) :WizardDialog( pParent, ModuleRes(WIZ_RTFCOPYTABLE)) ,m_vSourceColumns(_rSourceColumns) ,m_pbHelp( this , ModuleRes(PB_HELP)) @@ -661,7 +661,7 @@ OCopyTableWizard::OCopyTableWizard( Window* pParent, const ::rtl::OUString& _rDe ,m_xDestConnection( _xConnection ) ,m_rSourceObject( DummyCopySource::Instance() ) ,m_xFormatter(_xFormatter) - ,m_xFactory(_rM) + ,m_xContext(_rxContext) ,m_sTypeNames(ModuleRes(STR_TABLEDESIGN_DBFIELDTYPES)) ,m_nPageCount(0) ,m_bDeleteSourceColumns(sal_False) @@ -684,7 +684,7 @@ OCopyTableWizard::OCopyTableWizard( Window* pParent, const ::rtl::OUString& _rDe ::dbaui::fillTypeInfo( _xConnection, m_sTypeNames, m_aTypeInfo, m_aTypeInfoIndex ); ::dbaui::fillTypeInfo( _xConnection, m_sTypeNames, m_aDestTypeInfo, m_aDestTypeInfoIndex ); - m_xInteractionHandler.set( InteractionHandler::createWithParent(comphelper::getComponentContext(m_xFactory), 0), UNO_QUERY ); + m_xInteractionHandler.set( InteractionHandler::createWithParent(m_xContext, 0), UNO_QUERY ); OCopyTable* pPage1( new OCopyTable( this ) ); pPage1->disallowViews(); @@ -1339,7 +1339,7 @@ Reference< XPropertySet > OCopyTableWizard::createTable() { xSuppDestinationColumns.set( xTable, UNO_QUERY_THROW ); // insert new table name into table filter - ::dbaui::appendToFilter( m_xDestConnection, m_sName, comphelper::getComponentContext(GetFactory()), this ); + ::dbaui::appendToFilter( m_xDestConnection, m_sName, GetComponentContext(), this ); // copy ui settings m_rSourceObject.copyUISettingsTo( xTable ); diff --git a/dbaccess/source/ui/misc/WExtendPages.cxx b/dbaccess/source/ui/misc/WExtendPages.cxx index c1ccaf8eb541..e8e84a2a6270 100644 --- a/dbaccess/source/ui/misc/WExtendPages.cxx +++ b/dbaccess/source/ui/misc/WExtendPages.cxx @@ -23,6 +23,7 @@ #include "WCopyTable.hxx" using namespace dbaui; +using namespace com::sun::star; //======================================================================== SvParser* OWizHTMLExtend::createReader(sal_Int32 _nRows) { @@ -30,7 +31,7 @@ SvParser* OWizHTMLExtend::createReader(sal_Int32 _nRows) _nRows, m_pParent->GetColumnPositions(), m_pParent->GetFormatter(), - m_pParent->GetFactory(), + uno::Reference<lang::XMultiServiceFactory>(m_pParent->GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW), m_pParent->getDestVector(), m_pParent->getTypeInfo(), m_pParent->shouldCreatePrimaryKey()); @@ -42,7 +43,7 @@ SvParser* OWizRTFExtend::createReader(sal_Int32 _nRows) _nRows, m_pParent->GetColumnPositions(), m_pParent->GetFormatter(), - m_pParent->GetFactory(), + uno::Reference<lang::XMultiServiceFactory>(m_pParent->GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW), m_pParent->getDestVector(), m_pParent->getTypeInfo(), m_pParent->shouldCreatePrimaryKey()); diff --git a/dbaccess/source/ui/uno/ColumnControl.cxx b/dbaccess/source/ui/uno/ColumnControl.cxx index 999c5f33a079..2a71d359931d 100644 --- a/dbaccess/source/ui/uno/ColumnControl.cxx +++ b/dbaccess/source/ui/uno/ColumnControl.cxx @@ -65,7 +65,7 @@ void SAL_CALL OColumnControl::createPeer(const Reference< XToolkit >& /*rToolkit pParentWin = pParent->GetWindow(); } - OColumnPeer* pPeer = new OColumnPeer( pParentWin, maContext.getLegacyServiceFactory() ); + OColumnPeer* pPeer = new OColumnPeer( pParentWin, maContext.getUNOContext() ); OSL_ENSURE(pPeer != NULL, "FmXGridControl::createPeer : imp_CreatePeer didn't return a peer !"); setPeer( pPeer ); diff --git a/dbaccess/source/ui/uno/ColumnPeer.cxx b/dbaccess/source/ui/uno/ColumnPeer.cxx index c5613a75f767..a4c1ea19e060 100644 --- a/dbaccess/source/ui/uno/ColumnPeer.cxx +++ b/dbaccess/source/ui/uno/ColumnPeer.cxx @@ -33,13 +33,12 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::sdbc; -OColumnPeer::OColumnPeer(Window* _pParent,const Reference<XMultiServiceFactory>& _rxFactory) - :m_xORB(_rxFactory) - ,m_pActFieldDescr(NULL) +OColumnPeer::OColumnPeer(Window* _pParent,const Reference<XComponentContext>& _rxContext) + :m_pActFieldDescr(NULL) { osl_atomic_increment( &m_refCount ); { - OColumnControlWindow* pFieldControl = new OColumnControlWindow(_pParent,m_xORB); + OColumnControlWindow* pFieldControl = new OColumnControlWindow(_pParent, _rxContext); pFieldControl->SetComponentInterface(this); pFieldControl->Show(); } diff --git a/dbaccess/source/ui/uno/ColumnPeer.hxx b/dbaccess/source/ui/uno/ColumnPeer.hxx index a5a2562b2c3b..3b97a6d6acf0 100644 --- a/dbaccess/source/ui/uno/ColumnPeer.hxx +++ b/dbaccess/source/ui/uno/ColumnPeer.hxx @@ -22,7 +22,7 @@ #include <toolkit/awt/vclxwindow.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/sdbc/XConnection.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> //......................................................................... namespace dbaui @@ -31,13 +31,12 @@ namespace dbaui class OFieldDescription; class OColumnPeer : public VCLXWindow { - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> m_xORB; OFieldDescription* m_pActFieldDescr; ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xColumn; public: OColumnPeer(Window* _pParent - ,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext); void setColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xColumn); void setConnection(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xCon); diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index e06f91e1f1a2..7618f336e35c 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -1610,7 +1610,7 @@ Dialog* CopyTableWizard::createDialog( Window* _pParent ) *m_pSourceObject, m_xSourceConnection.getTyped(), m_xDestConnection.getTyped(), - m_aContext.getLegacyServiceFactory(), + m_aContext.getUNOContext(), m_xInteractionHandler ); |