summaryrefslogtreecommitdiff
path: root/configmgr
diff options
context:
space:
mode:
authorPhilipp Hofer <philipp.hofer@protonmail.com>2020-11-12 12:52:11 +0100
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2020-11-22 01:57:11 +0100
commit315f270d2db7541e9400852b070afb30f371f644 (patch)
tree19dee369c79fd0f48976aed0133c34f788303909 /configmgr
parent1e17165f6643afe583bb97a40fb25ecb7bab24d9 (diff)
tdf#123936 Formatting files in module configmgr with clang-format
Change-Id: I51bd9777e51e4d8b745791bdde41e142db217d32 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105655 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Jenkins
Diffstat (limited to 'configmgr')
-rw-r--r--configmgr/source/additions.hxx6
-rw-r--r--configmgr/source/config_map.hxx6
-rw-r--r--configmgr/source/defaultprovider.cxx16
-rw-r--r--configmgr/source/defaultprovider.hxx8
-rw-r--r--configmgr/source/groupnode.hxx21
-rw-r--r--configmgr/source/localizedpropertynode.hxx23
-rw-r--r--configmgr/source/localizedvaluenode.hxx19
-rw-r--r--configmgr/source/lock.cxx7
-rw-r--r--configmgr/source/lock.hxx7
-rw-r--r--configmgr/source/modifications.hxx17
-rw-r--r--configmgr/source/nodemap.cxx16
-rw-r--r--configmgr/source/rootnode.hxx12
12 files changed, 75 insertions, 83 deletions
diff --git a/configmgr/source/additions.hxx b/configmgr/source/additions.hxx
index 6dedf1b5303e..9f50f187813b 100644
--- a/configmgr/source/additions.hxx
+++ b/configmgr/source/additions.hxx
@@ -25,10 +25,10 @@
#include <vector>
-namespace configmgr {
+namespace configmgr
+{
// Additions is a list of configuration node paths
-typedef std::vector< std::vector<OUString> > Additions;
-
+typedef std::vector<std::vector<OUString>> Additions;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/configmgr/source/config_map.hxx b/configmgr/source/config_map.hxx
index 0bba60020253..af15f23ae9cf 100644
--- a/configmgr/source/config_map.hxx
+++ b/configmgr/source/config_map.hxx
@@ -19,7 +19,7 @@
struct LengthContentsCompare
{
- bool operator()( const OUString &a, const OUString &b ) const
+ bool operator()(const OUString& a, const OUString& b) const
{
if (a.getLength() == b.getLength())
return a < b;
@@ -28,7 +28,9 @@ struct LengthContentsCompare
}
};
-template< class T > struct config_map : public std::map< OUString, T, LengthContentsCompare > { };
+template <class T> struct config_map : public std::map<OUString, T, LengthContentsCompare>
+{
+};
#endif // CONFIG_MAP_HXX
diff --git a/configmgr/source/defaultprovider.cxx b/configmgr/source/defaultprovider.cxx
index 131f548a039e..59f02af38107 100644
--- a/configmgr/source/defaultprovider.cxx
+++ b/configmgr/source/defaultprovider.cxx
@@ -34,22 +34,20 @@ com_sun_star_comp_configuration_DefaultProvider_get_implementation(
css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
{
osl::MutexGuard guard(*configmgr::lock());
- css::uno::Reference< css::uno::XInterface > singleton(
+ css::uno::Reference<css::uno::XInterface> singleton(
configmgr::configuration_provider::createDefault(context));
singleton->acquire();
return singleton.get();
}
-namespace configmgr::default_provider {
-
-OUString getImplementationName() {
- return "com.sun.star.comp.configuration.DefaultProvider";
-}
+namespace configmgr::default_provider
+{
+OUString getImplementationName() { return "com.sun.star.comp.configuration.DefaultProvider"; }
-css::uno::Sequence< OUString > getSupportedServiceNames() {
- return css::uno::Sequence< OUString > { "com.sun.star.configuration.DefaultProvider" };
+css::uno::Sequence<OUString> getSupportedServiceNames()
+{
+ return css::uno::Sequence<OUString>{ "com.sun.star.configuration.DefaultProvider" };
}
-
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/configmgr/source/defaultprovider.hxx b/configmgr/source/defaultprovider.hxx
index 7c5af3100cdf..d20ba200beaf 100644
--- a/configmgr/source/defaultprovider.hxx
+++ b/configmgr/source/defaultprovider.hxx
@@ -23,13 +23,11 @@
#include <com/sun/star/uno/Sequence.hxx>
-namespace configmgr::default_provider {
-
+namespace configmgr::default_provider
+{
OUString getImplementationName();
-css::uno::Sequence< OUString >
-getSupportedServiceNames();
-
+css::uno::Sequence<OUString> getSupportedServiceNames();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/configmgr/source/groupnode.hxx b/configmgr/source/groupnode.hxx
index 6d1f300817cd..12e18b37bc90 100644
--- a/configmgr/source/groupnode.hxx
+++ b/configmgr/source/groupnode.hxx
@@ -27,15 +27,16 @@
#include "node.hxx"
#include "nodemap.hxx"
-namespace configmgr {
-
-class GroupNode: public Node {
+namespace configmgr
+{
+class GroupNode : public Node
+{
public:
- GroupNode(int layer, bool extensible, OUString const & templateName);
+ GroupNode(int layer, bool extensible, OUString const& templateName);
- virtual rtl::Reference< Node > clone(bool keepTemplateName) const override;
+ virtual rtl::Reference<Node> clone(bool keepTemplateName) const override;
- virtual NodeMap & getMembers() override;
+ virtual NodeMap& getMembers() override;
virtual OUString getTemplateName() const override;
@@ -43,10 +44,10 @@ public:
virtual int getMandatory() const override;
- bool isExtensible() const { return extensible_;}
+ bool isExtensible() const { return extensible_; }
private:
- GroupNode(GroupNode const & other, bool keepTemplateName);
+ GroupNode(GroupNode const& other, bool keepTemplateName);
virtual ~GroupNode() override;
@@ -54,11 +55,9 @@ private:
bool extensible_;
NodeMap members_;
- OUString templateName_;
- // non-empty if this node is a template, free node, or set member
+ OUString templateName_; // non-empty if this node is a template, free node, or set member
int mandatory_;
};
-
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/configmgr/source/localizedpropertynode.hxx b/configmgr/source/localizedpropertynode.hxx
index 1da1d3b66e52..c54a6c521231 100644
--- a/configmgr/source/localizedpropertynode.hxx
+++ b/configmgr/source/localizedpropertynode.hxx
@@ -27,35 +27,34 @@
#include "nodemap.hxx"
#include "type.hxx"
-
-namespace configmgr {
-
-class LocalizedPropertyNode: public Node {
+namespace configmgr
+{
+class LocalizedPropertyNode : public Node
+{
public:
LocalizedPropertyNode(int layer, Type staticType, bool nillable);
- virtual rtl::Reference< Node > clone(bool keepTemplateName) const override;
+ virtual rtl::Reference<Node> clone(bool keepTemplateName) const override;
- virtual NodeMap & getMembers() override;
+ virtual NodeMap& getMembers() override;
- Type getStaticType() const { return staticType_;}
+ Type getStaticType() const { return staticType_; }
- bool isNillable() const { return nillable_;}
+ bool isNillable() const { return nillable_; }
private:
- LocalizedPropertyNode(LocalizedPropertyNode const & other);
+ LocalizedPropertyNode(LocalizedPropertyNode const& other);
virtual ~LocalizedPropertyNode() override;
virtual Kind kind() const override;
Type staticType_;
- // as specified in the component-schema (TYPE_ANY, ...,
- // TYPE_HEXBINARY_LIST; not TYPE_ERROR or TYPE_NIL)
+ // as specified in the component-schema (TYPE_ANY, ...,
+ // TYPE_HEXBINARY_LIST; not TYPE_ERROR or TYPE_NIL)
bool nillable_;
NodeMap members_;
};
-
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/configmgr/source/localizedvaluenode.hxx b/configmgr/source/localizedvaluenode.hxx
index 55ad0979eae5..34fe2815365a 100644
--- a/configmgr/source/localizedvaluenode.hxx
+++ b/configmgr/source/localizedvaluenode.hxx
@@ -26,26 +26,26 @@
#include "node.hxx"
-
-namespace configmgr {
-
-class LocalizedValueNode: public Node {
+namespace configmgr
+{
+class LocalizedValueNode : public Node
+{
public:
explicit LocalizedValueNode(int layer);
- LocalizedValueNode(int layer, css::uno::Any const & value);
+ LocalizedValueNode(int layer, css::uno::Any const& value);
- virtual rtl::Reference< Node > clone(bool keepTemplateName) const override;
+ virtual rtl::Reference<Node> clone(bool keepTemplateName) const override;
virtual OUString getTemplateName() const override;
- const css::uno::Any& getValue() const { return value_;}
- css::uno::Any *getValuePtr(int layer)
+ const css::uno::Any& getValue() const { return value_; }
+ css::uno::Any* getValuePtr(int layer)
{
setLayer(layer);
return &value_;
}
- void setValue(int layer, css::uno::Any const & value);
+ void setValue(int layer, css::uno::Any const& value);
private:
LocalizedValueNode(LocalizedValueNode const&) = default;
@@ -56,7 +56,6 @@ private:
css::uno::Any value_;
};
-
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/configmgr/source/lock.cxx b/configmgr/source/lock.cxx
index 40a7536b8ab7..28220c15af89 100644
--- a/configmgr/source/lock.cxx
+++ b/configmgr/source/lock.cxx
@@ -23,14 +23,13 @@
#include "lock.hxx"
-namespace configmgr {
-
-std::shared_ptr<osl::Mutex> const & lock()
+namespace configmgr
+{
+std::shared_ptr<osl::Mutex> const& lock()
{
static std::shared_ptr<osl::Mutex> theLock = std::make_shared<osl::Mutex>();
return theLock;
}
-
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/configmgr/source/lock.hxx b/configmgr/source/lock.hxx
index e100a4648e79..195dbf5e72c4 100644
--- a/configmgr/source/lock.hxx
+++ b/configmgr/source/lock.hxx
@@ -23,10 +23,9 @@
#include <osl/mutex.hxx>
#include <memory>
-namespace configmgr {
-
-std::shared_ptr<osl::Mutex> const & lock();
-
+namespace configmgr
+{
+std::shared_ptr<osl::Mutex> const& lock();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/configmgr/source/modifications.hxx b/configmgr/source/modifications.hxx
index 0bc3ebb499f0..22e608ac7d72 100644
--- a/configmgr/source/modifications.hxx
+++ b/configmgr/source/modifications.hxx
@@ -28,11 +28,13 @@
#include <boost/unordered_map.hpp>
#include <config_dconf.h>
-namespace configmgr {
-
-class Modifications {
+namespace configmgr
+{
+class Modifications
+{
public:
- struct Node {
+ struct Node
+ {
typedef boost::unordered_map<OUString, Node, OUStringHash> Children;
Children children;
@@ -42,9 +44,9 @@ public:
~Modifications();
- void add(std::vector<OUString> const & path);
+ void add(std::vector<OUString> const& path);
- void remove(std::vector<OUString> const & path);
+ void remove(std::vector<OUString> const& path);
#if ENABLE_DCONF
void clear() { root_.children.clear(); }
@@ -52,7 +54,7 @@ public:
bool empty() const { return root_.children.empty(); }
- Node const & getRoot() const { return root_;}
+ Node const& getRoot() const { return root_; }
private:
Modifications(const Modifications&) = delete;
@@ -60,7 +62,6 @@ private:
Node root_;
};
-
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/configmgr/source/nodemap.cxx b/configmgr/source/nodemap.cxx
index defbc6868b32..e21578b2880b 100644
--- a/configmgr/source/nodemap.cxx
+++ b/configmgr/source/nodemap.cxx
@@ -26,13 +26,13 @@
#include "node.hxx"
#include "nodemap.hxx"
-namespace configmgr {
-
-void NodeMap::cloneInto(NodeMap * target) const
+namespace configmgr
+{
+void NodeMap::cloneInto(NodeMap* target) const
{
assert(target != nullptr && target->empty());
NodeMapImpl clone(maImpl);
- for (auto & elem : clone)
+ for (auto& elem : clone)
{
elem.second = elem.second->clone(true);
}
@@ -40,16 +40,14 @@ void NodeMap::cloneInto(NodeMap * target) const
target->clearCache();
}
-rtl::Reference< Node > NodeMap::findNode(int layer, OUString const & name) const
+rtl::Reference<Node> NodeMap::findNode(int layer, OUString const& name) const
{
const_iterator i;
if (maCache == end() || maCache->first != name)
- maCache = const_cast< NodeMap *>(this)->maImpl.find(name);
+ maCache = const_cast<NodeMap*>(this)->maImpl.find(name);
i = maCache;
- return i == end() || i->second->getLayer() > layer
- ? rtl::Reference< Node >() : i->second;
+ return i == end() || i->second->getLayer() > layer ? rtl::Reference<Node>() : i->second;
}
-
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/configmgr/source/rootnode.hxx b/configmgr/source/rootnode.hxx
index 4f53bffb72ad..84e10ef2667e 100644
--- a/configmgr/source/rootnode.hxx
+++ b/configmgr/source/rootnode.hxx
@@ -16,9 +16,10 @@
#include "node.hxx"
#include "nodemap.hxx"
-namespace configmgr {
-
-class RootNode: public Node {
+namespace configmgr
+{
+class RootNode : public Node
+{
public:
RootNode();
@@ -27,13 +28,12 @@ private:
virtual Kind kind() const override;
- virtual rtl::Reference< Node > clone(bool keepTemplateName) const override;
+ virtual rtl::Reference<Node> clone(bool keepTemplateName) const override;
- virtual NodeMap & getMembers() override;
+ virtual NodeMap& getMembers() override;
NodeMap members_;
};
-
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */