diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2024-06-14 12:45:31 +0200 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2024-06-14 19:42:35 +0200 |
commit | 9561c81642316bda9b2df1e7a71f8f2130e383d6 (patch) | |
tree | 133dc435877f594f1dfa8d823c54a270e1d8596b /sw | |
parent | 2a15e5839c399b312a53da80c983503368a8ac47 (diff) |
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.stahl@allotropia.de>
Tested-by: Jenkins
(cherry picked from commit a9bc3ea1bef2a6b622a729dfa18eb3851ce7101e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168873
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/crsr/crstrvl.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
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; } |