summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2014-12-03 18:32:23 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2014-12-04 01:09:56 +0100
commitf0b92b8bdf60dab4c60263d29bf7d5b415fde284 (patch)
tree80bef193d11b7f9484f2c45a5c7ad365fc0843cc /sw
parent71101b2ced8ed7aa252e3fcb0c9c7a6f13b0bc9a (diff)
use C++11 iteration
Change-Id: I383e7552160c5e12796ddf7cb13058d99032c7f5
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/text/xmldump.cxx13
1 files changed, 5 insertions, 8 deletions
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<const SwRootFrm* const>(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<SwPaM*>(pPaM->GetNext());
}
- while (pPaM && pPaM != pEditShell->getShellCrsr(false));
xmlTextWriterEndElement(writer);
}