summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/inc/unoatxt.hxx7
-rw-r--r--sw/source/uibase/uno/unoatxt.cxx7
2 files changed, 13 insertions, 1 deletions
diff --git a/sw/source/uibase/inc/unoatxt.hxx b/sw/source/uibase/inc/unoatxt.hxx
index 02e49d010321..a991b1d7e0f0 100644
--- a/sw/source/uibase/inc/unoatxt.hxx
+++ b/sw/source/uibase/inc/unoatxt.hxx
@@ -31,6 +31,8 @@
#include <com/sun/star/text/XText.hpp>
#include <svl/itemprop.hxx>
#include <svl/lstner.hxx>
+#include <cppuhelper/basemutex.hxx>
+#include <cppuhelper/compbase.hxx>
#include <cppuhelper/implbase.hxx>
#include <svtools/unoevent.hxx>
class SwTextBlocks;
@@ -155,7 +157,8 @@ public:
class SwXAutoTextEntry
:public SfxListener
- ,public cppu::WeakImplHelper
+ ,public cppu::BaseMutex
+ ,public cppu::WeakComponentImplHelper
<
css::text::XAutoTextEntry,
css::lang::XServiceInfo,
@@ -178,6 +181,8 @@ class SwXAutoTextEntry
}
void GetBodyText ();
+ void SAL_CALL disposing() override;
+
protected:
/** ensure that the current content (which may only be in-memory so far) is flushed to the auto text group file
diff --git a/sw/source/uibase/uno/unoatxt.cxx b/sw/source/uibase/uno/unoatxt.cxx
index f984a3e65428..ef41ed8649aa 100644
--- a/sw/source/uibase/uno/unoatxt.cxx
+++ b/sw/source/uibase/uno/unoatxt.cxx
@@ -718,6 +718,7 @@ sal_Int64 SAL_CALL SwXAutoTextEntry::getSomething( const uno::Sequence< sal_Int8
SwXAutoTextEntry::SwXAutoTextEntry(SwGlossaries* pGlss, const OUString& rGroupName,
const OUString& rEntryName) :
+ WeakComponentImplHelper(m_aMutex),
pGlossaries(pGlss),
sGroupName(rGroupName),
sEntryName(rEntryName),
@@ -801,6 +802,12 @@ void SwXAutoTextEntry::GetBodyText ()
xBodyText.set( *pBodyText, uno::UNO_QUERY);
}
+void SwXAutoTextEntry::disposing()
+{
+ SolarMutexGuard g;
+ implFlushDocument(true);
+}
+
uno::Reference< text::XTextCursor > SwXAutoTextEntry::createTextCursor() throw( uno::RuntimeException, std::exception )
{
SolarMutexGuard aGuard;