summaryrefslogtreecommitdiff
path: root/configmgr/source/data.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2011-12-13 12:37:00 +0100
committerStephan Bergmann <sbergman@redhat.com>2011-12-13 12:50:34 +0100
commitbcdea3b379637a98e5bbc304078149ca6c2b6e03 (patch)
treea3803df980a54ab1a03c740c3114a54ca7d12f27 /configmgr/source/data.cxx
parentddf1cf333174777e7923aa0d6126daf2c8645fed (diff)
Simplified, type-safe C++ configuration access.
* New offapi com.sun.star.configuration entities to access the complete configuration read-only or read/write... * ...configmgr adapted to support those new services/singletons... * ...new unotools/configuration.hxx is the type-safe C++ plumbing on top of that... * ...officecfg now generates C++ headers to access all the properties and sets given in the .xcs files... * ...and svl's asiancfg.cxx exemplarily makes use of the new officecfg/Office/Common.hxx to access the configuration. * There is still TODOs: For one, see those listed in officecfg/registry/cppheader.xsl. For another, at least a notification mechanism for the new read-only configuration access and the C++ wrapper is missing.
Diffstat (limited to 'configmgr/source/data.cxx')
-rw-r--r--configmgr/source/data.cxx18
1 files changed, 15 insertions, 3 deletions
diff --git a/configmgr/source/data.cxx b/configmgr/source/data.cxx
index 0fdc1e5eba92..fcc42e97cecc 100644
--- a/configmgr/source/data.cxx
+++ b/configmgr/source/data.cxx
@@ -48,6 +48,7 @@
#include "groupnode.hxx"
#include "node.hxx"
#include "nodemap.hxx"
+#include "rootnode.hxx"
#include "setnode.hxx"
namespace configmgr {
@@ -207,6 +208,8 @@ rtl::Reference< Node > Data::findNode(
? rtl::Reference< Node >() : i->second;
}
+Data::Data(): root_(new RootNode(components)) {}
+
rtl::Reference< Node > Data::resolvePathRepresentation(
rtl::OUString const & pathRepresentation,
rtl::OUString * canonicRepresentation, Path * path, int * finalizedLayer)
@@ -218,6 +221,18 @@ rtl::Reference< Node > Data::resolvePathRepresentation(
pathRepresentation),
css::uno::Reference< css::uno::XInterface >());
}
+ if (path != 0) {
+ path->clear();
+ }
+ if (pathRepresentation.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("/"))) {
+ if (canonicRepresentation != 0) {
+ *canonicRepresentation = pathRepresentation;
+ }
+ if (finalizedLayer != 0) {
+ *finalizedLayer = NO_LAYER;
+ }
+ return root_;
+ }
rtl::OUString seg;
bool setElement;
rtl::OUString templateName;
@@ -231,9 +246,6 @@ rtl::Reference< Node > Data::resolvePathRepresentation(
}
NodeMap::const_iterator i(components.find(seg));
rtl::OUStringBuffer canonic;
- if (path != 0) {
- path->clear();
- }
rtl::Reference< Node > parent;
int finalized = NO_LAYER;
for (rtl::Reference< Node > p(i == components.end() ? 0 : i->second);;) {