summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-11-04 12:06:58 +0000
committerMichael Stahl <michael.stahl@allotropia.de>2021-11-05 10:30:49 +0100
commit0e83cdaf8a96fa06b95219e581fc2eed7df39c26 (patch)
tree5edd688bb487782a51def79cddb783a541d8eb4e /sw
parent73d3639304100d50422435745f8ecc7ff1583de1 (diff)
Resolves: tdf#143643 ensure relayout on undo of insert comment
Change-Id: I732e23b8ff7c17abf4b5b9b7c7964fca6069543c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124707 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/PostItMgr.hxx3
-rw-r--r--sw/source/uibase/docvw/PostItMgr.cxx15
2 files changed, 13 insertions, 5 deletions
diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx
index 760fc7f8abe7..5b12063d2eef 100644
--- a/sw/inc/PostItMgr.hxx
+++ b/sw/inc/PostItMgr.hxx
@@ -153,7 +153,8 @@ class SAL_DLLPUBLIC_RTTI SwPostItMgr final : public SfxListener
bool LayoutByPage( std::vector<sw::annotation::SwAnnotationWin*> &aVisiblePostItList,
const tools::Rectangle& rBorder,
tools::Long lNeededHeight);
- void CheckForRemovedPostIts();
+ // return true if a postit was found to have been removed
+ bool CheckForRemovedPostIts();
bool ArrowEnabled(sal_uInt16 aDirection,tools::ULong aPage) const;
bool BorderOverPageBorder(tools::ULong aPage) const;
bool HasScrollbars() const;
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index d8b79c6e9d7e..f1b3a329f937 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -238,7 +238,7 @@ SwPostItMgr::~SwPostItMgr()
mPages.clear();
}
-void SwPostItMgr::CheckForRemovedPostIts()
+bool SwPostItMgr::CheckForRemovedPostIts()
{
IDocumentRedlineAccess const& rIDRA(mpWrtShell->getIDocumentRedlineAccess());
bool bRemoved = false;
@@ -260,7 +260,7 @@ void SwPostItMgr::CheckForRemovedPostIts()
}
if ( !bRemoved )
- return;
+ return false;
// make sure that no deleted items remain in page lists
// todo: only remove deleted ones?!
@@ -270,9 +270,13 @@ void SwPostItMgr::CheckForRemovedPostIts()
PrepareView();
}
else
- // if postits are their make sure that page lists are not empty
+ {
+ // if postits are there make sure that page lists are not empty
// otherwise sudden paints can cause pain (in BorderOverPageBorder)
CalcRects();
+ }
+
+ return true;
}
SwSidebarItem* SwPostItMgr::InsertItem(SfxBroadcaster* pItem, bool bCheckExistence, bool bFocus)
@@ -370,7 +374,10 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
if (!pField)
{
- CheckForRemovedPostIts();
+ const bool bWasRemoved = CheckForRemovedPostIts();
+ // tdf#143643 ensure relayout on undo of insert comment
+ if (bWasRemoved)
+ mbLayout = true;
break;
}
RemoveItem(pField);