sw/qa/extras/uiwriter/data/split-section-in-nested-table.fodt |  154 ++++++++++
 sw/qa/extras/uiwriter/uiwriter.cxx                            |   17 +
 sw/source/core/layout/sectfrm.cxx                             |   28 -
 writerperfect/source/writer/exp/XMLSectionContext.cxx         |    2 
 writerperfect/source/writer/exp/XMLSectionContext.hxx         |    2 
 writerperfect/source/writer/exp/XMLTextFrameContext.cxx       |    6 
 writerperfect/source/writer/exp/XMLTextFrameContext.hxx       |    2 
 writerperfect/source/writer/exp/XMLTextListContext.cxx        |    2 
 writerperfect/source/writer/exp/XMLTextListContext.hxx        |    2 
 writerperfect/source/writer/exp/XMLTextListItemContext.cxx    |    2 
 writerperfect/source/writer/exp/XMLTextListItemContext.hxx    |    2 
 writerperfect/source/writer/exp/txtparai.cxx                  |    8 
 writerperfect/source/writer/exp/txtparai.hxx                  |    4 
 writerperfect/source/writer/exp/txtstyli.cxx                  |    2 
 writerperfect/source/writer/exp/txtstyli.hxx                  |    2 
 writerperfect/source/writer/exp/xmlfmt.cxx                    |    2 
 writerperfect/source/writer/exp/xmlfmt.hxx                    |    2 
 writerperfect/source/writer/exp/xmlictxt.cxx                  |    2 
 writerperfect/source/writer/exp/xmlictxt.hxx                  |    7 
 writerperfect/source/writer/exp/xmlimp.cxx                    |   10 
 writerperfect/source/writer/exp/xmlimp.hxx                    |    2 
 writerperfect/source/writer/exp/xmlmetai.cxx                  |    2 
 writerperfect/source/writer/exp/xmlmetai.hxx                  |    2 
 writerperfect/source/writer/exp/xmltbli.cxx                   |   10 
 writerperfect/source/writer/exp/xmltbli.hxx                   |    2 
 writerperfect/source/writer/exp/xmltext.cxx                   |    4 
 writerperfect/source/writer/exp/xmltext.hxx                   |    4 
 27 files changed, 218 insertions(+), 66 deletions(-)

New commits:
commit 8da365e2a7a6b30da6c2ca26b2a5f45f89cd5460
Author: Miklos Vajna <[email protected]>
Date:   Mon Sep 25 12:49:34 2017 +0200

    sw: split section frames inside table cells, handle nested tables
    
    Commit 3d1bb76ebf5c51141018cfd76eccdb63472de8de (tdf#112109 sw: split
    section frames inside table cells, ignore nested tables, 2017-08-31)
    explicitly disabled this, but the underlying problem is now fixed with
    commit ec262cbc56822d8fffccd6e983848df196cf5c44 (tdf#112160 sw: audit
    GetNextLayoutLeaf() calls in SwFrame::GetNextSctLeaf(), 2017-09-04), so
    we can have it again.
    
    Change-Id: Ic17c4921de2c69e4cc16ae82cfed58d096879db7

diff --git a/sw/qa/extras/uiwriter/data/split-section-in-nested-table.fodt 
b/sw/qa/extras/uiwriter/data/split-section-in-nested-table.fodt
new file mode 100644
index 000000000000..52d4f64742a4
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/split-section-in-nested-table.fodt
@@ -0,0 +1,154 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<office:document 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:dc="http://purl.org/dc/elements/1.1/"; 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
xmlns:math="http://www.w3.org/1998/Math/MathML"; 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" 
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
xmlns:config="urn:oas
 is:names:tc:opendocument:xmlns:config:1.0" 
xmlns:ooo="http://openoffice.org/2004/office"; 
xmlns:ooow="http://openoffice.org/2004/writer"; 
xmlns:oooc="http://openoffice.org/2004/calc"; 
xmlns:dom="http://www.w3.org/2001/xml-events"; 
xmlns:xforms="http://www.w3.org/2002/xforms"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:rpt="http://openoffice.org/2005/report"; 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:xhtml="http://www.w3.org/1999/xhtml"; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#"; 
xmlns:officeooo="http://openoffice.org/2009/office"; 
xmlns:tableooo="http://openoffice.org/2009/table"; 
xmlns:drawooo="http://openoffice.org/2010/draw"; 
xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"
 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" 
xmlns:formx="urn:openoffice:names:
 experimental:ooxml-odf-interop:xmlns:form:1.0" 
xmlns:css3t="http://www.w3.org/TR/css3-text/"; office:version="1.2" 
office:mimetype="application/vnd.oasis.opendocument.text">
+  <office:styles>
+    <style:default-style style:family="graphic">
+      <style:graphic-properties svg:stroke-color="#3465a4" 
draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" 
draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" 
draw:start-line-spacing-vertical="0.283cm" 
draw:end-line-spacing-horizontal="0.283cm" 
draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/>
+      <style:paragraph-properties style:text-autospace="ideograph-alpha" 
style:line-break="strict" style:font-independent-line-spacing="false">
+        <style:tab-stops/>
+      </style:paragraph-properties>
+      <style:text-properties style:use-window-font-color="true" 
style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="en" 
fo:country="US" style:letter-kerning="true" style:font-name-asian="AR PL 
SungtiL GB" style:font-size-asian="10.5pt" style:language-asian="zh" 
style:country-asian="CN" style:font-name-complex="Lucida Sans" 
style:font-size-complex="12pt" style:language-complex="hi" 
style:country-complex="IN"/>
+    </style:default-style>
+    <style:default-style style:family="paragraph">
+      <style:paragraph-properties fo:orphans="2" fo:widows="2" 
fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" 
style:punctuation-wrap="hanging" style:line-break="strict" 
style:tab-stop-distance="1.251cm" style:writing-mode="page"/>
+      <style:text-properties style:use-window-font-color="true" 
style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="en" 
fo:country="US" style:letter-kerning="true" style:font-name-asian="AR PL 
SungtiL GB" style:font-size-asian="10.5pt" style:language-asian="zh" 
style:country-asian="CN" style:font-name-complex="Lucida Sans" 
style:font-size-complex="12pt" style:language-complex="hi" 
style:country-complex="IN" fo:hyphenate="false" 
fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2"/>
+    </style:default-style>
+    <style:default-style style:family="table">
+      <style:table-properties table:border-model="collapsing"/>
+    </style:default-style>
+    <style:default-style style:family="table-row">
+      <style:table-row-properties fo:keep-together="auto"/>
+    </style:default-style>
+    <style:style style:name="Standard" style:family="paragraph" 
style:class="text"/>
+    <style:style style:name="Heading" style:family="paragraph" 
style:parent-style-name="Standard" style:next-style-name="Text_20_body" 
style:class="text">
+      <style:paragraph-properties fo:margin-top="0.423cm" 
fo:margin-bottom="0.212cm" loext:contextual-spacing="false" 
fo:keep-with-next="always"/>
+      <style:text-properties style:font-name="Liberation Sans" 
fo:font-family="&apos;Liberation Sans&apos;" style:font-family-generic="swiss" 
style:font-pitch="variable" fo:font-size="14pt" style:font-name-asian="AR PL 
SungtiL GB" style:font-family-asian="&apos;AR PL SungtiL GB&apos;" 
style:font-family-generic-asian="system" style:font-pitch-asian="variable" 
style:font-size-asian="14pt" style:font-name-complex="Lucida Sans" 
style:font-family-complex="&apos;Lucida Sans&apos;" 
style:font-family-generic-complex="system" style:font-pitch-complex="variable" 
style:font-size-complex="14pt"/>
+    </style:style>
+    <style:style style:name="Text_20_body" style:display-name="Text body" 
style:family="paragraph" style:parent-style-name="Standard" style:class="text">
+      <style:paragraph-properties fo:margin-top="0cm" 
fo:margin-bottom="0.247cm" loext:contextual-spacing="false" 
fo:line-height="120%"/>
+    </style:style>
+    <style:style style:name="List" style:family="paragraph" 
style:parent-style-name="Text_20_body" style:class="list">
+      <style:text-properties style:font-size-asian="12pt" 
style:font-name-complex="Lucida Sans1" style:font-family-complex="&apos;Lucida 
Sans&apos;" style:font-family-generic-complex="swiss"/>
+    </style:style>
+    <style:style style:name="Caption" style:family="paragraph" 
style:parent-style-name="Standard" style:class="extra">
+      <style:paragraph-properties fo:margin-top="0.212cm" 
fo:margin-bottom="0.212cm" loext:contextual-spacing="false" 
text:number-lines="false" text:line-number="0"/>
+      <style:text-properties fo:font-size="12pt" fo:font-style="italic" 
style:font-size-asian="12pt" style:font-style-asian="italic" 
style:font-name-complex="Lucida Sans1" style:font-family-complex="&apos;Lucida 
Sans&apos;" style:font-family-generic-complex="swiss" 
style:font-size-complex="12pt" style:font-style-complex="italic"/>
+    </style:style>
+    <style:style style:name="Index" style:family="paragraph" 
style:parent-style-name="Standard" style:class="index">
+      <style:paragraph-properties text:number-lines="false" 
text:line-number="0"/>
+      <style:text-properties style:font-size-asian="12pt" 
style:font-name-complex="Lucida Sans1" style:font-family-complex="&apos;Lucida 
Sans&apos;" style:font-family-generic-complex="swiss"/>
+    </style:style>
+    <style:style style:name="Table_20_Contents" style:display-name="Table 
Contents" style:family="paragraph" style:parent-style-name="Standard" 
style:class="extra">
+      <style:paragraph-properties text:number-lines="false" 
text:line-number="0"/>
+    </style:style>
+    <text:notes-configuration text:note-class="footnote" style:num-format="1" 
text:start-value="0" text:footnotes-position="page" 
text:start-numbering-at="document"/>
+    <text:notes-configuration text:note-class="endnote" style:num-format="i" 
text:start-value="0"/>
+    <text:linenumbering-configuration text:number-lines="false" 
text:offset="0.499cm" style:num-format="1" text:number-position="left" 
text:increment="5"/>
+  </office:styles>
+  <office:automatic-styles>
+    <style:style style:name="Table1" style:family="table">
+      <style:table-properties style:width="17.59cm" table:align="margins"/>
+    </style:style>
+    <style:style style:name="Table1.A" style:family="table-column">
+      <style:table-column-properties style:column-width="8.795cm" 
style:rel-column-width="32767*"/>
+    </style:style>
+    <style:style style:name="Table1.B" style:family="table-column">
+      <style:table-column-properties style:column-width="8.795cm" 
style:rel-column-width="32768*"/>
+    </style:style>
+    <style:style style:name="Table1.A1" style:family="table-cell">
+      <style:table-cell-properties fo:padding="0.097cm" fo:border-left="0.05pt 
solid #000000" fo:border-right="none" fo:border-top="0.05pt solid #000000" 
fo:border-bottom="0.05pt solid #000000"/>
+    </style:style>
+    <style:style style:name="Table1.B1" style:family="table-cell">
+      <style:table-cell-properties fo:padding="0.097cm" fo:border="0.05pt 
solid #000000"/>
+    </style:style>
+    <style:style style:name="Table2" style:family="table">
+      <style:table-properties style:width="8.599cm" table:align="margins"/>
+    </style:style>
+    <style:style style:name="Table2.A" style:family="table-column">
+      <style:table-column-properties style:column-width="4.299cm" 
style:rel-column-width="32767*"/>
+    </style:style>
+    <style:style style:name="Table2.B" style:family="table-column">
+      <style:table-column-properties style:column-width="4.3cm" 
style:rel-column-width="32768*"/>
+    </style:style>
+    <style:style style:name="Table2.A1" style:family="table-cell">
+      <style:table-cell-properties fo:padding="0.097cm" fo:border-left="0.05pt 
solid #000000" fo:border-right="none" fo:border-top="0.05pt solid #000000" 
fo:border-bottom="0.05pt solid #000000"/>
+    </style:style>
+    <style:style style:name="Table2.B1" style:family="table-cell">
+      <style:table-cell-properties fo:padding="0.097cm" fo:border="0.05pt 
solid #000000"/>
+    </style:style>
+    <style:style style:name="P1" style:family="paragraph" 
style:parent-style-name="Standard">
+      <style:text-properties officeooo:rsid="00026875" 
officeooo:paragraph-rsid="00026875"/>
+    </style:style>
+    <style:style style:name="P2" style:family="paragraph" 
style:parent-style-name="Table_20_Contents">
+      <style:text-properties officeooo:rsid="0008b999" 
officeooo:paragraph-rsid="0008b999"/>
+    </style:style>
+    <style:style style:name="P3" style:family="paragraph" 
style:parent-style-name="Table_20_Contents">
+      <style:text-properties officeooo:rsid="0008b999" 
officeooo:paragraph-rsid="000a9ee7"/>
+    </style:style>
+    <style:style style:name="P4" style:family="paragraph" 
style:parent-style-name="Table_20_Contents">
+      <style:text-properties officeooo:rsid="000bc254" 
officeooo:paragraph-rsid="000bc254"/>
+    </style:style>
+    <style:style style:name="T1" style:family="text">
+      <style:text-properties officeooo:rsid="000bc254"/>
+    </style:style>
+    <style:style style:name="T2" style:family="text">
+      <style:text-properties officeooo:rsid="000e3a11"/>
+    </style:style>
+    <style:style style:name="Sect1" style:family="section">
+      <style:section-properties style:editable="false">
+        <style:columns fo:column-count="1" fo:column-gap="0cm"/>
+      </style:section-properties>
+    </style:style>
+    <style:page-layout style:name="pm1">
+      <style:page-layout-properties fo:page-width="21.59cm" 
fo:page-height="8.64cm" style:num-format="1" style:print-orientation="portrait" 
fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" 
fo:margin-right="2cm" style:writing-mode="lr-tb" 
style:footnote-max-height="0cm">
+        <style:footnote-sep style:width="0.018cm" 
style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" 
style:line-style="solid" style:adjustment="left" style:rel-width="25%" 
style:color="#000000"/>
+      </style:page-layout-properties>
+      <style:header-style/>
+      <style:footer-style/>
+    </style:page-layout>
+  </office:automatic-styles>
+  <office:master-styles>
+    <style:master-page style:name="Standard" style:page-layout-name="pm1"/>
+  </office:master-styles>
+  <office:body>
+    <office:text text:use-soft-page-breaks="true">
+      <office:forms form:automatic-focus="false" 
form:apply-design-mode="false"/>
+      <text:sequence-decls>
+        <text:sequence-decl text:display-outline-level="0" 
text:name="Illustration"/>
+        <text:sequence-decl text:display-outline-level="0" text:name="Table"/>
+        <text:sequence-decl text:display-outline-level="0" text:name="Text"/>
+        <text:sequence-decl text:display-outline-level="0" 
text:name="Drawing"/>
+      </text:sequence-decls>
+      <text:p text:style-name="P1">Before table.</text:p>
+      <table:table table:name="Table1" table:style-name="Table1">
+        <table:table-column table:style-name="Table1.A"/>
+        <table:table-column table:style-name="Table1.B"/>
+        <table:table-row>
+          <table:table-cell table:style-name="Table1.A1" 
office:value-type="string">
+            <text:p text:style-name="P2">Before inner table.</text:p>
+            <table:table table:name="Table2" table:style-name="Table2">
+              <table:table-column table:style-name="Table2.A"/>
+              <table:table-column table:style-name="Table2.B"/>
+              <table:table-row>
+                <table:table-cell table:style-name="Table2.A1" 
office:value-type="string">
+                  <text:p text:style-name="P2">Before section.</text:p>
+                  <text:section text:style-name="Sect1" text:name="Section2">
+                    <text:p text:style-name="P3">In section. He heard quiet 
steps behind him. That didn&apos;t bode well. Who could be following him this 
late <text:soft-page-break/>at night and in this deadbeat part of town?</text:p>
+                  </text:section>
+                  <text:p text:style-name="P2">After section.</text:p>
+                </table:table-cell>
+                <table:table-cell table:style-name="Table2.B1" 
office:value-type="string">
+                  <text:p text:style-name="P2"><text:span 
text:style-name="T1">Table2:</text:span>B1</text:p>
+                </table:table-cell>
+              </table:table-row>
+            </table:table>
+            <text:p text:style-name="P2">After inner table.</text:p>
+          </table:table-cell>
+          <table:table-cell table:style-name="Table1.B1" 
office:value-type="string">
+            <text:p text:style-name="P4">Table<text:span 
text:style-name="T2">1</text:span>:B1</text:p>
+          </table:table-cell>
+        </table:table-row>
+      </table:table>
+      <text:p text:style-name="P1">After table.</text:p>
+    </office:text>
+  </office:body>
+</office:document>
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index 3574334acc34..8b1e7c5185ac 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -267,6 +267,7 @@ public:
     void testTableInNestedSection();
     void testTableInSectionInTable();
     void testSectionInTableInTable();
+    void testSectionInTableInTable2();
     void testTdf112160();
     void testLinesMoveBackwardsInSectionInTable();
 #endif
@@ -422,6 +423,7 @@ public:
     CPPUNIT_TEST(testTableInNestedSection);
     CPPUNIT_TEST(testTableInSectionInTable);
     CPPUNIT_TEST(testSectionInTableInTable);
+    CPPUNIT_TEST(testSectionInTableInTable2);
     CPPUNIT_TEST(testTdf112160);
     CPPUNIT_TEST(testLinesMoveBackwardsInSectionInTable);
 #endif
@@ -5180,6 +5182,21 @@ void SwUiWriterTest::testSectionInTableInTable()
     createDoc("tdf112109.fodt");
 }
 
+void SwUiWriterTest::testSectionInTableInTable2()
+{
+    createDoc("split-section-in-nested-table.fodt");
+    xmlDocPtr pXmlDoc = parseLayoutDump();
+    sal_uInt32 nSection1 = getXPath(pXmlDoc, 
"//page[1]//body/tab/row/cell/tab/row/cell/section", "id").toUInt32();
+    sal_uInt32 nSection1Follow = getXPath(pXmlDoc, 
"//page[1]//body/tab/row/cell/tab/row/cell/section", "follow").toUInt32();
+    // This failed, the section wasn't split inside a nested table.
+    sal_uInt32 nSection2 = getXPath(pXmlDoc, 
"//page[2]//body/tab/row/cell/tab/row/cell/section", "id").toUInt32();
+    sal_uInt32 nSection2Precede = getXPath(pXmlDoc, 
"//page[2]//body/tab/row/cell/tab/row/cell/section", "precede").toUInt32();
+
+    // Make sure that the first's follow and the second's precede is correct.
+    CPPUNIT_ASSERT_EQUAL(nSection2, nSection1Follow);
+    CPPUNIT_ASSERT_EQUAL(nSection1, nSection2Precede);
+}
+
 void SwUiWriterTest::testTdf112160()
 {
     // Assert that the A2 cell is on page 1.
diff --git a/sw/source/core/layout/sectfrm.cxx 
b/sw/source/core/layout/sectfrm.cxx
index 39bc17c79092..d5aa2322187e 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -589,34 +589,14 @@ namespace
         return pLayFrame;
     }
 
-    /// Checks if pFrame is in a table, which itself is in a section.
-    bool IsFrameInTableInSection(const SwFrame* pFrame)
+    /// Checks if pFrame has a parent that can contain a split section frame.
+    bool CanContainSplitSection(const SwFrame* pFrame)
     {
         if (!pFrame->IsInTab())
-            return false;
+            return true;
 
         // The frame is in a table, see if the table is in a section.
-        return pFrame->FindTabFrame()->IsInSct();
-    }
-
-    /// Checks if pFrame is in a table, which itself is in a table.
-    bool IsFrameInTableInTable(const SwFrame* pFrame)
-    {
-        if (!pFrame->IsInTab())
-            return false;
-
-        // The frame is in a table, see if the inner table is in an outer
-        // table.
-        bool bNested = false;
-        if (const SwFrame* pUpper = pFrame->FindTabFrame()->GetUpper())
-            bNested = pUpper->IsInTab();
-        return bNested;
-    }
-
-    /// Checks if pFrame has a parent that can contain a split section frame.
-    bool CanContainSplitSection(const SwFrame* pFrame)
-    {
-        return !IsFrameInTableInSection(pFrame) && 
!IsFrameInTableInTable(pFrame);
+        return !pFrame->FindTabFrame()->IsInSct();
     }
 }
 
commit 68af7378074397466c15509a5d813dce69a54a41
Author: Miklos Vajna <[email protected]>
Date:   Mon Sep 25 10:33:48 2017 +0200

    EPUB export: don't leak when exceptions are thrown
    
    Additional benefit is that this way we're again in sync with xmloff
    code.
    
    Change-Id: Ifa1dd976fbd2ce04cb47814060508c65e35474ca

diff --git a/writerperfect/source/writer/exp/XMLSectionContext.cxx 
b/writerperfect/source/writer/exp/XMLSectionContext.cxx
index ba6e1a7944f7..9d3621c4f346 100644
--- a/writerperfect/source/writer/exp/XMLSectionContext.cxx
+++ b/writerperfect/source/writer/exp/XMLSectionContext.cxx
@@ -24,7 +24,7 @@ XMLSectionContext::XMLSectionContext(XMLImport &rImport)
 {
 }
 
-XMLImportContext *XMLSectionContext::CreateChildContext(const OUString &rName, 
const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
+rtl::Reference<XMLImportContext> XMLSectionContext::CreateChildContext(const 
OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> 
&/*xAttribs*/)
 {
     return CreateTextChildContext(mrImport, rName);
 }
diff --git a/writerperfect/source/writer/exp/XMLSectionContext.hxx 
b/writerperfect/source/writer/exp/XMLSectionContext.hxx
index 5aa49a444a9a..9eeb69a311b4 100644
--- a/writerperfect/source/writer/exp/XMLSectionContext.hxx
+++ b/writerperfect/source/writer/exp/XMLSectionContext.hxx
@@ -23,7 +23,7 @@ class XMLSectionContext : public XMLImportContext
 public:
     XMLSectionContext(XMLImport &rImport);
 
-    XMLImportContext *CreateChildContext(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
+    rtl::Reference<XMLImportContext> CreateChildContext(const OUString &rName, 
const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
     void SAL_CALL startElement(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
     void SAL_CALL endElement(const OUString &rName) override;
 };
diff --git a/writerperfect/source/writer/exp/XMLTextFrameContext.cxx 
b/writerperfect/source/writer/exp/XMLTextFrameContext.cxx
index 60cbe2d21263..94c76b71be9a 100644
--- a/writerperfect/source/writer/exp/XMLTextFrameContext.cxx
+++ b/writerperfect/source/writer/exp/XMLTextFrameContext.cxx
@@ -25,7 +25,7 @@ class XMLTextImageContext : public XMLImportContext
 public:
     XMLTextImageContext(XMLImport &rImport);
 
-    XMLImportContext *CreateChildContext(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
+    rtl::Reference<XMLImportContext> CreateChildContext(const OUString &rName, 
const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
 
     void SAL_CALL startElement(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
     void SAL_CALL endElement(const OUString &rName) override;
@@ -40,7 +40,7 @@ XMLTextImageContext::XMLTextImageContext(XMLImport &rImport)
 {
 }
 
-XMLImportContext *XMLTextImageContext::CreateChildContext(const OUString 
&rName, const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
+rtl::Reference<XMLImportContext> XMLTextImageContext::CreateChildContext(const 
OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> 
&/*xAttribs*/)
 {
     if (rName == "office:binary-data")
     {
@@ -76,7 +76,7 @@ XMLTextFrameContext::XMLTextFrameContext(XMLImport &rImport)
 {
 }
 
-XMLImportContext *XMLTextFrameContext::CreateChildContext(const OUString 
&rName, const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
+rtl::Reference<XMLImportContext> XMLTextFrameContext::CreateChildContext(const 
OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> 
&/*xAttribs*/)
 {
     if (rName == "draw:image")
         return new XMLTextImageContext(mrImport);
diff --git a/writerperfect/source/writer/exp/XMLTextFrameContext.hxx 
b/writerperfect/source/writer/exp/XMLTextFrameContext.hxx
index 2cf14889df05..076426e69ed9 100644
--- a/writerperfect/source/writer/exp/XMLTextFrameContext.hxx
+++ b/writerperfect/source/writer/exp/XMLTextFrameContext.hxx
@@ -27,7 +27,7 @@ class XMLTextFrameContext : public XMLImportContext
 public:
     XMLTextFrameContext(XMLImport &rImport);
 
-    XMLImportContext *CreateChildContext(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
+    rtl::Reference<XMLImportContext> CreateChildContext(const OUString &rName, 
const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
 
     void SAL_CALL startElement(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
     void SAL_CALL endElement(const OUString &rName) override;
diff --git a/writerperfect/source/writer/exp/XMLTextListContext.cxx 
b/writerperfect/source/writer/exp/XMLTextListContext.cxx
index edfd7371b15e..3a7698890759 100644
--- a/writerperfect/source/writer/exp/XMLTextListContext.cxx
+++ b/writerperfect/source/writer/exp/XMLTextListContext.cxx
@@ -23,7 +23,7 @@ XMLTextListContext::XMLTextListContext(XMLImport &rImport)
 {
 }
 
-XMLImportContext *XMLTextListContext::CreateChildContext(const OUString 
&rName, const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
+rtl::Reference<XMLImportContext> XMLTextListContext::CreateChildContext(const 
OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> 
&/*xAttribs*/)
 {
     if (rName == "text:list-item")
         return new XMLTextListItemContext(mrImport);
diff --git a/writerperfect/source/writer/exp/XMLTextListContext.hxx 
b/writerperfect/source/writer/exp/XMLTextListContext.hxx
index 533257228fbb..8e9152f06058 100644
--- a/writerperfect/source/writer/exp/XMLTextListContext.hxx
+++ b/writerperfect/source/writer/exp/XMLTextListContext.hxx
@@ -23,7 +23,7 @@ class XMLTextListContext : public XMLImportContext
 public:
     XMLTextListContext(XMLImport &rImport);
 
-    XMLImportContext *CreateChildContext(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
+    rtl::Reference<XMLImportContext> CreateChildContext(const OUString &rName, 
const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
 };
 
 } // namespace exp
diff --git a/writerperfect/source/writer/exp/XMLTextListItemContext.cxx 
b/writerperfect/source/writer/exp/XMLTextListItemContext.cxx
index 7b166d52fb42..cbf3462566f0 100644
--- a/writerperfect/source/writer/exp/XMLTextListItemContext.cxx
+++ b/writerperfect/source/writer/exp/XMLTextListItemContext.cxx
@@ -25,7 +25,7 @@ XMLTextListItemContext::XMLTextListItemContext(XMLImport 
&rImport)
 {
 }
 
-XMLImportContext *XMLTextListItemContext::CreateChildContext(const OUString 
&rName, const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
+rtl::Reference<XMLImportContext> 
XMLTextListItemContext::CreateChildContext(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
 {
     if (rName == "text:p" || rName == "text:h")
         return new XMLParaContext(mrImport);
diff --git a/writerperfect/source/writer/exp/XMLTextListItemContext.hxx 
b/writerperfect/source/writer/exp/XMLTextListItemContext.hxx
index cb6a68aedf5a..cbca5bf7feac 100644
--- a/writerperfect/source/writer/exp/XMLTextListItemContext.hxx
+++ b/writerperfect/source/writer/exp/XMLTextListItemContext.hxx
@@ -23,7 +23,7 @@ class XMLTextListItemContext : public XMLImportContext
 public:
     XMLTextListItemContext(XMLImport &rImport);
 
-    XMLImportContext *CreateChildContext(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
+    rtl::Reference<XMLImportContext> CreateChildContext(const OUString &rName, 
const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
 };
 
 } // namespace exp
diff --git a/writerperfect/source/writer/exp/txtparai.cxx 
b/writerperfect/source/writer/exp/txtparai.cxx
index 8e19475b65fe..fa6f91f0bd7b 100644
--- a/writerperfect/source/writer/exp/txtparai.cxx
+++ b/writerperfect/source/writer/exp/txtparai.cxx
@@ -76,7 +76,7 @@ class XMLSpanContext : public XMLImportContext
 public:
     XMLSpanContext(XMLImport &rImport, const librevenge::RVNGPropertyList 
&rPropertyList);
 
-    XMLImportContext *CreateChildContext(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
+    rtl::Reference<XMLImportContext> CreateChildContext(const OUString &rName, 
const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
 
     void SAL_CALL startElement(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
     void SAL_CALL characters(const OUString &rChars) override;
@@ -94,7 +94,7 @@ XMLSpanContext::XMLSpanContext(XMLImport &rImport, const 
librevenge::RVNGPropert
         m_aPropertyList.insert(itProp.key(), itProp()->clone());
 }
 
-XMLImportContext *XMLSpanContext::CreateChildContext(const OUString &rName, 
const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
+rtl::Reference<XMLImportContext> XMLSpanContext::CreateChildContext(const 
OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> 
&/*xAttribs*/)
 {
     if (rName == "draw:frame")
         return new XMLTextFrameContext(mrImport);
@@ -259,7 +259,7 @@ XMLParaContext::XMLParaContext(XMLImport &rImport)
 {
 }
 
-XMLImportContext *XMLParaContext::CreateChildContext(const OUString &rName, 
const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
+rtl::Reference<XMLImportContext> XMLParaContext::CreateChildContext(const 
OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> 
&/*xAttribs*/)
 {
     if (rName == "text:a")
         return new XMLHyperlinkContext(mrImport);
@@ -308,7 +308,7 @@ void XMLParaContext::characters(const OUString &rChars)
     mrImport.GetGenerator().closeSpan();
 }
 
-XMLImportContext *CreateParagraphOrSpanChildContext(XMLImport &rImport, const 
OUString &rName, const librevenge::RVNGPropertyList &rTextPropertyList)
+rtl::Reference<XMLImportContext> CreateParagraphOrSpanChildContext(XMLImport 
&rImport, const OUString &rName, const librevenge::RVNGPropertyList 
&rTextPropertyList)
 {
     if (rName == "text:span")
         return new XMLSpanContext(rImport, rTextPropertyList);
diff --git a/writerperfect/source/writer/exp/txtparai.hxx 
b/writerperfect/source/writer/exp/txtparai.hxx
index a427d2602516..c32ef1916b0b 100644
--- a/writerperfect/source/writer/exp/txtparai.hxx
+++ b/writerperfect/source/writer/exp/txtparai.hxx
@@ -23,7 +23,7 @@ class XMLParaContext : public XMLImportContext
 public:
     XMLParaContext(XMLImport &rImport);
 
-    XMLImportContext *CreateChildContext(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/) override;
+    rtl::Reference<XMLImportContext> CreateChildContext(const OUString &rName, 
const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/) 
override;
 
     void SAL_CALL startElement(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
     void SAL_CALL endElement(const OUString &rName) override;
@@ -36,7 +36,7 @@ private:
 };
 
 /// Shared child context factory for paragraph and span contexts.
-XMLImportContext *CreateParagraphOrSpanChildContext(XMLImport &rImport, const 
OUString &rName, const librevenge::RVNGPropertyList &rTextPropertyList);
+rtl::Reference<XMLImportContext> CreateParagraphOrSpanChildContext(XMLImport 
&rImport, const OUString &rName, const librevenge::RVNGPropertyList 
&rTextPropertyList);
 
 } // namespace exp
 } // namespace writerperfect
diff --git a/writerperfect/source/writer/exp/txtstyli.cxx 
b/writerperfect/source/writer/exp/txtstyli.cxx
index 420651a1ddb0..bdb36eedea51 100644
--- a/writerperfect/source/writer/exp/txtstyli.cxx
+++ b/writerperfect/source/writer/exp/txtstyli.cxx
@@ -81,7 +81,7 @@ XMLStyleContext::XMLStyleContext(XMLImport &rImport, 
XMLStylesContext &rStyles)
 {
 }
 
-XMLImportContext *XMLStyleContext::CreateChildContext(const OUString &rName, 
const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
+rtl::Reference<XMLImportContext> XMLStyleContext::CreateChildContext(const 
OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> 
&/*xAttribs*/)
 {
     if (rName == "style:paragraph-properties")
         return new XMLParagraphPropertiesContext(mrImport, *this);
diff --git a/writerperfect/source/writer/exp/txtstyli.hxx 
b/writerperfect/source/writer/exp/txtstyli.hxx
index 83ffd78f4e70..5852730049a0 100644
--- a/writerperfect/source/writer/exp/txtstyli.hxx
+++ b/writerperfect/source/writer/exp/txtstyli.hxx
@@ -27,7 +27,7 @@ class XMLStyleContext : public XMLImportContext
 public:
     XMLStyleContext(XMLImport &rImport, XMLStylesContext &rStyles);
 
-    XMLImportContext *CreateChildContext(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
+    rtl::Reference<XMLImportContext> CreateChildContext(const OUString &rName, 
const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
     void SAL_CALL startElement(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
     void SAL_CALL endElement(const OUString &rName) override;
 
diff --git a/writerperfect/source/writer/exp/xmlfmt.cxx 
b/writerperfect/source/writer/exp/xmlfmt.cxx
index b3317283f470..f1e501ccc748 100644
--- a/writerperfect/source/writer/exp/xmlfmt.cxx
+++ b/writerperfect/source/writer/exp/xmlfmt.cxx
@@ -26,7 +26,7 @@ XMLStylesContext::XMLStylesContext(XMLImport &rImport, 
std::map<OUString, librev
 {
 }
 
-XMLImportContext *XMLStylesContext::CreateChildContext(const OUString &rName, 
const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
+rtl::Reference<XMLImportContext> XMLStylesContext::CreateChildContext(const 
OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> 
&/*xAttribs*/)
 {
     if (rName == "style:style")
         return new XMLStyleContext(mrImport, *this);
diff --git a/writerperfect/source/writer/exp/xmlfmt.hxx 
b/writerperfect/source/writer/exp/xmlfmt.hxx
index 394be55b36c2..aea29dbdfa8f 100644
--- a/writerperfect/source/writer/exp/xmlfmt.hxx
+++ b/writerperfect/source/writer/exp/xmlfmt.hxx
@@ -27,7 +27,7 @@ class XMLStylesContext : public XMLImportContext
 public:
     XMLStylesContext(XMLImport &rImport, std::map<OUString, 
librevenge::RVNGPropertyList> &rParagraphStyles, std::map<OUString, 
librevenge::RVNGPropertyList> &rTextStyles);
 
-    XMLImportContext *CreateChildContext(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
+    rtl::Reference<XMLImportContext> CreateChildContext(const OUString &rName, 
const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
 
     std::map<OUString, librevenge::RVNGPropertyList> 
&GetCurrentParagraphStyles();
     std::map<OUString, librevenge::RVNGPropertyList> &GetCurrentTextStyles();
diff --git a/writerperfect/source/writer/exp/xmlictxt.cxx 
b/writerperfect/source/writer/exp/xmlictxt.cxx
index 5f5a731493c8..ba5c06804dc4 100644
--- a/writerperfect/source/writer/exp/xmlictxt.cxx
+++ b/writerperfect/source/writer/exp/xmlictxt.cxx
@@ -23,7 +23,7 @@ XMLImportContext::XMLImportContext(XMLImport &rImport)
 {
 }
 
-XMLImportContext *XMLImportContext::CreateChildContext(const OUString &rName, 
const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs)
+rtl::Reference<XMLImportContext> XMLImportContext::CreateChildContext(const 
OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> 
&xAttribs)
 {
     return mrImport.CreateContext(rName, xAttribs);
 }
diff --git a/writerperfect/source/writer/exp/xmlictxt.hxx 
b/writerperfect/source/writer/exp/xmlictxt.hxx
index 0076852f25d3..cbdeab0f6898 100644
--- a/writerperfect/source/writer/exp/xmlictxt.hxx
+++ b/writerperfect/source/writer/exp/xmlictxt.hxx
@@ -10,12 +10,13 @@
 #ifndef INCLUDED_WRITERPERFECT_SOURCE_WRITER_EXP_XMLICTXT_HXX
 #define INCLUDED_WRITERPERFECT_SOURCE_WRITER_EXP_XMLICTXT_HXX
 
-#include <cppuhelper/implbase.hxx>
-
 #include <librevenge/librevenge.h>
 
 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
 
+#include <cppuhelper/implbase.hxx>
+#include <rtl/ref.hxx>
+
 namespace writerperfect
 {
 namespace exp
@@ -32,7 +33,7 @@ class XMLImportContext : public cppu::WeakImplHelper
 public:
     XMLImportContext(XMLImport &rImport);
 
-    virtual XMLImportContext *CreateChildContext(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs);
+    virtual rtl::Reference<XMLImportContext> CreateChildContext(const OUString 
&rName, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs);
 
     // XDocumentHandler
     void SAL_CALL startDocument() override;
diff --git a/writerperfect/source/writer/exp/xmlimp.cxx 
b/writerperfect/source/writer/exp/xmlimp.cxx
index 2370399edb65..5d368ed277f0 100644
--- a/writerperfect/source/writer/exp/xmlimp.cxx
+++ b/writerperfect/source/writer/exp/xmlimp.cxx
@@ -27,7 +27,7 @@ class XMLBodyContext : public XMLImportContext
 public:
     XMLBodyContext(XMLImport &rImport);
 
-    XMLImportContext *CreateChildContext(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/) override;
+    rtl::Reference<XMLImportContext> CreateChildContext(const OUString &rName, 
const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/) 
override;
 };
 
 XMLBodyContext::XMLBodyContext(XMLImport &rImport)
@@ -35,7 +35,7 @@ XMLBodyContext::XMLBodyContext(XMLImport &rImport)
 {
 }
 
-XMLImportContext *XMLBodyContext::CreateChildContext(const OUString &rName, 
const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
+rtl::Reference<XMLImportContext> XMLBodyContext::CreateChildContext(const 
OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> 
&/*xAttribs*/)
 {
     if (rName == "office:text")
         return new XMLBodyContentContext(mrImport);
@@ -48,7 +48,7 @@ class XMLOfficeDocContext : public XMLImportContext
 public:
     XMLOfficeDocContext(XMLImport &rImport);
 
-    XMLImportContext *CreateChildContext(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/) override;
+    rtl::Reference<XMLImportContext> CreateChildContext(const OUString &rName, 
const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/) 
override;
 };
 
 XMLOfficeDocContext::XMLOfficeDocContext(XMLImport &rImport)
@@ -56,7 +56,7 @@ XMLOfficeDocContext::XMLOfficeDocContext(XMLImport &rImport)
 {
 }
 
-XMLImportContext *XMLOfficeDocContext::CreateChildContext(const OUString 
&rName, const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
+rtl::Reference<XMLImportContext> XMLOfficeDocContext::CreateChildContext(const 
OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> 
&/*xAttribs*/)
 {
     if (rName == "office:body")
         return new XMLBodyContext(mrImport);
@@ -74,7 +74,7 @@ XMLImport::XMLImport(librevenge::RVNGTextInterface 
&rGenerator)
 {
 }
 
-XMLImportContext *XMLImport::CreateContext(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
+rtl::Reference<XMLImportContext> XMLImport::CreateContext(const OUString 
&rName, const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
 {
     if (rName == "office:document")
         return new XMLOfficeDocContext(*this);
diff --git a/writerperfect/source/writer/exp/xmlimp.hxx 
b/writerperfect/source/writer/exp/xmlimp.hxx
index 128a88cabdd6..f971327fada8 100644
--- a/writerperfect/source/writer/exp/xmlimp.hxx
+++ b/writerperfect/source/writer/exp/xmlimp.hxx
@@ -43,7 +43,7 @@ class XMLImport : public cppu::WeakImplHelper
 public:
     XMLImport(librevenge::RVNGTextInterface &rGenerator);
 
-    XMLImportContext *CreateContext(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs);
+    rtl::Reference<XMLImportContext> CreateContext(const OUString &rName, 
const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs);
 
     librevenge::RVNGTextInterface &GetGenerator() const;
     std::map<OUString, librevenge::RVNGPropertyList> &GetAutomaticTextStyles();
diff --git a/writerperfect/source/writer/exp/xmlmetai.cxx 
b/writerperfect/source/writer/exp/xmlmetai.cxx
index 8777f4fa0b6f..0d804833bc7a 100644
--- a/writerperfect/source/writer/exp/xmlmetai.cxx
+++ b/writerperfect/source/writer/exp/xmlmetai.cxx
@@ -133,7 +133,7 @@ XMLMetaDocumentContext::XMLMetaDocumentContext(XMLImport 
&rImport)
 {
 }
 
-XMLImportContext *XMLMetaDocumentContext::CreateChildContext(const OUString 
&rName, const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
+rtl::Reference<XMLImportContext> 
XMLMetaDocumentContext::CreateChildContext(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
 {
     if (rName == "dc:title")
         return new XMLDcTitleContext(mrImport, *this);
diff --git a/writerperfect/source/writer/exp/xmlmetai.hxx 
b/writerperfect/source/writer/exp/xmlmetai.hxx
index b02e1f21caaf..12285937a705 100644
--- a/writerperfect/source/writer/exp/xmlmetai.hxx
+++ b/writerperfect/source/writer/exp/xmlmetai.hxx
@@ -25,7 +25,7 @@ class XMLMetaDocumentContext : public XMLImportContext
 public:
     XMLMetaDocumentContext(XMLImport &rImport);
 
-    XMLImportContext *CreateChildContext(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
+    rtl::Reference<XMLImportContext> CreateChildContext(const OUString &rName, 
const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
 
     void SAL_CALL endElement(const OUString &rName) override;
 
diff --git a/writerperfect/source/writer/exp/xmltbli.cxx 
b/writerperfect/source/writer/exp/xmltbli.cxx
index 735e276de241..d5844fd18d5c 100644
--- a/writerperfect/source/writer/exp/xmltbli.cxx
+++ b/writerperfect/source/writer/exp/xmltbli.cxx
@@ -26,7 +26,7 @@ class XMLTableCellContext : public XMLImportContext
 public:
     XMLTableCellContext(XMLImport &rImport);
 
-    XMLImportContext *CreateChildContext(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
+    rtl::Reference<XMLImportContext> CreateChildContext(const OUString &rName, 
const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
 
     void SAL_CALL startElement(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
     void SAL_CALL endElement(const OUString &rName) override;
@@ -37,7 +37,7 @@ XMLTableCellContext::XMLTableCellContext(XMLImport &rImport)
 {
 }
 
-XMLImportContext *XMLTableCellContext::CreateChildContext(const OUString 
&rName, const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
+rtl::Reference<XMLImportContext> XMLTableCellContext::CreateChildContext(const 
OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> 
&/*xAttribs*/)
 {
     return CreateTextChildContext(mrImport, rName);
 }
@@ -58,7 +58,7 @@ class XMLTableRowContext : public XMLImportContext
 public:
     XMLTableRowContext(XMLImport &rImport);
 
-    XMLImportContext *CreateChildContext(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
+    rtl::Reference<XMLImportContext> CreateChildContext(const OUString &rName, 
const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
 
     void SAL_CALL startElement(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
     void SAL_CALL endElement(const OUString &rName) override;
@@ -69,7 +69,7 @@ XMLTableRowContext::XMLTableRowContext(XMLImport &rImport)
 {
 }
 
-XMLImportContext *XMLTableRowContext::CreateChildContext(const OUString 
&rName, const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
+rtl::Reference<XMLImportContext> XMLTableRowContext::CreateChildContext(const 
OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> 
&/*xAttribs*/)
 {
     if (rName == "table:table-cell")
         return new XMLTableCellContext(mrImport);
@@ -91,7 +91,7 @@ XMLTableContext::XMLTableContext(XMLImport &rImport)
 {
 }
 
-XMLImportContext *XMLTableContext::CreateChildContext(const OUString &rName, 
const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
+rtl::Reference<XMLImportContext> XMLTableContext::CreateChildContext(const 
OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> 
&/*xAttribs*/)
 {
     if (rName == "table:table-row")
         return new XMLTableRowContext(mrImport);
diff --git a/writerperfect/source/writer/exp/xmltbli.hxx 
b/writerperfect/source/writer/exp/xmltbli.hxx
index ceeb098c1f9c..07ae0a647181 100644
--- a/writerperfect/source/writer/exp/xmltbli.hxx
+++ b/writerperfect/source/writer/exp/xmltbli.hxx
@@ -23,7 +23,7 @@ class XMLTableContext : public XMLImportContext
 public:
     XMLTableContext(XMLImport &rImport);
 
-    XMLImportContext *CreateChildContext(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
+    rtl::Reference<XMLImportContext> CreateChildContext(const OUString &rName, 
const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
 
     void SAL_CALL startElement(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
     void SAL_CALL endElement(const OUString &rName) override;
diff --git a/writerperfect/source/writer/exp/xmltext.cxx 
b/writerperfect/source/writer/exp/xmltext.cxx
index 14c5b306dd99..3902e15ae839 100644
--- a/writerperfect/source/writer/exp/xmltext.cxx
+++ b/writerperfect/source/writer/exp/xmltext.cxx
@@ -26,12 +26,12 @@ XMLBodyContentContext::XMLBodyContentContext(XMLImport 
&rImport)
 {
 }
 
-XMLImportContext *XMLBodyContentContext::CreateChildContext(const OUString 
&rName, const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
+rtl::Reference<XMLImportContext> 
XMLBodyContentContext::CreateChildContext(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
 {
     return CreateTextChildContext(mrImport, rName);
 }
 
-XMLImportContext *CreateTextChildContext(XMLImport &rImport, const OUString 
&rName)
+rtl::Reference<XMLImportContext> CreateTextChildContext(XMLImport &rImport, 
const OUString &rName)
 {
     if (rName == "text:p" || rName == "text:h")
         return new XMLParaContext(rImport);
diff --git a/writerperfect/source/writer/exp/xmltext.hxx 
b/writerperfect/source/writer/exp/xmltext.hxx
index dc8f35f33fbd..bce957c4f7e8 100644
--- a/writerperfect/source/writer/exp/xmltext.hxx
+++ b/writerperfect/source/writer/exp/xmltext.hxx
@@ -23,11 +23,11 @@ class XMLBodyContentContext : public XMLImportContext
 public:
     XMLBodyContentContext(XMLImport &rImport);
 
-    XMLImportContext *CreateChildContext(const OUString &rName, const 
css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/) override;
+    rtl::Reference<XMLImportContext> CreateChildContext(const OUString &rName, 
const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/) 
override;
 };
 
 /// Context factory for body text, section, table cell, etc.
-XMLImportContext *CreateTextChildContext(XMLImport &rImport, const OUString 
&rName);
+rtl::Reference<XMLImportContext> CreateTextChildContext(XMLImport &rImport, 
const OUString &rName);
 
 } // namespace exp
 } // namespace writerperfect
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to