diff options
-rw-r--r-- | include/xmloff/txtparae.hxx | 2 | ||||
-rw-r--r-- | xmloff/qa/unit/uxmloff.cxx | 8 | ||||
-rw-r--r-- | xmloff/source/text/txtparae.cxx | 7 |
3 files changed, 8 insertions, 9 deletions
diff --git a/include/xmloff/txtparae.hxx b/include/xmloff/txtparae.hxx index 9c3d27e3dd33..8fb299cae511 100644 --- a/include/xmloff/txtparae.hxx +++ b/include/xmloff/txtparae.hxx @@ -109,7 +109,7 @@ class XMLOFF_DLLPUBLIC XMLTextParagraphExport : public XMLStyleExport bool bOpenRuby; XMLTextListsHelper* mpTextListsHelper; - ::std::vector< XMLTextListsHelper* > maTextListsHelperStack; + ::std::vector< std::unique_ptr<XMLTextListsHelper> > maTextListsHelperStack; enum class FrameType { Text, Graphic, Embedded, Shape }; public: diff --git a/xmloff/qa/unit/uxmloff.cxx b/xmloff/qa/unit/uxmloff.cxx index 71a1b371f006..c2460dc496d5 100644 --- a/xmloff/qa/unit/uxmloff.cxx +++ b/xmloff/qa/unit/uxmloff.cxx @@ -43,7 +43,7 @@ public: CPPUNIT_TEST(testMetaGenerator); CPPUNIT_TEST_SUITE_END(); private: - SvXMLExport *pExport; + std::unique_ptr<SvXMLExport> pExport; }; Test::Test() @@ -55,14 +55,14 @@ void Test::setUp() { BootstrapFixture::setUp(); - pExport = new SchXMLExport( + pExport.reset(new SchXMLExport( comphelper::getProcessComponentContext(), "SchXMLExport.Compact", - SvXMLExportFlags::ALL); + SvXMLExportFlags::ALL)); } void Test::tearDown() { - delete pExport; + pExport.reset(); BootstrapFixture::tearDown(); } diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 2e7349780ed2..36c161abc79c 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -3844,18 +3844,17 @@ void XMLTextParagraphExport::PreventExportOfControlsInMuteSections( void XMLTextParagraphExport::PushNewTextListsHelper() { - mpTextListsHelper = new XMLTextListsHelper(); - maTextListsHelperStack.push_back( mpTextListsHelper ); + maTextListsHelperStack.emplace_back( new XMLTextListsHelper() ); + mpTextListsHelper = maTextListsHelperStack.back().get(); } void XMLTextParagraphExport::PopTextListsHelper() { - delete mpTextListsHelper; mpTextListsHelper = nullptr; maTextListsHelperStack.pop_back(); if ( !maTextListsHelperStack.empty() ) { - mpTextListsHelper = maTextListsHelperStack.back(); + mpTextListsHelper = maTextListsHelperStack.back().get(); } } |