summaryrefslogtreecommitdiff
path: root/sw/source/core/fields/postithelper.cxx
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2021-03-18 13:41:46 +0100
committerLászló Németh <nemeth@numbertext.org>2021-03-18 16:32:46 +0100
commit31442054520cf0a263cc17e157cfa102cff8ef6a (patch)
treec6cd81783a93cb30fa192388dca47b89d557b3d0 /sw/source/core/fields/postithelper.cxx
parent88f4b76270c26ab1d99c14f68cdcbea4b6ee9031 (diff)
tdf#140980 sw: fix bad strikethrough of annotations
Not deleted annotation windows got a bad strikethrough in ChangesInMargin mode, if they annotate tracked deletions. Also clean-up commit a001a66ba27e2fe9a485388869d53f001f2b09af (tdf#140982 sw ChangesInMargin: fix annotation ranges). Change-Id: I06cb88113bf038c09702b6ef33e46c94c963730d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112672 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source/core/fields/postithelper.cxx')
-rw-r--r--sw/source/core/fields/postithelper.cxx17
1 files changed, 16 insertions, 1 deletions
diff --git a/sw/source/core/fields/postithelper.cxx b/sw/source/core/fields/postithelper.cxx
index c61637601ad2..18dd7cc10c71 100644
--- a/sw/source/core/fields/postithelper.cxx
+++ b/sw/source/core/fields/postithelper.cxx
@@ -29,6 +29,7 @@
#include <txtfrm.hxx>
#include <IDocumentRedlineAccess.hxx>
#include <IDocumentFieldsAccess.hxx>
+#include <IDocumentMarkAccess.hxx>
#include <redline.hxx>
#include <scriptinfo.hxx>
#include <calbck.hxx>
@@ -193,7 +194,21 @@ SwPostItHelper::SwLayoutStatus SwPostItHelper::getLayoutInfos(
if( RedlineType::Insert == pRedline->GetType() )
aRet = INSERTED;
else if( RedlineType::Delete == pRedline->GetType() )
- aRet = DELETED;
+ {
+ bool bDeleted = pAnnotationMark == nullptr;
+ if( !bDeleted )
+ {
+ IDocumentMarkAccess& rDMA(*pTextNode->GetDoc().getIDocumentMarkAccess());
+ IDocumentMarkAccess::const_iterator_t pAnnotationBookmark =
+ rDMA.findAnnotationBookmark(pAnnotationMark->GetName());
+ // tdf#140980 only really deleted, if there is no helper bookmark
+ // in ChangesInMargin mode
+ if ( pAnnotationBookmark == rDMA.getBookmarksEnd() )
+ bDeleted = true;
+ }
+ if ( bDeleted )
+ aRet = DELETED;
+ }
o_rInfo.mRedlineAuthor = pRedline->GetAuthor();
}
}