[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - include/vcl sd/source sfx2/source

Jan Holesovsky (via logerrit) logerrit at kemper.freedesktop.org
Mon Dec 16 22:07:20 UTC 2019


 include/vcl/ITiledRenderable.hxx |    9 +++++++++
 sd/source/ui/inc/unomodel.hxx    |    5 +++++
 sfx2/source/view/lokhelper.cxx   |    2 +-
 3 files changed, 15 insertions(+), 1 deletion(-)

New commits:
commit 589147c64804adc5ceba895510559e2b6806d467
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Mon Dec 16 17:50:57 2019 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Mon Dec 16 23:06:36 2019 +0100

    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.
    
    Change-Id: I686bc9acf66788bfed6cf478fc7a1646ca8fd259
    Reviewed-on: https://gerrit.libreoffice.org/85235
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index 63646d5c5df0..a204713dd91b 100644
--- a/include/vcl/ITiledRenderable.hxx
+++ b/include/vcl/ITiledRenderable.hxx
@@ -340,6 +340,15 @@ public:
     virtual void completeFunction(int /*nIndex*/)
     {
     }
+
+    /**
+     * 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 9282d0aeef80..7d7a9ee8005c 100644
--- a/sd/source/ui/inc/unomodel.hxx
+++ b/sd/source/ui/inc/unomodel.hxx
@@ -268,6 +268,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 58076bf0143e..f478b667f407 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -303,7 +303,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)


More information about the Libreoffice-commits mailing list