Kaydet (Commit) 550d95ae authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Manage m_pSttNdIdx via unique_ptr

...so it gets deleted upon an exception

Change-Id: I239f916019806eef1b761248fd167f5febf25001
üst bb9a7c34
...@@ -398,7 +398,6 @@ SwXMLImport::SwXMLImport( ...@@ -398,7 +398,6 @@ SwXMLImport::SwXMLImport(
const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< uno::XComponentContext >& rContext,
OUString const & implementationName, SvXMLImportFlags nImportFlags) OUString const & implementationName, SvXMLImportFlags nImportFlags)
: SvXMLImport( rContext, implementationName, nImportFlags ), : SvXMLImport( rContext, implementationName, nImportFlags ),
m_pSttNdIdx( nullptr ),
m_pTableItemMapper( nullptr ), m_pTableItemMapper( nullptr ),
m_pDocElemTokenMap( nullptr ), m_pDocElemTokenMap( nullptr ),
m_pTableElemTokenMap( nullptr ), m_pTableElemTokenMap( nullptr ),
...@@ -653,7 +652,7 @@ void SwXMLImport::startDocument() ...@@ -653,7 +652,7 @@ void SwXMLImport::startDocument()
if( (getImportFlags() & SvXMLImportFlags::CONTENT) && !IsStylesOnlyMode() ) if( (getImportFlags() & SvXMLImportFlags::CONTENT) && !IsStylesOnlyMode() )
{ {
m_pSttNdIdx = new SwNodeIndex( pDoc->GetNodes() ); m_pSttNdIdx.reset(new SwNodeIndex( pDoc->GetNodes() ));
if( IsInsertMode() ) if( IsInsertMode() )
{ {
SwPaM *pPaM = pTextCursor->GetPaM(); SwPaM *pPaM = pTextCursor->GetPaM();
...@@ -861,8 +860,7 @@ void SwXMLImport::endDocument() ...@@ -861,8 +860,7 @@ void SwXMLImport::endDocument()
GetTextImport()->ResetCursor(); GetTextImport()->ResetCursor();
delete m_pSttNdIdx; m_pSttNdIdx.reset();;
m_pSttNdIdx = nullptr;
// SJ: #i49801# -> now permitting repaints // SJ: #i49801# -> now permitting repaints
if ( pDoc ) if ( pDoc )
......
...@@ -20,6 +20,10 @@ ...@@ -20,6 +20,10 @@
#ifndef INCLUDED_SW_SOURCE_FILTER_XML_XMLIMP_HXX #ifndef INCLUDED_SW_SOURCE_FILTER_XML_XMLIMP_HXX
#define INCLUDED_SW_SOURCE_FILTER_XML_XMLIMP_HXX #define INCLUDED_SW_SOURCE_FILTER_XML_XMLIMP_HXX
#include <sal/config.h>
#include <memory>
#include <com/sun/star/document/XDocumentProperties.hpp> #include <com/sun/star/document/XDocumentProperties.hpp>
#include <sot/storage.hxx> #include <sot/storage.hxx>
...@@ -49,7 +53,7 @@ namespace SwImport { ...@@ -49,7 +53,7 @@ namespace SwImport {
class SwXMLImport: public SvXMLImport class SwXMLImport: public SvXMLImport
{ {
SwNodeIndex *m_pSttNdIdx; std::unique_ptr<SwNodeIndex> m_pSttNdIdx;
SvXMLUnitConverter *m_pTwipUnitConv; SvXMLUnitConverter *m_pTwipUnitConv;
SvXMLImportItemMapper *m_pTableItemMapper;// paragraph item import SvXMLImportItemMapper *m_pTableItemMapper;// paragraph item import
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment