sd/source/ui/view/Outliner.cxx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
New commits: commit 148aabdb074b593c9c8d7b0b62695e490d46996f Author: Thorsten Behrens <[email protected]> AuthorDate: Sat Jun 8 10:20:46 2024 +0200 Commit: Thorsten Behrens <[email protected]> CommitDate: Sat Jun 8 10:26:33 2024 +0200 Fix crash after 'make notes pane searchable' Before that, make CppunitTest_sd_uiimpress CPPUNIT_TEST_NAME=testSearchAllInDocumentAndNotes was crashing with pInstance->GetViewShell() returning a nullptr. Change-Id: I1f497936ca31c761fdbdc86d159ba9b4d6104cd0 diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index c6a092f5d562..727cef1a7f9f 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -1749,12 +1749,14 @@ void SdOutliner::EnterEditMode (bool bGrabFocus) pInstance->RequestSynchronousUpdate(); std::shared_ptr<sd::ViewShell> pNotesPaneShell(pInstance->GetViewShell(sd::framework::FrameworkHelper::msBottomImpressPaneURL)); - - // likely only one or two of these is enough - pNotesPaneShell->GetParentWindow()->GrabFocus(); - pNotesPaneShell->GetContentWindow()->Activate(); - pNotesPaneShell->GetContentWindow()->GrabFocus(); - pNotesPaneShell->GetContentWindow()->GetFocus(); + if(pNotesPaneShell) + { + // likely only one or two of these is enough + pNotesPaneShell->GetParentWindow()->GrabFocus(); + pNotesPaneShell->GetContentWindow()->Activate(); + pNotesPaneShell->GetContentWindow()->GrabFocus(); + pNotesPaneShell->GetContentWindow()->GetFocus(); + } } mbFoundObject = true;
