sd/source/ui/view/Outliner.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 81f961c6d83250823216ace89282a7de18ce520c
Author:     Mohit Marathe <[email protected]>
AuthorDate: Mon Feb 2 20:13:44 2026 +0530
Commit:     Michael Stahl <[email protected]>
CommitDate: Fri Feb 6 14:05:04 2026 +0100

    sd: svx: fix crash when searching text while text edit is active in
    
    other view by skipping search in shape which is being edited.
    
    The crash was caused because SdOutliner was deleted after
    SdrTextObj::BegTextEdit returned false when called from
    SdrObjEditView::SdrBeginTextEdit
    
    Backtrace of crash:
    0  SdOutliner::Implementation::GetOutlinerView (this=0x0) at 
/home/mohitm/work/libreoffice/co-25.04/sd/source/ui/view/Outliner.cxx:91
    1  0x0000741cff1e4988 in SdOutliner::getOutlinerView (this=0x60b85732b8c0) 
at /home/mohitm/work/libreoffice/co-25.04/sd/source/ui/view/Outliner.cxx:245
    2  0x0000741cff1ed11f in SdOutliner::PrepareSearchAndReplace 
(this=0x60b85732b8c0) at 
/home/mohitm/work/libreoffice/co-25.04/sd/source/ui/view/Outliner.cxx:1592
    3  0x0000741cff1e7550 in SdOutliner::ProvideNextTextObject 
(this=0x60b85732b8c0) at 
/home/mohitm/work/libreoffice/co-25.04/sd/source/ui/view/Outliner.cxx:1377
    4  0x0000741cff1e9bf0 in SdOutliner::SearchAndReplaceOnce 
(this=0x60b85732b8c0, pSelections=0x0) at 
/home/mohitm/work/libreoffice/co-25.04/sd/source/ui/view/Outliner.cxx:940
    5  0x0000741cff1e8348 in SdOutliner::StartSearchAndReplace 
(this=0x60b85732b8c0, pSearchItem=0x60b8557e8980) at 
/home/mohitm/work/libreoffice/co-25.04/sd/source/ui/view/Outliner.cxx:519
    6  0x0000741cfeeaaff1 in sd::FuSearch::SearchAndReplace 
(this=0x60b8573288a0, pSearchItem=0x60b8557e8980) at 
/home/mohitm/work/libreoffice/co-25.04/sd/source/ui/func/fusearch.cxx:143
    7  0x0000741cfed9b3d0 in sd::DrawDocShell::Execute (this=0x60b855995e30, 
rReq=...) at 
/home/mohitm/work/libreoffice/co-25.04/sd/source/ui/docshell/docshel3.cxx:224
    8  0x0000741cff2db6f3 in sd::DrawViewShell::Execute (this=0x60b846a3de70, 
rReq=...) at 
/home/mohitm/work/libreoffice/co-25.04/sd/source/ui/view/drviews7.cxx:1973
    
    Signed-off-by: Mohit Marathe <[email protected]>
    Change-Id: I47a16a3e3695a4e1d9e307c1207de570ee0ecd1c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198196
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Michael Stahl <[email protected]>
    (cherry picked from commit e16226d7e81b7ab608463ec681c7bd7703b41bc2)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198754

diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index d68097546da5..2e1ff1055baf 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -1221,7 +1221,7 @@ namespace
 bool lclIsValidTextObject(const sd::outliner::IteratorPosition& rPosition)
 {
     auto* pObject = DynCastSdrTextObj( rPosition.mxObject.get().get() );
-    return (pObject != nullptr) && pObject->HasText() && ! 
pObject->IsEmptyPresObj();
+    return (pObject != nullptr) && pObject->HasText() && ! 
pObject->IsEmptyPresObj() && !pObject->IsInEditMode();
 }
 
 bool isValidVectorGraphicObject(const sd::outliner::IteratorPosition& 
rPosition)

Reply via email to