[Libreoffice-commits] core.git: sw/source

Miklos Vajna vmiklos at collabora.co.uk
Wed Apr 2 03:05:46 PDT 2014


 sw/source/core/docnode/nodedump.cxx |   20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

New commits:
commit 82332ee1fc23b6fdccaf92149c0f2fa46fcdc4d6
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Apr 2 11:59:47 2014 +0200

    sw doc model dump: handle SdrObject text
    
    Change-Id: I0b11aaa3efd5176a3a7c124bd15d50962ee7e90e

diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index aee1ca2..dbdf480 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -26,6 +26,8 @@
 #include <editeng/rsiditem.hxx>
 #include <editeng/fontitem.hxx>
 #include <editeng/fhgtitem.hxx>
+#include <editeng/editobj.hxx>
+#include <editeng/outlobj.hxx>
 #include <svx/svdpage.hxx>
 #include <svx/svdmodel.hxx>
 #include <tools/datetimeutils.hxx>
@@ -125,7 +127,7 @@ void lcl_dumpSdrModel(WriterHelper& writer, const SdrModel* pModel)
             sal_Int32 nObjCount = pPage->GetObjCount();
             for (sal_Int32 i = 0; i < nObjCount; ++i)
             {
-                SdrObject* pObject = pPage->GetObj(i);
+                const SdrObject* pObject = pPage->GetObj(i);
                 writer.startElement("sdrObject");
                 writer.writeFormatAttribute("ptr", "%p", pObject);
                 if (pObject)
@@ -134,6 +136,22 @@ void lcl_dumpSdrModel(WriterHelper& writer, const SdrModel* pModel)
                     writer.writeFormatAttribute("name", "%s", BAD_CAST(OUStringToOString(pObject->GetName(), RTL_TEXTENCODING_UTF8).getStr()));
                     writer.writeFormatAttribute("title", "%s", BAD_CAST(OUStringToOString(pObject->GetTitle(), RTL_TEXTENCODING_UTF8).getStr()));
                     writer.writeFormatAttribute("description", "%s", BAD_CAST(OUStringToOString(pObject->GetDescription(), RTL_TEXTENCODING_UTF8).getStr()));
+
+                    const OutlinerParaObject* pOutliner = pObject->GetOutlinerParaObject();
+                    writer.startElement("outliner");
+                    writer.writeFormatAttribute("ptr", "%p", pOutliner);
+                    if (pOutliner)
+                    {
+                        const EditTextObject& rEditObj = pOutliner->GetTextObject();
+                        sal_Int32 nPara = rEditObj.GetParagraphCount();
+                        for (sal_Int32 j = 0; j < nPara; ++j)
+                        {
+                            writer.startElement("paragraph");
+                            xmlTextWriterWriteString(writer, BAD_CAST(OUStringToOString(rEditObj.GetText(j), RTL_TEXTENCODING_UTF8).getStr()));
+                            writer.endElement();
+                        }
+                    }
+                    writer.endElement();
                 }
                 writer.endElement();
             }


More information about the Libreoffice-commits mailing list