diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-09-13 09:13:27 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-09-13 09:20:41 +0200 |
commit | 91efe73bb00855edb75d57e964eaf1e89a5f5935 (patch) | |
tree | 5486640b86a497b62f8eed1aa49bf2cbae1b59e3 /sw | |
parent | 114eef57b5f5dd2936d528588bfd80a970845bb5 (diff) |
SwFrm::dumpAsXml: dump cursor positions as well
Change-Id: Icd832483228812cf3c8ddff3c0d56090f3b17856
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/text/xmldump.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx index b38816a2d3cf..fabdcd867340 100644 --- a/sw/source/core/text/xmldump.cxx +++ b/sw/source/core/text/xmldump.cxx @@ -13,6 +13,8 @@ #include "tabfrm.hxx" #include "txtfrm.hxx" #include "hffrm.hxx" +#include "rootfrm.hxx" +#include "editsh.hxx" #include "porlin.hxx" #include "porlay.hxx" #include "portxt.hxx" @@ -287,6 +289,28 @@ void SwFrm::dumpAsXml( xmlTextWriterPtr writer ) dumpAsXmlAttributes( writer ); + if (IsRootFrm()) + { + // Root frame has access to the edit shell, so dump the current selection ranges here. + SwRootFrm* const pRootFrm = static_cast<SwRootFrm* const>(this); + SwEditShell* pEditShell = pRootFrm->GetCurrShell()->GetDoc()->GetEditShell(); + xmlTextWriterStartElement(writer, BAD_CAST("shellCrsr")); + SwPaM* pPaM = pEditShell->getShellCrsr(false); + do + { + xmlTextWriterStartElement(writer, BAD_CAST("swpam")); + xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("pointNodeIndex"), "%ld", pPaM->GetPoint()->nNode.GetIndex()); + xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("pointContentIndex"), "%d", pPaM->GetPoint()->nContent.GetIndex()); + + xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("markNodeIndex"), "%ld", pPaM->GetMark()->nNode.GetIndex()); + xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("markContentIndex"), "%d", pPaM->GetMark()->nContent.GetIndex()); + xmlTextWriterEndElement(writer); + pPaM = static_cast<SwPaM*>(pPaM->GetNext()); + } + while (pPaM && pPaM != pEditShell->getShellCrsr(false)); + xmlTextWriterEndElement(writer); + } + xmlTextWriterStartElement( writer, BAD_CAST( "infos" ) ); dumpInfosAsXml( writer ); xmlTextWriterEndElement( writer ); |