diff options
author | Dirk Völzke <dv@openoffice.org> | 2001-03-01 12:51:12 +0000 |
---|---|---|
committer | Dirk Völzke <dv@openoffice.org> | 2001-03-01 12:51:12 +0000 |
commit | a9625e5b531bf9eca85c8e53309c6ad3241b4fd3 (patch) | |
tree | f802c644682fb7eaa6f5727367f523b83459d2bd | |
parent | 7b52608d2924a61462c60867613d487db5cec7c0 (diff) |
use lazy writing for the ConfigurationUpdateAccess
-rw-r--r-- | ucb/source/ucp/hierarchy/hierarchydata.cxx | 58 |
1 files changed, 49 insertions, 9 deletions
diff --git a/ucb/source/ucp/hierarchy/hierarchydata.cxx b/ucb/source/ucp/hierarchy/hierarchydata.cxx index 61fa9cf50188..0c20d2dd177c 100644 --- a/ucb/source/ucp/hierarchy/hierarchydata.cxx +++ b/ucb/source/ucp/hierarchy/hierarchydata.cxx @@ -2,9 +2,9 @@ * * $RCSfile: hierarchydata.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: kso $ $Date: 2001-01-16 10:29:41 $ + * last change: $Author: dv $ $Date: 2001-03-01 13:51:12 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -78,6 +78,9 @@ #include <vector> +#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_ +#include <com/sun/star/beans/PropertyValue.hpp> +#endif #ifndef _COM_SUN_STAR_CONTAINER_XHIERARCHICALNAMEACCESS_HPP_ #include <com/sun/star/container/XHierarchicalNameAccess.hpp> #endif @@ -100,6 +103,7 @@ #include "hierarchyprovider.hxx" #endif +using namespace com::sun::star::beans; using namespace com::sun::star::container; using namespace com::sun::star::util; using namespace com::sun::star::lang; @@ -134,6 +138,12 @@ struct HierarchyEntry::iterator_Impl #define HIERARCHY_ROOT_DB_KEY "/org.openoffice.ucb.Hierarchy/Root" #define HIERARCHY_ROOT_DB_KEY_LENGTH 34 +#define DECLARE_ASCII( SASCIIVALUE ) \ + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SASCIIVALUE )) + +#define CFGPROPERTY_NODEPATH DECLARE_ASCII("nodepath" ) // describe path of cfg entry +#define CFGPROPERTY_LAZYWRITE DECLARE_ASCII("lazywrite" ) // true->async. update; false->sync. update + //========================================================================= HierarchyEntry::HierarchyEntry( const Reference< XMultiServiceFactory >& rSMgr, @@ -279,8 +289,17 @@ sal_Bool HierarchyEntry::setData( bRoot = sal_False; } - Sequence< Any > aArguments( 1 ); - aArguments[ 0 ] <<= aParentPath; + Sequence< Any > aArguments( 2 ) ; + PropertyValue aProperty ; + OUString sPath ; + + aProperty.Name = CFGPROPERTY_NODEPATH ; + aProperty.Value <<= aParentPath ; + aArguments[0] <<= aProperty ; + + aProperty.Name = CFGPROPERTY_LAZYWRITE ; + aProperty.Value <<= sal_True ; + aArguments[1] <<= aProperty ; Reference< XChangesBatch > xBatch( m_xConfigProvider->createInstanceWithArguments( @@ -531,8 +550,17 @@ sal_Bool HierarchyEntry::move( bNewRoot = sal_False; } - Sequence< Any > aArguments( 1 ); - aArguments[ 0 ] <<= aOldParentPath; + Sequence< Any > aArguments( 2 ) ; + PropertyValue aProperty ; + OUString sPath ; + + aProperty.Name = CFGPROPERTY_NODEPATH ; + aProperty.Value <<= aOldParentPath ; + aArguments[0] <<= aProperty ; + + aProperty.Name = CFGPROPERTY_LAZYWRITE ; + aProperty.Value <<= sal_True ; + aArguments[1] <<= aProperty ; xOldParentBatch = Reference< XChangesBatch >( m_xConfigProvider->createInstanceWithArguments( @@ -555,7 +583,9 @@ sal_Bool HierarchyEntry::move( { bDifferentParents = sal_True; - aArguments[ 0 ] <<= aNewParentPath; + aProperty.Name = CFGPROPERTY_NODEPATH ; + aProperty.Value <<= aNewParentPath ; + aArguments[0] <<= aProperty ; xNewParentBatch = Reference< XChangesBatch >( m_xConfigProvider->createInstanceWithArguments( @@ -807,8 +837,18 @@ sal_Bool HierarchyEntry::remove() bRoot = sal_False; } - Sequence< Any > aArguments( 1 ); - aArguments[ 0 ] <<= aParentPath; + Sequence< Any > aArguments( 2 ) ; + PropertyValue aProperty ; + OUString sPath ; + + aProperty.Name = CFGPROPERTY_NODEPATH ; + aProperty.Value <<= aParentPath ; + aArguments[0] <<= aProperty ; + + aProperty.Name = CFGPROPERTY_LAZYWRITE ; + aProperty.Value <<= sal_True ; + aArguments[1] <<= aProperty ; + Reference< XChangesBatch > xBatch( m_xConfigProvider->createInstanceWithArguments( |