diff options
author | Noel Grandin <noel@peralex.com> | 2013-03-19 13:08:47 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-03-20 07:32:53 +0200 |
commit | a066525b42a1ab8dc60e10a5d62819c259904f32 (patch) | |
tree | 0c21130ff82a482ab80de0fcc3c73be0125d06f5 /dbaccess/source/ext/macromigration | |
parent | 6999a50efaaf802ccd4c7eb7957af17cc32602be (diff) |
fdo#46808, Convert a bunch of comphelper::ComponentContext stuff
.. to Reference<XComponentContext>
mostly in the dbaccess module, but it also affected some other
modules.
Change-Id: I09b3f6fe7a9b33498b11d98b5521b5aeeb8882be
Diffstat (limited to 'dbaccess/source/ext/macromigration')
8 files changed, 29 insertions, 36 deletions
diff --git a/dbaccess/source/ext/macromigration/docinteraction.cxx b/dbaccess/source/ext/macromigration/docinteraction.cxx index a83deb852006..9468a9c4453e 100644 --- a/dbaccess/source/ext/macromigration/docinteraction.cxx +++ b/dbaccess/source/ext/macromigration/docinteraction.cxx @@ -24,7 +24,6 @@ #include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/task/DocumentPasswordRequest.hpp> -#include <comphelper/componentcontext.hxx> #include <comphelper/namedvaluecollection.hxx> #include <comphelper/interaction.hxx> #include <rtl/ref.hxx> @@ -45,6 +44,7 @@ namespace dbmm using ::com::sun::star::uno::RuntimeException; using ::com::sun::star::uno::Any; using ::com::sun::star::uno::makeAny; + using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::task::XInteractionHandler; using ::com::sun::star::frame::XModel; using ::com::sun::star::task::DocumentPasswordRequest; @@ -65,8 +65,8 @@ namespace dbmm { } - InteractionHandler_Data( const ::comphelper::ComponentContext& _rContext ) - :xHandler( ::com::sun::star::task::InteractionHandler::createWithParent(_rContext.getUNOContext(), 0), UNO_QUERY ) + InteractionHandler_Data( const Reference<XComponentContext>& _rContext ) + :xHandler( ::com::sun::star::task::InteractionHandler::createWithParent(_rContext, 0), UNO_QUERY ) { } }; @@ -75,7 +75,7 @@ namespace dbmm //= InteractionHandler //==================================================================== //-------------------------------------------------------------------- - InteractionHandler::InteractionHandler( const ::comphelper::ComponentContext& _rContext, const Reference< XModel >& _rxDocument ) + InteractionHandler::InteractionHandler( const Reference<XComponentContext>& _rContext, const Reference< XModel >& _rxDocument ) :m_pData( new InteractionHandler_Data( _rContext ) ) { // check whether the doumentc has an own interaction handler set diff --git a/dbaccess/source/ext/macromigration/docinteraction.hxx b/dbaccess/source/ext/macromigration/docinteraction.hxx index 3291bcaeda2d..895bf0e785de 100644 --- a/dbaccess/source/ext/macromigration/docinteraction.hxx +++ b/dbaccess/source/ext/macromigration/docinteraction.hxx @@ -22,10 +22,7 @@ #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/task/XInteractionHandler.hpp> - -namespace comphelper { - class ComponentContext; -} +#include <com/sun/star/uno/XComponentContext.hpp> #include <memory> @@ -47,7 +44,9 @@ namespace dbmm component at the given component context, or using the given document's interaction handler, if one is specified in the document's media descriptor. */ - InteractionHandler( const ::comphelper::ComponentContext& _rContext, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& _rxDocument ); + InteractionHandler( + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rContext, + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& _rxDocument ); /** destructor */ diff --git a/dbaccess/source/ext/macromigration/macromigrationdialog.cxx b/dbaccess/source/ext/macromigration/macromigrationdialog.cxx index 0eb2da076992..01c1dd2ff542 100644 --- a/dbaccess/source/ext/macromigration/macromigrationdialog.cxx +++ b/dbaccess/source/ext/macromigration/macromigrationdialog.cxx @@ -112,7 +112,7 @@ namespace dbmm //==================================================================== struct MacroMigrationDialog_Data { - ::comphelper::ComponentContext aContext; + Reference<XComponentContext> aContext; MigrationLog aLogger; Reference< XOfficeDatabaseDocument > xDocument; Reference< XModel2 > xDocumentModel; @@ -122,7 +122,7 @@ namespace dbmm bool bMigrationSuccess; MacroMigrationDialog_Data( - const ::comphelper::ComponentContext& _rContext, + const Reference<XComponentContext>& _rContext, const Reference< XOfficeDatabaseDocument >& _rxDocument ) :aContext( _rContext ) ,aLogger() @@ -139,7 +139,7 @@ namespace dbmm //= MacroMigrationDialog //==================================================================== //-------------------------------------------------------------------- - MacroMigrationDialog::MacroMigrationDialog( Window* _pParent, const ::comphelper::ComponentContext& _rContext, + MacroMigrationDialog::MacroMigrationDialog( Window* _pParent, const Reference<XComponentContext>& _rContext, const Reference< XOfficeDatabaseDocument >& _rxDocument ) :MacroMigrationDialog_Base( _pParent, MacroMigrationResId( DLG_MACRO_MIGRATION ) ) ,m_pData( new MacroMigrationDialog_Data( _rContext, _rxDocument ) ) @@ -174,7 +174,7 @@ namespace dbmm } //-------------------------------------------------------------------- - const ::comphelper::ComponentContext& MacroMigrationDialog::getComponentContext() const + const Reference<XComponentContext>& MacroMigrationDialog::getComponentContext() const { return m_pData->aContext; } @@ -438,7 +438,7 @@ namespace dbmm try { // check that the backup location isn't the same as the document itself - if ( lcl_equalURLs_nothrow( m_pData->aContext.getUNOContext(), sBackupLocation, m_pData->xDocumentModel->getURL() ) ) + if ( lcl_equalURLs_nothrow( m_pData->aContext, sBackupLocation, m_pData->xDocumentModel->getURL() ) ) { ErrorBox aErrorBox( const_cast< MacroMigrationDialog* >( this ), MacroMigrationResId( ERR_INVALID_BACKUP_LOCATION ) ); aErrorBox.Execute(); diff --git a/dbaccess/source/ext/macromigration/macromigrationdialog.hxx b/dbaccess/source/ext/macromigration/macromigrationdialog.hxx index 72cdc57532f9..51e04e4204c2 100644 --- a/dbaccess/source/ext/macromigration/macromigrationdialog.hxx +++ b/dbaccess/source/ext/macromigration/macromigrationdialog.hxx @@ -22,7 +22,6 @@ #include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp> -#include <comphelper/componentcontext.hxx> #include <svtools/roadmapwizard.hxx> #include <memory> @@ -42,12 +41,12 @@ namespace dbmm public: MacroMigrationDialog( Window* _pParent, - const ::comphelper::ComponentContext& _rContext, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rContext, const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XOfficeDatabaseDocument >& _rxDocument ); virtual ~MacroMigrationDialog(); - const ::comphelper::ComponentContext& + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& getComponentContext() const; const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XOfficeDatabaseDocument >& getDocument() const; diff --git a/dbaccess/source/ext/macromigration/macromigrationpages.cxx b/dbaccess/source/ext/macromigration/macromigrationpages.cxx index ebf8936584c5..0e824f3cc216 100644 --- a/dbaccess/source/ext/macromigration/macromigrationpages.cxx +++ b/dbaccess/source/ext/macromigration/macromigrationpages.cxx @@ -27,6 +27,7 @@ #include <com/sun/star/frame/XModel.hpp> +#include <comphelper/componentcontext.hxx> #include <tools/urlobj.hxx> #include <tools/diagnose_ex.h> #include <vcl/metric.hxx> diff --git a/dbaccess/source/ext/macromigration/macromigrationwizard.cxx b/dbaccess/source/ext/macromigration/macromigrationwizard.cxx index 5c95ec717b61..7b0f64747b0e 100644 --- a/dbaccess/source/ext/macromigration/macromigrationwizard.cxx +++ b/dbaccess/source/ext/macromigration/macromigrationwizard.cxx @@ -26,7 +26,6 @@ #include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp> #include <com/sun/star/frame/XStorable.hpp> -#include <comphelper/componentcontext.hxx> #include <svtools/genericunodialog.hxx> //........................................................................ @@ -99,7 +98,7 @@ namespace dbmm virtual void destroyDialog(); private: - ::comphelper::ComponentContext m_aContext; + Reference<XComponentContext> m_aContext; Reference< XOfficeDatabaseDocument > m_xDocument; }; diff --git a/dbaccess/source/ext/macromigration/migrationengine.cxx b/dbaccess/source/ext/macromigration/migrationengine.cxx index d4e84d61db31..705c47189857 100644 --- a/dbaccess/source/ext/macromigration/migrationengine.cxx +++ b/dbaccess/source/ext/macromigration/migrationengine.cxx @@ -90,6 +90,7 @@ namespace dbmm using ::com::sun::star::uno::RuntimeException; using ::com::sun::star::uno::Any; using ::com::sun::star::uno::makeAny; + using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::sdb::XOfficeDatabaseDocument; using ::com::sun::star::sdb::XFormDocumentsSupplier; using ::com::sun::star::sdb::XReportDocumentsSupplier; @@ -857,7 +858,7 @@ namespace dbmm { public: MigrationEngine_Impl( - const ::comphelper::ComponentContext& _rContext, + const Reference<XComponentContext>& _rContext, const Reference< XOfficeDatabaseDocument >& _rxDocument, IMigrationProgress& _rProgress, MigrationLog& _rLogger @@ -869,7 +870,7 @@ namespace dbmm bool migrateAll(); private: - ::comphelper::ComponentContext m_aContext; + Reference<XComponentContext> m_aContext; const Reference< XOfficeDatabaseDocument > m_xDocument; const Reference< XModel > m_xDocumentModel; IMigrationProgress& m_rProgress; @@ -983,7 +984,7 @@ namespace dbmm //= MigrationEngine_Impl - implementation //==================================================================== //-------------------------------------------------------------------- - MigrationEngine_Impl::MigrationEngine_Impl( const ::comphelper::ComponentContext& _rContext, + MigrationEngine_Impl::MigrationEngine_Impl( const Reference<XComponentContext>& _rContext, const Reference< XOfficeDatabaseDocument >& _rxDocument, IMigrationProgress& _rProgress, MigrationLog& _rLogger ) :m_aContext( _rContext ) ,m_xDocument( _rxDocument ) @@ -1497,12 +1498,12 @@ namespace dbmm if ( _eScriptType == eBasic ) { xTargetLibraries.set( DocumentScriptLibraryContainer::create( - m_aContext.getUNOContext(), xStorageDoc ), UNO_QUERY_THROW ); + m_aContext, xStorageDoc ), UNO_QUERY_THROW ); } else { xTargetLibraries.set( DocumentDialogLibraryContainer::create( - m_aContext.getUNOContext(), xStorageDoc ), UNO_QUERY_THROW ); + m_aContext, xStorageDoc ), UNO_QUERY_THROW ); } // copy all libs to the target, with potentially renaming them @@ -1637,7 +1638,7 @@ namespace dbmm } // analyze the script URI - Reference< XUriReferenceFactory > xUriRefFac = UriReferenceFactory::create( m_aContext.getUNOContext() ); + Reference< XUriReferenceFactory > xUriRefFac = UriReferenceFactory::create( m_aContext ); Reference< XVndSunStarScriptUrlReference > xUri( xUriRefFac->parse( _inout_rScriptCode ), UNO_QUERY_THROW ); OUString sScriptLanguage = xUri->getParameter( OUString( "language" ) ); @@ -1821,8 +1822,8 @@ namespace dbmm Reference< XInputStreamProvider > xISP( _inout_rDialogLibraryElement, UNO_QUERY_THROW ); Reference< XInputStream > xInput( xISP->createInputStream(), UNO_QUERY_THROW ); - Reference< XNameContainer > xDialogModel( m_aContext.createComponent( "com.sun.star.awt.UnoControlDialogModel" ), UNO_QUERY_THROW ); - ::xmlscript::importDialogModel( xInput, xDialogModel, m_aContext.getUNOContext(), m_xDocumentModel ); + Reference< XNameContainer > xDialogModel( m_aContext->getServiceManager()->createInstanceWithContext("com.sun.star.awt.UnoControlDialogModel", m_aContext), UNO_QUERY_THROW ); + ::xmlscript::importDialogModel( xInput, xDialogModel, m_aContext, m_xDocumentModel ); // adjust the events of the dialog impl_adjustDialogElementEvents_throw( xDialogModel ); @@ -1837,7 +1838,7 @@ namespace dbmm } // export dialog model - xISP = ::xmlscript::exportDialogModel( xDialogModel, m_aContext.getUNOContext(), m_xDocumentModel ); + xISP = ::xmlscript::exportDialogModel( xDialogModel, m_aContext, m_xDocumentModel ); _inout_rDialogLibraryElement <<= xISP; } catch( const Exception& ) @@ -1944,7 +1945,7 @@ namespace dbmm //= MigrationEngine //==================================================================== //-------------------------------------------------------------------- - MigrationEngine::MigrationEngine( const ::comphelper::ComponentContext& _rContext, + MigrationEngine::MigrationEngine( const Reference<XComponentContext>& _rContext, const Reference< XOfficeDatabaseDocument >& _rxDocument, IMigrationProgress& _rProgress, MigrationLog& _rLogger ) :m_pImpl( new MigrationEngine_Impl( _rContext, _rxDocument, _rProgress, _rLogger ) ) diff --git a/dbaccess/source/ext/macromigration/migrationengine.hxx b/dbaccess/source/ext/macromigration/migrationengine.hxx index 262a1fca1ffc..01f1116b699a 100644 --- a/dbaccess/source/ext/macromigration/migrationengine.hxx +++ b/dbaccess/source/ext/macromigration/migrationengine.hxx @@ -22,14 +22,8 @@ #include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp> -#include <comphelper/componentcontext.hxx> - #include <memory> -namespace comphelper { - class ComponentContext; -} - //........................................................................ namespace dbmm { @@ -53,7 +47,7 @@ namespace dbmm passed herein as reference, must live as long as the engine instance lives. */ MigrationEngine( - const ::comphelper::ComponentContext& _rContext, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rContext, const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XOfficeDatabaseDocument >& _rxDocument, IMigrationProgress& _rProgress, MigrationLog& _rLogger |