summaryrefslogtreecommitdiff
path: root/sw/source/core/fields/postithelper.cxx
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-12-05 15:24:55 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2018-12-05 15:29:12 +0100
commit9075687133063fea49e8b3d739d65dfa9e69cc7f (patch)
treec29cafdd2d153bb85124656802505e1a9a7bf17c /sw/source/core/fields/postithelper.cxx
parenta7d2885bf8b6d717b441f6cc9215e7ae2700b82a (diff)
sw_redlinehide_4b: consider the comments in the margin
SwPostItMgr needs to hide the comments that are in delete redlines. Also notify SwPostItMgr when redlines are created/removed. SwPostItMgr is owned by the ViewShell but there is currently only one layout so SwRootFrame still needs to broadcast to all of them. Also an EndListening call was missing in SwPostItMgr::CheckForRemovedPostIts() which caused asserts. Change-Id: Ic0fccde50f6fdaa449afb535476c00c41ba94287
Diffstat (limited to 'sw/source/core/fields/postithelper.cxx')
-rw-r--r--sw/source/core/fields/postithelper.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/sw/source/core/fields/postithelper.cxx b/sw/source/core/fields/postithelper.cxx
index d02bbec26c6a..8b276678a3d7 100644
--- a/sw/source/core/fields/postithelper.cxx
+++ b/sw/source/core/fields/postithelper.cxx
@@ -31,6 +31,7 @@
#include <txtfrm.hxx>
#include <tabfrm.hxx>
#include <IDocumentRedlineAccess.hxx>
+#include <IDocumentFieldsAccess.hxx>
#include <redline.hxx>
#include <scriptinfo.hxx>
#include <editeng/charhiddenitem.hxx>
@@ -142,9 +143,12 @@ SwPosition SwAnnotationItem::GetAnchorPosition() const
return aPos;
}
-bool SwAnnotationItem::UseElement()
+bool SwAnnotationItem::UseElement(SwRootFrame const& rLayout,
+ IDocumentRedlineAccess const& rIDRA)
{
- return mrFormatField.IsFieldInDoc();
+ return mrFormatField.IsFieldInDoc()
+ && (!rLayout.IsHideRedlines()
+ || !sw::IsFieldDeletedInModel(rIDRA, *mrFormatField.GetTextField()));
}
VclPtr<sw::annotation::SwAnnotationWin> SwAnnotationItem::GetSidebarWindow(