summaryrefslogtreecommitdiff
path: root/sw/source/core/crsr/crsrsh.cxx
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2023-08-16 21:41:26 +0200
committerLászló Németh <nemeth@numbertext.org>2023-08-18 00:06:43 +0200
commite79f0f65ab06baafc7e8a6aeb1d89ca748087b24 (patch)
treee8299f31db1fc7ca436808af374c0a687efa3425 /sw/source/core/crsr/crsrsh.cxx
parent5ca28013a5ceb1b633fd4df8f9451778be5f1734 (diff)
tdf#156783 sw tracked table column: fix crash setting border
or border padding without correct table cursor. Table formatting is allowed on text selections starting with tables, but adding border or border padding resulted crashing. This regression became more visible with hidden deleted table columns, where SelectTable (e.g. Ctrl-A) doesn't select the whole table, but only the text content of the visible cells, and in the case of hidden right table columns, without table cursor. Manual test: insert two tables in the document, and in the first cell of the first table, select the whole document by pressing Ctrl-A 2 times or more. In table settings, enable table border or modify padding to crash LibreOffice. Regression since version 7.5. Change-Id: If8ebb52c7662ff37ac42348c8f412549b793b6d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155749 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source/core/crsr/crsrsh.cxx')
-rw-r--r--sw/source/core/crsr/crsrsh.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 9fb43ff2d596..f22e0bc9450a 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -599,7 +599,7 @@ bool SwCursorShell::SttEndDoc( bool bStt )
const SwTableNode* SwCursorShell::IsCursorInTable() const
{
- if (m_pTableCursor)
+ if (m_pTableCursor && m_pTableCursor->GetSelectedBoxesCount())
{ // find the table that has the selected boxes
return m_pTableCursor->GetSelectedBoxes()[0]->GetSttNd()->FindTableNode();
}