summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2021-06-03 12:13:49 +0200
committerLászló Németh <nemeth@numbertext.org>2021-06-03 19:10:59 +0200
commit896c2199d9f0a28bd405dd2d1068f5e2973cdf06 (patch)
tree240ddbe66c7282f8bfd1d66ee01cebafce098354 /sw/source/core
parent06a983b213b8fb71fdac1004868d7b4fdd6a9833 (diff)
tdf#79069 DOCX: support tracked table (row) deletion
Only DOCX round-trip was supported for tracked table and table row deletions. Now change tracking of newly deleted tables and table rows is exported in DOCX. Also the DOCX import is handled by Manage Changes now: accepting the deleted ranges of a deleted row removes also the table row, not only its text content. Follow-up to commit 05366b8e6683363688de8708a3d88cf144c7a2bf "tdf#60382 sw offapi: add change tracking of table/row deletion". Change-Id: Ic02e0adbda11032acb9616c262c2fce134f6b07c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116652 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source/core')
-rw-r--r--sw/source/core/unocore/unocrsrhelper.cxx16
1 files changed, 15 insertions, 1 deletions
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index 32b449b97403..58d5dbf6b11e 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -72,6 +72,7 @@
#include <fchrfmt.hxx>
#include <editeng/editids.hrc>
#include <editeng/flstitem.hxx>
+#include <editeng/prntitem.hxx>
#include <vcl/metric.hxx>
#include <svtools/ctrltool.hxx>
#include <sfx2/docfilt.hxx>
@@ -1388,7 +1389,8 @@ void makeTableRowRedline( SwTableLine& rTableLine,
std::u16string_view rRedlineType,
const uno::Sequence< beans::PropertyValue >& rRedlineProperties )
{
- IDocumentRedlineAccess* pRedlineAccess = &rTableLine.GetFrameFormat()->GetDoc()->getIDocumentRedlineAccess();
+ SwDoc* pDoc = rTableLine.GetFrameFormat()->GetDoc();
+ IDocumentRedlineAccess* pRedlineAccess = &pDoc->getIDocumentRedlineAccess();
RedlineType eType;
if ( rRedlineType == u"TableRowInsert" )
@@ -1398,6 +1400,18 @@ void makeTableRowRedline( SwTableLine& rTableLine,
else if ( rRedlineType == u"TableRowDelete" )
{
eType = RedlineType::TableRowDelete;
+
+ // set table row property "HasTextChangesOnly" to false
+ // to handle tracked deletion of the table row on the UI
+ const SvxPrintItem *pHasTextChangesOnlyProp =
+ rTableLine.GetFrameFormat()->GetAttrSet().GetItem<SvxPrintItem>(RES_PRINT);
+ if ( !pHasTextChangesOnlyProp || pHasTextChangesOnlyProp->GetValue() )
+ {
+ SvxPrintItem aSetTracking(RES_PRINT, false);
+ SwPosition aPos( *rTableLine.GetTabBoxes()[0]->GetSttNd() );
+ SwCursor aCursor( aPos, nullptr );
+ pDoc->SetRowNotTracked( aCursor, aSetTracking );
+ }
}
else
{