[Libreoffice-commits] core.git: configmgr/source cui/source cui/uiconfig offapi/com vcl/source vcl/unx

2023-12-06 Thread Samuel Mehrbrodt (via logerrit)
 configmgr/source/access.cxx  |   22 ++
 configmgr/source/access.hxx  |3 
 configmgr/source/childaccess.cxx |4 
 configmgr/source/dconf.cxx   |4 
 configmgr/source/localizedvaluenode.cxx  |5 
 configmgr/source/localizedvaluenode.hxx  |8 
 configmgr/source/propertynode.cxx|9 -
 configmgr/source/propertynode.hxx|8 
 configmgr/source/valueparser.cxx |5 
 configmgr/source/xcuparser.cxx   |4 
 cui/source/options/optaboutconfig.cxx|  154 +++
 cui/source/options/optaboutconfig.hxx|6 
 cui/uiconfig/ui/aboutconfigdialog.ui |   18 ++
 offapi/com/sun/star/configuration/XDocumentation.idl |   16 +
 vcl/source/app/salvtables.cxx|   15 +
 vcl/unx/gtk3/gtkinst.cxx |   18 +-
 16 files changed, 216 insertions(+), 83 deletions(-)

New commits:
commit 030b72df0af04752157378e07703db0e035ff9c2
Author: Samuel Mehrbrodt 
AuthorDate: Mon Nov 27 11:01:09 2023 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Thu Dec 7 08:03:36 2023 +0100

tdf#157432 Expert config: Allow filtering by changed values

Change-Id: Ib8bbb7fc9e8014a9367278f3fa640f53af46dd2b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159986
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 371ebdc95b06..3075bc0a32f6 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -478,6 +478,28 @@ css::uno::Type Access::getTypeByHierarchicalName(OUString 
const & aName)
 }
 }
 
+sal_Bool Access::getModifiedByHierarchicalName(OUString const & aName)
+{
+assert(thisIs(IS_ANY));
+osl::MutexGuard g(*lock_);
+checkLocalizedPropertyAccess();
+rtl::Reference< ChildAccess > child(getSubChild(aName));
+if (!child.is()) {
+throw css::container::NoSuchElementException(
+aName, getXWeak());
+}
+auto const & p = child->getNode();
+switch (p->kind()) {
+case Node::KIND_PROPERTY:
+return static_cast(p.get())->isModified();
+case Node::KIND_LOCALIZED_VALUE:
+return static_cast(p.get())->isModified();
+default:
+throw css::util::InvalidStateException(
+aName, getXWeak());
+}
+}
+
 sal_Bool Access::hasByHierarchicalName(OUString const & aName)
 {
 assert(thisIs(IS_ANY));
diff --git a/configmgr/source/access.hxx b/configmgr/source/access.hxx
index a94d20a6bce6..bd93b4222177 100644
--- a/configmgr/source/access.hxx
+++ b/configmgr/source/access.hxx
@@ -168,6 +168,9 @@ public:
 virtual css::uno::Type SAL_CALL getTypeByHierarchicalName(
 OUString const & aName) override;
 
+virtual sal_Bool SAL_CALL getModifiedByHierarchicalName(
+OUString const & aName) override;
+
 virtual sal_Bool SAL_CALL hasByHierarchicalName(OUString const & aName) 
override;
 
 virtual void SAL_CALL replaceByHierarchicalName(
diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx
index e0a9f9ac6cee..abf3795f1d55 100644
--- a/configmgr/source/childaccess.cxx
+++ b/configmgr/source/childaccess.cxx
@@ -279,11 +279,11 @@ void ChildAccess::commitChanges(bool valid, Modifications 
* globalModifications)
 switch (node_->kind()) {
 case Node::KIND_PROPERTY:
 static_cast< PropertyNode * >(node_.get())->setValue(
-Data::NO_LAYER, *changedValue_);
+Data::NO_LAYER, *changedValue_, true);
 break;
 case Node::KIND_LOCALIZED_VALUE:
 static_cast< LocalizedValueNode * >(node_.get())->setValue(
-Data::NO_LAYER, *changedValue_);
+Data::NO_LAYER, *changedValue_, true);
 break;
 default:
 assert(false); // this cannot happen
diff --git a/configmgr/source/dconf.cxx b/configmgr/source/dconf.cxx
index 8548daa46b3c..c12f4a2814fd 100644
--- a/configmgr/source/dconf.cxx
+++ b/configmgr/source/dconf.cxx
@@ -973,7 +973,7 @@ void readDir(
 case ReadValue::Error:
 continue;
 case ReadValue::Value:
-prop->setValue(layer, value);
+prop->setValue(layer, value, false);
 finalize(client, path, member, layer);
 break;
 case ReadValue::Remove:
@@ -1005,7 +1005,7 @@ void readDir(
 continue;
 }
 static_cast(member.get())->setValue(
-layer, value);
+layer, value, false);
 finalize(client, path, member, layer);
 break;
 }
diff 

[Libreoffice-commits] core.git: configmgr/source

2023-11-26 Thread Stephan Bergmann (via logerrit)
 configmgr/source/access.cxx|   11 ---
 configmgr/source/node.hxx  |6 --
 configmgr/source/xcsparser.cxx |8 +++-
 configmgr/source/xcsparser.hxx |1 -
 4 files changed, 11 insertions(+), 15 deletions(-)

New commits:
commit 3ff66d4361c3394d8669f3a367f41d4bad9914e7
Author: Stephan Bergmann 
AuthorDate: Sun Nov 26 10:11:34 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Sun Nov 26 13:19:56 2023 +0100

Simplify implementation of getTypeByHierarchicalName

(Localized)PropertyType::getStaticType already provides the relevant 
information

Change-Id: I5aceb596ac4a2d111ebcb5ddef7ef74c80762047
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159969
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index c802f62494f0..371ebdc95b06 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -466,11 +466,16 @@ css::uno::Type Access::getTypeByHierarchicalName(OUString 
const & aName)
 throw css::container::NoSuchElementException(
 aName, getXWeak());
 }
-auto type = child->getNode()->getType();
-if (type == TYPE_ERROR)
+auto const & p = child->getNode();
+switch (p->kind()) {
+case Node::KIND_PROPERTY:
+return mapType(static_cast(p.get())->getStaticType());
+case Node::KIND_LOCALIZED_PROPERTY:
+return mapType(static_cast(p.get())->getStaticType());
+default:
 throw css::util::InvalidStateException(
 aName, getXWeak());
-return mapType(child->getNode()->getType());
+}
 }
 
 sal_Bool Access::hasByHierarchicalName(OUString const & aName)
diff --git a/configmgr/source/node.hxx b/configmgr/source/node.hxx
index 68664e870e35..cce8e3d4abb3 100644
--- a/configmgr/source/node.hxx
+++ b/configmgr/source/node.hxx
@@ -27,8 +27,6 @@
 #include 
 #include 
 
-#include "type.hxx"
-
 namespace configmgr {
 
 class NodeMap;
@@ -58,9 +56,6 @@ public:
 void setDescription(OUString const& description) { description_ = 
description; };
 OUString getDescription() { return description_; }
 
-void setType(Type const& type) { type_ = type; };
-Type getType() { return type_; }
-
 rtl::Reference< Node > getMember(OUString const & name);
 
 protected:
@@ -72,7 +67,6 @@ private:
 int layer_;
 int finalized_;
 OUString description_;
-Type type_ = TYPE_ERROR;
 };
 
 }
diff --git a/configmgr/source/xcsparser.cxx b/configmgr/source/xcsparser.cxx
index 50d7b9fa4791..e70ddac6a6c9 100644
--- a/configmgr/source/xcsparser.cxx
+++ b/configmgr/source/xcsparser.cxx
@@ -316,7 +316,6 @@ void XcsParser::endElement(xmlreader::XmlReader const & 
reader) {
 while (desc.indexOf("  ") != -1)
 desc = desc.replaceAll("  ", " ");
 top.node->setDescription(desc);
-top.node->setType(type_);
 }
 if (elements_.empty()) {
 switch (state_) {
@@ -478,7 +477,7 @@ void XcsParser::handleNodeRef(xmlreader::XmlReader & 
reader) {
 void XcsParser::handleProp(xmlreader::XmlReader & reader) {
 bool hasName = false;
 OUString name;
-type_ = TYPE_ERROR;
+valueParser_.type_ = TYPE_ERROR;
 bool localized = false;
 bool nillable = true;
 for (;;) {
@@ -493,7 +492,7 @@ void XcsParser::handleProp(xmlreader::XmlReader & reader) {
 } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn == "type")
 {
-type_ = xmldata::parseType(
+valueParser_.type_ = xmldata::parseType(
 reader, reader.getAttributeValue(true));
 } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn == "localized")
@@ -509,11 +508,10 @@ void XcsParser::handleProp(xmlreader::XmlReader & reader) 
{
 throw css::uno::RuntimeException(
 "no prop name attribute in " + reader.getUrl());
 }
-if (type_ == TYPE_ERROR) {
+if (valueParser_.type_ == TYPE_ERROR) {
 throw css::uno::RuntimeException(
 "no prop type attribute in " + reader.getUrl());
 }
-valueParser_.type_ = type_;
 elements_.push(
 Element(
 (localized
diff --git a/configmgr/source/xcsparser.hxx b/configmgr/source/xcsparser.hxx
index 6e8ff7d2367d..aedcccde1147 100644
--- a/configmgr/source/xcsparser.hxx
+++ b/configmgr/source/xcsparser.hxx
@@ -96,7 +96,6 @@ private:
 ElementStack elements_;
 bool bIsParsingInfo_;
 OUStringBuffer description_;
-Type type_;
 };
 
 }


[Libreoffice-commits] core.git: configmgr/source

2023-11-25 Thread Stephan Bergmann (via logerrit)
 configmgr/source/xcsparser.cxx |   28 
 1 file changed, 16 insertions(+), 12 deletions(-)

New commits:
commit 8ac9ef88ce9cf8a78748d420639eec0f23735e47
Author: Stephan Bergmann 
AuthorDate: Sat Nov 25 14:54:27 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Sat Nov 25 23:10:06 2023 +0100

Simplify description/type parsing a bit

...it only pertains to property nodes

Change-Id: I706e14118e3f8c33190821f9bcce81bd60d665e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159953
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/configmgr/source/xcsparser.cxx b/configmgr/source/xcsparser.cxx
index d4e35cc75c39..50d7b9fa4791 100644
--- a/configmgr/source/xcsparser.cxx
+++ b/configmgr/source/xcsparser.cxx
@@ -109,7 +109,7 @@ void merge(
 }
 
 XcsParser::XcsParser(int layer, Data & data):
-valueParser_(layer), data_(data), state_(STATE_START), ignoring_(), 
bIsParsingInfo_(false), type_(TYPE_ERROR)
+valueParser_(layer), data_(data), state_(STATE_START), ignoring_(), 
bIsParsingInfo_(false)
 {}
 
 XcsParser::~XcsParser() {}
@@ -307,13 +307,17 @@ void XcsParser::endElement(xmlreader::XmlReader const & 
reader) {
 Element top(std::move(elements_.top()));
 elements_.pop();
 if (top.node.is()) {
-// Remove whitespace from description_ resulting from line 
breaks/indentation in xml files
-OUString desc(description_.makeStringAndClear());
-desc = desc.trim();
-while (desc.indexOf("  ") != -1)
-desc = desc.replaceAll("  ", " ");
-top.node->setDescription(desc);
-top.node->setType(type_);
+if (top.node->kind() == Node::KIND_PROPERTY
+|| top.node->kind() == Node::KIND_LOCALIZED_PROPERTY)
+{
+// Remove whitespace from description_ resulting from line 
breaks/indentation in xml files
+OUString desc(description_.makeStringAndClear());
+desc = desc.trim();
+while (desc.indexOf("  ") != -1)
+desc = desc.replaceAll("  ", " ");
+top.node->setDescription(desc);
+top.node->setType(type_);
+}
 if (elements_.empty()) {
 switch (state_) {
 case STATE_TEMPLATES:
@@ -474,7 +478,7 @@ void XcsParser::handleNodeRef(xmlreader::XmlReader & 
reader) {
 void XcsParser::handleProp(xmlreader::XmlReader & reader) {
 bool hasName = false;
 OUString name;
-valueParser_.type_ = TYPE_ERROR;
+type_ = TYPE_ERROR;
 bool localized = false;
 bool nillable = true;
 for (;;) {
@@ -489,9 +493,8 @@ void XcsParser::handleProp(xmlreader::XmlReader & reader) {
 } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn == "type")
 {
-valueParser_.type_ = xmldata::parseType(
+type_ = xmldata::parseType(
 reader, reader.getAttributeValue(true));
-type_ = valueParser_.type_;
 } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn == "localized")
 {
@@ -506,10 +509,11 @@ void XcsParser::handleProp(xmlreader::XmlReader & reader) 
{
 throw css::uno::RuntimeException(
 "no prop name attribute in " + reader.getUrl());
 }
-if (valueParser_.type_ == TYPE_ERROR) {
+if (type_ == TYPE_ERROR) {
 throw css::uno::RuntimeException(
 "no prop type attribute in " + reader.getUrl());
 }
+valueParser_.type_ = type_;
 elements_.push(
 Element(
 (localized


[Libreoffice-commits] core.git: configmgr/source

2023-11-21 Thread Noel Grandin (via logerrit)
 configmgr/source/xcsparser.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 06654099e9a208f23a98bcf4d2a4c3b6d8798ec4
Author: Noel Grandin 
AuthorDate: Tue Nov 21 14:31:42 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Nov 21 17:59:51 2023 +0100

asan: fix read of uninitialised value

ever since
commit a91892ec4942fc875820ea02dfbe74e986548142
Author: Samuel Mehrbrodt 
Date:   Thu Nov 16 13:56:06 2023 +0100
Use existing types, instead of strings

Change-Id: Ifb7af17d21a32fdf411854b6820b32d1767660e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159779
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/xcsparser.cxx b/configmgr/source/xcsparser.cxx
index 2acf4125e186..d4e35cc75c39 100644
--- a/configmgr/source/xcsparser.cxx
+++ b/configmgr/source/xcsparser.cxx
@@ -109,7 +109,7 @@ void merge(
 }
 
 XcsParser::XcsParser(int layer, Data & data):
-valueParser_(layer), data_(data), state_(STATE_START), ignoring_(), 
bIsParsingInfo_(false)
+valueParser_(layer), data_(data), state_(STATE_START), ignoring_(), 
bIsParsingInfo_(false), type_(TYPE_ERROR)
 {}
 
 XcsParser::~XcsParser() {}


[Libreoffice-commits] core.git: configmgr/source cui/source offapi/com

2023-11-20 Thread Samuel Mehrbrodt (via logerrit)
 configmgr/source/access.cxx  |9 ++
 configmgr/source/access.hxx  |2 
 configmgr/source/node.hxx|8 +-
 configmgr/source/xcsparser.cxx   |4 -
 configmgr/source/xcsparser.hxx   |2 
 cui/source/options/optaboutconfig.cxx|   66 ++-
 offapi/com/sun/star/configuration/XDocumentation.idl |8 +-
 7 files changed, 58 insertions(+), 41 deletions(-)

New commits:
commit a91892ec4942fc875820ea02dfbe74e986548142
Author: Samuel Mehrbrodt 
AuthorDate: Thu Nov 16 13:56:06 2023 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Mon Nov 20 11:17:23 2023 +0100

Use existing types, instead of strings

as suggested in 
https://gerrit.libreoffice.org/c/core/+/158028/comments/b7a803f4_7e5899ca

Change-Id: I7d4c46b24307922b51e463bacdfacfca85956b80
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159524
Reviewed-by: Stephan Bergmann 
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 6ef23a40597b..c802f62494f0 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -66,6 +66,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -455,7 +456,7 @@ OUString Access::getDescriptionByHierarchicalName(OUString 
const & aName)
 return child->getNode()->getDescription();
 }
 
-OUString Access::getTypeByHierarchicalName(OUString const & aName)
+css::uno::Type Access::getTypeByHierarchicalName(OUString const & aName)
 {
 assert(thisIs(IS_ANY));
 osl::MutexGuard g(*lock_);
@@ -465,7 +466,11 @@ OUString Access::getTypeByHierarchicalName(OUString const 
& aName)
 throw css::container::NoSuchElementException(
 aName, getXWeak());
 }
-return child->getNode()->getType();
+auto type = child->getNode()->getType();
+if (type == TYPE_ERROR)
+throw css::util::InvalidStateException(
+aName, getXWeak());
+return mapType(child->getNode()->getType());
 }
 
 sal_Bool Access::hasByHierarchicalName(OUString const & aName)
diff --git a/configmgr/source/access.hxx b/configmgr/source/access.hxx
index 19276e6aca06..a94d20a6bce6 100644
--- a/configmgr/source/access.hxx
+++ b/configmgr/source/access.hxx
@@ -165,7 +165,7 @@ public:
 virtual OUString SAL_CALL getDescriptionByHierarchicalName(
 OUString const & aName) override;
 
-virtual OUString SAL_CALL getTypeByHierarchicalName(
+virtual css::uno::Type SAL_CALL getTypeByHierarchicalName(
 OUString const & aName) override;
 
 virtual sal_Bool SAL_CALL hasByHierarchicalName(OUString const & aName) 
override;
diff --git a/configmgr/source/node.hxx b/configmgr/source/node.hxx
index 7961d090a4c0..68664e870e35 100644
--- a/configmgr/source/node.hxx
+++ b/configmgr/source/node.hxx
@@ -27,6 +27,8 @@
 #include 
 #include 
 
+#include "type.hxx"
+
 namespace configmgr {
 
 class NodeMap;
@@ -56,8 +58,8 @@ public:
 void setDescription(OUString const& description) { description_ = 
description; };
 OUString getDescription() { return description_; }
 
-void setType(OUString const& type) { type_ = type; };
-OUString getType() { return type_; }
+void setType(Type const& type) { type_ = type; };
+Type getType() { return type_; }
 
 rtl::Reference< Node > getMember(OUString const & name);
 
@@ -70,7 +72,7 @@ private:
 int layer_;
 int finalized_;
 OUString description_;
-OUString type_;
+Type type_ = TYPE_ERROR;
 };
 
 }
diff --git a/configmgr/source/xcsparser.cxx b/configmgr/source/xcsparser.cxx
index 020cdeaabd82..2acf4125e186 100644
--- a/configmgr/source/xcsparser.cxx
+++ b/configmgr/source/xcsparser.cxx
@@ -313,7 +313,7 @@ void XcsParser::endElement(xmlreader::XmlReader const & 
reader) {
 while (desc.indexOf("  ") != -1)
 desc = desc.replaceAll("  ", " ");
 top.node->setDescription(desc);
-top.node->setType(typeName_);
+top.node->setType(type_);
 if (elements_.empty()) {
 switch (state_) {
 case STATE_TEMPLATES:
@@ -489,9 +489,9 @@ void XcsParser::handleProp(xmlreader::XmlReader & reader) {
 } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn == "type")
 {
-typeName_ = reader.getAttributeValue(true).convertFromUtf8();
 valueParser_.type_ = xmldata::parseType(
 reader, reader.getAttributeValue(true));
+type_ = valueParser_.type_;
 } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn == "localized")
 {
diff --git a/configmgr/source/xcsparser.hxx b/configmgr/source/xcsparser.hxx
index 7d0e6ca44a0a..6e8ff7d2367d 100644
--- a/configmgr/source/xcsparser.hxx
+++ b/configmgr/source/xcsparser.hxx
@@ -96,7 

[Libreoffice-commits] core.git: configmgr/source

2023-11-19 Thread Stephan Bergmann (via logerrit)
 configmgr/source/dconf.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8ef2b4b4c6624247305a22dbcc54098910584b66
Author: Stephan Bergmann 
AuthorDate: Mon Nov 20 07:30:15 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Nov 20 08:53:42 2023 +0100

Extended loplugin:ostr: configmgr

Change-Id: If9cc1f0c18a5fa344a433b338f81d191340e70f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159722
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/configmgr/source/dconf.cxx b/configmgr/source/dconf.cxx
index a63a96c511da..8548daa46b3c 100644
--- a/configmgr/source/dconf.cxx
+++ b/configmgr/source/dconf.cxx
@@ -214,7 +214,7 @@ private:
 };
 
 OString getRoot() {
-return "/org/libreoffice/registry";
+return "/org/libreoffice/registry"_ostr;
 }
 
 bool decode(OUString * string, bool slash) {


[Libreoffice-commits] core.git: configmgr/source cui/source offapi/com

2023-11-09 Thread Samuel Mehrbrodt (via logerrit)
 configmgr/source/access.cxx  |   13 
 configmgr/source/access.hxx  |3 
 configmgr/source/node.hxx|4 
 configmgr/source/xcsparser.cxx   |2 
 configmgr/source/xcsparser.hxx   |1 
 cui/source/options/optaboutconfig.cxx|  350 +--
 offapi/com/sun/star/configuration/XDocumentation.idl |   12 
 7 files changed, 204 insertions(+), 181 deletions(-)

New commits:
commit 700ac29771ccec2d66934f66b45a33a48a5ac3f1
Author: Samuel Mehrbrodt 
AuthorDate: Mon Oct 16 11:19:19 2023 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Thu Nov 9 15:37:16 2023 +0100

Use proper type in expert config dialog

In preparation for proper editing support for the different types.

Change-Id: I7044ff100c9bfcca5fa8894ff4525a1aac692796
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158028
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index f2b0931b0beb..6ef23a40597b 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -455,6 +455,19 @@ OUString Access::getDescriptionByHierarchicalName(OUString 
const & aName)
 return child->getNode()->getDescription();
 }
 
+OUString Access::getTypeByHierarchicalName(OUString const & aName)
+{
+assert(thisIs(IS_ANY));
+osl::MutexGuard g(*lock_);
+checkLocalizedPropertyAccess();
+rtl::Reference< ChildAccess > child(getSubChild(aName));
+if (!child.is()) {
+throw css::container::NoSuchElementException(
+aName, getXWeak());
+}
+return child->getNode()->getType();
+}
+
 sal_Bool Access::hasByHierarchicalName(OUString const & aName)
 {
 assert(thisIs(IS_ANY));
diff --git a/configmgr/source/access.hxx b/configmgr/source/access.hxx
index 4efa910b68c5..19276e6aca06 100644
--- a/configmgr/source/access.hxx
+++ b/configmgr/source/access.hxx
@@ -165,6 +165,9 @@ public:
 virtual OUString SAL_CALL getDescriptionByHierarchicalName(
 OUString const & aName) override;
 
+virtual OUString SAL_CALL getTypeByHierarchicalName(
+OUString const & aName) override;
+
 virtual sal_Bool SAL_CALL hasByHierarchicalName(OUString const & aName) 
override;
 
 virtual void SAL_CALL replaceByHierarchicalName(
diff --git a/configmgr/source/node.hxx b/configmgr/source/node.hxx
index cce8e3d4abb3..7961d090a4c0 100644
--- a/configmgr/source/node.hxx
+++ b/configmgr/source/node.hxx
@@ -56,6 +56,9 @@ public:
 void setDescription(OUString const& description) { description_ = 
description; };
 OUString getDescription() { return description_; }
 
+void setType(OUString const& type) { type_ = type; };
+OUString getType() { return type_; }
+
 rtl::Reference< Node > getMember(OUString const & name);
 
 protected:
@@ -67,6 +70,7 @@ private:
 int layer_;
 int finalized_;
 OUString description_;
+OUString type_;
 };
 
 }
diff --git a/configmgr/source/xcsparser.cxx b/configmgr/source/xcsparser.cxx
index 4f9cf2ee2ddb..020cdeaabd82 100644
--- a/configmgr/source/xcsparser.cxx
+++ b/configmgr/source/xcsparser.cxx
@@ -313,6 +313,7 @@ void XcsParser::endElement(xmlreader::XmlReader const & 
reader) {
 while (desc.indexOf("  ") != -1)
 desc = desc.replaceAll("  ", " ");
 top.node->setDescription(desc);
+top.node->setType(typeName_);
 if (elements_.empty()) {
 switch (state_) {
 case STATE_TEMPLATES:
@@ -488,6 +489,7 @@ void XcsParser::handleProp(xmlreader::XmlReader & reader) {
 } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
attrLn == "type")
 {
+typeName_ = reader.getAttributeValue(true).convertFromUtf8();
 valueParser_.type_ = xmldata::parseType(
 reader, reader.getAttributeValue(true));
 } else if (attrNsId == ParseManager::NAMESPACE_OOR &&
diff --git a/configmgr/source/xcsparser.hxx b/configmgr/source/xcsparser.hxx
index aedcccde1147..7d0e6ca44a0a 100644
--- a/configmgr/source/xcsparser.hxx
+++ b/configmgr/source/xcsparser.hxx
@@ -96,6 +96,7 @@ private:
 ElementStack elements_;
 bool bIsParsingInfo_;
 OUStringBuffer description_;
+OUString typeName_;
 };
 
 }
diff --git a/cui/source/options/optaboutconfig.cxx 
b/cui/source/options/optaboutconfig.cxx
index 74bf672a3cf1..791856ef2ae5 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -357,180 +357,220 @@ void CuiAboutConfigTabPage::FillItems(const Reference< 
XNameAccess >& xNameAcces
 ::comphelper::getProcessComponentContext(), "*");
 beans::Property aProperty;
 bool bReadOnly = false;
+OUString sFullPath(sPath + "/" + sPropertyName);
 try
 {
-

[Libreoffice-commits] core.git: configmgr/source cui/source offapi/com offapi/UnoApi_offapi.mk officecfg/util solenv/bin

2023-11-08 Thread Samuel Mehrbrodt (via logerrit)
 configmgr/source/access.cxx  |   16 +++
 configmgr/source/access.hxx  |6 +
 configmgr/source/node.cxx|1 
 configmgr/source/node.hxx|6 +
 configmgr/source/xcsparser.cxx   |   90 +++
 configmgr/source/xcsparser.hxx   |2 
 cui/source/options/optaboutconfig.cxx|   33 +-
 cui/source/options/optaboutconfig.hxx|3 
 offapi/UnoApi_offapi.mk  |1 
 offapi/com/sun/star/configuration/XDocumentation.idl |   34 +++
 officecfg/util/schema_trim.xsl   |2 
 solenv/bin/packregistry.xslt |4 
 12 files changed, 171 insertions(+), 27 deletions(-)

New commits:
commit db3078bd8c8e3ce3a99fc3987bb6e93b609990c1
Author: Samuel Mehrbrodt 
AuthorDate: Thu Sep 21 16:00:40 2023 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Thu Nov 9 08:14:38 2023 +0100

tdf#157431 Show description for expert config items

Change-Id: I7d0257c2e06ed384f90ca3b51a6d2549044f2cf3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157148
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 668192fee63c..f2b0931b0beb 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -216,6 +216,8 @@ css::uno::Sequence< css::uno::Type > Access::getTypes()
 } else {
 types.push_back(
 cppu::UnoType< css::container::XHierarchicalNameAccess >::get());
+types.push_back(
+cppu::UnoType< css::configuration::XDocumentation >::get());
 }
 addTypes();
 return comphelper::containerToSequence(types);
@@ -440,6 +442,19 @@ css::uno::Any Access::getByHierarchicalName(OUString const 
& aName)
 return child->asValue();
 }
 
+OUString Access::getDescriptionByHierarchicalName(OUString const & aName)
+{
+assert(thisIs(IS_ANY));
+osl::MutexGuard g(*lock_);
+checkLocalizedPropertyAccess();
+rtl::Reference< ChildAccess > child(getSubChild(aName));
+if (!child.is()) {
+throw css::container::NoSuchElementException(
+aName, getXWeak());
+}
+return child->getNode()->getDescription();
+}
+
 sal_Bool Access::hasByHierarchicalName(OUString const & aName)
 {
 assert(thisIs(IS_ANY));
@@ -1300,6 +1315,7 @@ css::uno::Any Access::queryInterface(css::uno::Type const 
& aType)
 static_cast< css::lang::XServiceInfo * >(this),
 static_cast< css::lang::XComponent * >(this),
 static_cast< css::container::XHierarchicalNameAccess * >(this),
+static_cast< css::configuration::XDocumentation * >(this),
 static_cast< css::container::XContainer * >(this),
 static_cast< css::beans::XExactName * >(this),
 static_cast< css::container::XHierarchicalName * >(this),
diff --git a/configmgr/source/access.hxx b/configmgr/source/access.hxx
index daa5f1d1f6be..4efa910b68c5 100644
--- a/configmgr/source/access.hxx
+++ b/configmgr/source/access.hxx
@@ -35,6 +35,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -82,6 +84,7 @@ class Access:
 public cppu::OWeakObject, public css::lang::XTypeProvider,
 public css::lang::XServiceInfo,
 public css::lang::XComponent,
+public css::configuration::XDocumentation,
 public css::container::XHierarchicalNameReplace,
 public css::container::XContainer,
 public css::beans::XExactName,
@@ -159,6 +162,9 @@ public:
 virtual css::uno::Any SAL_CALL getByHierarchicalName(
 OUString const & aName) override;
 
+virtual OUString SAL_CALL getDescriptionByHierarchicalName(
+OUString const & aName) override;
+
 virtual sal_Bool SAL_CALL hasByHierarchicalName(OUString const & aName) 
override;
 
 virtual void SAL_CALL replaceByHierarchicalName(
diff --git a/configmgr/source/node.cxx b/configmgr/source/node.cxx
index 8f00d3887da3..2c8c697b5338 100644
--- a/configmgr/source/node.cxx
+++ b/configmgr/source/node.cxx
@@ -59,7 +59,6 @@ void Node::setFinalized(int layer) {
 finalized_ = layer;
 }
 
-
 rtl::Reference< Node > Node::getMember(OUString const & name) {
 NodeMap const & members = getMembers();
 NodeMap::const_iterator i(members.find(name));
diff --git a/configmgr/source/node.hxx b/configmgr/source/node.hxx
index b858c9e42e95..cce8e3d4abb3 100644
--- a/configmgr/source/node.hxx
+++ b/configmgr/source/node.hxx
@@ -23,7 +23,9 @@
 
 #include 
 #include 
+#include 
 #include 
+#include 
 
 namespace configmgr {
 
@@ -51,6 +53,9 @@ public:
 void setFinalized(int layer);
 int getFinalized() const { return finalized_;}
 
+void setDescription(OUString const& description) { description_ = 
description; };
+OUString getDescription() { return description_; }
+
 rtl::Reference< Node > 

[Libreoffice-commits] core.git: configmgr/source

2023-10-31 Thread Noel Grandin (via logerrit)
 configmgr/source/access.cxx  |   14 +++---
 configmgr/source/access.hxx  |2 +-
 configmgr/source/childaccess.cxx |2 +-
 configmgr/source/childaccess.hxx |2 +-
 configmgr/source/rootaccess.cxx  |2 +-
 configmgr/source/rootaccess.hxx  |2 +-
 6 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 0e08992f99bfd4aaa57a6b30b9e8a32ee5dc4a98
Author: Noel Grandin 
AuthorDate: Tue Oct 31 15:55:44 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Oct 31 18:11:02 2023 +0100

reduce ref-counting traffic in configmgr

we can return by const& from getNode

Change-Id: If93c43fd2e910e2fb69d9bd0a9e3dc587133dfa8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158729
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 4bb66cb5f025..668192fee63c 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -132,7 +132,7 @@ void Access::releaseNondeleting() {
 }
 
 bool Access::isValue() {
-rtl::Reference< Node > p(getNode());
+const rtl::Reference< Node > & p(getNode());
 switch (p->kind()) {
 case Node::KIND_PROPERTY:
 case Node::KIND_LOCALIZED_VALUE:
@@ -331,7 +331,7 @@ css::uno::Type Access::getElementType() {
 assert(thisIs(IS_ANY));
 osl::MutexGuard g(*lock_);
 checkLocalizedPropertyAccess();
-rtl::Reference< Node > p(getNode());
+const rtl::Reference< Node > & p(getNode());
 switch (p->kind()) {
 case Node::KIND_LOCALIZED_PROPERTY:
 return mapType(
@@ -625,7 +625,7 @@ void Access::setName(OUString const & aName)
 {
 rtl::Reference< Access > parent(getParentAccess());
 if (parent.is()) {
-rtl::Reference< Node > node(getNode());
+const rtl::Reference< Node > & node(getNode());
 if (! node->getTemplateName().isEmpty()) {
 rtl::Reference< ChildAccess > other(
 parent->getChild(aName));
@@ -1164,7 +1164,7 @@ void Access::removeByName(OUString const & aName)
 aName, getXWeak());
 }
 if (getNode()->kind() == Node::KIND_GROUP) {
-rtl::Reference< Node > p(child->getNode());
+const rtl::Reference< Node >& p(child->getNode());
 if (p->kind() != Node::KIND_PROPERTY ||
 !static_cast< PropertyNode * >(p.get())->isExtension())
 {
@@ -2048,7 +2048,7 @@ rtl::Reference< ChildAccess > 
Access::getSubChild(OUString const & path) {
 return rtl::Reference< ChildAccess >();
 }
 if (setElement) {
-rtl::Reference< Node > p(parent->getNode());
+const rtl::Reference< Node >& p(parent->getNode());
 switch (p->kind()) {
 case Node::KIND_LOCALIZED_PROPERTY:
 if (!Components::allLocales(getRootAccess()->getLocale()) ||
@@ -2100,7 +2100,7 @@ css::beans::Property Access::asProperty() {
 css::uno::Type type;
 bool nillable;
 bool removable;
-rtl::Reference< Node > p(getNode());
+const rtl::Reference< Node >& p(getNode());
 switch (p->kind()) {
 case Node::KIND_PROPERTY:
 {
@@ -2225,7 +2225,7 @@ rtl::Reference< Access > Access::getNotificationRoot() {
 #if !defined NDEBUG
 bool Access::thisIs(int what) {
 osl::MutexGuard g(*lock_);
-rtl::Reference< Node > p(getNode());
+const rtl::Reference< Node >& p(getNode());
 Node::Kind k(p->kind());
 return (k != Node::KIND_PROPERTY && k != Node::KIND_LOCALIZED_VALUE &&
 ((what & IS_GROUP) == 0 || k == Node::KIND_GROUP) &&
diff --git a/configmgr/source/access.hxx b/configmgr/source/access.hxx
index 7b59e81cfdc8..daa5f1d1f6be 100644
--- a/configmgr/source/access.hxx
+++ b/configmgr/source/access.hxx
@@ -111,7 +111,7 @@ public:
 virtual std::vector getRelativePath() = 0;
 
 virtual OUString getRelativePathRepresentation() = 0;
-virtual rtl::Reference< Node > getNode() = 0;
+virtual const rtl::Reference< Node > & getNode() = 0;
 
 virtual bool isFinalized() = 0;
 
diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx
index 8a8d581dd8d6..e0a9f9ac6cee 100644
--- a/configmgr/source/childaccess.cxx
+++ b/configmgr/source/childaccess.cxx
@@ -107,7 +107,7 @@ OUString ChildAccess::getRelativePathRepresentation() {
 return path.makeStringAndClear();
 }
 
-rtl::Reference< Node > ChildAccess::getNode() {
+const rtl::Reference< Node > & ChildAccess::getNode() {
 return node_;
 }
 
diff --git a/configmgr/source/childaccess.hxx b/configmgr/source/childaccess.hxx
index 6f060c2de827..f3948a08ab50 100644
--- a/configmgr/source/childaccess.hxx
+++ b/configmgr/source/childaccess.hxx
@@ -64,7 +64,7 @@ public:
 virtual std::vector getRelativePath() override;
 
 virtual OUString getRelativePathRepresentation() override;
-virtual 

[Libreoffice-commits] core.git: configmgr/source

2023-10-31 Thread Noel Grandin (via logerrit)
 configmgr/source/access.cxx |   81 
 configmgr/source/access.hxx |3 +
 2 files changed, 55 insertions(+), 29 deletions(-)

New commits:
commit 300763ddf666b8f2e428231ffa892ecd4efb2eae
Author: Noel Grandin 
AuthorDate: Tue Oct 31 15:54:18 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Oct 31 18:10:30 2023 +0100

reduce reference counting traffic in configmgr

no need to construct a vector when iterating over children

Change-Id: I717e92be3c576a6e5d877f4333264a5bed9daadf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158728
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 46657374030a..4bb66cb5f025 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -354,7 +354,7 @@ sal_Bool Access::hasElements() {
 assert(thisIs(IS_ANY));
 osl::MutexGuard g(*lock_);
 checkLocalizedPropertyAccess();
-return !getAllChildren().empty(); //TODO: optimize
+return !isAllChildrenEmpty();
 }
 
 bool Access::getByNameFast(const OUString & name, css::uno::Any & value)
@@ -410,14 +410,13 @@ css::uno::Sequence< OUString > Access::getElementNames()
 assert(thisIs(IS_ANY));
 osl::MutexGuard g(*lock_);
 checkLocalizedPropertyAccess();
-std::vector< rtl::Reference< ChildAccess > > children(getAllChildren());
-css::uno::Sequence names(children.size());
-OUString* pArray = names.getArray();
-for (auto const& child : children)
+std::vector childNames;
+forAllChildren([] (ChildAccess& rChild)
 {
-*pArray++ = child->getNameInternal();
-}
-return names;
+childNames.push_back(rChild.getNameInternal());
+return true;
+});
+return comphelper::containerToSequence(childNames);
 }
 
 sal_Bool Access::hasByName(OUString const & aName)
@@ -537,13 +536,12 @@ css::uno::Sequence< css::beans::Property > 
Access::getProperties()
 {
 assert(thisIs(IS_GROUP));
 osl::MutexGuard g(*lock_);
-std::vector< rtl::Reference< ChildAccess > > children(getAllChildren());
 std::vector< css::beans::Property > properties;
-properties.reserve(children.size());
-for (auto const& child : children)
+forAllChildren([] (ChildAccess& rChild)
 {
-properties.push_back(child->asProperty());
-}
+properties.push_back(rChild.asProperty());
+return true;
+});
 return comphelper::containerToSequence(properties);
 }
 
@@ -1423,19 +1421,22 @@ rtl::Reference< ChildAccess > Access::getChild(OUString 
const & name) {
 locale = locale.copy(0, i);
 }
 assert(!locale.isEmpty());
-std::vector< rtl::Reference< ChildAccess > > children(
-getAllChildren());
-for (auto const& child : children)
+rtl::Reference< ChildAccess > foundChild;
+forAllChildren([, ] (ChildAccess& rChild)
 {
-const OUString & name2(child->getNameInternal());
+const OUString & name2(rChild.getNameInternal());
 if (name2.startsWith(locale) &&
 (name2.getLength() == locale.getLength() ||
  name2[locale.getLength()] == '-' ||
  name2[locale.getLength()] == '_'))
 {
-return child;
+foundChild = 
+return false;
 }
-}
+return true;
+});
+if (foundChild)
+return foundChild;
 }
 // Defaults are the "en-US" locale, the "en" locale, the empty string 
locale, the first child (if
 // any, and if the property is non-nillable), or a null ChildAccess, 
in that order:
@@ -1452,9 +1453,15 @@ rtl::Reference< ChildAccess > Access::getChild(OUString 
const & name) {
 return child;
 }
 if (!static_cast(getNode().get())->isNillable()) {
-std::vector< rtl::Reference< ChildAccess > > 
children(getAllChildren());
-if (!children.empty()) {
-return children.front();
+// look for first child in list
+rtl::Reference< ChildAccess > foundChild;
+forAllChildren([] (ChildAccess& rChild)
+{
+foundChild = 
+return false;
+});
+if (foundChild) {
+return foundChild;
 }
 }
 return rtl::Reference< ChildAccess >();
@@ -1464,14 +1471,14 @@ rtl::Reference< ChildAccess > Access::getChild(OUString 
const & name) {
 ? getUnmodifiedChild(name) : getModifiedChild(i);
 }
 
-std::vector< rtl::Reference< ChildAccess > > Access::getAllChildren() {
-std::vector< rtl::Reference< ChildAccess > > vec;
+void Access::forAllChildren(const std::function & func) {
 NodeMap const & members = 

[Libreoffice-commits] core.git: configmgr/source

2023-10-19 Thread Stephan Bergmann (via logerrit)
 configmgr/source/configurationprovider.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 826d673ac8870001a53a50a6142d66d510a67e4a
Author: Stephan Bergmann 
AuthorDate: Thu Oct 19 10:30:06 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Oct 19 13:54:29 2023 +0200

Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: configmgr

Change-Id: Id95245a309b3baa80d7cca63d980aa0657fb9eb2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158148
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/configmgr/source/configurationprovider.cxx 
b/configmgr/source/configurationprovider.cxx
index 40ffd6a9ba4a..9789e0721bd6 100644
--- a/configmgr/source/configurationprovider.cxx
+++ b/configmgr/source/configurationprovider.cxx
@@ -60,10 +60,10 @@ namespace configmgr::configuration_provider {
 
 namespace {
 
-constexpr OUStringLiteral accessServiceName =
-u"com.sun.star.configuration.ConfigurationAccess";
-constexpr OUStringLiteral updateAccessServiceName =
-u"com.sun.star.configuration.ConfigurationUpdateAccess";
+constexpr OUString accessServiceName =
+u"com.sun.star.configuration.ConfigurationAccess"_ustr;
+constexpr OUString updateAccessServiceName =
+u"com.sun.star.configuration.ConfigurationUpdateAccess"_ustr;
 
 void badNodePath() {
 throw css::uno::Exception(


[Libreoffice-commits] core.git: configmgr/source

2023-08-31 Thread Noel Grandin (via logerrit)
 configmgr/source/access.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit af8ee87852496e51d4c3e0e8f446503e4a8faabb
Author: Noel Grandin 
AuthorDate: Thu Aug 31 14:18:03 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Aug 31 21:50:18 2023 +0200

SAL_WARN->SAL_INFO in Access::getChild

reduce log noise

Change-Id: I95393f18fe8cc019c89ad4779d5b10f64993bd51
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156340
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 00a9db96407f..46657374030a 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -1377,7 +1377,7 @@ rtl::Reference< ChildAccess > Access::getChild(OUString 
const & name) {
 << locale << "\" recursively starting with \"*\"");
 return getChild(locale);
 }
-SAL_WARN_IF(
+SAL_INFO_IF(
 locale.isEmpty(), "configmgr",
 ("access best-matching localized property value via \"*\""
  " with empty ; falling back to defaults"));


[Libreoffice-commits] core.git: configmgr/source

2023-07-17 Thread Mike Kaganski (via logerrit)
 configmgr/source/broadcaster.cxx |   25 -
 configmgr/source/broadcaster.hxx |3 ++-
 configmgr/source/rootaccess.cxx  |2 +-
 3 files changed, 19 insertions(+), 11 deletions(-)

New commits:
commit 8e9b3abce97f6ec1851cb7e3464e63107fad2793
Author: Mike Kaganski 
AuthorDate: Tue Jul 18 00:28:41 2023 +0300
Commit: Mike Kaganski 
CommitDate: Tue Jul 18 06:54:47 2023 +0200

Make sure that root listeners are notified first

The problem appeared when in a configuration listener's changesOccurred,
a configuration value was read using officecfg machinery, which could
return the old value of the configuration, or an updated one, at random.

This was caused by use of a cached value in
comphelper::detail::ConfigurationWrapper::getPropertyValue, which is
cleaned in ConfigurationChangesListener::changesOccurred; but the order
in which the listeners' changesOccurred methods were called depended on
the implementation detail of configmgr::Components::roots_, which was
previously a std::set of pointers, and now is a sorted vector. This
made the pointers sorted in order of the pointers' addresses (basically
random), and when a broadcaster's common list of change listeners was
prepared in Components::initGlobalBroadcaster, ConfigurationWrapper's
listener could arrive last. This meant, that the cache could be cleaned
too late, after its obsolete content was already used in a previous
listener.

The problem could be partially mitigated by clearing the cache in the
comphelper::detail::ConfigurationWrapper::setPropertyValue, but that
would only handle cases of config modifications using comphelper.

Instead, take into account that ConfigurationWrapper listens on the
root of configuration tree; and introduce a separate container in
configmgr::Broadcaster for root listeners. They would be triggered
first, before all other listeners.

Still, this would not guarantee the proper order, if another listener
is registered on root. To handle all cases, a special listener category
could be used, which could be filled using a dedicated internal API, so
comphelper could use it to register its privileged listener close to
the heart of the broadcaster :) This might be implemented later.

Change-Id: I956b7989b3927dca2683f63cf92b0dda04db9bdf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154561
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/configmgr/source/broadcaster.cxx b/configmgr/source/broadcaster.cxx
index 03bcf8f273de..365e25f9eb02 100644
--- a/configmgr/source/broadcaster.cxx
+++ b/configmgr/source/broadcaster.cxx
@@ -97,9 +97,12 @@ void Broadcaster::addPropertiesChangeNotification(
 
 void Broadcaster::addChangesNotification(
 css::uno::Reference< css::util::XChangesListener > const & listener,
-css::util::ChangesEvent const & event)
+css::util::ChangesEvent const & event, bool bRootListener)
 {
-changesNotifications_.emplace_back(listener, event);
+if (bRootListener)
+rootChangesNotifications_.emplace_back(listener, event);
+else
+changesNotifications_.emplace_back(listener, event);
 }
 
 void Broadcaster::send() {
@@ -164,13 +167,17 @@ void Broadcaster::send() {
 appendMessage(messages, e);
 }
 }
-for (auto& rNotification : changesNotifications_) {
-try {
-rNotification.listener->changesOccurred(rNotification.event);
-} catch (css::lang::DisposedException &) {
-} catch (css::uno::Exception & e) {
-exception = cppu::getCaughtException();
-appendMessage(messages, e);
+// First root listeners, then the rest
+for (const auto& container : { rootChangesNotifications_ , 
changesNotifications_})
+{
+for (auto& rNotification : container) {
+try {
+rNotification.listener->changesOccurred(rNotification.event);
+} catch (css::lang::DisposedException &) {
+} catch (css::uno::Exception & e) {
+exception = cppu::getCaughtException();
+appendMessage(messages, e);
+}
 }
 }
 if (exception.hasValue()) {
diff --git a/configmgr/source/broadcaster.hxx b/configmgr/source/broadcaster.hxx
index d0c461e731d8..711e7a83bd9e 100644
--- a/configmgr/source/broadcaster.hxx
+++ b/configmgr/source/broadcaster.hxx
@@ -72,7 +72,7 @@ public:
 
 void addChangesNotification(
 css::uno::Reference< css::util::XChangesListener > const & listener,
-css::util::ChangesEvent const & event);
+css::util::ChangesEvent const & event, bool bRootListener);
 
 void send();
 
@@ -131,6 +131,7 @@ private:
 std::vector< ContainerNotification > 
containerElementReplacedNotifications_;
 std::vector< PropertyChangeNotification > propertyChangeNotifications_;
 std::vector< 

[Libreoffice-commits] core.git: configmgr/source

2023-06-18 Thread Mike Kaganski (via logerrit)
 configmgr/source/access.cxx|  150 ++---
 configmgr/source/childaccess.cxx   |7 -
 configmgr/source/configurationprovider.cxx |   12 +-
 configmgr/source/configurationregistry.cxx |   54 +-
 configmgr/source/readonlyaccess.cxx|6 -
 configmgr/source/readwriteaccess.cxx   |6 -
 configmgr/source/rootaccess.cxx|6 -
 7 files changed, 118 insertions(+), 123 deletions(-)

New commits:
commit bc70f674c2487ad826f8fe04e626de1829f5b40d
Author: Mike Kaganski 
AuthorDate: Sun Apr 23 20:13:14 2023 +0300
Commit: Mike Kaganski 
CommitDate: Sun Jun 18 08:41:27 2023 +0200

Use getXWeak in configmgr

Change-Id: Ia7d9475cecd2208ccf672f2b35c0c841fed7f4dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150840
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 047c93a5627a..00a9db96407f 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -281,7 +281,7 @@ void Access::dispose() {
 if (getParentAccess().is()) {
 throw css::uno::RuntimeException(
 "configmgr dispose inappropriate Access",
-static_cast< cppu::OWeakObject * >(this));
+getXWeak());
 }
 if (disposed_) {
 return;
@@ -302,7 +302,7 @@ void Access::addEventListener(
 checkLocalizedPropertyAccess();
 if (!xListener.is()) {
 throw css::uno::RuntimeException(
-"null listener", static_cast< cppu::OWeakObject * >(this));
+"null listener", getXWeak());
 }
 if (!disposed_) {
 disposeListeners_.insert(xListener);
@@ -311,7 +311,7 @@ void Access::addEventListener(
 }
 try {
 xListener->disposing(
-css::lang::EventObject(static_cast< cppu::OWeakObject * >(this)));
+css::lang::EventObject(getXWeak()));
 } catch (css::lang::DisposedException &) {}
 }
 
@@ -346,7 +346,7 @@ css::uno::Type Access::getElementType() {
 default:
 assert(false);
 throw css::uno::RuntimeException(
-"this cannot happen", static_cast< cppu::OWeakObject * >(this));
+"this cannot happen", getXWeak());
 }
 }
 
@@ -401,7 +401,7 @@ css::uno::Any Access::getByName(OUString const & aName)
 css::uno::Any value;
 if (!getByNameFast(aName, value))
 throw css::container::NoSuchElementException(
-aName, static_cast< cppu::OWeakObject * >(this));
+aName, getXWeak());
 return value;
 }
 
@@ -436,7 +436,7 @@ css::uno::Any Access::getByHierarchicalName(OUString const 
& aName)
 rtl::Reference< ChildAccess > child(getSubChild(aName));
 if (!child.is()) {
 throw css::container::NoSuchElementException(
-aName, static_cast< cppu::OWeakObject * >(this));
+aName, getXWeak());
 }
 return child->asValue();
 }
@@ -461,7 +461,7 @@ void Access::replaceByHierarchicalName(
 rtl::Reference< ChildAccess > child(getSubChild(aName));
 if (!child.is()) {
 throw css::container::NoSuchElementException(
-aName, static_cast< cppu::OWeakObject * >(this));
+aName, getXWeak());
 }
 child->checkFinalized();
 rtl::Reference< Node > parent(child->getParentNode());
@@ -476,12 +476,12 @@ void Access::replaceByHierarchicalName(
 throw css::lang::IllegalArgumentException(
 ("configmgr::Access::replaceByHierarchicalName does not"
  " currently support set members"),
-static_cast< cppu::OWeakObject * >(this), 0);
+getXWeak(), 0);
 case Node::KIND_ROOT:
 throw css::lang::IllegalArgumentException(
 ("configmgr::Access::replaceByHierarchicalName does not allow"
  " changing component " + aName),
-static_cast< cppu::OWeakObject * >(this), 0);
+getXWeak(), 0);
 default:
 assert(false); // this cannot happen
 break;
@@ -500,7 +500,7 @@ void Access::addContainerListener(
 checkLocalizedPropertyAccess();
 if (!xListener.is()) {
 throw css::uno::RuntimeException(
-"null listener", static_cast< cppu::OWeakObject * >(this));
+"null listener", getXWeak());
 }
 if (!disposed_) {
 containerListeners_.insert(xListener);
@@ -509,7 +509,7 @@ void Access::addContainerListener(
 }
 try {
 xListener->disposing(
-css::lang::EventObject(static_cast< cppu::OWeakObject * >(this)));
+css::lang::EventObject(getXWeak()));
 } catch (css::lang::DisposedException &) {}
 }
 
@@ -554,7 +554,7 @@ css::beans::Property Access::getPropertyByName(OUString 
const & aName)
 rtl::Reference< ChildAccess > 

[Libreoffice-commits] core.git: configmgr/source oox/source sc/source sfx2/source svx/source sw/source

2023-04-28 Thread Noel Grandin (via logerrit)
 configmgr/source/valueparser.cxx |7 +++
 oox/source/export/chartexport.cxx|6 ++
 sc/source/core/opencl/opbase.cxx |7 ++-
 sc/source/filter/html/htmlpars.cxx   |3 +--
 sfx2/source/control/shell.cxx|3 +--
 svx/source/dialog/framelinkarray.cxx |6 +++---
 sw/source/filter/html/svxcss1.cxx|8 +++-
 sw/source/filter/ww8/rtfexport.cxx   |   10 --
 8 files changed, 19 insertions(+), 31 deletions(-)

New commits:
commit a33922e38b87db5b009986324c6543e90f18a752
Author: Noel Grandin 
AuthorDate: Wed Apr 26 08:41:23 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Apr 28 08:23:04 2023 +0200

optimise find/insert calls to maps

Instead of doing two lookups, we can just call insert and
then update the mapped-to value if the insert actually succeeded.

Change-Id: I3df3b98f0debe6bf74c739dd5850e7714d9c2789
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151030
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/valueparser.cxx b/configmgr/source/valueparser.cxx
index 82778e6c823b..17174368d59b 100644
--- a/configmgr/source/valueparser.cxx
+++ b/configmgr/source/valueparser.cxx
@@ -352,12 +352,11 @@ bool ValueParser::endElement() {
 case Node::KIND_LOCALIZED_PROPERTY:
 {
 NodeMap & members = node_->getMembers();
-NodeMap::iterator i(members.find(localizedName_));
+auto [i, bInserted] = 
members.insert(NodeMap::value_type(localizedName_, nullptr));
 LocalizedValueNode *pLVNode;
-if (i == members.end()) {
+if (bInserted) {
 pLVNode = new LocalizedValueNode(layer_);
-members.insert(
-NodeMap::value_type(localizedName_, pLVNode ));
+i->second = pLVNode;
 } else {
 pLVNode = static_cast< LocalizedValueNode * 
>(i->second.get());
 }
diff --git a/oox/source/export/chartexport.cxx 
b/oox/source/export/chartexport.cxx
index a2c30f2e8861..94f956428d19 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -3345,10 +3345,8 @@ void ChartExport::_exportAxis(
 }
 
 // only export each axis only once non-deleted
-bool bDeleted = maExportedAxis.find(rAxisIdPair.nAxisType) != 
maExportedAxis.end();
-
-if (!bDeleted)
-maExportedAxis.insert(rAxisIdPair.nAxisType);
+auto aItInsertedPair = maExportedAxis.insert(rAxisIdPair.nAxisType);
+bool bDeleted = !aItInsertedPair.second;
 
 pFS->singleElement(FSNS(XML_c, XML_delete), XML_val, !bDeleted && bVisible 
? "0" : "1");
 
diff --git a/sc/source/core/opencl/opbase.cxx b/sc/source/core/opencl/opbase.cxx
index 199b24b32459..4ea248daaa3a 100644
--- a/sc/source/core/opencl/opbase.cxx
+++ b/sc/source/core/opencl/opbase.cxx
@@ -114,12 +114,9 @@ int DynamicKernelArgument::GetStringId( const rtl_uString* 
string )
 return 0;
 if( stringIdsMap == nullptr )
 stringIdsMap = new std::unordered_map;
-std::unordered_map::iterator it = 
stringIdsMap->find( string );
-if( it != stringIdsMap->end())
-return it->second;
 int newId = stringIdsMap->size() + 1;
-stringIdsMap->insert( std::pair( string, newId ));
-return newId;
+auto aItInsertedPair = stringIdsMap->insert( std::pair( string, newId ));
+return aItInsertedPair.first->second;
 }
 
 void DynamicKernelArgument::ClearStringIds()
diff --git a/sc/source/filter/html/htmlpars.cxx 
b/sc/source/filter/html/htmlpars.cxx
index e49920eb563b..db7bfc432a86 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -768,8 +768,7 @@ void ScHTMLLayoutParser::SetWidths()
 for (auto it = pLocalColOffset->begin(); it != 
pLocalColOffset->end(); ++it)
 {
 // Only exact offsets, do not use MakeColNoRef().
-if (maColOffset.find(*it) == maColOffset.end())
-maColOffset.insert(*it);
+maColOffset.insert(*it);
 }
 }
 }
diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx
index 5bbeb01d92cd..84828b0eff25 100644
--- a/sfx2/source/control/shell.cxx
+++ b/sfx2/source/control/shell.cxx
@@ -170,8 +170,7 @@ void SfxShell::PutItem
 if (it != pImpl->m_Items.end())
 {
 // Replace Item
-pImpl->m_Items.erase( it );
-pImpl->m_Items.insert(std::make_pair(nWhich, 
std::unique_ptr(pItem)));
+it->second = std::unique_ptr(pItem);
 
 // if active, notify Bindings
 SfxDispatcher *pDispat = GetDispatcher();
diff --git a/svx/source/dialog/framelinkarray.cxx 
b/svx/source/dialog/framelinkarray.cxx
index 322e2225d5e6..918aa76dc7ae 100644
--- a/svx/source/dialog/framelinkarray.cxx
+++ 

[Libreoffice-commits] core.git: configmgr/source embedserv/source emfio/inc helpcompiler/inc helpcompiler/source

2023-03-16 Thread Uday Sharma (via logerrit)
 configmgr/source/config_map.hxx  |5 +
 embedserv/source/embed/guid.hxx  |6 +-
 emfio/inc/emfreader.hxx  |6 +-
 emfio/inc/mtftools.hxx   |6 +-
 helpcompiler/inc/HelpCompiler.hxx|5 +
 helpcompiler/inc/HelpLinker.hxx  |6 +-
 helpcompiler/source/LuceneHelper.hxx |6 +-
 7 files changed, 7 insertions(+), 33 deletions(-)

New commits:
commit 0d8d0fb8932652f182c46805d5cf3ae7f6ebadd5
Author: Uday Sharma 
AuthorDate: Sat Feb 11 23:04:38 2023 +0530
Commit: Ilmari Lauhakangas 
CommitDate: Thu Mar 16 09:25:32 2023 +

tdf#143148: Use pragma once instead of include guards

Change-Id: I6898acbf7c6c9de45bbfa6a32202acf302f92caa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146822
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/configmgr/source/config_map.hxx b/configmgr/source/config_map.hxx
index 5d2990d5a0d8..46a553cdde39 100644
--- a/configmgr/source/config_map.hxx
+++ b/configmgr/source/config_map.hxx
@@ -6,8 +6,7 @@
  * 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/.
  */
-#ifndef CONFIG_MAP_HXX
-#define CONFIG_MAP_HXX
+#pragma once
 
 #include 
 #include 
@@ -32,6 +31,4 @@ template  struct config_map : public 
std::maphttp://www.apache.org/licenses/LICENSE-2.0 .
  */
-
-#ifndef INCLUDED_EMBEDSERV_SOURCE_EMBED_GUID_HXX
-#define INCLUDED_EMBEDSERV_SOURCE_EMBED_GUID_HXX
+#pragma once
 
 #include 
 
@@ -34,6 +32,4 @@ std::u16string_view getServiceNameFromGUID_Impl(GUID const*);
 
 wchar_t const* getStorageTypeFromGUID_Impl(GUID const* guid);
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/emfio/inc/emfreader.hxx b/emfio/inc/emfreader.hxx
index a09ad6fa2c20..4893a45733af 100644
--- a/emfio/inc/emfreader.hxx
+++ b/emfio/inc/emfreader.hxx
@@ -16,9 +16,7 @@
  *   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_EMFIO_INC_EMFREADER_HXX
-#define INCLUDED_EMFIO_INC_EMFREADER_HXX
+#pragma once
 
 #include "mtftools.hxx"
 
@@ -63,6 +61,4 @@ namespace emfio
 };
 }
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/emfio/inc/mtftools.hxx b/emfio/inc/mtftools.hxx
index 26e2d8cca088..b2237736869b 100644
--- a/emfio/inc/mtftools.hxx
+++ b/emfio/inc/mtftools.hxx
@@ -16,9 +16,7 @@
  *   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_EMFIO_INC_MTFTOOLS_HXX
-#define INCLUDED_EMFIO_INC_MTFTOOLS_HXX
+#pragma once
 
 #include 
 #include 
@@ -838,6 +836,4 @@ namespace emfio
 };
 }
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/helpcompiler/inc/HelpCompiler.hxx 
b/helpcompiler/inc/HelpCompiler.hxx
index c66e705ae222..04562e9c41a7 100644
--- a/helpcompiler/inc/HelpCompiler.hxx
+++ b/helpcompiler/inc/HelpCompiler.hxx
@@ -16,9 +16,7 @@
  *   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_HELPCOMPILER_INC_HELPCOMPILER_HXX
-#define INCLUDED_HELPCOMPILER_INC_HELPCOMPILER_HXX
+#pragma once
 
 #include 
 
@@ -212,5 +210,4 @@ inline char tocharlower(char c)
 rtl::toAsciiLowerCase(static_cast(c)));
 }
 
-#endif
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/helpcompiler/inc/HelpLinker.hxx b/helpcompiler/inc/HelpLinker.hxx
index 5087e47ae08d..9645f7c4c67c 100644
--- a/helpcompiler/inc/HelpLinker.hxx
+++ b/helpcompiler/inc/HelpLinker.hxx
@@ -16,9 +16,7 @@
  *   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_HELPCOMPILER_INC_HELPLINKER_HXX
-#define INCLUDED_HELPCOMPILER_INC_HELPLINKER_HXX
+#pragma once
 
 #include 
 #include 
@@ -88,6 +86,4 @@ private:
 const std::string& jarfileB, const std::string& titleB );
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/helpcompiler/source/LuceneHelper.hxx 
b/helpcompiler/source/LuceneHelper.hxx
index 781f30bba416..6e8208b1b20e 100644
--- a/helpcompiler/source/LuceneHelper.hxx
+++ b/helpcompiler/source/LuceneHelper.hxx
@@ -6,9 +6,7 @@
  * 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/.
  */
-
-#ifndef INCLUDED_HELPCOMPILER_SOURCE_LUCENEHELPER_HXX
-#define INCLUDED_HELPCOMPILER_SOURCE_LUCENEHELPER_HXX
+#pragma once
 
 #if defined(__GNUC__)
 #pragma GCC visibility push(default)
@@ -26,6 +24,4 @@
 std::vector OUStringToTCHARVec(OUString const& rStr);
 OUString TCHARArrayToOUString(TCHAR const* str);
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


[Libreoffice-commits] core.git: configmgr/source

2023-02-23 Thread Noel Grandin (via logerrit)
 configmgr/source/configurationprovider.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 12c00caa3d017116ba29801578f1bd42b111824a
Author: Noel Grandin 
AuthorDate: Thu Feb 23 09:39:35 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Feb 23 12:13:42 2023 +

unlock during dispose in configmgr::configuration_provider::Service

Since the code that can run during flushModifications might manage to
call back into Service..

regression from
commit a61951a3a21c6457334f78f657806c1167dbf339
Author: Noel Grandin 
Date:   Mon Feb 20 20:08:30 2023 +0200
BaseMutex->std::mutex in configmgr::configuration_provider::Service

Change-Id: I0070e7589cdea38905de6c68adefd8081b122152
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147500
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/configurationprovider.cxx 
b/configmgr/source/configurationprovider.cxx
index 215cad7f6f14..a99309397e37 100644
--- a/configmgr/source/configurationprovider.cxx
+++ b/configmgr/source/configurationprovider.cxx
@@ -106,7 +106,7 @@ private:
 
 virtual ~Service() override {}
 
-virtual void disposing(std::unique_lock& /*rGuard*/) override 
{ flushModifications(); }
+virtual void disposing(std::unique_lock& rGuard) override;
 
 virtual OUString SAL_CALL getImplementationName() override
 {
@@ -330,6 +330,12 @@ css::lang::Locale Service::getLocale() {
 return loc;
 }
 
+void Service::disposing(std::unique_lock& rGuard) {
+rGuard.unlock(); // just in case we call back into Service during dispose()
+flushModifications();
+rGuard.lock();
+}
+
 void Service::flushModifications() const {
 Components * components;
 {


[Libreoffice-commits] core.git: configmgr/source

2023-02-21 Thread Noel Grandin (via logerrit)
 configmgr/source/configurationprovider.cxx |   16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

New commits:
commit 00194781efcafa231ac53ba26c84e2df847cf5e7
Author: Noel Grandin 
AuthorDate: Tue Feb 21 12:41:58 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 21 11:58:51 2023 +

fix locking in configmgr::configuration_provider::Service

a mistake from
commit a61951a3a21c6457334f78f657806c1167dbf339
Author: Noel Grandin 
Date:   Mon Feb 20 20:08:30 2023 +0200
BaseMutex->std::mutex in configmgr::configuration_provider::Service

Change-Id: I59c670ea7bffacb9dcd1f073b5da2439c2102a45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147392
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/configurationprovider.cxx 
b/configmgr/source/configurationprovider.cxx
index ddff084a1b03..215cad7f6f14 100644
--- a/configmgr/source/configurationprovider.cxx
+++ b/configmgr/source/configurationprovider.cxx
@@ -106,7 +106,7 @@ private:
 
 virtual ~Service() override {}
 
-virtual void disposing(std::unique_lock& rGuard) override { 
flushModifications(rGuard); }
+virtual void disposing(std::unique_lock& /*rGuard*/) override 
{ flushModifications(); }
 
 virtual OUString SAL_CALL getImplementationName() override
 {
@@ -157,7 +157,7 @@ private:
 
 virtual css::lang::Locale SAL_CALL getLocale() override;
 
-void flushModifications(std::unique_lock& rGuard) const;
+void flushModifications() const;
 
 css::uno::Reference< css::uno::XComponentContext > context_;
 OUString locale_;
@@ -293,8 +293,8 @@ void Service::removeRefreshListener(
 }
 
 void Service::flush() {
+flushModifications();
 std::unique_lock g(m_aMutex);
-flushModifications(g);
 if (maFlushListeners.getLength(g)) {
 css::lang::EventObject ev(static_cast< cppu::OWeakObject * >(this));
 maFlushListeners.notifyEach(g, ::util::XFlushListener::flushed, 
ev);
@@ -330,11 +330,13 @@ css::lang::Locale Service::getLocale() {
 return loc;
 }
 
-void Service::flushModifications(std::unique_lock& rGuard) const {
-Components * components = ::getSingleton(context_);
-rGuard.unlock();
+void Service::flushModifications() const {
+Components * components;
+{
+osl::MutexGuard guard(*lock_);
+components = ::getSingleton(context_);
+}
 components->flushModifications();
-rGuard.lock();
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*


[Libreoffice-commits] core.git: configmgr/source

2023-02-21 Thread Noel Grandin (via logerrit)
 configmgr/source/configurationprovider.cxx |   59 +
 1 file changed, 28 insertions(+), 31 deletions(-)

New commits:
commit a61951a3a21c6457334f78f657806c1167dbf339
Author: Noel Grandin 
AuthorDate: Mon Feb 20 20:08:30 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 21 09:12:17 2023 +

BaseMutex->std::mutex in configmgr::configuration_provider::Service

Change-Id: Ie8f7cb4cd91ac0089365a691f07962a26d51a72a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147377
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/configurationprovider.cxx 
b/configmgr/source/configurationprovider.cxx
index b8bdcb4262f2..ddff084a1b03 100644
--- a/configmgr/source/configurationprovider.cxx
+++ b/configmgr/source/configurationprovider.cxx
@@ -39,8 +39,7 @@
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -74,19 +73,18 @@ void badNodePath() {
 }
 
 typedef
-cppu::WeakComponentImplHelper<
+comphelper::WeakComponentImplHelper<
 css::lang::XServiceInfo, css::lang::XMultiServiceFactory,
 css::util::XRefreshable, css::util::XFlushable,
 css::lang::XLocalizable >
 ServiceBase;
 
-class Service:
-private cppu::BaseMutex, public ServiceBase
+class Service : public ServiceBase
 {
 public:
 explicit Service(
 const css::uno::Reference< css::uno::XComponentContext >& context):
-ServiceBase(m_aMutex), context_(context), default_(true),
+context_(context), default_(true),
 lock_( lock() )
 {
 assert(context.is());
@@ -95,7 +93,7 @@ public:
 Service(
 const css::uno::Reference< css::uno::XComponentContext >& context,
 OUString locale):
-ServiceBase(m_aMutex), context_(context), locale_(std::move(locale)),
+context_(context), locale_(std::move(locale)),
 default_(false),
 lock_( lock() )
 {
@@ -108,7 +106,7 @@ private:
 
 virtual ~Service() override {}
 
-virtual void SAL_CALL disposing() override { flushModifications(); }
+virtual void disposing(std::unique_lock& rGuard) override { 
flushModifications(rGuard); }
 
 virtual OUString SAL_CALL getImplementationName() override
 {
@@ -159,12 +157,14 @@ private:
 
 virtual css::lang::Locale SAL_CALL getLocale() override;
 
-void flushModifications() const;
+void flushModifications(std::unique_lock& rGuard) const;
 
 css::uno::Reference< css::uno::XComponentContext > context_;
 OUString locale_;
 bool default_;
 std::shared_ptr lock_;
+comphelper::OInterfaceContainerHelper4 
maRefreshListeners;
+comphelper::OInterfaceContainerHelper4 
maFlushListeners;
 };
 
 css::uno::Reference< css::uno::XInterface > Service::createInstance(
@@ -271,49 +271,48 @@ css::uno::Sequence< OUString > 
Service::getAvailableServiceNames()
 
 void Service::refresh() {
 //TODO
-cppu::OInterfaceContainerHelper * cont = rBHelper.getContainer(
-cppu::UnoType< css::util::XRefreshListener >::get());
-if (cont != nullptr) {
+std::unique_lock g(m_aMutex);
+if (maRefreshListeners.getLength(g)) {
 css::lang::EventObject ev(static_cast< cppu::OWeakObject * >(this));
-cont->notifyEach(::util::XRefreshListener::refreshed, ev);
+maRefreshListeners.notifyEach(g, 
::util::XRefreshListener::refreshed, ev);
 }
 }
 
 void Service::addRefreshListener(
 css::uno::Reference< css::util::XRefreshListener > const & l)
 {
-rBHelper.addListener(
-cppu::UnoType< css::util::XRefreshListener >::get(), l);
+std::unique_lock g(m_aMutex);
+maRefreshListeners.addInterface(g, l);
 }
 
 void Service::removeRefreshListener(
 css::uno::Reference< css::util::XRefreshListener > const & l)
 {
-rBHelper.removeListener(
-cppu::UnoType< css::util::XRefreshListener >::get(), l);
+std::unique_lock g(m_aMutex);
+maRefreshListeners.removeInterface(g, l);
 }
 
 void Service::flush() {
-flushModifications();
-cppu::OInterfaceContainerHelper * cont = rBHelper.getContainer(
-cppu::UnoType< css::util::XFlushListener >::get());
-if (cont != nullptr) {
+std::unique_lock g(m_aMutex);
+flushModifications(g);
+if (maFlushListeners.getLength(g)) {
 css::lang::EventObject ev(static_cast< cppu::OWeakObject * >(this));
-cont->notifyEach(::util::XFlushListener::flushed, ev);
+maFlushListeners.notifyEach(g, ::util::XFlushListener::flushed, 
ev);
 }
 }
 
 void Service::addFlushListener(
 css::uno::Reference< css::util::XFlushListener > const & l)
 {
-rBHelper.addListener(cppu::UnoType< css::util::XFlushListener >::get(), l);
+std::unique_lock g(m_aMutex);
+maFlushListeners.addInterface(g, l);
 }
 
 void Service::removeFlushListener(
 css::uno::Reference< css::util::XFlushListener > const & l)
 {
-rBHelper.removeListener(
-cppu::UnoType< 

[Libreoffice-commits] core.git: configmgr/source

2023-02-16 Thread Eike Rathke (via logerrit)
 configmgr/source/access.cxx |   12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit b52117c0be97c45824d2897657084f8ac7e9bf42
Author: Eike Rathke 
AuthorDate: Fri Feb 17 02:12:23 2023 +0100
Commit: Eike Rathke 
CommitDate: Fri Feb 17 02:39:58 2023 +

Try an override locale as first fallback

Change-Id: I4ca6db43fef2706c4c1bab020e2170f6cf45a441
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147184
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 9d71c7fa2978..047c93a5627a 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -1394,9 +1394,19 @@ rtl::Reference< ChildAccess > Access::getChild(OUString 
const & name) {
 if (directChild.is())
 return directChild;
 
+LanguageTag aLanguageTag(locale, true);
+if (aLanguageTag.getBcp47() != locale)
+{
+// Original may be overridden by a known locale, for example
+// "zh-Hant-TW" by "zh-TW".
+rtl::Reference 
child(getChild(aLanguageTag.getBcp47()));
+if (child.is())
+return child;
+}
+
 // Find the best match using the LanguageTag fallback mechanism,
 // excluding the original tag.
-std::vector aFallbacks = 
LanguageTag(locale).getFallbackStrings(false);
+std::vector aFallbacks = 
aLanguageTag.getFallbackStrings(false);
 for (const OUString& rFallback : aFallbacks)
 {
 rtl::Reference child(getChild(rFallback));


[Libreoffice-commits] core.git: configmgr/source

2023-01-23 Thread Noel Grandin (via logerrit)
 configmgr/source/access.cxx  |4 +++-
 configmgr/source/childaccess.cxx |   18 +-
 configmgr/source/childaccess.hxx |8 +---
 3 files changed, 5 insertions(+), 25 deletions(-)

New commits:
commit 3f11b3c466565432e45f19f1cc30171075b9af8d
Author: Noel Grandin 
AuthorDate: Mon Jan 23 09:40:28 2023 +0200
Commit: Noel Grandin 
CommitDate: Mon Jan 23 10:10:48 2023 +

XUnoTunnel->dynamic_cast in configmgr::ChildAccess

Change-Id: Iadfdbb68ad7876801bf79352bdec26da7da63325
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145993
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 865d383002d3..48d9b46ddc26 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -2159,7 +2159,9 @@ void Access::checkKnownProperty(OUString const & 
descriptor) {
 rtl::Reference< ChildAccess > Access::getFreeSetMember(
 css::uno::Any const & value)
 {
-rtl::Reference< ChildAccess > freeAcc = 
comphelper::getFromUnoTunnel(value);
+css::uno::Reference xTmp;
+value >>= xTmp;
+rtl::Reference< ChildAccess > freeAcc = 
dynamic_cast(xTmp.get());
 if (!freeAcc.is() || freeAcc->getParentAccess().is() ||
 (freeAcc->isInTransaction() &&
  freeAcc->getRootAccess() != getRootAccess()))
diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx
index 60a11006bf7c..ea2394286371 100644
--- a/configmgr/source/childaccess.cxx
+++ b/configmgr/source/childaccess.cxx
@@ -56,12 +56,6 @@
 
 namespace configmgr {
 
-css::uno::Sequence< sal_Int8 > const & ChildAccess::getUnoTunnelId()
-{
-static const comphelper::UnoIdInit theChildAccessUnoTunnelId;
-return theChildAccessUnoTunnelId.getSeq();
-}
-
 ChildAccess::ChildAccess(
 Components & components, rtl::Reference< RootAccess > const & root,
 rtl::Reference< Access > const & parent, OUString name,
@@ -159,15 +153,6 @@ void ChildAccess::setParent(css::uno::Reference< 
css::uno::XInterface > const &)
 "setParent", static_cast< cppu::OWeakObject * >(this));
 }
 
-sal_Int64 ChildAccess::getSomething(
-css::uno::Sequence< sal_Int8 > const & aIdentifier)
-{
-assert(thisIs(IS_ANY));
-osl::MutexGuard g(*lock_);
-checkLocalizedPropertyAccess();
-return comphelper::getSomethingImpl(aIdentifier, this);
-}
-
 void ChildAccess::bind(
 rtl::Reference< RootAccess > const & root,
 rtl::Reference< Access > const & parent, OUString const & name)
@@ -341,8 +326,7 @@ css::uno::Any ChildAccess::queryInterface(css::uno::Type 
const & aType)
 return res.hasValue()
 ? res
 : cppu::queryInterface(
-aType, static_cast< css::container::XChild * >(this),
-static_cast< css::lang::XUnoTunnel * >(this));
+aType, static_cast< css::container::XChild * >(this));
 }
 
 }
diff --git a/configmgr/source/childaccess.hxx b/configmgr/source/childaccess.hxx
index 3b7a5a5410aa..6f060c2de827 100644
--- a/configmgr/source/childaccess.hxx
+++ b/configmgr/source/childaccess.hxx
@@ -26,7 +26,6 @@
 #include 
 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -48,11 +47,9 @@ class Node;
 class RootAccess;
 
 class ChildAccess:
-public Access, public css::container::XChild,
-public css::lang::XUnoTunnel
+public Access, public css::container::XChild
 {
 public:
-static css::uno::Sequence< sal_Int8 > const & getUnoTunnelId();
 
 ChildAccess(
 Components & components, rtl::Reference< RootAccess > const & root,
@@ -85,9 +82,6 @@ public:
 virtual void SAL_CALL setParent(
 css::uno::Reference< css::uno::XInterface > const &) override;
 
-virtual sal_Int64 SAL_CALL getSomething(
-css::uno::Sequence< sal_Int8 > const & aIdentifier) override;
-
 void bind(
 rtl::Reference< RootAccess > const & root,
 rtl::Reference< Access > const & parent, OUString const & name)


[Libreoffice-commits] core.git: configmgr/source

2022-09-27 Thread Stephan Bergmann (via logerrit)
 configmgr/source/access.cxx  |   15 +++
 configmgr/source/access.hxx  |2 +-
 configmgr/source/data.cxx|   20 ++--
 configmgr/source/data.hxx|2 +-
 configmgr/source/partial.cxx |8 
 5 files changed, 23 insertions(+), 24 deletions(-)

New commits:
commit 5c425ca13001ddd64b3f6fd4dde8af7468bc37c8
Author: Stephan Bergmann 
AuthorDate: Tue Sep 27 16:33:08 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Sep 27 19:47:55 2022 +0200

Revert some string_view pessimization

This reverts the configmgr part of 0a7eac8576f313dcaf27ee45326d71fd6b5aea1e 
"use
more string_view in accessibility..configmgr":  All calls to 
Data::parseSegment
(either directly, or indirectly either via Access::getSubChild or via
parseSegment in partial.cxx) pass in an OUString path, and in some cases 
(see
below)

> *name = path.substr(index, i - index);

in Data::parseSegment reconstructs an OUString from the full path (i.e.,
index == 0 and i == path.size()).  And I see no code that actually benefited
from the switch to string_view.

One example call stack for such an expensive reconstruction of an OUString 
from
full path is

> #0 in configmgr::Data::parseSegment(path=u"ooSetupSystemLocale", index=0, 
name=0x75299280, setElement=0x752992a0, templateName=0x752992b0) in 
core/configmgr/source/data.cxx
> #1 in configmgr::Access::getSubChild(this=0x61928f80, 
path=u"ooSetupSystemLocale") in core/configmgr/source/access.cxx
> #2 in configmgr::Access::getByHierarchicalName(this=0x61928f80, 
aName="ooSetupSystemLocale") in core/configmgr/source/access.cxx
> #3 in utl::ConfigItem::GetProperties(xHierarchyAccess=uno::Reference to 
(configmgr::RootAccess *) 0x61928fb8, rNames=uno::Sequence of length 6 = 
{...}, bAllLocales=false) in core/unotools/source/config/configitem.cxx
> #4 in utl::ConfigItem::GetProperties(this=0x6110cad0, 
rNames=uno::Sequence of length 6 = {...}) in 
core/unotools/source/config/configitem.cxx
> #5 in 
SvtSysLocaleOptions_Impl::SvtSysLocaleOptions_Impl(this=0x6110cad0) in 
core/unotools/source/config/syslocaleoptions.cxx
[...]

Change-Id: I51127d82aea927dd9aaf374880c406dbafaddcde
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140658
Reviewed-by: Noel Grandin 
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 06c000dcdbd3..865d383002d3 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -74,7 +74,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -1971,10 +1970,10 @@ rtl::Reference< ChildAccess > 
Access::getUnmodifiedChild(
 return createUnmodifiedChild(name,node);
 }
 
-rtl::Reference< ChildAccess > Access::getSubChild(std::u16string_view path) {
+rtl::Reference< ChildAccess > Access::getSubChild(OUString const & path) {
 sal_Int32 i = 0;
 // For backwards compatibility, allow absolute paths where meaningful:
-if( o3tl::starts_with(path, u"/") ) {
+if( path.startsWith("/") ) {
 ++i;
 if (!getRootAccess().is()) {
 return rtl::Reference< ChildAccess >();
@@ -1987,7 +1986,7 @@ rtl::Reference< ChildAccess > 
Access::getSubChild(std::u16string_view path) {
 OUString templateName1;
 i = Data::parseSegment(
 path, i, , , );
-if (i == -1 || (i != static_cast(path.size()) && 
path[i] != '/')) {
+if (i == -1 || (i != path.getLength() && path[i] != '/')) {
 return rtl::Reference< ChildAccess >();
 }
 OUString name2;
@@ -2000,7 +1999,7 @@ rtl::Reference< ChildAccess > 
Access::getSubChild(std::u16string_view path) {
 {
 return rtl::Reference< ChildAccess >();
 }
-if (i != static_cast(path.size())) {
+if (i != path.getLength()) {
 ++i;
 }
 }
@@ -2010,7 +2009,7 @@ rtl::Reference< ChildAccess > 
Access::getSubChild(std::u16string_view path) {
 bool setElement;
 OUString templateName;
 i = Data::parseSegment(path, i, , , );
-if (i == -1 || (i != static_cast(path.size()) && path[i] != 
'/')) {
+if (i == -1 || (i != path.getLength() && path[i] != '/')) {
 return rtl::Reference< ChildAccess >();
 }
 rtl::Reference< ChildAccess > child(parent->getChild(name));
@@ -2042,9 +2041,9 @@ rtl::Reference< ChildAccess > 
Access::getSubChild(std::u16string_view path) {
 // For backwards compatibility, ignore a final slash after non-value
 // nodes:
 if (child->isValue()) {
-return i == static_cast(path.size())
+return i == path.getLength()
 ? child : rtl::Reference< ChildAccess >();
-} else if (i >= 

[Libreoffice-commits] core.git: configmgr/source

2022-05-23 Thread Noel Grandin (via logerrit)
 configmgr/source/access.cxx|5 +++--
 configmgr/source/access.hxx|2 +-
 configmgr/source/broadcaster.cxx   |   17 +
 configmgr/source/broadcaster.hxx   |8 
 configmgr/source/childaccess.cxx   |5 +++--
 configmgr/source/childaccess.hxx   |2 +-
 configmgr/source/components.cxx|   13 +++--
 configmgr/source/configurationprovider.cxx |5 +++--
 configmgr/source/configurationregistry.cxx |5 +++--
 configmgr/source/groupnode.cxx |5 +++--
 configmgr/source/groupnode.hxx |2 +-
 configmgr/source/localizedvaluenode.cxx|5 +++--
 configmgr/source/localizedvaluenode.hxx|2 +-
 configmgr/source/propertynode.cxx  |5 +++--
 configmgr/source/propertynode.hxx  |2 +-
 configmgr/source/readonlyaccess.cxx|5 +++--
 configmgr/source/readwriteaccess.cxx   |5 +++--
 configmgr/source/rootaccess.cxx|9 +
 configmgr/source/rootaccess.hxx|4 ++--
 configmgr/source/setnode.cxx   |9 +
 configmgr/source/setnode.hxx   |4 ++--
 configmgr/source/xcsparser.hxx |7 ---
 configmgr/source/xcuparser.hxx |9 +
 23 files changed, 75 insertions(+), 60 deletions(-)

New commits:
commit be9a39488420b069ed5c7fd65347b2ff68883e62
Author: Noel Grandin 
AuthorDate: Mon May 23 09:01:36 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon May 23 10:52:11 2022 +0200

clang-tidy modernize-pass-by-value in configmgr

Change-Id: If2e69c04e4d72ec6911fb435092275dbfffbf991
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134752
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 86e6bdb72772..865d383002d3 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -21,6 +21,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -1924,8 +1925,8 @@ Access::ModifiedChild::ModifiedChild():
 {}
 
 Access::ModifiedChild::ModifiedChild(
-rtl::Reference< ChildAccess > const & theChild, bool theDirectlyModified):
-child(theChild), directlyModified(theDirectlyModified)
+rtl::Reference< ChildAccess > theChild, bool theDirectlyModified):
+child(std::move(theChild)), directlyModified(theDirectlyModified)
 {}
 
 rtl::Reference< ChildAccess > Access::getModifiedChild(
diff --git a/configmgr/source/access.hxx b/configmgr/source/access.hxx
index 811c63693835..51e43d5bcfcc 100644
--- a/configmgr/source/access.hxx
+++ b/configmgr/source/access.hxx
@@ -354,7 +354,7 @@ private:
 ModifiedChild();
 
 ModifiedChild(
-rtl::Reference< ChildAccess > const & theChild,
+rtl::Reference< ChildAccess > theChild,
 bool theDirectlyModified);
 };
 
diff --git a/configmgr/source/broadcaster.cxx b/configmgr/source/broadcaster.cxx
index 24b047e9d5a4..f1830ee81b13 100644
--- a/configmgr/source/broadcaster.cxx
+++ b/configmgr/source/broadcaster.cxx
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "broadcaster.hxx"
 
@@ -183,8 +184,8 @@ void Broadcaster::send() {
 
 Broadcaster::DisposeNotification::DisposeNotification(
 css::uno::Reference< css::lang::XEventListener > const & theListener,
-css::lang::EventObject const & theEvent):
-listener(theListener), event(theEvent)
+css::lang::EventObject  theEvent):
+listener(theListener), event(std::move(theEvent))
 {
 assert(theListener.is());
 }
@@ -192,8 +193,8 @@ Broadcaster::DisposeNotification::DisposeNotification(
 Broadcaster::ContainerNotification::ContainerNotification(
 css::uno::Reference< css::container::XContainerListener > const &
 theListener,
-css::container::ContainerEvent const & theEvent):
-listener(theListener), event(theEvent)
+css::container::ContainerEvent  theEvent):
+listener(theListener), event(std::move(theEvent))
 {
 assert(theListener.is());
 }
@@ -201,8 +202,8 @@ Broadcaster::ContainerNotification::ContainerNotification(
 Broadcaster::PropertyChangeNotification::PropertyChangeNotification(
 css::uno::Reference< css::beans::XPropertyChangeListener > const &
 theListener,
-css::beans::PropertyChangeEvent const & theEvent):
-listener(theListener), event(theEvent)
+css::beans::PropertyChangeEvent  theEvent):
+listener(theListener), event(std::move(theEvent))
 {
 assert(theListener.is());
 }
@@ -218,8 +219,8 @@ 
Broadcaster::PropertiesChangeNotification::PropertiesChangeNotification(
 
 Broadcaster::ChangesNotification::ChangesNotification(
 css::uno::Reference< css::util::XChangesListener > const & theListener,
-css::util::ChangesEvent const & theEvent):
-listener(theListener), event(theEvent)
+css::util::ChangesEvent  theEvent):
+listener(theListener), 

[Libreoffice-commits] core.git: configmgr/source

2022-05-17 Thread Tor Lillqvist (via logerrit)
 configmgr/source/config_map.hxx |5 ++---
 configmgr/source/nodemap.cxx|7 ---
 configmgr/source/nodemap.hxx|5 ++---
 3 files changed, 8 insertions(+), 9 deletions(-)

New commits:
commit c400311414fca20d3705ee9ef24747b9a5301167
Author: Tor Lillqvist 
AuthorDate: Tue May 17 10:46:45 2022 +0300
Commit: Caolán McNamara 
CommitDate: Tue May 17 10:48:20 2022 +0200

Revert "use boost::flat_map in config_map"

Fixes build breakage on macOS at least. Noel said it was OK to revert.

This reverts commit cc4325f84a0ba35d8bbb564512bce0c6b8aab408.

Change-Id: Ib78d29fc21d4d030b4032955b18271de1761f396
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134458
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/configmgr/source/config_map.hxx b/configmgr/source/config_map.hxx
index f968165736d1..5d2990d5a0d8 100644
--- a/configmgr/source/config_map.hxx
+++ b/configmgr/source/config_map.hxx
@@ -9,7 +9,7 @@
 #ifndef CONFIG_MAP_HXX
 #define CONFIG_MAP_HXX
 
-#include 
+#include 
 #include 
 
 // The realisation here is that while a map is a reasonably compact
@@ -28,8 +28,7 @@ struct LengthContentsCompare
 }
 };
 
-template 
-struct config_map : public boost::container::flat_map
+template  struct config_map : public std::map
 {
 };
 
diff --git a/configmgr/source/nodemap.cxx b/configmgr/source/nodemap.cxx
index 0b524846bfcd..e21578b2880b 100644
--- a/configmgr/source/nodemap.cxx
+++ b/configmgr/source/nodemap.cxx
@@ -42,9 +42,10 @@ void NodeMap::cloneInto(NodeMap* target) const
 
 rtl::Reference NodeMap::findNode(int layer, OUString const& name) const
 {
-if (!moCache || (*moCache)->first != name)
-moCache = const_cast(this)->maImpl.find(name);
-const_iterator i = *moCache;
+const_iterator i;
+if (maCache == end() || maCache->first != name)
+maCache = const_cast(this)->maImpl.find(name);
+i = maCache;
 return i == end() || i->second->getLayer() > layer ? 
rtl::Reference() : i->second;
 }
 }
diff --git a/configmgr/source/nodemap.hxx b/configmgr/source/nodemap.hxx
index b03a6503bb22..19447c7f77f7 100644
--- a/configmgr/source/nodemap.hxx
+++ b/configmgr/source/nodemap.hxx
@@ -23,7 +23,6 @@
 #include "config_map.hxx"
 #include 
 #include "node.hxx"
-#include 
 
 namespace configmgr {
 
@@ -60,8 +59,8 @@ class NodeMap
 
 private:
 // We get a large number of repeated identical lookups.
-mutable std::optional moCache;
-void clearCache() { moCache.reset(); }
+mutable const_iterator maCache;
+void clearCache() { maCache = maImpl.end(); }
 };
 
 }


[Libreoffice-commits] core.git: configmgr/source

2022-05-15 Thread Noel Grandin (via logerrit)
 configmgr/source/config_map.hxx |5 +++--
 configmgr/source/nodemap.cxx|7 +++
 configmgr/source/nodemap.hxx|5 +++--
 3 files changed, 9 insertions(+), 8 deletions(-)

New commits:
commit cc4325f84a0ba35d8bbb564512bce0c6b8aab408
Author: Noel Grandin 
AuthorDate: Sun May 15 13:01:22 2022 +0200
Commit: Noel Grandin 
CommitDate: Sun May 15 21:39:58 2022 +0200

use boost::flat_map in config_map

reduces time spent allocating

Change-Id: Idd571db62d28be7e48672f76d741174a7ab40959
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134346
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/config_map.hxx b/configmgr/source/config_map.hxx
index 5d2990d5a0d8..f968165736d1 100644
--- a/configmgr/source/config_map.hxx
+++ b/configmgr/source/config_map.hxx
@@ -9,7 +9,7 @@
 #ifndef CONFIG_MAP_HXX
 #define CONFIG_MAP_HXX
 
-#include 
+#include 
 #include 
 
 // The realisation here is that while a map is a reasonably compact
@@ -28,7 +28,8 @@ struct LengthContentsCompare
 }
 };
 
-template  struct config_map : public std::map
+template 
+struct config_map : public boost::container::flat_map
 {
 };
 
diff --git a/configmgr/source/nodemap.cxx b/configmgr/source/nodemap.cxx
index e21578b2880b..0b524846bfcd 100644
--- a/configmgr/source/nodemap.cxx
+++ b/configmgr/source/nodemap.cxx
@@ -42,10 +42,9 @@ void NodeMap::cloneInto(NodeMap* target) const
 
 rtl::Reference NodeMap::findNode(int layer, OUString const& name) const
 {
-const_iterator i;
-if (maCache == end() || maCache->first != name)
-maCache = const_cast(this)->maImpl.find(name);
-i = maCache;
+if (!moCache || (*moCache)->first != name)
+moCache = const_cast(this)->maImpl.find(name);
+const_iterator i = *moCache;
 return i == end() || i->second->getLayer() > layer ? 
rtl::Reference() : i->second;
 }
 }
diff --git a/configmgr/source/nodemap.hxx b/configmgr/source/nodemap.hxx
index 19447c7f77f7..b03a6503bb22 100644
--- a/configmgr/source/nodemap.hxx
+++ b/configmgr/source/nodemap.hxx
@@ -23,6 +23,7 @@
 #include "config_map.hxx"
 #include 
 #include "node.hxx"
+#include 
 
 namespace configmgr {
 
@@ -59,8 +60,8 @@ class NodeMap
 
 private:
 // We get a large number of repeated identical lookups.
-mutable const_iterator maCache;
-void clearCache() { maCache = maImpl.end(); }
+mutable std::optional moCache;
+void clearCache() { moCache.reset(); }
 };
 
 }


[Libreoffice-commits] core.git: configmgr/source

2022-05-12 Thread Noel Grandin (via logerrit)
 configmgr/source/access.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit cf954c71850521405176c6cbe4bf636806421c21
Author: Noel Grandin 
AuthorDate: Wed May 11 11:43:18 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu May 12 08:34:07 2022 +0200

elide temporary std::vector in Access::getElementNames

Change-Id: I9a875d5615930700e20f67c40b4b7a24458fd447
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134198
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 806ff8944d81..86e6bdb72772 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -409,13 +409,13 @@ css::uno::Sequence< OUString > Access::getElementNames()
 osl::MutexGuard g(*lock_);
 checkLocalizedPropertyAccess();
 std::vector< rtl::Reference< ChildAccess > > children(getAllChildren());
-std::vector names;
-names.reserve(children.size());
+css::uno::Sequence names(children.size());
+OUString* pArray = names.getArray();
 for (auto const& child : children)
 {
-names.push_back(child->getNameInternal());
+*pArray++ = child->getNameInternal();
 }
-return comphelper::containerToSequence(names);
+return names;
 }
 
 sal_Bool Access::hasByName(OUString const & aName)


[Libreoffice-commits] core.git: configmgr/source

2022-05-11 Thread Noel Grandin (via logerrit)
 configmgr/source/access.cxx  |2 +-
 configmgr/source/access.hxx  |2 +-
 configmgr/source/childaccess.cxx |2 +-
 configmgr/source/childaccess.hxx |2 +-
 configmgr/source/rootaccess.cxx  |2 +-
 configmgr/source/rootaccess.hxx  |2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 52a0f9e6b881c21275358de3ec9b4c85f77402e4
Author: Noel Grandin 
AuthorDate: Wed May 11 10:59:29 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed May 11 15:08:33 2022 +0200

avoid some ref-counting traffic in configmgr::Access:getNameInternal

Change-Id: I3062855ab8f9ec9f1e7cdffe163f1c78865d5b9d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134154
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 30e75eb9e8b7..806ff8944d81 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -1416,7 +1416,7 @@ rtl::Reference< ChildAccess > Access::getChild(OUString 
const & name) {
 getAllChildren());
 for (auto const& child : children)
 {
-OUString name2(child->getNameInternal());
+const OUString & name2(child->getNameInternal());
 if (name2.startsWith(locale) &&
 (name2.getLength() == locale.getLength() ||
  name2[locale.getLength()] == '-' ||
diff --git a/configmgr/source/access.hxx b/configmgr/source/access.hxx
index 6d4ca787f3cc..811c63693835 100644
--- a/configmgr/source/access.hxx
+++ b/configmgr/source/access.hxx
@@ -301,7 +301,7 @@ protected:
 
 virtual ~Access() override;
 
-virtual OUString getNameInternal() = 0;
+virtual const OUString & getNameInternal() = 0;
 virtual rtl::Reference< RootAccess > getRootAccess() = 0;
 virtual rtl::Reference< Access > getParentAccess() = 0;
 
diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx
index 87def984be17..6010a5a5ce3b 100644
--- a/configmgr/source/childaccess.cxx
+++ b/configmgr/source/childaccess.cxx
@@ -121,7 +121,7 @@ bool ChildAccess::isFinalized() {
 (parent_.is() && parent_->isFinalized());
 }
 
-OUString ChildAccess::getNameInternal() {
+const OUString & ChildAccess::getNameInternal() {
 return name_;
 }
 
diff --git a/configmgr/source/childaccess.hxx b/configmgr/source/childaccess.hxx
index d063a28c9c9c..dc7e47005d2f 100644
--- a/configmgr/source/childaccess.hxx
+++ b/configmgr/source/childaccess.hxx
@@ -71,7 +71,7 @@ public:
 
 virtual bool isFinalized() override;
 
-virtual OUString getNameInternal() override;
+virtual const OUString & getNameInternal() override;
 
 virtual rtl::Reference< RootAccess > getRootAccess() override;
 virtual rtl::Reference< Access > getParentAccess() override;
diff --git a/configmgr/source/rootaccess.cxx b/configmgr/source/rootaccess.cxx
index 17c8f7ec12a2..1043bd9bedab 100644
--- a/configmgr/source/rootaccess.cxx
+++ b/configmgr/source/rootaccess.cxx
@@ -233,7 +233,7 @@ bool RootAccess::isFinalized() {
 return finalized_;
 }
 
-OUString RootAccess::getNameInternal() {
+const OUString & RootAccess::getNameInternal() {
 getNode();
 return name_;
 }
diff --git a/configmgr/source/rootaccess.hxx b/configmgr/source/rootaccess.hxx
index 11fbea450eed..982de3c6f2c8 100644
--- a/configmgr/source/rootaccess.hxx
+++ b/configmgr/source/rootaccess.hxx
@@ -98,7 +98,7 @@ private:
 
 virtual bool isFinalized() override;
 
-virtual OUString getNameInternal() override;
+virtual const OUString & getNameInternal() override;
 
 virtual rtl::Reference< RootAccess > getRootAccess() override;
 


[Libreoffice-commits] core.git: configmgr/source

2022-04-26 Thread Stephan Bergmann (via logerrit)
 configmgr/source/data.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit b1c80b5c0973563c8cbf7c305aef493e9d3f7c0d
Author: Stephan Bergmann 
AuthorDate: Tue Apr 26 14:32:18 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Apr 26 15:43:59 2022 +0200

Adapt function's interface to change from OUString to std::u16string_view

...in 6fc3dfd3f1b5cb13101299df42444f2ff0493846 "use more string_view"

Change-Id: Ibd1b8748e7a261cdb457a14ba87b1ec68d2a83de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133438
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/configmgr/source/data.cxx b/configmgr/source/data.cxx
index 518d08513ad6..f173ee1556fb 100644
--- a/configmgr/source/data.cxx
+++ b/configmgr/source/data.cxx
@@ -21,6 +21,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -44,11 +45,11 @@ namespace configmgr {
 namespace {
 
 bool decode(
-std::u16string_view encoded, sal_Int32 begin, sal_Int32 end,
+std::u16string_view encoded, std::size_t begin, std::size_t end,
 OUString * decoded)
 {
 assert(
-begin >= 0 && begin <= end && end <= 
static_cast(encoded.size()) &&
+begin <= end && end <= encoded.size() &&
 decoded != nullptr);
 OUStringBuffer buf(end - begin);
 while (begin != end) {


[Libreoffice-commits] core.git: configmgr/source

2022-04-13 Thread Noel Grandin (via logerrit)
 configmgr/source/components.cxx |   14 +++---
 configmgr/source/components.hxx |2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 902e81b1b0c62993270846962d44aea6774e9687
Author: Noel Grandin 
AuthorDate: Wed Apr 13 16:13:41 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Apr 13 20:35:21 2022 +0200

use more string_view in configmgr

Change-Id: Ia8aab5ea1a03d1512a1da806d505ce06f6977828
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132971
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index cf1375956571..57f9e30e185b 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -405,15 +405,15 @@ void Components::insertModificationXcuFile(
 }
 
 css::beans::Optional< css::uno::Any > Components::getExternalValue(
-OUString const & descriptor)
+std::u16string_view descriptor)
 {
-sal_Int32 i = descriptor.indexOf(' ');
-if (i <= 0) {
+size_t i = descriptor.find(' ');
+if (i == 0 || i == std::u16string_view::npos) {
 throw css::uno::RuntimeException(
-"bad external value descriptor " + descriptor);
+OUString::Concat("bad external value descriptor ") + descriptor);
 }
 //TODO: Do not make calls with mutex locked:
-OUString name(descriptor.copy(0, i));
+OUString name(descriptor.substr(0, i));
 ExternalServices::iterator j(externalServices_.find(name));
 if (j == externalServices_.end()) {
 css::uno::Reference< css::uno::XInterface > service;
@@ -439,11 +439,11 @@ css::beans::Optional< css::uno::Any > 
Components::getExternalValue(
 css::beans::Optional< css::uno::Any > value;
 if (j->second.is()) {
 try {
-if (!(j->second->getPropertyValue(descriptor.copy(i + 1)) >>=
+if (!(j->second->getPropertyValue(OUString(descriptor.substr(i + 
1))) >>=
   value))
 {
 throw css::uno::RuntimeException(
-"cannot obtain external value through " + descriptor);
+OUString::Concat("cannot obtain external value through ") 
+ descriptor);
 }
 } catch (css::beans::UnknownPropertyException & e) {
 throw css::uno::RuntimeException(
diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx
index 08f14a8b7bf9..5d7b6b5967ee 100644
--- a/configmgr/source/components.hxx
+++ b/configmgr/source/components.hxx
@@ -96,7 +96,7 @@ public:
 Modifications * modifications);
 
 css::beans::Optional< css::uno::Any >
-getExternalValue(OUString const & descriptor);
+getExternalValue(std::u16string_view descriptor);
 
 private:
 Components(const Components&) = delete;


[Libreoffice-commits] core.git: configmgr/source connectivity/source forms/source i18npool/inc i18npool/source i18nutil/source idl/source include/connectivity include/i18nutil include/linguistic inclu

2022-04-11 Thread Noel Grandin (via logerrit)
 configmgr/source/config_map.hxx |6 -
 configmgr/source/data.cxx   |   11 +-
 connectivity/source/commontools/dbconversion.cxx|4 
 connectivity/source/parse/sqlnode.cxx   |2 
 forms/source/xforms/convert.cxx |4 
 i18npool/inc/nativenumbersupplier.hxx   |2 
 i18npool/inc/transliteration_Numeric.hxx|2 
 i18npool/source/localedata/LocaleNode.cxx   |   30 ++---
 i18npool/source/localedata/LocaleNode.hxx   |   12 +-
 i18npool/source/localedata/filewriter.cxx   |   14 +-
 i18npool/source/nativenumber/nativenumbersupplier.cxx   |9 -
 i18npool/source/transliteration/transliteration_Numeric.cxx |6 -
 i18nutil/source/utility/scripttypedetector.cxx  |   22 ++--
 idl/source/prj/parser.cxx   |8 -
 include/connectivity/dbconversion.hxx   |2 
 include/connectivity/sqlnode.hxx|2 
 include/i18nutil/scripttypedetector.hxx |8 -
 include/linguistic/misc.hxx |8 -
 include/svl/PasswordHelper.hxx  |8 -
 include/svl/cryptosign.hxx  |2 
 include/svl/lngmisc.hxx |2 
 include/unotools/configpaths.hxx|6 -
 include/unotools/datetime.hxx   |2 
 include/unotools/localedatawrapper.hxx  |4 
 linguistic/source/dicimp.cxx|   10 -
 linguistic/source/dicimp.hxx|6 -
 linguistic/source/hhconvdic.cxx |4 
 linguistic/source/misc.cxx  |   26 ++---
 sc/source/core/data/tabprotection.cxx   |4 
 sfx2/source/dialog/securitypage.cxx |2 
 svl/source/crypto/cryptosign.cxx|4 
 svl/source/misc/PasswordHelper.cxx  |   12 +-
 svl/source/misc/lngmisc.cxx |4 
 svl/source/misc/urihelper.cxx   |4 
 svl/source/passwordcontainer/passwordcontainer.cxx  |8 -
 svl/source/passwordcontainer/passwordcontainer.hxx  |2 
 unotools/source/config/configitem.cxx   |4 
 unotools/source/config/configpaths.cxx  |   21 ++--
 unotools/source/i18n/localedatawrapper.cxx  |   62 ++--
 unotools/source/misc/datetime.cxx   |   32 +++---
 vcl/source/control/longcurr.cxx |2 
 41 files changed, 193 insertions(+), 190 deletions(-)

New commits:
commit 6fc3dfd3f1b5cb13101299df42444f2ff0493846
Author: Noel Grandin 
AuthorDate: Mon Apr 11 14:49:08 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon Apr 11 17:44:46 2022 +0200

use more string_view

found by tweaking the loplugin:stringview and making it whitelist
getLength

Change-Id: Ic41cd4e3026d93b70a76fe1279c6de3abbe6b4a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132820
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/config_map.hxx b/configmgr/source/config_map.hxx
index af15f23ae9cf..5d2990d5a0d8 100644
--- a/configmgr/source/config_map.hxx
+++ b/configmgr/source/config_map.hxx
@@ -19,12 +19,12 @@
 
 struct LengthContentsCompare
 {
-bool operator()(const OUString& a, const OUString& b) const
+bool operator()(std::u16string_view a, std::u16string_view b) const
 {
-if (a.getLength() == b.getLength())
+if (a.size() == b.size())
 return a < b;
 else
-return a.getLength() < b.getLength();
+return a.size() < b.size();
 }
 };
 
diff --git a/configmgr/source/data.cxx b/configmgr/source/data.cxx
index 6279e02cf096..518d08513ad6 100644
--- a/configmgr/source/data.cxx
+++ b/configmgr/source/data.cxx
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "additions.hxx"
 #include "data.hxx"
@@ -43,23 +44,23 @@ namespace configmgr {
 namespace {
 
 bool decode(
-OUString const & encoded, sal_Int32 begin, sal_Int32 end,
+std::u16string_view encoded, sal_Int32 begin, sal_Int32 end,
 OUString * decoded)
 {
 assert(
-begin >= 0 && begin <= end && end <= encoded.getLength() &&
+begin >= 0 && begin <= end && end <= 
static_cast(encoded.size()) &&
 decoded != nullptr);
 OUStringBuffer buf(end - begin);
 while (begin != end) {
 sal_Unicode c = encoded[begin++];
 if (c == '&') {
-if (encoded.match("amp;", begin)) {
+if (o3tl::starts_with(encoded.substr(begin), 

[Libreoffice-commits] core.git: configmgr/source

2021-11-23 Thread Caolán McNamara (via logerrit)
 configmgr/source/dconf.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 62924b92d6737579cc4709b410d311251d4e5517
Author: Caolán McNamara 
AuthorDate: Tue Nov 23 16:46:07 2021 +
Commit: Caolán McNamara 
CommitDate: Tue Nov 23 20:42:35 2021 +0100

fix configmgr --enable-dconf build

error: no viable conversion from 'const char [1]' to 'std::u16string_view' 
(aka 'basic_string_view')
and
warning: instead of an 'rtl::OUString' constructed from a 'char16_t', pass 
a 'std::u16string_view' (or an 'rtl::OUStringChar') [loplugin:stringview]

Change-Id: I0e611606190f063227c5467dc5a082277cebaaa0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125706
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/configmgr/source/dconf.cxx b/configmgr/source/dconf.cxx
index 1c0711ff1927..9db51fa17cfb 100644
--- a/configmgr/source/dconf.cxx
+++ b/configmgr/source/dconf.cxx
@@ -231,11 +231,11 @@ bool decode(OUString * string, bool slash) {
 return true;
 }
 if (string->match("00", i + 1)) {
-*string = string->replaceAt(i, 3, OUString(u'\0'));
+*string = string->replaceAt(i, 3, OUStringChar(u'\0'));
 } else if (slash && string->match("2F", i + 1)) {
-*string = string->replaceAt(i, 3, "/");
+*string = string->replaceAt(i, 3, u"/");
 } else if (string->match("5C", i + 1)) {
-*string = string->replaceAt(i + 1, 2, "");
+*string = string->replaceAt(i + 1, 2, u"");
 } else {
 SAL_WARN("configmgr.dconf", "bad escape in " << *string);
 return false;


[Libreoffice-commits] core.git: configmgr/source

2021-11-21 Thread Noel Grandin (via logerrit)
 configmgr/source/configurationregistry.cxx |   50 ++---
 1 file changed, 25 insertions(+), 25 deletions(-)

New commits:
commit 7ef421dbfbfd486f235a7c5bdbd856b8ee9d62ea
Author: Noel Grandin 
AuthorDate: Sat Nov 20 22:06:23 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Nov 21 13:27:20 2021 +0100

osl::Mutex->std::mutex in configuration_registry

Change-Id: If5561d6532716bfe3151f555a691aa5188264a1f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125603
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/configurationregistry.cxx 
b/configmgr/source/configurationregistry.cxx
index e4d86c46e9f2..1301fcf134ce 100644
--- a/configmgr/source/configurationregistry.cxx
+++ b/configmgr/source/configurationregistry.cxx
@@ -50,7 +50,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
@@ -119,7 +119,7 @@ private:
 void doClose();
 
 css::uno::Reference< css::lang::XMultiServiceFactory > provider_;
-osl::Mutex mutex_;
+std::mutex mutex_;
 css::uno::Reference< css::uno::XInterface > access_;
 OUString url_;
 bool readOnly_;
@@ -234,7 +234,7 @@ Service::Service(
 }
 
 OUString Service::getURL() {
-osl::MutexGuard g(mutex_);
+std::unique_lock g(mutex_);
 checkValid_RuntimeException();
 return url_;
 }
@@ -242,7 +242,7 @@ OUString Service::getURL() {
 void Service::open(OUString const & rURL, sal_Bool bReadOnly, sal_Bool)
 {
 //TODO: bCreate
-osl::MutexGuard g(mutex_);
+std::unique_lock g(mutex_);
 if (access_.is()) {
 doClose();
 }
@@ -269,13 +269,13 @@ void Service::open(OUString const & rURL, sal_Bool 
bReadOnly, sal_Bool)
 }
 
 sal_Bool Service::isValid() {
-osl::MutexGuard g(mutex_);
+std::unique_lock g(mutex_);
 return access_.is();
 }
 
 void Service::close()
 {
-osl::MutexGuard g(mutex_);
+std::unique_lock g(mutex_);
 checkValid();
 doClose();
 }
@@ -289,13 +289,13 @@ void Service::destroy()
 
 css::uno::Reference< css::registry::XRegistryKey > Service::getRootKey()
 {
-osl::MutexGuard g(mutex_);
+std::unique_lock g(mutex_);
 checkValid();
 return new RegistryKey(*this, css::uno::Any(access_));
 }
 
 sal_Bool Service::isReadOnly() {
-osl::MutexGuard g(mutex_);
+std::unique_lock g(mutex_);
 checkValid_RuntimeException();
 return readOnly_;
 }
@@ -351,7 +351,7 @@ void Service::doClose() {
 }
 
 OUString RegistryKey::getKeyName() {
-osl::MutexGuard g(service_.mutex_);
+std::unique_lock g(service_.mutex_);
 service_.checkValid_RuntimeException();
 css::uno::Reference< css::container::XNamed > named;
 if (value_ >>= named) {
@@ -364,7 +364,7 @@ OUString RegistryKey::getKeyName() {
 
 sal_Bool RegistryKey::isReadOnly()
 {
-osl::MutexGuard g(service_.mutex_);
+std::unique_lock g(service_.mutex_);
 service_.checkValid_RuntimeException();
 return service_.readOnly_; //TODO: read-only sub-nodes in update access?
 }
@@ -375,14 +375,14 @@ sal_Bool RegistryKey::isValid() {
 
 css::registry::RegistryKeyType RegistryKey::getKeyType(OUString const &)
 {
-osl::MutexGuard g(service_.mutex_);
+std::unique_lock g(service_.mutex_);
 service_.checkValid();
 return css::registry::RegistryKeyType_KEY;
 }
 
 css::registry::RegistryValueType RegistryKey::getValueType()
 {
-osl::MutexGuard g(service_.mutex_);
+std::unique_lock g(service_.mutex_);
 service_.checkValid();
 css::uno::Type t(value_.getValueType());
 switch (t.getTypeClass()) {
@@ -409,7 +409,7 @@ css::registry::RegistryValueType RegistryKey::getValueType()
 
 sal_Int32 RegistryKey::getLongValue()
 {
-osl::MutexGuard g(service_.mutex_);
+std::unique_lock g(service_.mutex_);
 service_.checkValid();
 sal_Int32 v = 0;
 if (value_ >>= v) {
@@ -429,7 +429,7 @@ void RegistryKey::setLongValue(sal_Int32)
 
 css::uno::Sequence< sal_Int32 > RegistryKey::getLongListValue()
 {
-osl::MutexGuard g(service_.mutex_);
+std::unique_lock g(service_.mutex_);
 service_.checkValid();
 css::uno::Sequence< sal_Int32 > v;
 if (value_ >>= v) {
@@ -449,7 +449,7 @@ void RegistryKey::setLongListValue(css::uno::Sequence< 
sal_Int32 > const &)
 
 OUString RegistryKey::getAsciiValue()
 {
-osl::MutexGuard g(service_.mutex_);
+std::unique_lock g(service_.mutex_);
 service_.checkValid();
 OUString v;
 if (value_ >>= v) {
@@ -469,7 +469,7 @@ void RegistryKey::setAsciiValue(OUString const &)
 
 css::uno::Sequence< OUString > RegistryKey::getAsciiListValue()
 {
-osl::MutexGuard g(service_.mutex_);
+std::unique_lock g(service_.mutex_);
 service_.checkValid();
 css::uno::Sequence< OUString > v;
 if (value_ >>= v) {
@@ -489,7 +489,7 @@ void RegistryKey::setAsciiListValue(css::uno::Sequence< 
OUString > const &)
 
 OUString RegistryKey::getStringValue()
 {
-osl::MutexGuard g(service_.mutex_);
+std::unique_lock 

[Libreoffice-commits] core.git: configmgr/source

2021-10-29 Thread Mike Kaganski (via logerrit)
 configmgr/source/access.cxx|   16 +---
 configmgr/source/configurationregistry.cxx |4 ++--
 configmgr/source/valueparser.cxx   |3 ++-
 3 files changed, 13 insertions(+), 10 deletions(-)

New commits:
commit 0787aeac2428bf6a2e372ed5f2eac2f079c28ba6
Author: Mike Kaganski 
AuthorDate: Thu Oct 28 21:14:47 2021 +0300
Commit: Mike Kaganski 
CommitDate: Fri Oct 29 10:33:14 2021 +0200

Prepare for removal of non-const operator[] from Sequence in configmgr

Change-Id: Ia349292783b81f0b4eebe64ae672ea5cb6d6cd59
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124352
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index dc16b0211ade..95c5de4ed47a 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -856,10 +856,10 @@ css::uno::Sequence< css::uno::Any > 
Access::getPropertyValues(
 assert(thisIs(IS_GROUP));
 osl::MutexGuard g(*lock_);
 css::uno::Sequence< css::uno::Any > vals(aPropertyNames.getLength());
-
+auto aValsRange = asNonConstRange(vals);
 for (sal_Int32 i = 0; i < aPropertyNames.getLength(); ++i)
 {
-if (!getByNameFast(aPropertyNames[i], vals[i]))
+if (!getByNameFast(aPropertyNames[i], aValsRange[i]))
 throw css::uno::RuntimeException(
 "configmgr getPropertyValues inappropriate property name",
 static_cast< cppu::OWeakObject * >(this));
@@ -912,11 +912,12 @@ void Access::firePropertiesChangeEvent(
 assert(thisIs(IS_GROUP));
 css::uno::Sequence< css::beans::PropertyChangeEvent > events(
 aPropertyNames.getLength());
+auto aEventsRange = asNonConstRange(events);
 for (sal_Int32 i = 0; i < events.getLength(); ++i) {
-events[i].Source = static_cast< cppu::OWeakObject * >(this);
-events[i].PropertyName = aPropertyNames[i];
-events[i].Further = false;
-events[i].PropertyHandle = -1;
+aEventsRange[i].Source = static_cast< cppu::OWeakObject * >(this);
+aEventsRange[i].PropertyName = aPropertyNames[i];
+aEventsRange[i].Further = false;
+aEventsRange[i].PropertyHandle = -1;
 }
 xListener->propertiesChange(events);
 }
@@ -1013,6 +1014,7 @@ css::uno::Sequence< css::uno::Any > 
Access::getHierarchicalPropertyValues(
 osl::MutexGuard g(*lock_);
 css::uno::Sequence< css::uno::Any > vals(
 aHierarchicalPropertyNames.getLength());
+auto aValsRange = asNonConstRange(vals);
 for (sal_Int32 i = 0; i < aHierarchicalPropertyNames.getLength(); ++i) {
 rtl::Reference< ChildAccess > child(
 getSubChild(aHierarchicalPropertyNames[i]));
@@ -1022,7 +1024,7 @@ css::uno::Sequence< css::uno::Any > 
Access::getHierarchicalPropertyValues(
  " hierarchical property name"),
 static_cast< cppu::OWeakObject * >(this), -1);
 }
-vals[i] = child->asValue();
+aValsRange[i] = child->asValue();
 }
 return vals;
 }
diff --git a/configmgr/source/configurationregistry.cxx 
b/configmgr/source/configurationregistry.cxx
index c0e945ffc622..e4d86c46e9f2 100644
--- a/configmgr/source/configurationregistry.cxx
+++ b/configmgr/source/configurationregistry.cxx
@@ -246,8 +246,8 @@ void Service::open(OUString const & rURL, sal_Bool 
bReadOnly, sal_Bool)
 if (access_.is()) {
 doClose();
 }
-css::uno::Sequence< css::uno::Any > args(1);
-args[0] <<= css::beans::NamedValue("nodepath", css::uno::Any(rURL));
+css::uno::Sequence< css::uno::Any > args{ css::uno::Any(
+css::beans::NamedValue("nodepath", css::uno::Any(rURL))) };
 try {
 access_ = provider_->createInstanceWithArguments(
 (bReadOnly
diff --git a/configmgr/source/valueparser.cxx b/configmgr/source/valueparser.cxx
index 6245cb11b654..a70c3231b702 100644
--- a/configmgr/source/valueparser.cxx
+++ b/configmgr/source/valueparser.cxx
@@ -439,8 +439,9 @@ void ValueParser::start(
 
 template< typename T > css::uno::Any ValueParser::convertItems() {
 css::uno::Sequence< T > seq(items_.size());
+auto seqRange = asNonConstRange(seq);
 for (sal_Int32 i = 0; i < seq.getLength(); ++i) {
-bool ok = (items_[i] >>= seq[i]);
+bool ok = (items_[i] >>= seqRange[i]);
 assert(ok);
 (void) ok; // avoid warnings
 }


[Libreoffice-commits] core.git: configmgr/source

2021-10-15 Thread Stephan Bergmann (via logerrit)
 configmgr/source/winreg.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 27454bc5a64b5f310a53bf514ff709a5eca2320f
Author: Stephan Bergmann 
AuthorDate: Fri Oct 15 10:30:11 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Oct 15 14:08:53 2021 +0200

loplugin:stringview (clang-cl)

Change-Id: I367bc431bfd12041b2ccb6145c11f80b545aae19
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123647
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/configmgr/source/winreg.cxx b/configmgr/source/winreg.cxx
index e5a92d094435..381150fc2d5e 100644
--- a/configmgr/source/winreg.cxx
+++ b/configmgr/source/winreg.cxx
@@ -238,7 +238,7 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & 
aKeyName, TempFile 
 else
 {
 writeAttributeValue(
-aFileHandle, OUString("/" + aNextPathPart));
+aFileHandle, OUStringConcatenation("/" + 
aNextPathPart));
 }
 }
 else


[Libreoffice-commits] core.git: configmgr/source oox/source xmloff/source

2021-09-17 Thread Stephan Bergmann (via logerrit)
 configmgr/source/valueparser.cxx   |4 +++-
 oox/source/ppt/comments.cxx|5 -
 xmloff/source/draw/animationimport.cxx |8 ++--
 3 files changed, 13 insertions(+), 4 deletions(-)

New commits:
commit a6db8971bf37b696ae7b1d0f8fb4d11a1e541da1
Author: Stephan Bergmann 
AuthorDate: Fri Sep 17 07:42:32 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Sep 17 11:14:40 2021 +0200

Some more uses of rtl_math_(u)StringToDouble

...to avoid construction of temporary O(U)Strings, in anticipation of using
C++17 std::from_chars once that is available in all our baselines, similar 
to
99a1290b3f2c8584db0a33fe48adf93dccce3a92 "Use existing 
rtl_math_stringToDouble"

Change-Id: Ib92504341c3ae9dd599f91725b0af5b7219a201d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122219
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/configmgr/source/valueparser.cxx b/configmgr/source/valueparser.cxx
index 49ddba36fc27..6245cb11b654 100644
--- a/configmgr/source/valueparser.cxx
+++ b/configmgr/source/valueparser.cxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -128,7 +129,8 @@ bool parseValue(xmlreader::Span const & text, sal_Int64 * 
value) {
 
 bool parseValue(xmlreader::Span const & text, double * value) {
 assert(text.is() && value != nullptr);
-*value = OString(text.begin, text.length).toDouble();
+*value = rtl_math_stringToDouble(
+text.begin, text.begin + text.length, '.', 0, nullptr, nullptr);
 //TODO: check valid lexical representation
 return true;
 }
diff --git a/oox/source/ppt/comments.cxx b/oox/source/ppt/comments.cxx
index 78dc5295497f..8034a3978b45 100644
--- a/oox/source/ppt/comments.cxx
+++ b/oox/source/ppt/comments.cxx
@@ -9,6 +9,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 namespace oox::ppt
@@ -37,7 +38,9 @@ void Comment::setDateTime(const OUString& sDateTime)
 aDateTime.Day = sDateTime.getToken(0, 'T', nIdx).toUInt32();
 aDateTime.Hours = sDateTime.getToken(0, ':', nIdx).toUInt32();
 aDateTime.Minutes = sDateTime.getToken(0, ':', nIdx).toUInt32();
-double seconds = sDateTime.copy(nIdx).toDouble();
+double seconds = rtl_math_uStringToDouble(sDateTime.getStr() + nIdx,
+  sDateTime.getStr() + 
sDateTime.getLength(), '.', 0,
+  nullptr, nullptr);
 aDateTime.Seconds = floor(seconds);
 seconds -= aDateTime.Seconds;
 aDateTime.NanoSeconds = ::rtl::math::round(seconds * 10);
diff --git a/xmloff/source/draw/animationimport.cxx 
b/xmloff/source/draw/animationimport.cxx
index f39922967f48..1c8ff364bccd 100644
--- a/xmloff/source/draw/animationimport.cxx
+++ b/xmloff/source/draw/animationimport.cxx
@@ -50,6 +50,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -408,8 +409,11 @@ Sequence< TimeFilterPair > 
AnimationsImportHelperImpl::convertTimeFilter( const
 sal_Int32 nPos = aToken.indexOf( ',' );
 if( nPos >= 0 )
 {
-pValues->Time = aToken.copy( 0, nPos ).toDouble();
-pValues->Progress = aToken.copy( nPos+1 ).toDouble();
+pValues->Time = rtl_math_uStringToDouble(
+aToken.getStr(), aToken.getStr() + nPos, '.', 0, nullptr, 
nullptr);
+pValues->Progress = rtl_math_uStringToDouble(
+aToken.getStr() + nPos + 1, aToken.getStr() + 
aToken.getLength(), '.', 0,
+nullptr, nullptr);
 }
 pValues++;
 }


[Libreoffice-commits] core.git: configmgr/source

2021-08-14 Thread Eike Rathke (via logerrit)
 configmgr/source/access.cxx |   14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 6c4ff1d23ef61e708f3450d1b0ae77cc78cac731
Author: Eike Rathke 
AuthorDate: Sun Aug 15 01:44:54 2021 +0200
Commit: Eike Rathke 
CommitDate: Sun Aug 15 02:57:21 2021 +0200

Avoid computing LanguageTag fallbacks several hundred times

... over and over again even for known and present locales for
each and every localizable config item.

Change-Id: I19974c56169f45a7c53ed6b0eede47365e1365dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120496
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 02e3f557c684..28ef91000fb1 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -1385,8 +1385,14 @@ rtl::Reference< ChildAccess > Access::getChild(OUString 
const & name) {
 locale = comphelper::LibreOfficeKit::getLanguageTag().getBcp47();
 
 if (!locale.isEmpty()) {
-// Find the best match using the LanguageTag fallback mechanism
-std::vector aFallbacks = 
LanguageTag(locale).getFallbackStrings(true);
+// Try exact match first, avoiding all fallback overhead.
+rtl::Reference directChild(getChild(locale));
+if (directChild.is())
+return directChild;
+
+// Find the best match using the LanguageTag fallback mechanism,
+// excluding the original tag.
+std::vector aFallbacks = 
LanguageTag(locale).getFallbackStrings(false);
 for (const OUString& rFallback : aFallbacks)
 {
 rtl::Reference child(getChild(rFallback));
@@ -1398,8 +1404,8 @@ rtl::Reference< ChildAccess > Access::getChild(OUString 
const & name) {
 // xml:lang attributes, look for the first entry with the same 
first
 // segment as the requested language tag before falling back to
 // defaults (see fdo#33638):
-assert(aFallbacks.size() > 0);
-locale = aFallbacks[aFallbacks.size() - 1];
+if (aFallbacks.size() > 0)
+locale = aFallbacks[aFallbacks.size() - 1];
 assert(
 !locale.isEmpty() && locale.indexOf('-') == -1 &&
 locale.indexOf('_') == -1);


[Libreoffice-commits] core.git: configmgr/source

2021-08-11 Thread Noel Grandin (via logerrit)
 configmgr/source/childaccess.cxx |6 +++---
 configmgr/source/childaccess.hxx |3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit da40449dc5f1841ac3e6f6aa1194834a363455b6
Author: Noel Grandin 
AuthorDate: Tue Aug 10 20:01:50 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Aug 11 09:59:17 2021 +0200

no need to allocate changedValue_ separately

Change-Id: Ibda7c7a055790f6eb87ac6bd62554e745181cea7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120292
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx
index 41636b0e1bbe..ecaae9f522e5 100644
--- a/configmgr/source/childaccess.cxx
+++ b/configmgr/source/childaccess.cxx
@@ -236,14 +236,14 @@ void ChildAccess::setProperty(
 }
 checkValue(value, type, isNillable);
 getParentAccess()->markChildAsModified(this);
-changedValue_.reset(new css::uno::Any(value));
+changedValue_.emplace(value);
 localModifications->add(getRelativePath());
 }
 
 
 css::uno::Any ChildAccess::asValue()
 {
-if (changedValue_ != nullptr)
+if (changedValue_)
 {
 return *changedValue_;
 }
@@ -287,7 +287,7 @@ void ChildAccess::commitChanges(bool valid, Modifications * 
globalModifications)
 {
 assert(globalModifications != nullptr);
 commitChildChanges(valid, globalModifications);
-if (valid && changedValue_ != nullptr)
+if (valid && changedValue_)
 {
 std::vector path(getAbsolutePath());
 getComponents().addModification(path);
diff --git a/configmgr/source/childaccess.hxx b/configmgr/source/childaccess.hxx
index 2aecdf6757ea..2c0eabfcaa4e 100644
--- a/configmgr/source/childaccess.hxx
+++ b/configmgr/source/childaccess.hxx
@@ -22,6 +22,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 #include 
@@ -125,7 +126,7 @@ private:
 rtl::Reference< Access > parent_; // null if free node
 OUString name_;
 rtl::Reference< Node > node_;
-std::unique_ptr< css::uno::Any > changedValue_;
+std::optional< css::uno::Any > changedValue_;
 bool inTransaction_;
 // to determine if a free node can be inserted underneath some root
 std::shared_ptr lock_;


[Libreoffice-commits] core.git: configmgr/source

2021-07-22 Thread Noel Grandin (via logerrit)
 configmgr/source/access.cxx|   94 ++---
 configmgr/source/access.hxx|2 
 configmgr/source/childaccess.cxx   |   16 ++--
 configmgr/source/childaccess.hxx   |1 
 configmgr/source/components.cxx|   11 ++-
 configmgr/source/components.hxx|1 
 configmgr/source/configurationprovider.cxx |   15 ++--
 configmgr/source/defaultprovider.cxx   |2 
 configmgr/source/lock.cxx  |7 +-
 configmgr/source/lock.hxx  |3 
 configmgr/source/readonlyaccess.cxx|2 
 configmgr/source/readwriteaccess.cxx   |2 
 configmgr/source/rootaccess.cxx|   17 ++---
 configmgr/source/rootaccess.hxx|2 
 configmgr/source/update.cxx|   10 +--
 15 files changed, 103 insertions(+), 82 deletions(-)

New commits:
commit 55d47fd99c673ecb9830e9a60c55a3cc0d008b28
Author: Noel Grandin 
AuthorDate: Thu Jul 22 11:58:35 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Jul 22 21:17:15 2021 +0200

Revert "simplify locking in configmgr"

This reverts commit 7f7dad7018c874542e0ab6a0fb0f05f21d112b53.

And add some comments to the definition of the lock, to make
it purpose obvious.

Change-Id: Ib1a0b6345efab0febe9191341ce264c8d6070932
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119366
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index ec4b1f36e084..02e3f557c684 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -171,7 +171,7 @@ void Access::initBroadcaster(
 css::uno::Sequence< css::uno::Type > Access::getTypes()
 {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(configmgr::GetLock());
+osl::MutexGuard g(*lock_);
 checkLocalizedPropertyAccess();
 std::vector< css::uno::Type > types { cppu::UnoType< css::uno::XInterface 
>::get(),
   cppu::UnoType< css::uno::XWeak 
>::get(),
@@ -222,7 +222,7 @@ css::uno::Sequence< css::uno::Type > Access::getTypes()
 css::uno::Sequence< sal_Int8 > Access::getImplementationId()
 {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(configmgr::GetLock());
+osl::MutexGuard g(*lock_);
 checkLocalizedPropertyAccess();
 return css::uno::Sequence< sal_Int8 >();
 }
@@ -230,7 +230,7 @@ css::uno::Sequence< sal_Int8 > Access::getImplementationId()
 OUString Access::getImplementationName()
 {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(configmgr::GetLock());
+osl::MutexGuard g(*lock_);
 checkLocalizedPropertyAccess();
 return "org.openoffice-configmgr::Access";
 }
@@ -243,7 +243,7 @@ sal_Bool Access::supportsService(OUString const & 
ServiceName)
 css::uno::Sequence< OUString > Access::getSupportedServiceNames()
 {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(configmgr::GetLock());
+osl::MutexGuard g(*lock_);
 checkLocalizedPropertyAccess();
 std::vector services;
 services.emplace_back("com.sun.star.configuration.ConfigurationAccess");
@@ -274,7 +274,7 @@ void Access::dispose() {
 assert(thisIs(IS_ANY));
 Broadcaster bc;
 {
-osl::MutexGuard g(configmgr::GetLock());
+osl::MutexGuard g(*lock_);
 checkLocalizedPropertyAccess();
 if (getParentAccess().is()) {
 throw css::uno::RuntimeException(
@@ -296,7 +296,7 @@ void Access::addEventListener(
 {
 assert(thisIs(IS_ANY));
 {
-osl::MutexGuard g(configmgr::GetLock());
+osl::MutexGuard g(*lock_);
 checkLocalizedPropertyAccess();
 if (!xListener.is()) {
 throw css::uno::RuntimeException(
@@ -317,7 +317,7 @@ void Access::removeEventListener(
 css::uno::Reference< css::lang::XEventListener > const & aListener)
 {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(configmgr::GetLock());
+osl::MutexGuard g(*lock_);
 checkLocalizedPropertyAccess();
 DisposeListeners::iterator i(disposeListeners_.find(aListener));
 if (i != disposeListeners_.end()) {
@@ -327,7 +327,7 @@ void Access::removeEventListener(
 
 css::uno::Type Access::getElementType() {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(configmgr::GetLock());
+osl::MutexGuard g(*lock_);
 checkLocalizedPropertyAccess();
 rtl::Reference< Node > p(getNode());
 switch (p->kind()) {
@@ -350,7 +350,7 @@ css::uno::Type Access::getElementType() {
 
 sal_Bool Access::hasElements() {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(configmgr::GetLock());
+osl::MutexGuard g(*lock_);
 checkLocalizedPropertyAccess();
 return !getAllChildren().empty(); //TODO: optimize
 }
@@ -394,7 +394,7 @@ bool Access::getByNameFast(const OUString & name, 
css::uno::Any & value)
 css::uno::Any Access::getByName(OUString const & aName)
 {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(configmgr::GetLock());
+osl::MutexGuard 

[Libreoffice-commits] core.git: configmgr/source

2021-07-22 Thread Noel Grandin (via logerrit)
 configmgr/source/access.cxx|   94 ++---
 configmgr/source/access.hxx|2 
 configmgr/source/childaccess.cxx   |   16 ++--
 configmgr/source/childaccess.hxx   |1 
 configmgr/source/components.cxx|   11 +--
 configmgr/source/components.hxx|1 
 configmgr/source/configurationprovider.cxx |   15 +---
 configmgr/source/defaultprovider.cxx   |2 
 configmgr/source/lock.cxx  |4 -
 configmgr/source/lock.hxx  |3 
 configmgr/source/readonlyaccess.cxx|2 
 configmgr/source/readwriteaccess.cxx   |2 
 configmgr/source/rootaccess.cxx|   17 ++---
 configmgr/source/rootaccess.hxx|2 
 configmgr/source/update.cxx|   10 +--
 15 files changed, 82 insertions(+), 100 deletions(-)

New commits:
commit 7f7dad7018c874542e0ab6a0fb0f05f21d112b53
Author: Noel Grandin 
AuthorDate: Wed Jul 21 20:49:37 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Jul 22 11:40:54 2021 +0200

simplify locking in configmgr

if we are going to have a shared lock, just use the instance of the
shared lock instead of taking a shared_ptr to it.

Change-Id: I00f74815426fcf971ff8e12734fc4566aa6ad5f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119343
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 02e3f557c684..ec4b1f36e084 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -171,7 +171,7 @@ void Access::initBroadcaster(
 css::uno::Sequence< css::uno::Type > Access::getTypes()
 {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(*lock_);
+osl::MutexGuard g(configmgr::GetLock());
 checkLocalizedPropertyAccess();
 std::vector< css::uno::Type > types { cppu::UnoType< css::uno::XInterface 
>::get(),
   cppu::UnoType< css::uno::XWeak 
>::get(),
@@ -222,7 +222,7 @@ css::uno::Sequence< css::uno::Type > Access::getTypes()
 css::uno::Sequence< sal_Int8 > Access::getImplementationId()
 {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(*lock_);
+osl::MutexGuard g(configmgr::GetLock());
 checkLocalizedPropertyAccess();
 return css::uno::Sequence< sal_Int8 >();
 }
@@ -230,7 +230,7 @@ css::uno::Sequence< sal_Int8 > Access::getImplementationId()
 OUString Access::getImplementationName()
 {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(*lock_);
+osl::MutexGuard g(configmgr::GetLock());
 checkLocalizedPropertyAccess();
 return "org.openoffice-configmgr::Access";
 }
@@ -243,7 +243,7 @@ sal_Bool Access::supportsService(OUString const & 
ServiceName)
 css::uno::Sequence< OUString > Access::getSupportedServiceNames()
 {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(*lock_);
+osl::MutexGuard g(configmgr::GetLock());
 checkLocalizedPropertyAccess();
 std::vector services;
 services.emplace_back("com.sun.star.configuration.ConfigurationAccess");
@@ -274,7 +274,7 @@ void Access::dispose() {
 assert(thisIs(IS_ANY));
 Broadcaster bc;
 {
-osl::MutexGuard g(*lock_);
+osl::MutexGuard g(configmgr::GetLock());
 checkLocalizedPropertyAccess();
 if (getParentAccess().is()) {
 throw css::uno::RuntimeException(
@@ -296,7 +296,7 @@ void Access::addEventListener(
 {
 assert(thisIs(IS_ANY));
 {
-osl::MutexGuard g(*lock_);
+osl::MutexGuard g(configmgr::GetLock());
 checkLocalizedPropertyAccess();
 if (!xListener.is()) {
 throw css::uno::RuntimeException(
@@ -317,7 +317,7 @@ void Access::removeEventListener(
 css::uno::Reference< css::lang::XEventListener > const & aListener)
 {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(*lock_);
+osl::MutexGuard g(configmgr::GetLock());
 checkLocalizedPropertyAccess();
 DisposeListeners::iterator i(disposeListeners_.find(aListener));
 if (i != disposeListeners_.end()) {
@@ -327,7 +327,7 @@ void Access::removeEventListener(
 
 css::uno::Type Access::getElementType() {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(*lock_);
+osl::MutexGuard g(configmgr::GetLock());
 checkLocalizedPropertyAccess();
 rtl::Reference< Node > p(getNode());
 switch (p->kind()) {
@@ -350,7 +350,7 @@ css::uno::Type Access::getElementType() {
 
 sal_Bool Access::hasElements() {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(*lock_);
+osl::MutexGuard g(configmgr::GetLock());
 checkLocalizedPropertyAccess();
 return !getAllChildren().empty(); //TODO: optimize
 }
@@ -394,7 +394,7 @@ bool Access::getByNameFast(const OUString & name, 
css::uno::Any & value)
 css::uno::Any Access::getByName(OUString const & aName)
 {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(*lock_);
+osl::MutexGuard g(configmgr::GetLock());
 

[Libreoffice-commits] core.git: configmgr/source

2021-05-14 Thread Julien Nabet (via logerrit)
 configmgr/source/access.cxx |   26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 141f3e101508e7d0a83bd34a5cf48673fe91e44c
Author: Julien Nabet 
AuthorDate: Fri May 14 11:08:45 2021 +0200
Commit: Julien Nabet 
CommitDate: Fri May 14 23:13:59 2021 +0200

Directly partly initialize vector in access.cxx

Change-Id: Iac19920caf0a9bdfa07b025c19c7659b96374c7e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115590
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index fa2aa1fe6eb0..02e3f557c684 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -173,19 +173,19 @@ css::uno::Sequence< css::uno::Type > Access::getTypes()
 assert(thisIs(IS_ANY));
 osl::MutexGuard g(*lock_);
 checkLocalizedPropertyAccess();
-std::vector< css::uno::Type > types;
-types.push_back(cppu::UnoType< css::uno::XInterface >::get());
-types.push_back(cppu::UnoType< css::uno::XWeak >::get());
-types.push_back(cppu::UnoType< css::lang::XTypeProvider >::get());
-types.push_back(cppu::UnoType< css::lang::XServiceInfo >::get());
-types.push_back(cppu::UnoType< css::lang::XComponent >::get());
-types.push_back(cppu::UnoType< css::container::XContainer >::get());
-types.push_back(cppu::UnoType< css::beans::XExactName >::get());
-types.push_back(cppu::UnoType< css::container::XHierarchicalName >::get());
-types.push_back(cppu::UnoType< css::container::XNamed >::get());
-types.push_back(cppu::UnoType< css::beans::XProperty >::get());
-types.push_back(cppu::UnoType< css::container::XElementAccess >::get());
-types.push_back(cppu::UnoType< css::container::XNameAccess >::get());
+std::vector< css::uno::Type > types { cppu::UnoType< css::uno::XInterface 
>::get(),
+  cppu::UnoType< css::uno::XWeak 
>::get(),
+  cppu::UnoType< 
css::lang::XTypeProvider >::get(),
+  cppu::UnoType< 
css::lang::XServiceInfo >::get(),
+  cppu::UnoType< css::lang::XComponent 
>::get(),
+  cppu::UnoType< 
css::container::XContainer >::get(),
+  cppu::UnoType< 
css::beans::XExactName >::get(),
+  cppu::UnoType< 
css::container::XHierarchicalName >::get(),
+  cppu::UnoType< 
css::container::XNamed >::get(),
+  cppu::UnoType< css::beans::XProperty 
>::get(),
+  cppu::UnoType< 
css::container::XElementAccess >::get(),
+  cppu::UnoType< 
css::container::XNameAccess >::get()
+};
 if (getNode()->kind() == Node::KIND_GROUP) {
 types.push_back(cppu::UnoType< css::beans::XPropertySetInfo >::get());
 types.push_back(cppu::UnoType< css::beans::XPropertySet >::get());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2021-03-09 Thread Stephan Bergmann (via logerrit)
 configmgr/source/dconf.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 4cf54b8616fb6be26f02bd06c0158c3e69fde0db
Author: Stephan Bergmann 
AuthorDate: Tue Mar 9 16:40:56 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Mar 9 22:21:06 2021 +0100

Mark workaround as fixed upstream

Change-Id: I808f0b26916eece2d4fae3c7d1e73c847905adf8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112208
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/configmgr/source/dconf.cxx b/configmgr/source/dconf.cxx
index 75c0bb360ce3..1c0711ff1927 100644
--- a/configmgr/source/dconf.cxx
+++ b/configmgr/source/dconf.cxx
@@ -17,8 +17,11 @@
 #include 
 
 extern "C" {
-// 
-// "common/dconf-changeset.h etc. lack extern "C" wrapper for C++"
+//TODO: 
+// "common/dconf-changeset.h etc. lack extern "C" wrapper for C++", fixed 
on current dconf
+// master (towards 0.40?) now with
+// 

+// "Merge branch 'wip/issue-23' into 'master'"
 #include 
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2021-02-17 Thread Noel (via logerrit)
 configmgr/source/access.cxx |8 
 configmgr/source/rootaccess.cxx |2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 779e20ec8deadc80f244f2b76d086638c273c7ab
Author: Noel 
AuthorDate: Wed Feb 17 08:47:55 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Feb 17 09:13:20 2021 +0100

loplugin:referencecasting in configmgr

Change-Id: Ib74468d3a6a40b32896c58b0d30e3121ee834e1c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111027
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 619629f95c79..86e09cbae35f 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -1230,7 +1230,7 @@ void Access::initDisposeBroadcaster(Broadcaster * 
broadcaster) {
 for (auto const& containerListener : containerListeners_)
 {
 broadcaster->addDisposeNotification(
-containerListener.get(),
+containerListener,
 css::lang::EventObject(static_cast< cppu::OWeakObject * >(this)));
 }
 for (auto const& propertyChangeListener : propertyChangeListeners_)
@@ -1238,7 +1238,7 @@ void Access::initDisposeBroadcaster(Broadcaster * 
broadcaster) {
 for (auto const& propertyChangeListenerElement : 
propertyChangeListener.second)
 {
 broadcaster->addDisposeNotification(
-propertyChangeListenerElement.get(),
+propertyChangeListenerElement,
 css::lang::EventObject(
 static_cast< cppu::OWeakObject * >(this)));
 }
@@ -1248,7 +1248,7 @@ void Access::initDisposeBroadcaster(Broadcaster * 
broadcaster) {
 for (auto const& vetoableChangeListenerElement : 
vetoableChangeListener.second)
 {
 broadcaster->addDisposeNotification(
-vetoableChangeListenerElement.get(),
+vetoableChangeListenerElement,
 css::lang::EventObject(
 static_cast< cppu::OWeakObject * >(this)));
 }
@@ -1256,7 +1256,7 @@ void Access::initDisposeBroadcaster(Broadcaster * 
broadcaster) {
 for (auto const& propertiesChangeListener : propertiesChangeListeners_)
 {
 broadcaster->addDisposeNotification(
-propertiesChangeListener.get(),
+propertiesChangeListener,
 css::lang::EventObject(static_cast< cppu::OWeakObject * >(this)));
 }
 //TODO: iterate over children w/ listeners (incl. unmodified ones):
diff --git a/configmgr/source/rootaccess.cxx b/configmgr/source/rootaccess.cxx
index a3804fa47d4d..985560d02177 100644
--- a/configmgr/source/rootaccess.cxx
+++ b/configmgr/source/rootaccess.cxx
@@ -267,7 +267,7 @@ void RootAccess::initDisposeBroadcaster(Broadcaster * 
broadcaster) {
 for (auto const& changesListener : changesListeners_)
 {
 broadcaster->addDisposeNotification(
-changesListener.get(),
+changesListener,
 css::lang::EventObject(static_cast< cppu::OWeakObject * >(this)));
 }
 Access::initDisposeBroadcaster(broadcaster);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source fpicker/source jvmfwk/plugins sc/qa xmlsecurity/source

2020-11-25 Thread Stephan Bergmann (via logerrit)
 configmgr/source/winreg.cxx   |2 +-
 fpicker/source/win32/VistaFilePickerImpl.cxx  |2 +-
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx   |4 ++--
 sc/qa/unit/subsequent_export-test.cxx |3 ++-
 xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx |3 ++-
 5 files changed, 8 insertions(+), 6 deletions(-)

New commits:
commit e8227dc4af54c39e871b12f2e846fa54cff11581
Author: Stephan Bergmann 
AuthorDate: Wed Nov 25 09:41:33 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Nov 25 10:53:32 2020 +0100

loplugin:stringview (clang-cl)

Change-Id: I47b44c80b2a5e3c9d84f5d7257efe17f138a1067
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106563
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/configmgr/source/winreg.cxx b/configmgr/source/winreg.cxx
index 6e4690500996..e5a92d094435 100644
--- a/configmgr/source/winreg.cxx
+++ b/configmgr/source/winreg.cxx
@@ -226,7 +226,7 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & 
aKeyName, TempFile 
 if(nCommandSeparator != -1)
 {
 OUString aNodeOp = 
aNextPathPart.copy(nCommandSeparator + 1);
-writeAttributeValue(aFileHandle, 
aNextPathPart.copy(0, nCommandSeparator - 1));
+writeAttributeValue(aFileHandle, 
aNextPathPart.subView(0, nCommandSeparator - 1));
 aFileHandle.writeString("\" oor:op=\"");
 writeAttributeValue(aFileHandle, aNodeOp);
 }
diff --git a/fpicker/source/win32/VistaFilePickerImpl.cxx 
b/fpicker/source/win32/VistaFilePickerImpl.cxx
index d6e10115ac82..7d3b4d014450 100644
--- a/fpicker/source/win32/VistaFilePickerImpl.cxx
+++ b/fpicker/source/win32/VistaFilePickerImpl.cxx
@@ -996,7 +996,7 @@ void VistaFilePickerImpl::impl_sta_ShowDialogModal(const 
RequestRef& rRequest)
 {
 const sal_Int32 idx = sFilter.indexOf('.');
 if (idx >= 0)
-aFileURL += sFilter.copy(idx);
+aFileURL += sFilter.subView(idx);
 }
 }
 }
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index f47b0a3ee4fd..94affa946402 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -482,7 +482,7 @@ static void load_msvcr(OUString const & jvm_dll, 
std::u16string_view msvcr)
 }
 
 if (LoadLibraryW(
-o3tl::toW(OUString(jvm_dll.copy(0, slash+1) + msvcr).getStr(
+o3tl::toW(OUString(OUString::Concat(jvm_dll.subView(0, slash+1)) + 
msvcr).getStr(
 return;
 
 // Then check if msvcr71.dll is in the parent folder of where
@@ -494,7 +494,7 @@ static void load_msvcr(OUString const & jvm_dll, 
std::u16string_view msvcr)
 return;
 
 (void)LoadLibraryW(
-o3tl::toW(OUString(jvm_dll.copy(0, slash+1) + msvcr).getStr()));
+o3tl::toW(OUString(OUString::Concat(jvm_dll.subView(0, slash+1)) + 
msvcr).getStr()));
 }
 
 // Check if the jvm DLL imports msvcr71.dll, and in that case try
diff --git a/sc/qa/unit/subsequent_export-test.cxx 
b/sc/qa/unit/subsequent_export-test.cxx
index 36d85d8f2343..02b51df285d5 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -3520,7 +3520,8 @@ void ScExportTest::testSupBookVirtualPathXLS()
 
 OUString aFormula = toString(rDoc, aPos, *pCode, rDoc.GetGrammar());
 #ifdef _WIN32
-aFormula = aFormula.copy(0, 9) + aFormula.copy(12); // strip drive letter, 
e.g. 'C:/'
+aFormula = OUString::Concat(aFormula.subView(0, 9)) + aFormula.subView(12);
+// strip drive letter, e.g. 'C:/'
 #endif
 OUString aExpectedFormula = 
"'file:///home/timar/Documents/external.xls'#$Sheet1.A1";
 if (aFormula != aExpectedFormula)
diff --git a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx 
b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
index 0e619b2802f8..de00d18a1930 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
@@ -164,7 +164,8 @@ static OUString replaceTagSWithTagST(OUString const & oldDN)
 
 if (pairIndex.first != -1)
 {
-return oldDN.copy(0, 
pairIndex.first)+"ST"+oldDN.copy(pairIndex.second);
+return OUString::Concat(oldDN.subView(0, pairIndex.first))+"ST"
++oldDN.subView(pairIndex.second);
 }
 return oldDN;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

[Libreoffice-commits] core.git: configmgr/source

2020-11-22 Thread Stephan Bergmann (via logerrit)
 configmgr/source/localizedpropertynode.hxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 9d26fbe23501929f69eca6772a57c1db7b58eded
Author: Stephan Bergmann 
AuthorDate: Sun Nov 22 15:49:05 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Sun Nov 22 22:19:07 2020 +0100

Make it clear again what the comment appertains to

...after 315f270d2db7541e9400852b070afb30f371f644 "tdf#123936 Formatting 
files
in module configmgr with clang-format"

Change-Id: I75f30acc3db166404e5de58ef65d3de34f5e7061
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106356
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/configmgr/source/localizedpropertynode.hxx 
b/configmgr/source/localizedpropertynode.hxx
index c54a6c521231..d4831a89fd67 100644
--- a/configmgr/source/localizedpropertynode.hxx
+++ b/configmgr/source/localizedpropertynode.hxx
@@ -49,9 +49,8 @@ private:
 
 virtual Kind kind() const override;
 
-Type staticType_;
-// as specified in the component-schema (TYPE_ANY, ...,
-// TYPE_HEXBINARY_LIST; not TYPE_ERROR or TYPE_NIL)
+Type staticType_; // as specified in the component-schema (TYPE_ANY, ..., 
TYPE_HEXBINARY_LIST;
+// not TYPE_ERROR or TYPE_NIL)
 bool nillable_;
 NodeMap members_;
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2020-11-22 Thread gozeloglu (via logerrit)
 configmgr/source/defaultprovider.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5ed43ebfbb9406040a2d8eb7869b051f3e99293a
Author: gozeloglu 
AuthorDate: Sun Nov 22 10:07:28 2020 +
Commit: Julien Nabet 
CommitDate: Sun Nov 22 11:53:51 2020 +0100

tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor

Change-Id: I39c4cd2474814e6033795e0dc3fcc7c18812d854
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106342
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/configmgr/source/defaultprovider.cxx 
b/configmgr/source/defaultprovider.cxx
index 59f02af38107..7161659e0fa6 100644
--- a/configmgr/source/defaultprovider.cxx
+++ b/configmgr/source/defaultprovider.cxx
@@ -46,7 +46,7 @@ OUString getImplementationName() { return 
"com.sun.star.comp.configuration.Defau
 
 css::uno::Sequence getSupportedServiceNames()
 {
-return css::uno::Sequence{ 
"com.sun.star.configuration.DefaultProvider" };
+return { "com.sun.star.configuration.DefaultProvider" };
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2020-10-02 Thread Stephan Bergmann (via logerrit)
 configmgr/source/configmgr.component |3 ++-
 configmgr/source/defaultprovider.cxx |2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit b4ddb579eeafbcf0fd7edd346401b31d00c0aa7b
Author: Stephan Bergmann 
AuthorDate: Fri Oct 2 08:10:46 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Oct 2 09:09:00 2020 +0200

Use the new single-instance="true" attribute in configmgr

Change-Id: Ib5873aedd5c49dd2f8c099190e78de9b85fcd53a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103787
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/configmgr/source/configmgr.component 
b/configmgr/source/configmgr.component
index c8b0c4f01260..ff46b6070393 100644
--- a/configmgr/source/configmgr.component
+++ b/configmgr/source/configmgr.component
@@ -28,7 +28,8 @@
 
   
   
+
constructor="com_sun_star_comp_configuration_DefaultProvider_get_implementation"
+single-instance="true">
 
 
   
diff --git a/configmgr/source/defaultprovider.cxx 
b/configmgr/source/defaultprovider.cxx
index 4cc7a24d0c93..131f548a039e 100644
--- a/configmgr/source/defaultprovider.cxx
+++ b/configmgr/source/defaultprovider.cxx
@@ -34,7 +34,7 @@ 
com_sun_star_comp_configuration_DefaultProvider_get_implementation(
 css::uno::XComponentContext* context, css::uno::Sequence 
const&)
 {
 osl::MutexGuard guard(*configmgr::lock());
-static css::uno::Reference< css::uno::XInterface > singleton(
+css::uno::Reference< css::uno::XInterface > singleton(
 configmgr::configuration_provider::createDefault(context));
 singleton->acquire();
 return singleton.get();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2020-09-24 Thread Andrea Gelmini (via logerrit)
 configmgr/source/components.hxx |2 +-
 configmgr/source/data.hxx   |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 02a78dee11f61490ede6e3e16202dc7987bede93
Author: Andrea Gelmini 
AuthorDate: Wed Sep 23 15:23:57 2020 +0200
Commit: Julien Nabet 
CommitDate: Thu Sep 24 18:33:44 2020 +0200

Fix typo in code

It passed "make check" on Linux

Change-Id: I810841b0bf0d59a13893d9b88f19673a8191741e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103255
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx
index 5062ab36a15d..9ede2ed381f2 100644
--- a/configmgr/source/components.hxx
+++ b/configmgr/source/components.hxx
@@ -56,7 +56,7 @@ public:
 
 rtl::Reference< Node > resolvePathRepresentation(
 OUString const & pathRepresentation,
-OUString * canonicRepresenation, std::vector * path, int * 
finalizedLayer)
+OUString * canonicRepresentation, std::vector * path, int * 
finalizedLayer)
 const;
 
 rtl::Reference< Node > getTemplate( OUString const & fullName) const;
diff --git a/configmgr/source/data.hxx b/configmgr/source/data.hxx
index fbb96b391eb8..58763cd0d58c 100644
--- a/configmgr/source/data.hxx
+++ b/configmgr/source/data.hxx
@@ -68,7 +68,7 @@ struct Data {
 
 rtl::Reference< Node > resolvePathRepresentation(
 OUString const & pathRepresentation,
-OUString * canonicRepresenation, std::vector * path, int * 
finalizedLayer)
+OUString * canonicRepresentation, std::vector * path, int * 
finalizedLayer)
 const;
 
 rtl::Reference< Node > getTemplate(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2020-09-04 Thread George Bateman (via logerrit)
 configmgr/source/access.hxx|5 +
 configmgr/source/additions.hxx |5 +
 configmgr/source/broadcaster.hxx   |5 +
 configmgr/source/childaccess.hxx   |5 +
 configmgr/source/components.hxx|5 +
 configmgr/source/configurationprovider.hxx |5 +
 configmgr/source/data.hxx  |5 +
 configmgr/source/dconf.hxx |5 +
 configmgr/source/defaultprovider.hxx   |5 +
 configmgr/source/groupnode.hxx |5 +
 configmgr/source/localizedpropertynode.hxx |5 +
 configmgr/source/localizedvaluenode.hxx|5 +
 configmgr/source/lock.hxx  |5 +
 configmgr/source/modifications.hxx |5 +
 configmgr/source/node.hxx  |5 +
 configmgr/source/nodemap.hxx   |5 +
 configmgr/source/parsemanager.hxx  |5 +
 configmgr/source/parser.hxx|5 +
 configmgr/source/partial.hxx   |5 +
 configmgr/source/propertynode.hxx  |5 +
 configmgr/source/rootaccess.hxx|5 +
 configmgr/source/rootnode.hxx  |5 +
 configmgr/source/setnode.hxx   |5 +
 configmgr/source/type.hxx  |5 +
 configmgr/source/valueparser.hxx   |5 +
 configmgr/source/writemodfile.hxx  |5 +
 configmgr/source/xcdparser.hxx |5 +
 configmgr/source/xcsparser.hxx |5 +
 configmgr/source/xcuparser.hxx |5 +
 configmgr/source/xmldata.hxx   |5 +
 30 files changed, 30 insertions(+), 120 deletions(-)

New commits:
commit 6efb746a8cf876ef00d97aa8bd8f2f4ef9cabcfd
Author: George Bateman 
AuthorDate: Thu Aug 6 14:36:13 2020 +
Commit: Julien Nabet 
CommitDate: Fri Sep 4 09:01:02 2020 +0200

tdf#124176 Use #pragma once in configmgr

This commit was carried out by a Python script, source of which
is at https://bugs.documentfoundation.org/show_bug.cgi?id=124176#c97.

Change-Id: Ide38653f1828752b90d7e312471c9facb99646a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100252
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/configmgr/source/access.hxx b/configmgr/source/access.hxx
index 910df97a50bc..a6c0be563f85 100644
--- a/configmgr/source/access.hxx
+++ b/configmgr/source/access.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_CONFIGMGR_SOURCE_ACCESS_HXX
-#define INCLUDED_CONFIGMGR_SOURCE_ACCESS_HXX
+#pragma once
 
 #include 
 
@@ -448,6 +447,4 @@ protected:
 
 }
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/configmgr/source/additions.hxx b/configmgr/source/additions.hxx
index 9a82252b9ffc..6dedf1b5303e 100644
--- a/configmgr/source/additions.hxx
+++ b/configmgr/source/additions.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_CONFIGMGR_SOURCE_ADDITIONS_HXX
-#define INCLUDED_CONFIGMGR_SOURCE_ADDITIONS_HXX
+#pragma once
 
 #include 
 
@@ -32,6 +31,4 @@ typedef std::vector< std::vector > Additions;
 
 }
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/configmgr/source/broadcaster.hxx b/configmgr/source/broadcaster.hxx
index 40778979ac1a..6c4943f5526e 100644
--- a/configmgr/source/broadcaster.hxx
+++ b/configmgr/source/broadcaster.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_CONFIGMGR_SOURCE_BROADCASTER_HXX
-#define INCLUDED_CONFIGMGR_SOURCE_BROADCASTER_HXX
+#pragma once
 
 #include 
 
@@ -137,6 +136,4 @@ private:
 
 }
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/configmgr/source/childaccess.hxx b/configmgr/source/childaccess.hxx
index bbf4e25e7755..3742dff3f969 100644
--- a/configmgr/source/childaccess.hxx
+++ b/configmgr/source/childaccess.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_CONFIGMGR_SOURCE_CHILDACCESS_HXX
-#define INCLUDED_CONFIGMGR_SOURCE_CHILDACCESS_HXX
+#pragma once
 
 #include 
 
@@ -134,6 +133,4 @@ private:
 
 }
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx
index 014c5c7f6b62..5062ab36a15d 100644
--- a/configmgr/source/components.hxx
+++ b/configmgr/source/components.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_CONFIGMGR_SOURCE_COMPONENTS_HXX
-#define INCLUDED_CONFIGMGR_SOURCE_COMPONENTS_HXX
+#pragma once
 
 #include 
 
@@ -163,6 +162,4 @@ private:
 
 }
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/configmgr/source/configurationprovider.hxx 

[Libreoffice-commits] core.git: configmgr/source connectivity/source cui/source dbaccess/source filter/source idlc/inc linguistic/source sc/source sd/source

2020-08-17 Thread Noel Grandin (via logerrit)
 configmgr/source/broadcaster.hxx |   26 ---
 connectivity/source/drivers/postgresql/pq_connection.cxx |7 +---
 connectivity/source/inc/hsqldb/HConnection.hxx   |5 --
 cui/source/inc/macropg.hxx   |3 -
 dbaccess/source/filter/hsqldb/hsqlbinarynode.cxx |2 -
 dbaccess/source/filter/hsqldb/parseschema.cxx|2 -
 dbaccess/source/ui/dlg/advancedsettings.hxx  |3 -
 filter/source/svg/svgwriter.hxx  |5 --
 idlc/inc/astinterface.hxx|4 --
 linguistic/source/convdic.hxx|3 -
 linguistic/source/convdicxml.cxx |2 -
 sc/source/core/data/dpsave.cxx   |3 -
 sc/source/filter/inc/xicontent.hxx   |3 -
 sc/source/ui/inc/retypepassdlg.hxx   |7 +---
 sd/source/ui/annotations/annotationmanagerimpl.hxx   |3 -
 15 files changed, 20 insertions(+), 58 deletions(-)

New commits:
commit dd6db74abddfe27671c2593eefefa871466b02f5
Author: Noel Grandin 
AuthorDate: Mon Aug 17 09:26:16 2020 +0200
Commit: Noel Grandin 
CommitDate: Mon Aug 17 14:11:12 2020 +0200

inline some use-once typedefs

Change-Id: I683175c1e788a2a4cfec9504dc8dc3ebfee7c5de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100858
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/broadcaster.hxx b/configmgr/source/broadcaster.hxx
index bdb39adfbcbf..40778979ac1a 100644
--- a/configmgr/source/broadcaster.hxx
+++ b/configmgr/source/broadcaster.hxx
@@ -126,25 +126,13 @@ private:
 css::util::ChangesEvent const & theEvent);
 };
 
-typedef std::vector< DisposeNotification > DisposeNotifications;
-
-typedef std::vector< ContainerNotification > ContainerNotifications;
-
-typedef std::vector< PropertyChangeNotification >
-PropertyChangeNotifications;
-
-typedef std::vector< PropertiesChangeNotification >
-PropertiesChangeNotifications;
-
-typedef std::vector< ChangesNotification > ChangesNotifications;
-
-DisposeNotifications disposeNotifications_;
-ContainerNotifications containerElementInsertedNotifications_;
-ContainerNotifications containerElementRemovedNotifications_;
-ContainerNotifications containerElementReplacedNotifications_;
-PropertyChangeNotifications propertyChangeNotifications_;
-PropertiesChangeNotifications propertiesChangeNotifications_;
-ChangesNotifications changesNotifications_;
+std::vector< DisposeNotification > disposeNotifications_;
+std::vector< ContainerNotification > 
containerElementInsertedNotifications_;
+std::vector< ContainerNotification > containerElementRemovedNotifications_;
+std::vector< ContainerNotification > 
containerElementReplacedNotifications_;
+std::vector< PropertyChangeNotification > propertyChangeNotifications_;
+std::vector< PropertiesChangeNotification > propertiesChangeNotifications_;
+std::vector< ChangesNotification > changesNotifications_;
 };
 
 }
diff --git a/connectivity/source/drivers/postgresql/pq_connection.cxx 
b/connectivity/source/drivers/postgresql/pq_connection.cxx
index b0521d0a83a7..43ce0bc6ba2b 100644
--- a/connectivity/source/drivers/postgresql/pq_connection.cxx
+++ b/connectivity/source/drivers/postgresql/pq_connection.cxx
@@ -133,14 +133,11 @@ Connection::~Connection()
 m_settings.pConnection = nullptr;
 }
 }
-typedef std::vector< css::uno::Reference< css::sdbc::XCloseable > > 
CloseableVector;
-
-typedef std::vector< css::uno::Reference< css::lang::XComponent > > 
DisposeableVector;
 
 void Connection::close()
 {
-CloseableVector vectorCloseable;
-DisposeableVector vectorDispose;
+std::vector< css::uno::Reference< css::sdbc::XCloseable > > 
vectorCloseable;
+std::vector< css::uno::Reference< css::lang::XComponent > > vectorDispose;
 {
 MutexGuard guard( m_xMutex->GetMutex() );
 // silently ignore, if the connection has been closed already
diff --git a/connectivity/source/inc/hsqldb/HConnection.hxx 
b/connectivity/source/inc/hsqldb/HConnection.hxx
index 93efe9dfb9d2..78bcfe26eaf1 100644
--- a/connectivity/source/inc/hsqldb/HConnection.hxx
+++ b/connectivity/source/inc/hsqldb/HConnection.hxx
@@ -130,12 +130,9 @@ namespace connectivity::hsqldb
 
 class MethodGuard : public ::osl::MutexGuard
 {
-private:
-typedef ::osl::MutexGuard   BaseGuard;
-
 public:
 MethodGuard( const IMethodGuardAccess& _rComponent )
-:BaseGuard( _rComponent.getMutex() )
+: ::osl::MutexGuard( _rComponent.getMutex() )
 {
 _rComponent.checkDisposed();
 }
diff --git a/cui/source/inc/macropg.hxx b/cui/source/inc/macropg.hxx
index 5017aeeabfe8..26ea92f65ad5 100644
--- 

[Libreoffice-commits] core.git: configmgr/source cppu/source desktop/source editeng/source i18nutil/source

2020-08-03 Thread Noel Grandin (via logerrit)
 configmgr/source/components.cxx |  132 ++--
 configmgr/source/rootaccess.cxx |   23 ++--
 configmgr/source/writemodfile.cxx   |   25 ++---
 configmgr/source/xcsparser.cxx  |   84 -
 cppu/source/typelib/typelib.cxx |   90 +--
 desktop/source/lib/init.cxx |  128 +--
 editeng/source/editeng/impedit2.cxx |   20 ++--
 i18nutil/source/utility/oneToOneMapping.cxx |   34 +++
 8 files changed, 270 insertions(+), 266 deletions(-)

New commits:
commit e54777276d28e6bbceefa07e260926c81790938c
Author: Noel Grandin 
AuthorDate: Mon Aug 3 08:41:49 2020 +0200
Commit: Noel Grandin 
CommitDate: Mon Aug 3 11:12:07 2020 +0200

loplugin:flatten in configmgr..i18nutil

Change-Id: Idaeed33df4f1dd1b2acbdaf8a895c5d56c3ca14c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99980
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index 7f629bc8afbe..f7bd5ba34e3a 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -271,23 +271,24 @@ void Components::addModification(std::vector 
const & path) {
 
 void Components::writeModifications() {
 
-if (!data_.modifications.empty()) {
-switch (modificationTarget_) {
-case ModificationTarget::None:
-break;
-case ModificationTarget::File:
-if (!writeThread_.is()) {
-writeThread_ = new WriteThread(
-_, *this, modificationFileUrl_, data_);
-writeThread_->launch();
-}
-break;
-case ModificationTarget::Dconf:
+if (data_.modifications.empty())
+return;
+
+switch (modificationTarget_) {
+case ModificationTarget::None:
+break;
+case ModificationTarget::File:
+if (!writeThread_.is()) {
+writeThread_ = new WriteThread(
+_, *this, modificationFileUrl_, data_);
+writeThread_->launch();
+}
+break;
+case ModificationTarget::Dconf:
 #if ENABLE_DCONF
-dconf::writeModifications(*this, data_);
+dconf::writeModifications(*this, data_);
 #endif
-break;
-}
+break;
 }
 }
 
@@ -349,38 +350,39 @@ void Components::removeExtensionXcuFile(
 assert(modifications != nullptr);
 rtl::Reference< Data::ExtensionXcu > item(
 data_.removeExtensionXcuAdditions(fileUri));
-if (item.is()) {
-for (Additions::reverse_iterator i(item->additions.rbegin());
- i != item->additions.rend(); ++i)
+if (!item.is())
+return;
+
+for (Additions::reverse_iterator i(item->additions.rbegin());
+ i != item->additions.rend(); ++i)
+{
+rtl::Reference< Node > parent;
+NodeMap const * map = _.getComponents();
+rtl::Reference< Node > node;
+for (auto const& j : *i)
 {
-rtl::Reference< Node > parent;
-NodeMap const * map = _.getComponents();
-rtl::Reference< Node > node;
-for (auto const& j : *i)
-{
-parent = node;
-node = map->findNode(Data::NO_LAYER, j);
-if (!node.is()) {
-break;
-}
-map = >getMembers();
+parent = node;
+node = map->findNode(Data::NO_LAYER, j);
+if (!node.is()) {
+break;
 }
-if (node.is()) {
-assert(parent.is());
-if (parent->kind() == Node::KIND_SET) {
-assert(
-node->kind() == Node::KIND_GROUP ||
-node->kind() == Node::KIND_SET);
-if (canRemoveFromLayer(item->layer, node)) {
-parent->getMembers().erase(i->back());
-data_.modifications.remove(*i);
-modifications->add(*i);
-}
+map = >getMembers();
+}
+if (node.is()) {
+assert(parent.is());
+if (parent->kind() == Node::KIND_SET) {
+assert(
+node->kind() == Node::KIND_GROUP ||
+node->kind() == Node::KIND_SET);
+if (canRemoveFromLayer(item->layer, node)) {
+parent->getMembers().erase(i->back());
+data_.modifications.remove(*i);
+modifications->add(*i);
 }
 }
 }
-writeModifications();
 }
+writeModifications();
 }
 
 void Components::insertModificationXcuFile(
@@ -825,32 +827,32 @@ void Components::parseXcsXcuIniLayer(
 // Check if ini file exists (otherwise .override would still read global
 // SCHEMA/DATA variables, 

[Libreoffice-commits] core.git: configmgr/source

2020-07-23 Thread Jan Holesovsky (via logerrit)
 configmgr/source/access.cxx |   24 ++--
 1 file changed, 10 insertions(+), 14 deletions(-)

New commits:
commit dfc28be2487c13be36a90efd778b8d8f179c589d
Author: Jan Holesovsky 
AuthorDate: Thu Jul 23 00:42:42 2020 +0200
Commit: Andras Timar 
CommitDate: Thu Jul 23 10:40:27 2020 +0200

configmgr: Use a proper LanguageTag-based locale fallback mechanism.

Without this, zh-Hant-TW locale used via the LibreOfficeKit was reduced
to zh-Hant and further to zh, which was interpreted as zh-CN, causing
incorrect strings particularly in the sidebar.

Change-Id: I58e53f71d13824e422a7b3634f3822d55090f8ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99203
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index e07fc8446f51..0308a0361761 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -1385,29 +1385,25 @@ rtl::Reference< ChildAccess > Access::getChild(OUString 
const & name) {
 locale = comphelper::LibreOfficeKit::getLanguageTag().getBcp47();
 
 if (!locale.isEmpty()) {
-// Find best match using an adaptation of RFC 4647 lookup matching
-// rules, removing "-" or "_" delimited segments from the end:
-for (;;) {
-rtl::Reference< ChildAccess > child(getChild(locale));
-if (child.is()) {
+// Find the best match using the LanguageTag fallback mechanism
+std::vector aFallbacks = 
LanguageTag(locale).getFallbackStrings(true);
+for (const OUString& rFallback : aFallbacks)
+{
+rtl::Reference child(getChild(rFallback));
+if (child.is())
 return child;
-}
-sal_Int32 i = locale.getLength() - 1;
-while (i > 0 && locale[i] != '-' && locale[i] != '_') {
---i;
-}
-if (i <= 0) {
-break;
-}
-locale = locale.copy(0, i);
 }
+
 // As a workaround for broken xcu data that does not use shortest
 // xml:lang attributes, look for the first entry with the same 
first
 // segment as the requested language tag before falling back to
 // defaults (see fdo#33638):
+assert(aFallbacks.size() > 0);
+locale = aFallbacks[aFallbacks.size() - 1];
 assert(
 !locale.isEmpty() && locale.indexOf('-') == -1 &&
 locale.indexOf('_') == -1);
+
 std::vector< rtl::Reference< ChildAccess > > children(
 getAllChildren());
 for (auto const& child : children)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source connectivity/inc connectivity/source connectivity/workben include/connectivity

2020-07-18 Thread Noel Grandin (via logerrit)
 configmgr/source/xmldata.hxx   |6 -
 connectivity/inc/sdbcx/VCatalog.hxx|6 -
 connectivity/inc/sdbcx/VGroup.hxx  |6 -
 connectivity/inc/sdbcx/VIndex.hxx  |6 -
 connectivity/inc/sdbcx/VIndexColumn.hxx|6 -
 connectivity/inc/sdbcx/VKey.hxx|7 -
 connectivity/inc/sdbcx/VKeyColumn.hxx  |6 -
 connectivity/inc/sdbcx/VTypeDef.hxx|5 
 connectivity/inc/sdbcx/VUser.hxx   |6 -
 connectivity/source/drivers/evoab2/NCatalog.hxx|6 -
 connectivity/source/drivers/evoab2/NColumns.hxx|5 
 connectivity/source/drivers/evoab2/NConnection.hxx |7 -
 connectivity/source/drivers/evoab2/NDatabaseMetaData.hxx   |6 -
 connectivity/source/drivers/evoab2/NDriver.hxx |8 -
 connectivity/source/drivers/evoab2/NPreparedStatement.hxx  |6 -
 connectivity/source/drivers/evoab2/NResultSet.hxx  |6 -
 connectivity/source/drivers/evoab2/NResultSetMetaData.hxx  |7 -
 connectivity/source/drivers/evoab2/NStatement.hxx  |6 -
 connectivity/source/drivers/evoab2/NTable.hxx  |6 -
 connectivity/source/drivers/evoab2/NTables.hxx |7 -
 connectivity/source/drivers/firebird/Blob.hxx  |5 
 connectivity/source/drivers/firebird/Catalog.hxx   |8 -
 connectivity/source/drivers/firebird/Clob.hxx  |5 
 connectivity/source/drivers/firebird/Column.hxx|6 -
 connectivity/source/drivers/firebird/Columns.hxx   |7 -
 connectivity/source/drivers/firebird/Connection.hxx|6 -
 connectivity/source/drivers/firebird/DatabaseMetaData.hxx  |6 -
 connectivity/source/drivers/firebird/Driver.hxx|5 
 connectivity/source/drivers/firebird/Indexes.hxx   |7 -
 connectivity/source/drivers/firebird/Keys.hxx  |7 -
 connectivity/source/drivers/firebird/PreparedStatement.hxx |6 -
 connectivity/source/drivers/firebird/ResultSet.hxx |6 -
 connectivity/source/drivers/firebird/ResultSetMetaData.hxx |6 -
 connectivity/source/drivers/firebird/Statement.hxx |7 -
 connectivity/source/drivers/firebird/StatementCommonBase.hxx   |6 -
 connectivity/source/drivers/firebird/SubComponent.hxx  |   24 
 connectivity/source/drivers/firebird/Table.hxx |7 -
 connectivity/source/drivers/firebird/Tables.hxx|7 -
 connectivity/source/drivers/firebird/User.hxx  |7 -
 connectivity/source/drivers/firebird/Users.hxx |7 -
 connectivity/source/drivers/firebird/Util.hxx  |6 -
 connectivity/source/drivers/hsqldb/HTerminateListener.hxx  |9 -
 connectivity/source/drivers/macab/MacabAddressBook.hxx |5 
 connectivity/source/drivers/macab/MacabCatalog.hxx |7 -
 connectivity/source/drivers/macab/MacabColumns.hxx |5 
 connectivity/source/drivers/macab/MacabConnection.hxx  |5 
 connectivity/source/drivers/macab/MacabDatabaseMetaData.hxx|5 
 connectivity/source/drivers/macab/MacabDriver.hxx  |5 
 connectivity/source/drivers/macab/MacabGroup.hxx   |5 
 connectivity/source/drivers/macab/MacabHeader.hxx  |5 
 connectivity/source/drivers/macab/MacabPreparedStatement.hxx   |5 
 connectivity/source/drivers/macab/MacabRecord.hxx  |5 
 connectivity/source/drivers/macab/MacabRecords.hxx |5 
 connectivity/source/drivers/macab/MacabResultSet.hxx   |5 
 connectivity/source/drivers/macab/MacabResultSetMetaData.hxx   |5 
 connectivity/source/drivers/macab/MacabStatement.cxx   |5 
 connectivity/source/drivers/macab/MacabStatement.hxx   |5 
 connectivity/source/drivers/macab/MacabTable.hxx   |5 
 connectivity/source/drivers/macab/MacabTables.hxx  |5 
 connectivity/source/drivers/macab/macabcondition.hxx   |5 
 connectivity/source/drivers/macab/macaborder.hxx   |5 
 connectivity/source/drivers/macab/macabutilities.hxx   |5 
 connectivity/source/drivers/mork/MCatalog.hxx  |6 -
 connectivity/source/drivers/mork/MColumnAlias.hxx  |6 -
 connectivity/source/drivers/mork/MColumns.hxx  |6 -
 

[Libreoffice-commits] core.git: configmgr/source

2020-06-30 Thread Stephan Bergmann (via logerrit)
 configmgr/source/services.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit dbfcdc4b7036f058cfae4120ef4c540b58b1b2b8
Author: Stephan Bergmann 
AuthorDate: Tue Jun 30 18:34:15 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Jun 30 22:58:24 2020 +0200

Upcoming improved loplugin:staticanonymous -> redundantstatic: configmgr

Change-Id: I85650691056c24d8c2e37ddce2c50a27193b4c6c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97543
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/configmgr/source/services.cxx b/configmgr/source/services.cxx
index 48ccd8a33c56..ef614b1c5830 100644
--- a/configmgr/source/services.cxx
+++ b/configmgr/source/services.cxx
@@ -44,7 +44,7 @@ css::uno::Reference< css::uno::XInterface > dummy(
 return css::uno::Reference< css::uno::XInterface >();
 }
 
-static cppu::ImplementationEntry const services[] = {
+cppu::ImplementationEntry const services[] = {
 { , ::configuration_provider::getImplementationName,
   ::configuration_provider::getSupportedServiceNames,
   ::configuration_provider::createFactory, nullptr, 0 },
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source sd/source

2020-06-15 Thread Andras Timar (via logerrit)
 configmgr/source/access.cxx  |2 +-
 sd/source/core/CustomAnimationPreset.cxx |4 ++--
 sd/source/core/TransitionPreset.cxx  |4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 1b8cbfef2481c06bc6d7bf3c5d5811b0d2b9b423
Author: Andras Timar 
AuthorDate: Mon Jun 15 09:20:24 2020 +0200
Commit: Andras Timar 
CommitDate: Mon Jun 15 21:41:16 2020 +0200

Use  getBcp47() instead of getLanguage()

getLanguage() only returns the language code which can be
ambiguous in case of UI localization, when there are more
than one language variants. Fallback to the first variant
caused mixed language UI, e.g. en-US vs. en-GB, pt vs. pt-BR,
zh-CN vs. zh-TW.

Change-Id: I888423cd4b3c65dbdb900ff3b6bc308fa119be4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96285
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 9fe7f31cc00f..e07fc8446f51 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -1382,7 +1382,7 @@ rtl::Reference< ChildAccess > Access::getChild(OUString 
const & name) {
 // here we override it with the actual current-user's language to
 // support per-view localization in LOK.
 if (comphelper::LibreOfficeKit::isActive())
-locale = 
comphelper::LibreOfficeKit::getLanguageTag().getLanguage();
+locale = comphelper::LibreOfficeKit::getLanguageTag().getBcp47();
 
 if (!locale.isEmpty()) {
 // Find best match using an adaptation of RFC 4647 lookup matching
diff --git a/sd/source/core/CustomAnimationPreset.cxx 
b/sd/source/core/CustomAnimationPreset.cxx
index 3be4e76941f8..cf15dc490622 100644
--- a/sd/source/core/CustomAnimationPreset.cxx
+++ b/sd/source/core/CustomAnimationPreset.cxx
@@ -478,8 +478,8 @@ const CustomAnimationPresets& 
CustomAnimationPresets::getCustomAnimationPresets(
 // Support localization per-view. Currently not useful for Desktop
 // but very much critical for LOK. The cache now is per-language.
 const OUString aLang = comphelper::LibreOfficeKit::isActive()
-   ? 
comphelper::LibreOfficeKit::getLanguageTag().getLanguage()
-   : 
SvtSysLocaleOptions().GetLanguageTag().getLanguage();
+   ? 
comphelper::LibreOfficeKit::getLanguageTag().getBcp47()
+   : 
SvtSysLocaleOptions().GetLanguageTag().getBcp47();
 
 SolarMutexGuard aGuard;
 const auto it = mPresetsMap.find(aLang);
diff --git a/sd/source/core/TransitionPreset.cxx 
b/sd/source/core/TransitionPreset.cxx
index 951959cdb69a..1a8f55b90aed 100644
--- a/sd/source/core/TransitionPreset.cxx
+++ b/sd/source/core/TransitionPreset.cxx
@@ -367,8 +367,8 @@ const TransitionPresetList& 
TransitionPreset::getTransitionPresetList()
 // Support localization per-view. Currently not useful for Desktop
 // but very much critical for LOK. The cache now is per-language.
 const OUString aLang = comphelper::LibreOfficeKit::isActive()
-   ? 
comphelper::LibreOfficeKit::getLanguageTag().getLanguage()
-   : 
SvtSysLocaleOptions().GetLanguageTag().getLanguage();
+   ? 
comphelper::LibreOfficeKit::getLanguageTag().getBcp47()
+   : 
SvtSysLocaleOptions().GetLanguageTag().getBcp47();
 
 SolarMutexGuard aGuard;
 const auto it = mPresetsMap.find(aLang);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2020-05-06 Thread Stephan Bergmann (via logerrit)
 configmgr/source/components.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 8fa958d7d7f454cbea83fdafdde295ffd960787e
Author: Stephan Bergmann 
AuthorDate: Wed May 6 16:24:48 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Wed May 6 17:22:18 2020 +0200

"resolved" is a better name than "isResolved" here

...as the variable is true if any of the unresolved depedencies got resolved
now, rather than anything specific that "is resolved" now.  This partially
reverts be729e772196f33543e21cb9bac21add87726b20 "tdf#94269: Replace 'n' 
prefix
for bool variables with 'b'".

Change-Id: I14c0b3872aaf320baedb349b1cfdd1ed29417dfc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93569
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index 5dfb8c281cb7..7f629bc8afbe 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -796,17 +796,17 @@ void Components::parseXcdFiles(int layer, OUString const 
& url) {
 }
 }
 while (!unres.empty()) {
-bool isResolved = false;
+bool resolved = false;
 for (UnresolvedVector::iterator i(unres.begin()); i != unres.end();) {
 if (i->manager->parse()) {
 processedDeps.insert(i->name);
 i = unres.erase(i);
-isResolved = true;
+resolved = true;
 } else {
 ++i;
 }
 }
-if (!isResolved) {
+if (!resolved) {
 throw css::uno::RuntimeException(
 "xcd: unresolved dependencies in " + url);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2020-05-06 Thread Stephan Bergmann (via logerrit)
 configmgr/source/components.cxx |7 ---
 configmgr/source/components.hxx |2 --
 2 files changed, 9 deletions(-)

New commits:
commit 8c93e2c280536ba3acf9553aa199c752c8ca23f6
Author: Stephan Bergmann 
AuthorDate: Wed May 6 09:25:57 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Wed May 6 14:50:23 2020 +0200

Remove support for "module" layers

f4d8090a484f99970f00bab2aa9b9f8d6cbe4fdc "Drop support for long-gone
share/registry/modules layer" stated:  "Support for 'module' layers in
configmgr/source/components.cxx is still needed for
gb_CppunitTest_use_filter_configuration in solenv/gbuild/CppunitTest.mk."  
But
that need is meanwhile gone since e1b51e7beb7f9cfa7b574b9c2a69799e62963a09
"gbuild: use .xcd configuration files from instdir" removed
gb_CppunitTest_use_filter_configuration.

Change-Id: Ide8d69e79272df7c450edfb1e763e3dcc8f257e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93546
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index 57cf0840b1bf..5dfb8c281cb7 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -516,9 +516,6 @@ Components::Components(
 userExtensionLayer_ = layer;
 parseXcsXcuIniLayer(layer, url, true);
 layer += 2; //TODO: overflow
-} else if (type == "module") {
-parseModuleLayer(layer, url);
-++layer; //TODO: overflow
 } else if (type == "res") {
 sal_uInt32 nStartTime = osl_getGlobalTimer();
 parseResLayer(layer, url);
@@ -856,10 +853,6 @@ void Components::parseXcsXcuIniLayer(
 }
 }
 
-void Components::parseModuleLayer(int layer, OUString const & url) {
-parseFiles(layer, ".xcu", , url, false);
-}
-
 void Components::parseResLayer(int layer, OUString const & url) {
 OUString resUrl(url + "/res");
 parseXcdFiles(layer, resUrl);
diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx
index 6aec76bd1aad..8db06909b192 100644
--- a/configmgr/source/components.hxx
+++ b/configmgr/source/components.hxx
@@ -132,8 +132,6 @@ private:
 void parseXcsXcuIniLayer(
 int layer, OUString const & url, bool recordAdditions);
 
-void parseModuleLayer(int layer, OUString const & url);
-
 void parseResLayer(int layer, OUString const & url);
 
 void parseModificationLayer(int layer, OUString const & url);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source include/sfx2 svx/source

2020-02-04 Thread Noel Grandin (via logerrit)
 configmgr/source/components.hxx |3 ++-
 include/sfx2/linkmgr.hxx|4 ++--
 svx/source/inc/svdoutlinercache.hxx |4 ++--
 svx/source/svdraw/svdotxat.cxx  |2 +-
 svx/source/svdraw/svdouno.cxx   |   14 --
 5 files changed, 11 insertions(+), 16 deletions(-)

New commits:
commit d543d4d5388f79eee92a97b7bf4cd490d9ed29ea
Author: Noel Grandin 
AuthorDate: Tue Feb 4 10:14:27 2020 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 4 10:09:04 2020 +0100

std::set -> o3tl::sorted_vector

Change-Id: I562f8a8dc27f4aeebec6f6643b95460315edc9c2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87949
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx
index bd4aeb5a78ac..6aec76bd1aad 100644
--- a/configmgr/source/components.hxx
+++ b/configmgr/source/components.hxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "additions.hxx"
 #include "data.hxx"
@@ -139,7 +140,7 @@ private:
 
 int getExtensionLayer(bool shared) const;
 
-typedef std::set< RootAccess * > WeakRootSet;
+typedef o3tl::sorted_vector< RootAccess * > WeakRootSet;
 
 typedef
 config_map<
diff --git a/include/sfx2/linkmgr.hxx b/include/sfx2/linkmgr.hxx
index 7f3bf021eeed..c12b453f56c5 100644
--- a/include/sfx2/linkmgr.hxx
+++ b/include/sfx2/linkmgr.hxx
@@ -24,7 +24,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 class SfxObjectShell;
@@ -47,7 +47,7 @@ namespace sfx2
 
 typedef std::vector > SvBaseLinks;
 
-typedef std::set SvLinkSources;
+typedef o3tl::sorted_vector SvLinkSources;
 
 class SFX2_DLLPUBLIC LinkManager
 {
diff --git a/svx/source/inc/svdoutlinercache.hxx 
b/svx/source/inc/svdoutlinercache.hxx
index 0dc4994cc29d..01679f6b9391 100644
--- a/svx/source/inc/svdoutlinercache.hxx
+++ b/svx/source/inc/svdoutlinercache.hxx
@@ -22,7 +22,7 @@
 
 #include 
 #include 
-#include 
+#include 
 
 class SdrModel;
 class SdrOutliner;
@@ -34,7 +34,7 @@ private:
 SdrModel*mpModel;
 std::vector< std::unique_ptr >  maModeOutline;
 std::vector< std::unique_ptr >  maModeText;
-std::set< SdrOutliner* > maActiveOutliners;
+o3tl::sorted_vector< SdrOutliner* >  maActiveOutliners;
 
 public:
 SdrOutlinerCache( SdrModel* pModel );
diff --git a/svx/source/svdraw/svdotxat.cxx b/svx/source/svdraw/svdotxat.cxx
index ad4c9f6965c1..04b8de638f65 100644
--- a/svx/source/svdraw/svdotxat.cxx
+++ b/svx/source/svdraw/svdotxat.cxx
@@ -351,7 +351,7 @@ void SdrTextObj::ImpSetTextStyleSheetListeners()
 }
 
 // now convert the strings in the vector from names to StyleSheet*
-std::set aStyleSheets;
+o3tl::sorted_vector aStyleSheets;
 while (!aStyleNames.empty()) {
 OUString aName = aStyleNames.back();
 aStyleNames.pop_back();
diff --git a/svx/source/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx
index 7e5e6e571d6e..111aa5ed0cd5 100644
--- a/svx/source/svdraw/svdouno.cxx
+++ b/svx/source/svdraw/svdouno.cxx
@@ -50,6 +50,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 using namespace sdr::contact;
@@ -349,7 +350,7 @@ void SdrUnoObj::NbcSetLayer( SdrLayerID _nLayer )
 // same time)
 
 // collect all views in which our old layer is visible
-::std::set< SdrView* > aPreviouslyVisible;
+o3tl::sorted_vector< SdrView* > aPreviouslyVisible;
 
 {
 SdrViewIter aIter( this );
@@ -360,20 +361,13 @@ void SdrUnoObj::NbcSetLayer( SdrLayerID _nLayer )
 SdrRectObj::NbcSetLayer( _nLayer );
 
 // collect all views in which our new layer is visible
-::std::set< SdrView* > aNewlyVisible;
+o3tl::sorted_vector< SdrView* > aNewlyVisible;
 
 {
 SdrViewIter aIter( this );
 for ( SdrView* pView = aIter.FirstView(); pView; pView = 
aIter.NextView() )
 {
-::std::set< SdrView* >::const_iterator aPrevPos = 
aPreviouslyVisible.find( pView );
-if ( aPreviouslyVisible.end() != aPrevPos )
-{   // in pView, we were visible _before_ the layer change, and are
-// visible _after_ the layer change, too
-// -> we're not interested in this view at all
-aPreviouslyVisible.erase( aPrevPos );
-}
-else
+if ( aPreviouslyVisible.erase(pView) == 0 )
 {
 // in pView, we were visible _before_ the layer change, and are
 // _not_ visible after the layer change
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2020-01-29 Thread Canberk TURAN (via logerrit)
 configmgr/source/configurationprovider.cxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit a654caf5dbca9635d4e7f89eb6d125ea98626da3
Author: Canberk TURAN 
AuthorDate: Mon Jan 27 14:54:18 2020 +0300
Commit: Muhammet Kara 
CommitDate: Wed Jan 29 22:10:18 2020 +0100

tdf#88205: Adapt uses of css::uno::Sequence to use initializer_list ctor

Changed to one-line return

Change-Id: I2ce55ff3c7f218823418ed623b03e6a4fcbc0d2c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87515
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/configmgr/source/configurationprovider.cxx 
b/configmgr/source/configurationprovider.cxx
index 6cbde63f2000..467d73bfdc23 100644
--- a/configmgr/source/configurationprovider.cxx
+++ b/configmgr/source/configurationprovider.cxx
@@ -268,10 +268,7 @@ Service::createInstanceWithArguments(
 
 css::uno::Sequence< OUString > Service::getAvailableServiceNames()
 {
-css::uno::Sequence< OUString > names(2);
-names[0] = accessServiceName;
-names[1] = updateAccessServiceName;
-return names;
+return { accessServiceName, updateAccessServiceName };
 }
 
 void Service::refresh() {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2020-01-25 Thread Efdal İncesu (via logerrit)
 configmgr/source/winreg.hxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit e7c6ceb862e997a56b51212e2c4351ba8ce13602
Author: Efdal İncesu 
AuthorDate: Sat Jan 25 14:58:47 2020 +0300
Commit: Muhammet Kara 
CommitDate: Sat Jan 25 17:46:02 2020 +0100

tdf#124176: Use pragma once instead of include guard

Change-Id: Ifec221d1dbffa3adcc9e3cc7ed13dcf82f1182d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87384
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/configmgr/source/winreg.hxx b/configmgr/source/winreg.hxx
index fb880ac0c564..132a1f6d4206 100644
--- a/configmgr/source/winreg.hxx
+++ b/configmgr/source/winreg.hxx
@@ -8,8 +8,7 @@
  *
  */
 
-#ifndef INCLUDED_CONFIGMGR_SOURCE_WINREG_HXX
-#define INCLUDED_CONFIGMGR_SOURCE_WINREG_HXX
+#pragma once
 
 namespace configmgr {
 
@@ -19,6 +18,4 @@ bool dumpWindowsRegistry(OUString* pFileURL, WinRegType 
eType);
 
 }
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2020-01-02 Thread Noel Grandin (via logerrit)
 configmgr/source/access.cxx|   94 ++---
 configmgr/source/access.hxx|2 
 configmgr/source/childaccess.cxx   |   16 ++--
 configmgr/source/childaccess.hxx   |1 
 configmgr/source/components.cxx|   11 ++-
 configmgr/source/components.hxx|1 
 configmgr/source/configurationprovider.cxx |   15 ++--
 configmgr/source/defaultprovider.cxx   |2 
 configmgr/source/lock.cxx  |   12 ++-
 configmgr/source/lock.hxx  |3 
 configmgr/source/readonlyaccess.cxx|2 
 configmgr/source/readwriteaccess.cxx   |2 
 configmgr/source/rootaccess.cxx|   17 ++---
 configmgr/source/rootaccess.hxx|2 
 configmgr/source/update.cxx|   10 +--
 15 files changed, 105 insertions(+), 85 deletions(-)

New commits:
commit cb109d6518cc36155f9d0665932de0a54fdb6f4a
Author: Noel Grandin 
AuthorDate: Thu Jan 2 08:05:01 2020 +0100
Commit: Noel Grandin 
CommitDate: Thu Jan 2 19:07:20 2020 +0100

Revert "no need to use shared_ptr here"

This reverts commit 122598af564082786f01b4eafdb9f09f0cffdf5f.

Reason for revert: shared_ptr was introduced for fdo#31494, to avoid issues 
during shutdown

Change-Id: I1c3ef4a966b9244da1e504806e917d1918b83803
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86095
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 0564cb3bad88..9fe7f31cc00f 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -171,7 +171,7 @@ void Access::initBroadcaster(
 css::uno::Sequence< css::uno::Type > Access::getTypes()
 {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(theConfigLock());
+osl::MutexGuard g(*lock_);
 checkLocalizedPropertyAccess();
 std::vector< css::uno::Type > types;
 types.push_back(cppu::UnoType< css::uno::XInterface >::get());
@@ -222,7 +222,7 @@ css::uno::Sequence< css::uno::Type > Access::getTypes()
 css::uno::Sequence< sal_Int8 > Access::getImplementationId()
 {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(theConfigLock());
+osl::MutexGuard g(*lock_);
 checkLocalizedPropertyAccess();
 return css::uno::Sequence< sal_Int8 >();
 }
@@ -230,7 +230,7 @@ css::uno::Sequence< sal_Int8 > Access::getImplementationId()
 OUString Access::getImplementationName()
 {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(theConfigLock());
+osl::MutexGuard g(*lock_);
 checkLocalizedPropertyAccess();
 return "org.openoffice-configmgr::Access";
 }
@@ -243,7 +243,7 @@ sal_Bool Access::supportsService(OUString const & 
ServiceName)
 css::uno::Sequence< OUString > Access::getSupportedServiceNames()
 {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(theConfigLock());
+osl::MutexGuard g(*lock_);
 checkLocalizedPropertyAccess();
 std::vector services;
 services.emplace_back("com.sun.star.configuration.ConfigurationAccess");
@@ -274,7 +274,7 @@ void Access::dispose() {
 assert(thisIs(IS_ANY));
 Broadcaster bc;
 {
-osl::MutexGuard g(theConfigLock());
+osl::MutexGuard g(*lock_);
 checkLocalizedPropertyAccess();
 if (getParentAccess().is()) {
 throw css::uno::RuntimeException(
@@ -296,7 +296,7 @@ void Access::addEventListener(
 {
 assert(thisIs(IS_ANY));
 {
-osl::MutexGuard g(theConfigLock());
+osl::MutexGuard g(*lock_);
 checkLocalizedPropertyAccess();
 if (!xListener.is()) {
 throw css::uno::RuntimeException(
@@ -317,7 +317,7 @@ void Access::removeEventListener(
 css::uno::Reference< css::lang::XEventListener > const & aListener)
 {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(theConfigLock());
+osl::MutexGuard g(*lock_);
 checkLocalizedPropertyAccess();
 DisposeListeners::iterator i(disposeListeners_.find(aListener));
 if (i != disposeListeners_.end()) {
@@ -327,7 +327,7 @@ void Access::removeEventListener(
 
 css::uno::Type Access::getElementType() {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(theConfigLock());
+osl::MutexGuard g(*lock_);
 checkLocalizedPropertyAccess();
 rtl::Reference< Node > p(getNode());
 switch (p->kind()) {
@@ -350,7 +350,7 @@ css::uno::Type Access::getElementType() {
 
 sal_Bool Access::hasElements() {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(theConfigLock());
+osl::MutexGuard g(*lock_);
 checkLocalizedPropertyAccess();
 return !getAllChildren().empty(); //TODO: optimize
 }
@@ -394,7 +394,7 @@ bool Access::getByNameFast(const OUString & name, 
css::uno::Any & value)
 css::uno::Any Access::getByName(OUString const & aName)
 {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(theConfigLock());
+osl::MutexGuard g(*lock_);
 checkLocalizedPropertyAccess();
 css::uno::Any value;
 if (!getByNameFast(aName, 

[Libreoffice-commits] core.git: configmgr/source

2019-12-30 Thread Stephan Bergmann (via logerrit)
 configmgr/source/access.hxx|1 -
 configmgr/source/components.hxx|1 -
 configmgr/source/configurationprovider.cxx |1 -
 configmgr/source/rootaccess.hxx|1 -
 configmgr/source/update.cxx|1 -
 5 files changed, 5 deletions(-)

New commits:
commit 87dd1232054b4c85a2bdadc8aa2c84dd4947bedb
Author: Stephan Bergmann 
AuthorDate: Mon Dec 30 16:35:01 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Dec 30 19:42:19 2019 +0100

Clean up newly unused includes

...after 122598af564082786f01b4eafdb9f09f0cffdf5f "no need to use shared_ptr
here"

Change-Id: I5b7525388eed96005c9163a58c9b260d0b100cbf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86012
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/configmgr/source/access.hxx b/configmgr/source/access.hxx
index 24f4ddadf665..db2decb48874 100644
--- a/configmgr/source/access.hxx
+++ b/configmgr/source/access.hxx
@@ -22,7 +22,6 @@
 
 #include 
 
-#include 
 #include 
 #include 
 #include "config_map.hxx"
diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx
index f9e8ff0cd295..c23beee82777 100644
--- a/configmgr/source/components.hxx
+++ b/configmgr/source/components.hxx
@@ -22,7 +22,6 @@
 
 #include 
 
-#include 
 #include 
 
 #include 
diff --git a/configmgr/source/configurationprovider.cxx 
b/configmgr/source/configurationprovider.cxx
index 65e785e2afe1..7d39593ab62e 100644
--- a/configmgr/source/configurationprovider.cxx
+++ b/configmgr/source/configurationprovider.cxx
@@ -20,7 +20,6 @@
 #include 
 
 #include 
-#include 
 
 #include 
 #include 
diff --git a/configmgr/source/rootaccess.hxx b/configmgr/source/rootaccess.hxx
index 8157f8e6c7a2..bc26179fc2e2 100644
--- a/configmgr/source/rootaccess.hxx
+++ b/configmgr/source/rootaccess.hxx
@@ -22,7 +22,6 @@
 
 #include 
 
-#include 
 #include 
 #include 
 
diff --git a/configmgr/source/update.cxx b/configmgr/source/update.cxx
index 983c2e88fac2..c8f6505243ee 100644
--- a/configmgr/source/update.cxx
+++ b/configmgr/source/update.cxx
@@ -20,7 +20,6 @@
 #include 
 
 #include 
-#include 
 #include 
 
 #include 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2019-12-24 Thread Noel Grandin (via logerrit)
 configmgr/source/access.cxx|   94 ++---
 configmgr/source/access.hxx|2 
 configmgr/source/childaccess.cxx   |   16 ++--
 configmgr/source/childaccess.hxx   |1 
 configmgr/source/components.cxx|   11 +--
 configmgr/source/components.hxx|1 
 configmgr/source/configurationprovider.cxx |   15 +---
 configmgr/source/defaultprovider.cxx   |2 
 configmgr/source/lock.cxx  |   12 +--
 configmgr/source/lock.hxx  |3 
 configmgr/source/readonlyaccess.cxx|2 
 configmgr/source/readwriteaccess.cxx   |2 
 configmgr/source/rootaccess.cxx|   17 ++---
 configmgr/source/rootaccess.hxx|2 
 configmgr/source/update.cxx|   10 +--
 15 files changed, 85 insertions(+), 105 deletions(-)

New commits:
commit 122598af564082786f01b4eafdb9f09f0cffdf5f
Author: Noel Grandin 
AuthorDate: Mon Dec 23 22:09:27 2019 +0200
Commit: Noel Grandin 
CommitDate: Tue Dec 24 16:05:43 2019 +0100

no need to use shared_ptr here

when we are really just sharing a single global lock object

Change-Id: I30d6f4cbd30cb7ee849f20a6c15615a94f67d7d8
Reviewed-on: https://gerrit.libreoffice.org/85768
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 9fe7f31cc00f..0564cb3bad88 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -171,7 +171,7 @@ void Access::initBroadcaster(
 css::uno::Sequence< css::uno::Type > Access::getTypes()
 {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(*lock_);
+osl::MutexGuard g(theConfigLock());
 checkLocalizedPropertyAccess();
 std::vector< css::uno::Type > types;
 types.push_back(cppu::UnoType< css::uno::XInterface >::get());
@@ -222,7 +222,7 @@ css::uno::Sequence< css::uno::Type > Access::getTypes()
 css::uno::Sequence< sal_Int8 > Access::getImplementationId()
 {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(*lock_);
+osl::MutexGuard g(theConfigLock());
 checkLocalizedPropertyAccess();
 return css::uno::Sequence< sal_Int8 >();
 }
@@ -230,7 +230,7 @@ css::uno::Sequence< sal_Int8 > Access::getImplementationId()
 OUString Access::getImplementationName()
 {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(*lock_);
+osl::MutexGuard g(theConfigLock());
 checkLocalizedPropertyAccess();
 return "org.openoffice-configmgr::Access";
 }
@@ -243,7 +243,7 @@ sal_Bool Access::supportsService(OUString const & 
ServiceName)
 css::uno::Sequence< OUString > Access::getSupportedServiceNames()
 {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(*lock_);
+osl::MutexGuard g(theConfigLock());
 checkLocalizedPropertyAccess();
 std::vector services;
 services.emplace_back("com.sun.star.configuration.ConfigurationAccess");
@@ -274,7 +274,7 @@ void Access::dispose() {
 assert(thisIs(IS_ANY));
 Broadcaster bc;
 {
-osl::MutexGuard g(*lock_);
+osl::MutexGuard g(theConfigLock());
 checkLocalizedPropertyAccess();
 if (getParentAccess().is()) {
 throw css::uno::RuntimeException(
@@ -296,7 +296,7 @@ void Access::addEventListener(
 {
 assert(thisIs(IS_ANY));
 {
-osl::MutexGuard g(*lock_);
+osl::MutexGuard g(theConfigLock());
 checkLocalizedPropertyAccess();
 if (!xListener.is()) {
 throw css::uno::RuntimeException(
@@ -317,7 +317,7 @@ void Access::removeEventListener(
 css::uno::Reference< css::lang::XEventListener > const & aListener)
 {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(*lock_);
+osl::MutexGuard g(theConfigLock());
 checkLocalizedPropertyAccess();
 DisposeListeners::iterator i(disposeListeners_.find(aListener));
 if (i != disposeListeners_.end()) {
@@ -327,7 +327,7 @@ void Access::removeEventListener(
 
 css::uno::Type Access::getElementType() {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(*lock_);
+osl::MutexGuard g(theConfigLock());
 checkLocalizedPropertyAccess();
 rtl::Reference< Node > p(getNode());
 switch (p->kind()) {
@@ -350,7 +350,7 @@ css::uno::Type Access::getElementType() {
 
 sal_Bool Access::hasElements() {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(*lock_);
+osl::MutexGuard g(theConfigLock());
 checkLocalizedPropertyAccess();
 return !getAllChildren().empty(); //TODO: optimize
 }
@@ -394,7 +394,7 @@ bool Access::getByNameFast(const OUString & name, 
css::uno::Any & value)
 css::uno::Any Access::getByName(OUString const & aName)
 {
 assert(thisIs(IS_ANY));
-osl::MutexGuard g(*lock_);
+osl::MutexGuard g(theConfigLock());
 checkLocalizedPropertyAccess();
 css::uno::Any value;
 if (!getByNameFast(aName, value))
@@ -406,7 +406,7 @@ css::uno::Any Access::getByName(OUString const & aName)
 css::uno::Sequence< OUString > 

[Libreoffice-commits] core.git: configmgr/source connectivity/source slideshow/source svx/source sw/source writerfilter/source xmloff/source

2019-11-12 Thread Noel Grandin (via logerrit)
 configmgr/source/xcsparser.cxx|2 -
 connectivity/source/commontools/RowFunctionParser.cxx |6 ++---
 slideshow/source/engine/eventqueue.cxx|4 +--
 slideshow/source/engine/smilfunctionparser.cxx|6 ++---
 svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx |   12 +-
 sw/source/core/view/viewsh.cxx|2 -
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |2 -
 xmloff/source/core/xmlimp.cxx |2 -
 8 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit 1a2926a995fdbdcdae0ca6407877084f3520e539
Author: Noel Grandin 
AuthorDate: Tue Nov 12 12:44:32 2019 +0200
Commit: Noel Grandin 
CommitDate: Tue Nov 12 13:59:50 2019 +0100

use std::move when popping stuff off stacks

Change-Id: I6ba0ee8afee1a9579045643cd0118cf19599d5b9
Reviewed-on: https://gerrit.libreoffice.org/82497
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/xcsparser.cxx b/configmgr/source/xcsparser.cxx
index c0b34974157b..7b1750b20972 100644
--- a/configmgr/source/xcsparser.cxx
+++ b/configmgr/source/xcsparser.cxx
@@ -257,7 +257,7 @@ void XcsParser::endElement(xmlreader::XmlReader const & 
reader) {
 if (ignoring_ > 0) {
 --ignoring_;
 } else if (!elements_.empty()) {
-Element top(elements_.top());
+Element top(std::move(elements_.top()));
 elements_.pop();
 if (top.node.is()) {
 if (elements_.empty()) {
diff --git a/connectivity/source/commontools/RowFunctionParser.cxx 
b/connectivity/source/commontools/RowFunctionParser.cxx
index 811e0fb7c70f..44bd04a080dd 100644
--- a/connectivity/source/commontools/RowFunctionParser.cxx
+++ b/connectivity/source/commontools/RowFunctionParser.cxx
@@ -206,9 +206,9 @@ public:
 throw ParseError( "Not enough arguments for binary operator" );
 
 // retrieve arguments
-std::shared_ptr pSecondArg( rNodeStack.top() );
+std::shared_ptr pSecondArg( 
std::move(rNodeStack.top()) );
 rNodeStack.pop();
-std::shared_ptr pFirstArg( rNodeStack.top() );
+std::shared_ptr pFirstArg( std::move(rNodeStack.top()) 
);
 rNodeStack.pop();
 
 // create combined ExpressionNode
@@ -257,7 +257,7 @@ public:
 throw ParseError( "Not enough arguments for unary operator" );
 
 // retrieve arguments
-std::shared_ptr pArg( rNodeStack.top() );
+std::shared_ptr pArg( std::move(rNodeStack.top()) );
 rNodeStack.pop();
 
 rNodeStack.push( std::shared_ptr( new 
UnaryFunctionExpression( pArg ) ) );
diff --git a/slideshow/source/engine/eventqueue.cxx 
b/slideshow/source/engine/eventqueue.cxx
index d5596cdb7036..e2b909e40185 100644
--- a/slideshow/source/engine/eventqueue.cxx
+++ b/slideshow/source/engine/eventqueue.cxx
@@ -180,7 +180,7 @@ namespace slideshow
 && !bFireAllEvents
 && (maEvents.empty() || maEvents.top().nTime > nCurrTime))
 {
-const EventEntry aEvent (maNextNextEvents.top());
+const EventEntry aEvent (std::move(maNextNextEvents.top()));
 maNextNextEvents.pop();
 maEvents.push(aEvent);
 }
@@ -192,7 +192,7 @@ namespace slideshow
 while( !maEvents.empty() &&
(bFireAllEvents || maEvents.top().nTime <= nCurrTime) )
 {
-EventEntry event( maEvents.top() );
+EventEntry event( std::move(maEvents.top()) );
 maEvents.pop();
 
 // only process event, if it is still 'charged',
diff --git a/slideshow/source/engine/smilfunctionparser.cxx 
b/slideshow/source/engine/smilfunctionparser.cxx
index 678e3c5ed740..9a6673e7db2a 100644
--- a/slideshow/source/engine/smilfunctionparser.cxx
+++ b/slideshow/source/engine/smilfunctionparser.cxx
@@ -238,7 +238,7 @@ namespace slideshow
 throw ParseError( "Not enough arguments for unary 
operator" );
 
 // retrieve arguments
-std::shared_ptr pArg( rNodeStack.top() );
+std::shared_ptr pArg( 
std::move(rNodeStack.top()) );
 rNodeStack.pop();
 
 // check for constness
@@ -313,9 +313,9 @@ namespace slideshow
 throw ParseError( "Not enough arguments for binary 
operator" );
 
 // retrieve arguments
-std::shared_ptr pSecondArg( 
rNodeStack.top() );
+std::shared_ptr pSecondArg( 
std::move(rNodeStack.top()) );
 rNodeStack.pop();
-std::shared_ptr pFirstArg( 
rNodeStack.top() );
+std::shared_ptr pFirstArg( 
std::move(rNodeStack.top()) );
 rNodeStack.pop();
 

[Libreoffice-commits] core.git: configmgr/source include/xmlreader sw/source vcl/opengl vcl/source xmlreader/source

2019-10-06 Thread Noel Grandin (via logerrit)
 configmgr/source/valueparser.cxx |   10 +--
 configmgr/source/xcdparser.cxx   |   12 +--
 configmgr/source/xcsparser.cxx   |   60 +-
 configmgr/source/xcuparser.cxx   |   80 
 configmgr/source/xmldata.cxx |   63 +--
 include/xmlreader/span.hxx   |   23 ---
 sw/source/uibase/envelp/labelcfg.cxx |   10 +--
 vcl/opengl/win/blocklist_parser.cxx  |   32 -
 vcl/source/window/builder.cxx|  114 +--
 xmlreader/source/xmlreader.cxx   |   12 +--
 10 files changed, 198 insertions(+), 218 deletions(-)

New commits:
commit 0a6b9df8c8fc8e97ac627081485613e336051208
Author: Noel Grandin 
AuthorDate: Sun Oct 6 08:10:55 2019 +0200
Commit: Noel Grandin 
CommitDate: Sun Oct 6 17:06:53 2019 +0200

convert equals() to operator== in xmlreader::Span

Change-Id: Ic6a8eae344c06be87e2bc4bf7f242a2d18ebc8ad
Reviewed-on: https://gerrit.libreoffice.org/80312
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/valueparser.cxx b/configmgr/source/valueparser.cxx
index ceadf689f5b1..49ddba36fc27 100644
--- a/configmgr/source/valueparser.cxx
+++ b/configmgr/source/valueparser.cxx
@@ -63,11 +63,11 @@ bool parseHexDigit(char c, int * value) {
 
 bool parseValue(xmlreader::Span const & text, sal_Bool * value) {
 assert(text.is() && value != nullptr);
-if (text.equals("true") || text.equals("1")) {
+if (text == "true" || text == "1") {
 *value = true;
 return true;
 }
-if (text.equals("false") || text.equals("0")) {
+if (text == "false" || text == "0") {
 *value = false;
 return true;
 }
@@ -278,7 +278,7 @@ bool ValueParser::startElement(
 }
 switch (state_) {
 case State::Text:
-if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && name.equals("it") 
&&
+if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && name == "it" &&
 isListType(type_) && separator_.isEmpty())
 {
 pad_.clear();
@@ -290,7 +290,7 @@ bool ValueParser::startElement(
 [[fallthrough]];
 case State::IT:
 if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
-name.equals("unicode") &&
+name == "unicode" &&
 (type_ == TYPE_STRING || type_ == TYPE_STRING_LIST))
 {
 sal_Int32 scalar = -1;
@@ -301,7 +301,7 @@ bool ValueParser::startElement(
 break;
 }
 if (attrNsId == ParseManager::NAMESPACE_OOR &&
-attrLn.equals("scalar"))
+attrLn == "scalar")
 {
 if (!parseValue(reader.getAttributeValue(true), )) {
 scalar = -1;
diff --git a/configmgr/source/xcdparser.cxx b/configmgr/source/xcdparser.cxx
index a849e210b3b6..a069c6b99c6f 100644
--- a/configmgr/source/xcdparser.cxx
+++ b/configmgr/source/xcdparser.cxx
@@ -61,14 +61,14 @@ bool XcdParser::startElement(
 }
 switch (state_) {
 case STATE_START:
-if (nsId == ParseManager::NAMESPACE_OOR && name.equals("data")) {
+if (nsId == ParseManager::NAMESPACE_OOR && name == "data") {
 state_ = STATE_DEPENDENCIES;
 return true;
 }
 break;
 case STATE_DEPENDENCIES:
 if (nsId == xmlreader::XmlReader::NAMESPACE_NONE &&
-name.equals("dependency"))
+name == "dependency")
 {
 if (dependencyFile_.isEmpty()) {
 dependencyOptional_ = false;
@@ -81,12 +81,12 @@ bool XcdParser::startElement(
 }
 if (attrNsId == xmlreader::XmlReader::NAMESPACE_NONE &&
 //TODO: _OOR
-attrLn.equals("file"))
+attrLn == "file")
 {
 attrFile = reader.getAttributeValue(false);
 } else if ((attrNsId ==
 xmlreader::XmlReader::NAMESPACE_NONE) &&
-   attrLn.equals("optional"))
+   attrLn == "optional")
 {
 dependencyOptional_ = xmldata::parseBoolean(
 reader.getAttributeValue(true));
@@ -118,7 +118,7 @@ bool XcdParser::startElement(
 [[fallthrough]];
 case STATE_COMPONENTS:
 if (nsId == ParseManager::NAMESPACE_OOR &&
-name.equals("component-schema"))
+name == "component-schema")
 {
 nestedParser_ = new XcsParser(layer_, data_);
 nesting_ = 1;
@@ -126,7 +126,7 @@ bool XcdParser::startElement(
 reader, nsId, name, existingDependencies);
 }
 if (nsId == ParseManager::NAMESPACE_OOR &&
-(name.equals("component-data") || name.equals("items")))
+(name == 

[Libreoffice-commits] core.git: configmgr/source include/rtl

2019-09-27 Thread Stephan Bergmann (via logerrit)
 configmgr/source/writemodfile.cxx |   10 +-
 include/rtl/stringconcat.hxx  |3 +++
 2 files changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 9c9b1e95ae4c407cf0f462c4e1a64fcc303399d6
Author: Stephan Bergmann 
AuthorDate: Fri Sep 27 19:18:58 2019 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Sep 27 23:41:23 2019 +0200

Add conversion from rtl::OStringNumber to std::string_view

...and revert the relevant part of 2f5f45921b05904a4be1ff633be09c62cb44ff08
"support O(U)String::number() for fast string concatenation", as discussed 
in
the comments of that Gerrit change, now that
89bb0b0dcd8dc4656d0047cd10702d1c471c0fa1 "Deduplicate O(U)StringNumber
definitions; add toAsciiUpperCase" paved the way.

For consistency, also add conversion from rtl::OUStringNumber to
std::u16string_view, even if that remains unused as of now.

Change-Id: Ieb64bff0b59c22f3dec05c99fca5676b27a46e9a
Reviewed-on: https://gerrit.libreoffice.org/79750
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/configmgr/source/writemodfile.cxx 
b/configmgr/source/writemodfile.cxx
index d7fba8264b80..017e925dee48 100644
--- a/configmgr/source/writemodfile.cxx
+++ b/configmgr/source/writemodfile.cxx
@@ -155,19 +155,19 @@ void writeValueContent_(TempFile , sal_Bool value) 
{
 }
 
 void writeValueContent_(TempFile , sal_Int16 value) {
-handle.writeString(OString(OString::number(value)));
+handle.writeString(OString::number(value));
 }
 
 void writeValueContent_(TempFile , sal_Int32 value) {
-handle.writeString(OString(OString::number(value)));
+handle.writeString(OString::number(value));
 }
 
 void writeValueContent_(TempFile , sal_Int64 value) {
-handle.writeString(OString(OString::number(value)));
+handle.writeString(OString::number(value));
 }
 
 void writeValueContent_(TempFile , double value) {
-handle.writeString(OString(OString::number(value)));
+handle.writeString(OString::number(value));
 }
 
 void writeValueContent_(TempFile , const OUString& value) {
@@ -530,7 +530,7 @@ void writeValueContent(TempFile , 
std::u16string_view value) {
 {
 handle.writeString(convertToUtf8(value.substr(i, j - i)));
 handle.writeString("");
 i = j + 1;
 } else if (c == '\x0D') {
diff --git a/include/rtl/stringconcat.hxx b/include/rtl/stringconcat.hxx
index 7bbcb1cf680f..ae2048e80233 100644
--- a/include/rtl/stringconcat.hxx
+++ b/include/rtl/stringconcat.hxx
@@ -15,6 +15,7 @@
 #include "rtl/ustring.h"
 
 #include 
+#include 
 #include 
 
 #include 
@@ -334,6 +335,7 @@ template  struct 
OStringNumberBase
 rtl_str_toAsciiUpperCase_WithLength(buf, length);
 return std::move(*static_cast(this));
 }
+operator std::string_view() const { return std::string_view(buf, length); }
 char buf[nBufSize];
 sal_Int32 length;
 };
@@ -402,6 +404,7 @@ template  struct 
OUStringNumberBase
 rtl_ustr_toAsciiUpperCase_WithLength(buf, length);
 return std::move(*static_cast(this));
 }
+operator std::u16string_view() const { return std::u16string_view(buf, 
length); }
 sal_Unicode buf[nBufSize];
 sal_Int32 length;
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: configmgr/source

2019-06-12 Thread Ashod Nakashian (via logerrit)
 configmgr/source/access.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit 5ede6b3bca9d174c77d16a1bc182ab83eb963398
Author: Ashod Nakashian 
AuthorDate: Mon Jan 28 10:03:32 2019 -0500
Commit: Jan Holesovsky 
CommitDate: Wed Jun 12 09:45:12 2019 +0200

configmgr: support changing locale language

Change-Id: Ia8318ce8ca3ae9fdbd526e0d41861e2863fb9a94
Reviewed-on: https://gerrit.libreoffice.org/68262
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/73485
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky 

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index b2fcb3cf9ad0..6e8fc5227590 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -71,6 +71,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -1380,6 +1382,13 @@ rtl::Reference< ChildAccess > Access::getChild(OUString 
const & name) {
 locale.isEmpty(), "configmgr",
 ("access best-matching localized property value via \"*\""
  " with empty ; falling back to defaults"));
+
+// Since the locale given to us is the one used at initialization,
+// here we override it with the actual current-user's language to
+// support per-view localization in LOK.
+if (comphelper::LibreOfficeKit::isActive())
+locale = 
comphelper::LibreOfficeKit::getLanguageTag().getLanguage();
+
 if (!locale.isEmpty()) {
 // Find best match using an adaptation of RFC 4647 lookup matching
 // rules, removing "-" or "_" delimited segments from the end:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: configmgr/source

2019-05-13 Thread Michael Stahl (via logerrit)
 configmgr/source/dconf.cxx |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 5097d1cabc806ee99b068b678982e215950c4f11
Author: Michael Stahl 
AuthorDate: Mon May 13 11:27:28 2019 +0200
Commit: Michael Stahl 
CommitDate: Mon May 13 14:36:47 2019 +0200

configmgr: workaround GCC9 -Werror=sign-compare in static_assert

... which is quite unhelpful; any cast would have to make assumptions
about the size of types anyway...

Change-Id: I5f35d82eb35d1af36b5a572166cf863babf23d41
Reviewed-on: https://gerrit.libreoffice.org/72223
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/configmgr/source/dconf.cxx b/configmgr/source/dconf.cxx
index c2b8c2cd1efc..da351bd917a0 100644
--- a/configmgr/source/dconf.cxx
+++ b/configmgr/source/dconf.cxx
@@ -1174,7 +1174,7 @@ bool addProperty(
 css::uno::Sequence seq(
 value.get>());
 static_assert(
-std::numeric_limits::max() <= G_MAXSIZE,
+sizeof(sal_Int32) <= sizeof(gsize),
 "G_MAXSIZE too small");
 static_assert(
 sizeof (sal_Int8) == sizeof (guchar), "size mismatch");
@@ -1189,7 +1189,7 @@ bool addProperty(
 css::uno::Sequence seq(
 value.get>());
 static_assert(
-std::numeric_limits::max() <= G_MAXSIZE,
+sizeof(sal_Int32) <= sizeof(gsize),
 "G_MAXSIZE too small");
 static_assert(sizeof (sal_Bool) == 1, "size mismatch");
 v.reset(
@@ -1203,7 +1203,7 @@ bool addProperty(
 css::uno::Sequence seq(
 value.get>());
 static_assert(
-std::numeric_limits::max() <= G_MAXSIZE,
+sizeof(sal_Int32) <= sizeof(gsize),
 "G_MAXSIZE too small");
 static_assert(
 sizeof (sal_Int16) == sizeof (gint16), "size mismatch");
@@ -1219,7 +1219,7 @@ bool addProperty(
 css::uno::Sequence seq(
 value.get>());
 static_assert(
-std::numeric_limits::max() <= G_MAXSIZE,
+sizeof(sal_Int32) <= sizeof(gsize),
 "G_MAXSIZE too small");
 static_assert(
 sizeof (sal_Int32) == sizeof (gint32), "size mismatch");
@@ -1235,7 +1235,7 @@ bool addProperty(
 css::uno::Sequence seq(
 value.get>());
 static_assert(
-std::numeric_limits::max() <= G_MAXSIZE,
+sizeof(sal_Int32) <= sizeof(gsize),
 "G_MAXSIZE too small");
 static_assert(
 sizeof (sal_Int64) == sizeof (gint64), "size mismatch");
@@ -1251,7 +1251,7 @@ bool addProperty(
 css::uno::Sequence seq(
 value.get>());
 static_assert(
-std::numeric_limits::max() <= G_MAXSIZE,
+sizeof(sal_Int32) <= sizeof(gsize),
 "G_MAXSIZE too small");
 static_assert(
 sizeof (double) == sizeof (gdouble), "size mismatch");
@@ -1278,7 +1278,7 @@ bool addProperty(
 vs.push_back(children.front().get());
 }
 static_assert(
-std::numeric_limits::max() <= G_MAXSIZE,
+sizeof(sal_Int32) <= sizeof(gsize),
 "G_MAXSIZE too small");
 v.reset(
 g_variant_new_array(
@@ -1293,7 +1293,7 @@ bool addProperty(
 std::vector vs;
 for (sal_Int32 i = 0; i != seq.getLength(); ++i) {
 static_assert(
-std::numeric_limits::max() <= G_MAXSIZE,
+sizeof(sal_Int32) <= sizeof(gsize),
 "G_MAXSIZE too small");
 static_assert(
 sizeof (sal_Int8) == sizeof (guchar), "size mismatch");
@@ -1315,7 +1315,7 @@ bool addProperty(
 return false;
 }
 static_assert(
-std::numeric_limits::max() <= G_MAXSIZE,
+sizeof(sal_Int32) <= sizeof(gsize),
 "G_MAXSIZE too small");
 v.reset(
 g_variant_new_array(ty.get(), vs.data(), seq.getLength()));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: configmgr/source officecfg/registry

2019-04-12 Thread Stephan Bergmann (via logerrit)
 configmgr/source/xcdparser.cxx  |2 +-
 officecfg/registry/component-update.dtd |4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

New commits:
commit d644a561eeb3e6ceb943819895a40c461effdbe6
Author: Stephan Bergmann 
AuthorDate: Fri Apr 12 13:06:59 2019 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Apr 12 16:03:49 2019 +0200

Allow  in .xcd too

Can't remember a good reason not to.

Change-Id: Ie2c62783465b917696d19e66159b5862512c7a54
Reviewed-on: https://gerrit.libreoffice.org/70655
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/configmgr/source/xcdparser.cxx b/configmgr/source/xcdparser.cxx
index c5e8a9b017db..bc00b7b0b01d 100644
--- a/configmgr/source/xcdparser.cxx
+++ b/configmgr/source/xcdparser.cxx
@@ -127,7 +127,7 @@ bool XcdParser::startElement(
 reader, nsId, name, existingDependencies);
 }
 if (nsId == ParseManager::NAMESPACE_OOR &&
-name.equals("component-data"))
+(name.equals("component-data") || name.equals("items")))
 {
 nestedParser_ = new XcuParser(layer_ + 1, data_, nullptr, nullptr, 
nullptr);
 nesting_ = 1;
diff --git a/officecfg/registry/component-update.dtd 
b/officecfg/registry/component-update.dtd
index e2e5d77dee11..d99ee499249e 100644
--- a/officecfg/registry/component-update.dtd
+++ b/officecfg/registry/component-update.dtd
@@ -97,9 +97,7 @@
 
 
-
+
 
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: configmgr/source

2019-01-16 Thread Libreoffice Gerrit user
 configmgr/source/components.cxx |   12 ++--
 1 file changed, 2 insertions(+), 10 deletions(-)

New commits:
commit 939d744cee18642fec24d33436b211c92b8b46f8
Author: Stephan Bergmann 
AuthorDate: Tue Jan 15 19:05:35 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Jan 16 09:20:26 2019 +0100

Replace uses of rtl/instance.hxx with plain local static vars in configmgr

Change-Id: Iebd72f1cfd2b3af54efaabba04a89d043eef28c8
Reviewed-on: https://gerrit.libreoffice.org/66405
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index e584a3c98589..9587fde1e7a5 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -48,7 +48,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -196,19 +195,12 @@ void Components::WriteThread::execute() {
 reference_->clear();
 }
 
-class theComponentsSingleton :
-public rtl::StaticWithArg<
-Components,
-css::uno::Reference< css::uno::XComponentContext >,
-theComponentsSingleton>
-{
-};
-
 Components & Components::getSingleton(
 css::uno::Reference< css::uno::XComponentContext > const & context)
 {
 assert(context.is());
-return theComponentsSingleton::get(context);
+static Components singleton(context);
+return singleton;
 }
 
 bool Components::allLocales(OUString const & locale) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source include/rtl

2019-01-09 Thread Libreoffice Gerrit user
 configmgr/source/writemodfile.cxx |   20 ++--
 configmgr/source/writemodfile.hxx |9 +
 include/rtl/string.hxx|7 +++
 include/rtl/ustring.hxx   |8 
 4 files changed, 30 insertions(+), 14 deletions(-)

New commits:
commit dac7be50cff94e0c34cdca5ac7e35c19685c40c1
Author: Stephan Bergmann 
AuthorDate: Wed Jan 9 12:12:13 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Jan 10 08:27:04 2019 +0100

o3tl::string_view -> std::string_view (in configmgr)

Change-Id: I64131f59ce859a252baa9c84291d262bcb04fffd
Reviewed-on: https://gerrit.libreoffice.org/66012
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/configmgr/source/writemodfile.cxx 
b/configmgr/source/writemodfile.cxx
index b3592bb1a8af..2122c3fdf947 100644
--- a/configmgr/source/writemodfile.cxx
+++ b/configmgr/source/writemodfile.cxx
@@ -22,13 +22,13 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -60,7 +60,7 @@ class Components;
 
 namespace {
 
-OString convertToUtf8(o3tl::u16string_view text) {
+OString convertToUtf8(std::u16string_view text) {
 OString s;
 assert(text.size() <= sal_uInt32(std::numeric_limits::max()));
 if (!rtl_convertUStringToString(
@@ -140,7 +140,7 @@ oslFileError TempFile::flush() {
 return e;
 }
 
-void TempFile::writeString(o3tl::string_view text) {
+void TempFile::writeString(std::string_view text) {
 buffer.append(text.data(), text.size());
 if (buffer.getLength() > 0x1)
 flush();
@@ -186,8 +186,8 @@ void writeValueContent_(
 '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C',
 'D', 'E', 'F' };
 handle.writeString(
-o3tl::string_view(hexDigit + ((value[i] >> 4) & 0xF), 1));
-handle.writeString(o3tl::string_view(hexDigit + (value[i] & 0xF), 1));
+std::string_view(hexDigit + ((value[i] >> 4) & 0xF), 1));
+handle.writeString(std::string_view(hexDigit + (value[i] & 0xF), 1));
 }
 }
 
@@ -281,7 +281,7 @@ void writeValue(TempFile , Type type, css::uno::Any 
const & value) {
 
 void writeNode(
 Components & components, TempFile ,
-rtl::Reference< Node > const & parent, o3tl::u16string_view name,
+rtl::Reference< Node > const & parent, std::u16string_view name,
 rtl::Reference< Node > const & node)
 {
 static xmlreader::Span const typeNames[] = {
@@ -316,7 +316,7 @@ void writeNode(
 if (type != TYPE_NIL) {
 handle.writeString(" oor:type=\"");
 handle.writeString(
-o3tl::string_view(
+std::string_view(
 typeNames[type].begin, typeNames[type].length));
 handle.writeString("\"");
 }
@@ -359,7 +359,7 @@ void writeNode(
 if (type != TYPE_NIL) {
 handle.writeString(" oor:type=\"");
 handle.writeString(
-o3tl::string_view(
+std::string_view(
 typeNames[type].begin, typeNames[type].length));
 handle.writeString("\"");
 }
@@ -479,7 +479,7 @@ void writeModifications(
 
 }
 
-void writeAttributeValue(TempFile , o3tl::u16string_view value) {
+void writeAttributeValue(TempFile , std::u16string_view value) {
 std::size_t i = 0;
 std::size_t j = i;
 for (; j != value.size(); ++j) {
@@ -524,7 +524,7 @@ void writeAttributeValue(TempFile , 
o3tl::u16string_view value) {
 handle.writeString(convertToUtf8(value.substr(i, j - i)));
 }
 
-void writeValueContent(TempFile , o3tl::u16string_view value) {
+void writeValueContent(TempFile , std::u16string_view value) {
 std::size_t i = 0;
 std::size_t j = i;
 for (; j != value.size(); ++j) {
diff --git a/configmgr/source/writemodfile.hxx 
b/configmgr/source/writemodfile.hxx
index a8925ab8e758..435a24caf63f 100644
--- a/configmgr/source/writemodfile.hxx
+++ b/configmgr/source/writemodfile.hxx
@@ -22,7 +22,8 @@
 
 #include 
 
-#include 
+#include 
+
 #include 
 
 namespace configmgr {
@@ -43,15 +44,15 @@ struct TempFile {
 #ifdef _WIN32
 oslFileError closeWithoutUnlink();
 #endif
-void writeString(o3tl::string_view text);
+void writeString(std::string_view text);
 
 private:
 TempFile(const TempFile&) = delete;
 TempFile& operator=(const TempFile&) = delete;
 };
 
-void writeAttributeValue(TempFile , o3tl::u16string_view value);
-void writeValueContent(TempFile , o3tl::u16string_view value);
+void writeAttributeValue(TempFile , std::u16string_view value);
+void writeValueContent(TempFile , std::u16string_view value);
 
 void writeModFile(
 Components & components, OUString const & url, Data const & data);
diff --git a/include/rtl/string.hxx b/include/rtl/string.hxx
index 

[Libreoffice-commits] core.git: configmgr/source

2018-12-28 Thread Libreoffice Gerrit user
 configmgr/source/winreg.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 97b4ac005269ba35d87151b55abca6a91c9b5e5f
Author: Matteo Casalin 
AuthorDate: Sun Dec 9 16:37:34 2018 +0100
Commit: Matteo Casalin 
CommitDate: Fri Dec 28 16:52:18 2018 +0100

Use indexed getToken()

Change-Id: If5338305e1955c2cad2d9073fdd3f09d6bf55093
Reviewed-on: https://gerrit.libreoffice.org/65666
Tested-by: Jenkins
Reviewed-by: Matteo Casalin 

diff --git a/configmgr/source/winreg.cxx b/configmgr/source/winreg.cxx
index c7ba91fb205f..0fd372aa927a 100644
--- a/configmgr/source/winreg.cxx
+++ b/configmgr/source/winreg.cxx
@@ -211,9 +211,9 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & 
aKeyName, TempFile 
 sal_Int32 nCloseNode = 0;
 
 aFileHandle.writeString("https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2018-12-28 Thread Libreoffice Gerrit user
 configmgr/source/access.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 912666d7e5969aeec87163ad2b4083889008de18
Author: Andrea Gelmini 
AuthorDate: Mon Dec 17 21:29:58 2018 +0100
Commit: Julien Nabet 
CommitDate: Fri Dec 28 10:00:55 2018 +0100

Fix typo

Change-Id: Iabf8ef0fb5b9fd1d768b705b62db9083cec592c8
Reviewed-on: https://gerrit.libreoffice.org/65653
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 7bbd1b05e287..90d95ec87759 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -1381,7 +1381,7 @@ rtl::Reference< ChildAccess > Access::getChild(OUString 
const & name) {
 ("access best-matching localized property value via \"*\""
  " with empty ; falling back to defaults"));
 if (!locale.isEmpty()) {
-// Find best match using an adaption of RFC 4647 lookup matching
+// Find best match using an adaptation of RFC 4647 lookup matching
 // rules, removing "-" or "_" delimited segments from the end:
 for (;;) {
 rtl::Reference< ChildAccess > child(getChild(locale));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2018-05-09 Thread Stephan Bergmann
 configmgr/source/dconf.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 536bd91e1910ea4cc9aeea123b00785b76063984
Author: Stephan Bergmann 
Date:   Wed May 9 12:15:09 2018 +0200

Missing template clone() in configmgr dconf mode

...that could cause infinite recursion, e.g. when an erroneously modified
/org.openoffice.ucb.Hierarchy/Entry template (which recursively has 
children of
the same template type) is later used to instantiate a new set member.

Change-Id: I7b9e55fa1c92979aed98b9f23f4432600afffed4
Reviewed-on: https://gerrit.libreoffice.org/54023
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/configmgr/source/dconf.cxx b/configmgr/source/dconf.cxx
index 22c80841addf..642e37ec0257 100644
--- a/configmgr/source/dconf.cxx
+++ b/configmgr/source/dconf.cxx
@@ -938,6 +938,7 @@ void readDir(
 << templ);
 continue;
 }
+member = member->clone(true);
 break;
 default:
 assert(false); // cannot happen
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2018-05-09 Thread Andras Timar
 configmgr/source/winreg.cxx |   37 +++--
 1 file changed, 35 insertions(+), 2 deletions(-)

New commits:
commit c9a81876ee0ba173af107fda6a831d5a2cbb61de
Author: Andras Timar 
Date:   Mon May 7 12:23:02 2018 -0700

Add possibility to read  from winreg conf backend

Change-Id: I67bc14d7ee1bacc15d34e6ee25ca7638de268643
Reviewed-on: https://gerrit.libreoffice.org/53942
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/53943
Tested-by: Jenkins 
Reviewed-by: Andras Timar 

diff --git a/configmgr/source/winreg.cxx b/configmgr/source/winreg.cxx
index eda41482a032..c7ba91fb205f 100644
--- a/configmgr/source/winreg.cxx
+++ b/configmgr/source/winreg.cxx
@@ -34,7 +34,8 @@ namespace {
 // Last element of Key becomes prop, first part is the path and optionally 
nodes,
 // when the node has oor:op attribute.
 // Values can be the following: Value (string), Type (string, optional),
-// Final (dword, optional), External (dword, optional), ExternalBackend 
(string, optional)
+// Final (dword, optional), External (dword, optional), ExternalBackend 
(string, optional),
+// Nil (dword, optional)
 //
 // For example the following registry setting:
 // 
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\LibreOffice\org.openoffice.UserProfile\Data\o]
@@ -89,6 +90,28 @@ namespace {
 // 
 // 
 // 
+//
+// Nil example:
+// Empty value () and nil value () are 
different.
+// In case of some path settings, the base path setting has to be cleared.
+// 
[HKEY_CURRENT_USER\Software\Policies\LibreOffice\org.openoffice.Office.Common\Path\Current\Work]
+// "Value"=""
+// "Final"=dword:0001
+// "Nil"=dword:0001
+// 
[HKEY_CURRENT_USER\Software\Policies\LibreOffice\org.openoffice.Office.Paths\Paths\org.openoffice.Office.Paths:NamedPath['Work']\WritePath]
+// "Value"="file:///H:/"
+// "Final"=dword:0001
+// becomes the following in configuration:
+// 
+// 
+// 
+//  
+// 
+// 
+// 
+// file:///H:/
+// 
+//  
 
 void dumpWindowsRegistryKey(HKEY hKey, OUString const & aKeyName, TempFile 
)
 {
@@ -136,6 +159,7 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & 
aKeyName, TempFile 
 
 bool bFinal = false;
 bool bExternal = false;
+bool bNil = false;
 OUString aValue;
 OUString aType;
 OUString aExternalBackend;
@@ -156,6 +180,11 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & 
aKeyName, TempFile 
 if (*reinterpret_cast(pValue.get()) == 1)
 bFinal = true;
 }
+else if (!wcscmp(pValueName.get(), L"Nil"))
+{
+if (*reinterpret_cast(pValue.get()) == 1)
+bNil = true;
+}
 else if (!wcscmp(pValueName.get(), L"External"))
 {
 if (*reinterpret_cast(pValue.get()) == 1)
@@ -231,7 +260,11 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & 
aKeyName, TempFile 
 if(bFinal)
 aFileHandle.writeString(" oor:finalized=\"true\"");
 aFileHandle.writeString(">

[Libreoffice-commits] core.git: configmgr/source

2018-04-25 Thread Mike Kaganski
 configmgr/source/winreg.cxx |   17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

New commits:
commit 8776a895d41f174bf5d86332093ed5795c73bdd6
Author: Mike Kaganski 
Date:   Tue Apr 24 16:01:56 2018 +0100

Winreg config layer: Allow to define external backend separately

Defining backend separately allows e.g. creating ADMX templates with
easy-to-use UI, where user defines only LDAP names for the setting, and
doesn't need to type the LO configuration backend name.

Change-Id: I64f23043c94a5a4e0ba7281d0f711a427d694126
Reviewed-on: https://gerrit.libreoffice.org/53413
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/configmgr/source/winreg.cxx b/configmgr/source/winreg.cxx
index 59cd575efe68..eda41482a032 100644
--- a/configmgr/source/winreg.cxx
+++ b/configmgr/source/winreg.cxx
@@ -34,7 +34,7 @@ namespace {
 // Last element of Key becomes prop, first part is the path and optionally 
nodes,
 // when the node has oor:op attribute.
 // Values can be the following: Value (string), Type (string, optional),
-// Final (dword, optional), External (dword, optional)
+// Final (dword, optional), External (dword, optional), ExternalBackend 
(string, optional)
 //
 // For example the following registry setting:
 // 
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\LibreOffice\org.openoffice.UserProfile\Data\o]
@@ -79,9 +79,10 @@ namespace {
 //
 // External (component data) example:
 // 
[HKEY_CURRENT_USER\Software\Policies\LibreOffice\org.openoffice.UserProfile\Data\o]
-// "Value"="com.sun.star.configuration.backend.LdapUserProfileBe company"
+// "Value"="company"
 // "Final"=dword:0001
 // "External"=dword:0001
+// "ExternalBackend"="com.sun.star.configuration.backend.LdapUserProfileBe"
 // becomes the following in configuration:
 // 
 // 
@@ -137,6 +138,7 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & 
aKeyName, TempFile 
 bool bExternal = false;
 OUString aValue;
 OUString aType;
+OUString aExternalBackend;
 
 for(DWORD i = 0; i < nValues; ++i)
 {
@@ -159,11 +161,20 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & 
aKeyName, TempFile 
 if (*reinterpret_cast(pValue.get()) == 1)
 bExternal = true;
 }
+else if (!wcscmp(pValueName.get(), L"ExternalBackend"))
+aExternalBackend = o3tl::toU(pValue.get());
 }
-// type and external are mutually exclusive
 if (bExternal)
+{
+// type and external are mutually exclusive
 aType.clear();
 
+// Prepend backend, like in
+// "com.sun.star.configuration.backend.LdapUserProfileBe 
company"
+if (!aExternalBackend.isEmpty())
+aValue = aExternalBackend + " " + aValue;
+}
+
 sal_Int32 aLastSeparator = aKeyName.lastIndexOf('\\');
 OUString aPathAndNodes = aKeyName.copy(0, aLastSeparator);
 OUString aProp = aKeyName.copy(aLastSeparator + 1);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2018-04-04 Thread Stephan Bergmann
 configmgr/source/components.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit 8bd827c976037381be963d4ef99bfb9a2d720889
Author: Stephan Bergmann 
Date:   Wed Apr 4 15:44:40 2018 +0200

Ignore dangling symlink configuration files

This will be used by the Flatpak build, to offload per-locale data to a 
Locale
extension (which expects all per-locale files to be in one place, so we 
need to
add---potentially dangling, if a given locale is not installed---symlinks 
from
the original places to the location where that Locale extension stores the
actual files).

Change-Id: Id13b8c53fbc9e0763e53fd09c0c059c9e638c13d
Reviewed-on: https://gerrit.libreoffice.org/52381
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index 3f99191bb2d4..e296f8dfa8de 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -708,6 +708,10 @@ void Components::parseFiles(
 parseFileLeniently(
 parseFile, stat.getFileURL(), layer, nullptr, nullptr, 
nullptr);
 } catch (css::container::NoSuchElementException & e) {
+if (stat.getFileType() == osl::FileStatus::Link) {
+SAL_WARN("configmgr", "dangling link <" << 
stat.getFileURL() << ">");
+continue;
+}
 throw css::uno::RuntimeException(
 "stat'ed file does not exist: " + e.Message);
 }
@@ -784,6 +788,10 @@ void Components::parseXcdFiles(int layer, OUString const & 
url) {
 stat.getFileURL(),
 new XcdParser(layer, processedDeps, data_));
 } catch (css::container::NoSuchElementException & e) {
+if (stat.getFileType() == osl::FileStatus::Link) {
+SAL_WARN("configmgr", "dangling link <" << 
stat.getFileURL() << ">");
+continue;
+}
 throw css::uno::RuntimeException(
 "stat'ed file does not exist: " + e.Message);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2018-02-08 Thread Stephan Bergmann
 configmgr/source/access.cxx |   13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

New commits:
commit a26adf6679aa13dc5821047f6aa1f05e7d0d00fd
Author: Stephan Bergmann 
Date:   Thu Feb 8 09:07:32 2018 +0100

Better return nil than an arbitrary xml:lang="..." value

...for a localized property that doesn't have a suitable value, but is 
nillable.

E.g., 
/org.openoffice.Office.Writer/Insert/Caption/CaptionOrderNumberingFirst
(once fixed to indeed be a localized property as apparently intended, with a
follow-up commit to this) only has an explicit value (true) for 
xml:lang="hu",
but shouldn't return that for any other locale (where the implicit default 
for a
nil value should instead be false, cf. the else branch at the end of
SwInsertConfig::Load, sw/source/uibase/config/modcfg.cxx).

Change-Id: I7b991c1bc4df22bf2359175b0734e85e0844ce99
Reviewed-on: https://gerrit.libreoffice.org/49409
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 0d19af353b49..718f6339967b 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -1430,9 +1430,8 @@ rtl::Reference< ChildAccess > Access::getChild(OUString 
const & name) {
 }
 }
 }
-// Defaults are the "en-US" locale, the "en" locale, the empty string
-// locale, the first child (if any), or a null ChildAccess, in that
-// order:
+// Defaults are the "en-US" locale, the "en" locale, the empty string 
locale, the first child (if
+// any, and if the property is non-nillable), or a null ChildAccess, 
in that order:
 rtl::Reference< ChildAccess > child(getChild("en-US"));
 if (child.is()) {
 return child;
@@ -1445,9 +1444,11 @@ rtl::Reference< ChildAccess > Access::getChild(OUString 
const & name) {
 if (child.is()) {
 return child;
 }
-std::vector< rtl::Reference< ChildAccess > > 
children(getAllChildren());
-if (!children.empty()) {
-return children.front();
+if (!static_cast(getNode().get())->isNillable()) {
+std::vector< rtl::Reference< ChildAccess > > 
children(getAllChildren());
+if (!children.empty()) {
+return children.front();
+}
 }
 return rtl::Reference< ChildAccess >();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source include/unotools unotools/source

2017-11-05 Thread Julien Nabet
 configmgr/source/additions.hxx  |3 --
 include/unotools/configmgr.hxx  |4 +-
 unotools/source/config/configmgr.cxx|   18 +++-
 unotools/source/misc/desktopterminationobserver.cxx |   30 
 4 files changed, 15 insertions(+), 40 deletions(-)

New commits:
commit 3ae605f8b93df426236eed359814449589033a79
Author: Julien Nabet 
Date:   Sat Nov 4 17:45:25 2017 +0100

Replace lists by vectors in configmgr/unotools

+ use for range loops

Change-Id: I4cebcf0536dc6c3ddfdce9532e94c0c380ea3ab9
Reviewed-on: https://gerrit.libreoffice.org/44308
Tested-by: Jenkins 
Reviewed-by: Julien Nabet 

diff --git a/configmgr/source/additions.hxx b/configmgr/source/additions.hxx
index 1bc779e2fcea..d7394411b1e0 100644
--- a/configmgr/source/additions.hxx
+++ b/configmgr/source/additions.hxx
@@ -22,12 +22,11 @@
 
 #include 
 
-#include 
 #include 
 
 namespace configmgr {
 // Additions is a list of configuration node paths
-typedef std::list< std::vector > Additions;
+typedef std::vector< std::vector > Additions;
 
 }
 
diff --git a/include/unotools/configmgr.hxx b/include/unotools/configmgr.hxx
index c74305b3c6b1..fe6a13545ed0 100644
--- a/include/unotools/configmgr.hxx
+++ b/include/unotools/configmgr.hxx
@@ -22,7 +22,7 @@
 
 #include 
 
-#include 
+#include 
 
 #include 
 #include 
@@ -84,7 +84,7 @@ private:
 
 void doStoreConfigItems();
 
-std::list< ConfigItem * > items_;
+std::vector< ConfigItem * > items_;
 };
 
 }
diff --git a/unotools/source/config/configmgr.cxx 
b/unotools/source/config/configmgr.cxx
index f8b5e891cb02..5dd1dc7ee3f8 100644
--- a/unotools/source/config/configmgr.cxx
+++ b/unotools/source/config/configmgr.cxx
@@ -177,14 +177,7 @@ utl::ConfigManager::addConfigItem(utl::ConfigItem & item) {
 }
 
 void utl::ConfigManager::removeConfigItem(utl::ConfigItem & item) {
-for (std::list< ConfigItem * >::iterator i(items_.begin());
- i != items_.end(); ++i)
-{
-if (*i == ) {
-items_.erase(i);
-break;
-}
-}
+items_.erase(std::remove(items_.begin(), items_.end(), ), 
items_.end());
 }
 
 void utl::ConfigManager::registerConfigItem(utl::ConfigItem * item) {
@@ -193,12 +186,11 @@ void 
utl::ConfigManager::registerConfigItem(utl::ConfigItem * item) {
 }
 
 void utl::ConfigManager::doStoreConfigItems() {
-for (std::list< ConfigItem * >::iterator i(items_.begin());
- i != items_.end(); ++i)
+for (auto const& item : items_)
 {
-if ((*i)->IsModified()) {
-(*i)->Commit();
-(*i)->ClearModified();
+if (item->IsModified()) {
+item->Commit();
+item->ClearModified();
 }
 }
 }
diff --git a/unotools/source/misc/desktopterminationobserver.cxx 
b/unotools/source/misc/desktopterminationobserver.cxx
index 1de3530b917f..2984324caa87 100644
--- a/unotools/source/misc/desktopterminationobserver.cxx
+++ b/unotools/source/misc/desktopterminationobserver.cxx
@@ -26,7 +26,7 @@
 #include 
 #include 
 
-#include 
+#include 
 
 namespace utl
 {
@@ -38,7 +38,7 @@ namespace utl
 namespace
 {
 
-typedef ::std::list< ITerminationListener* > Listeners;
+typedef ::std::vector< ITerminationListener* > Listeners;
 
 struct ListenerAdminData
 {
@@ -113,12 +113,9 @@ namespace utl
 aToNotify = getListenerAdminData().aListeners;
 }
 
-for ( Listeners::const_iterator listener = aToNotify.begin();
-  listener != aToNotify.end();
-  ++listener
-)
+for (auto const& listener : aToNotify)
 {
-if ( !(*listener)->queryTermination() )
+if ( !listener->queryTermination() )
 throw TerminationVetoException();
 }
 }
@@ -135,12 +132,9 @@ namespace utl
 }
 
 // notify the listeners
-for ( Listeners::const_iterator listener = aToNotify.begin();
-  listener != aToNotify.end();
-  ++listener
-)
+for (auto const& listener : aToNotify)
 {
-(*listener)->notifyTermination();
+listener->notifyTermination();
 }
 
 // clear the listener container
@@ -185,17 +179,7 @@ namespace utl
 {
 ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
 Listeners& rListeners = getListenerAdminData().aListeners;
-for ( Listeners::iterator lookup = rListeners.begin();
-  lookup != rListeners.end();
-  ++lookup
-  )
-{
-if ( *lookup == _pListener )
-{
-rListeners.erase( lookup );
-break;
-}
-}
+

[Libreoffice-commits] core.git: configmgr/source

2017-11-02 Thread Mike Kaganski
 configmgr/source/winreg.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 05d15643c40b571059f8a9474cbf0c5056e40873
Author: Mike Kaganski 
Date:   Thu Nov 2 11:01:59 2017 +0300

Winreg configuration layer: don't assert on user input

Change-Id: I1314e37315450ead3bf131ed3fabd9351a88a4e5
Reviewed-on: https://gerrit.libreoffice.org/44191
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/configmgr/source/winreg.cxx b/configmgr/source/winreg.cxx
index ea24c0ebacb4..e9c6e8359510 100644
--- a/configmgr/source/winreg.cxx
+++ b/configmgr/source/winreg.cxx
@@ -167,7 +167,8 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & 
aKeyName, TempFile 
 }
 }
 // type and external are mutually exclusive
-assert(aType.isEmpty() || !bExternal);
+if (bExternal)
+aType.clear();
 
 sal_Int32 aLastSeparator = aKeyName.lastIndexOf('\\');
 OUString aPathAndNodes = aKeyName.copy(0, aLastSeparator);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2017-11-01 Thread Mike Kaganski
 configmgr/source/winreg.cxx |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 5a5953b90cd2ba5eaeddc9ba450e3f3ac9dd771a
Author: Mike Kaganski 
Date:   Wed Nov 1 11:19:24 2017 +0300

Winreg configuration layer: use writeAttributeValue for oox:external

Change-Id: Ib15250c738f98b26adf9745d453a8d22189b271e
Reviewed-on: https://gerrit.libreoffice.org/44153
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/configmgr/source/winreg.cxx b/configmgr/source/winreg.cxx
index 81fc4b43ea0d..ea24c0ebacb4 100644
--- a/configmgr/source/winreg.cxx
+++ b/configmgr/source/winreg.cxx
@@ -226,17 +226,17 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & 
aKeyName, TempFile 
 aFileHandle.writeString(" oor:finalized=\"true\"");
 aFileHandle.writeString(">");
-
-writeValueContent(aFileHandle, aValue);
-
-if (bExternal)
+writeAttributeValue(aFileHandle, aValue);
 aFileHandle.writeString("\"/");
+}
 else
+{
+aFileHandle.writeString(">");
+writeValueContent(aFileHandle, aValue);
 aFileHandle.writeString("");
 for(; nCloseNode > 0; nCloseNode--)
 aFileHandle.writeString("");
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2017-11-01 Thread Mike Kaganski
 configmgr/source/winreg.cxx |   53 +++-
 1 file changed, 43 insertions(+), 10 deletions(-)

New commits:
commit ce8536ad3cfd00242c4fa7642e59374c0c5812f3
Author: Mike Kaganski 
Date:   Wed Nov 1 08:17:55 2017 +0300

Winreg configuration layer: support oox:external values

Change-Id: Ie03cd4e351de62bf298009e220ed25338dc42f62
Reviewed-on: https://gerrit.libreoffice.org/44148
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/configmgr/source/winreg.cxx b/configmgr/source/winreg.cxx
index 773775dfde92..81fc4b43ea0d 100644
--- a/configmgr/source/winreg.cxx
+++ b/configmgr/source/winreg.cxx
@@ -39,7 +39,8 @@ namespace {
 // This is not a generic registry reader. We assume the following structure:
 // Last element of Key becomes prop, first part is the path and optionally 
nodes,
 // when the node has oor:op attribute.
-// Values can be the following: Value (string) and Final (dword, optional)
+// Values can be the following: Value (string), Type (string, optional),
+// Final (dword, optional), External (dword, optional)
 //
 // For example the following registry setting:
 // 
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\LibreOffice\org.openoffice.UserProfile\Data\o]
@@ -81,6 +82,18 @@ namespace {
 // false
 // 
 // 
+//
+// External (component data) example:
+// 
[HKEY_CURRENT_USER\Software\Policies\LibreOffice\org.openoffice.UserProfile\Data\o]
+// "Value"="com.sun.star.configuration.backend.LdapUserProfileBe company"
+// "Final"=dword:0001
+// "External"=dword:0001
+// becomes the following in configuration:
+// 
+// 
+// 
+// 
+// 
 
 void dumpWindowsRegistryKey(HKEY hKey, OUString const & aKeyName, TempFile 
)
 {
@@ -127,6 +140,7 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & 
aKeyName, TempFile 
 new wchar_t[nLongestValueLen/sizeof(wchar_t) + 1]);
 
 bool bFinal = false;
+bool bExternal = false;
 OUString aValue;
 OUString aType;
 
@@ -136,17 +150,25 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & 
aKeyName, TempFile 
 DWORD nValueLen = nLongestValueLen + 1;
 
 RegEnumValueW(hCurKey, i, pValueName.get(), , 
nullptr, nullptr, reinterpret_cast(pValue.get()), );
-const wchar_t wsValue[] = L"Value";
-const wchar_t wsFinal[] = L"Final";
-const wchar_t wsType[] = L"Type";
 
-if(!wcscmp(pValueName.get(), wsValue))
+if (!wcscmp(pValueName.get(), L"Value"))
 aValue = o3tl::toU(pValue.get());
-else if (!wcscmp(pValueName.get(), wsType))
+else if (!wcscmp(pValueName.get(), L"Type"))
 aType = o3tl::toU(pValue.get());
-else if(!wcscmp(pValueName.get(), wsFinal) && 
*reinterpret_cast(pValue.get()) == 1)
-bFinal = true;
+else if (!wcscmp(pValueName.get(), L"Final"))
+{
+if (*reinterpret_cast(pValue.get()) == 1)
+bFinal = true;
+}
+else if (!wcscmp(pValueName.get(), L"External"))
+{
+if (*reinterpret_cast(pValue.get()) == 1)
+bExternal = true;
+}
 }
+// type and external are mutually exclusive
+assert(aType.isEmpty() || !bExternal);
+
 sal_Int32 aLastSeparator = aKeyName.lastIndexOf('\\');
 OUString aPathAndNodes = aKeyName.copy(0, aLastSeparator);
 OUString aProp = aKeyName.copy(aLastSeparator + 1);
@@ -202,9 +224,20 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & 
aKeyName, TempFile 
 }
 if(bFinal)
 aFileHandle.writeString(" oor:finalized=\"true\"");
-aFileHandle.writeString(">");
+aFileHandle.writeString(">");
+
 writeValueContent(aFileHandle, aValue);
-aFileHandle.writeString("");
+
+if (bExternal)
+aFileHandle.writeString("\"/");
+else
+aFileHandle.writeString("");
 for(; nCloseNode > 0; nCloseNode--)
 aFileHandle.writeString("");
 aFileHandle.writeString("\n");
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2017-10-31 Thread Andras Timar
 configmgr/source/winreg.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e90329ff3896cf33528b47830f49fcd05590bd6a
Author: Andras Timar 
Date:   Tue Oct 31 23:40:06 2017 +0100

typo: xs::boolean -> xs:boolean

Change-Id: I4a7df6bf56a5b8367d3717fc4e48b535e829e96f

diff --git a/configmgr/source/winreg.cxx b/configmgr/source/winreg.cxx
index 995202806931..773775dfde92 100644
--- a/configmgr/source/winreg.cxx
+++ b/configmgr/source/winreg.cxx
@@ -77,7 +77,7 @@ namespace {
 // "Type"="xs:boolean"
 // becomes the following in configuration:
 // 
-// 
+// 
 // false
 // 
 // 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source helpcompiler/inc helpcompiler/source idl/inc idl/source include/helpcompiler mysqlc/source opencl/inc xmlscript/source

2017-10-30 Thread Noel Grandin
 configmgr/source/components.cxx |2 +-
 configmgr/source/components.hxx |2 +-
 helpcompiler/inc/BasCodeTagger.hxx  |2 +-
 helpcompiler/source/BasCodeTagger.cxx   |2 +-
 helpcompiler/source/HelpIndexer.cxx |2 +-
 idl/inc/database.hxx|2 +-
 idl/inc/slot.hxx|4 ++--
 idl/inc/types.hxx   |2 +-
 idl/source/objects/slot.cxx |4 ++--
 idl/source/objects/types.cxx|2 +-
 idl/source/prj/database.cxx |3 ++-
 include/helpcompiler/HelpIndexer.hxx|8 
 mysqlc/source/mysqlc_connection.hxx |2 +-
 opencl/inc/opencl_device_selection.h|2 +-
 xmlscript/source/xmldlg_imexp/imp_share.hxx |8 
 xmlscript/source/xmldlg_imexp/xmldlg_import.cxx |2 +-
 16 files changed, 25 insertions(+), 24 deletions(-)

New commits:
commit 9ee60319c675087486907707c8a2b18b5c9dc9fc
Author: Noel Grandin 
Date:   Mon Oct 30 11:45:58 2017 +0200

loplugin:constmethod in idl,helpcompiler

Change-Id: I9b328fc0a3ebdd15a646ee6dab800ffbadb1aaef
Reviewed-on: https://gerrit.libreoffice.org/44050
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index ddbebe103e60..5354763b0c95 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -878,7 +878,7 @@ void Components::parseModificationLayer(int layer, OUString 
const & url) {
 }
 }
 
-int Components::getExtensionLayer(bool shared) {
+int Components::getExtensionLayer(bool shared) const {
 int layer = shared ? sharedExtensionLayer_ : userExtensionLayer_;
 if (layer == -1) {
 throw css::uno::RuntimeException(
diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx
index fc10060e0845..5006c864acdc 100644
--- a/configmgr/source/components.hxx
+++ b/configmgr/source/components.hxx
@@ -139,7 +139,7 @@ private:
 
 void parseModificationLayer(int layer, OUString const & url);
 
-int getExtensionLayer(bool shared);
+int getExtensionLayer(bool shared) const;
 
 typedef std::set< RootAccess * > WeakRootSet;
 
diff --git a/helpcompiler/inc/BasCodeTagger.hxx 
b/helpcompiler/inc/BasCodeTagger.hxx
index ae180fa7451c..d8dbffa4cd49 100644
--- a/helpcompiler/inc/BasCodeTagger.hxx
+++ b/helpcompiler/inc/BasCodeTagger.hxx
@@ -56,7 +56,7 @@ class L10N_DLLPUBLIC LibXmlTreeWalker
 LibXmlTreeWalker( xmlDocPtr doc );
 void nextNode();
 xmlNodePtr currentNode() { return m_pCurrentNode;}
-bool end();
+bool end() const;
 void ignoreCurrNodesChildren();
 };
 
diff --git a/helpcompiler/source/BasCodeTagger.cxx 
b/helpcompiler/source/BasCodeTagger.cxx
index b472ac6dc2b6..20a4f1bb8061 100644
--- a/helpcompiler/source/BasCodeTagger.cxx
+++ b/helpcompiler/source/BasCodeTagger.cxx
@@ -43,7 +43,7 @@ void LibXmlTreeWalker::ignoreCurrNodesChildren()
   m_Queue.pop_back();
 }
 
-bool LibXmlTreeWalker::end()
+bool LibXmlTreeWalker::end() const
 {
 return m_pCurrentNode->next == nullptr && m_Queue.empty();
 }
diff --git a/helpcompiler/source/HelpIndexer.cxx 
b/helpcompiler/source/HelpIndexer.cxx
index 5e016fb0ff6e..51966f4c71dc 100644
--- a/helpcompiler/source/HelpIndexer.cxx
+++ b/helpcompiler/source/HelpIndexer.cxx
@@ -110,7 +110,7 @@ bool HelpIndexer::scanForFiles(OUString const & path) {
 return true;
 }
 
-void HelpIndexer::helpDocument(OUString const & fileName, Document *doc) {
+void HelpIndexer::helpDocument(OUString const & fileName, Document *doc) const 
{
 // Add the help path as an indexed, untokenized field.
 
 OUString path = "#HLP#" + d_module + "/" + fileName;
diff --git a/idl/inc/database.hxx b/idl/inc/database.hxx
index 2d48204b5f57..bc4ef2a5e27e 100644
--- a/idl/inc/database.hxx
+++ b/idl/inc/database.hxx
@@ -112,7 +112,7 @@ public:
 voidSetPath(const OUString ) { aPath = s; }
 SvRefMemberList& GetStack() { return aContextStack; }
 
-voidWrite(const OString& rText);
+voidWrite(const OString& rText) const;
 voidWriteError( SvTokenStream & rInStm );
 voidSetError( const OString& rError, SvToken const & 
rTok );
 voidSetAndWriteError( SvTokenStream & rInStm, const 
OString& rError );
diff --git a/idl/inc/slot.hxx b/idl/inc/slot.hxx
index d9ac77a591f5..1aa6ebca6913 100644
--- a/idl/inc/slot.hxx
+++ b/idl/inc/slot.hxx
@@ -120,7 +120,7 @@ public:
 virtual voidInsert( SvSlotElementList& ) override;
 voidWriteSlotStubs( const OString& rShellName,
 ByteStringList & rList,
-

[Libreoffice-commits] core.git: configmgr/source

2017-10-12 Thread Julien Nabet
 configmgr/source/components.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit a5a905e7ff2e3a19020b6c486e77695aece71b8c
Author: Julien Nabet 
Date:   Thu Oct 12 23:55:20 2017 +0200

Replace list by vector in components (configmgr)

Change-Id: I772b9b1b1d8fdbbc1dc7e38904490a6533686a90
Reviewed-on: https://gerrit.libreoffice.org/43353
Tested-by: Jenkins 
Reviewed-by: Julien Nabet 

diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index 3b4111bc0fb9..7459ef4e5d45 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -23,7 +23,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 #include 
@@ -79,17 +79,17 @@ namespace configmgr {
 
 namespace {
 
-struct UnresolvedListItem {
+struct UnresolvedVectorItem {
 OUString name;
 rtl::Reference< ParseManager > manager;
 
-UnresolvedListItem(
+UnresolvedVectorItem(
 OUString const & theName,
 rtl::Reference< ParseManager > const & theManager):
 name(theName), manager(theManager) {}
 };
 
-typedef std::list< UnresolvedListItem > UnresolvedList;
+typedef std::vector< UnresolvedVectorItem > UnresolvedVector;
 
 void parseXcsFile(
 OUString const & url, int layer, Data & data, Partial const * partial,
@@ -750,7 +750,7 @@ void Components::parseXcdFiles(int layer, OUString const & 
url) {
 throw css::uno::RuntimeException(
 "cannot open directory " + url);
 }
-UnresolvedList unres;
+UnresolvedVector unres;
 std::set< OUString > existingDeps;
 std::set< OUString > processedDeps;
 for (;;) {
@@ -794,7 +794,7 @@ void Components::parseXcdFiles(int layer, OUString const & 
url) {
 }
 while (!unres.empty()) {
 bool isResolved = false;
-for (UnresolvedList::iterator i(unres.begin()); i != unres.end();) {
+for (UnresolvedVector::iterator i(unres.begin()); i != unres.end();) {
 if (i->manager->parse()) {
 processedDeps.insert(i->name);
 i = unres.erase(i);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source include/rtl sal/rtl sal/textenc sax/source stoc/source svtools/source tools/source

2017-09-13 Thread Stephan Bergmann
 configmgr/source/access.cxx   |4 -
 include/rtl/character.hxx |   27 
++
 sal/rtl/uri.cxx   |5 -
 sal/rtl/ustrbuf.cxx   |2 
 sal/textenc/tcvtutf8.cxx  |5 -
 sax/source/expatwrap/saxwriter.cxx|4 -
 stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx |4 -
 svtools/source/svrtf/svparser.cxx |2 
 tools/source/fsys/urlobj.cxx  |6 --
 9 files changed, 40 insertions(+), 19 deletions(-)

New commits:
commit 3f0fba004badec01e536ca0fe2889e7e0bb93d7a
Author: Stephan Bergmann 
Date:   Wed Sep 13 13:35:49 2017 +0200

New rtl::isUnicodeScalarValue, rtl::isSurrogate

There are apparently various places that want to check for a Unicode scalar
value rather than for a Unicode code point.  Changed those uses of
rtl::isUnicodeCodePoint where that was obvious.  (For changing
svtools/source/svrtf/svparser.cxx see 
8e0fb74dc01927b60d8b868548ef8fe1d7a80ce3
"Revert 'svtools: HTML import: don't put lone surrogates in OUString'".)  
Other
uses of rtl::isUnicodeCodePoint might also want to use 
rtl::isUnicodeScalarValue
instead.

As a side effect, this change also introduces rtl::isSurrogate, which is 
useful
in a few places as well.

Change-Id: I9245f4f98b83877145a4d392f0ddb7c5d824a535

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 6eb692cc5430..0d19af353b49 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -113,8 +113,8 @@ bool isValidName(OUString const & name, bool setMember) {
 for (sal_Int32 i = 0; i != name.getLength();) {
 sal_uInt32 c = name.iterateCodePoints();
 if ((c < 0x20 && !(c == 0x09 || c == 0x0A || c == 0x0D))
-|| rtl::isHighSurrogate(c) || rtl::isLowSurrogate(c) || c == 0xFFFE
-|| c == 0x || (!setMember && c == '/'))
+|| rtl::isSurrogate(c) || c == 0xFFFE || c == 0x
+|| (!setMember && c == '/'))
 {
 return false;
 }
diff --git a/include/rtl/character.hxx b/include/rtl/character.hxx
index b83121a4a6d4..ee26f4ae1f9a 100644
--- a/include/rtl/character.hxx
+++ b/include/rtl/character.hxx
@@ -335,6 +335,20 @@ sal_uInt32 const surrogatesLowLast = 0xDFFF;
 }
 /// @endcond
 
+/** Check for surrogate.
+
+@param code  A Unicode code point.
+
+@return  True if code is a surrogate code point (0xD800--0xDFFF).
+
+@since LibreOffice 6.0
+*/
+inline bool isSurrogate(sal_uInt32 code) {
+assert(isUnicodeCodePoint(code));
+return code >= detail::surrogatesHighFirst
+&& code <= detail::surrogatesLowLast;
+}
+
 /** Check for high surrogate.
 
 @param code  A Unicode code point.
@@ -433,6 +447,19 @@ inline std::size_t splitSurrogates(sal_uInt32 code, 
sal_Unicode * output) {
 }
 }
 
+/** Check for Unicode scalar value.
+
+@param code  An integer.
+
+@return  True if code is a Unicode scalar value.
+
+@since LibreOffice 6.0
+*/
+inline bool isUnicodeScalarValue(sal_uInt32 code)
+{
+return isUnicodeCodePoint(code) && !isSurrogate(code);
+}
+
 }
 
 #endif
diff --git a/sal/rtl/uri.cxx b/sal/rtl/uri.cxx
index 257a0a27abac..57a7102a38eb 100644
--- a/sal/rtl/uri.cxx
+++ b/sal/rtl/uri.cxx
@@ -133,9 +133,8 @@ sal_uInt32 readUcs4(sal_Unicode const ** pBegin, 
sal_Unicode const * pEnd,
 p += 3;
 nEncoded |= ((nWeight1 & 3) << 4 | nWeight2) << nShift;
 }
-if (bUTF8 && rtl::isUnicodeCodePoint(nEncoded)
-&& nEncoded >= nMin && !rtl::isHighSurrogate(nEncoded)
-&& !rtl::isLowSurrogate(nEncoded))
+if (bUTF8 && rtl::isUnicodeScalarValue(nEncoded)
+&& nEncoded >= nMin)
 {
 *pBegin = p;
 *pType = EscapeChar;
diff --git a/sal/rtl/ustrbuf.cxx b/sal/rtl/ustrbuf.cxx
index cef31a5da2ea..508c8d7a9c7c 100644
--- a/sal/rtl/ustrbuf.cxx
+++ b/sal/rtl/ustrbuf.cxx
@@ -168,7 +168,7 @@ void rtl_uStringbuffer_insertUtf32(
 {
 sal_Unicode buf[2];
 sal_Int32 len;
-OSL_ASSERT(rtl::isUnicodeCodePoint(c) && !(c >= 0xD800 && c <= 0xDFFF));
+OSL_ASSERT(rtl::isUnicodeScalarValue(c));
 if (c <= 0x) {
 buf[0] = (sal_Unicode) c;
 len = 1;
diff --git a/sal/textenc/tcvtutf8.cxx b/sal/textenc/tcvtutf8.cxx
index d9c3c134a83a..f5ed9dfb995c 100644
--- a/sal/textenc/tcvtutf8.cxx
+++ b/sal/textenc/tcvtutf8.cxx
@@ -170,10 +170,7 @@ sal_Size ImplConvertUtf8ToUnicode(
 }
 break;
 case 3:
-if (nUtf32 < 0x800
-|| (!bJavaUtf8
-   

[Libreoffice-commits] core.git: configmgr/source

2017-08-30 Thread Stephan Bergmann
 configmgr/source/dconf.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 975d65eca3ccac4a9e2ff978ff15cdaa1828f89d
Author: Stephan Bergmann 
Date:   Wed Aug 30 14:15:53 2017 +0200

loplugin:constparams

Change-Id: I8bc9fd2a3ad727f1a0f4b98254efdae085a2b8cd

diff --git a/configmgr/source/dconf.cxx b/configmgr/source/dconf.cxx
index 2ba4d0c9b43c..586c5289dc34 100644
--- a/configmgr/source/dconf.cxx
+++ b/configmgr/source/dconf.cxx
@@ -749,7 +749,7 @@ ReadValue readValue(
 
 void finalize(
 GObjectHolder const & client, OString const & path,
-rtl::Reference & node, int layer)
+rtl::Reference const & node, int layer)
 {
 if (!dconf_client_is_writable(client.get(), path.getStr())) {
 node->setFinalized(layer);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2017-08-11 Thread Caolán McNamara
 configmgr/source/dconf.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e7c0bd4df01744a744847a94c7a04746787e5157
Author: Caolán McNamara 
Date:   Fri Aug 11 12:36:24 2017 +0100

error: ‘class configmgr::NodeMap’ has no member named ‘emplace’

Change-Id: I434739024afa97d05b5cf6e959973d845fdb2dfe

diff --git a/configmgr/source/dconf.cxx b/configmgr/source/dconf.cxx
index 35e626163fa3..2ba4d0c9b43c 100644
--- a/configmgr/source/dconf.cxx
+++ b/configmgr/source/dconf.cxx
@@ -1036,9 +1036,9 @@ void readDir(
 }
 } else if (replace) {
 members.erase(name);
-members.emplace( name, member));
+members.insert(NodeMap::value_type(name, member));
 } else if (insert) {
-members.emplace( name, member));
+members.insert(NodeMap::value_type(name, member));
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source include/unotools unotools/source

2017-07-17 Thread Noel Grandin
 configmgr/source/xcuparser.cxx  |2 +-
 configmgr/source/xcuparser.hxx  |2 +-
 include/unotools/ZipPackageHelper.hxx   |6 +++---
 include/unotools/compatibility.hxx  |2 +-
 include/unotools/configitem.hxx |2 +-
 include/unotools/configmgr.hxx  |2 +-
 include/unotools/desktopterminationobserver.hxx |2 +-
 include/unotools/options.hxx|2 +-
 unotools/source/config/bootstrap.cxx|   16 
 unotools/source/config/configitem.cxx   |2 +-
 unotools/source/config/configmgr.cxx|2 +-
 unotools/source/config/configvaluecontainer.cxx |4 ++--
 unotools/source/config/options.cxx  |2 +-
 unotools/source/misc/ZipPackageHelper.cxx   |6 +++---
 unotools/source/misc/closeveto.cxx  |2 +-
 unotools/source/misc/desktopterminationobserver.cxx |2 +-
 16 files changed, 28 insertions(+), 28 deletions(-)

New commits:
commit f71a35500088ba332f21896f373de0fa903e7bcc
Author: Noel Grandin 
Date:   Mon Jul 17 10:55:36 2017 +0200

loplugin:constparams in configmgr,unotools

Change-Id: Ief3df5487eb20b1f6d0e8aed89cfef4464d23a88
Reviewed-on: https://gerrit.libreoffice.org/40048
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx
index bac4119262ca..b47a482f3f8b 100644
--- a/configmgr/source/xcuparser.cxx
+++ b/configmgr/source/xcuparser.cxx
@@ -621,7 +621,7 @@ void XcuParser::handleGroupProp(
 }
 
 void XcuParser::handleUnknownGroupProp(
-xmlreader::XmlReader const & reader, GroupNode * group,
+xmlreader::XmlReader const & reader, GroupNode const * group,
 OUString const & name, Type type, Operation operation, bool finalized)
 {
 switch (operation) {
diff --git a/configmgr/source/xcuparser.hxx b/configmgr/source/xcuparser.hxx
index 27e193bde8b7..ec40372fed1d 100644
--- a/configmgr/source/xcuparser.hxx
+++ b/configmgr/source/xcuparser.hxx
@@ -85,7 +85,7 @@ private:
 void handleGroupProp(xmlreader::XmlReader & reader, GroupNode * group);
 
 void handleUnknownGroupProp(
-xmlreader::XmlReader const & reader, GroupNode * group,
+xmlreader::XmlReader const & reader, GroupNode const * group,
 OUString const & name, Type type, Operation operation,
 bool finalized);
 
diff --git a/include/unotools/ZipPackageHelper.hxx 
b/include/unotools/ZipPackageHelper.hxx
index 61c77668232f..c3a7f963ba38 100644
--- a/include/unotools/ZipPackageHelper.hxx
+++ b/include/unotools/ZipPackageHelper.hxx
@@ -39,14 +39,14 @@ public:
 void savePackage();
 
 /// @throws css::uno::Exception
-void addFile( css::uno::Reference< css::uno::XInterface >& xRootFolder,
+void addFile( css::uno::Reference< css::uno::XInterface > const & 
xRootFolder,
   const OUString& rSourceFile );
 
 /// @throws css::uno::Exception
-css::uno::Reference< css::uno::XInterface > addFolder( 
css::uno::Reference< css::uno::XInterface >& xRootFolder,
+css::uno::Reference< css::uno::XInterface > addFolder( 
css::uno::Reference< css::uno::XInterface > const & xRootFolder,
const OUString& 
rName );
 
-void addFolderWithContent( css::uno::Reference< css::uno::XInterface >& 
xRootFolder,
+void addFolderWithContent( css::uno::Reference< css::uno::XInterface > 
const & xRootFolder,
const OUString& rDirURL );
 
 css::uno::Reference< css::uno::XInterface >& getRootFolder();
diff --git a/include/unotools/compatibility.hxx 
b/include/unotools/compatibility.hxx
index 5a4e2f7922ef..f281f58aad1d 100644
--- a/include/unotools/compatibility.hxx
+++ b/include/unotools/compatibility.hxx
@@ -127,7 +127,7 @@ class UNOTOOLS_DLLPUBLIC SvtCompatibilityEntry
 return aValue;
 }
 
-void setValue( const Index rIdx, css::uno::Any& rValue )
+void setValue( const Index rIdx, css::uno::Any const & rValue )
 {
 if ( static_cast(rIdx) < getElementCount() )
 {
diff --git a/include/unotools/configitem.hxx b/include/unotools/configitem.hxx
index 41c8b62a007d..5a842a1193be 100644
--- a/include/unotools/configitem.hxx
+++ b/include/unotools/configitem.hxx
@@ -154,7 +154,7 @@ namespace utl
 boolClearNodeSet(const OUString& rNode);
 // remove selected members of a set
 boolClearNodeElements(const OUString& rNode,
-css::uno::Sequence< OUString >& 
rElements);
+css::uno::Sequence< OUString > const & 
rElements);
 // change or add members to a set
   

[Libreoffice-commits] core.git: configmgr/source extensions/source idl/inc idl/source sax/source unodevtools/source vcl/headless vcl/inc vcl/opengl vcl/unx

2017-04-28 Thread Noel Grandin
 configmgr/source/valueparser.cxx  |3 
 configmgr/source/valueparser.hxx  |3 
 configmgr/source/xcsparser.cxx|4 
 configmgr/source/xcuparser.cxx|4 
 extensions/source/config/ldap/ldapaccess.cxx  |9 -
 idl/inc/types.hxx |2 
 idl/source/objects/types.cxx  |5 -
 sax/source/fastparser/fastparser.cxx  |   22 ++--
 unodevtools/source/skeletonmaker/javacompskeleton.cxx |4 
 vcl/headless/svpframe.cxx |3 
 vcl/headless/svpinst.cxx  |4 
 vcl/inc/headless/svpframe.hxx |3 
 vcl/inc/openglgdiimpl.hxx |2 
 vcl/inc/unx/cupsmgr.hxx   |2 
 vcl/inc/unx/glyphcache.hxx|4 
 vcl/inc/unx/gtk/gtkdata.hxx   |3 
 vcl/inc/unx/i18n_ic.hxx   |4 
 vcl/inc/unx/printergfx.hxx|2 
 vcl/inc/unx/salbmp.h  |2 
 vcl/opengl/gdiimpl.cxx|   16 +--
 vcl/unx/generic/app/i18n_ic.cxx   |2 
 vcl/unx/generic/dtrans/X11_dndcontext.cxx |   18 +--
 vcl/unx/generic/dtrans/X11_dndcontext.hxx |9 -
 vcl/unx/generic/dtrans/X11_selection.cxx  |   52 +--
 vcl/unx/generic/dtrans/X11_selection.hxx  |8 -
 vcl/unx/generic/gdi/salbmp.cxx|8 -
 vcl/unx/generic/glyphs/glyphcache.cxx |   10 +-
 vcl/unx/generic/print/common_gfx.cxx  |4 
 vcl/unx/generic/print/genpspgraphics.cxx  |2 
 vcl/unx/generic/printer/cupsmgr.cxx   |6 -
 vcl/unx/generic/window/salframe.cxx   |4 
 vcl/unx/gtk/gtkdata.cxx   |7 -
 vcl/unx/gtk/salnativewidgets-gtk.cxx  |   82 --
 vcl/unx/gtk3/gtk3gtkdata.cxx  |7 -
 vcl/unx/gtk3/gtk3gtkinst.cxx  |   29 +++---
 35 files changed, 144 insertions(+), 205 deletions(-)

New commits:
commit 3a36cf434fb4a967c9ea767cb7ac5f4da0502a0d
Author: Noel Grandin 
Date:   Tue Apr 25 15:09:53 2017 +0200

loplugin:checkunusedparams in configmgr and vcl

Change-Id: I7226d01f38e6edaf3868d7267d9b02dbdbc9e5ba
Reviewed-on: https://gerrit.libreoffice.org/36975
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/valueparser.cxx b/configmgr/source/valueparser.cxx
index d26bddc481fa..10860628e491 100644
--- a/configmgr/source/valueparser.cxx
+++ b/configmgr/source/valueparser.cxx
@@ -275,8 +275,7 @@ xmlreader::XmlReader::Text ValueParser::getTextMode() const 
{
 }
 
 bool ValueParser::startElement(
-xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name,
-std::set< OUString > const *)
+xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name)
 {
 if (!node_.is()) {
 return false;
diff --git a/configmgr/source/valueparser.hxx b/configmgr/source/valueparser.hxx
index 50cab466d2d4..a1d585e89587 100644
--- a/configmgr/source/valueparser.hxx
+++ b/configmgr/source/valueparser.hxx
@@ -51,8 +51,7 @@ public:
 xmlreader::XmlReader::Text getTextMode() const;
 
 bool startElement(
-xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name,
-std::set< OUString > const *);
+xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name);
 
 bool endElement();
 
diff --git a/configmgr/source/xcsparser.cxx b/configmgr/source/xcsparser.cxx
index 6c1b2fea9a4a..50415391e55e 100644
--- a/configmgr/source/xcsparser.cxx
+++ b/configmgr/source/xcsparser.cxx
@@ -125,9 +125,9 @@ xmlreader::XmlReader::Text XcsParser::getTextMode() {
 
 bool XcsParser::startElement(
 xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name,
-std::set< OUString > const * existingDependencies)
+std::set< OUString > const * /*existingDependencies*/)
 {
-if (valueParser_.startElement(reader, nsId, name, existingDependencies)) {
+if (valueParser_.startElement(reader, nsId, name)) {
 return true;
 }
 if (state_ == STATE_START) {
diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx
index 34e0eb5973c8..bac4119262ca 100644
--- a/configmgr/source/xcuparser.cxx
+++ b/configmgr/source/xcuparser.cxx
@@ -72,9 +72,9 @@ xmlreader::XmlReader::Text XcuParser::getTextMode() {
 
 bool XcuParser::startElement(
 xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name,
-std::set< OUString > const * existingDependencies)
+std::set< OUString > const * 

[Libreoffice-commits] core.git: configmgr/source include/o3tl o3tl/CppunitTest_o3tl_tests.mk o3tl/qa

2017-04-07 Thread Stephan Bergmann
 configmgr/source/winreg.cxx   |   42 -
 configmgr/source/writemodfile.cxx |  235 --
 configmgr/source/writemodfile.hxx |9 
 include/o3tl/string_view.hxx  |  867 ++
 o3tl/CppunitTest_o3tl_tests.mk|1 
 o3tl/qa/test-string_view.cxx  |  212 +
 6 files changed, 1212 insertions(+), 154 deletions(-)

New commits:
commit 50057a37a877213d935958d5c643fde1434d680c
Author: Stephan Bergmann 
Date:   Fri Apr 7 15:59:12 2017 +0200

Introduce o3tl::string_view.hxx approximation of C++17 

...and use it in configmgr/source/writemodfile.hxx

Change-Id: Ie683dc21010ed45cc454ff89bea0376994b351f2
Reviewed-on: https://gerrit.libreoffice.org/36270
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/configmgr/source/winreg.cxx b/configmgr/source/winreg.cxx
index c48a85e70e26..76d7abe15462 100644
--- a/configmgr/source/winreg.cxx
+++ b/configmgr/source/winreg.cxx
@@ -149,7 +149,7 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & 
aKeyName, TempFile 
 bool bHasNode = false;
 sal_Int32 nCloseNode = 0;
 
-writeData(aFileHandle, "");
+aFileHandle.writeString("\">");
 break;
 }
 }
 
-writeData(aFileHandle, "");
+aFileHandle.writeString(" oor:finalized=\"true\"");
+aFileHandle.writeString(">");
 writeValueContent(aFileHandle, aValue);
-writeData(aFileHandle, "");
+aFileHandle.writeString("");
 for(; nCloseNode > 0; nCloseNode--)
-writeData(aFileHandle, "");
-writeData(aFileHandle, "\n");
+aFileHandle.writeString("");
+aFileHandle.writeString("\n");
 }
 RegCloseKey(hCurKey);
 }
@@ -235,14 +236,13 @@ bool dumpWindowsRegistry(OUString* pFileURL, WinRegType 
eType)
 "cannot create temporary file");
 }
 aFileHandle.url = *pFileURL;
-writeData(
-aFileHandle,
-"\n\n");
+aFileHandle.writeString(
+"\n\n");
 dumpWindowsRegistryKey(hKey, "", aFileHandle);
-writeData(aFileHandle, "");
+aFileHandle.writeString("");
 oslFileError e = aFileHandle.closeWithoutUnlink();
 if (e != osl_File_E_None)
 SAL_WARN("configmgr", "osl_closeFile failed with " << +e);
diff --git a/configmgr/source/writemodfile.cxx 
b/configmgr/source/writemodfile.cxx
index a1e545e5b5a3..e34b604dafd5 100644
--- a/configmgr/source/writemodfile.cxx
+++ b/configmgr/source/writemodfile.cxx
@@ -20,12 +20,15 @@
 #include 
 
 #include 
+#include 
+#include 
 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -57,13 +60,11 @@ class Components;
 
 namespace {
 
-OString convertToUtf8(
-OUString const & text, sal_Int32 offset, sal_Int32 length)
-{
-assert(offset <= text.getLength() && text.getLength() - offset >= length);
+OString convertToUtf8(o3tl::u16string_view text) {
 OString s;
+assert(text.size() <= sal_uInt32(std::numeric_limits::max()));
 if (!rtl_convertUStringToString(
-, text.pData->buffer + offset, length,
+, text.data(), text.size(),
 RTL_TEXTENCODING_UTF8,
 (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR |
  RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR)))
@@ -139,43 +140,38 @@ oslFileError TempFile::flush() {
 return e;
 }
 
-void TempFile::writeString(char const *begin, sal_Int32 length) {
-buffer.append(begin, length);
+void TempFile::writeString(o3tl::string_view text) {
+buffer.append(text.data(), text.size());
 if (buffer.getLength() > 0x1)
 flush();
 }
 
 namespace {
 
-void writeData_(TempFile , char const * begin, sal_Int32 length) {
-assert(length >= 0);
-handle.writeString(begin, length);
-}
-
 void writeValueContent_(TempFile &, bool) = delete;
 // silence loplugin:salbool
 void writeValueContent_(TempFile , sal_Bool value) {
 if (value) {
-writeData_(handle, RTL_CONSTASCII_STRINGPARAM("true"));
+handle.writeString("true");
 } else {
-writeData_(handle, RTL_CONSTASCII_STRINGPARAM("false"));
+handle.writeString("false");
 }
 }
 
 void writeValueContent_(TempFile , sal_Int16 value) {
-writeData(handle, OString::number(value));
+handle.writeString(OString::number(value));
 }
 
 void writeValueContent_(TempFile , sal_Int32 

[Libreoffice-commits] core.git: configmgr/source

2017-03-24 Thread Andrea Gelmini
 configmgr/source/rootaccess.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c4e7c260c48069d3aeee4930d519ee6e18a80585
Author: Andrea Gelmini 
Date:   Wed Mar 22 11:11:10 2017 +0100

Fix configmgr argument

Commit 3e64874e7cd23 introduce a not-existent argument.
Dunno if it's an issue.
Just made this commit to show it to real developers!

Change-Id: I01f4b859631e76e0d76269db19bcbcf3481d827c
Reviewed-on: https://gerrit.libreoffice.org/35531
Tested-by: Jenkins 
Reviewed-by: Julien Nabet 

diff --git a/configmgr/source/rootaccess.hxx b/configmgr/source/rootaccess.hxx
index 1f4203ba9803..9564bbf34a63 100644
--- a/configmgr/source/rootaccess.hxx
+++ b/configmgr/source/rootaccess.hxx
@@ -58,7 +58,7 @@ class RootAccess:
 {
 public:
 RootAccess(
-Components & components, OUString const & pathRepresenation,
+Components & components, OUString const & pathRepresentation,
 OUString const & locale, bool update);
 
 virtual std::vector getAbsolutePath() override;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2017-03-07 Thread Tamás Zolnai
 configmgr/source/winreg.cxx |   22 ++
 1 file changed, 22 insertions(+)

New commits:
commit 145accd9a5b55070959d40c9314d870dffa5e4bc
Author: Tamás Zolnai 
Date:   Wed Mar 8 00:08:16 2017 +0100

tdf#106283: Registry settings are not read properly on Windows

Read also a type value from registry so user can specify
a type for a property of an extensible group.

Change-Id: I4105ba559a64ce96bfe5a390660ad7f349ba894c
Reviewed-on: https://gerrit.libreoffice.org/34961
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/configmgr/source/winreg.cxx b/configmgr/source/winreg.cxx
index 60f99f1..00b6656 100644
--- a/configmgr/source/winreg.cxx
+++ b/configmgr/source/winreg.cxx
@@ -68,6 +68,18 @@ namespace {
 // 
 // 
 // 
+//
+// Third example (property of an extensible group -> needs type):
+// 
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\LibreOffice\org.openoffice.Office.Jobs\Jobs\org.openoffice.Office.Jobs:Job['UpdateCheck']\Arguments\AutoCheckEnabled]
+// "Value"="false"
+// "Final"=dword:0001
+// "Type"="xs:boolean"
+// becomes the following in configuration:
+// 
+// 
+// false
+// 
+// 
 
 void dumpWindowsRegistryKey(HKEY hKey, OUString const & aKeyName, TempFile 
)
 {
@@ -112,6 +124,7 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & 
aKeyName, TempFile 
 
 bool bFinal = false;
 OUString aValue;
+OUString aType;
 
 for(DWORD i = 0; i < nValues; ++i)
 {
@@ -121,9 +134,12 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & 
aKeyName, TempFile 
 RegEnumValueW(hCurKey, i, pValueName.get(), , 
nullptr, nullptr, reinterpret_cast(pValue.get()), );
 const wchar_t wsValue[] = L"Value";
 const wchar_t wsFinal[] = L"Final";
+const wchar_t wsType[] = L"Type";
 
 if(!wcscmp(pValueName.get(), wsValue))
 aValue = OUString(pValue.get());
+if (!wcscmp(pValueName.get(), wsType))
+aType = OUString(pValue.get());
 if(!wcscmp(pValueName.get(), wsFinal) && 
*reinterpret_cast(pValue.get()) == 1)
 bFinal = true;
 }
@@ -173,6 +189,12 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & 
aKeyName, TempFile 
 writeData(aFileHandle, "");
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2017-03-06 Thread Stephan Bergmann
 configmgr/source/xcuparser.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 979e4b822cf03c8bde6885893c8c93f3a0e467f1
Author: Stephan Bergmann 
Date:   Mon Mar 6 17:49:30 2017 +0100

Revert "tdf#106283: Registry settings are not read properly on Windows"

This reverts commit 8cfda7206139b3017346c435591c77c9741ba8ee.  The problem 
in
that issue is that the configmgr/source/winreg.cxx code generates .xcu data
where such an extension prop doesn't have an oor:type attribute, which is 
not
allowed.  On the other hand, it is important that the PropertyNode 
representing
such an extension prop has a staticType_ of TYPE_ANY, so that later layers 
or
programmatic calls can store values of different type.

diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx
index e999cf1..34e0eb5 100644
--- a/configmgr/source/xcuparser.cxx
+++ b/configmgr/source/xcuparser.cxx
@@ -636,7 +636,7 @@ void XcuParser::handleUnknownGroupProp(
 valueParser_.type_ = type;
 rtl::Reference< Node > prop(
 new PropertyNode(
-valueParser_.getLayer(), type, true, css::uno::Any(),
+valueParser_.getLayer(), TYPE_ANY, true, css::uno::Any(),
 true));
 if (finalized) {
 prop->setFinalized(valueParser_.getLayer());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2017-03-03 Thread Tamás Zolnai
 configmgr/source/xcuparser.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8cfda7206139b3017346c435591c77c9741ba8ee
Author: Tamás Zolnai 
Date:   Fri Mar 3 13:27:53 2017 +0100

tdf#106283: Registry settings are not read properly on Windows

In general, properties' type is read from scheme files (xcs)
but scheme files can contain property groups without a type
(extensible groups). In this case the xcd files defines the actual
properties and their type.
handleUnknownGroupProp() method is called when a property is
not defined in the scheme file. Here we have the type information
read from xcd file, so use it instead of setting it to any

Change-Id: I4180d154ecf4130ecbb9c808cee6529124842790
Reviewed-on: https://gerrit.libreoffice.org/34859
Reviewed-by: Tamás Zolnai 
Tested-by: Tamás Zolnai 

diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx
index 34e0eb5..e999cf1 100644
--- a/configmgr/source/xcuparser.cxx
+++ b/configmgr/source/xcuparser.cxx
@@ -636,7 +636,7 @@ void XcuParser::handleUnknownGroupProp(
 valueParser_.type_ = type;
 rtl::Reference< Node > prop(
 new PropertyNode(
-valueParser_.getLayer(), TYPE_ANY, true, css::uno::Any(),
+valueParser_.getLayer(), type, true, css::uno::Any(),
 true));
 if (finalized) {
 prop->setFinalized(valueParser_.getLayer());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source sc/qa sd/qa

2017-02-20 Thread Fakabbir Amin
 configmgr/source/components.cxx  |4 ++--
 sc/qa/unit/tiledrendering/tiledrendering.cxx |7 +++
 sd/qa/unit/tiledrendering/tiledrendering.cxx |   11 ++-
 3 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 12fc1d5399a688a80eec2565a4b552377e428ab7
Author: Fakabbir Amin 
Date:   Fri Feb 17 19:48:40 2017 +0530

tdf#84323: Make osl::Condition::wait more readable

Improved readability of calls to osl::Condition::wait.

Change-Id: I69fb9815561013f1eb9fd4a649e32902e09473c6
Reviewed-on: https://gerrit.libreoffice.org/34399
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index 7fdb43a..3978305 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -21,6 +21,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -178,8 +179,7 @@ Components::WriteThread::WriteThread(
 }
 
 void Components::WriteThread::execute() {
-TimeValue t = { 1, 0 }; // 1 sec
-delay_.wait(); // must not throw; result_error is harmless and ignored
+delay_.wait(std::chrono::seconds(1)); // must not throw; result_error is 
harmless and ignored
 osl::MutexGuard g(*lock_); // must not throw
 try {
 try {
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 025139d..a4c355b 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -32,6 +32,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -352,15 +353,13 @@ void ScTiledRenderingTest::testDocumentSize()
 // Set cursor column
 pViewShell->SetCursor(100, 0);
 // 2 seconds
-TimeValue aTime = { 2 , 0 };
-osl::Condition::Result aResult = m_aDocSizeCondition.wait(aTime);
+osl::Condition::Result aResult = 
m_aDocSizeCondition.wait(std::chrono::seconds(2));
 CPPUNIT_ASSERT_EQUAL(aResult, osl::Condition::result_ok);
 
 // Set cursor row
 pViewShell->SetCursor(0, 100);
 // 2 seconds
-aTime = { 2 , 0 };
-aResult = m_aDocSizeCondition.wait(aTime);
+aResult = m_aDocSizeCondition.wait(std::chrono::seconds(2));
 CPPUNIT_ASSERT_EQUAL(aResult, osl::Condition::result_ok);
 
 comphelper::LibreOfficeKit::setActive(false);
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index cbb8703..2013bfe 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -45,6 +45,8 @@
 #include 
 #include 
 
+#include 
+
 using namespace css;
 
 static const char* const DATA_DIRECTORY = "/sd/qa/unit/tiledrendering/data/";
@@ -668,8 +670,7 @@ void SdTiledRenderingTest::testInsertDeletePage()
 for (unsigned it = 1; it <= 10; it++)
 comphelper::dispatchCommand(".uno:InsertPage", aArgs);
 
-TimeValue aTimeValue = { 2 , 0 }; // 2 seconds max
-osl::Condition::Result aResult = m_aDocumentSizeCondition.wait(aTimeValue);
+osl::Condition::Result aResult = 
m_aDocumentSizeCondition.wait(std::chrono::seconds(2));
 CPPUNIT_ASSERT_EQUAL(aResult, osl::Condition::result_ok);
 
 // Verify inserted slides
@@ -686,7 +687,7 @@ void SdTiledRenderingTest::testInsertDeletePage()
 for (unsigned it = 1; it <= 10; it++)
 comphelper::dispatchCommand(".uno:DeletePage", aArgs);
 
-aResult = m_aDocumentSizeCondition.wait(aTimeValue);
+aResult = m_aDocumentSizeCondition.wait(std::chrono::seconds(2));
 CPPUNIT_ASSERT_EQUAL(aResult, osl::Condition::result_ok);
 
 // Verify deleted slides
@@ -702,7 +703,7 @@ void SdTiledRenderingTest::testInsertDeletePage()
 for (unsigned it = 1; it <= 10; it++)
 comphelper::dispatchCommand(".uno:Undo", aArgs);
 
-aResult = m_aDocumentSizeCondition.wait(aTimeValue);
+aResult = m_aDocumentSizeCondition.wait(std::chrono::seconds(2));
 CPPUNIT_ASSERT_EQUAL(aResult, osl::Condition::result_ok);
 
 // Verify inserted slides
@@ -718,7 +719,7 @@ void SdTiledRenderingTest::testInsertDeletePage()
 for (unsigned it = 1; it <= 10; it++)
 comphelper::dispatchCommand(".uno:Redo", aArgs);
 
-aResult = m_aDocumentSizeCondition.wait(aTimeValue);
+aResult = m_aDocumentSizeCondition.wait(std::chrono::seconds(2));
 CPPUNIT_ASSERT_EQUAL(aResult, osl::Condition::result_ok);
 
 // Verify deleted slides
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2017-02-07 Thread Michael Meeks
 configmgr/source/components.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit e5b062758950b0d6c5cea0a1914998433ef19774
Author: Michael Meeks 
Date:   Tue Feb 7 12:27:54 2017 +0100

configmgr: add SAL_CONFIG_WINREG_RETAIN_TMP variable.

Windows registry dumping behaves very strangely, and in hard to debug
ways - this should help in-the-field debugging of this in future.

Change-Id: Ia35d58a8be36d1b683db39ae7d2128a3ccfd10a5
Reviewed-on: https://gerrit.libreoffice.org/33992
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index 7eb8796..7fdb43a 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -561,7 +561,8 @@ Components::Components(
 OUString aTempFileURL;
 if (dumpWindowsRegistry(, eType)) {
 parseFileLeniently(, aTempFileURL, layer, 
nullptr, nullptr, nullptr);
-osl::File::remove(aTempFileURL);
+if (!getenv("SAL_CONFIG_WINREG_RETAIN_TMP"))
+osl::File::remove(aTempFileURL);
 }
 ++layer; //TODO: overflow
 #endif
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source cppuhelper/source include/xmlreader sw/source vcl/opengl vcl/source xmlreader/source

2016-05-25 Thread Noel Grandin
 configmgr/source/parsemanager.cxx|   10 ++--
 cppuhelper/source/servicemanager.cxx |   22 -
 include/xmlreader/xmlreader.hxx  |2 
 sw/source/uibase/envelp/labelcfg.cxx |   18 +++
 vcl/opengl/win/blocklist_parser.cxx  |   16 +++
 vcl/source/window/builder.cxx|   80 +--
 xmlreader/source/xmlreader.cxx   |   16 +++
 7 files changed, 82 insertions(+), 82 deletions(-)

New commits:
commit 472219209849daee7a9924f0f54d5f0bdfe4b772
Author: Noel Grandin 
Date:   Mon May 23 14:54:44 2016 +0200

Convert XmlReader::Result to scoped enum

Change-Id: I6a0d1dcf5ae51d2ac08aacdfec50865f93e51c21
Reviewed-on: https://gerrit.libreoffice.org/25365
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/parsemanager.cxx 
b/configmgr/source/parsemanager.cxx
index 48ec737..192b34a 100644
--- a/configmgr/source/parsemanager.cxx
+++ b/configmgr/source/parsemanager.cxx
@@ -60,11 +60,11 @@ bool ParseManager::parse(std::set< OUString > const * 
existingDependencies) {
 sal_uInt32 startTime( osl_getGlobalTimer() );
 for (;;) {
 switch (itemData_.is()
-? xmlreader::XmlReader::RESULT_BEGIN
+? xmlreader::XmlReader::Result::Begin
 : reader_.nextItem(
 parser_->getTextMode(), _, _))
 {
-case xmlreader::XmlReader::RESULT_BEGIN:
+case xmlreader::XmlReader::Result::Begin:
 if (!parser_->startElement(
 reader_, itemNamespaceId_, itemData_, 
existingDependencies))
 {
@@ -72,13 +72,13 @@ bool ParseManager::parse(std::set< OUString > const * 
existingDependencies) {
 return false;
 }
 break;
-case xmlreader::XmlReader::RESULT_END:
+case xmlreader::XmlReader::Result::End:
 parser_->endElement(reader_);
 break;
-case xmlreader::XmlReader::RESULT_TEXT:
+case xmlreader::XmlReader::Result::Text:
 parser_->characters(itemData_);
 break;
-case xmlreader::XmlReader::RESULT_DONE:
+case xmlreader::XmlReader::Result::Done:
 SAL_INFO("configmgr", "parsing " << reader_.getUrl() << " took " 
<< (osl_getGlobalTimer() - startTime) << " ms, success");
 return true;
 }
diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index 2785920..7589424 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -156,7 +156,7 @@ Parser::Parser(
 xmlreader::XmlReader::Text::NONE, , );
 switch (state) {
 case STATE_BEGIN:
-if (res == xmlreader::XmlReader::RESULT_BEGIN && nsId == ucNsId
+if (res == xmlreader::XmlReader::Result::Begin && nsId == ucNsId
 && name.equals(RTL_CONSTASCII_STRINGPARAM("components")))
 {
 state = STATE_COMPONENTS;
@@ -165,17 +165,17 @@ Parser::Parser(
 throw css::registry::InvalidRegistryException(
 reader_.getUrl() + ": unexpected item in outer level");
 case STATE_END:
-if (res == xmlreader::XmlReader::RESULT_DONE) {
+if (res == xmlreader::XmlReader::Result::Done) {
 return;
 }
 throw css::registry::InvalidRegistryException(
 reader_.getUrl() + ": unexpected item in outer level");
 case STATE_COMPONENTS:
-if (res == xmlreader::XmlReader::RESULT_END) {
+if (res == xmlreader::XmlReader::Result::End) {
 state = STATE_END;
 break;
 }
-if (res == xmlreader::XmlReader::RESULT_BEGIN && nsId == ucNsId
+if (res == xmlreader::XmlReader::Result::Begin && nsId == ucNsId
 && name.equals(RTL_CONSTASCII_STRINGPARAM("component")))
 {
 handleComponent();
@@ -185,13 +185,13 @@ Parser::Parser(
 throw css::registry::InvalidRegistryException(
 reader_.getUrl() + ": unexpected item in ");
 case STATE_COMPONENT:
-if (res == xmlreader::XmlReader::RESULT_END) {
+if (res == xmlreader::XmlReader::Result::End) {
 state = STATE_COMPONENTS;
 break;
 }
 SAL_FALLTHROUGH;
 case STATE_COMPONENT_INITIAL:
-if (res == xmlreader::XmlReader::RESULT_BEGIN && nsId == ucNsId
+if (res == xmlreader::XmlReader::Result::Begin && nsId == ucNsId
 && name.equals(RTL_CONSTASCII_STRINGPARAM("implementation")))
 {
 handleImplementation();
@@ -201,18 +201,18 @@ Parser::Parser(
 throw css::registry::InvalidRegistryException(
 reader_.getUrl() + ": unexpected item in ");
 

[Libreoffice-commits] core.git: configmgr/source

2016-05-12 Thread Stephan Bergmann
 configmgr/source/access.cxx |   11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit 34499f08b560a33de35f34ec8ea2d9f2ffaf616b
Author: Stephan Bergmann 
Date:   Thu May 12 13:41:41 2016 +0200

Silence -Werror,-Wimplicit-fallthrough under NDEBUG

Change-Id: I030404b445f310a850e0fee2f7ff06baebc9932a

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 9f14a6c..77af56f 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -20,6 +20,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 #include 
@@ -1564,17 +1565,11 @@ std::vector< rtl::Reference< ChildAccess > > 
Access::getAllChildren() {
 void Access::checkValue(css::uno::Any const & value, Type type, bool nillable) 
{
 bool ok;
 switch (type) {
-case TYPE_NIL:
-assert(false);
-// fall through (cannot happen)
 case TYPE_ERROR:
 ok = false;
 break;
 case TYPE_ANY:
 switch (getDynamicType(value)) {
-case TYPE_ANY:
-assert(false);
-// fall through (cannot happen)
 case TYPE_ERROR:
 ok = false;
 break;
@@ -1584,11 +1579,15 @@ void Access::checkValue(css::uno::Any const & value, 
Type type, bool nillable) {
 default:
 ok = true;
 break;
+case TYPE_ANY:
+for (;;) std::abort(); // cannot happen
 }
 break;
 default:
 ok = value.hasValue() ? value.isExtractableTo(mapType(type)) : 
nillable;
 break;
+case TYPE_NIL:
+for (;;) std::abort(); // cannot happen
 }
 if (!ok) {
 throw css::lang::IllegalArgumentException(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2016-03-31 Thread Stephan Bergmann
 configmgr/source/modifications.hxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit f0070f535f34d69ac2bb198e4673e06552756b8b
Author: Stephan Bergmann 
Date:   Thu Mar 31 15:47:12 2016 +0200

Missing include

Change-Id: I0babe806f04aa41110e87f9fd6b6febf892cd66d

diff --git a/configmgr/source/modifications.hxx 
b/configmgr/source/modifications.hxx
index 7aa93bf..2b4dfba 100644
--- a/configmgr/source/modifications.hxx
+++ b/configmgr/source/modifications.hxx
@@ -22,8 +22,9 @@
 
 #include 
 
-#include 
+#include 
 
+#include 
 #include 
 
 namespace configmgr {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2016-03-15 Thread Jakub Trzebiatowski
 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 89e0663c55f7f1763536a345d6315c71ef26
Author: Jakub Trzebiatowski 
Date:   Mon Mar 7 19:48:23 2016 +0100

tdf#96099 fix trival typedefs, Path to std::vector

Change-Id: I23fca48becbfdfd92db02a11b739a668fc1cd8c4
Reviewed-on: https://gerrit.libreoffice.org/23007
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

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 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 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 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 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 
 
 #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 getAbsolutePath() = 0;
+virtual std::vector 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 * 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 
 
 #include 
-
-#include "path.hxx"
+#include 
 
 namespace configmgr {
-
-typedef std::list< Path > Additions;
+// Additions is a list of configuration node paths
+typedef std::list< std::vector > 

  1   2   >