From f014ea59e9e6e24ffead1961e8b689237b3927f0 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 6 Dec 2011 04:36:21 +0100 Subject: comphelper::LifecycleProxy: make writing work: The storage implementation forgets any writes unless all storages are committed. --- comphelper/source/misc/storagehelper.cxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'comphelper/source') diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx index e429f2223069..773ec55440d7 100644 --- a/comphelper/source/misc/storagehelper.cxx +++ b/comphelper/source/misc/storagehelper.cxx @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -551,6 +552,20 @@ LifecycleProxy::LifecycleProxy() : m_pBadness( new Impl() ) { } LifecycleProxy::~LifecycleProxy() { } +void LifecycleProxy::commitStorages() +{ + for (Impl::reverse_iterator iter = m_pBadness->rbegin(); + iter != m_pBadness->rend(); ++iter) // reverse order (outwards) + { + uno::Reference const xTransaction(*iter, + uno::UNO_QUERY); + if (xTransaction.is()) + { + xTransaction->commit(); + } + } +} + static void splitPath( std::vector &rElems, const ::rtl::OUString& rPath ) { -- cgit v1.2.3