From f0b92b8bdf60dab4c60263d29bf7d5b415fde284 Mon Sep 17 00:00:00 2001 From: Bjoern Michaelsen Date: Wed, 3 Dec 2014 18:32:23 +0100 Subject: use C++11 iteration Change-Id: I383e7552160c5e12796ddf7cb13058d99032c7f5 --- sw/source/core/text/xmldump.cxx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'sw') diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx index e5865b34d5ff..58e52f7b8cc5 100644 --- a/sw/source/core/text/xmldump.cxx +++ b/sw/source/core/text/xmldump.cxx @@ -299,19 +299,16 @@ void SwFrm::dumpAsXml( xmlTextWriterPtr writer ) const const SwRootFrm* const pRootFrm = static_cast(this); SwEditShell* pEditShell = pRootFrm->GetCurrShell()->GetDoc()->GetEditShell(); xmlTextWriterStartElement(writer, BAD_CAST("shellCrsr")); - SwPaM* pPaM = pEditShell->getShellCrsr(false); - do + for(SwPaM& rPaM : pEditShell->getShellCrsr(false)->GetRingContainer()) { xmlTextWriterStartElement(writer, BAD_CAST("swpam")); - xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("pointNodeIndex"), "%ld", pPaM->GetPoint()->nNode.GetIndex()); - xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("pointContentIndex"), "%" SAL_PRIdINT32, pPaM->GetPoint()->nContent.GetIndex()); + xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("pointNodeIndex"), "%ld", rPaM.GetPoint()->nNode.GetIndex()); + xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("pointContentIndex"), "%" SAL_PRIdINT32, rPaM.GetPoint()->nContent.GetIndex()); - xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("markNodeIndex"), "%ld", pPaM->GetMark()->nNode.GetIndex()); - xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("markContentIndex"), "%" SAL_PRIdINT32, pPaM->GetMark()->nContent.GetIndex()); + xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("markNodeIndex"), "%ld", rPaM.GetMark()->nNode.GetIndex()); + xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("markContentIndex"), "%" SAL_PRIdINT32, rPaM.GetMark()->nContent.GetIndex()); xmlTextWriterEndElement(writer); - pPaM = static_cast(pPaM->GetNext()); } - while (pPaM && pPaM != pEditShell->getShellCrsr(false)); xmlTextWriterEndElement(writer); } -- cgit