sw/source/core/crsr/swcrsr.cxx | 4 ++-- vcl/source/window/stacking.cxx | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-)
New commits: commit 6d596ad1ab0ee745c1e08dddf301625d6f501866 Author: Caolán McNamara <[email protected]> AuthorDate: Tue May 27 17:16:21 2025 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Wed May 28 08:58:08 2025 +0200 move this check to earlier Change-Id: I3082b828327f0b235ad867001a643ad4766aa35e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185925 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> (cherry picked from commit dff8e9123cac3e6e942e0c081e64fe1a591c37cb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185939 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx index 142a3750b125..4ab141a2ca66 100644 --- a/vcl/source/window/stacking.cxx +++ b/vcl/source/window/stacking.cxx @@ -842,6 +842,12 @@ void Window::SetParent( vcl::Window* pNewParent ) if( !pNewParent || pNewParent == this ) return; + if (!mpWindowImpl) + { + SAL_WARN("vcl", "Window::SetParent(): mpWindowImpl == NULL"); + return; + } + // check if the taskpanelist would change and move the window pointer accordingly SystemWindow *pSysWin = ImplGetLastSystemWindow(this); SystemWindow *pNewSysWin = nullptr; @@ -866,12 +872,6 @@ void Window::SetParent( vcl::Window* pNewParent ) ImplSetFrameParent( pNewParent ); - if (!mpWindowImpl) - { - SAL_WARN("vcl", "Window::SetParent(): mpWindowImpl == NULL"); - return; - } - if ( mpWindowImpl->mpBorderWindow ) { mpWindowImpl->mpRealParent = pNewParent; commit ee64b9cb41c50d965bad0ba46ec88337d91336f2 Author: Caolán McNamara <[email protected]> AuthorDate: Tue May 27 17:25:52 2025 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Wed May 28 08:57:56 2025 +0200 null deref of SwTextNode #0 rtl::OUString::getLength (this=<optimized out>) at include/rtl/ustring.hxx:821 #1 SwTextNode::Len (this=this@entry=0x0) at sw/source/core/txtnode/ndtxt.cxx:300 #2 0x00007fe9a0a80b0d in SwCursor::LeftRight(bool, unsigned short, SwCursorSkipMode, bool, bool, bool, SwRootFrame const*, bool) () at sw/source/core/crsr/swcrsr.cxx:1789 #3 0x00007fe9a0a552d4 in SwCursorShell::LeftRight(bool, unsigned short, SwCursorSkipMode, bool) () at sw/inc/crsrsh.hxx:495 #4 0x00007fe9a0c82eca in SwCursorShell::Right (bAllowVisual=false, nMode=SwCursorSkipMode::Chars, nCnt=1, this=0x361e17e0) at sw/inc/crsrsh.hxx:379 #5 SwEditShell::SetExtTextInputData(CommandExtTextInputData const&) () at sw/source/core/edit/editsh.cxx:1019 #6 0x00007fe9a13e7dad in SwEditWin::Command(CommandEvent const&) () at sw/source/uibase/docvw/edtwin.cxx:5932 #7 0x00007fe9b02806fb in ImplCallCommand(VclPtr<vcl::Window> const&, CommandEventId, void const*, bool, Point const*) () at include/rtl/ref.hxx:203 #8 0x00007fe9b0285bb1 in ImplHandleExtTextInput (nCursorFlags=<optimized out>, nCursorPos=<optimized out>, pTextAttr=<optimized out>, rText=..., pWindow=<optimized out>) at include/vcl/vclreferencebase.hxx:37 #9 ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) () at vcl/source/window/winproc.cxx:2855 #10 0x00007fe9b0271355 in vcl::Window::PostExtTextInputEvent(VclEventId, rtl::OUString const&) () at vcl/source/window/window.cxx:2098 #11 0x00007fe9af195bd9 in (anonymous namespace)::LOKPostAsyncEvent(void*, void*) () at sfx2/source/view/lokhelper.cxx:1209 Change-Id: I4f1699b8ed7a7797d6dfabc05c500370c24e0976 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185930 Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Jenkins (cherry picked from commit 53abdbd6011116ca9e1e03ad2bb5a72eb0bae7f8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185935 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index a195759f452c..ba4176a39d8f 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -1779,8 +1779,8 @@ bool SwCursor::LeftRight( bool bLeft, sal_uInt16 nCnt, SwCursorSkipMode nMode, if (!bLeft && pLayout && pLayout->GetFieldmarkMode() == sw::FieldmarkMode::ShowResult) { SwTextNode const*const pNode(GetPoint()->GetNode().GetTextNode()); - assert(pNode); - if (pNode->Len() != GetPoint()->GetContentIndex() + SAL_WARN_IF(!pNode, "sw.core", "expected a SwTextNode"); + if (pNode && pNode->Len() != GetPoint()->GetContentIndex() && pNode->GetText()[GetPoint()->GetContentIndex()] == CH_TXT_ATR_FIELDSTART) { IDocumentMarkAccess const& rIDMA(*GetDoc().getIDocumentMarkAccess());
