summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-07-15 23:17:20 +0200
committerMichael Stahl <mstahl@redhat.com>2015-07-16 00:06:21 +0200
commit218be53fe00aebed43df0b041de609b30f99ce95 (patch)
treead9098da3c0868c211065414fc7be6bbfff40cef /desktop
parent5c8325325868753d2891556400c91651bce58402 (diff)
tools: replace boost::ptr_vector with std::unordered_map
Change-Id: I530c5f95dda9aa80654e3a2a20a2e236221e7305
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/deployment/manager/dp_manager.cxx5
-rw-r--r--desktop/source/deployment/registry/component/dp_component.cxx22
-rw-r--r--desktop/source/deployment/registry/package/dp_package.cxx11
3 files changed, 19 insertions, 19 deletions
diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx
index 3392b545faff..d67f49610e87 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -971,9 +971,8 @@ Reference<deployment::XPackage> PackageManagerImpl::getDeployedPackage_(
INetContentTypeParameterList params;
if (INetContentTypes::parse( data.mediaType, type, subType, &params ))
{
- INetContentTypeParameter const * param = params.find(
- OString("platform") );
- if (param != 0 && !platform_fits( param->m_sValue ))
+ auto const iter = params.find(OString("platform"));
+ if (iter != params.end() && !platform_fits(iter->second.m_sValue))
throw lang::IllegalArgumentException(
getResourceString(RID_STR_NO_SUCH_PACKAGE) + id,
static_cast<OWeakObject *>(this),
diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx
index e17961f0bb9b..9b2a2a73179c 100644
--- a/desktop/source/deployment/registry/component/dp_component.cxx
+++ b/desktop/source/deployment/registry/component/dp_component.cxx
@@ -670,21 +670,21 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
{
// xxx todo: probe and evaluate component xml description
- INetContentTypeParameter const * param = params.find(OString("platform"));
- bool bPlatformFits(param == 0);
+ auto const iter = params.find(OString("platform"));
+ bool bPlatformFits(iter == params.end());
OUString aPlatform;
if (!bPlatformFits) // platform is specified, we have to check
{
- aPlatform = param->m_sValue;
+ aPlatform = iter->second.m_sValue;
bPlatformFits = platform_fits(aPlatform);
}
// If the package is being removed, do not care whether
// platform fits. We won't be using it anyway.
if (bPlatformFits || bRemoved) {
- param = params.find(OString("type"));
- if (param != 0)
+ auto const iterType = params.find(OString("type"));
+ if (iterType != params.end())
{
- OUString const & value = param->m_sValue;
+ OUString const & value = iterType->second.m_sValue;
if (value.equalsIgnoreAsciiCase("native")) {
if (bPlatformFits)
return new BackendImpl::ComponentPackageImpl(
@@ -713,8 +713,8 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
}
else if (subType.equalsIgnoreAsciiCase("vnd.sun.star.uno-components"))
{
- INetContentTypeParameter const * param = params.find(OString("platform"));
- if (param == 0 || platform_fits( param->m_sValue )) {
+ auto const iter = params.find(OString("platform"));
+ if (iter == params.end() || platform_fits(iter->second.m_sValue)) {
return new BackendImpl::ComponentsPackageImpl(
this, url, name, m_xComponentsTypeInfo, bRemoved,
identifier);
@@ -722,9 +722,9 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
}
else if (subType.equalsIgnoreAsciiCase( "vnd.sun.star.uno-typelibrary"))
{
- INetContentTypeParameter const * param = params.find(OString("type"));
- if (param != 0) {
- OUString const & value = param->m_sValue;
+ auto const iter = params.find(OString("type"));
+ if (iter != params.end()) {
+ OUString const & value = iter->second.m_sValue;
if (value.equalsIgnoreAsciiCase("RDB"))
{
return new BackendImpl::TypelibraryPackageImpl(
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx
index db08cb9033e9..2ce790d1e50d 100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -1473,8 +1473,8 @@ void BackendImpl::PackageImpl::scanBundle(
if (! INetContentTypes::parse( mediaType, type, subType, &params ))
continue;
- INetContentTypeParameter const * param = params.find("platform");
- if (param != 0 && !platform_fits( param->m_sValue ))
+ auto const iter = params.find("platform");
+ if (iter != params.end() && !platform_fits(iter->second.m_sValue))
continue;
const OUString url( makeURL( packageRootURL, fullPath ) );
@@ -1483,14 +1483,15 @@ void BackendImpl::PackageImpl::scanBundle(
subType.equalsIgnoreAsciiCase( "vnd.sun.star.package-bundle-description"))
{
// check locale:
- param = params.find("locale");
- if (param == 0) {
+ auto const iterLocale = params.find("locale");
+ if (iterLocale == params.end())
+ {
if (descrFile.isEmpty())
descrFile = url;
}
else {
// match best locale:
- LanguageTag descrTag( param->m_sValue);
+ LanguageTag descrTag(iter->second.m_sValue);
if (officeLocale.getLanguage() == descrTag.getLanguage())
{
size_t nPenalty = nPenaltyMax;