summaryrefslogtreecommitdiffstats
path: root/configmgr/source/node.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/node.cxx
parentImprove quoting when calling submake for custom targets. (diff)
downloadcore-bcdea3b379637a98e5bbc304078149ca6c2b6e03.tar.gz
core-bcdea3b379637a98e5bbc304078149ca6c2b6e03.zip
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/node.cxx')
-rw-r--r--configmgr/source/node.cxx22
1 files changed, 8 insertions, 14 deletions
diff --git a/configmgr/source/node.cxx b/configmgr/source/node.cxx
index 892cdaa622fd..b6480820aedc 100644
--- a/configmgr/source/node.cxx
+++ b/configmgr/source/node.cxx
@@ -30,11 +30,7 @@
#include <cassert>
-#include "com/sun/star/uno/Reference.hxx"
-#include "com/sun/star/uno/RuntimeException.hpp"
-#include "com/sun/star/uno/XInterface.hpp"
#include "rtl/ref.hxx"
-#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
#include "data.hxx"
@@ -43,17 +39,15 @@
namespace configmgr {
-namespace {
-
-namespace css = com::sun::star;
-
+NodeMap const & Node::getMembers() const {
+ NodeMap * members = const_cast< Node * >(this)->getMemberMap();
+ assert(members != 0);
+ return *members;
}
-NodeMap & Node::getMembers() {
+NodeMap * Node::getMemberMap() {
assert(false);
- throw css::uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("this cannot happen")),
- css::uno::Reference< css::uno::XInterface >());
+ return 0;
}
rtl::OUString Node::getTemplateName() const {
@@ -87,8 +81,8 @@ int Node::getFinalized() const {
}
rtl::Reference< Node > Node::getMember(rtl::OUString const & name) {
- NodeMap & members = getMembers();
- NodeMap::iterator i(members.find(name));
+ NodeMap const & members = getMembers();
+ NodeMap::const_iterator i(members.find(name));
return i == members.end() ? rtl::Reference< Node >() : i->second;
}