summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-03-23 09:29:29 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-03-23 09:30:09 +0100
commitb0c1d2a7f368ed8af46d358e4b4350eb435fa241 (patch)
treeba988325b2af55b68de3359fe2047e039a6574b1
parenta9fd1afd3b30fc365a92ad98f073fb7ccbdb50da (diff)
DocxAttributeOutput::m_pParagraph/RunSdtPrTokenChildren: use std::unique_ptr
Change-Id: I8fa221211efcbed8407cd8dccb3dc0962068295e
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx13
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.hxx6
2 files changed, 7 insertions, 12 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index b3cc59342bea..15c4c6261aa7 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -326,12 +326,11 @@ void DocxAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pText
m_bIsFirstParagraph = false;
}
-static void lcl_deleteAndResetTheLists( ::sax_fastparser::FastAttributeList* &pSdtPrTokenChildren, ::sax_fastparser::FastAttributeList* &pSdtPrDataBindingAttrs, OUString& rSdtPrAlias)
+static void lcl_deleteAndResetTheLists( std::unique_ptr<sax_fastparser::FastAttributeList> &pSdtPrTokenChildren, ::sax_fastparser::FastAttributeList* &pSdtPrDataBindingAttrs, OUString& rSdtPrAlias)
{
if( pSdtPrTokenChildren )
{
- delete pSdtPrTokenChildren ;
- pSdtPrTokenChildren = NULL;
+ pSdtPrTokenChildren.reset(0);
}
if( pSdtPrDataBindingAttrs )
{
@@ -602,7 +601,7 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT
}
void DocxAttributeOutput::WriteSdtBlock( sal_Int32& nSdtPrToken,
- ::sax_fastparser::FastAttributeList*& pSdtPrTokenChildren,
+ std::unique_ptr<sax_fastparser::FastAttributeList>& pSdtPrTokenChildren,
::sax_fastparser::FastAttributeList*& pSdtPrTokenAttributes,
::sax_fastparser::FastAttributeList*& pSdtPrDataBindingAttrs,
OUString& rSdtPrAlias,
@@ -692,7 +691,7 @@ void DocxAttributeOutput::WriteSdtBlock( sal_Int32& nSdtPrToken,
// clear sdt status
nSdtPrToken = 0;
- delete pSdtPrTokenChildren; pSdtPrTokenChildren = NULL;
+ pSdtPrTokenChildren.reset(0);
if( pSdtPrDataBindingAttrs )
{
// do not delete yet; it's in xAttrList inside the parser
@@ -8326,12 +8325,10 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri
m_nParaAfterSpacing(0),
m_setFootnote(false)
, m_nParagraphSdtPrToken(0)
- , m_pParagraphSdtPrTokenChildren(NULL)
, m_pParagraphSdtPrTokenAttributes(NULL)
, m_pParagraphSdtPrDataBindingAttrs(NULL)
, m_nRunSdtPrToken(0)
, m_nStateOfFlyFrame( FLY_NOT_PROCESSED )
- , m_pRunSdtPrTokenChildren(NULL)
, m_pRunSdtPrDataBindingAttrs(NULL)
, m_bParagraphSdtHasId(false)
{
@@ -8340,10 +8337,8 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri
DocxAttributeOutput::~DocxAttributeOutput()
{
delete m_pTableWrt, m_pTableWrt = NULL;
- delete m_pParagraphSdtPrTokenChildren; m_pParagraphSdtPrTokenChildren = NULL;
delete m_pParagraphSdtPrTokenAttributes; m_pParagraphSdtPrTokenAttributes = NULL;
delete m_pParagraphSdtPrDataBindingAttrs; m_pParagraphSdtPrDataBindingAttrs = NULL;
- delete m_pRunSdtPrTokenChildren; m_pRunSdtPrTokenChildren = NULL;
delete m_pRunSdtPrDataBindingAttrs; m_pRunSdtPrDataBindingAttrs = NULL;
}
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index 32f1c79fe1b7..c2cf6c7b4267 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -704,7 +704,7 @@ private:
void WritePostponedCustomShape();
void WriteSdtBlock(sal_Int32& nSdtPrToken,
- ::sax_fastparser::FastAttributeList*& pSdtPrTokenChildren,
+ std::unique_ptr<sax_fastparser::FastAttributeList>& pSdtPrTokenChildren,
::sax_fastparser::FastAttributeList*& pSdtPrTokenAttributes,
::sax_fastparser::FastAttributeList*& pSdtPrDataBindingAttrs,
OUString& rSdtPrAlias,
@@ -909,14 +909,14 @@ private:
/// members to control the existence of grabbagged SDT properties in the paragraph
sal_Int32 m_nParagraphSdtPrToken;
- ::sax_fastparser::FastAttributeList *m_pParagraphSdtPrTokenChildren;
+ std::unique_ptr<sax_fastparser::FastAttributeList> m_pParagraphSdtPrTokenChildren;
::sax_fastparser::FastAttributeList *m_pParagraphSdtPrTokenAttributes;
::sax_fastparser::FastAttributeList *m_pParagraphSdtPrDataBindingAttrs;
/// members to control the existence of grabbagged SDT properties in the text run
sal_Int32 m_nRunSdtPrToken;
/// State of the Fly at current position
FlyProcessingState m_nStateOfFlyFrame;
- ::sax_fastparser::FastAttributeList *m_pRunSdtPrTokenChildren;
+ std::unique_ptr<sax_fastparser::FastAttributeList> m_pRunSdtPrTokenChildren;
::sax_fastparser::FastAttributeList *m_pRunSdtPrDataBindingAttrs;
/// Value of the <w:alias> paragraph SDT element.
OUString m_aParagraphSdtPrAlias;