summaryrefslogtreecommitdiff
path: root/desktop/source/migration
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-02-01 13:28:32 +0200
committerNoel Grandin <noel@peralex.com>2013-02-11 08:02:18 +0200
commit0cd4caa547a75316c6b3f2992dd66b2294c6f1ae (patch)
tree7936ffb501740f7a53c18ed679f27ee1ec76b1ef /desktop/source/migration
parente7a76a0e65a185c3ac0ef041f7e6957d3f8b655b (diff)
fdo#46808, convert code in desktop module to XComponentContext
Change-Id: I79a22f52ebe59f8f89291d4e6e78bd37817cd047
Diffstat (limited to 'desktop/source/migration')
-rw-r--r--desktop/source/migration/migration.cxx22
-rw-r--r--desktop/source/migration/migration_impl.hxx4
2 files changed, 12 insertions, 14 deletions
diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx
index 6301fdc3acba..61c57c1c9b75 100644
--- a/desktop/source/migration/migration.cxx
+++ b/desktop/source/migration/migration.cxx
@@ -207,7 +207,7 @@ bool MigrationImpl::initializeMigration()
void Migration::migrateSettingsIfNecessary()
{
- MigrationImpl aImpl( comphelper::getProcessServiceFactory() );
+ MigrationImpl aImpl;
if (! aImpl.initializeMigration() )
return;
@@ -227,9 +227,8 @@ void Migration::migrateSettingsIfNecessary()
(void)bResult;
}
-MigrationImpl::MigrationImpl(const uno::Reference< XMultiServiceFactory >& xFactory)
+MigrationImpl::MigrationImpl()
: m_vrVersions(new strings_v)
- , m_xFactory(xFactory)
{
}
@@ -265,10 +264,10 @@ sal_Bool MigrationImpl::doMigration()
lArgs[0] <<= aOldCfgDataPath + vModulesInfo[i].sModuleShortName;
lArgs[1] <<= embed::ElementModes::READ;
- uno::Reference< lang::XSingleServiceFactory > xStorageFactory(
- embed::FileSystemStorageFactory::create(comphelper::getComponentContext(m_xFactory)));
+ uno::Reference< uno::XComponentContext > xContext(comphelper::getProcessComponentContext());
+ uno::Reference< lang::XSingleServiceFactory > xStorageFactory(embed::FileSystemStorageFactory::create(xContext));
uno::Reference< embed::XStorage > xModules(xStorageFactory->createInstanceWithArguments(lArgs), uno::UNO_QUERY);
- uno::Reference< ui::XUIConfigurationManager > xOldCfgManager( m_xFactory->createInstance("com.sun.star.ui.UIConfigurationManager"), uno::UNO_QUERY );
+ uno::Reference< ui::XUIConfigurationManager > xOldCfgManager(xContext->getServiceManager()->createInstanceWithContext("com.sun.star.ui.UIConfigurationManager", xContext), uno::UNO_QUERY );
uno::Reference< ui::XUIConfigurationStorage > xOldCfgStorage( xOldCfgManager, uno::UNO_QUERY );
uno::Reference< ui::XUIConfigurationPersistence > xOldCfgPersistence( xOldCfgManager, uno::UNO_QUERY );
@@ -336,8 +335,7 @@ sal_Bool MigrationImpl::doMigration()
void MigrationImpl::refresh()
{
uno::Reference< XRefreshable >(
- configuration::theDefaultProvider::get(
- comphelper::getComponentContext(m_xFactory)),
+ configuration::theDefaultProvider::get(comphelper::getProcessComponentContext()),
uno::UNO_QUERY_THROW)->refresh();
}
@@ -952,6 +950,7 @@ void MigrationImpl::runServices()
// and execute the migration job
uno::Reference< XJob > xMigrationJob;
+ uno::Reference< uno::XComponentContext > xContext(comphelper::getProcessComponentContext());
migrations_v::const_iterator i_mig = m_vrMigrations->begin();
while (i_mig != m_vrMigrations->end())
{
@@ -969,8 +968,9 @@ void MigrationImpl::runServices()
seqArguments[2] = uno::makeAny(NamedValue("ExtensionBlackList",
uno::makeAny( seqExtBlackList )));
- xMigrationJob = uno::Reference< XJob >(m_xFactory->createInstanceWithArguments(
- i_mig->service, seqArguments), uno::UNO_QUERY_THROW);
+ xMigrationJob = uno::Reference< XJob >(
+ xContext->getServiceManager()->createInstanceWithArgumentsAndContext(i_mig->service, seqArguments, xContext),
+ uno::UNO_QUERY_THROW);
xMigrationJob->execute(uno::Sequence< NamedValue >());
@@ -1007,7 +1007,7 @@ void MigrationImpl::runServices()
lArgs[1] <<= embed::ElementModes::READ;
uno::Reference< lang::XSingleServiceFactory > xStorageFactory(
- embed::FileSystemStorageFactory::create(comphelper::getComponentContext(m_xFactory)));
+ embed::FileSystemStorageFactory::create(comphelper::getProcessComponentContext()));
uno::Reference< embed::XStorage > xModules;
xModules = uno::Reference< embed::XStorage >(xStorageFactory->createInstanceWithArguments(lArgs), uno::UNO_QUERY);
diff --git a/desktop/source/migration/migration_impl.hxx b/desktop/source/migration/migration_impl.hxx
index ef2e659954fc..653813fbd2dd 100644
--- a/desktop/source/migration/migration_impl.hxx
+++ b/desktop/source/migration/migration_impl.hxx
@@ -32,7 +32,6 @@
#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/container/XIndexContainer.hpp>
@@ -185,7 +184,6 @@ class MigrationImpl
private:
strings_vr m_vrVersions;
- NS_UNO::Reference< NS_CSS::lang::XMultiServiceFactory > m_xFactory;
migrations_available m_vMigrationsAvailable; // list of all available migrations
migrations_vr m_vrMigrations; // list of all migration specs from config
@@ -232,7 +230,7 @@ private:
bool checkMigrationCompleted();
public:
- MigrationImpl(const NS_UNO::Reference< NS_CSS::lang::XMultiServiceFactory >&);
+ MigrationImpl();
~MigrationImpl();
bool initializeMigration();
sal_Bool doMigration();