summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2021-05-31 14:38:31 +0200
committerLászló Németh <nemeth@numbertext.org>2021-06-01 09:30:23 +0200
commit6a4409647519e0466896fae4ffe2dc64edd53d9a (patch)
tree00044c1e5372122ba9be37ba3aaee2d76684c403 /sw/source/core
parente1908f9e2345d9aebc28d93a8c647f0ed69b360e (diff)
tdf#60382 sw: fix tracked row deletion at rejection
At rejection of a tracked deletion in a table row, set HasTextChangesOnly property of the row to true. Follow-up to commit 05366b8e6683363688de8708a3d88cf144c7a2bf "tdf#60382 sw offapi: add change tracking of table/row deletion". Change-Id: Iea78f8394890995cbc06209abd4bf5ea4ceb7357 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116446 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source/core')
-rw-r--r--sw/source/core/doc/DocumentRedlineManager.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx
index 6d2332418441..6079ddcc88f2 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -461,6 +461,24 @@ namespace
}
}
+ // at rejection of a deletion in a table, remove the tracking of the table row
+ void lcl_RemoveTrackingOfTableRow( const SwPosition* pPos )
+ {
+ if ( const SwTableBox* pBox = pPos->nNode.GetNode().GetTableBox() )
+ {
+ const SwTableLine* pLine = pBox->GetUpper();
+ const SvxPrintItem *pHasTextChangesOnlyProp =
+ pLine->GetFrameFormat()->GetAttrSet().GetItem<SvxPrintItem>(RES_PRINT);
+ // table row property "HasTextChangesOnly" is set and its value is false
+ if ( pHasTextChangesOnlyProp && !pHasTextChangesOnlyProp->GetValue() )
+ {
+ SvxPrintItem aUnsetTracking(RES_PRINT, true);
+ SwCursor aCursor( *pPos, nullptr );
+ pPos->GetDoc().SetRowNotTracked( aCursor, aUnsetTracking );
+ }
+ }
+ }
+
bool lcl_AcceptRedline( SwRedlineTable& rArr, SwRedlineTable::size_type& rPos,
bool bCallDelete,
const SwPosition* pSttRng = nullptr,
@@ -743,6 +761,9 @@ namespace
if( pRedl->GetExtraData() )
pRedl->GetExtraData()->Reject( *pRedl );
+ // remove tracking of the table row, if needed
+ lcl_RemoveTrackingOfTableRow( updatePaM.End() );
+
switch( eCmp )
{
case SwComparePosition::Inside: