summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Lingner <jl@openoffice.org>2010-04-21 16:04:34 +0200
committerJoachim Lingner <jl@openoffice.org>2010-04-21 16:04:34 +0200
commitc2d9d80b487dd0d7353b22eee44bee3b84fc7838 (patch)
tree6377659aba194b2b571b838aac5aa834ffe8843c
parente1703d7ac3e485fb7b94787ecdf04a7910bb20c5 (diff)
jl152 import 263449 from native0jl:#i77196# no registration of components in uno.exe at startup, fixed extension activation, basic, etc.
-rw-r--r--basic/source/inc/namecont.hxx11
-rw-r--r--basic/source/uno/namecont.cxx90
-rw-r--r--desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx2
-rw-r--r--desktop/source/deployment/manager/dp_extensionmanager.cxx207
-rw-r--r--desktop/source/deployment/manager/dp_extensionmanager.hxx21
-rw-r--r--desktop/source/deployment/manager/dp_manager.hrc2
-rw-r--r--desktop/source/deployment/manager/dp_manager.src4
-rw-r--r--desktop/source/deployment/registry/component/dp_component.cxx39
-rw-r--r--desktop/source/deployment/registry/configuration/dp_configuration.cxx2
-rw-r--r--desktop/source/deployment/registry/dp_backend.cxx7
-rw-r--r--desktop/source/deployment/registry/executable/dp_executable.cxx2
-rw-r--r--desktop/source/deployment/registry/help/dp_help.cxx2
-rw-r--r--desktop/source/deployment/registry/inc/dp_backend.h3
-rw-r--r--desktop/source/deployment/registry/package/dp_package.cxx4
-rw-r--r--desktop/source/deployment/registry/script/dp_script.cxx2
-rw-r--r--desktop/source/deployment/registry/sfwk/dp_sfwk.cxx2
-rwxr-xr-xdesktop/source/migration/services/extensionmigration.cxx6
-rwxr-xr-xdesktop/source/migration/services/oo3extensionmigration.cxx2
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_app.cxx7
-rw-r--r--svx/source/smarttags/SmartTagMgr.cxx11
20 files changed, 253 insertions, 173 deletions
diff --git a/basic/source/inc/namecont.hxx b/basic/source/inc/namecont.hxx
index 1f7e77170d44..2d24759d9b83 100644
--- a/basic/source/inc/namecont.hxx
+++ b/basic/source/inc/namecont.hxx
@@ -689,6 +689,7 @@ enum IteratorState
{
USER_EXTENSIONS,
SHARED_EXTENSIONS,
+ BUNDLED_EXTENSIONS,
END_REACHED
};
@@ -708,6 +709,8 @@ protected:
implGetNextUserScriptPackage( bool& rbPureDialogLib );
com::sun::star::uno::Reference< com::sun::star::deployment::XPackage >
implGetNextSharedScriptPackage( bool& rbPureDialogLib );
+ com::sun::star::uno::Reference< com::sun::star::deployment::XPackage >
+ implGetNextBundledScriptPackage( bool& rbPureDialogLib );
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > m_xContext;
@@ -721,8 +724,16 @@ protected:
< com::sun::star::deployment::XPackage > > m_aSharedPackagesSeq;
bool m_bSharedPackagesLoaded;
+ com::sun::star::uno::Sequence< com::sun::star::uno::Reference
+ < com::sun::star::deployment::XPackage > > m_aBundledPackagesSeq;
+ bool m_bBundledPackagesLoaded;
+
+
int m_iUserPackage;
int m_iSharedPackage;
+ int m_iBundledPackage;
+
+
ScriptSubPackageIterator* m_pScriptSubPackageIterator;
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 14c84420dad6..7a6a771f85cc 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -65,7 +65,7 @@
#include <com/sun/star/uno/DeploymentException.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/script/LibraryNotLoadedException.hpp>
-#include "com/sun/star/deployment/thePackageManagerFactory.hpp"
+#include "com/sun/star/deployment/ExtensionManager.hpp"
#include <comphelper/storagehelper.hxx>
#ifndef _RTL_USTRING_HXX_
#include <comphelper/anytostring.hxx>
@@ -1080,6 +1080,7 @@ sal_Bool SfxLibraryContainer::init_Impl(
OUString aUserSearchStr = OUString::createFromAscii( "vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE" );
OUString aSharedSearchStr = OUString::createFromAscii( "vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE" );
+ OUString aBundledSearchStr = OUString::createFromAscii( "vnd.sun.star.expand:$BUNDLED_EXTENSIONS" );
OUString aInstSearchStr = OUString::createFromAscii( "$(INST)" );
Sequence< OUString > aNames = pPrevCont->getElementNames();
@@ -1111,6 +1112,7 @@ sal_Bool SfxLibraryContainer::init_Impl(
bool bCreateLink = true;
if( aStorageURL.indexOf( aUserSearchStr ) != -1 ||
aStorageURL.indexOf( aSharedSearchStr ) != -1 ||
+ aStorageURL.indexOf( aBundledSearchStr ) != -1 ||
aStorageURL.indexOf( aInstSearchStr ) != -1 )
{
bCreateLink = false;
@@ -2182,11 +2184,12 @@ Reference< XNameAccess > SAL_CALL SfxLibraryContainer::createLibraryLink
OUString aUserSearchStr = OUString::createFromAscii( "vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE" );
OUString aSharedSearchStr = OUString::createFromAscii( "vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE" );
+ OUString aBundledSearchStr = OUString::createFromAscii( "vnd.sun.star.expand:$BUNDLED_EXTENSIONS" );
if( StorageURL.indexOf( aUserSearchStr ) != -1 )
{
pNewLib->mbExtension = sal_True;
}
- else if( StorageURL.indexOf( aSharedSearchStr ) != -1 )
+ else if( StorageURL.indexOf( aSharedSearchStr ) != -1 || StorageURL.indexOf( aBundledSearchStr ) != -1 )
{
pNewLib->mbExtension = sal_True;
pNewLib->mbReadOnly = sal_True;
@@ -3075,8 +3078,10 @@ ScriptExtensionIterator::ScriptExtensionIterator( void )
: m_eState( USER_EXTENSIONS )
, m_bUserPackagesLoaded( false )
, m_bSharedPackagesLoaded( false )
+ , m_bBundledPackagesLoaded( false )
, m_iUserPackage( 0 )
, m_iSharedPackage( 0 )
+ , m_iBundledPackage( 0 )
, m_pScriptSubPackageIterator( NULL )
{
Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
@@ -3125,6 +3130,16 @@ rtl::OUString ScriptExtensionIterator::nextBasicOrDialogLibrary( bool& rbPureDia
aRetLib = xScriptPackage->getURL();
break;
}
+ case BUNDLED_EXTENSIONS:
+ {
+ Reference< deployment::XPackage > xScriptPackage =
+ implGetNextBundledScriptPackage( rbPureDialogLib );
+ if( !xScriptPackage.is() )
+ break;
+
+ aRetLib = xScriptPackage->getURL();
+ break;
+ }
case END_REACHED:
VOS_ENSURE( false, "ScriptExtensionIterator::nextBasicOrDialogLibrary(): Invalid case END_REACHED" );
break;
@@ -3295,10 +3310,11 @@ Reference< deployment::XPackage > ScriptExtensionIterator::implGetNextUserScript
{
try
{
- Reference< XPackageManager > xUserManager =
- thePackageManagerFactory::get( m_xContext )->getPackageManager( rtl::OUString::createFromAscii("user") );
- m_aUserPackagesSeq = xUserManager->getDeployedPackages
- ( Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
+ Reference< XExtensionManager > xManager =
+ ExtensionManager::get( m_xContext );
+ m_aUserPackagesSeq = xManager->getDeployedExtensions
+ (rtl::OUString::createFromAscii("user"),
+ Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
}
catch( com::sun::star::uno::DeploymentException& )
{
@@ -3348,10 +3364,11 @@ Reference< deployment::XPackage > ScriptExtensionIterator::implGetNextSharedScri
{
try
{
- Reference< XPackageManager > xSharedManager =
- thePackageManagerFactory::get( m_xContext )->getPackageManager( rtl::OUString::createFromAscii("shared") );
- m_aSharedPackagesSeq = xSharedManager->getDeployedPackages
- ( Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
+ Reference< XExtensionManager > xSharedManager =
+ ExtensionManager::get( m_xContext );
+ m_aSharedPackagesSeq = xSharedManager->getDeployedExtensions
+ (rtl::OUString::createFromAscii("shared"),
+ Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
}
catch( com::sun::star::uno::DeploymentException& )
{
@@ -3391,4 +3408,57 @@ Reference< deployment::XPackage > ScriptExtensionIterator::implGetNextSharedScri
return xScriptPackage;
}
+Reference< deployment::XPackage > ScriptExtensionIterator::implGetNextBundledScriptPackage
+ ( bool& rbPureDialogLib )
+{
+ Reference< deployment::XPackage > xScriptPackage;
+
+ if( !m_bBundledPackagesLoaded )
+ {
+ try
+ {
+ Reference< XExtensionManager > xManager =
+ ExtensionManager::get( m_xContext );
+ m_aBundledPackagesSeq = xManager->getDeployedExtensions
+ (rtl::OUString::createFromAscii("bundled"),
+ Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
+ }
+ catch( com::sun::star::uno::DeploymentException& )
+ {
+ // Special Office installations may not contain deployment code
+ return xScriptPackage;
+ }
+
+ m_bBundledPackagesLoaded = true;
+ }
+
+ if( m_iBundledPackage == m_aBundledPackagesSeq.getLength() )
+ {
+ m_eState = END_REACHED;
+ }
+ else
+ {
+ if( m_pScriptSubPackageIterator == NULL )
+ {
+ const Reference< deployment::XPackage >* pBundledPackages = m_aBundledPackagesSeq.getConstArray();
+ Reference< deployment::XPackage > xPackage = pBundledPackages[ m_iBundledPackage ];
+ VOS_ENSURE( xPackage.is(), "ScriptExtensionIterator::implGetNextBundledScriptPackage(): Invalid package" );
+ m_pScriptSubPackageIterator = new ScriptSubPackageIterator( xPackage );
+ }
+
+ if( m_pScriptSubPackageIterator != NULL )
+ {
+ xScriptPackage = m_pScriptSubPackageIterator->getNextScriptSubPackage( rbPureDialogLib );
+ if( !xScriptPackage.is() )
+ {
+ delete m_pScriptSubPackageIterator;
+ m_pScriptSubPackageIterator = NULL;
+ m_iBundledPackage++;
+ }
+ }
+ }
+
+ return xScriptPackage;
+}
+
} // namespace basic
diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
index 4b55a93d3f84..647c46b754c8 100644
--- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
@@ -1048,7 +1048,7 @@ void ExtensionCmdQueue::Thread::_enableExtension( ::rtl::Reference< ProgressCmdE
try
{
- xPackage->registerPackage( xAbortChannel, rCmdEnv.get() );
+ xPackage->registerPackage(false, xAbortChannel, rCmdEnv.get() );
if ( m_pDialogHelper )
m_pDialogHelper->updatePackageInfo( xPackage );
}
diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx
index c4581556749f..bbe476e57fba 100644
--- a/desktop/source/deployment/manager/dp_extensionmanager.cxx
+++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx
@@ -260,48 +260,38 @@ void ExtensionManager::addExtensionsToMap(
}
-/*
-*/
-Reference<deploy::XPackage> ExtensionManager::getExtensionAndStatus(
- ::rtl::OUString const & identifier,
- ::rtl::OUString const & fileName,
- ::rtl::OUString const & repository,
- Reference<task::XAbortChannel> const & xAbortChannel,
- Reference<ucb::XCommandEnvironment> const & xCmdEnv,
- bool & out_bWasRegistered)
+bool ExtensionManager::isUserDisabled(
+ OUString const & identifier, OUString const & fileName)
{
- Reference<deploy::XPackage> theExtension;
::std::list<Reference<deploy::XPackage> > listExtensions =
- getExtensionsWithSameId(identifier, fileName);
- OSL_ASSERT(listExtensions.size() == m_repositoryNames.size());
- Reference<deploy::XPackage> xActiveExtension;
- ::std::list<OUString>::const_iterator
- inames = m_repositoryNames.begin();
- ::std::list<Reference<deploy::XPackage> >::const_iterator
- iext = listExtensions.begin();
- for (; inames != m_repositoryNames.end(); inames++, iext++)
+ getExtensionsWithSameId(identifier, fileName);
+ OSL_ASSERT(listExtensions.size() == 3);
+
+ return isUserDisabled( ::comphelper::containerToSequence<
+ Reference<deploy::XPackage>,
+ ::std::list<Reference<deploy::XPackage> >
+ > (listExtensions));
+}
+
+bool ExtensionManager::isUserDisabled(
+ uno::Sequence<Reference<deploy::XPackage> > const & seqExtSameId)
+{
+ OSL_ASSERT(seqExtSameId.getLength() == 3);
+ Reference<deploy::XPackage> const & userExtension = seqExtSameId[0];
+ if (userExtension.is())
{
- if (repository.equals(*inames))
- {
- theExtension = *iext;
- if (iext->is())
- {
- beans::Optional<beans::Ambiguous<sal_Bool> > optRegistered =
- (*iext)->isRegistered(xAbortChannel, xCmdEnv);
- OSL_ENSURE(! optRegistered.Value.IsAmbiguous,
- "Extension is not properly registered");
- //IsAmbiguous = true: only partly registered, but we assume
- //that this is the active extension, and something went wrong when registering it
- //previously.
- if (optRegistered.IsPresent
- && (optRegistered.Value.Value || optRegistered.Value.IsAmbiguous))
- out_bWasRegistered = true;
- }
- break;
- }
+ beans::Optional<beans::Ambiguous<sal_Bool> > reg =
+ userExtension->isRegistered(Reference<task::XAbortChannel>(),
+ Reference<ucb::XCommandEnvironment>());
+ //If the value is ambiguous is than we assume that the extension
+ //is enabled, but something went wrong during enabling. We do not
+ //automatically disable user extensions.
+ if (reg.IsPresent &&
+ ! reg.Value.IsAmbiguous && ! reg.Value.Value)
+ return true;
}
- return theExtension;
+ return false;
}
/*
@@ -321,6 +311,8 @@ Reference<deploy::XPackage> ExtensionManager::getExtensionAndStatus(
*/
void ExtensionManager::activateExtension(
OUString const & identifier, OUString const & fileName,
+ bool bUserDisabled,
+ bool bStartup,
Reference<task::XAbortChannel> const & xAbortChannel,
Reference<ucb::XCommandEnvironment> const & xCmdEnv )
{
@@ -333,11 +325,13 @@ void ExtensionManager::activateExtension(
Reference<deploy::XPackage>,
::std::list<Reference<deploy::XPackage> >
> (listExtensions),
- xAbortChannel, xCmdEnv);
+ bUserDisabled, bStartup, xAbortChannel, xCmdEnv);
}
void ExtensionManager::activateExtension(
uno::Sequence<Reference<deploy::XPackage> > const & seqExt,
+ bool bUserDisabled,
+ bool bStartup,
Reference<task::XAbortChannel> const & xAbortChannel,
Reference<ucb::XCommandEnvironment> const & xCmdEnv )
{
@@ -355,9 +349,12 @@ void ExtensionManager::activateExtension(
if (!optReg.IsPresent)
break;
- //Check if this is a disabled user extension, if so then skip
- if (!optReg.Value.Value && i == 0) //e.g. not registered
- continue;
+ //Check if this is a disabled user extension,
+ if (i == 0 && bUserDisabled)
+ {
+ aExt->revokePackage(xAbortChannel, xCmdEnv);
+ continue;
+ }
//If we have already determined an active extension then we must
//make sure to unregister all extensions with the same id in
@@ -374,7 +371,7 @@ void ExtensionManager::activateExtension(
//Register if not already done.
//reregister if the value is ambiguous, which indicates that
//something went wrong during last registration.
- aExt->registerPackage(xAbortChannel, xCmdEnv);
+ aExt->registerPackage(bStartup, xAbortChannel, xCmdEnv);
}
}
}
@@ -455,17 +452,18 @@ Reference<deploy::XPackage> ExtensionManager::addExtension(
uno::Any excOccurred1;
uno::Any excOccurred2;
-
+ bool bUserDisabled = false;
try
{
- //If we add a user extension and there is already one which was
- //disabled by a user, then the newly installed one is enabled. If we
- //add to another repository then the user extension remains
- //disabled.
- bool bWasRegistered = false;
- xOldExtension = getExtensionAndStatus(
- sIdentifier, sFileName, repository, xAbortChannel,
- xCmdEnv, bWasRegistered);
+ bUserDisabled = isUserDisabled(sIdentifier, sFileName);
+ try
+ {
+ xOldExtension = xPackageManager->getDeployedPackage(
+ sIdentifier, sFileName, xCmdEnv);
+ }
+ catch (lang::IllegalArgumentException &)
+ {
+ }
bool bCanInstall = false;
try
{
@@ -514,8 +512,7 @@ Reference<deploy::XPackage> ExtensionManager::addExtension(
{
if (xOldExtension.is())
{
- if (bWasRegistered)
- xOldExtension->revokePackage(xAbortChannel, xCmdEnv);
+ xOldExtension->revokePackage(xAbortChannel, xCmdEnv);
//save the old user extension in case the user aborts
//store the extension in the tmp repository, this will overwrite
//xTmpPackage (same identifier). Do not let the user abort or
@@ -532,9 +529,17 @@ Reference<deploy::XPackage> ExtensionManager::addExtension(
xNewExtension = xPackageManager->addPackage(
url, properties, OUString(), xAbortChannel, xCmdEnv);
+
+ //If we add a user extension and there is already one which was
+ //disabled by a user, then the newly installed one is enabled. If we
+ //add to another repository then the user extension remains
+ //disabled.
+ bool bUserDisabled2 = bUserDisabled;
+ if (repository.equals(OUSTR("user")))
+ bUserDisabled2 = false;
activateExtension(
dp_misc::getIdentifier(xNewExtension),
- xNewExtension->getName(), xAbortChannel, xCmdEnv);
+ xNewExtension->getName(), bUserDisabled2, false, xAbortChannel, xCmdEnv);
fireModified();
}
}
@@ -575,7 +580,7 @@ Reference<deploy::XPackage> ExtensionManager::addExtension(
tmpCmdEnv);
}
activateExtension(
- sIdentifier, sFileName,
+ sIdentifier, sFileName, bUserDisabled, false,
Reference<task::XAbortChannel>(), tmpCmdEnv);
if (xTmpExtension.is() || xExtensionBackup.is())
m_tmpRepository->removePackage(
@@ -611,7 +616,8 @@ void ExtensionManager::removeExtension(
uno::Any excOccurred1;
Reference<deploy::XPackage> xExtensionBackup;
Reference<deploy::XPackageManager> xPackageManager;
-
+ bool bUserDisabled = false;
+ ::osl::MutexGuard guard(getMutex());
try
{
//Determine the repository to use
@@ -624,7 +630,7 @@ void ExtensionManager::removeExtension(
OUSTR("No valid repository name provided."),
static_cast<cppu::OWeakObject*>(this), 0);
- ::osl::MutexGuard guard(getMutex());
+ bUserDisabled = isUserDisabled(identifier, fileName);
//Backup the extension, in case the user cancels the action
xExtensionBackup = backupExtension(
identifier, fileName, xPackageManager, xCmdEnv);
@@ -637,7 +643,8 @@ void ExtensionManager::removeExtension(
xPackageManager->removePackage(
identifier, fileName, xAbortChannel, xCmdEnv);
- activateExtension(identifier, fileName, xAbortChannel, xCmdEnv);
+ activateExtension(identifier, fileName, bUserDisabled, false,
+ xAbortChannel, xCmdEnv);
fireModified();
}
catch (deploy::DeploymentException& ) {
@@ -673,7 +680,8 @@ void ExtensionManager::removeExtension(
xExtensionBackup, Reference<task::XAbortChannel>(),
tmpCmdEnv);
activateExtension(
- identifier, fileName, Reference<task::XAbortChannel>(),
+ identifier, fileName, bUserDisabled, false,
+ Reference<task::XAbortChannel>(),
tmpCmdEnv);
m_tmpRepository->removePackage(
@@ -705,49 +713,24 @@ void ExtensionManager::enableExtension(
lang::IllegalArgumentException,
uno::RuntimeException)
{
+ ::osl::MutexGuard guard(getMutex());
+ bool bUserDisabled = false;
+ uno::Any excOccurred;
try
{
if (!extension.is())
return;
-
OUString repository = extension->getRepositoryName();
if (!repository.equals(OUSTR("user")))
throw lang::IllegalArgumentException(
OUSTR("No valid repository name provided."),
static_cast<cppu::OWeakObject*>(this), 0);
- ::osl::MutexGuard guard(getMutex());
- //if it is already registered or if it cannot be registered
- //because it does not contain any files which need to be processed
- //then there is nothing to do here
- beans::Optional<beans::Ambiguous<sal_Bool> > reg =
- extension->isRegistered(xAbortChannel, xCmdEnv);
- if (!reg.IsPresent
- || (!reg.Value.IsAmbiguous && reg.Value.Value))
- return;
- }
- catch (deploy::DeploymentException& ) {
- throw;
- } catch (ucb::CommandFailedException & ) {
- throw;
- } catch (ucb::CommandAbortedException & ) {
- throw;
- } catch (lang::IllegalArgumentException &) {
- throw;
- } catch (uno::RuntimeException &) {
- throw;
- } catch (...) {
- uno::Any exc = ::cppu::getCaughtException();
- throw deploy::DeploymentException(
- OUSTR("Extension Manager: exception during enableExtension"),
- static_cast<OWeakObject*>(this), exc);
- }
+ bUserDisabled = isUserDisabled(dp_misc::getIdentifier(extension),
+ extension->getName());
- uno::Any excOccurred;
- try
- {
activateExtension(dp_misc::getIdentifier(extension),
- extension->getName(),
+ extension->getName(), false, false,
xAbortChannel, xCmdEnv);
}
catch (deploy::DeploymentException& ) {
@@ -772,9 +755,8 @@ void ExtensionManager::enableExtension(
{
try
{
- extension->revokePackage(Reference<task::XAbortChannel>(), xCmdEnv);
activateExtension(dp_misc::getIdentifier(extension),
- extension->getName(),
+ extension->getName(), bUserDisabled, false,
xAbortChannel, xCmdEnv);
}
catch (...)
@@ -810,8 +792,10 @@ long ExtensionManager::checkPrerequisitesAndEnable(
//There are some unfulfilled prerequisites, try to revoke
extension->revokePackage(xAbortChannel, xCmdEnv);
}
- activateExtension(dp_misc::getIdentifier(extension),
- extension->getName(), xAbortChannel, xCmdEnv);
+ const OUString id(dp_misc::getIdentifier(extension));
+ activateExtension(id, extension->getName(),
+ isUserDisabled(id, extension->getName()), false,
+ xAbortChannel, xCmdEnv);
return ret;
}
catch (deploy::DeploymentException& ) {
@@ -844,31 +828,23 @@ void ExtensionManager::disableExtension(
lang::IllegalArgumentException,
uno::RuntimeException)
{
+ ::osl::MutexGuard guard(getMutex());
uno::Any excOccurred;
+ bool bUserDisabled = false;
try
{
if (!extension.is())
return;
-
- ::osl::MutexGuard guard(getMutex());
- OUString repository = extension->getRepositoryName();
+ const OUString repository( extension->getRepositoryName());
if (!repository.equals(OUSTR("user")))
throw lang::IllegalArgumentException(
OUSTR("No valid repository name provided."),
static_cast<cppu::OWeakObject*>(this), 0);
- //if it is already registered or if it cannot be registered
- //because it does not contain any files which need to be processed
- //then there is nothing to do here
- beans::Optional<beans::Ambiguous<sal_Bool> > reg =
- extension->isRegistered(xAbortChannel, xCmdEnv);
- if (!reg.IsPresent
- || (!reg.Value.IsAmbiguous && !reg.Value.Value))
- return;
+ const OUString id(dp_misc::getIdentifier(extension));
+ bUserDisabled = isUserDisabled(id, extension->getName());
- extension->revokePackage(xAbortChannel, xCmdEnv);
- activateExtension(dp_misc::getIdentifier(extension),
- extension->getName(),
+ activateExtension(id, extension->getName(), true, false,
xAbortChannel, xCmdEnv);
}
catch (deploy::DeploymentException& ) {
@@ -894,7 +870,7 @@ void ExtensionManager::disableExtension(
try
{
activateExtension(dp_misc::getIdentifier(extension),
- extension->getName(),
+ extension->getName(), bUserDisabled, false,
xAbortChannel, xCmdEnv);
}
catch (...)
@@ -1021,7 +997,7 @@ void ExtensionManager::reinstallDeployedExtensions(
const OUString id = dp_misc::getIdentifier(extensions[ pos ]);
const OUString fileName = extensions[ pos ]->getName();
OSL_ASSERT(id.getLength());
- activateExtension(id, fileName, xAbortChannel, xCmdEnv );
+ activateExtension(id, fileName, false, false, xAbortChannel, xCmdEnv );
}
catch (lang::DisposedException &)
{
@@ -1083,12 +1059,11 @@ void ExtensionManager::synchronize(
static_cast<cppu::OWeakObject*>(this), 0);
::osl::MutexGuard guard(getMutex());
+ String sSynchronizing(StrSyncRepository::get());
+ sSynchronizing.SearchAndReplaceAllAscii( "%NAME", repository );
+ dp_misc::ProgressLevel progress(xCmdEnv, sSynchronizing);
- dp_misc::ProgressLevel progress(
- xCmdEnv, OUSTR("Synchronizing ") + repository + OUSTR(" repository\n"));
xPackageManager->synchronize(xAbortChannel, xCmdEnv);
-
-
try
{
const uno::Sequence<uno::Sequence<Reference<deploy::XPackage> > >
@@ -1097,8 +1072,8 @@ void ExtensionManager::synchronize(
{
uno::Sequence<Reference<deploy::XPackage> > const & seqExt =
seqSeqExt[i];
-
- activateExtension(seqExt, xAbortChannel, xCmdEnv);
+ activateExtension(seqExt, isUserDisabled(seqExt), true,
+ xAbortChannel, xCmdEnv);
}
}
catch (...)
diff --git a/desktop/source/deployment/manager/dp_extensionmanager.hxx b/desktop/source/deployment/manager/dp_extensionmanager.hxx
index b11a2c64f546..10bf3713c410 100644
--- a/desktop/source/deployment/manager/dp_extensionmanager.hxx
+++ b/desktop/source/deployment/manager/dp_extensionmanager.hxx
@@ -204,6 +204,9 @@ public:
private:
+ struct StrSyncRepository : public ::dp_misc::StaticResourceString<
+ StrSyncRepository, RID_STR_SYNCHRONIZING_REPOSITORY> {};
+
struct ExtensionInfos
{
::rtl::OUString identifier;
@@ -225,24 +228,24 @@ private:
*/
::std::list< ::rtl::OUString > m_repositoryNames;
- css::uno::Reference<css::deployment::XPackage> getExtensionAndStatus(
- ::rtl::OUString const & identifier,
- ::rtl::OUString const & fileName,
- ::rtl::OUString const & repository,
- css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
- css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv,
- bool & out_bWasRegistered);
+ bool isUserDisabled(::rtl::OUString const & identifier,
+ ::rtl::OUString const & filename);
+
+ bool ExtensionManager::isUserDisabled(
+ css::uno::Sequence<css::uno::Reference<css::deployment::XPackage> > const & seqExtSameId);
void activateExtension(
::rtl::OUString const & identifier,
::rtl::OUString const & fileName,
+ bool bUserDisabled, bool bStartup,
css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv);
void activateExtension(
css::uno::Sequence<css::uno::Reference<css::deployment::XPackage> > const & seqExt,
- css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
- css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv );
+ bool bUserDisabled, bool bStartup,
+ css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
+ css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv );
::std::list<css::uno::Reference<css::deployment::XPackage> >
diff --git a/desktop/source/deployment/manager/dp_manager.hrc b/desktop/source/deployment/manager/dp_manager.hrc
index bdbfc079cda6..6131cc381abf 100644
--- a/desktop/source/deployment/manager/dp_manager.hrc
+++ b/desktop/source/deployment/manager/dp_manager.hrc
@@ -35,5 +35,5 @@
#define RID_STR_PACKAGE_ALREADY_ADDED (RID_DEPLOYMENT_MANAGER_START+2)
#define RID_STR_COPYING_PACKAGE (RID_DEPLOYMENT_MANAGER_START+3)
#define RID_STR_NO_SUCH_PACKAGE (RID_DEPLOYMENT_MANAGER_START+4)
-
+#define RID_STR_SYNCHRONIZING_REPOSITORY (RID_DEPLOYMENT_MANAGER_START+5)
#endif
diff --git a/desktop/source/deployment/manager/dp_manager.src b/desktop/source/deployment/manager/dp_manager.src
index 95ede4aa6227..7d38b880c37a 100644
--- a/desktop/source/deployment/manager/dp_manager.src
+++ b/desktop/source/deployment/manager/dp_manager.src
@@ -53,3 +53,7 @@ String RID_STR_NO_SUCH_PACKAGE
Text [ en-US ] = "There is no such extension deployed: ";
};
+String RID_STR_SYNCHRONIZING_REPOSITORY
+{
+ Text [ en-US ] = "Synchronizing repository for %NAME extensions";
+};
diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx
index 17444eb0828e..b3b8a8249994 100644
--- a/desktop/source/deployment/registry/component/dp_component.cxx
+++ b/desktop/source/deployment/registry/component/dp_component.cxx
@@ -122,7 +122,6 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
BackendImpl * getMyBackend() const;
const OUString m_loader;
- Reference<XComponentContext> m_xRemoteContext;
ComponentBackendDb::Data m_registeredComponentsDb;
enum reg {
@@ -143,6 +142,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
virtual void processPackage_(
::osl::ResettableMutexGuard & guard,
bool registerPackage,
+ bool startup,
::rtl::Reference<AbortChannel> const & abortChannel,
Reference<XCommandEnvironment> const & xCmdEnv );
@@ -179,6 +179,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
virtual void processPackage_(
::osl::ResettableMutexGuard & guard,
bool registerPackage,
+ bool startup,
::rtl::Reference<AbortChannel> const & abortChannel,
Reference<XCommandEnvironment> const & xCmdEnv );
@@ -356,7 +357,7 @@ BackendImpl * BackendImpl::ComponentPackageImpl::getMyBackend() const
//______________________________________________________________________________
void BackendImpl::ComponentPackageImpl::disposing()
{
- m_xRemoteContext.clear();
+// m_xRemoteContext.clear();
Package::disposing();
}
@@ -1224,6 +1225,7 @@ BackendImpl::ComponentPackageImpl::isRegistered_(
void BackendImpl::ComponentPackageImpl::processPackage_(
::osl::ResettableMutexGuard &,
bool doRegisterPackage,
+ bool startup,
::rtl::Reference<AbortChannel> const & abortChannel,
Reference<XCommandEnvironment> const & xCmdEnv )
{
@@ -1244,11 +1246,14 @@ void BackendImpl::ComponentPackageImpl::processPackage_(
data.javaTypeLibrary = isJavaTypelib;
if (doRegisterPackage)
{
- if (! m_xRemoteContext.is()) {
- m_xRemoteContext.set(
+ Reference <uno::XComponentContext> context(that->getComponentContext());
+ if (! startup)
+ {
+ context.set(
that->getObject( url ), UNO_QUERY );
- if (! m_xRemoteContext.is()) {
- m_xRemoteContext.set(
+
+ if (! context.is()) {
+ context.set(
that->insertObject( url, raise_uno_process(
that->getComponentContext(),
abortChannel ) ),
@@ -1258,9 +1263,9 @@ void BackendImpl::ComponentPackageImpl::processPackage_(
const Reference<registry::XSimpleRegistry> xServicesRDB( getRDB() );
const Reference<registry::XImplementationRegistration> xImplReg(
- m_xRemoteContext->getServiceManager()->createInstanceWithContext(
+ context->getServiceManager()->createInstanceWithContext(
OUSTR("com.sun.star.registry.ImplementationRegistration"),
- m_xRemoteContext ), UNO_QUERY_THROW );
+ context ), UNO_QUERY_THROW );
xImplReg->registerImplementation( m_loader, url, xServicesRDB );
//only write to unorc if registration was successful.
@@ -1274,7 +1279,7 @@ void BackendImpl::ComponentPackageImpl::processPackage_(
t_stringlist implNames;
t_stringpairvec singletons;
const Reference<loader::XImplementationLoader> xLoader(
- getComponentInfo( &implNames, &singletons, m_xRemoteContext ) );
+ getComponentInfo( &implNames, &singletons, context ) );
data.implementationNames = implNames;
data.singletons = singletons;
@@ -1348,11 +1353,14 @@ void BackendImpl::ComponentPackageImpl::processPackage_(
// set to VOID during revocation process:
m_registered = REG_VOID;
- Reference<XComponentContext> xContext;
- if (m_xRemoteContext.is()) // has been activated in this process
- xContext = m_xRemoteContext;
- else // has been deployed in former times
+ //get the remote context. If it does not exist then use the local one
+ Reference<XComponentContext> xContext(
+ that->getObject( url ), UNO_QUERY );
+ bool bRemoteContext = false;
+ if (!xContext.is())
xContext = that->getComponentContext();
+ else
+ bRemoteContext = true;
t_stringlist implNames;
t_stringpairvec singletons;
@@ -1427,10 +1435,8 @@ void BackendImpl::ComponentPackageImpl::processPackage_(
if (isJavaTypelib)
that->removeFromUnoRc( java, url, xCmdEnv );
- if (m_xRemoteContext.is()) {
+ if (bRemoteContext)
that->releaseObject( url );
- m_xRemoteContext.clear();
- }
m_registered = REG_NOT_REGISTERED;
getMyBackend()->deleteDataFromDb(url);
@@ -1483,6 +1489,7 @@ BackendImpl::TypelibraryPackageImpl::isRegistered_(
void BackendImpl::TypelibraryPackageImpl::processPackage_(
::osl::ResettableMutexGuard &,
bool doRegisterPackage,
+ bool startup,
::rtl::Reference<AbortChannel> const &,
Reference<XCommandEnvironment> const & xCmdEnv )
{
diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
index fefa6794342a..941b9a35d7f5 100644
--- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx
+++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
@@ -86,6 +86,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
virtual void processPackage_(
::osl::ResettableMutexGuard & guard,
bool registerPackage,
+ bool startup,
::rtl::Reference<AbortChannel> const & abortChannel,
Reference<XCommandEnvironment> const & xCmdEnv );
@@ -644,6 +645,7 @@ OUString replaceOrigin(
void BackendImpl::PackageImpl::processPackage_(
::osl::ResettableMutexGuard &,
bool doRegisterPackage,
+ bool /*startup*/,
::rtl::Reference<AbortChannel> const &,
Reference<XCommandEnvironment> const & xCmdEnv )
{
diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx
index 1cebd20c297a..e822a66aa85f 100644
--- a/desktop/source/deployment/registry/dp_backend.cxx
+++ b/desktop/source/deployment/registry/dp_backend.cxx
@@ -619,6 +619,7 @@ beans::Optional< beans::Ambiguous<sal_Bool> > Package::isRegistered(
//______________________________________________________________________________
void Package::processPackage_impl(
bool doRegisterPackage,
+ bool startup,
Reference<task::XAbortChannel> const & xAbortChannel,
Reference<XCommandEnvironment> const & xCmdEnv )
{
@@ -646,6 +647,7 @@ void Package::processPackage_impl(
+ displayName );
processPackage_( guard,
doRegisterPackage,
+ startup,
AbortChannel::get(xAbortChannel),
xCmdEnv );
}
@@ -683,6 +685,7 @@ void Package::processPackage_impl(
//______________________________________________________________________________
void Package::registerPackage(
+ sal_Bool startup,
Reference<task::XAbortChannel> const & xAbortChannel,
Reference<XCommandEnvironment> const & xCmdEnv )
throw (deployment::DeploymentException,
@@ -692,7 +695,7 @@ void Package::registerPackage(
{
if (m_bRemoved)
throw deployment::ExtensionRemovedException();
- processPackage_impl( true /* register */, xAbortChannel, xCmdEnv );
+ processPackage_impl( true /* register */, startup, xAbortChannel, xCmdEnv );
}
//______________________________________________________________________________
@@ -703,7 +706,7 @@ void Package::revokePackage(
CommandFailedException, CommandAbortedException,
lang::IllegalArgumentException, RuntimeException)
{
- processPackage_impl( false /* revoke */, xAbortChannel, xCmdEnv );
+ processPackage_impl( false /* revoke */, false, xAbortChannel, xCmdEnv );
}
diff --git a/desktop/source/deployment/registry/executable/dp_executable.cxx b/desktop/source/deployment/registry/executable/dp_executable.cxx
index 1dc4cdde64ea..ac83302f9fb4 100644
--- a/desktop/source/deployment/registry/executable/dp_executable.cxx
+++ b/desktop/source/deployment/registry/executable/dp_executable.cxx
@@ -62,6 +62,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
virtual void processPackage_(
::osl::ResettableMutexGuard & guard,
bool registerPackage,
+ bool startup,
::rtl::Reference<dp_misc::AbortChannel> const & abortChannel,
Reference<XCommandEnvironment> const & xCmdEnv );
@@ -202,6 +203,7 @@ BackendImpl::ExecutablePackageImpl::isRegistered_(
void BackendImpl::ExecutablePackageImpl::processPackage_(
::osl::ResettableMutexGuard &,
bool doRegisterPackage,
+ bool /*startup*/,
::rtl::Reference<dp_misc::AbortChannel> const & abortChannel,
Reference<XCommandEnvironment> const & /*xCmdEnv*/ )
{
diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx
index a523a1aa20a5..7e8f128bbf12 100644
--- a/desktop/source/deployment/registry/help/dp_help.cxx
+++ b/desktop/source/deployment/registry/help/dp_help.cxx
@@ -76,6 +76,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
virtual void processPackage_(
::osl::ResettableMutexGuard & guard,
bool registerPackage,
+ bool startup,
::rtl::Reference<AbortChannel> const & abortChannel,
Reference<XCommandEnvironment> const & xCmdEnv );
@@ -278,6 +279,7 @@ BackendImpl::PackageImpl::isRegistered_(
void BackendImpl::PackageImpl::processPackage_(
::osl::ResettableMutexGuard &,
bool doRegisterPackage,
+ bool /* startup */,
::rtl::Reference<AbortChannel> const & abortChannel,
Reference<XCommandEnvironment> const & xCmdEnv )
{
diff --git a/desktop/source/deployment/registry/inc/dp_backend.h b/desktop/source/deployment/registry/inc/dp_backend.h
index 7ad55d29ba2f..7b11ae456d5d 100644
--- a/desktop/source/deployment/registry/inc/dp_backend.h
+++ b/desktop/source/deployment/registry/inc/dp_backend.h
@@ -67,6 +67,7 @@ class Package : protected ::dp_misc::MutexHolder, public t_PackageBase
PackageRegistryBackend * getMyBackend() const;
void processPackage_impl(
bool registerPackage,
+ bool startup,
css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv );
@@ -97,6 +98,7 @@ protected:
virtual void processPackage_(
::osl::ResettableMutexGuard & guard,
bool registerPackage,
+ bool startup,
::rtl::Reference< ::dp_misc::AbortChannel > const & abortChannel,
css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv )
= 0;
@@ -193,6 +195,7 @@ public:
css::uno::RuntimeException);
virtual void SAL_CALL registerPackage(
+ sal_Bool startup,
css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel,
css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv )
throw (css::deployment::DeploymentException,
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx
index 822e744b8fc2..a5426bf26b54 100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -159,6 +159,7 @@ class BackendImpl : public ImplBaseT
virtual void processPackage_(
::osl::ResettableMutexGuard & guard,
bool registerPackage,
+ bool startup,
::rtl::Reference<AbortChannel> const & abortChannel,
Reference<ucb::XCommandEnvironment> const & xCmdEnv );
@@ -847,6 +848,7 @@ uno::Reference< graphic::XGraphic > BackendImpl::PackageImpl::getIcon( sal_Bool
void BackendImpl::PackageImpl::processPackage_(
::osl::ResettableMutexGuard &,
bool doRegisterPackage,
+ bool startup,
::rtl::Reference<AbortChannel> const & abortChannel,
Reference<ucb::XCommandEnvironment> const & xCmdEnv )
{
@@ -865,7 +867,7 @@ void BackendImpl::PackageImpl::processPackage_(
xPackage->createAbortChannel() );
AbortChannel::Chain chain( abortChannel, xSubAbortChannel );
try {
- xPackage->registerPackage( xSubAbortChannel, xCmdEnv );
+ xPackage->registerPackage( startup, xSubAbortChannel, xCmdEnv );
}
catch (RuntimeException &) {
throw;
diff --git a/desktop/source/deployment/registry/script/dp_script.cxx b/desktop/source/deployment/registry/script/dp_script.cxx
index 5023a501c67e..b2eddfaf74e0 100644
--- a/desktop/source/deployment/registry/script/dp_script.cxx
+++ b/desktop/source/deployment/registry/script/dp_script.cxx
@@ -80,6 +80,7 @@ class BackendImpl : public t_helper
virtual void processPackage_(
::osl::ResettableMutexGuard & guard,
bool registerPackage,
+ bool startup,
::rtl::Reference<AbortChannel> const & abortChannel,
Reference<XCommandEnvironment> const & xCmdEnv );
@@ -379,6 +380,7 @@ BackendImpl::PackageImpl::isRegistered_(
void BackendImpl::PackageImpl::processPackage_(
::osl::ResettableMutexGuard &,
bool doRegisterPackage,
+ bool /* startup */,
::rtl::Reference<AbortChannel> const &,
Reference<XCommandEnvironment> const & xCmdEnv )
{
diff --git a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
index 704f4f810928..8a4ee1b45fbc 100644
--- a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
+++ b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
@@ -77,6 +77,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
virtual void processPackage_(
::osl::ResettableMutexGuard & guard,
bool registerPackage,
+ bool startup,
::rtl::Reference<AbortChannel> const & abortChannel,
Reference<XCommandEnvironment> const & xCmdEnv );
@@ -371,6 +372,7 @@ BackendImpl::PackageImpl::isRegistered_(
void BackendImpl::PackageImpl::processPackage_(
::osl::ResettableMutexGuard &,
bool doRegisterPackage,
+ bool /* startup */,
::rtl::Reference<AbortChannel> const &,
Reference<XCommandEnvironment> const & )
{
diff --git a/desktop/source/migration/services/extensionmigration.cxx b/desktop/source/migration/services/extensionmigration.cxx
index a926f17c0c19..66f32744a782 100755
--- a/desktop/source/migration/services/extensionmigration.cxx
+++ b/desktop/source/migration/services/extensionmigration.cxx
@@ -236,7 +236,7 @@ namespace migration
if ( (sMediaType.equals(sBasicType) || sMediaType.equals(sDialogType))
&& isBasicPackageEnabled(xPkg))
{
- xPkg->registerPackage(uno::Reference< task::XAbortChannel >(),
+ xPkg->registerPackage(false, uno::Reference< task::XAbortChannel >(),
uno::Reference< ucb::XCommandEnvironment> ());
}
}
@@ -288,7 +288,7 @@ namespace migration
if ( bRegistered && !sMediaType.equals(sBasicType) && !sMediaType.equals(sDialogType) )
{
seqPkg[l]->revokePackage(uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ());
- seqPkg[l]->registerPackage(uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ());
+ seqPkg[l]->registerPackage(false, uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ());
}
}
}
@@ -297,7 +297,7 @@ namespace migration
registerBasicPackage(aPackage);
{
aPackage->revokePackage(uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ());
- aPackage->registerPackage(uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ());
+ aPackage->registerPackage(false, uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ());
}
}
}
diff --git a/desktop/source/migration/services/oo3extensionmigration.cxx b/desktop/source/migration/services/oo3extensionmigration.cxx
index a077eaddb911..2d17a654b29b 100755
--- a/desktop/source/migration/services/oo3extensionmigration.cxx
+++ b/desktop/source/migration/services/oo3extensionmigration.cxx
@@ -146,7 +146,7 @@ void OO3ExtensionMigration::registerConfigurationPackage( const uno::Reference<
if ( (sMediaType.equals(sConfigurationDataType) || sMediaType.equals(sConfigurationSchemaType) ) )
{
xPkg->revokePackage(uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ());
- xPkg->registerPackage(uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ());
+ xPkg->registerPackage(false, uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ());
}
}
diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
index ba8cd56085f8..2f4a7f1d7146 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
@@ -400,12 +400,7 @@ extern "C" int unopkg_main()
Reference<deployment::XPackage> p(
findPackage(repository,
xExtensionManager, xCmdEnv, cmdPackage ) );
- //Todo. temporary preventing exception in bundled case.
- //In case of a bundled extension, remove would be called as a result of
- //uninstalling a rpm. Then we do not want to show an error when the
- //extension does not exist, because the package will be uninstalled anyway
- //and the error would only confuse people.
- if ( !p.is() && !option_bundled)
+ if ( !p.is())
throw;
else if (p.is())
xExtensionManager->removeExtension(
diff --git a/svx/source/smarttags/SmartTagMgr.cxx b/svx/source/smarttags/SmartTagMgr.cxx
index b3a19ecc65bd..0070646b3330 100644
--- a/svx/source/smarttags/SmartTagMgr.cxx
+++ b/svx/source/smarttags/SmartTagMgr.cxx
@@ -35,8 +35,7 @@
#include <vcl/svapp.hxx>
#include <com/sun/star/smarttags/XSmartTagRecognizer.hpp>
#include <com/sun/star/smarttags/XSmartTagAction.hpp>
-#include <com/sun/star/deployment/XPackageManagerFactory.hpp>
-#include <com/sun/star/deployment/thePackageManagerFactory.hpp>
+#include <com/sun/star/deployment/ExtensionManager.hpp>
#include <com/sun/star/text/XTextMarkup.hpp>
#include <com/sun/star/smarttags/SmartTagRecognizerMode.hpp>
#include <com/sun/star/i18n/XBreakIterator.hpp>
@@ -472,11 +471,9 @@ void SmartTagMgr::RegisterListener()
// register as listener at package manager
try
{
- Reference<deployment::XPackageManagerFactory> xPackageManagerFactory(
- deployment::thePackageManagerFactory::get( mxContext ) );
- Reference<deployment::XPackageManager> xPackageManager(
- xPackageManagerFactory->getPackageManager( C2U("user" ) ) );
- Reference< util::XModifyBroadcaster > xMB ( xPackageManager, UNO_QUERY_THROW );
+ Reference<deployment::XExtensionManager> xExtensionManager(
+ deployment::ExtensionManager::get( mxContext ) );
+ Reference< util::XModifyBroadcaster > xMB ( xExtensionManager, UNO_QUERY_THROW );
Reference< util::XModifyListener > xListener( this );
xMB->addModifyListener( xListener );