summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2022-11-07 13:06:56 +0100
committerLászló Németh <nemeth@numbertext.org>2022-11-07 16:50:32 +0100
commit0d295ee0c34ed505a9673580b40ade3ce6947d99 (patch)
tree867cd097b5c68a3bcb1b25653841ffeaabbe62ad /sw/inc
parente8d9e0cf6bff43d07749d98e5922ecc8b3cf3ef6 (diff)
tdf#151658 sw: accept of row deletions with nested tables
Accepting tracked row deletion didn't delete the table row, only its row content, if the table row contained cell starting nested tables. Extend SwTableBox::IsEmpty() to detect a table cell as empty, if it contains only a cell starting empty table. Note: Without change tracking, deleting content of a selected table cell leaves the cell starting nested table in the cell, but deleting row removed the row with nested table, too. Follow-up to commit 6383362999b72160eab6abdfc6ea6bdbd231b100 "tdf#151657 sw: delete row with nested table in Hide Changes" and commit c809867f3ee92a8eb36cbab840bd6d6c5b3b1c26 "tdf#150976 sw: fix tracked deletion of row with nested table". Change-Id: I9c9bc3b97653b63e797e1e9dd545809b77a02c76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142384 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/swtable.hxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx
index 49f5bf8418af..0ad1deffb42e 100644
--- a/sw/inc/swtable.hxx
+++ b/sw/inc/swtable.hxx
@@ -354,6 +354,9 @@ public:
bool IsDeleted() const;
// is it a table with deleted row(s)
bool HasDeletedRow() const;
+ // it doesn't contain box content (except single empty nested tables of the boxes
+ // which could remain after deletion of text content of the selected table)
+ bool IsEmpty() const;
};
/// SwTableLine is one table row in the document model.
@@ -397,7 +400,8 @@ public:
bool hasSoftPageBreak() const;
- // it doesn't contain box content
+ // it doesn't contain box content (except single empty nested tables of the boxes
+ // which could remain after deletion of text content of the selected table row)
bool IsEmpty() const;
// Update TextChangesOnly property based on the redlines of the table row.
@@ -473,8 +477,10 @@ public:
void RemoveFromTable();
const SwStartNode *GetSttNd() const { return m_pStartNode; }
SwNodeOffset GetSttIdx() const;
- // it doesn't contain box content
- bool IsEmpty() const;
+ // it doesn't contain box content or if bWithRemainingNestedTable = true,
+ // it contains only an empty nested table as box content (which
+ // could remain after deletion of the text content of the selected box).
+ bool IsEmpty( bool bWithRemainingNestedTable = true ) const;
// Search next/previous box with content.
SwTableBox* FindNextBox( const SwTable&, const SwTableBox*,