sw/source/uibase/utlui/content.cxx |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit c5d262518d917a7a6a4f9ccac7b74b488f5b2269
Author:     Jim Raykowski <rayk...@gmail.com>
AuthorDate: Sat Dec 10 06:50:10 2022 -0900
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Dec 14 18:50:51 2022 +0000

    tdf#152029 related: Prevent crash on nullptr iter_compare
    
    Fixes crash that happens with x11 and qt5 backends when iter_compare is
    given a nullptr iterator to compare.
    
    Change-Id: I80995071dbc5b9e9807fc8b5cf10b0868b851ee4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143907
    Tested-by: Jenkins
    Reviewed-by: Jim Raykowski <rayk...@gmail.com>
    (cherry picked from commit 080d2d21cb59fd6e81375f15cf17c6cbfc605a77)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143958
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index a930c15c912e..83e123540a9f 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -1149,9 +1149,6 @@ SwContentTree::~SwContentTree()
 
 IMPL_LINK(SwContentTree, MouseMoveHdl, const MouseEvent&, rMEvt, bool)
 {
-    // initialize the compare entry iterator with the first tree entry iterator
-    if (!m_xOverlayCompareEntry && 
!m_xTreeView->get_iter_first(*m_xOverlayCompareEntry))
-       return false;
     if (rMEvt.IsLeaveWindow())
     {
         m_aOverlayObjectDelayTimer.Stop();
@@ -1165,8 +1162,11 @@ IMPL_LINK(SwContentTree, MouseMoveHdl, const 
MouseEvent&, rMEvt, bool)
             m_xTreeView->get_dest_row_at_pos(rMEvt.GetPosPixel(), 
xEntry.get(), false, false))
     {
         // Remove the overlay object if the pointer is over a different entry 
than the last time
-        // it was here.
-        if (m_xTreeView->iter_compare(*xEntry, *m_xOverlayCompareEntry) != 0)
+        // it was here. Gaurd against doing the iter_compare when entering the 
window to work
+        // around a bug that causes sal backends to crash when 
m_xOverlayCompareEntry iterator is
+        // nullptr which is the case on initial window entry.
+        if (!rMEvt.IsEnterWindow() &&
+                m_xTreeView->iter_compare(*xEntry, *m_xOverlayCompareEntry) != 
0)
         {
             m_aOverlayObjectDelayTimer.Stop();
             if (m_xOverlayObject && m_xOverlayObject->getOverlayManager())

Reply via email to