Commits

Anonymous committed f525d35

CWS-TOOLING: integrate CWS sb99

Comments (0)

Files changed (351)

configmgr/prj/build.lst

-cg	configmgr	:	offapi comphelper cppuhelper tools vos NULL
+cg	configmgr	: BOOST:boost offapi comphelper cppuhelper salhelper tools vos NULL
 cg	configmgr								usr1	-	all	cg_mkout NULL
 cg	configmgr\inc							nmake	-	all	cg_inc NULL
 cg	configmgr\source\misc					nmake	-	all	cg_misc cg_inc NULL

configmgr/qa/unit/makefile.mk

 $(MISC)$/$(TARGET).rdb .ERRREMOVE:
     $(COPY) $(SOLARBINDIR)$/types.rdb $@
     regcomp -register -r $@ -c $(subst,$/,/ $(DLLDEST)$/configmgr2.uno$(DLLPOST))
-    regcomp -register -r $@ -c $(subst,$/,/ $(SOLARLIBDIR)/typeconverter.uno$(DLLPOST))
     regcomp -register -r $@ -c $(subst,$/,/ $(SOLARLIBDIR)/sax.uno$(DLLPOST))
-    regcomp -register -r $@ -c $(subst,$/,/ $(SOLARLIBDIR)/simplereg.uno$(DLLPOST))
+    regcomp -register -r $@ -c $(subst,$/,/ $(SOLARLIBDIR)/stocservices.uno$(DLLPOST))
     regcomp -register -r $@ -c $(subst,$/,/ $(SOLARLIBDIR)/streams.uno$(DLLPOST))
 
 test .PHONY: $(SHL1TARGETN) $(MISC)$/$(TARGET).rdb

configmgr/qa/unit/performance.cxx

 
 #include "common.hxx"
 
-using namespace css;
-
 void Test::setUp()
 {
     mpMagic = new Magic();
     }
 }
 
-uno::Any Test::getKey (const sal_Char *pPath, rtl::OUString aName)
+css::uno::Any Test::getKey (const sal_Char *pPath, rtl::OUString aName)
 {
-    uno::Reference< container::XHierarchicalNameAccess > xNameAccess( 
+    css::uno::Reference< css::container::XHierarchicalNameAccess > xNameAccess( 
         createView(pPath, false), css::uno::UNO_QUERY_THROW);
-    uno::Any aVal;
+    css::uno::Any aVal;
     aVal = xNameAccess->getByHierarchicalName (aName);
     disposeComponent (xNameAccess);
     return aVal;
 
 void Test::setKey (const sal_Char *pPath, rtl::OUString aName, css::uno::Any a)
 {
-    uno::Reference< util::XChangesBatch > xAppView;
+    css::uno::Reference< css::util::XChangesBatch > xAppView;
     
-    xAppView = uno::Reference< util::XChangesBatch > (
-        createView(pPath, true), uno::UNO_QUERY_THROW );
-    uno::Reference< container::XNameReplace > xSettings(xAppView, uno::UNO_QUERY_THROW);
+    xAppView = css::uno::Reference< css::util::XChangesBatch > (
+        createView(pPath, true), css::uno::UNO_QUERY_THROW );
+    css::uno::Reference< css::container::XNameReplace > xSettings(xAppView, css::uno::UNO_QUERY_THROW);
     rtl::OUString aStr;
     
     // set key
 
 void Test::resetKey (const sal_Char *pPath, rtl::OUString aName)
 {
-    uno::Reference< util::XChangesBatch > xAppView;
+    css::uno::Reference< css::util::XChangesBatch > xAppView;
 
     // reset to default
-    xAppView = uno::Reference< util::XChangesBatch > ( createView(pPath, true), uno::UNO_QUERY_THROW );
-    uno::Reference< container::XNameReplace > xSettings(xAppView, uno::UNO_QUERY_THROW);
+    xAppView = css::uno::Reference< css::util::XChangesBatch > ( createView(pPath, true), css::uno::UNO_QUERY_THROW );
+    css::uno::Reference< css::container::XNameReplace > xSettings(xAppView, css::uno::UNO_QUERY_THROW);
     
-    uno::Reference< beans::XPropertyState > xSettingsState(xSettings, uno::UNO_QUERY);
+    css::uno::Reference< css::beans::XPropertyState > xSettingsState(xSettings, css::uno::UNO_QUERY);
     xSettingsState->setPropertyToDefault(aName);
     xAppView->commitChanges();
     
     try {
         setKey ("/org.openoffice.Setup/Test",
                 rtl::OUString::createFromAscii("AString"),
-                uno::makeAny (rtl::OUString::createFromAscii("baa")));
+                css::uno::makeAny (rtl::OUString::createFromAscii("baa")));
 
         // check value
         rtl::OUString aStr;
     rtl::OUString aPropProperties( RTL_CONSTASCII_USTRINGPARAM( "Properties" ));
 
     try {
-        uno::Reference< container::XNameAccess > xNameAccess ( 
+        css::uno::Reference< css::container::XNameAccess > xNameAccess ( 
             createView("/org.openoffice.UI.GenericCommands/UserInterface/Commands", false),
             css::uno::UNO_QUERY_THROW);
         
         CPPUNIT_ASSERT_MESSAGE ("fetched UI generic commands", xNameAccess.is());
         
-        uno::Any a;
-        uno::Sequence< rtl::OUString > aNameSeq = xNameAccess->getElementNames();
+        css::uno::Any a;
+        css::uno::Sequence< rtl::OUString > aNameSeq = xNameAccess->getElementNames();
 
         CPPUNIT_ASSERT_MESSAGE ("right element / sequence", aNameSeq.getLength() == 696);
         sal_uInt32 end, start = osl_getGlobalTimer();
                 try
                 {
                     {
-                        uno::Reference< container::XNameAccess > xChildNameAccess;
+                        css::uno::Reference< css::container::XNameAccess > xChildNameAccess;
                         // This is the slow bit ! ...
                         // Creating the @#$@#$ing XNameAccess object [ 650 times ]
                         // which we then use to 'getByName' etc.

configmgr/qa/unit/threading.cxx

     } CATCH_FAIL ("checking keys exist")
 }
 
-typedef ::cppu::WeakImplHelper1< css::beans::XPropertyChangeListener > ListenerBase;
-
-class RecursiveListener : public ListenerBase
+class RecursiveListener : public cppu::WeakImplHelper1< css::beans::XPropertyChangeListener >
 { 
 public:
     sal_Int32 m_nRecurse;
   public:
     RecursiveListener (Test *pTest, int nCount,
                        const char *pPath, const char *pKey)
-        : ListenerBase()
-        , m_nRecurse (nCount)
+        : m_nRecurse (nCount)
         , m_pTest (pTest)
         , m_pPath (pPath)
         , m_pKey (pKey)
         disposeComponent (mxPropSet);
     }
 
-    virtual void SAL_CALL acquire() throw() { ListenerBase::acquire(); }
-    virtual void SAL_CALL release() throw() { ListenerBase::acquire(); }
+    virtual void SAL_CALL acquire() throw() { cppu::WeakImplHelper1< css::beans::XPropertyChangeListener >::acquire(); }
+    virtual void SAL_CALL release() throw() { cppu::WeakImplHelper1< css::beans::XPropertyChangeListener >::acquire(); }
     // XPropertyChangeListener
     virtual void SAL_CALL propertyChange( const ::css::beans::PropertyChangeEvent& ) throw (::css::uno::RuntimeException)
     {

configmgr/source/api/confeventhelpers.cxx

-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: confeventhelpers.cxx,v $
- * $Revision: 1.17 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_configmgr.hxx"
-
-#include <stdio.h>
-#include <string.h>
-#include "confeventhelpers.hxx"
-#include "configexcept.hxx" 
-#include "change.hxx" 
-#include "treechangelist.hxx" 
-#include <osl/diagnose.h>
-
-#ifndef INCLUDED_ALGORITHM
-#include <algorithm>
-#define INCLUDED_ALGORITHM
-#endif 
-
-namespace configmgr
-{
-	namespace internal
-	{
-
-////////////////////////////////////////////////////////////////////////
-    using namespace configuration;
-    namespace Path = configuration::Path;
-
-/////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////
-ConfigChangesBroadcasterImpl::ConfigChangesBroadcasterImpl() 
-{
-}
-
-/////////////////////////////////////////////////////////////////////////
-ConfigChangesBroadcasterImpl::~ConfigChangesBroadcasterImpl() 
-{
-	OSL_ENSURE(m_aListeners.begin() == m_aListeners.end(), "Remaining listeners found - forgot to dispose ?");
-	OSL_ENSURE(m_aPathMap.empty(), "Spurious mappings found");
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangesBroadcasterImpl::add(AbsolutePath const& aName, INodeListenerRef const& pListener) 
-{
-	osl::MutexGuard aGuard(m_aListeners.mutex);
-
-	InfoRef aAdded = m_aListeners.addListener(NodeListenerInfo(pListener));
-	aAdded->addPath(aName);
-	m_aPathMap.insert(PathMap::value_type(aName,aAdded));
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangesBroadcasterImpl::remove(INodeListenerRef const& pListener) 
-{
-	osl::MutexGuard aGuard(m_aListeners.mutex);
-
-	Listeners::Iterator const iter = m_aListeners.find(pListener);
-	if (iter != m_aListeners.end())
-	{
-		typedef NodeListenerInfo::Pathes Pathes;
-		Pathes const& pathes = iter->pathList();
-
-		// first clear the Path Map
-		for(Pathes::iterator itPath = pathes.begin(); itPath != pathes.end(); ++itPath)
-		{
-			typedef PathMap::iterator PMIter;
-			typedef std::pair<PMIter, PMIter> PMRange;
-
-			PMRange aRange = m_aPathMap.equal_range(*itPath);
-			while (aRange.first != aRange.second)
-			{
-				PMIter cur = aRange.first++;
-				if (cur->second == iter)
-					m_aPathMap.erase(cur);
-			}
-		}
-
-		// the remove the broadcast helper entry
-		m_aListeners.removeListener(pListener);
-	}
-}
-
-/////////////////////////////////////////////////////////////////////////
-// This should actually be available from the TreeChangeList
-/////////////////////////////////////////////////////////////////////////
-
-static Change const* resolvePath(Change const& rChange, RelativePath& aRelativePath, RemoveNode const*& pRemoveNode)
-{
-	RelativePath::Iterator aIter;
-
-	OSL_ASSERT(pRemoveNode == NULL);
-	pRemoveNode = NULL;
-
-    Change const* pChange = &rChange;
-	if (rChange.ISA(RemoveNode))
-		pRemoveNode = static_cast<RemoveNode const*>(pChange);
-
-	RelativePath::Iterator const aEnd(aRelativePath.end());
-
-	for( aIter = aRelativePath.begin();
-         aIter != aEnd;
-		 ++aIter)
-    {
-        OSL_ASSERT( pChange != NULL );
-
-		pChange = pChange->getSubChange(aIter->getName().toString());
-
-        if (pChange == NULL) break;
-
-        OSL_ASSERT(pRemoveNode == NULL);
-		OSL_ASSERT(aIter->getName().toString() == pChange->getNodeName());
-
-	    if (pChange->ISA(RemoveNode))
-		    pRemoveNode = static_cast<RemoveNode const*>(pChange);
-    }
-
-	if (pRemoveNode)
-	{
-        aRelativePath = RelativePath( Path::Rep(aRelativePath.begin(),aIter) );
-		OSL_ASSERT( aRelativePath.getLocalName().getName().toString() == pRemoveNode->getNodeName());
-	}
-	else 
-        OSL_ASSERT( pChange == 0 || configuration::matches(aRelativePath, RelativePath( Path::Rep(aRelativePath.begin(),aIter) )) );
-
-	return pChange;
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangesBroadcasterImpl::dispatchInner
-(
-	INodeListenerRef const& pTarget, 
-	AbsolutePath const& _aTargetPath,
-	Change const& rBaseChange, 
-	AbsolutePath const& _aChangeLocation,
-	sal_Bool , //_bError, 
-	IConfigBroadcaster* pSource
-)
-{
-    using namespace configuration;
-    try
-    {
-	    OSL_ASSERT(pTarget.is());
-        OSL_ASSERT( Path::hasPrefix( _aTargetPath, _aChangeLocation ) );
-
-        RelativePath aLocalPath = Path::stripPrefix( _aTargetPath, _aChangeLocation );
-
-	    RemoveNode const* pRemoved = 0;
-	    Change const* pTargetChange = resolvePath(rBaseChange, aLocalPath, pRemoved );
-
-		OSL_ASSERT( !pTargetChange || matches(_aChangeLocation.compose(aLocalPath),_aTargetPath) );
-
-	    if (pRemoved)
-		    pTarget->nodeDeleted(_aChangeLocation.compose(aLocalPath), pSource);
-
-        else if (pTargetChange)
-		    pTarget->nodeChanged(*pTargetChange, _aTargetPath, pSource);
-
-    }
-    catch (InvalidName& )
-    {
-        OSL_ENSURE(false,"ConfigChangesBroadcasterImpl: Could not dispatch notification: context path mismatch");
-    }
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangesBroadcasterImpl::dispatchOuter
-(
-	INodeListenerRef const& pTarget, 
-	AbsolutePath const& _aTargetPath,
-	Change const& rBaseChange, 
-	AbsolutePath const& _aChangeLocation,
-	sal_Bool , //_bError, 
-	IConfigBroadcaster* pSource
-)
-{
-    { (void)_aTargetPath; }
-	OSL_ASSERT(pTarget.is());
-    OSL_ASSERT( Path::hasPrefix( _aChangeLocation, _aTargetPath) );
-
-	pTarget->nodeChanged(rBaseChange, _aChangeLocation, pSource);
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangesBroadcasterImpl::dispatch(TreeChangeList const& rList_, sal_Bool _bError, IConfigBroadcaster* pSource)
-{
-	dispatch(rList_.root, rList_.getRootNodePath(),_bError, pSource);
-}
-/////////////////////////////////////////////////////////////////////////
-namespace
-{
-	struct DispatchTarget
-	{
-        DispatchTarget(INodeListenerRef _pTarget, AbsolutePath const* _pDispatchPath)
-        : pTarget(_pTarget), pDispatchPath( _pDispatchPath) {}
-
-		INodeListenerRef    pTarget;
-		AbsolutePath const* pDispatchPath;
-	};
-	typedef std::vector<DispatchTarget> DispatchTargets;
-}
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangesBroadcasterImpl::dispatch
-(
-	Change const& rBaseChange, 
-	AbsolutePath const& _aChangeLocation,
-	sal_Bool _bError, 
-	IConfigBroadcaster* pSource
-) 
-{
-    OSL_ENSURE(!_aChangeLocation.isRoot(),"Cannot dispatch changes directly to the root node");
-
-	// listeners registered under multiple sub-pathes will be called multiple times !
-
-	// Collect the targets
-	osl::ClearableMutexGuard aGuard(m_aListeners.mutex);
-
-	// Dispatch listeners to ancestors of the change root
-	DispatchTargets aOuterTargets;
-    if (_aChangeLocation.getDepth() > 1)
-	{
-        AbsolutePath const aModulePath( Path::Rep(*_aChangeLocation.begin()) );
-
-		PathMap::const_iterator itOuter = m_aPathMap.lower_bound( aModulePath ); 
-		PathMap::const_iterator const endOuter = m_aPathMap.upper_bound(_aChangeLocation.getParentPath());
-
-		// TODO: Both loops are so similar - they should be a single function
-		while (itOuter != endOuter)
-		{
-			OSL_ASSERT( m_aListeners.find(itOuter->second->get()) != m_aListeners.end() );
-
-			// check whether this should be dispatched at all
-            if ( Path::hasPrefix(_aChangeLocation,itOuter->first) )
-			{
-				aOuterTargets.push_back( DispatchTarget(itOuter->second->get(), &itOuter->first) );
-			}
-			++itOuter;
-		}
-	}
-
-	// Dispatch listeners to descendants of the change root
-	DispatchTargets aInnerTargets;
-	{
-		PathMap::const_iterator itInner = m_aPathMap.lower_bound(_aChangeLocation);
-
-        while(	itInner != m_aPathMap.end() && Path::hasPrefix(itInner->first,_aChangeLocation) )
-		{
-			OSL_ASSERT( m_aListeners.find(itInner->second->get()) != m_aListeners.end() );
-
-			aInnerTargets.push_back( DispatchTarget(itInner->second->get(), &itInner->first) );
-
-            ++itInner;
-		}
-	}
-
-	aGuard.clear();
-
-	{for (DispatchTargets::const_iterator it = aOuterTargets.begin(); it != aOuterTargets.end(); ++it){
-		this->dispatchOuter(it->pTarget, *it->pDispatchPath, rBaseChange, _aChangeLocation, _bError, pSource);
-	}}
-	{for (DispatchTargets::const_iterator it = aInnerTargets.begin(); it != aInnerTargets.end(); ++it){
-		this->dispatchInner(it->pTarget, *it->pDispatchPath, rBaseChange, _aChangeLocation, _bError, pSource);
-	}}
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigChangesBroadcasterImpl::disposing(IConfigBroadcaster* pSource) 
-{
-	osl::ClearableMutexGuard aGuard(m_aListeners.mutex);
-	m_aPathMap.clear();
-
-	aGuard.clear();
-	m_aListeners.disposing(pSource);
-}
-
-/////////////////////////////////////////////////////////////////////////
-/*		class ConfigMessageBroadcasterImpl
-		{
-		public:
-		private:
-			typedef BroadcastImplHelper<INodeListener*> Listeners;
-			Listeners m_aListeners;
-		};
-*/
-/////////////////////////////////////////////////////////////////////////
-/*void ConfigMessageBroadcasterImpl::add(IMessageHandler* pListener) 
-{
-	osl::MutexGuard aGuard(m_aListeners.mutex);
-
-	m_aListeners.addListener(pListener);
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigMessageBroadcasterImpl::remove(IMessageHandler* pListener) 
-{
-	osl::MutexGuard aGuard(m_aListeners.mutex);
-
-	m_aListeners.removeListener(pListener);
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigMessageBroadcasterImpl::dispatch(OUString const& _rNotifyReason, sal_Int32 _nNotificationId, IConfigBroadcaster* pSource) 
-{
-	osl::MutexGuard aGuard(m_aListeners.mutex);
-
-	for (Listeners::Iterator it = m_aListeners.begin(); it != m_aListeners.end(); )
-	{
-		// incrementing here allows a listener to remove itself from within the callback
-
-		// it is illegal to cause removal of another listener from the callback
-		// if this occurs (dereferencing, incrementing or comparing 'it' fails)
-		// we need to explicitly guard against that (which is really too expensive)
-
-		IMessageHandler* pHandler = *it;
-		++it;
-
-		if (pHandler)
-			pHandler->message(_rNotifyReason,_nNotificationId,pSource);
-	}
-
-}
-
-/////////////////////////////////////////////////////////////////////////
-void ConfigMessageBroadcasterImpl::disposing(IConfigBroadcaster* pSource) 
-{
-	osl::MutexGuard aGuard(m_aListeners.mutex);
-
-	m_aListeners.disposing(pSource);
-}
-*/
-/////////////////////////////////////////////////////////////////////////
-	} // namespace
-} // namespace
-
-
-

configmgr/source/api/confeventhelpers.hxx

-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: confeventhelpers.hxx,v $
- * $Revision: 1.12 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CONFIGMGR_API_EVENTHELPERS_HXX_
-#define CONFIGMGR_API_EVENTHELPERS_HXX_
-
-#include "confevents.hxx"
-#include "configpath.hxx"
-#include <com/sun/star/uno/RuntimeException.hpp>
-#include <osl/diagnose.h>
-#include <osl/mutex.hxx>
-
-#ifndef INCLUDED_MAP
-#include <map>
-#define INCLUDED_MAP
-#endif
-#ifndef INCLUDED_FUNCTIONAL
-#include <functional>
-#define INCLUDED_FUNCTIONAL
-#endif
-#include <hash_set>
-#ifndef INCLUDED_SET
-#include <set>
-#define INCLUDED_SET
-#endif
-
-namespace configmgr
-{
-	namespace internal
-	{
-
-        using namespace configuration;
-	////////////////////////////////////////////////////////////////////////
-		template <class ListenerRef>
-		class BroadcastImplHelper
-		{
-		public:
-			osl::Mutex mutex;
-
-		public:
-			BroadcastImplHelper() 
-			{}
-
-			~BroadcastImplHelper() 
-			{ 
-				OSL_ENSURE(m_aInterfaces.empty(), "Configuration Broadcaster was not disposed properly");
-			}
-
-		public:
-			typedef std::set<ListenerRef> Interfaces;
-			typedef typename Interfaces::iterator FullIterator;
-			typedef typename Interfaces::const_iterator Iterator;
-
-		public:
-			FullIterator addListener(ListenerRef aListener) 
-			{ 
-				return m_aInterfaces.insert(aListener).first; 
-			}
-			void removeListener(ListenerRef aListener) 
-			{ 
-				m_aInterfaces.erase(aListener); 
-			}
-			
-			void disposing(IConfigBroadcaster* pSource); 
-
-		public:
-			Iterator begin() const { return m_aInterfaces.begin(); }
-			Iterator end() const { return m_aInterfaces.end(); }
-
-			Iterator find(ListenerRef aListener) const   { return m_aInterfaces.find(aListener); }
-			FullIterator findFull(ListenerRef aListener) { return m_aInterfaces.find(aListener); }
-		private:
-			Interfaces m_aInterfaces;
-
-			// no implementation - not copyable
-			BroadcastImplHelper(BroadcastImplHelper&);
-			void operator=(BroadcastImplHelper&);
-		};
-
-		////////////////////////////////////////////////////////////////////////
-		template <class Listener>
-		void BroadcastImplHelper<Listener>::disposing(IConfigBroadcaster* pSource)
-		{
-			osl::ClearableMutexGuard aGuard(this->mutex);	// ensure that no notifications are running
-
-			Interfaces aTargets;
-			aTargets.swap(m_aInterfaces);
-
-			aGuard.clear();
-			for(FullIterator it = aTargets.begin(); it != aTargets.end(); )
-			{
-				FullIterator cur = it++;
-				if (*cur)
-					(*cur)->disposing(pSource);
-			}
-		}
-
-
-	/////////////////////////////////////////////////////////////////////////
-	
-		class NodeListenerInfo
-		{
-		public:
-            typedef std::hash_set<AbsolutePath, Path::Hash, Path::Equiv> Pathes;
-
-		public:
-			NodeListenerInfo(INodeListenerRef const&	pListener)
-				: m_pListener(pListener)
-			{
-			}
-
-		// path handling
-			Pathes const& pathList() const { return m_aPathes; }
-
-			void addPath(AbsolutePath const& sPath) const { m_aPathes.insert(sPath); }
-			void removePath(AbsolutePath const& sPath) const { m_aPathes.erase(sPath); }
-			//void removeChildPathes(OUString const& sPath);
-			
-		// behave as pointer for use as a 'reference' class 
-			INodeListenerRef get() const { return m_pListener; }
-			INodeListenerRef operator->() const { return get(); }
-			INodeListener& operator*() const { return *m_pListener; }
-		// needed to allow if (info) ... 
-			struct HasListener;
-			operator HasListener const*() const { return reinterpret_cast<HasListener*>(m_pListener.get()); }
-
-			bool operator < (NodeListenerInfo const& aInfo) const
-			{ return std::less<INodeListener*>()(m_pListener.get(), aInfo.m_pListener.get()); }
-			
-			bool operator == (NodeListenerInfo const& aInfo) const 
-			{ return !!( m_pListener == aInfo.m_pListener); }
-
-			bool operator > (NodeListenerInfo const& aInfo) const
-			{ return aInfo.operator < (*this); }
-			bool operator >= (NodeListenerInfo const& aInfo) const
-			{ return !operator<(aInfo); }
-			bool operator <= (NodeListenerInfo const& aInfo) const
-			{ return !operator>(aInfo); }
-
-			bool operator != (NodeListenerInfo const& aInfo) const
-			{ return !operator==(aInfo); }
-
-		private:
-			INodeListenerRef m_pListener;
-			mutable Pathes m_aPathes; // hack to be mutable even as set element
-		};
-		class ConfigChangesBroadcasterImpl
-		{
-		public:
-			ConfigChangesBroadcasterImpl(); 
-			~ConfigChangesBroadcasterImpl(); 
-
-			void add(AbsolutePath const& aPath, INodeListenerRef const& pListener);
-			void remove(INodeListenerRef const& pListener);
-
-//			void removed(OUString const& aPath, bool bRemovedFromModel, IConfigBroadcaster* pSource);
-
-			void dispatch(Change const& rBaseChange, AbsolutePath const& sChangeLocation, sal_Bool _bError, IConfigBroadcaster* pSource);
-			void dispatch(TreeChangeList const& rList_, sal_Bool _bError, IConfigBroadcaster* pSource);
-			void disposing(IConfigBroadcaster* pSource);
-		private:
-			typedef BroadcastImplHelper<NodeListenerInfo> Listeners;
-			typedef Listeners::FullIterator InfoRef;
-            typedef std::multimap<AbsolutePath, InfoRef, Path::Before> PathMap; 
-			Listeners m_aListeners;
-			PathMap m_aPathMap;
-		private:
-			void dispatchInner(INodeListenerRef const& pTarget, AbsolutePath const& sTargetPath, Change const& rBaseChange, AbsolutePath const& sChangeLocation, sal_Bool _bError, IConfigBroadcaster* pSource);
-			void dispatchOuter(INodeListenerRef const& pTarget, AbsolutePath const& sTargetPath, Change const& rBaseChange, AbsolutePath const& sChangeLocation, sal_Bool _bError, IConfigBroadcaster* pSource);
-		};
-
-	/////////////////////////////////////////////////////////////////////////
-	} // namespace
-} // namespace
-
-#endif // CONFIGMGR_API_EVENTHELPERS_HXX_
-
-

configmgr/source/api/confevents.cxx

 #include <stdio.h>
 #include <string.h>
 #include "confevents.hxx"
-#include "confeventhelpers.hxx"
+#include "configexcept.hxx"
 #include "treechangelist.hxx"
 #include <osl/diagnose.h>
 namespace configmgr
 {
 	/////////////////////////////////////////////////////////////////////////
-	using internal::ConfigChangesBroadcasterImpl;
-
-	/////////////////////////////////////////////////////////////////////////
-	class ConfigChangeBroadcastHelper // broadcasts changes for a given set of options
-	{
-		ConfigChangesBroadcasterImpl m_changes;
-	public:
-		ConfigChangeBroadcastHelper();
-		~ConfigChangeBroadcastHelper();
-		
-		void broadcast(TreeChangeList const& anUpdate, sal_Bool bError, IConfigBroadcaster* pSource);
-
-	public:
-		// IConfigBroadcaster implementation helper
-		void addListener(AbsolutePath const& aName, INodeListenerRef const& );
-		void removeListener(INodeListenerRef const&);
-
-		void dispose(IConfigBroadcaster* pSource);
-	};
-
-	/////////////////////////////////////////////////////////////////////////
-	ConfigChangeBroadcaster::ConfigChangeBroadcaster()
-	{
-	}
-
-	ConfigChangeBroadcaster::~ConfigChangeBroadcaster()
-	{
-	}
-
-	/////////////////////////////////////////////////////////////////////////
 	ConfigChangeBroadcastHelper::ConfigChangeBroadcastHelper()
-		: m_changes()
 	{
 	}
 
 	ConfigChangeBroadcastHelper::~ConfigChangeBroadcastHelper()
 	{
+        OSL_ENSURE(m_aListeners.begin() == m_aListeners.end(), "Remaining listeners found - forgot to dispose ?");
+        OSL_ENSURE(m_aPathMap.empty(), "Spurious mappings found");
 	}
 
 	/////////////////////////////////////////////////////////////////////////
-	void ConfigChangeBroadcastHelper::dispose(IConfigBroadcaster* pSource)
+	void ConfigChangeBroadcastHelper::dispose(TreeManager * pSource)
 	{
-		m_changes.disposing(pSource);
+		disposing(pSource);
 	}
 
 	/////////////////////////////////////////////////////////////////////////
-	// IConfigBroadcaster implementation 
-	void ConfigChangeBroadcaster::addListener(AbsolutePath const& aName, RequestOptions const & _aOptions, INodeListenerRef const& pHandler)	
+	void ConfigChangeBroadcastHelper::addListener(configuration::AbsolutePath const& aName, rtl::Reference<INodeListener> const& pHandler)	
 	{ 
-		if (ConfigChangeBroadcastHelper* pHelper = getBroadcastHelper(_aOptions,true))
-		{
-			pHelper->addListener(aName, pHandler); 
-		}
-		else
-			OSL_ASSERT(false);
+		add(aName, pHandler); 
 	}
 
-	void ConfigChangeBroadcaster::removeListener(RequestOptions const & _aOptions, INodeListenerRef const& pHandler)						
+	void ConfigChangeBroadcastHelper::removeListener(rtl::Reference<INodeListener> const& pHandler)						
 	{ 
-		if (ConfigChangeBroadcastHelper* pHelper = getBroadcastHelper(_aOptions,false))
+		remove(pHandler); 
+	}
+
+	/////////////////////////////////////////////////////////////////////////
+	void ConfigChangeBroadcastHelper::broadcast(TreeChangeList const& anUpdate, sal_Bool bError, TreeManager * pSource)
+	{
+		dispatch(anUpdate, bError, pSource);
+	}
+
+/////////////////////////////////////////////////////////////////////////
+void ConfigChangeBroadcastHelper::add(configuration::AbsolutePath const& aName, rtl::Reference<INodeListener> const& pListener) 
+{
+	osl::MutexGuard aGuard(m_aListeners.mutex);
+
+    internal::BroadcastImplHelper<internal::NodeListenerInfo>::Interfaces::iterator aAdded = m_aListeners.addListener(internal::NodeListenerInfo(pListener));
+	aAdded->addPath(aName);
+	m_aPathMap.insert(PathMap::value_type(aName,aAdded));
+}
+
+/////////////////////////////////////////////////////////////////////////
+void ConfigChangeBroadcastHelper::remove(rtl::Reference<INodeListener> const& pListener) 
+{
+	osl::MutexGuard aGuard(m_aListeners.mutex);
+
+    internal::BroadcastImplHelper<internal::NodeListenerInfo>::Interfaces::const_iterator const iter = m_aListeners.find(pListener);
+	if (iter != m_aListeners.end())
+	{
+        internal::NodeListenerInfo::Pathes const& pathes = iter->pathList();
+
+		// first clear the Path Map
+		for(internal::NodeListenerInfo::Pathes::iterator itPath = pathes.begin(); itPath != pathes.end(); ++itPath)
 		{
-			pHelper->removeListener( pHandler); 
+			std::pair<PathMap::iterator, PathMap::iterator> aRange = m_aPathMap.equal_range(*itPath);
+			while (aRange.first != aRange.second)
+			{
+				PathMap::iterator cur = aRange.first++;
+				if (cur->second == iter)
+					m_aPathMap.erase(cur);
+			}
+		}
+
+		// the remove the broadcast helper entry
+		m_aListeners.removeListener(pListener);
+	}
+}
+
+/////////////////////////////////////////////////////////////////////////
+// This should actually be available from the TreeChangeList
+/////////////////////////////////////////////////////////////////////////
+
+static Change const* resolvePath(Change const& rChange, configuration::RelativePath& aRelativePath, RemoveNode const*& pRemoveNode)
+{
+	std::vector<configuration::Path::Component>::const_reverse_iterator aIter;
+
+	OSL_ASSERT(pRemoveNode == NULL);
+	pRemoveNode = NULL;
+
+    Change const* pChange = &rChange;
+    pRemoveNode = dynamic_cast<RemoveNode const*>(pChange);
+
+	std::vector<configuration::Path::Component>::const_reverse_iterator const aEnd(aRelativePath.end());
+
+	for( aIter = aRelativePath.begin();
+         aIter != aEnd;
+		 ++aIter)
+    {
+        OSL_ASSERT( pChange != NULL );
+
+		pChange = pChange->getSubChange(aIter->getName());
+
+        if (pChange == NULL) break;
+
+        OSL_ASSERT(pRemoveNode == NULL);
+		OSL_ASSERT(aIter->getName() == pChange->getNodeName());
+
+        pRemoveNode = dynamic_cast<RemoveNode const*>(pChange);
+    }
+
+	if (pRemoveNode)
+	{
+        aRelativePath = configuration::RelativePath( configuration::Path::Rep(aRelativePath.begin(),aIter) );
+		OSL_ASSERT( aRelativePath.getLocalName().getName() == pRemoveNode->getNodeName());
+	}
+	else 
+        OSL_ASSERT( pChange == 0 || configuration::matches(aRelativePath, configuration::RelativePath( configuration::Path::Rep(aRelativePath.begin(),aIter) )) );
+
+	return pChange;
+}
+
+/////////////////////////////////////////////////////////////////////////
+void ConfigChangeBroadcastHelper::dispatchInner
+(
+	rtl::Reference<INodeListener> const& pTarget, 
+	configuration::AbsolutePath const& _aTargetPath,
+	Change const& rBaseChange, 
+	configuration::AbsolutePath const& _aChangeLocation,
+	sal_Bool , //_bError, 
+	TreeManager * pSource
+)
+{
+    try
+    {
+	    OSL_ASSERT(pTarget.is());
+        OSL_ASSERT( configuration::Path::hasPrefix( _aTargetPath, _aChangeLocation ) );
+
+        configuration::RelativePath aLocalPath = configuration::Path::stripPrefix( _aTargetPath, _aChangeLocation );
+
+	    RemoveNode const* pRemoved = 0;
+	    Change const* pTargetChange = resolvePath(rBaseChange, aLocalPath, pRemoved );
+
+		OSL_ASSERT( !pTargetChange || matches(_aChangeLocation.compose(aLocalPath),_aTargetPath) );
+
+	    if (pRemoved)
+		    pTarget->nodeDeleted(_aChangeLocation.compose(aLocalPath), pSource);
+
+        else if (pTargetChange)
+		    pTarget->nodeChanged(*pTargetChange, _aTargetPath, pSource);
+
+    }
+    catch (configuration::InvalidName& )
+    {
+        OSL_ENSURE(false,"ConfigChangeBroadcastHelper: Could not dispatch notification: context path mismatch");
+    }
+}
+
+/////////////////////////////////////////////////////////////////////////
+void ConfigChangeBroadcastHelper::dispatchOuter
+(
+	rtl::Reference<INodeListener> const& pTarget, 
+	configuration::AbsolutePath const& _aTargetPath,
+	Change const& rBaseChange, 
+	configuration::AbsolutePath const& _aChangeLocation,
+	sal_Bool , //_bError, 
+	TreeManager * pSource
+)
+{
+    { (void)_aTargetPath; }
+	OSL_ASSERT(pTarget.is());
+    OSL_ASSERT( configuration::Path::hasPrefix( _aChangeLocation, _aTargetPath) );
+
+	pTarget->nodeChanged(rBaseChange, _aChangeLocation, pSource);
+}
+
+/////////////////////////////////////////////////////////////////////////
+void ConfigChangeBroadcastHelper::dispatch(TreeChangeList const& rList_, sal_Bool _bError, TreeManager * pSource)
+{
+	dispatch(rList_.root, rList_.getRootNodePath(),_bError, pSource);
+}
+
+/////////////////////////////////////////////////////////////////////////
+namespace
+{
+	struct DispatchTarget
+	{
+        DispatchTarget(rtl::Reference<INodeListener> _pTarget, configuration::AbsolutePath const* _pDispatchPath)
+        : pTarget(_pTarget), pDispatchPath( _pDispatchPath) {}
+
+		rtl::Reference<INodeListener>    pTarget;
+		configuration::AbsolutePath const* pDispatchPath;
+	};
+}
+/////////////////////////////////////////////////////////////////////////
+void ConfigChangeBroadcastHelper::dispatch
+(
+	Change const& rBaseChange, 
+	configuration::AbsolutePath const& _aChangeLocation,
+	sal_Bool _bError, 
+	TreeManager * pSource
+) 
+{
+    OSL_ENSURE(!_aChangeLocation.isRoot(),"Cannot dispatch changes directly to the root node");
+
+	// listeners registered under multiple sub-pathes will be called multiple times !
+
+	// Collect the targets
+	osl::ClearableMutexGuard aGuard(m_aListeners.mutex);
+
+	// Dispatch listeners to ancestors of the change root
+	std::vector<DispatchTarget> aOuterTargets;
+    if (_aChangeLocation.getDepth() > 1)
+	{
+        configuration::AbsolutePath const aModulePath( configuration::Path::Rep(*_aChangeLocation.begin()) );
+
+		PathMap::const_iterator itOuter = m_aPathMap.lower_bound( aModulePath ); 
+		PathMap::const_iterator const endOuter = m_aPathMap.upper_bound(_aChangeLocation.getParentPath());
+
+		// TODO: Both loops are so similar - they should be a single function
+		while (itOuter != endOuter)
+		{
+			OSL_ASSERT( m_aListeners.find(itOuter->second->get()) != m_aListeners.end() );
+
+			// check whether this should be dispatched at all
+            if ( configuration::Path::hasPrefix(_aChangeLocation,itOuter->first) )
+			{
+				aOuterTargets.push_back( DispatchTarget(itOuter->second->get(), &itOuter->first) );
+			}
+			++itOuter;
 		}
 	}
 
-	/////////////////////////////////////////////////////////////////////////
-	void ConfigChangeBroadcaster::fireChanges(TreeChangeList const& rList_, sal_Bool bError_)
+	// Dispatch listeners to descendants of the change root
+	std::vector<DispatchTarget> aInnerTargets;
 	{
-		if (ConfigChangeBroadcastHelper* pHelper = getBroadcastHelper(rList_.getOptions(),false))
+		PathMap::const_iterator itInner = m_aPathMap.lower_bound(_aChangeLocation);
+
+        while(	itInner != m_aPathMap.end() && configuration::Path::hasPrefix(itInner->first,_aChangeLocation) )
 		{
-			pHelper->broadcast(rList_, bError_, this);
+			OSL_ASSERT( m_aListeners.find(itInner->second->get()) != m_aListeners.end() );
+
+			aInnerTargets.push_back( DispatchTarget(itInner->second->get(), &itInner->first) );
+
+            ++itInner;
 		}
 	}
 
-	/////////////////////////////////////////////////////////////////////////
-	ConfigChangeBroadcastHelper* ConfigChangeBroadcaster::newBroadcastHelper() 
-	{
-		return new ConfigChangeBroadcastHelper();
-	}
-	/////////////////////////////////////////////////////////////////////////
-	void ConfigChangeBroadcaster::disposeBroadcastHelper(ConfigChangeBroadcastHelper* pHelper) 
-	{
-		if (pHelper)
-		{
-			pHelper->dispose(this);
-			delete pHelper;
-		}
-	}
-	/////////////////////////////////////////////////////////////////////////
-	// IConfigBroadcaster implementation help
-	void ConfigChangeBroadcastHelper::addListener(AbsolutePath const& aName, INodeListenerRef const& pHandler)	
-	{ 
-		m_changes.add(aName, pHandler); 
-	}
+	aGuard.clear();
 
-	void ConfigChangeBroadcastHelper::removeListener(INodeListenerRef const& pHandler)						
-	{ 
-		m_changes.remove(pHandler); 
-	}
+	{for (std::vector<DispatchTarget>::const_iterator it = aOuterTargets.begin(); it != aOuterTargets.end(); ++it){
+		this->dispatchOuter(it->pTarget, *it->pDispatchPath, rBaseChange, _aChangeLocation, _bError, pSource);
+	}}
+	{for (std::vector<DispatchTarget>::const_iterator it = aInnerTargets.begin(); it != aInnerTargets.end(); ++it){
+		this->dispatchInner(it->pTarget, *it->pDispatchPath, rBaseChange, _aChangeLocation, _bError, pSource);
+	}}
+}
 
-/*	void ConfigChangeBroadcastHelper::removeNode(OUString const& aPath, bool bRemovedFromModel, IConfigBroadcaster* pSource)
-	{ 
-		m_changes.removed(aPath, bRemovedFromModel,pSource); 
-	}
-*/
-	/////////////////////////////////////////////////////////////////////////
-	void ConfigChangeBroadcastHelper::broadcast(TreeChangeList const& anUpdate, sal_Bool bError, IConfigBroadcaster* pSource)
-	{
-		m_changes.dispatch(anUpdate, bError, pSource);
-	}
+/////////////////////////////////////////////////////////////////////////
+void ConfigChangeBroadcastHelper::disposing(TreeManager * pSource) 
+{
+	osl::ClearableMutexGuard aGuard(m_aListeners.mutex);
+	m_aPathMap.clear();
 
+	aGuard.clear();
+	m_aListeners.disposing(pSource);
+}
 
 } // namespace
 

configmgr/source/api/confsvccomponent.cxx

 #include "precompiled_configmgr.hxx"
 
 #include "confsvccomponent.hxx"
+#include "datalock.hxx"
 #include <com/sun/star/lang/DisposedException.hpp>
 #include <cppuhelper/typeprovider.hxx>
 #include <osl/mutex.hxx>
 
 
 	ServiceComponentImpl::ServiceComponentImpl(ServiceImplementationInfo const* aInfo)
-		: ServiceImplBase(UnoApiLock::getLock())
+		: ::cppu::WeakComponentImplHelper1< lang::XServiceInfo >(UnoApiLock::getLock())
 		, m_info(aInfo)
 	{
 	}
 
 	void ServiceComponentImpl::disposing()
 	{
-		ServiceImplBase::disposing();
+		::cppu::WeakComponentImplHelper1< lang::XServiceInfo >::disposing();
 	}
 	void ServiceComponentImpl::checkAlive() throw (uno::RuntimeException)
 	{
 		checkAlive("Object was disposed");
 	}
-	void ServiceComponentImpl::checkAlive(OUString const& sMessage) throw (uno::RuntimeException)
+	void ServiceComponentImpl::checkAlive(rtl::OUString const& sMessage) throw (uno::RuntimeException)
 	{
 		if (rBHelper.bDisposed)
 			throw lang::DisposedException(sMessage, *this);
 	}
 
 	// XServiceInfo
-	OUString SAL_CALL ServiceComponentImpl::getImplementationName(  ) throw(uno::RuntimeException)
+	rtl::OUString SAL_CALL ServiceComponentImpl::getImplementationName(  ) throw(uno::RuntimeException)
 	{
 		return ServiceInfoHelper(m_info).getImplementationName();
 	}
 		return ServiceInfoHelper(m_info).supportsService( ServiceName );
 	}
 
-	uno::Sequence< OUString > SAL_CALL ServiceComponentImpl::getSupportedServiceNames(  ) throw(uno::RuntimeException)
+	uno::Sequence< rtl::OUString > SAL_CALL ServiceComponentImpl::getSupportedServiceNames(  ) throw(uno::RuntimeException)
 	{
 		return ServiceInfoHelper(m_info).getSupportedServiceNames( );
 	}

configmgr/source/api/makefile.mk

 
 SLOFILES=	\
 		$(SLO)$/confevents.obj	\
-		$(SLO)$/confeventhelpers.obj	\
 		$(SLO)$/confsvccomponent.obj
 
 # --- Targets ----------------------------------

configmgr/source/api2/accessimpl.cxx

 		namespace lang = css::lang;
 		namespace util = css::util;
 
-		using uno::RuntimeException;
-		using uno::Reference;
-		using uno::Any;
-		using uno::Sequence;
-		using lang::NoSupportException;
-
-		using configuration::AnyNodeRef;
-		using configuration::NodeRef;
-		using configuration::ValueRef;
-
-		using configuration::Tree;
-		using configuration::Name;
-		using configuration::AbsolutePath;
-		using configuration::RelativePath;
-		using node::Attributes;
-
 //-----------------------------------------------------------------------------------
 // Constructors
 //-----------------------------------------------------------------------------------
 
 // XHierarchicalName
 //------------------------------------------------------------------------------------------------------------------
-OUString implGetHierarchicalName( NodeAccess& rNode ) throw(RuntimeException)
+rtl::OUString implGetHierarchicalName( NodeAccess& rNode ) throw(uno::RuntimeException)
 {
 	// RTL_LOGFILE_CONTEXT(aLog, "Configmgr::API::implGetHierarchicalName()");
 
-	OUString sRet;
+	rtl::OUString sRet;
 	try
 	{
-		GuardedNodeDataAccess lock( rNode );
+		GuardedNodeData<NodeAccess> lock( rNode );
 
-		Tree aTree( lock.getTree());
+        rtl::Reference< configuration::Tree > aTree( lock.getTree());
 
-		AbsolutePath const aFullPath  = aTree.getAbsolutePath(lock.getNode());
+		configuration::AbsolutePath const aFullPath  = aTree->getAbsolutePath(lock.getNode());
 		sRet = aFullPath.toString();
 	}
 	catch (configuration::Exception& ex)
 }
 
 //------------------------------------------------------------------------------------------------------------------
-OUString implComposeHierarchicalName(NodeGroupInfoAccess& rNode, const OUString& sRelativeName )
-	throw(css::lang::IllegalArgumentException, NoSupportException, RuntimeException)
+rtl::OUString implComposeHierarchicalName(NodeGroupInfoAccess& rNode, const rtl::OUString& sRelativeName )
+	throw(css::lang::IllegalArgumentException, lang::NoSupportException, uno::RuntimeException)
 {
-	using configuration::validateRelativePath; // should actually be found by "Koenig" lookup, but MSVC6 fails there
-	OUString sRet;
+	rtl::OUString sRet;
 	try
 	{
-		GuardedNodeDataAccess lock( rNode );
-		NodeRef aNode( lock.getNode() );
-		Tree aTree( lock.getTree() );
+		GuardedNodeData<NodeAccess> lock( rNode );
+		configuration::NodeRef aNode( lock.getNode() );
+        rtl::Reference< configuration::Tree > aTree( lock.getTree() );
 
-		RelativePath const aAddedPath = validateRelativePath(sRelativeName, aTree, aNode);
+		configuration::RelativePath const aAddedPath = configuration::validateRelativePath(sRelativeName, aTree, aNode);
 
 		// TODO: add (relative) name validation based on node type - may then need provider lock
-		AbsolutePath const aFullPath = aTree.getAbsolutePath(aNode).compose(aAddedPath);
+		configuration::AbsolutePath const aFullPath = aTree->getAbsolutePath(aNode).compose(aAddedPath);
 
 		sRet = aFullPath.toString();
 	}
 }
 
 //------------------------------------------------------------------------------------------------------------------
-OUString implComposeHierarchicalName(NodeSetInfoAccess& rNode, const OUString& sElementName )
-	throw(css::lang::IllegalArgumentException, NoSupportException, RuntimeException)
+rtl::OUString implComposeHierarchicalName(NodeSetInfoAccess& rNode, const rtl::OUString& sElementName )
+	throw(css::lang::IllegalArgumentException, lang::NoSupportException, uno::RuntimeException)
 {
-	using configuration::validateElementPathComponent; // should actually be found by "Koenig" lookup, but MSVC6 fails there
-    using configuration::Path::Component;
-	OUString sRet;
+	rtl::OUString sRet;
 	try
 	{
-		GuardedNodeDataAccess lock( rNode );
-		NodeRef aNode( lock.getNode() );
-		Tree aTree( lock.getTree() );
+		GuardedNodeData<NodeAccess> lock( rNode );
+		configuration::NodeRef aNode( lock.getNode() );
+        rtl::Reference< configuration::Tree > aTree( lock.getTree() );
 
-        /*Path::*/Component const aAddedName = validateElementPathComponent(sElementName, aTree, aNode);
+        configuration::Path::Component const aAddedName = configuration::validateElementPathComponent(sElementName, aTree, aNode);
 
 		// TODO: add (relative) name validation based on node type - may then need provider lock
-		AbsolutePath const aFullPath = aTree.getAbsolutePath(aNode).compose(aAddedName);
+		configuration::AbsolutePath const aFullPath = aTree->getAbsolutePath(aNode).compose(aAddedName);
 
 		sRet = aFullPath.toString();
 	}
 
 //-----------------------------------------------------------------------------------
 // for group nodes
-uno::Type implGetElementType(NodeGroupInfoAccess& rNode) throw(RuntimeException)
+uno::Type implGetElementType(NodeGroupInfoAccess& rNode) throw(uno::RuntimeException)
 {
 	rNode.checkAlive();
 	// group nodes have a mix of types
 }
 
 // for set nodes
-uno::Type implGetElementType(NodeSetInfoAccess& rNode) throw(RuntimeException)
+uno::Type implGetElementType(NodeSetInfoAccess& rNode) throw(uno::RuntimeException)
 {
 	uno::Type aRet;
 	try
 	{
 		GuardedNodeData<NodeSetInfoAccess> lock( rNode );
 
-		aRet = rNode.getElementInfo().getElementType();
+		aRet = rNode.getElementInfo()->getInstanceType();
 	}
 	catch (configuration::Exception& ex)
 	{
 
 //-----------------------------------------------------------------------------------
 // for group nodes
-sal_Bool implHasElements(NodeGroupInfoAccess& rNode) throw(RuntimeException)
+sal_Bool implHasElements(NodeGroupInfoAccess& rNode) throw(uno::RuntimeException)
 {
 	//	rNode.checkAlive();
 //	return true;	// group nodes always have children
 // Better: cater for the case where we are reaching the depth limit
 	try
 	{
-		GuardedNodeDataAccess lock( rNode ); // no provider lock needed
+		GuardedNodeData<NodeAccess> lock( rNode ); // no provider lock needed
 
-		Tree    aThisTree( lock.getTree() );
-		NodeRef aThisNode( lock.getNode() );
-		OSL_ASSERT( !aThisTree.hasElements(aThisNode) );
-		return aThisTree.hasChildren(aThisNode);
+        rtl::Reference< configuration::Tree > aThisTree( lock.getTree() );
+		configuration::NodeRef aThisNode( lock.getNode() );
+		OSL_ASSERT( !aThisTree->hasElements(aThisNode) );
+		return aThisTree->hasChildren(aThisNode);
 	}
 	catch (configuration::Exception& ex)
 	{
 }
 
 // for set nodes
-sal_Bool implHasElements(NodeSetInfoAccess& rNode) throw(RuntimeException)
+sal_Bool implHasElements(NodeSetInfoAccess& rNode) throw(uno::RuntimeException)
 {
 	try
 	{
-		GuardedNodeDataAccess lock( rNode ); // provider lock needed
+		GuardedNodeData<NodeAccess> lock( rNode ); // provider lock needed
 
-		Tree    aThisTree( lock.getTree() );
-		NodeRef aThisNode( lock.getNode() );
-		OSL_ASSERT( !aThisTree.hasChildren(aThisNode) );
-		return aThisTree.hasElements(aThisNode);
+        rtl::Reference< configuration::Tree > aThisTree( lock.getTree() );
+		configuration::NodeRef aThisNode( lock.getNode() );
+		OSL_ASSERT( !aThisTree->hasChildren(aThisNode) );
+		return aThisTree->hasElements(aThisNode);
 	}
 	catch (configuration::Exception& ex)
 	{
 //------------------------------------------------------------------------------------------------------------------
 namespace internal
 {
-	using namespace configuration;
-	struct SearchExactName : private NodeVisitor
+	struct SearchExactName : private configuration::NodeVisitor
 	{
 	protected:
 		// warning: order dependency
-		RelativePath aSearchPath;
-		RelativePath::MutatingIterator pSearchComponent;
+		configuration::RelativePath aSearchPath;
+		std::vector<configuration::Path::Component>::reverse_iterator pSearchComponent;
 	public:
 		explicit
-		SearchExactName(const RelativePath& aLookFor)
+		SearchExactName(const configuration::RelativePath& aLookFor)
 		: aSearchPath(aLookFor)
 		, pSearchComponent(aSearchPath.begin_mutate())
 		{}
 
 		bool complete() { return aSearchPath.end_mutate() == pSearchComponent; }
 
-		bool search(NodeRef const& aNode, Tree const& aTree);
+		bool search(configuration::NodeRef const& aNode, rtl::Reference< configuration::Tree > const& aTree);
 
-		RelativePath const& getBestMatch() const { return aSearchPath; }
+		configuration::RelativePath const& getBestMatch() const { return aSearchPath; }
 
 	private:
-		bool findMatch(NodeRef& aNode, Tree& aTree);
-		virtual Result handle(Tree const& aTree, NodeRef const&); // NodeVisitor
-		virtual Result handle(Tree const& aTree, ValueRef const&); // NodeVisitor
+		bool findMatch(configuration::NodeRef& aNode, rtl::Reference< configuration::Tree > & aTree);
+		virtual Result handle(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const&); // NodeVisitor
+		virtual Result handle(rtl::Reference< configuration::Tree > const& aTree, configuration::ValueRef const&); // NodeVisitor
 	};
 //..................................................................................................................
-	bool SearchExactName::findMatch(NodeRef& aNode, Tree& aTree)
+	bool SearchExactName::findMatch(configuration::NodeRef& aNode, rtl::Reference< configuration::Tree > & aTree)
 	{
 		OSL_ASSERT( !complete() );
 
 		if ( !aNode.isValid() ) return false;
 
-		using configuration::hasChildOrElement;
-		using configuration::findInnerChildOrAvailableElement;
-
 		// exact match ?
-		if (!hasChildOrElement(aTree,aNode,*pSearchComponent))
+		if (!configuration::hasChildOrElement(aTree,aNode,*pSearchComponent))
 		{
-			if (aTree.dispatchToChildren(aNode,*this) == CONTINUE) // not found there
+			if (aTree->dispatchToChildren(aNode,*this) == CONTINUE) // not found there
 				return false;
 		}
-		OSL_ASSERT(hasChildOrElement(aTree,aNode,*pSearchComponent));
+		OSL_ASSERT(configuration::hasChildOrElement(aTree,aNode,*pSearchComponent));
 
-		if (! findInnerChildOrAvailableElement(aTree,aNode,pSearchComponent->getName()) )
-            aNode = NodeRef(); // will stop recursion (value or unloaded element found)
+		if (! configuration::findInnerChildOrAvailableElement(aTree,aNode,pSearchComponent->getName()) )
+            aNode = configuration::NodeRef(); // will stop recursion (value or unloaded element found)
         ++pSearchComponent;
 
         return true;
 	}
 	//..................................................................................................................
     // helper
-    static Path::Component getExtendedNodeName(Tree const& aTree, NodeRef const& aNode, Name const& aSimpleNodeName)
+    static configuration::Path::Component getExtendedNodeName(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode, rtl::OUString const& aSimpleNodeName)
     {
-	    OSL_PRECOND( !aTree.isEmpty(), "ERROR: Configuration: Tree operation requires valid tree" );
-	    OSL_PRECOND( !aNode.isValid() || aTree.isValidNode(aNode), "ERROR: Configuration: NodeRef does not match tree" );
+	    OSL_PRECOND( !configuration::isEmpty(aTree.get()), "ERROR: Configuration: Tree operation requires valid tree" );
+	    OSL_PRECOND( !aNode.isValid() || aTree->isValidNode(aNode.getOffset()), "ERROR: Configuration: NodeRef does not match tree" );
 
-        if (aTree.isRootNode(aNode))
-            return aTree.getRootName();
+        if (aTree->isRootNode(aNode))
+            return aTree->getExtendedRootName();
 
         else
-            return Path::wrapSimpleName(aSimpleNodeName);
+            return configuration::Path::wrapSimpleName(aSimpleNodeName);
     }
 	//..................................................................................................................
-	NodeVisitor::Result SearchExactName::handle(Tree const& aTree, NodeRef const& aNode)
+	configuration::NodeVisitor::Result SearchExactName::handle(rtl::Reference< configuration::Tree > const& aTree, configuration::NodeRef const& aNode)
 	{
 		OSL_ASSERT( aNode.isValid() );
 		OSL_ASSERT( !complete() );
 
 		// find inexact match (the first one, but the order is unspecified)
 		// TODO: Add support for node-type-specific element names
-		Name aNodeName = aTree.getName(aNode);
-        Name aSearchName = pSearchComponent->getName();
-		if (aNodeName.toString().equalsIgnoreAsciiCase(aSearchName.toString()))
+        rtl::OUString aNodeName = aTree->getSimpleNodeName(aNode.getOffset());
+        rtl::OUString aSearchName = pSearchComponent->getName();
+		if (aNodeName.equalsIgnoreAsciiCase(aSearchName))
 		{
 			*pSearchComponent = getExtendedNodeName(aTree,aNode,aNodeName);
 			return DONE; // for this level
 			return CONTINUE;
 	}
 	//..................................................................................................................
-	NodeVisitor::Result SearchExactName::handle(Tree const& aTree, ValueRef const& aNode)
+	configuration::NodeVisitor::Result SearchExactName::handle(rtl::Reference< configuration::Tree > const&, configuration::ValueRef const& aNode)
 	{
 		OSL_ASSERT( aNode.isValid() );
 		OSL_ASSERT( !complete() );
 
 		// find inexact match (the first one, but the order is unspecified)
 		// TODO: Add support for node-type-specific element names
-		Name aNodeName = aTree.getName(aNode);
-        OSL_ASSERT( isSimpleName(aNodeName) );
+        rtl::OUString aNodeName = aNode.m_sNodeName;
+        OSL_ASSERT( configuration::isSimpleName(aNodeName) );
 
         // value refs are group members and thus have to have simple names
-		if (aNodeName.toString().equalsIgnoreAsciiCase(pSearchComponent->getName().toString()))
+		if (aNodeName.equalsIgnoreAsciiCase(pSearchComponent->getName()))
 		{
-            *pSearchComponent = Path::wrapSimpleName(aNodeName);
+            *pSearchComponent = configuration::Path::wrapSimpleName(aNodeName);
 			return DONE; // for this level
 		}
 		else
 			return CONTINUE;
 	}
 //..................................................................................................................
-	bool SearchExactName::search(NodeRef const & aNode, Tree const & aTree)
+	bool SearchExactName::search(configuration::NodeRef const & aNode, rtl::Reference< configuration::Tree > const & aTree)
 	{
 		if (!aNode.isValid()) return false;
 
-        Tree    aSearchTree(aTree);
-        NodeRef aSearchNode(aNode);
+        rtl::Reference< configuration::Tree > aSearchTree(aTree);
+        configuration::NodeRef aSearchNode(aNode);
 
         while (!complete())
 			if (! findMatch(aSearchNode, aSearchTree))
 } // namespace internal
 
 //..................................................................................................................
-OUString implGetExactName(NodeGroupInfoAccess& rNode, const OUString& rApproximateName ) throw(RuntimeException)
+rtl::OUString implGetExactName(NodeGroupInfoAccess& rNode, const rtl::OUString& rApproximateName ) throw(uno::RuntimeException)
 {
 	// here we try to support both tree-fragment-local pathes and simple names (the latter ones are just an instance of the first)
 	try
 	{
-		using internal::SearchExactName;
-		using configuration::validateRelativePath;
+		GuardedNodeData<NodeAccess> lock( rNode );
 
-		GuardedNodeDataAccess lock( rNode );
+        rtl::Reference< configuration::Tree > aTree(lock.getTree());
+		configuration::NodeRef aNode(lock.getNode());
 
-		Tree aTree(lock.getTree());
-		NodeRef aNode(lock.getNode());
+		configuration::RelativePath aApproximatePath = configuration::validateRelativePath(rApproximateName,aTree,aNode);
 
-		RelativePath aApproximatePath = validateRelativePath(rApproximateName,aTree,aNode);
-
-		SearchExactName aSearch(aApproximatePath);
+		internal::SearchExactName aSearch(aApproximatePath);
 
 		aSearch.search(aNode, aTree);
 
 }
 
 //..................................................................................................................
-OUString implGetExactName(NodeSetInfoAccess& rNode, const OUString& rApproximateName ) throw(RuntimeException)
+rtl::OUString implGetExactName(NodeSetInfoAccess& rNode, const rtl::OUString& rApproximateName ) throw(uno::RuntimeException)
 {
 
     // here we can support only local names
 	try
 	{
-		using internal::SearchExactName;
-		using configuration::validateElementPathComponent;
-        using configuration::Path::Component;
+		GuardedNodeData<NodeAccess> lock( rNode );
 
-		GuardedNodeDataAccess lock( rNode );
+        rtl::Reference< configuration::Tree > aTree(lock.getTree());
+		configuration::NodeRef aNode(lock.getNode());
 
-		Tree aTree(lock.getTree());
-		NodeRef aNode(lock.getNode());
+        configuration::Path::Component aApproximateName = configuration::validateElementPathComponent(rApproximateName,aTree,aNode);
 
-        /*Path::*/Component aApproximateName = validateElementPathComponent(rApproximateName,aTree,aNode);
-
-		SearchExactName aSearch(aApproximateName);
+		internal::SearchExactName aSearch(aApproximateName);
 
 		aSearch.search(aNode, aTree);
 
 		OSL_ENSURE( aSearch.getBestMatch().getDepth() == 1,
                     "Search for exact names changed number of path components !?");
 
-        return aSearch.getBestMatch().getLocalName().getName().toString();
+        return aSearch.getBestMatch().getLocalName().getName();
     }
 	catch (configuration::InvalidName& )
 	{
 beans::Property implGetAsProperty(NodeAccess& rNode)
 	throw(uno::RuntimeException)
 {
-
-	using beans::Property;
 	try
 	{
-		GuardedNodeDataAccess lock( rNode );
+		GuardedNodeData<NodeAccess> lock( rNode );
 
-		Tree    aTree( lock.getTree());
-		NodeRef aNode( lock.getNode());
+        rtl::Reference< configuration::Tree > aTree( lock.getTree());
+		configuration::NodeRef aNode( lock.getNode());
 
-		Name    	aName       = aTree.getName(aNode);
-		Attributes	aAttributes = aTree.getAttributes(aNode);
+        rtl::OUString aName       = aTree->getSimpleNodeName(aNode.getOffset());
+		node::Attributes	aAttributes = aTree->getAttributes(aNode);
 		uno::Type	aApiType    = getUnoInterfaceType();
 
-		return helperMakeProperty( aName,aAttributes,aApiType, aTree.hasNodeDefault(aNode) );
+		return helperMakeProperty( aName,aAttributes,aApiType, aTree->hasNodeDefault(aNode) );
 	}
 	catch (configuration::Exception& ex)
 	{