summaryrefslogtreecommitdiff
path: root/configmgr
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2023-10-16 11:19:19 +0200
committerSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2023-11-09 15:37:16 +0100
commit700ac29771ccec2d66934f66b45a33a48a5ac3f1 (patch)
tree2b34a4490b56b48cf73da59e31e2867fe59f9f38 /configmgr
parentc5c2d3195189a329516c918faa251cff4baaed5a (diff)
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 <samuel.mehrbrodt@allotropia.de>
Diffstat (limited to 'configmgr')
-rw-r--r--configmgr/source/access.cxx13
-rw-r--r--configmgr/source/access.hxx3
-rw-r--r--configmgr/source/node.hxx4
-rw-r--r--configmgr/source/xcsparser.cxx2
-rw-r--r--configmgr/source/xcsparser.hxx1
5 files changed, 23 insertions, 0 deletions
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_;
};
}