diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-08-22 08:58:54 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-08-22 14:35:27 +0200 |
commit | ab99d91d5ee4b49c6bae7583ba52dae6935ea6a9 (patch) | |
tree | 3ba5d67fe42088361740be17f077ab8ef350e85c | |
parent | 2d9f8f45be0c9bc5f56864f66a37c3cc60069fe5 (diff) |
pMark is the same as *ppMark, so static_cast followed by dynamic_cast
We have already used
static_cast<Fieldmark*>(*ppMark)
when we then use
dynamic_cast<Fieldmark*>(pMark)
so replace both with
static_cast<Fieldmark*>(pMark)
Change-Id: I27334da0a867243d2af87f86711d793e18ec507b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172238
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
-rw-r--r-- | sw/source/core/doc/docbm.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index acc0c1c7f4d2..b12e12228915 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -1215,7 +1215,7 @@ namespace sw::mark { case IDocumentMarkAccess::MarkType::BOOKMARK: { - auto const ppBookmark = lcl_FindMark(m_vBookmarks, static_cast<sw::mark::Bookmark*>(*ppMark)); + auto const ppBookmark = lcl_FindMark(m_vBookmarks, static_cast<sw::mark::Bookmark*>(pMark)); if ( ppBookmark != m_vBookmarks.end() ) { Bookmark* pBookmark = *ppBookmark; @@ -1235,7 +1235,7 @@ namespace sw::mark case IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK: case IDocumentMarkAccess::MarkType::CROSSREF_NUMITEM_BOOKMARK: { - auto const ppBookmark = lcl_FindMark(m_vBookmarks, static_cast<Bookmark*>(*ppMark)); + auto const ppBookmark = lcl_FindMark(m_vBookmarks, static_cast<Bookmark*>(pMark)); if ( ppBookmark != m_vBookmarks.end() ) { m_vBookmarks.erase(ppBookmark); @@ -1253,14 +1253,14 @@ namespace sw::mark case IDocumentMarkAccess::MarkType::DROPDOWN_FIELDMARK: case IDocumentMarkAccess::MarkType::DATE_FIELDMARK: { - auto const ppFieldmark = lcl_FindMark(m_vFieldmarks, static_cast<Fieldmark*>(*ppMark)); + auto const ppFieldmark = lcl_FindMark(m_vFieldmarks, static_cast<Fieldmark*>(pMark)); if ( ppFieldmark != m_vFieldmarks.end() ) { if(m_pLastActiveFieldmark == *ppFieldmark) ClearFieldActivation(); m_vFieldmarks.erase(ppFieldmark); - ret.reset(new LazyFieldmarkDeleter(dynamic_cast<Fieldmark*>(pMark), m_rDoc, isMoveNodes)); + ret.reset(new LazyFieldmarkDeleter(static_cast<Fieldmark*>(pMark), m_rDoc, isMoveNodes)); } else { @@ -1272,7 +1272,7 @@ namespace sw::mark case IDocumentMarkAccess::MarkType::ANNOTATIONMARK: { - auto const ppAnnotationMark = lcl_FindMark(m_vAnnotationMarks, static_cast<AnnotationMark*>(*ppMark)); + auto const ppAnnotationMark = lcl_FindMark(m_vAnnotationMarks, static_cast<AnnotationMark*>(pMark)); assert(ppAnnotationMark != m_vAnnotationMarks.end() && "<MarkManager::deleteMark(..)> - Annotation Mark not found in Annotation Mark container."); m_vAnnotationMarks.erase(ppAnnotationMark); |