Kaydet (Commit) c2ca1152 authored tarafından Miklos Vajna's avatar Miklos Vajna

DocxAttributeOutput::m_pParagraphSdtPrTokenAttributes: use std::unique_ptr

Change-Id: Ibc8e21c5572c06fc929c308d519601d2ea0c830d
üst 9110d872
...@@ -597,7 +597,7 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT ...@@ -597,7 +597,7 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT
void DocxAttributeOutput::WriteSdtBlock( sal_Int32& nSdtPrToken, void DocxAttributeOutput::WriteSdtBlock( sal_Int32& nSdtPrToken,
std::unique_ptr<sax_fastparser::FastAttributeList>& pSdtPrTokenChildren, std::unique_ptr<sax_fastparser::FastAttributeList>& pSdtPrTokenChildren,
::sax_fastparser::FastAttributeList*& pSdtPrTokenAttributes, std::unique_ptr<sax_fastparser::FastAttributeList>& pSdtPrTokenAttributes,
std::unique_ptr<sax_fastparser::FastAttributeList>& pSdtPrDataBindingAttrs, std::unique_ptr<sax_fastparser::FastAttributeList>& pSdtPrDataBindingAttrs,
OUString& rSdtPrAlias, OUString& rSdtPrAlias,
bool bPara ) bool bPara )
...@@ -618,9 +618,8 @@ void DocxAttributeOutput::WriteSdtBlock( sal_Int32& nSdtPrToken, ...@@ -618,9 +618,8 @@ void DocxAttributeOutput::WriteSdtBlock( sal_Int32& nSdtPrToken,
m_pSerializer->startElement( nSdtPrToken, FSEND ); m_pSerializer->startElement( nSdtPrToken, FSEND );
else else
{ {
XFastAttributeListRef xAttrList(pSdtPrTokenAttributes); XFastAttributeListRef xAttrList(pSdtPrTokenAttributes.release());
m_pSerializer->startElement(nSdtPrToken, xAttrList); m_pSerializer->startElement(nSdtPrToken, xAttrList);
pSdtPrTokenAttributes = 0;
} }
if (nSdtPrToken == FSNS( XML_w, XML_date ) || nSdtPrToken == FSNS( XML_w, XML_docPartObj ) || nSdtPrToken == FSNS( XML_w, XML_docPartList ) || nSdtPrToken == FSNS( XML_w14, XML_checkbox )) { if (nSdtPrToken == FSNS( XML_w, XML_date ) || nSdtPrToken == FSNS( XML_w, XML_docPartObj ) || nSdtPrToken == FSNS( XML_w, XML_docPartList ) || nSdtPrToken == FSNS( XML_w14, XML_checkbox )) {
...@@ -640,9 +639,8 @@ void DocxAttributeOutput::WriteSdtBlock( sal_Int32& nSdtPrToken, ...@@ -640,9 +639,8 @@ void DocxAttributeOutput::WriteSdtBlock( sal_Int32& nSdtPrToken,
m_pSerializer->singleElement( nSdtPrToken, FSEND ); m_pSerializer->singleElement( nSdtPrToken, FSEND );
else else
{ {
XFastAttributeListRef xAttrList(pSdtPrTokenAttributes); XFastAttributeListRef xAttrList(pSdtPrTokenAttributes.release());
m_pSerializer->singleElement(nSdtPrToken, xAttrList); m_pSerializer->singleElement(nSdtPrToken, xAttrList);
pSdtPrTokenAttributes = 0;
} }
} }
...@@ -1175,7 +1173,7 @@ void DocxAttributeOutput::EndRun() ...@@ -1175,7 +1173,7 @@ void DocxAttributeOutput::EndRun()
// (so on export sdt blocks are never nested ATM) // (so on export sdt blocks are never nested ATM)
if ( !m_bAnchorLinkedToNode && !m_bStartedCharSdt ) if ( !m_bAnchorLinkedToNode && !m_bStartedCharSdt )
{ {
::sax_fastparser::FastAttributeList* pRunSdtPrTokenAttributes = 0; std::unique_ptr<sax_fastparser::FastAttributeList> pRunSdtPrTokenAttributes;
WriteSdtBlock( m_nRunSdtPrToken, m_pRunSdtPrTokenChildren, pRunSdtPrTokenAttributes, m_pRunSdtPrDataBindingAttrs, m_aRunSdtPrAlias, /*bPara=*/false ); WriteSdtBlock( m_nRunSdtPrToken, m_pRunSdtPrTokenChildren, pRunSdtPrTokenAttributes, m_pRunSdtPrDataBindingAttrs, m_aRunSdtPrAlias, /*bPara=*/false );
} }
else else
...@@ -8317,7 +8315,6 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri ...@@ -8317,7 +8315,6 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri
m_nParaAfterSpacing(0), m_nParaAfterSpacing(0),
m_setFootnote(false) m_setFootnote(false)
, m_nParagraphSdtPrToken(0) , m_nParagraphSdtPrToken(0)
, m_pParagraphSdtPrTokenAttributes(NULL)
, m_nRunSdtPrToken(0) , m_nRunSdtPrToken(0)
, m_nStateOfFlyFrame( FLY_NOT_PROCESSED ) , m_nStateOfFlyFrame( FLY_NOT_PROCESSED )
, m_bParagraphSdtHasId(false) , m_bParagraphSdtHasId(false)
...@@ -8327,7 +8324,6 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri ...@@ -8327,7 +8324,6 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri
DocxAttributeOutput::~DocxAttributeOutput() DocxAttributeOutput::~DocxAttributeOutput()
{ {
delete m_pTableWrt, m_pTableWrt = NULL; delete m_pTableWrt, m_pTableWrt = NULL;
delete m_pParagraphSdtPrTokenAttributes; m_pParagraphSdtPrTokenAttributes = NULL;
} }
DocxExport& DocxAttributeOutput::GetExport() DocxExport& DocxAttributeOutput::GetExport()
......
...@@ -705,7 +705,7 @@ private: ...@@ -705,7 +705,7 @@ private:
void WriteSdtBlock(sal_Int32& nSdtPrToken, void WriteSdtBlock(sal_Int32& nSdtPrToken,
std::unique_ptr<sax_fastparser::FastAttributeList>& pSdtPrTokenChildren, std::unique_ptr<sax_fastparser::FastAttributeList>& pSdtPrTokenChildren,
::sax_fastparser::FastAttributeList*& pSdtPrTokenAttributes, std::unique_ptr<sax_fastparser::FastAttributeList>& pSdtPrTokenAttributes,
std::unique_ptr<sax_fastparser::FastAttributeList>& pSdtPrDataBindingAttrs, std::unique_ptr<sax_fastparser::FastAttributeList>& pSdtPrDataBindingAttrs,
OUString& rSdtPrAlias, OUString& rSdtPrAlias,
bool bPara); bool bPara);
...@@ -910,7 +910,7 @@ private: ...@@ -910,7 +910,7 @@ private:
/// members to control the existence of grabbagged SDT properties in the paragraph /// members to control the existence of grabbagged SDT properties in the paragraph
sal_Int32 m_nParagraphSdtPrToken; sal_Int32 m_nParagraphSdtPrToken;
std::unique_ptr<sax_fastparser::FastAttributeList> m_pParagraphSdtPrTokenChildren; std::unique_ptr<sax_fastparser::FastAttributeList> m_pParagraphSdtPrTokenChildren;
::sax_fastparser::FastAttributeList *m_pParagraphSdtPrTokenAttributes; std::unique_ptr<sax_fastparser::FastAttributeList> m_pParagraphSdtPrTokenAttributes;
std::unique_ptr<sax_fastparser::FastAttributeList> m_pParagraphSdtPrDataBindingAttrs; std::unique_ptr<sax_fastparser::FastAttributeList> m_pParagraphSdtPrDataBindingAttrs;
/// members to control the existence of grabbagged SDT properties in the text run /// members to control the existence of grabbagged SDT properties in the text run
sal_Int32 m_nRunSdtPrToken; sal_Int32 m_nRunSdtPrToken;
......
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