sw/inc/IDocumentMarkAccess.hxx | 2 +- sw/source/core/doc/docbm.cxx | 3 +-- sw/source/core/doc/docredln.cxx | 5 ++--- sw/source/core/inc/MarkManager.hxx | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-)
New commits: commit 523aff41792dd956e2cc1d214fbfc37a04bed1a6 Author: Noel Grandin <[email protected]> AuthorDate: Fri Aug 9 18:00:45 2024 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Fri Aug 9 21:01:43 2024 +0200 simplify makeAnnotationBookmark it is always called with the same value for the MarkType parameter Change-Id: If82bb362c2c293e44c200994312ee45b35bc8a96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171702 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/sw/inc/IDocumentMarkAccess.hxx b/sw/inc/IDocumentMarkAccess.hxx index 8d20ee09a845..cb64b71e6ac6 100644 --- a/sw/inc/IDocumentMarkAccess.hxx +++ b/sw/inc/IDocumentMarkAccess.hxx @@ -312,7 +312,7 @@ class IDocumentMarkAccess // based on the helper bookmarks (which can survive I/O and hiding redlines) virtual ::sw::mark::Bookmark* makeAnnotationBookmark(const SwPaM& rPaM, const OUString& rProposedName, - MarkType eMark, ::sw::mark::InsertMode eMode, + ::sw::mark::InsertMode eMode, SwPosition const* pSepPos = nullptr) = 0; virtual std::vector<sw::mark::Bookmark*>::const_iterator findAnnotationBookmark( const OUString& rName ) const = 0; virtual void restoreAnnotationMarks(bool bDelete = true) = 0; diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index d5483ff4f3b2..a3e45c5ad70c 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -1699,12 +1699,11 @@ namespace sw::mark // create helper bookmark for annotations on tracked deletions ::sw::mark::Bookmark* MarkManager::makeAnnotationBookmark(const SwPaM& rPaM, const OUString& rName, - const IDocumentMarkAccess::MarkType eType, sw::mark::InsertMode const eMode, SwPosition const*const pSepPos) { OUString sAnnotationBookmarkName(rName + S_ANNOTATION_BOOKMARK); - return static_cast<sw::mark::Bookmark*>(makeMark( rPaM, sAnnotationBookmarkName, eType, eMode, pSepPos)); + return static_cast<sw::mark::Bookmark*>(makeMark( rPaM, sAnnotationBookmarkName, MarkType::BOOKMARK, eMode, pSepPos)); } // find helper bookmark of annotations on tracked deletions diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index f48b067ad9ea..489c12305b2f 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -1804,11 +1804,10 @@ static void lcl_storeAnnotationMarks(SwDoc& rDoc, const SwPosition* pStt, const sal_Int32 nLen = (*pStt == rStartPos) ? 1 : 0; SwPaM aPam( rStartPos.GetNode(), rStartPos.GetContentIndex(), rStartPos.GetNode(), rStartPos.GetContentIndex() + nLen); - ::sw::mark::MarkBase* pMark = rDMA.makeAnnotationBookmark( + ::sw::mark::Bookmark* pBookmark = rDMA.makeAnnotationBookmark( aPam, (**iter).GetName(), - IDocumentMarkAccess::MarkType::BOOKMARK, sw::mark::InsertMode::New); - ::sw::mark::Bookmark* pBookmark = dynamic_cast< ::sw::mark::Bookmark* >(pMark); + sw::mark::InsertMode::New); if (pBookmark) { pBookmark->SetKeyCode(vcl::KeyCode()); diff --git a/sw/source/core/inc/MarkManager.hxx b/sw/source/core/inc/MarkManager.hxx index 21dfcfd8eeeb..4c7be744e48b 100644 --- a/sw/source/core/inc/MarkManager.hxx +++ b/sw/source/core/inc/MarkManager.hxx @@ -128,7 +128,7 @@ namespace sw::mark { // helper bookmark to store annotation range of redlines virtual ::sw::mark::Bookmark* makeAnnotationBookmark(const SwPaM& rPaM, - const OUString& rName, IDocumentMarkAccess::MarkType eMark, + const OUString& rName, sw::mark::InsertMode eMode, SwPosition const* pSepPos = nullptr) override; virtual std::vector<sw::mark::Bookmark*>::const_iterator findAnnotationBookmark( const OUString& rName ) const override;
