summaryrefslogtreecommitdiff
path: root/comphelper/source/misc/storagehelper.cxx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2011-12-06 04:36:21 +0100
committerMichael Stahl <mstahl@redhat.com>2011-12-06 04:36:21 +0100
commitf014ea59e9e6e24ffead1961e8b689237b3927f0 (patch)
tree5da8abd126e8b3a972784e7a2b0cd073c36f7a53 /comphelper/source/misc/storagehelper.cxx
parentc81b005921b39c54b33777af126b87e9f4e92860 (diff)
comphelper::LifecycleProxy: make writing work:
The storage implementation forgets any writes unless all storages are committed.
Diffstat (limited to 'comphelper/source/misc/storagehelper.cxx')
-rw-r--r--comphelper/source/misc/storagehelper.cxx15
1 files changed, 15 insertions, 0 deletions
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 <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/XEncryptionProtectedSource2.hpp>
+#include <com/sun/star/embed/XTransactedObject.hpp>
#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
@@ -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<embed::XTransactedObject> const xTransaction(*iter,
+ uno::UNO_QUERY);
+ if (xTransaction.is())
+ {
+ xTransaction->commit();
+ }
+ }
+}
+
static void splitPath( std::vector<rtl::OUString> &rElems,
const ::rtl::OUString& rPath )
{