summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2019-12-16 17:50:57 +0100
committerMichael Meeks <michael.meeks@collabora.com>2020-05-27 22:06:59 +0100
commit5123f606f654be54a40785ca081eaadc5421d378 (patch)
treec91a255949a84d42a553f831a7458867f62ffcc3
parentf6869e462a0de414396440b4e5934121b283f990 (diff)
android: Don't crash when double-tapping a text box.
Here we were accessing the notification from a destructor; so avoid that when the pDoc is already being destructed. Reviewed-on: https://gerrit.libreoffice.org/85235 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Jan Holesovsky <kendy@collabora.com> (cherry picked from commit 589147c64804adc5ceba895510559e2b6806d467) Reviewed-on: https://gerrit.libreoffice.org/85246 Tested-by: Jenkins Change-Id: I686bc9acf66788bfed6cf478fc7a1646ca8fd259
-rw-r--r--include/vcl/ITiledRenderable.hxx9
-rw-r--r--sd/source/ui/inc/unomodel.hxx5
-rw-r--r--sfx2/source/view/lokhelper.cxx2
3 files changed, 15 insertions, 1 deletions
diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index 56922096d42b..5bd83d5ef2d4 100644
--- a/include/vcl/ITiledRenderable.hxx
+++ b/include/vcl/ITiledRenderable.hxx
@@ -298,6 +298,15 @@ public:
virtual void executeFromFieldEvent(const StringMap&)
{
}
+
+ /**
+ * It can happen that the underlying implementation is being disposed, but
+ * somebedy is trying to access the data...
+ */
+ virtual bool isDisposed() const
+ {
+ return false;
+ }
};
} // namespace vcl
diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx
index 9a5da032893b..b320abda4912 100644
--- a/sd/source/ui/inc/unomodel.hxx
+++ b/sd/source/ui/inc/unomodel.hxx
@@ -269,6 +269,11 @@ public:
virtual void moveSelectedParts(int nPosition, bool bDuplicate) override;
/// @see vcl::ITiledRenderable::getPartInfo().
virtual OUString getPartInfo(int nPart) override;
+ /// @see vcl::ITiledRenderable::isDisposed().
+ virtual bool isDisposed() const override
+ {
+ return mbDisposed;
+ }
// XComponent
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 9277ac5760c4..4da19e5c1c94 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -308,7 +308,7 @@ void SfxLokHelper::notifyInvalidation(SfxViewShell const* pThisView, const OStri
void SfxLokHelper::notifyDocumentSizeChanged(SfxViewShell const* pThisView, const OString& rPayload, vcl::ITiledRenderable* pDoc, bool bInvalidateAll)
{
- if (!pDoc || !comphelper::LibreOfficeKit::isActive() || DisableCallbacks::disabled())
+ if (!pDoc || pDoc->isDisposed() || !comphelper::LibreOfficeKit::isActive() || DisableCallbacks::disabled())
return;
if (bInvalidateAll)