summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-08-25 22:55:22 +0200
committerMichael Stahl <mstahl@redhat.com>2017-08-25 23:01:09 +0200
commit9cabd72ef14e19897f4d6f078758ac8b1aa6c02f (patch)
tree164f17f5836386e62ed39589aa31bfea6caba786 /sw/inc
parent355715d333bced59256afb005ac9f243d37aa23e (diff)
tdf#109267 sw: fix confusing return value of AppendRedline()
AppendRedline() has a boolen return value which is rather unclear and confusing: most callers don't even check it, but SaveMergeRedline::InsertRedline() expects "true" to mean that its redline hasn't been deleted, whereas makeRedline() expects "true" to mean that the redline was somehow "valid", even if it has been deleted and merged with an existing one. The "bMerged" variable in AppendRedline(), which is the source of the confusion, was introduced with commit 81286906d0b76a3b6c4443378877828290c3e5f0 "docx import fixes for: redlines". Split these differing expectations into different return values of a new enum type. Change-Id: If81631bde49ee52a249f5ba1dd64ab8e92fffaf7
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/IDocumentRedlineAccess.hxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/sw/inc/IDocumentRedlineAccess.hxx b/sw/inc/IDocumentRedlineAccess.hxx
index ac5d017eda4c..3f42f32d98ea 100644
--- a/sw/inc/IDocumentRedlineAccess.hxx
+++ b/sw/inc/IDocumentRedlineAccess.hxx
@@ -159,15 +159,23 @@ public:
virtual bool IsInRedlines(const SwNode& rNode) const = 0;
+ enum class AppendResult { IGNORED, MERGED, APPENDED };
/** Append a new redline
- @param pPtr
+ @param pNewRedl redline to insert
@param bCallDelete
+ if set, then for a new DELETE redline that is inserted so that it
+ overlaps an existing INSERT redline with the same author, the
+ overlapping range is deleted, i.e. the new DELETE removes
+ existing INSERT for that range
@returns
+ APPENDED if pNewRedl is still alive and was appended
+ MERGED if pNewRedl was deleted but has been merged with existing one
+ IGNORED if pNewRedl was deleted and ignored/invalid
*/
- virtual bool AppendRedline(/*[in]*/SwRangeRedline* pPtr, /*[in]*/bool bCallDelete) = 0;
+ virtual AppendResult AppendRedline(/*[in]*/SwRangeRedline* pNewRedl, /*[in]*/bool bCallDelete) = 0;
virtual bool AppendTableRowRedline(/*[in]*/SwTableRowRedline* pPtr, /*[in]*/bool bCallDelete) = 0;
virtual bool AppendTableCellRedline(/*[in]*/SwTableCellRedline* pPtr, /*[in]*/bool bCallDelete) = 0;