configmgr/source/access.cxx        |   11 +++++------
 configmgr/source/access.hxx        |    7 +++----
 configmgr/source/additions.hxx     |    7 +++----
 configmgr/source/childaccess.cxx   |   13 ++++++-------
 configmgr/source/childaccess.hxx   |    7 +++----
 configmgr/source/components.cxx    |   10 +++++-----
 configmgr/source/components.hxx    |    5 ++---
 configmgr/source/data.cxx          |    2 +-
 configmgr/source/data.hxx          |    3 +--
 configmgr/source/modifications.cxx |   11 +++++------
 configmgr/source/modifications.hxx |    6 ++----
 configmgr/source/partial.cxx       |    4 ++--
 configmgr/source/partial.hxx       |    3 +--
 configmgr/source/path.hxx          |   36 ------------------------------------
 configmgr/source/rootaccess.cxx    |    9 ++++-----
 configmgr/source/rootaccess.hxx    |    9 ++++-----
 configmgr/source/setnode.hxx       |    4 ++--
 configmgr/source/xcuparser.cxx     |    1 -
 configmgr/source/xcuparser.hxx     |    3 +--
 19 files changed, 50 insertions(+), 101 deletions(-)

New commits:
commit 89e0663c55f7f1763536a345d63111115c71ef26
Author: Jakub Trzebiatowski <ubap....@gmail.com>
Date:   Mon Mar 7 19:48:23 2016 +0100

    tdf#96099 fix trival typedefs, Path to std::vector<OUString>
    
    Change-Id: I23fca48becbfdfd92db02a11b739a668fc1cd8c4
    Reviewed-on: https://gerrit.libreoffice.org/23007
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Noel Grandin <noelgran...@gmail.com>

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 97543bb..3506beb 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 5a71adb..63cba69 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 399528d..1bc779e 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 576fbb3..2cde811 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 703b28a..9a43d86 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 3ba2640..294001b 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 48ec3a8..1ca24d6 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 ac3cff0..70ce467 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 e0293b5..315fe7b 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 6b8cdf6..630de8f 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 5549e14..7aa93bf 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 3b39b6e..d0ba41a 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 e7641e2..bbb9a13 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 9c5b549..0000000
--- 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 09ccd98..a84898d 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 abde6fc..4c16a29 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 e0ce35f..1638eb6 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 4d239ab..ca81104 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 9628db2..f7bc158 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_;
 };
 
 }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to