[Libreoffice-commits] core.git: sw/source

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Mon Oct 14 08:57:45 UTC 2019


 sw/source/core/doc/docbm.cxx |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

New commits:
commit a77321a07695c067662885eea5369e3c821dccb0
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Fri Oct 11 14:42:12 2019 +0200
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Mon Oct 14 10:57:01 2019 +0200

    sw: deleteFieldmarkAt() should just call getFieldmarkAt()
    
    dynamic_cast isn't a performance problem here.
    
    Change-Id: I7d90025051a428588479bb1431dd8bac292f5c49
    Reviewed-on: https://gerrit.libreoffice.org/80672
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 1d61f2ac65e7..880943fd6560 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -1284,14 +1284,11 @@ namespace sw { namespace mark
 
     void MarkManager::deleteFieldmarkAt(const SwPosition& rPos)
     {
-        auto const pFieldmark = find_if(
-            m_vFieldmarks.begin(),
-            m_vFieldmarks.end(),
-            [&rPos] (const ::sw::mark::IMark* pMark) { return pMark->IsCoveringPosition(rPos); } );
-        if(pFieldmark == m_vFieldmarks.end())
+        auto const pFieldmark = dynamic_cast<Fieldmark*>(getFieldmarkAt(rPos));
+        if (!pFieldmark)
             return;
 
-        deleteMark(lcl_FindMark(m_vAllMarks, *pFieldmark));
+        deleteMark(lcl_FindMark(m_vAllMarks, pFieldmark));
     }
 
     ::sw::mark::IFieldmark* MarkManager::changeFormFieldmarkType(::sw::mark::IFieldmark* pFieldmark, const OUString& rNewType)


More information about the Libreoffice-commits mailing list