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

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Wed Sep 22 06:22:03 UTC 2021


 sw/source/core/txtnode/ndtxt.cxx |   30 ------------------------------
 1 file changed, 30 deletions(-)

New commits:
commit b22cd6bfb10a2fe0407875e456708d6086accb81
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Tue Sep 21 20:06:16 2021 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Sep 22 08:21:28 2021 +0200

    sw: clean up no longer needed debug code
    
    It made sense when the perf improvement was added to see if the faster
    code indeed does the same as the old slower one, but now it can go.
    
    Change-Id: I45e05d51c2bac1e0d2df6fa1cdf1debe13dd21e8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122401
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 47d495fef56d..190b39a5a7fa 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1426,28 +1426,6 @@ void SwTextNode::Update(
         }
 
         // at-char anchored flys shouldn't be moved, either.
-#if OSL_DEBUG_LEVEL > 0
-        std::vector<SwFrameFormat*> checkFormats;
-        const SwFrameFormats& rFormats = *GetDoc().GetSpzFrameFormats();
-        for (auto& rpFormat : rFormats)
-        {
-            const SwFormatAnchor& rAnchor = rpFormat->GetAnchor();
-            const SwPosition* pContentAnchor = rAnchor.GetContentAnchor();
-            if (rAnchor.GetAnchorId() == RndStdIds::FLY_AT_CHAR && pContentAnchor)
-            {
-                // The fly is at-char anchored and has an anchor position.
-                SwIndex& rEndIdx = const_cast<SwIndex&>(pContentAnchor->nContent);
-                if (&pContentAnchor->nNode.GetNode() == this && rEndIdx.GetIndex() == rPos.GetIndex())
-                {
-                    // The anchor position is exactly our insert position.
-                    #if 0
-                    rEndIdx.Assign(&aTmpIdxReg, rEndIdx.GetIndex());
-                    #endif
-                    checkFormats.push_back( rpFormat );
-                }
-            }
-        }
-#endif
         std::vector<SwFrameFormat*> const& rFlys(GetAnchoredFlys());
         for (size_t i = 0; i != rFlys.size(); ++i)
         {
@@ -1462,17 +1440,9 @@ void SwTextNode::Update(
                 {
                     // The anchor position is exactly our insert position.
                     rEndIdx.Assign(&aTmpIdxReg, rEndIdx.GetIndex());
-#if OSL_DEBUG_LEVEL > 0
-                    auto checkPos = std::find( checkFormats.begin(), checkFormats.end(), pFormat );
-                    assert( checkPos != checkFormats.end());
-                    checkFormats.erase( checkPos );
-#endif
                 }
             }
         }
-#if OSL_DEBUG_LEVEL > 0
-        assert( checkFormats.empty());
-#endif
 
         // The cursors of other shells shouldn't be moved, either.
         if (SwDocShell* pDocShell = GetDoc().GetDocShell())


More information about the Libreoffice-commits mailing list