From 4c7775247fbbf38cd397fd7649bf10810f27a0b4 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 3 Feb 2017 16:48:02 +0100 Subject: tdf#104447 sw: make lcl_DebugMarks output more readable, pos. at the start MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit f6596a35c2d9a8c365bb78e1256a2def57ee1a36) The pass-by-value is also fixed here which is a surprisingly expensive performance regression. Change-Id: If9c151faefa3d109af2df7933a275c667880fb75 Reviewed-on: https://gerrit.libreoffice.org/35492 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sw/source/core/doc/docbm.cxx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index f75dd0e2c5de..1604d7ccf35c 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -288,28 +288,28 @@ namespace [&rName] (IDocumentMarkAccess::pMark_t const& rpMark) { return rpMark->GetName() == rName; } ); } - void lcl_DebugMarks(IDocumentMarkAccess::container_t vMarks) + void lcl_DebugMarks(IDocumentMarkAccess::container_t const& rMarks) { #if OSL_DEBUG_LEVEL > 0 - SAL_INFO("sw.core", vMarks.size() << " Marks"); - for(IDocumentMarkAccess::iterator_t ppMark = vMarks.begin(); - ppMark != vMarks.end(); - ppMark++) + SAL_INFO("sw.core", rMarks.size() << " Marks"); + for (IDocumentMarkAccess::const_iterator_t ppMark = rMarks.begin(); + ppMark != rMarks.end(); + ++ppMark) { IMark* pMark = ppMark->get(); const SwPosition* const pStPos = &pMark->GetMarkStart(); const SwPosition* const pEndPos = &pMark->GetMarkEnd(); SAL_INFO("sw.core", - typeid(*pMark).name() << " " << - pMark->GetName() << " " << pStPos->nNode.GetIndex() << "," << pStPos->nContent.GetIndex() << " " << pEndPos->nNode.GetIndex() << "," << - pEndPos->nContent.GetIndex()); + pEndPos->nContent.GetIndex() << " " << + typeid(*pMark).name() << " " << + pMark->GetName()); } #endif - assert(std::is_sorted(vMarks.begin(), vMarks.end(), lcl_MarkOrderingByStart)); - (void) vMarks; + assert(std::is_sorted(rMarks.begin(), rMarks.end(), lcl_MarkOrderingByStart)); + (void) rMarks; }; } -- cgit