From 854ee977ae497cf9229069bf10e4753133ce178e Mon Sep 17 00:00:00 2001 From: sb Date: Tue, 6 Apr 2010 16:53:43 +0200 Subject: sb122: #i110548# extension native libraries linking against basis layer; new extension dependency deployment-repositories --- .../source/deployment/gui/dp_gui_updatedialog.cxx | 2 +- desktop/source/deployment/inc/dp_dependencies.hxx | 7 +- .../deployment/manager/dp_informationprovider.cxx | 2 +- desktop/source/deployment/misc/dp_dependencies.cxx | 88 +++++++++++++++++++++- desktop/source/deployment/misc/dp_misc.src | 12 +++ .../source/deployment/registry/inc/dp_backend.h | 2 + .../deployment/registry/package/dp_package.cxx | 3 +- 7 files changed, 111 insertions(+), 5 deletions(-) (limited to 'desktop/source') diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx index 61479f799e6f..9097cdcf63a4 100644 --- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx +++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx @@ -521,7 +521,7 @@ bool UpdateDialog::Thread::update( dp_misc::DescriptionInfoset infoset(m_context, updateInfo); OSL_ASSERT(infoset.getVersion().getLength() != 0); css::uno::Sequence< css::uno::Reference< css::xml::dom::XElement > > ds( - dp_misc::Dependencies::check(infoset)); + dp_misc::Dependencies::check(infoset, packageManager->getContext())); UpdateDialog::DisabledUpdate du; du.aUpdateInfo = updateInfo; diff --git a/desktop/source/deployment/inc/dp_dependencies.hxx b/desktop/source/deployment/inc/dp_dependencies.hxx index 13be1e8612fb..65e9c9dd6b4a 100644 --- a/desktop/source/deployment/inc/dp_dependencies.hxx +++ b/desktop/source/deployment/inc/dp_dependencies.hxx @@ -53,6 +53,9 @@ namespace Dependencies { @param infoset the infoset containing the dependencies to check + @param repository + the repository into which to deploy + @return a list of the unsatisfied dependencies from infoset (in no specific order) @@ -60,7 +63,9 @@ namespace Dependencies { DESKTOP_DEPLOYMENTMISC_DLLPUBLIC ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::xml::dom::XElement > > - check(::dp_misc::DescriptionInfoset const & infoset); + check( + ::dp_misc::DescriptionInfoset const & infoset, + ::rtl::OUString const & repository); /** Obtain the (human-readable) error message of a failed dependency. diff --git a/desktop/source/deployment/manager/dp_informationprovider.cxx b/desktop/source/deployment/manager/dp_informationprovider.cxx index 9f2e0c9e1177..6267135e0d55 100644 --- a/desktop/source/deployment/manager/dp_informationprovider.cxx +++ b/desktop/source/deployment/manager/dp_informationprovider.cxx @@ -387,7 +387,7 @@ uno::Sequence< uno::Sequence< rtl::OUString > > if (*id2 == id) { // check, if there are unsatisfied dependencies and ignore those updates - uno::Sequence< uno::Reference< xml::dom::XElement > > ds( dp_misc::Dependencies::check( infoset ) ); + uno::Sequence< uno::Reference< xml::dom::XElement > > ds( dp_misc::Dependencies::check( infoset, _xManager->getContext() ) ); if ( ds.getLength() ) continue; diff --git a/desktop/source/deployment/misc/dp_dependencies.cxx b/desktop/source/deployment/misc/dp_dependencies.cxx index 63badbb0c211..49720c861092 100644 --- a/desktop/source/deployment/misc/dp_dependencies.cxx +++ b/desktop/source/deployment/misc/dp_dependencies.cxx @@ -69,6 +69,37 @@ bool satisfiesMinimalVersion(::rtl::OUString const & version) { return compareWithVersion(version) != ::dp_misc::LESS; } +bool contains(::rtl::OUString const & list, ::rtl::OUString const & element) { + for (::sal_Int32 i = 0;;) { + ::sal_Int32 n = i; + i = list.indexOf(',', i); + if (i == -1) { + i = list.getLength(); + } + if (list.copy(n, i) == element) { + return true; + } + if (i == list.getLength()) { + return false; + } + ++i; + } +} + +bool checkDeploymentRepositories( + css::uno::Reference< css::xml::dom::XElement > const & dependency, + ::rtl::OUString const & repository) +{ + css::uno::Reference< css::xml::dom::XAttr > sup( + dependency->getAttributeNode( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("supported")))); + css::uno::Reference< css::xml::dom::XAttr > notSup( + dependency->getAttributeNode( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("not-supported")))); + return (!sup.is() || contains(sup->getValue(), repository)) && + !(notSup.is() && contains(notSup->getValue(), repository)); +} + } namespace dp_misc { @@ -76,7 +107,10 @@ namespace dp_misc { namespace Dependencies { css::uno::Sequence< css::uno::Reference< css::xml::dom::XElement > > -check(::dp_misc::DescriptionInfoset const & infoset) { +check( + ::dp_misc::DescriptionInfoset const & infoset, + ::rtl::OUString const & repository) +{ css::uno::Reference< css::xml::dom::XNodeList > deps( infoset.getDependencies()); ::sal_Int32 n = deps->getLength(); @@ -107,6 +141,12 @@ check(::dp_misc::DescriptionInfoset const & infoset) { e->getAttribute( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value")))) != ::dp_misc::GREATER; + } else if (e->getNamespaceURI().equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM(xmlNamespace)) + && e->getTagName().equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("deployment-repositories"))) + { + sat = checkDeploymentRepositories(e, repository); } else if (e->hasAttributeNS( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(xmlNamespace)), @@ -145,6 +185,52 @@ check(::dp_misc::DescriptionInfoset const & infoset) { sValue = dependency->getAttribute( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value") ) ); sReason = ::rtl::OUString( ::String(::dp_misc::getResId(RID_DEPLYOMENT_DEPENDENCIES_MAX)) ); } + else if (dependency->getNamespaceURI().equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM(xmlNamespace)) && + dependency->getTagName().equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("deployment-repositories"))) + { + css::uno::Reference< css::xml::dom::XAttr > sup( + dependency->getAttributeNode( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("supported")))); + css::uno::Reference< css::xml::dom::XAttr > notSup( + dependency->getAttributeNode( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("not-supported")))); + sValue = ::String( + ::dp_misc::getResId( + sup.is() + ? (notSup.is() + ? RID_DEPLOYMENT_DEPENDENCIES_REPO_BOTH + : RID_DEPLOYMENT_DEPENDENCIES_REPO_POS) + : (notSup.is() + ? RID_DEPLOYMENT_DEPENDENCIES_REPO_NEG + : RID_DEPLYOMENT_DEPENDENCIES_UNKNOWN))); + ::rtl::OUStringBuffer buf; + for (::sal_Int32 i = 0;;) { + ::sal_Int32 j = sValue.indexOf('%', i); + if (j == -1) { + buf.append(sValue.copy(i)); + break; + } + if (sup.is() && + sValue.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("POS"), j + 1)) + { + buf.append(sValue.copy(i, j - i)); + buf.append(sup->getValue()); + i = j + RTL_CONSTASCII_LENGTH("%POS"); + } else if (notSup.is() && + sValue.matchAsciiL( + RTL_CONSTASCII_STRINGPARAM("NEG"), j + 1)) + { + buf.append(sValue.copy(i, j - i)); + buf.append(notSup->getValue()); + i = j + RTL_CONSTASCII_LENGTH("%NEG"); + } else { + i = j + 1; + } + } + return buf.makeStringAndClear(); + } else if ( dependency->hasAttributeNS( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( xmlNamespace ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenOffice.org-minimal-version" )))) { diff --git a/desktop/source/deployment/misc/dp_misc.src b/desktop/source/deployment/misc/dp_misc.src index 0d341122af16..6dada0178978 100644 --- a/desktop/source/deployment/misc/dp_misc.src +++ b/desktop/source/deployment/misc/dp_misc.src @@ -38,3 +38,15 @@ String RID_DEPLYOMENT_DEPENDENCIES_MIN { String RID_DEPLYOMENT_DEPENDENCIES_MAX { Text[en-US] = "Extension doesn't support versions greater than: OpenOffice.org %VERSION"; }; + +String RID_DEPLOYMENT_DEPENDENCIES_REPO_POS { + Text[en-US] = "Extension can only be deployed to repositories \"%POS\""; +}; + +String RID_DEPLOYMENT_DEPENDENCIES_REPO_NEG { + Text[en-US] = "Extension can not be deployed to repositories \"%NEG\""; +}; + +String RID_DEPLOYMENT_DEPENDENCIES_REPO_BOTH { + Text[en-US] = "Extension can be deployed to repositories \"%POS\" but not to \"%NEG\""; +}; diff --git a/desktop/source/deployment/registry/inc/dp_backend.h b/desktop/source/deployment/registry/inc/dp_backend.h index fe52c8ffc7e3..fdf950434395 100644 --- a/desktop/source/deployment/registry/inc/dp_backend.h +++ b/desktop/source/deployment/registry/inc/dp_backend.h @@ -299,6 +299,8 @@ public: inline ::rtl::OUString const & getCachePath() const { return m_cachePath; } inline bool transientMode() const { return m_cachePath.getLength() == 0; } + inline ::rtl::OUString getContext() const {return m_context; } + // XEventListener virtual void SAL_CALL disposing( css::lang::EventObject const & evt ) throw (css::uno::RuntimeException); diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx index cfe5be59dad0..f87b3e059994 100644 --- a/desktop/source/deployment/registry/package/dp_package.cxx +++ b/desktop/source/deployment/registry/package/dp_package.cxx @@ -553,7 +553,8 @@ bool BackendImpl::PackageImpl::checkDependencies( dp_misc::Dependencies::check( DescriptionInfoset( getMyBackend()->getComponentContext(), - description.getRootElement()))); + description.getRootElement()), + getMyBackend()->getContext())); if (unsatisfied.getLength() == 0) { return true; } else { -- cgit From 10ce0c56de2072553e5cbe5ebbd422cd88e5fde6 Mon Sep 17 00:00:00 2001 From: sb Date: Mon, 12 Apr 2010 13:13:16 +0200 Subject: sb122: #i110494# make OpenOffice.org-maximal-version dependency work for > 0 micro OOo versions again --- desktop/source/deployment/misc/dp_dependencies.cxx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'desktop/source') diff --git a/desktop/source/deployment/misc/dp_dependencies.cxx b/desktop/source/deployment/misc/dp_dependencies.cxx index 49720c861092..e5a81f4528f9 100644 --- a/desktop/source/deployment/misc/dp_dependencies.cxx +++ b/desktop/source/deployment/misc/dp_dependencies.cxx @@ -56,17 +56,13 @@ namespace css = ::com::sun::star; static char const xmlNamespace[] = "http://openoffice.org/extensions/description/2006"; -::dp_misc::Order compareWithVersion(::rtl::OUString const & version) { +bool satisfiesMinimalVersion(::rtl::OUString const & version) { ::rtl::OUString v( RTL_CONSTASCII_USTRINGPARAM( "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("version") ":Version:OOOPackageVersion}")); ::rtl::Bootstrap::expandMacros(v); - return ::dp_misc::compareVersions(v, version); -} - -bool satisfiesMinimalVersion(::rtl::OUString const & version) { - return compareWithVersion(version) != ::dp_misc::LESS; + return ::dp_misc::compareVersions(v, version) != ::dp_misc::LESS; } bool contains(::rtl::OUString const & list, ::rtl::OUString const & element) { @@ -136,8 +132,14 @@ check( RTL_CONSTASCII_STRINGPARAM( "OpenOffice.org-maximal-version"))) { + ::rtl::OUString v( + RTL_CONSTASCII_USTRINGPARAM( + "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("version") + ":Version:OOOBaseVersion}")); + ::rtl::Bootstrap::expandMacros(v); sat = - compareWithVersion( + ::dp_misc::compareVersions( + v, e->getAttribute( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value")))) != ::dp_misc::GREATER; -- cgit From 0a877b39fdd26f6fcd5706912569b83daf3fb67d Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 23 Apr 2010 16:19:36 +0200 Subject: sb122: #i110548# backed out new extension dependency deployment-repositories again (introduced in -c 3b28615890d2); not needed after all --- .../source/deployment/gui/dp_gui_updatedialog.cxx | 2 +- desktop/source/deployment/inc/dp_dependencies.hxx | 7 +- .../deployment/manager/dp_informationprovider.cxx | 2 +- desktop/source/deployment/misc/dp_dependencies.cxx | 88 +--------------------- desktop/source/deployment/misc/dp_misc.src | 12 --- .../source/deployment/registry/inc/dp_backend.h | 2 - .../deployment/registry/package/dp_package.cxx | 3 +- 7 files changed, 5 insertions(+), 111 deletions(-) (limited to 'desktop/source') diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx index 9097cdcf63a4..61479f799e6f 100644 --- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx +++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx @@ -521,7 +521,7 @@ bool UpdateDialog::Thread::update( dp_misc::DescriptionInfoset infoset(m_context, updateInfo); OSL_ASSERT(infoset.getVersion().getLength() != 0); css::uno::Sequence< css::uno::Reference< css::xml::dom::XElement > > ds( - dp_misc::Dependencies::check(infoset, packageManager->getContext())); + dp_misc::Dependencies::check(infoset)); UpdateDialog::DisabledUpdate du; du.aUpdateInfo = updateInfo; diff --git a/desktop/source/deployment/inc/dp_dependencies.hxx b/desktop/source/deployment/inc/dp_dependencies.hxx index 65e9c9dd6b4a..13be1e8612fb 100644 --- a/desktop/source/deployment/inc/dp_dependencies.hxx +++ b/desktop/source/deployment/inc/dp_dependencies.hxx @@ -53,9 +53,6 @@ namespace Dependencies { @param infoset the infoset containing the dependencies to check - @param repository - the repository into which to deploy - @return a list of the unsatisfied dependencies from infoset (in no specific order) @@ -63,9 +60,7 @@ namespace Dependencies { DESKTOP_DEPLOYMENTMISC_DLLPUBLIC ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::xml::dom::XElement > > - check( - ::dp_misc::DescriptionInfoset const & infoset, - ::rtl::OUString const & repository); + check(::dp_misc::DescriptionInfoset const & infoset); /** Obtain the (human-readable) error message of a failed dependency. diff --git a/desktop/source/deployment/manager/dp_informationprovider.cxx b/desktop/source/deployment/manager/dp_informationprovider.cxx index 6267135e0d55..9f2e0c9e1177 100644 --- a/desktop/source/deployment/manager/dp_informationprovider.cxx +++ b/desktop/source/deployment/manager/dp_informationprovider.cxx @@ -387,7 +387,7 @@ uno::Sequence< uno::Sequence< rtl::OUString > > if (*id2 == id) { // check, if there are unsatisfied dependencies and ignore those updates - uno::Sequence< uno::Reference< xml::dom::XElement > > ds( dp_misc::Dependencies::check( infoset, _xManager->getContext() ) ); + uno::Sequence< uno::Reference< xml::dom::XElement > > ds( dp_misc::Dependencies::check( infoset ) ); if ( ds.getLength() ) continue; diff --git a/desktop/source/deployment/misc/dp_dependencies.cxx b/desktop/source/deployment/misc/dp_dependencies.cxx index e5a81f4528f9..9534f166f2f0 100644 --- a/desktop/source/deployment/misc/dp_dependencies.cxx +++ b/desktop/source/deployment/misc/dp_dependencies.cxx @@ -65,37 +65,6 @@ bool satisfiesMinimalVersion(::rtl::OUString const & version) { return ::dp_misc::compareVersions(v, version) != ::dp_misc::LESS; } -bool contains(::rtl::OUString const & list, ::rtl::OUString const & element) { - for (::sal_Int32 i = 0;;) { - ::sal_Int32 n = i; - i = list.indexOf(',', i); - if (i == -1) { - i = list.getLength(); - } - if (list.copy(n, i) == element) { - return true; - } - if (i == list.getLength()) { - return false; - } - ++i; - } -} - -bool checkDeploymentRepositories( - css::uno::Reference< css::xml::dom::XElement > const & dependency, - ::rtl::OUString const & repository) -{ - css::uno::Reference< css::xml::dom::XAttr > sup( - dependency->getAttributeNode( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("supported")))); - css::uno::Reference< css::xml::dom::XAttr > notSup( - dependency->getAttributeNode( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("not-supported")))); - return (!sup.is() || contains(sup->getValue(), repository)) && - !(notSup.is() && contains(notSup->getValue(), repository)); -} - } namespace dp_misc { @@ -103,10 +72,7 @@ namespace dp_misc { namespace Dependencies { css::uno::Sequence< css::uno::Reference< css::xml::dom::XElement > > -check( - ::dp_misc::DescriptionInfoset const & infoset, - ::rtl::OUString const & repository) -{ +check(::dp_misc::DescriptionInfoset const & infoset) { css::uno::Reference< css::xml::dom::XNodeList > deps( infoset.getDependencies()); ::sal_Int32 n = deps->getLength(); @@ -143,12 +109,6 @@ check( e->getAttribute( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value")))) != ::dp_misc::GREATER; - } else if (e->getNamespaceURI().equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM(xmlNamespace)) - && e->getTagName().equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM("deployment-repositories"))) - { - sat = checkDeploymentRepositories(e, repository); } else if (e->hasAttributeNS( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(xmlNamespace)), @@ -187,52 +147,6 @@ check( sValue = dependency->getAttribute( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value") ) ); sReason = ::rtl::OUString( ::String(::dp_misc::getResId(RID_DEPLYOMENT_DEPENDENCIES_MAX)) ); } - else if (dependency->getNamespaceURI().equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM(xmlNamespace)) && - dependency->getTagName().equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM("deployment-repositories"))) - { - css::uno::Reference< css::xml::dom::XAttr > sup( - dependency->getAttributeNode( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("supported")))); - css::uno::Reference< css::xml::dom::XAttr > notSup( - dependency->getAttributeNode( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("not-supported")))); - sValue = ::String( - ::dp_misc::getResId( - sup.is() - ? (notSup.is() - ? RID_DEPLOYMENT_DEPENDENCIES_REPO_BOTH - : RID_DEPLOYMENT_DEPENDENCIES_REPO_POS) - : (notSup.is() - ? RID_DEPLOYMENT_DEPENDENCIES_REPO_NEG - : RID_DEPLYOMENT_DEPENDENCIES_UNKNOWN))); - ::rtl::OUStringBuffer buf; - for (::sal_Int32 i = 0;;) { - ::sal_Int32 j = sValue.indexOf('%', i); - if (j == -1) { - buf.append(sValue.copy(i)); - break; - } - if (sup.is() && - sValue.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("POS"), j + 1)) - { - buf.append(sValue.copy(i, j - i)); - buf.append(sup->getValue()); - i = j + RTL_CONSTASCII_LENGTH("%POS"); - } else if (notSup.is() && - sValue.matchAsciiL( - RTL_CONSTASCII_STRINGPARAM("NEG"), j + 1)) - { - buf.append(sValue.copy(i, j - i)); - buf.append(notSup->getValue()); - i = j + RTL_CONSTASCII_LENGTH("%NEG"); - } else { - i = j + 1; - } - } - return buf.makeStringAndClear(); - } else if ( dependency->hasAttributeNS( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( xmlNamespace ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenOffice.org-minimal-version" )))) { diff --git a/desktop/source/deployment/misc/dp_misc.src b/desktop/source/deployment/misc/dp_misc.src index 6dada0178978..0d341122af16 100644 --- a/desktop/source/deployment/misc/dp_misc.src +++ b/desktop/source/deployment/misc/dp_misc.src @@ -38,15 +38,3 @@ String RID_DEPLYOMENT_DEPENDENCIES_MIN { String RID_DEPLYOMENT_DEPENDENCIES_MAX { Text[en-US] = "Extension doesn't support versions greater than: OpenOffice.org %VERSION"; }; - -String RID_DEPLOYMENT_DEPENDENCIES_REPO_POS { - Text[en-US] = "Extension can only be deployed to repositories \"%POS\""; -}; - -String RID_DEPLOYMENT_DEPENDENCIES_REPO_NEG { - Text[en-US] = "Extension can not be deployed to repositories \"%NEG\""; -}; - -String RID_DEPLOYMENT_DEPENDENCIES_REPO_BOTH { - Text[en-US] = "Extension can be deployed to repositories \"%POS\" but not to \"%NEG\""; -}; diff --git a/desktop/source/deployment/registry/inc/dp_backend.h b/desktop/source/deployment/registry/inc/dp_backend.h index fdf950434395..fe52c8ffc7e3 100644 --- a/desktop/source/deployment/registry/inc/dp_backend.h +++ b/desktop/source/deployment/registry/inc/dp_backend.h @@ -299,8 +299,6 @@ public: inline ::rtl::OUString const & getCachePath() const { return m_cachePath; } inline bool transientMode() const { return m_cachePath.getLength() == 0; } - inline ::rtl::OUString getContext() const {return m_context; } - // XEventListener virtual void SAL_CALL disposing( css::lang::EventObject const & evt ) throw (css::uno::RuntimeException); diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx index 2008edc26713..e45f7fb7ef73 100644 --- a/desktop/source/deployment/registry/package/dp_package.cxx +++ b/desktop/source/deployment/registry/package/dp_package.cxx @@ -553,8 +553,7 @@ bool BackendImpl::PackageImpl::checkDependencies( dp_misc::Dependencies::check( DescriptionInfoset( getMyBackend()->getComponentContext(), - description.getRootElement()), - getMyBackend()->getContext())); + description.getRootElement()))); if (unsatisfied.getLength() == 0) { return true; } else { -- cgit From 74155ef0d4806b2cad2e550ce337e7f6a02adf38 Mon Sep 17 00:00:00 2001 From: sb Date: Tue, 4 May 2010 16:29:02 +0200 Subject: sb122: #i110491# turned configmgr API from C++ to UNO --- desktop/source/app/makefile.mk | 1 - desktop/source/deployment/makefile.mk | 3 +-- .../registry/configuration/dp_configuration.cxx | 12 +++++----- desktop/source/migration/migration.cxx | 26 ++++++++++++++++++---- desktop/source/splash/makefile.mk | 1 - 5 files changed, 30 insertions(+), 13 deletions(-) (limited to 'desktop/source') diff --git a/desktop/source/app/makefile.mk b/desktop/source/app/makefile.mk index 83bec9011283..d9db7c163481 100644 --- a/desktop/source/app/makefile.mk +++ b/desktop/source/app/makefile.mk @@ -65,7 +65,6 @@ SHL1LIBS = $(SLB)$/mig.lib SHL1STDLIBS = \ $(COMPHELPERLIB) \ - $(CONFIGMGRLIB) \ $(CPPUHELPERLIB) \ $(CPPULIB) \ $(I18NISOLANGLIB) \ diff --git a/desktop/source/deployment/makefile.mk b/desktop/source/deployment/makefile.mk index 7eda0f582e15..173ff35bec1d 100644 --- a/desktop/source/deployment/makefile.mk +++ b/desktop/source/deployment/makefile.mk @@ -80,8 +80,7 @@ SHL1STDLIBS = \ $(SVLLIB) \ $(UNOTOOLSLIB) \ $(DEPLOYMENTMISCLIB) \ - $(HELPLINKERLIB) \ - $(CONFIGMGRLIB) + $(HELPLINKERLIB) SHL1DEPN = SHL1IMPLIB = i$(TARGET) diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx index 460ba5e9fed0..6cf6d4ff7818 100644 --- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx @@ -45,9 +45,9 @@ #include "ucbhelper/content.hxx" #include "comphelper/anytostring.hxx" #include "comphelper/servicedecl.hxx" -#include "configmgr/update.hxx" #include "xmlscript/xml_helper.hxx" #include "svl/inettype.hxx" +#include "com/sun/star/configuration/Update.hpp" #include "com/sun/star/ucb/NameClash.hpp" #include "com/sun/star/io/XActiveDataSink.hpp" #include "com/sun/star/lang/WrappedTargetRuntimeException.hpp" @@ -645,14 +645,16 @@ void BackendImpl::PackageImpl::processPackage_( { if (m_isSchema) { - configmgr::update::insertExtensionXcsFile( - that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url)); + com::sun::star::configuration::Update::get( + that->m_xComponentContext)->insertExtensionXcsFile( + that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url)); } else { url = replaceOrigin(url, xCmdEnv); - configmgr::update::insertExtensionXcuFile( - that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url)); + com::sun::star::configuration::Update::get( + that->m_xComponentContext)->insertExtensionXcuFile( + that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url)); } that->addToConfigmgrIni( m_isSchema, url, xCmdEnv ); diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index 634bce451476..6ab5d8478de7 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -29,6 +29,7 @@ #include "precompiled_desktop.hxx" #include +#include #include #include "migration.hxx" @@ -38,7 +39,6 @@ #include #include #include -#include #include #include #include @@ -51,6 +51,7 @@ #include #include +#include #include #include #include @@ -539,6 +540,21 @@ bool getComponent(rtl::OUString const & path, rtl::OUString * component) { return true; } +uno::Sequence< rtl::OUString > setToSeq(std::set< rtl::OUString > const & set) { + std::set< rtl::OUString >::size_type n = set.size(); + if (n > SAL_MAX_INT32) { + throw std::bad_alloc(); + } + uno::Sequence< rtl::OUString > seq(static_cast< sal_Int32 >(n)); + sal_Int32 i = 0; + for (std::set< rtl::OUString >::const_iterator j(set.begin()); + j != set.end(); ++j) + { + seq[i++] = *j; + } + return seq; +} + } void MigrationImpl::copyConfig() { @@ -586,9 +602,11 @@ void MigrationImpl::copyConfig() { buf.append(enc); } while (n >= 0); buf.appendAscii(RTL_CONSTASCII_STRINGPARAM(".xcu")); - configmgr::update::insertModificationXcuFile( - buf.makeStringAndClear(), i->second.includedPaths, - i->second.excludedPaths); + configuration::Update::get( + comphelper::getProcessComponentContext())-> + insertModificationXcuFile( + buf.makeStringAndClear(), setToSeq(i->second.includedPaths), + setToSeq(i->second.excludedPaths)); } else { OSL_TRACE( ("configuration migration component %s ignored (only excludes," diff --git a/desktop/source/splash/makefile.mk b/desktop/source/splash/makefile.mk index 2f163fe7b9d6..89609687438c 100644 --- a/desktop/source/splash/makefile.mk +++ b/desktop/source/splash/makefile.mk @@ -63,7 +63,6 @@ SHL1STDLIBS= \ $(SVLLIB) \ $(SVTOOLLIB) \ $(COMPHELPERLIB) \ - $(CONFIGMGRLIB) \ $(UNOTOOLSLIB) \ $(TOOLSLIB) \ $(UCBHELPERLIB) \ -- cgit