diff options
author | sb <sb@openoffice.org> | 2010-08-12 10:22:02 +0200 |
---|---|---|
committer | sb <sb@openoffice.org> | 2010-08-12 10:22:02 +0200 |
commit | 1423da554b361a3aa020c17469972861a02dcac1 (patch) | |
tree | 48b221e80366bf8b6686b773a1de04642d9aec6f /configmgr/source/data.cxx | |
parent | 63be9a19153d112ecfbc01f40522f1a388c5bb56 (diff) |
sb130: #i113096# introduced com.sun.star.configuration.XUpdate.removeExtensionXcuFile
Diffstat (limited to 'configmgr/source/data.cxx')
-rw-r--r-- | configmgr/source/data.cxx | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/configmgr/source/data.cxx b/configmgr/source/data.cxx index e12f9596940b..50466ca0532c 100644 --- a/configmgr/source/data.cxx +++ b/configmgr/source/data.cxx @@ -36,11 +36,13 @@ #include "osl/diagnose.h" #include "rtl/ref.hxx" #include "rtl/string.h" +#include "rtl/textenc.h" #include "rtl/ustrbuf.hxx" #include "rtl/ustring.h" #include "rtl/ustring.hxx" #include "sal/types.h" +#include "additions.hxx" #include "data.hxx" #include "groupnode.hxx" #include "node.hxx" @@ -325,4 +327,46 @@ rtl::Reference< Node > Data::getTemplate( return findNode(layer, templates, fullName); } +Additions * Data::addExtensionXcuAdditions( + rtl::OUString const & url, int layer) +{ + rtl::Reference< ExtensionXcu > item(new ExtensionXcu); + ExtensionXcuAdditions::iterator i( + extensionXcuAdditions_.insert( + ExtensionXcuAdditions::value_type( + url, rtl::Reference< ExtensionXcu >())).first); + if (i->second.is()) { + throw css::uno::RuntimeException( + (rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "already added extension xcu ")) + + url), + css::uno::Reference< css::uno::XInterface >()); + } + i->second = item; + item->layer = layer; + return &item->additions; +} + +rtl::Reference< Data::ExtensionXcu > Data::removeExtensionXcuAdditions( + rtl::OUString const & url) +{ + ExtensionXcuAdditions::iterator i(extensionXcuAdditions_.find(url)); + if (i == extensionXcuAdditions_.end()) { + // This can happen, as migration of pre OOo 3.3 UserInstallation + // extensions in dp_registry::backend::configuration::BackendImpl:: + // PackageImpl::processPackage_ can cause just-in-time creation of + // extension xcu files that are never added via addExtensionXcuAdditions + // (also, there might be url spelling differences between calls to + // addExtensionXcuAdditions and removeExtensionXcuAdditions?): + OSL_TRACE( + "unknown configmgr::Data::removeExtensionXcuAdditions(%s)", + rtl::OUStringToOString(url, RTL_TEXTENCODING_UTF8).getStr()); + return rtl::Reference< ExtensionXcu >(); + } + rtl::Reference< ExtensionXcu > item(i->second); + extensionXcuAdditions_.erase(i); + return item; +} + } |