summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-04-28 09:12:04 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-04-28 09:12:28 +0200
commit95a29424abe1c588c68d737ec50ea780375a9334 (patch)
tree2043f0436a5ad5852d34fc0dd4976146ec9129ba
parentppc64: do not use asm block to retrieve args (diff)
downloadcore-95a29424abe1c588c68d737ec50ea780375a9334.tar.gz
core-95a29424abe1c588c68d737ec50ea780375a9334.zip
DocxSdrExport::Impl::m_pTextboxAttrList: use std::unique_ptr<>
Change-Id: If6c836c7e155c958a56fb69a06730c4e5a9ee1b5
-rw-r--r--sw/source/filter/ww8/docxsdrexport.cxx11
-rw-r--r--sw/source/filter/ww8/docxsdrexport.hxx2
2 files changed, 5 insertions, 8 deletions
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index 0beefaa2f03e..69b6ed45f0d9 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -133,7 +133,7 @@ struct DocxSdrExport::Impl
bool m_bTextFrameSyntax;
bool m_bDMLTextFrameSyntax;
std::unique_ptr<sax_fastparser::FastAttributeList> m_pFlyAttrList;
- sax_fastparser::FastAttributeList* m_pTextboxAttrList;
+ std::unique_ptr<sax_fastparser::FastAttributeList> m_pTextboxAttrList;
OStringBuffer m_aTextFrameStyle;
bool m_bFrameBtLr;
bool m_bDrawingOpen;
@@ -160,7 +160,6 @@ struct DocxSdrExport::Impl
m_pFlyFrameSize(0),
m_bTextFrameSyntax(false),
m_bDMLTextFrameSyntax(false),
- m_pTextboxAttrList(0),
m_bFrameBtLr(false),
m_bDrawingOpen(false),
m_bParagraphSdtOpen(false),
@@ -178,7 +177,6 @@ struct DocxSdrExport::Impl
~Impl()
{
- delete m_pTextboxAttrList, m_pTextboxAttrList = NULL;
}
/// Writes wp wrapper code around an SdrObject, which itself is written using drawingML syntax.
@@ -223,7 +221,7 @@ std::unique_ptr<sax_fastparser::FastAttributeList>& DocxSdrExport::getFlyAttrLis
return m_pImpl->m_pFlyAttrList;
}
-sax_fastparser::FastAttributeList* DocxSdrExport::getTextboxAttrList()
+std::unique_ptr<sax_fastparser::FastAttributeList>& DocxSdrExport::getTextboxAttrList()
{
return m_pImpl->m_pTextboxAttrList;
}
@@ -1609,7 +1607,7 @@ void DocxSdrExport::writeVMLTextFrame(sw::Frame* pParentFrame, bool bTextBoxOnly
m_pImpl->m_bTextFrameSyntax = true;
m_pImpl->m_pFlyAttrList.reset(sax_fastparser::FastSerializerHelper::createAttrList());
- m_pImpl->m_pTextboxAttrList = sax_fastparser::FastSerializerHelper::createAttrList();
+ m_pImpl->m_pTextboxAttrList.reset(sax_fastparser::FastSerializerHelper::createAttrList());
m_pImpl->m_aTextFrameStyle = "position:absolute";
if (!bTextBoxOnly)
{
@@ -1628,8 +1626,7 @@ void DocxSdrExport::writeVMLTextFrame(sw::Frame* pParentFrame, bool bTextBoxOnly
}
sax_fastparser::XFastAttributeListRef xFlyAttrList(m_pImpl->m_pFlyAttrList.release());
m_pImpl->m_bFrameBtLr = m_pImpl->checkFrameBtlr(m_pImpl->m_rExport.pDoc->GetNodes()[nStt], /*bDML=*/false);
- sax_fastparser::XFastAttributeListRef xTextboxAttrList(m_pImpl->m_pTextboxAttrList);
- m_pImpl->m_pTextboxAttrList = NULL;
+ sax_fastparser::XFastAttributeListRef xTextboxAttrList(m_pImpl->m_pTextboxAttrList.release());
m_pImpl->m_bTextFrameSyntax = false;
m_pImpl->m_pFlyFrameSize = 0;
m_pImpl->m_rExport.mpParentFrame = NULL;
diff --git a/sw/source/filter/ww8/docxsdrexport.hxx b/sw/source/filter/ww8/docxsdrexport.hxx
index cbdd1008c0f4..b99b235b3890 100644
--- a/sw/source/filter/ww8/docxsdrexport.hxx
+++ b/sw/source/filter/ww8/docxsdrexport.hxx
@@ -64,7 +64,7 @@ public:
bool getDMLTextFrameSyntax();
std::unique_ptr<sax_fastparser::FastAttributeList>& getFlyAttrList();
/// Attributes of the next v:textbox element.
- sax_fastparser::FastAttributeList* getTextboxAttrList();
+ std::unique_ptr<sax_fastparser::FastAttributeList>& getTextboxAttrList();
OStringBuffer& getTextFrameStyle();
/// Same, as DocxAttributeOutput::m_bBtLr, but for textframe rotation.
bool getFrameBtLr();