sw/source/core/crsr/crstrvl.cxx | 5 +++++ 1 file changed, 5 insertions(+)
New commits: commit 9561c81642316bda9b2df1e7a71f8f2130e383d6 Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Fri Jun 14 12:45:31 2024 +0200 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Fri Jun 14 19:42:35 2024 +0200 tdf#161346 sw: PDF export: fix crash on field in hidden text frame When creating a link rectangle for a SwGetRefField, the problem is that the cursor is positioned on 2 different nodes with 2 different text frames, neither of which is the node that contains the field; this happens because that node's text frame has a height of 0, so IsSelOvr() moves the cursor to a previous node. Check that SwCursorShell::GotoFormatField() did in fact go to the field. (regression from commit 9ba8d68c2b2fd06340bbdcb61dc3d57f6e3eb974) Change-Id: Ib74533f46dce8fb05224fddfff12e49577346b35 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168860 Reviewed-by: Michael Stahl <michael.st...@allotropia.de> Tested-by: Jenkins (cherry picked from commit a9bc3ea1bef2a6b622a729dfa18eb3851ce7101e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168873 Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de> diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index 81323787d7cc..a3c5081b8dae 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -1022,6 +1022,11 @@ bool SwCursorShell::GotoFormatField( const SwFormatField& rField ) bool bRet = !pCursor->IsSelOvr(); if( bRet ) UpdateCursor(SwCursorShell::SCROLLWIN|SwCursorShell::CHKRANGE|SwCursorShell::READONLY); + if (&pCursor->GetPoint()->GetNode() != pTNd) + { + // tdf#161346 failed to move to field + return false; + } return bRet; }