diff options
author | Noel Grandin <noel@peralex.com> | 2012-05-26 13:53:19 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-06-04 16:57:55 +0200 |
commit | b3c76dee6d44d07eae404b8d7341e6c88e6c4429 (patch) | |
tree | c747dd5bddf94c3b4312c7b1861a5087e76e71d6 /desktop/source/migration | |
parent | eb68bf18f2d859486c4a737abb2536a6afe45411 (diff) |
fdo#46808, Adapt UNO services to new style, Part 7, updating ::create
Update calls to factories to use new ::create methods
Change-Id: I01d4417820f52718836c92faf3c2fae0dc96b30d
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>, added some tweaks.
Diffstat (limited to 'desktop/source/migration')
-rw-r--r-- | desktop/source/migration/migration.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index 583edec17049..88bf8c54f393 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -35,6 +35,7 @@ #include "migration_impl.hxx" #include <unotools/textsearch.hxx> +#include <comphelper/componentcontext.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/sequence.hxx> #include <unotools/bootstrap.hxx> @@ -57,6 +58,7 @@ #include <com/sun/star/util/XChangesBatch.hpp> #include <com/sun/star/util/XStringSubstitution.hpp> #include <com/sun/star/embed/ElementModes.hpp> +#include <com/sun/star/embed/FileSystemStorageFactory.hpp> #include <com/sun/star/embed/XStorage.hpp> #include <com/sun/star/ui/XUIConfiguration.hpp> #include <com/sun/star/ui/XUIConfigurationStorage.hpp> @@ -272,10 +274,9 @@ sal_Bool MigrationImpl::doMigration() lArgs[0] <<= aOldCfgDataPath + vModulesInfo[i].sModuleShortName; lArgs[1] <<= embed::ElementModes::READ; - uno::Reference< lang::XSingleServiceFactory > xStorageFactory(m_xFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.FileSystemStorageFactory"))), uno::UNO_QUERY); - uno::Reference< embed::XStorage > xModules; - - xModules = uno::Reference< embed::XStorage >(xStorageFactory->createInstanceWithArguments(lArgs), uno::UNO_QUERY); + uno::Reference< lang::XSingleServiceFactory > xStorageFactory( + embed::FileSystemStorageFactory::create(comphelper::ComponentContext(m_xFactory).getUNOContext())); + uno::Reference< embed::XStorage > xModules(xStorageFactory->createInstanceWithArguments(lArgs), uno::UNO_QUERY); uno::Reference< ui::XUIConfigurationManager > xOldCfgManager( m_xFactory->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.UIConfigurationManager"))), uno::UNO_QUERY ); uno::Reference< ui::XUIConfigurationStorage > xOldCfgStorage( xOldCfgManager, uno::UNO_QUERY ); uno::Reference< ui::XUIConfigurationPersistence > xOldCfgPersistence( xOldCfgManager, uno::UNO_QUERY ); @@ -996,7 +997,8 @@ void MigrationImpl::runServices() lArgs[0] <<= m_aInfo.userdata + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/user/config/soffice.cfg/modules")); lArgs[1] <<= embed::ElementModes::READ; - uno::Reference< lang::XSingleServiceFactory > xStorageFactory(m_xFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.FileSystemStorageFactory"))), uno::UNO_QUERY); + uno::Reference< lang::XSingleServiceFactory > xStorageFactory( + embed::FileSystemStorageFactory::create(comphelper::ComponentContext(m_xFactory).getUNOContext())); uno::Reference< embed::XStorage > xModules; xModules = uno::Reference< embed::XStorage >(xStorageFactory->createInstanceWithArguments(lArgs), uno::UNO_QUERY); |