diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2008-08-01 08:53:02 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2008-08-01 08:53:02 +0000 |
commit | 6022000d920e6524ccf09c9522106fcf5f3bbcb3 (patch) | |
tree | 82701314525c0d97db109eb35470d8f40641f39d /desktop/source | |
parent | 430094a170869d7b5f03979d0314d662851682a9 (diff) |
INTEGRATION: CWS userdatamigration (1.12.90); FILE MERGED
2008/07/23 16:44:52 mba 1.12.90.5: #i92045#: product names for migration also in setup.xcu
2008/07/22 07:30:39 mba 1.12.90.4: #i91919#: register configuration files of extensions
2008/07/16 12:57:14 mba 1.12.90.3: #i88426#: cross-product update only if direct update not possible
2008/07/08 06:58:01 mba 1.12.90.2: #i88426#: migration of extensions and wordbooks
2008/07/04 06:19:39 mba 1.12.90.1: #i88426#: activate migration
Diffstat (limited to 'desktop/source')
-rw-r--r-- | desktop/source/migration/migration.cxx | 292 |
1 files changed, 145 insertions, 147 deletions
diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index 771b55db4b..7cb230764f 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -1,13 +1,13 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: migration.cxx,v $ - * $Revision: 1.12 $ + * $Revision: 1.13 $ * * This file is part of OpenOffice.org. * @@ -16,7 +16,7 @@ * only, as published by the Free Software Foundation. * * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of + * but WITHOUT uno::Any WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License version 3 for more details * (a copy is included in the LICENSE file that accompanied this code). @@ -44,6 +44,9 @@ #include <tools/urlobj.hxx> #include <osl/file.hxx> #include <osl/mutex.hxx> +#include <ucbhelper/content.hxx> +#include <osl/security.hxx> +#include <unotools/configmgr.hxx> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/task/XJob.hpp> @@ -53,11 +56,11 @@ #include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp> #include <com/sun/star/util/XRefreshable.hpp> #include <com/sun/star/util/XChangesBatch.hpp> - +#include <com/sun/star/util/XStringSubstitution.hpp> + using namespace rtl; using namespace osl; using namespace std; -using namespace com::sun::star::uno; using namespace com::sun::star::task; using namespace com::sun::star::lang; using namespace com::sun::star::beans; @@ -65,7 +68,8 @@ using namespace com::sun::star::util; using namespace com::sun::star::container; using namespace com::sun::star::configuration; using namespace com::sun::star::configuration::backend; - +using com::sun::star::uno::Exception; +using namespace com::sun::star; namespace desktop { @@ -87,7 +91,7 @@ static void releaseImpl() { delete pImpl; pImpl = 0; - } + } } @@ -136,11 +140,11 @@ sal_Bool MigrationImpl::checkMigration() return sal_False; } -MigrationImpl::MigrationImpl(const Reference< XMultiServiceFactory >& xFactory) +MigrationImpl::MigrationImpl(const uno::Reference< XMultiServiceFactory >& xFactory) : m_vrVersions(new strings_v) , m_xFactory(xFactory) , m_vrMigrations(readMigrationSteps()) - , m_aInfo(findInstallation()) + , m_aInfo(findInstallation()) , m_vrFileList(compileFileList()) , m_vrServiceList(compileServiceList()) { @@ -157,16 +161,15 @@ sal_Bool MigrationImpl::doMigration() try{ copyFiles(); - // execute the migration items from Setup.xcu + // execute the migration items from Setup.xcu // and refresh the cache copyConfig(); refresh(); // execute custom migration services from Setup.xcu // and refresh the cache - runServices(); + runServices(); refresh(); - result = sal_True; } catch (...) @@ -179,37 +182,37 @@ sal_Bool MigrationImpl::doMigration() // prevent running the migration multiple times setMigrationCompleted(); - return sal_False; + return result; } void MigrationImpl::refresh() { - Reference< XRefreshable > xRefresh(m_xFactory->createInstance( - OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider")), UNO_QUERY); + uno::Reference< XRefreshable > xRefresh(m_xFactory->createInstance( + OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider")), uno::UNO_QUERY); if (xRefresh.is()) xRefresh->refresh(); else - OSL_ENSURE(sal_False, "could not get XRefresh interface from default config provider. No refresh done."); - + OSL_ENSURE(sal_False, "could not get XRefresh interface from default config provider. No refresh done."); + } -void MigrationImpl::setMigrationCompleted() +void MigrationImpl::setMigrationCompleted() { try { - Reference< XPropertySet > aPropertySet(getConfigAccess("org.openoffice.Setup/Office", true), UNO_QUERY_THROW); - aPropertySet->setPropertyValue(OUString::createFromAscii("MigrationCompleted"), makeAny(sal_True)); - Reference< XChangesBatch >(aPropertySet, UNO_QUERY_THROW)->commitChanges(); + uno::Reference< XPropertySet > aPropertySet(getConfigAccess("org.openoffice.Setup/Office", true), uno::UNO_QUERY_THROW); + aPropertySet->setPropertyValue(OUString::createFromAscii("MigrationCompleted"), uno::makeAny(sal_True)); + uno::Reference< XChangesBatch >(aPropertySet, uno::UNO_QUERY_THROW)->commitChanges(); } catch (...) { // fail silently } } -sal_Bool MigrationImpl::checkMigrationCompleted() +sal_Bool MigrationImpl::checkMigrationCompleted() { sal_Bool bMigrationCompleted = sal_False; try { - Reference< XPropertySet > aPropertySet( - getConfigAccess("org.openoffice.Setup/Office"), UNO_QUERY_THROW); + uno::Reference< XPropertySet > aPropertySet( + getConfigAccess("org.openoffice.Setup/Office"), uno::UNO_QUERY_THROW); aPropertySet->getPropertyValue( OUString::createFromAscii("MigrationCompleted")) >>= bMigrationCompleted; } catch (Exception&) { @@ -223,19 +226,19 @@ migrations_vr MigrationImpl::readMigrationSteps() { // get supported version names - Reference< XNameAccess > aMigrationAccess(getConfigAccess("org.openoffice.Setup/Migration"), UNO_QUERY_THROW); - Sequence< OUString > seqVersions; + uno::Reference< XNameAccess > aMigrationAccess(getConfigAccess("org.openoffice.Setup/Migration"), uno::UNO_QUERY_THROW); + uno::Sequence< OUString > seqVersions; aMigrationAccess->getByName(OUString::createFromAscii("SupportedVersions")) >>= seqVersions; for (sal_Int32 i=0; i<seqVersions.getLength(); i++) m_vrVersions->push_back(seqVersions[i].trim()); - // get migration description from from org.openoffice.Setup/Migration + // get migration description from from org.openoffice.Setup/Migration // and build vector of migration steps - Reference< XNameAccess > theNameAccess(getConfigAccess("org.openoffice.Setup/Migration/MigrationSteps"), UNO_QUERY_THROW); - Sequence< OUString > seqMigrations = theNameAccess->getElementNames(); - Reference< XNameAccess > tmpAccess; - Reference< XNameAccess > tmpAccess2; - Sequence< OUString > tmpSeq; + uno::Reference< XNameAccess > theNameAccess(getConfigAccess("org.openoffice.Setup/Migration/MigrationSteps"), uno::UNO_QUERY_THROW); + uno::Sequence< OUString > seqMigrations = theNameAccess->getElementNames(); + uno::Reference< XNameAccess > tmpAccess; + uno::Reference< XNameAccess > tmpAccess2; + uno::Sequence< OUString > tmpSeq; migrations_vr vrMigrations(new migrations_v); for (sal_Int32 i = 0; i < seqMigrations.getLength(); i++) { @@ -289,57 +292,65 @@ migrations_vr MigrationImpl::readMigrationSteps() return vrMigrations; } +static FileBase::RC _checkAndCreateDirectory(INetURLObject& dirURL) +{ + FileBase::RC result = Directory::create(dirURL.GetMainURL(INetURLObject::DECODE_TO_IURI)); + if (result == FileBase::E_NOENT) + { + INetURLObject baseURL(dirURL); + baseURL.removeSegment(); + _checkAndCreateDirectory(baseURL); + return Directory::create(dirURL.GetMainURL(INetURLObject::DECODE_TO_IURI)); + } else + return result; +} + install_info MigrationImpl::findInstallation() { - OUString usVersion; + rtl::OUString aProductName; + uno::Any aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME ); + aRet >>= aProductName; + aProductName = aProductName.toAsciiLowerCase(); + install_info aInfo; - utl::Bootstrap::PathStatus aStatus; - aStatus = utl::Bootstrap::locateVersionFile(usVersion); - if (aStatus != utl::Bootstrap::PATH_EXISTS) + strings_v::const_iterator i_ver = m_vrVersions->begin(); + uno::Reference < util::XStringSubstitution > xSubst( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.util.PathSubstitution")), uno::UNO_QUERY ); + while (i_ver != m_vrVersions->end()) { - // aStatus = utl::Bootstrap::locateUserInstallation(usVersion); - // if (aStatus == utl::Bootstrap::PATH_EXISTS) - if (rtl::Bootstrap::get( - OUString::createFromAscii("SYSUSERCONFIG"), usVersion)) + ::rtl::OUString aVersion, aProfileName; + sal_Int32 nSeparatorIndex = (*i_ver).indexOf('='); + if ( nSeparatorIndex != -1 ) { - aStatus = utl::Bootstrap::PATH_EXISTS; -#ifdef UNX - usVersion += OUString::createFromAscii("/.sversionrc"); -#else - usVersion += OUString::createFromAscii("/sversion.ini"); -#endif + aVersion = (*i_ver).copy( 0, nSeparatorIndex ); + aProfileName = (*i_ver).copy( nSeparatorIndex+1 ); } - else - return aInfo; - } - Config aVersion(usVersion); - aVersion.SetGroup("Versions"); - - strings_v vInst; - ByteString sInst; - for (USHORT i=0; i<aVersion.GetKeyCount(); i++) { - sInst =aVersion.GetKeyName(i); - vInst.push_back(OUString(static_cast< OString >(sInst), sInst.Len(), RTL_TEXTENCODING_UTF8)); - } - - ByteString sInstall; - strings_v::const_iterator i_ins = vInst.begin(); - while (i_ins != vInst.end()) { - strings_v::const_iterator i_ver = m_vrVersions->begin(); - while (i_ver != m_vrVersions->end()) + if ( aVersion.getLength() && aProfileName.getLength() && + ( !aInfo.userdata.getLength() || !aProfileName.toAsciiLowerCase().compareTo( aProductName, aProductName.getLength() ) ) + ) { - // this will use the last valid version from the sversion file - // aInfo will be overwritten for each matching version identifier - if ( i_ins->indexOf(*i_ver) == 0) { - sInstall = aVersion.ReadKey(OUStringToOString(*i_ins, RTL_TEXTENCODING_UTF8)); - aInfo.productname = *i_ins; - aInfo.userdata = OUString(static_cast< OString >(sInstall), sInstall.Len(), RTL_TEXTENCODING_UTF8); + ::rtl::OUString aUserInst; + osl::Security().getConfigDir( aUserInst ); + if ( aUserInst.getLength() && aUserInst[ aUserInst.getLength()-1 ] != '/' ) + aUserInst += ::rtl::OUString::createFromAscii("/"); +#ifdef UNX + // tribute to whoever had the "great" idea to use different names on Windows and Unix + aUserInst += ::rtl::OUString::createFromAscii("."); +#endif + aUserInst += aProfileName; + try + { + INetURLObject aObj(aUserInst); + ::ucbhelper::Content aCnt( aObj.GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ucb::XCommandEnvironment > () ); + aCnt.isDocument(); + aInfo.userdata = aObj.GetMainURL( INetURLObject::NO_DECODE ); + aInfo.productname = aVersion; } - i_ver++; + catch( uno::Exception& ){} } - i_ins++; + i_ver++; } + return aInfo; } @@ -378,7 +389,7 @@ strings_vr MigrationImpl::getAllFiles(const OUString& baseURL) const // get sub dirs Directory dir(baseURL); if (dir.open() == FileBase::E_None) - { + { strings_v vSubDirs; strings_vr vrSubResult; @@ -426,7 +437,7 @@ strings_vr MigrationImpl::compileFileList() // get a file list result for each migration step migrations_v::const_iterator i_migr = m_vrMigrations->begin(); - while (i_migr != m_vrMigrations->end()) + while (i_migr != m_vrMigrations->end()) { vrInclude = applyPatterns(*vrFiles, i_migr->includeFiles); vrExclude = applyPatterns(*vrFiles, i_migr->excludeFiles); @@ -442,52 +453,52 @@ void MigrationImpl::copyConfig() { try { // 1. get a list of all components from hierachy browser - Reference< XJob > xBrowser(m_xFactory->createInstance( - OUString::createFromAscii("com.sun.star.configuration.backend.LocalHierarchyBrowser")), UNO_QUERY_THROW); + uno::Reference< XJob > xBrowser(m_xFactory->createInstance( + OUString::createFromAscii("com.sun.star.configuration.backend.LocalHierarchyBrowser")), uno::UNO_QUERY_THROW); - Sequence< NamedValue > seqArgs(2); + uno::Sequence< NamedValue > seqArgs(2); seqArgs[0] = NamedValue( OUString::createFromAscii("LayerDataUrl"), - makeAny(m_aInfo.userdata + OUString::createFromAscii("/user/registry"))); + uno::makeAny(m_aInfo.userdata + OUString::createFromAscii("/user/registry"))); seqArgs[1] = NamedValue( OUString::createFromAscii("FetchComponentNames"), - makeAny(sal_True)); + uno::makeAny(sal_True)); // execute the search - Any aResult = xBrowser->execute(seqArgs); - Sequence< OUString > seqComponents; + uno::Any aResult = xBrowser->execute(seqArgs); + uno::Sequence< OUString > seqComponents; aResult >>= seqComponents; OSL_ENSURE(seqComponents.getLength()>0, "MigrationImpl::copyConfig(): no config components available"); - - // 2. create an importer - Reference< XJob > xImporter(m_xFactory->createInstance( - OUString::createFromAscii("com.sun.star.configuration.backend.LocalDataImporter")), UNO_QUERY_THROW); + + // 2. create an importer + uno::Reference< XJob > xImporter(m_xFactory->createInstance( + OUString::createFromAscii("com.sun.star.configuration.backend.LocalDataImporter")), uno::UNO_QUERY_THROW); // 3. for each migration step... - Sequence< NamedValue > importerArgs(3); + uno::Sequence< NamedValue > importerArgs(3); importerArgs[0] = NamedValue( OUString::createFromAscii("LayerDataUrl"), - makeAny(m_aInfo.userdata + OUString::createFromAscii("/user/registry"))); + uno::makeAny(m_aInfo.userdata + OUString::createFromAscii("/user/registry"))); importerArgs[1] = NamedValue( OUString::createFromAscii("LayerFilter"), - Any()); + uno::Any()); importerArgs[2] = NamedValue( OUString::createFromAscii("Component"), - Any()); + uno::Any()); migrations_v::const_iterator i_mig = m_vrMigrations->begin(); while (i_mig != m_vrMigrations->end()) { - // a. create config filter for step - Reference< XInitialization > xFilter( + // a. create config filter for step + uno::Reference< XInitialization > xFilter( new CConfigFilter(&(i_mig->includeConfig), &(i_mig->excludeConfig))); - importerArgs[1].Value = makeAny(xFilter); + importerArgs[1].Value = uno::makeAny(xFilter); // b. run each importer with config filter for (sal_Int32 i=0; i<seqComponents.getLength(); i++) { OUString component = seqComponents[i]; - importerArgs[2].Value = makeAny(seqComponents[i]); + importerArgs[2].Value = uno::makeAny(seqComponents[i]); try { aResult = xImporter->execute(importerArgs); Exception myException; @@ -507,8 +518,8 @@ void MigrationImpl::copyConfig() { OString aMsg("Exception in config layer import.\nmessage: "); aMsg += OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US); - OSL_ENSURE(sal_False, aMsg.getStr()); - } + OSL_ENSURE(sal_False, aMsg.getStr()); + } } @@ -519,11 +530,11 @@ void MigrationImpl::substract(strings_v& va, const strings_v& vb_c) const strings_v vb(vb_c); // ensure uniqueness of entries sort(va.begin(), va.end()); - sort(vb.begin(), vb.end()); + sort(vb.begin(), vb.end()); unique(va.begin(), va.end()); - unique(vb.begin(), vb.end()); + unique(vb.begin(), vb.end()); - strings_v::const_iterator i_ex = vb.begin(); + strings_v::const_iterator i_ex = vb.begin(); strings_v::iterator i_in; strings_v::iterator i_next; while (i_ex != vb.end()) @@ -547,9 +558,9 @@ void MigrationImpl::substract(strings_v& va, const strings_v& vb_c) const } } -Reference< XNameAccess > MigrationImpl::getConfigAccess(const sal_Char* pPath, sal_Bool bUpdate) +uno::Reference< XNameAccess > MigrationImpl::getConfigAccess(const sal_Char* pPath, sal_Bool bUpdate) { - Reference< XNameAccess > xNameAccess; + uno::Reference< XNameAccess > xNameAccess; try{ OUString sConfigSrvc = OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider"); OUString sAccessSrvc; @@ -557,21 +568,21 @@ Reference< XNameAccess > MigrationImpl::getConfigAccess(const sal_Char* pPath, s sAccessSrvc = OUString::createFromAscii("com.sun.star.configuration.ConfigurationUpdateAccess"); else sAccessSrvc = OUString::createFromAscii("com.sun.star.configuration.ConfigurationAccess"); - - OUString sConfigURL = OUString::createFromAscii(pPath); + + OUString sConfigURL = OUString::createFromAscii(pPath); // get configuration provider - Reference< XMultiServiceFactory > theMSF = comphelper::getProcessServiceFactory(); - Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory > ( - theMSF->createInstance( sConfigSrvc ),UNO_QUERY_THROW ); + uno::Reference< XMultiServiceFactory > theMSF = comphelper::getProcessServiceFactory(); + uno::Reference< XMultiServiceFactory > theConfigProvider = uno::Reference< XMultiServiceFactory > ( + theMSF->createInstance( sConfigSrvc ),uno::UNO_QUERY_THROW ); // access the provider - Sequence< Any > theArgs(1); + uno::Sequence< uno::Any > theArgs(1); theArgs[ 0 ] <<= sConfigURL; - xNameAccess = Reference< XNameAccess > ( + xNameAccess = uno::Reference< XNameAccess > ( theConfigProvider->createInstanceWithArguments( - sAccessSrvc, theArgs ), UNO_QUERY_THROW ); - } catch (com::sun::star::uno::Exception& e) + sAccessSrvc, theArgs ), uno::UNO_QUERY_THROW ); + } catch (com::sun::star::uno::Exception& e) { OString aMsg = OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US); OSL_ENSURE(sal_False, aMsg.getStr()); @@ -579,19 +590,6 @@ Reference< XNameAccess > MigrationImpl::getConfigAccess(const sal_Char* pPath, s return xNameAccess; } -static FileBase::RC _checkAndCreateDirectory(INetURLObject& dirURL) -{ - FileBase::RC result = Directory::create(dirURL.GetMainURL(INetURLObject::DECODE_TO_IURI)); - if (result == FileBase::E_NOENT) - { - INetURLObject baseURL(dirURL); - baseURL.removeSegment(); - _checkAndCreateDirectory(baseURL); - return Directory::create(dirURL.GetMainURL(INetURLObject::DECODE_TO_IURI)); - } else - return result; -} - void MigrationImpl::copyFiles() { strings_v::const_iterator i_file = m_vrFileList->begin(); @@ -604,14 +602,14 @@ void MigrationImpl::copyFiles() { while (i_file != m_vrFileList->end()) { - + // remove installation prefix from file localName = i_file->copy(m_aInfo.userdata.getLength()); destName = userInstall + localName; INetURLObject aURL(destName); // check whether destination directory exists aURL.removeSegment(); - _checkAndCreateDirectory(aURL); + _checkAndCreateDirectory(aURL); FileBase::RC copyResult = File::copy(*i_file, destName); if (copyResult != FileBase::E_None) { @@ -622,7 +620,7 @@ void MigrationImpl::copyFiles() } i_file++; } - } + } else { OSL_ENSURE(sal_False, "copyFiles: UserInstall does not exist"); @@ -631,62 +629,62 @@ void MigrationImpl::copyFiles() void MigrationImpl::runServices() { - + //create stratum for old user layer OUString aOldLayerURL = m_aInfo.userdata; aOldLayerURL += OUString::createFromAscii("/user/registry"); OUString aStratumSvc = OUString::createFromAscii("com.sun.star.configuration.backend.LocalSingleStratum"); - Sequence< Any > stratumArgs(1); - stratumArgs[0] = makeAny(aOldLayerURL); - Reference< XSingleLayerStratum> xStartum( m_xFactory->createInstanceWithArguments( - aStratumSvc, stratumArgs), UNO_QUERY); + uno::Sequence< uno::Any > stratumArgs(1); + stratumArgs[0] = uno::makeAny(aOldLayerURL); + uno::Reference< XSingleLayerStratum> xStartum( m_xFactory->createInstanceWithArguments( + aStratumSvc, stratumArgs), uno::UNO_QUERY); // Build argument array - Sequence< Any > seqArguments(3); - seqArguments[0] = makeAny(NamedValue( + uno::Sequence< uno::Any > seqArguments(3); + seqArguments[0] = uno::makeAny(NamedValue( OUString::createFromAscii("Productname"), - makeAny(m_aInfo.productname))); - seqArguments[1] = makeAny(NamedValue( + uno::makeAny(m_aInfo.productname))); + seqArguments[1] = uno::makeAny(NamedValue( OUString::createFromAscii("UserData"), - makeAny(m_aInfo.userdata))); + uno::makeAny(m_aInfo.userdata))); // create an instance of every migration service // and execute the migration job - Reference< XJob > xMigrationJob; + uno::Reference< XJob > xMigrationJob; - migrations_v::const_iterator i_mig = m_vrMigrations->begin(); + migrations_v::const_iterator i_mig = m_vrMigrations->begin(); while (i_mig != m_vrMigrations->end()) { if( i_mig->service.getLength() > 0) { - + try { // create access to old configuration components in the user layer // that were requested by the migration service - Sequence< NamedValue > seqComponents(i_mig->configComponents.size()); + uno::Sequence< NamedValue > seqComponents(i_mig->configComponents.size()); strings_v::const_iterator i_comp = i_mig->configComponents.begin(); sal_Int32 i = 0; while (i_comp != i_mig->configComponents.end() && xStartum.is()) { // create Layer for i_comp seqComponents[i] = NamedValue( - *i_comp, makeAny(xStartum->getLayer(*i_comp, OUString()))); + *i_comp, uno::makeAny(xStartum->getLayer(*i_comp, OUString()))); // next component i_comp++; i++; } // set old config argument - seqArguments[2] = makeAny(NamedValue( + seqArguments[2] = uno::makeAny(NamedValue( OUString::createFromAscii("OldConfiguration"), - makeAny(seqComponents))); + uno::makeAny(seqComponents))); - xMigrationJob = Reference< XJob >(m_xFactory->createInstanceWithArguments( - i_mig->service, seqArguments), UNO_QUERY_THROW); + xMigrationJob = uno::Reference< XJob >(m_xFactory->createInstanceWithArguments( + i_mig->service, seqArguments), uno::UNO_QUERY_THROW); - xMigrationJob->execute(Sequence< NamedValue >()); + xMigrationJob->execute(uno::Sequence< NamedValue >()); } catch (Exception& e) @@ -698,7 +696,7 @@ void MigrationImpl::runServices() } catch (...) { OString aMsg("Execution of migration service failed (Exception caught).\nService: "); - aMsg += OUStringToOString(i_mig->service, RTL_TEXTENCODING_ASCII_US) + + aMsg += OUStringToOString(i_mig->service, RTL_TEXTENCODING_ASCII_US) + "\nNo message available"; OSL_ENSURE(sal_False, aMsg.getStr()); } @@ -713,7 +711,7 @@ strings_vr MigrationImpl::compileServiceList() { strings_vr vrResult(new strings_v); migrations_v::const_iterator i_migr = m_vrMigrations->begin(); - while (i_migr != m_vrMigrations->end()) + while (i_migr != m_vrMigrations->end()) { vrResult->push_back(i_migr->service); i_migr++; |