summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-01-21 13:15:50 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2022-06-22 13:44:49 +0200
commitf9d31904c9b5fa802d9abe28f542a2dd7bcff699 (patch)
tree1d38e2ad6bc1477fb35914eab3f13476e14c77f8
parentFix crash when no valid EntryDescriptor found (diff)
downloadcore-f9d31904c9b5fa802d9abe28f542a2dd7bcff699.tar.gz
core-f9d31904c9b5fa802d9abe28f542a2dd7bcff699.zip
tdf#45589 sw: invalidate on bookmark insertion/deletion
Invalidate the text frames when a bookmark is inserted or deleted; also when MarkManager::repositionMark() changes the positions. The other calls of SetMarkPos()/SetOtherMarkPos() look like they're all from code that corrects positions after text insertions or deletions so no additional invalidate should be necessary there. It turns out that one WW8 document in sw_filters_test wants to insert a bookmark on a SwGrfNode; check for that in makeMark(). Change-Id: I293e6da9042bea5992cb27091b9cff77e5c7961d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87157 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit ef8427d12a63127a2eb867637699343d630545dd) Note, this was already cherry-picked as commit 011f7c8a461ff6e0b3e83bf2c90b1d4502406df1 but apparently some parts missing. Change-Id: I5daa88b8adb273c4f8a4a3c46c13f1fd70188554
-rw-r--r--sw/source/core/crsr/bookmrk.cxx18
-rw-r--r--sw/source/core/doc/docbm.cxx5
-rw-r--r--sw/source/core/inc/bookmrk.hxx6
3 files changed, 20 insertions, 9 deletions
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index 1c4d4941463a..3de0b8351391 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -431,6 +431,24 @@ namespace sw { namespace mark
}
}
+ void Bookmark::Hide(bool const isHide)
+ {
+ if (isHide != m_bHidden)
+ {
+ m_bHidden = isHide;
+ InvalidateFrames();
+ }
+ }
+
+ void Bookmark::SetHideCondition(OUString const& rHideCondition)
+ {
+ if (m_sHideCondition != rHideCondition)
+ {
+ m_sHideCondition = rHideCondition;
+ InvalidateFrames();
+ }
+ }
+
::sfx2::IXmlIdRegistry& Bookmark::GetRegistry()
{
SwDoc *const pDoc( GetMarkPos().GetDoc() );
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 13034ce3a699..7918e5db8dbe 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -561,11 +561,6 @@ namespace sw { namespace mark
pPos2->nContent.GetIndex());
}
#endif
- // see for example _SaveContentIdx, Shells
- OSL_PRECOND(m_vAllMarks.size() < USHRT_MAX,
- "MarkManager::makeMark(..)"
- " - more than USHRT_MAX marks are not supported correctly");
-
if ( (!rPaM.GetPoint()->nNode.GetNode().IsTextNode()
&& (eType != MarkType::UNO_BOOKMARK
// SwXTextRange can be on table node or plain start node (FLY_AT_FLY)
diff --git a/sw/source/core/inc/bookmrk.hxx b/sw/source/core/inc/bookmrk.hxx
index 45be76199073..fe5bff942568 100644
--- a/sw/source/core/inc/bookmrk.hxx
+++ b/sw/source/core/inc/bookmrk.hxx
@@ -186,10 +186,8 @@ namespace sw {
{ return m_bHidden; }
virtual const OUString& GetHideCondition() const override
{ return m_sHideCondition; }
- virtual void Hide(bool rHide) override
- { m_bHidden = rHide; }
- virtual void SetHideCondition(const OUString& rHideCondition) override
- { m_sHideCondition = rHideCondition; }
+ virtual void Hide(bool rHide) override;
+ virtual void SetHideCondition(const OUString& rHideCondition) override;
// ::sfx2::Metadatable
virtual ::sfx2::IXmlIdRegistry& GetRegistry() override;