sw/source/core/text/xmldump.cxx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
New commits: commit 91efe73bb00855edb75d57e964eaf1e89a5f5935 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Fri Sep 13 09:13:27 2013 +0200 SwFrm::dumpAsXml: dump cursor positions as well Change-Id: Icd832483228812cf3c8ddff3c0d56090f3b17856 diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx index b38816a..fabdcd8 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 ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits