sw/source/core/access/acccontext.cxx |    7 ++++++-
 sw/source/core/access/acccontext.hxx |    2 ++
 sw/source/core/access/accmap.cxx     |    4 +++-
 vcl/inc/svdata.hxx                   |    1 -
 vcl/source/app/svapp.cxx             |    6 ------
 5 files changed, 11 insertions(+), 9 deletions(-)

New commits:
commit 5c73c3aa6875b1e69b2d58a47ba823faf78b8aa2
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue May 9 11:59:40 2023 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Tue May 9 20:42:35 2023 +0200

    drop unused ImplPrepareExitMsg
    
    Change-Id: I9254328829ac051524fbfdf6a3b5b2f72b12c427
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151574
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index 6d1d8adac015..448262492054 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -168,7 +168,6 @@ struct ImplSVAppData
     bool m_bUseSystemLoop = false;
 
     DECL_STATIC_LINK(ImplSVAppData, ImplQuitMsg, void*, void);
-    DECL_STATIC_LINK(ImplSVAppData, ImplPrepareExitMsg, void*, void);
     DECL_STATIC_LINK(ImplSVAppData, ImplEndAllDialogsMsg, void*, void);
     DECL_STATIC_LINK(ImplSVAppData, ImplEndAllPopupsMsg, void*, void);
 };
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 4690c534df70..c61d9ea0f2aa 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -339,12 +339,6 @@ void Application::notifyInvalidation(tools::Rectangle 
const* /*pRect*/) const
 {
 }
 
-IMPL_STATIC_LINK_NOARG( ImplSVAppData, ImplPrepareExitMsg, void*, void )
-{
-    //now close top level frames
-    (void)GetpApp()->QueryExit();
-}
-
 void Application::Execute()
 {
     ImplSVData* pSVData = ImplGetSVData();
commit 5e99e5d734f19fe7299a3e390b23a93db971e013
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue May 9 14:16:20 2023 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Tue May 9 20:42:22 2023 +0200

    Resolves: tdf#138512 don't crash on removing already Disposed a11y context
    
    Change-Id: I2a8f3d10a1349de233e11d841f7f244e4e513b2c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151582
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/source/core/access/acccontext.cxx 
b/sw/source/core/access/acccontext.cxx
index 37cb87fb3114..3445114b2d78 100644
--- a/sw/source/core/access/acccontext.cxx
+++ b/sw/source/core/access/acccontext.cxx
@@ -518,9 +518,14 @@ bool SwAccessibleContext::IsEditableState()
     return bRet;
 }
 
+bool SwAccessibleContext::IsDisposed() const
+{
+    return !(GetFrame() && GetMap());
+}
+
 void SwAccessibleContext::ThrowIfDisposed()
 {
-    if (!(GetFrame() && GetMap()))
+    if (IsDisposed())
     {
         throw lang::DisposedException("object is nonfunctional",
                 static_cast<cppu::OWeakObject*>(this));
diff --git a/sw/source/core/access/acccontext.hxx 
b/sw/source/core/access/acccontext.hxx
index 32d13efbf513..d64939089622 100644
--- a/sw/source/core/access/acccontext.hxx
+++ b/sw/source/core/access/acccontext.hxx
@@ -349,6 +349,8 @@ public:
     virtual bool SetSelectedState(bool bSelected);
     bool  IsSelectedInDoc() const { return m_isSelectedInDoc; }
 
+    bool IsDisposed() const;
+
     static OUString GetResource(TranslateId pResId,
                                 const OUString *pArg1 = nullptr,
                                 const OUString *pArg2 = nullptr);
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index fe0384ca0ea2..5cc2fd73801b 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -2673,7 +2673,9 @@ void SwAccessibleMap::InvalidateCursorPosition( const 
SwFrame *pFrame )
 
     for (SwAccessibleParagraph* pAccPara : m_setParaRemove)
     {
-        if(pAccPara && pAccPara->getSelectedAccessibleChildCount() == 0 && 
pAccPara->getSelectedText().getLength() == 0)
+        if (pAccPara && !pAccPara->IsDisposed() &&
+            pAccPara->getSelectedAccessibleChildCount() == 0 &&
+            pAccPara->getSelectedText().getLength() == 0)
         {
             if(pAccPara->SetSelectedState(false))
             {

Reply via email to