diff options
Diffstat (limited to 'sw/source/core/crsr/bookmrk.cxx')
-rw-r--r-- | sw/source/core/crsr/bookmrk.cxx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx index a16713dc295d..1c4d4941463a 100644 --- a/sw/source/core/crsr/bookmrk.cxx +++ b/sw/source/core/crsr/bookmrk.cxx @@ -25,6 +25,7 @@ #include <doc.hxx> #include <ndtxt.hxx> #include <pam.hxx> +#include <hints.hxx> #include <swserv.hxx> #include <sfx2/linkmgr.hxx> #include <UndoBookmark.hxx> @@ -238,6 +239,12 @@ namespace io_pDoc->GetIDocumentUndoRedo().EndUndo(SwUndoId::UI_REPLACE, nullptr); }; + + auto InvalidatePosition(SwPosition const& rPos) -> void + { + SwUpdateAttr const hint(rPos.nContent.GetIndex(), rPos.nContent.GetIndex(), 0); + rPos.nNode.GetNode().GetTextNode()->NotifyClients(nullptr, &hint); + } } namespace sw { namespace mark @@ -337,6 +344,11 @@ namespace sw { namespace mark } // TODO: everything else uses MarkBase::GenerateNewName ? + + auto MarkBase::InvalidateFrames() -> void + { + } + NavigatorReminder::NavigatorReminder(const SwPaM& rPaM) : MarkBase(rPaM, "__NavigatorReminder__") { } @@ -393,6 +405,7 @@ namespace sw { namespace mark std::make_unique<SwUndoInsBookmark>(*this)); } io_pDoc->getIDocumentState().SetModified(); + InvalidateFrames(); } void Bookmark::DeregisterFromDoc(SwDoc* const io_pDoc) @@ -405,6 +418,17 @@ namespace sw { namespace mark std::make_unique<SwUndoDeleteBookmark>(*this)); } io_pDoc->getIDocumentState().SetModified(); + InvalidateFrames(); + } + + // invalidate text frames in case it's hidden or Formatting Marks enabled + auto Bookmark::InvalidateFrames() -> void + { + InvalidatePosition(GetMarkPos()); + if (IsExpanded()) + { + InvalidatePosition(GetOtherMarkPos()); + } } ::sfx2::IXmlIdRegistry& Bookmark::GetRegistry() @@ -513,6 +537,8 @@ namespace sw { namespace mark if (eMode == sw::mark::InsertMode::New) { lcl_SetFieldMarks(this, io_pDoc, CH_TXT_ATR_FIELDSTART, CH_TXT_ATR_FIELDEND, pSepPos); + // no need to invalidate text frames here, the insertion of the + // CH_TXT_ATR already invalidates } else { |