summaryrefslogtreecommitdiff
path: root/configmgr
diff options
context:
space:
mode:
authorJakub Trzebiatowski <ubap.dev@gmail.com>2016-03-07 19:48:23 +0100
committerNoel Grandin <noelgrandin@gmail.com>2016-03-15 06:26:57 +0000
commit89e0663c55f7f1763536a345d63111115c71ef26 (patch)
treebb9a3a82a3f462cb72242e02c0a974285a80d40a /configmgr
parent869262bcc980d1d964036dbaba87a456479f53b7 (diff)
tdf#96099 fix trival typedefs, Path to std::vector<OUString>
Change-Id: I23fca48becbfdfd92db02a11b739a668fc1cd8c4 Reviewed-on: https://gerrit.libreoffice.org/23007 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'configmgr')
-rw-r--r--configmgr/source/access.cxx11
-rw-r--r--configmgr/source/access.hxx7
-rw-r--r--configmgr/source/additions.hxx7
-rw-r--r--configmgr/source/childaccess.cxx13
-rw-r--r--configmgr/source/childaccess.hxx7
-rw-r--r--configmgr/source/components.cxx10
-rw-r--r--configmgr/source/components.hxx5
-rw-r--r--configmgr/source/data.cxx2
-rw-r--r--configmgr/source/data.hxx3
-rw-r--r--configmgr/source/modifications.cxx11
-rw-r--r--configmgr/source/modifications.hxx6
-rw-r--r--configmgr/source/partial.cxx4
-rw-r--r--configmgr/source/partial.hxx3
-rw-r--r--configmgr/source/path.hxx36
-rw-r--r--configmgr/source/rootaccess.cxx9
-rw-r--r--configmgr/source/rootaccess.hxx9
-rw-r--r--configmgr/source/setnode.hxx4
-rw-r--r--configmgr/source/xcuparser.cxx1
-rw-r--r--configmgr/source/xcuparser.hxx3
19 files changed, 50 insertions, 101 deletions
diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 97543bbda69d..3506beb7aeb4 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -96,7 +96,6 @@
#include "modifications.hxx"
#include "node.hxx"
#include "nodemap.hxx"
-#include "path.hxx"
#include "propertynode.hxx"
#include "rootaccess.hxx"
#include "setnode.hxx"
@@ -253,7 +252,7 @@ css::uno::Sequence< OUString > Access::getSupportedServiceNames()
assert(thisIs(IS_ANY));
osl::MutexGuard g(*lock_);
checkLocalizedPropertyAccess();
- std::vector< OUString > services;
+ std::vector<OUString> services;
services.push_back("com.sun.star.configuration.ConfigurationAccess");
if (getRootAccess()->isUpdate()) {
services.push_back(
@@ -424,7 +423,7 @@ css::uno::Sequence< OUString > Access::getElementNames()
osl::MutexGuard g(*lock_);
checkLocalizedPropertyAccess();
std::vector< rtl::Reference< ChildAccess > > children(getAllChildren());
- std::vector< OUString > names;
+ std::vector<OUString> names;
for (std::vector< rtl::Reference< ChildAccess > >::iterator i(
children.begin());
i != children.end(); ++i)
@@ -1673,7 +1672,7 @@ void Access::commitChildChanges(
}
}
if (childValid && i->second.directlyModified) {
- Path path(getAbsolutePath());
+ std::vector<OUString> path(getAbsolutePath());
path.push_back(i->first);
components_.addModification(path);
globalModifications->add(path);
@@ -2100,8 +2099,8 @@ rtl::Reference< ChildAccess > Access::getSubChild(OUString const & path) {
if (!getRootAccess().is()) {
return rtl::Reference< ChildAccess >();
}
- Path abs(getAbsolutePath());
- for (Path::iterator j(abs.begin()); j != abs.end(); ++j) {
+ std::vector<OUString> abs(getAbsolutePath());
+ for (auto j(abs.begin()); j != abs.end(); ++j) {
OUString name1;
bool setElement1;
OUString templateName1;
diff --git a/configmgr/source/access.hxx b/configmgr/source/access.hxx
index 5a71adb6f569..63cba6907a5f 100644
--- a/configmgr/source/access.hxx
+++ b/configmgr/source/access.hxx
@@ -62,7 +62,6 @@
#include <sal/types.h>
#include "modifications.hxx"
-#include "path.hxx"
#include "type.hxx"
namespace com { namespace sun { namespace star {
@@ -120,8 +119,8 @@ public:
void markChildAsModified(rtl::Reference< ChildAccess > const & child);
void releaseChild(OUString const & name);
- virtual Path getAbsolutePath() = 0;
- virtual Path getRelativePath() = 0;
+ virtual std::vector<OUString> getAbsolutePath() = 0;
+ virtual std::vector<OUString> getRelativePath() = 0;
virtual OUString getRelativePathRepresentation() = 0;
virtual rtl::Reference< Node > getNode() = 0;
@@ -438,7 +437,7 @@ protected:
const = 0;
virtual void addSupportedServiceNames(
- std::vector< OUString > * services) = 0;
+ std::vector<OUString> * services) = 0;
virtual void initDisposeBroadcaster(Broadcaster * broadcaster);
virtual void clearListeners() throw ();
diff --git a/configmgr/source/additions.hxx b/configmgr/source/additions.hxx
index 399528dfa4b7..1bc779e2fcea 100644
--- a/configmgr/source/additions.hxx
+++ b/configmgr/source/additions.hxx
@@ -23,12 +23,11 @@
#include <sal/config.h>
#include <list>
-
-#include "path.hxx"
+#include <vector>
namespace configmgr {
-
-typedef std::list< Path > Additions;
+// Additions is a list of configuration node paths
+typedef std::list< std::vector<OUString> > Additions;
}
diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx
index 576fbb308b23..2cde81159b4a 100644
--- a/configmgr/source/childaccess.cxx
+++ b/configmgr/source/childaccess.cxx
@@ -53,7 +53,6 @@
#include "lock.hxx"
#include "modifications.hxx"
#include "node.hxx"
-#include "path.hxx"
#include "propertynode.hxx"
#include "rootaccess.hxx"
#include "setnode.hxx"
@@ -91,16 +90,16 @@ ChildAccess::ChildAccess(
assert(root.is() && node.is());
}
-Path ChildAccess::getAbsolutePath() {
+std::vector<OUString> ChildAccess::getAbsolutePath() {
rtl::Reference< Access > parent(getParentAccess());
assert(parent.is());
- Path path(parent->getAbsolutePath());
+ std::vector<OUString> path(parent->getAbsolutePath());
path.push_back(name_);
return path;
}
-Path ChildAccess::getRelativePath() {
- Path path;
+std::vector<OUString> ChildAccess::getRelativePath() {
+ std::vector<OUString> path;
rtl::Reference< Access > parent(getParentAccess());
if (parent.is()) {
path = parent->getRelativePath();
@@ -301,7 +300,7 @@ void ChildAccess::commitChanges(bool valid, Modifications * globalModifications)
assert(globalModifications != nullptr);
commitChildChanges(valid, globalModifications);
if (valid && changedValue_.get() != nullptr) {
- Path path(getAbsolutePath());
+ std::vector<OUString> path(getAbsolutePath());
getComponents().addModification(path);
globalModifications->add(path);
switch (node_->kind()) {
@@ -335,7 +334,7 @@ void ChildAccess::addTypes(std::vector< css::uno::Type > * types) const {
}
void ChildAccess::addSupportedServiceNames(
- std::vector< OUString > * services)
+ std::vector<OUString> * services)
{
assert(services != nullptr);
services->push_back(
diff --git a/configmgr/source/childaccess.hxx b/configmgr/source/childaccess.hxx
index 703b28a21f0b..9a43d86e8c21 100644
--- a/configmgr/source/childaccess.hxx
+++ b/configmgr/source/childaccess.hxx
@@ -35,7 +35,6 @@
#include <sal/types.h>
#include "access.hxx"
-#include "path.hxx"
namespace com { namespace sun { namespace star { namespace uno {
class Any;
@@ -66,8 +65,8 @@ public:
Components & components, rtl::Reference< RootAccess > const & root,
rtl::Reference< Node > const & node);
- virtual Path getAbsolutePath() override;
- virtual Path getRelativePath() override;
+ virtual std::vector<OUString> getAbsolutePath() override;
+ virtual std::vector<OUString> getRelativePath() override;
virtual OUString getRelativePathRepresentation() override;
virtual rtl::Reference< Node > getNode() override;
@@ -125,7 +124,7 @@ private:
std::vector< css::uno::Type > * types) const override;
virtual void addSupportedServiceNames(
- std::vector< OUString > * services) override;
+ std::vector<OUString> * services) override;
virtual css::uno::Any SAL_CALL queryInterface(
css::uno::Type const & aType)
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index 3ba26407b4b3..294001b03299 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -217,7 +217,7 @@ bool Components::allLocales(OUString const & locale) {
rtl::Reference< Node > Components::resolvePathRepresentation(
OUString const & pathRepresentation,
- OUString * canonicRepresentation, Path * path, int * finalizedLayer)
+ OUString * canonicRepresentation, std::vector<OUString> * path, int * finalizedLayer)
const
{
return data_.resolvePathRepresentation(
@@ -251,9 +251,9 @@ void Components::initGlobalBroadcaster(
(*i)->releaseNondeleting();
if (root.is()) {
if (root != exclude) {
- Path path(root->getAbsolutePath());
+ std::vector<OUString> path(root->getAbsolutePath());
Modifications::Node const * mods = &modifications.getRoot();
- for (Path::iterator j(path.begin()); j != path.end(); ++j) {
+ for (auto j(path.begin()); j != path.end(); ++j) {
Modifications::Node::Children::const_iterator k(
mods->children.find(*j));
if (k == mods->children.end()) {
@@ -273,7 +273,7 @@ void Components::initGlobalBroadcaster(
}
}
-void Components::addModification(Path const & path) {
+void Components::addModification(std::vector<OUString> const & path) {
data_.modifications.add(path);
}
@@ -364,7 +364,7 @@ void Components::removeExtensionXcuFile(
rtl::Reference< Node > parent;
NodeMap const * map = &data_.getComponents();
rtl::Reference< Node > node;
- for (Path::const_iterator j(i->begin()); j != i->end(); ++j) {
+ for (auto j(i->begin()); j != i->end(); ++j) {
parent = node;
node = map->findNode(Data::NO_LAYER, *j);
if (!node.is()) {
diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx
index 48ec3a8a397b..1ca24d638087 100644
--- a/configmgr/source/components.hxx
+++ b/configmgr/source/components.hxx
@@ -33,7 +33,6 @@
#include "additions.hxx"
#include "data.hxx"
#include "modifications.hxx"
-#include "path.hxx"
namespace com { namespace sun { namespace star {
namespace beans { class XPropertySet; }
@@ -59,7 +58,7 @@ public:
rtl::Reference< Node > resolvePathRepresentation(
OUString const & pathRepresentation,
- OUString * canonicRepresenation, Path * path, int * finalizedLayer)
+ OUString * canonicRepresenation, std::vector<OUString> * path, int * finalizedLayer)
const;
rtl::Reference< Node > getTemplate(
@@ -74,7 +73,7 @@ public:
rtl::Reference< RootAccess > const & exclude,
Broadcaster * broadcaster);
- void addModification(Path const & path);
+ void addModification(std::vector<OUString> const & path);
void writeModifications();
diff --git a/configmgr/source/data.cxx b/configmgr/source/data.cxx
index ac3cff0e2f1e..70ce467b8805 100644
--- a/configmgr/source/data.cxx
+++ b/configmgr/source/data.cxx
@@ -183,7 +183,7 @@ Data::Data(): root_(new RootNode) {}
rtl::Reference< Node > Data::resolvePathRepresentation(
OUString const & pathRepresentation,
- OUString * canonicRepresentation, Path * path, int * finalizedLayer)
+ OUString * canonicRepresentation, std::vector<OUString> * path, int * finalizedLayer)
const
{
if (pathRepresentation.isEmpty() || pathRepresentation[0] != '/') {
diff --git a/configmgr/source/data.hxx b/configmgr/source/data.hxx
index e0293b518390..315fe7b9bf47 100644
--- a/configmgr/source/data.hxx
+++ b/configmgr/source/data.hxx
@@ -34,7 +34,6 @@
#include "additions.hxx"
#include "modifications.hxx"
#include "nodemap.hxx"
-#include "path.hxx"
namespace configmgr {
@@ -70,7 +69,7 @@ struct Data {
rtl::Reference< Node > resolvePathRepresentation(
OUString const & pathRepresentation,
- OUString * canonicRepresenation, Path * path, int * finalizedLayer)
+ OUString * canonicRepresenation, std::vector<OUString> * path, int * finalizedLayer)
const;
rtl::Reference< Node > getTemplate(
diff --git a/configmgr/source/modifications.cxx b/configmgr/source/modifications.cxx
index 6b8cdf60aab3..630de8fbc8a6 100644
--- a/configmgr/source/modifications.cxx
+++ b/configmgr/source/modifications.cxx
@@ -24,7 +24,6 @@
#include <rtl/ustring.hxx>
#include "modifications.hxx"
-#include "path.hxx"
namespace configmgr {
@@ -32,10 +31,10 @@ Modifications::Modifications() {}
Modifications::~Modifications() {}
-void Modifications::add(Path const & path) {
+void Modifications::add(std::vector<OUString> const & path) {
Node * p = &root_;
bool wasPresent = false;
- for (Path::const_iterator i(path.begin()); i != path.end(); ++i) {
+ for (auto i(path.begin()); i != path.end(); ++i) {
Node::Children::iterator j(p->children.find(*i));
if (j == p->children.end()) {
if (wasPresent && p->children.empty()) {
@@ -52,10 +51,10 @@ void Modifications::add(Path const & path) {
p->children.clear();
}
-void Modifications::remove(Path const & path) {
+void Modifications::remove(std::vector<OUString> const & path) {
assert(!path.empty());
Node * p = &root_;
- for (Path::const_iterator i(path.begin());;) {
+ for (auto i(path.begin());;) {
Node::Children::iterator j(p->children.find(*i));
if (j == p->children.end()) {
break;
@@ -63,7 +62,7 @@ void Modifications::remove(Path const & path) {
if (++i == path.end()) {
p->children.erase(j);
if (p->children.empty()) {
- Path parent(path);
+ std::vector<OUString> parent(path);
parent.pop_back();
remove(parent);
}
diff --git a/configmgr/source/modifications.hxx b/configmgr/source/modifications.hxx
index 5549e14a4d7c..7aa93bf53381 100644
--- a/configmgr/source/modifications.hxx
+++ b/configmgr/source/modifications.hxx
@@ -26,8 +26,6 @@
#include <config_dconf.h>
-#include "path.hxx"
-
namespace configmgr {
class Modifications {
@@ -42,9 +40,9 @@ public:
~Modifications();
- void add(Path const & path);
+ void add(std::vector<OUString> const & path);
- void remove(Path const & path);
+ void remove(std::vector<OUString> const & path);
#if ENABLE_DCONF
void clear() { root_.children.clear(); }
diff --git a/configmgr/source/partial.cxx b/configmgr/source/partial.cxx
index 3b39b6edddba..d0ba41aba1ee 100644
--- a/configmgr/source/partial.cxx
+++ b/configmgr/source/partial.cxx
@@ -109,7 +109,7 @@ Partial::Partial(
Partial::~Partial() {}
-Partial::Containment Partial::contains(Path const & path) const {
+Partial::Containment Partial::contains(std::vector<OUString> const & path) const {
//TODO: For set elements, the segment names recorded in the node tree need
// not match the corresponding path segments, so this function can fail.
@@ -121,7 +121,7 @@ Partial::Containment Partial::contains(Path const & path) const {
// ** If there is no startInclude along its trace: => CONTAINS_SUBNODES
Node const * p = &root_;
bool bIncludes = false;
- for (Path::const_iterator i(path.begin()); i != path.end(); ++i) {
+ for (auto i(path.begin()); i != path.end(); ++i) {
Node::Children::const_iterator j(p->children.find(*i));
if (j == p->children.end()) {
return p->startInclude ? CONTAINS_NODE : CONTAINS_NOT;
diff --git a/configmgr/source/partial.hxx b/configmgr/source/partial.hxx
index e7641e2c974b..bbb9a135ea4c 100644
--- a/configmgr/source/partial.hxx
+++ b/configmgr/source/partial.hxx
@@ -25,7 +25,6 @@
#include <set>
#include <boost/unordered_map.hpp>
-#include "path.hxx"
#include <rtl/ustring.hxx>
namespace configmgr {
@@ -40,7 +39,7 @@ public:
~Partial();
- Containment contains(Path const & path) const;
+ Containment contains(std::vector<OUString> const & path) const;
private:
Partial(const Partial&) = delete;
diff --git a/configmgr/source/path.hxx b/configmgr/source/path.hxx
deleted file mode 100644
index 9c5b54913ee2..000000000000
--- a/configmgr/source/path.hxx
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_CONFIGMGR_SOURCE_PATH_HXX
-#define INCLUDED_CONFIGMGR_SOURCE_PATH_HXX
-
-#include <sal/config.h>
-
-#include <vector>
-
-
-namespace configmgr {
-
-typedef std::vector< OUString > Path;
-
-}
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/configmgr/source/rootaccess.cxx b/configmgr/source/rootaccess.cxx
index 09ccd98bbcef..a84898df0bbf 100644
--- a/configmgr/source/rootaccess.cxx
+++ b/configmgr/source/rootaccess.cxx
@@ -52,7 +52,6 @@
#include "lock.hxx"
#include "modifications.hxx"
#include "node.hxx"
-#include "path.hxx"
#include "rootaccess.hxx"
namespace configmgr {
@@ -67,7 +66,7 @@ RootAccess::RootAccess(
{
}
-Path RootAccess::getAbsolutePath() {
+std::vector<OUString> RootAccess::getAbsolutePath() {
getNode();
return path_;
}
@@ -205,8 +204,8 @@ RootAccess::~RootAccess()
getComponents().removeRootAccess(this);
}
-Path RootAccess::getRelativePath() {
- return Path();
+std::vector<OUString> RootAccess::getRelativePath() {
+ return std::vector<OUString>();
}
OUString RootAccess::getRelativePathRepresentation() {
@@ -263,7 +262,7 @@ void RootAccess::addTypes(std::vector< css::uno::Type > * types) const {
}
void RootAccess::addSupportedServiceNames(
- std::vector< OUString > * services)
+ std::vector<OUString> * services)
{
assert(services != nullptr);
services->push_back("com.sun.star.configuration.AccessRootElement");
diff --git a/configmgr/source/rootaccess.hxx b/configmgr/source/rootaccess.hxx
index abde6fc2771d..4c16a2932ea4 100644
--- a/configmgr/source/rootaccess.hxx
+++ b/configmgr/source/rootaccess.hxx
@@ -37,7 +37,6 @@
#include "access.hxx"
#include "modifications.hxx"
-#include "path.hxx"
namespace com { namespace sun { namespace star {
namespace uno {
@@ -62,7 +61,7 @@ public:
Components & components, OUString const & pathRepresenation,
OUString const & locale, bool update);
- virtual Path getAbsolutePath() override;
+ virtual std::vector<OUString> getAbsolutePath() override;
virtual void initBroadcaster(
Modifications::Node const & modifications, Broadcaster * broadcaster) override;
@@ -104,7 +103,7 @@ public:
private:
virtual ~RootAccess();
- virtual Path getRelativePath() override;
+ virtual std::vector<OUString> getRelativePath() override;
virtual OUString getRelativePathRepresentation() override;
@@ -122,7 +121,7 @@ private:
const override;
virtual void addSupportedServiceNames(
- std::vector< OUString > * services) override;
+ std::vector<OUString> * services) override;
virtual void initDisposeBroadcaster(Broadcaster * broadcaster) override;
@@ -143,7 +142,7 @@ private:
OUString pathRepresentation_;
OUString locale_;
- Path path_;
+ std::vector<OUString> path_;
rtl::Reference< Node > node_;
OUString name_;
ChangesListeners changesListeners_;
diff --git a/configmgr/source/setnode.hxx b/configmgr/source/setnode.hxx
index e0ce35f67a7d..1638eb622254 100644
--- a/configmgr/source/setnode.hxx
+++ b/configmgr/source/setnode.hxx
@@ -50,7 +50,7 @@ public:
OUString const & getDefaultTemplateName() const { return defaultTemplateName_;}
- std::vector< OUString > & getAdditionalTemplateNames() { return additionalTemplateNames_;}
+ std::vector<OUString> & getAdditionalTemplateNames() { return additionalTemplateNames_;}
bool isValidTemplate(OUString const & templateName) const;
@@ -62,7 +62,7 @@ private:
virtual Kind kind() const override;
OUString defaultTemplateName_;
- std::vector< OUString > additionalTemplateNames_;
+ std::vector<OUString> additionalTemplateNames_;
NodeMap members_;
OUString templateName_;
// non-empty if this node is a template, free node, or set member
diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx
index 4d239ab4f1f9..ca811040ddcd 100644
--- a/configmgr/source/xcuparser.cxx
+++ b/configmgr/source/xcuparser.cxx
@@ -46,7 +46,6 @@
#include "nodemap.hxx"
#include "parsemanager.hxx"
#include "partial.hxx"
-#include "path.hxx"
#include "propertynode.hxx"
#include "setnode.hxx"
#include "xcuparser.hxx"
diff --git a/configmgr/source/xcuparser.hxx b/configmgr/source/xcuparser.hxx
index 9628db292790..f7bc15839462 100644
--- a/configmgr/source/xcuparser.hxx
+++ b/configmgr/source/xcuparser.hxx
@@ -33,7 +33,6 @@
#include "node.hxx"
#include "nodemap.hxx"
#include "parser.hxx"
-#include "path.hxx"
#include "type.hxx"
#include "valueparser.hxx"
#include "xmldata.hxx"
@@ -147,7 +146,7 @@ private:
bool trackPath_;
OUString componentName_;
StateStack state_;
- Path path_;
+ std::vector<OUString> path_;
};
}