diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-07-23 22:32:14 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-07-24 10:58:54 +0200 |
commit | 88b992d0da1e6122942cd9817ac55da1b932fdd6 (patch) | |
tree | 9cb5dc60ad46605b83ad172a944c50e19df7b92f | |
parent | 5e6a0eed2743b99dbbe133168204fdb184608476 (diff) |
filter: convert boost::ptr_vector to std::vector<std::unique_ptr>
Change-Id: I548f15466c695e4cbf5e505771d7c0baf8812198
-rw-r--r-- | filter/source/msfilter/svdfppt.cxx | 29 | ||||
-rw-r--r-- | include/filter/msfilter/svdfppt.hxx | 2 |
2 files changed, 16 insertions, 15 deletions
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 615a36650918..e709914e2adf 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -5701,13 +5701,13 @@ PPTParagraphObj::PPTParagraphObj( PPTStyleTextPropReader& rPropReader, { PPTCharPropSet *const pCharPropSet = rPropReader.aCharPropList[rnCurCharPos]; - PPTPortionObj* pPPTPortion = new PPTPortionObj( *pCharPropSet, - rStyleSheet, nInstance, pParaSet->mnDepth ); - m_PortionList.push_back(pPPTPortion); + std::unique_ptr<PPTPortionObj> pPPTPortion(new PPTPortionObj( + *pCharPropSet, rStyleSheet, nInstance, pParaSet->mnDepth)); if (!mbTab) { mbTab = pPPTPortion->HasTabulator(); } + m_PortionList.push_back(std::move(pPPTPortion)); } } } @@ -5718,10 +5718,11 @@ PPTParagraphObj::~PPTParagraphObj() void PPTParagraphObj::AppendPortion( PPTPortionObj& rPPTPortion ) { - m_PortionList.push_back(new PPTPortionObj(rPPTPortion)); + m_PortionList.push_back( + std::unique_ptr<PPTPortionObj>(new PPTPortionObj(rPPTPortion))); if ( !mbTab ) { - mbTab = m_PortionList.back().HasTabulator(); + mbTab = m_PortionList.back()->HasTabulator(); } } @@ -5732,7 +5733,7 @@ void PPTParagraphObj::UpdateBulletRelSize( sal_uInt32& nBulletRelSize ) const sal_uInt16 nFontHeight = 0; if (!m_PortionList.empty()) { - PPTPortionObj const& rPortion = m_PortionList.front(); + PPTPortionObj const& rPortion = *m_PortionList.front(); if (rPortion.pCharSet->mnAttrSet & (1 << PPT_CharAttr_FontHeight)) { nFontHeight = rPortion.pCharSet->mnFontHeight; @@ -5775,7 +5776,7 @@ bool PPTParagraphObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& rRetValue, sal_uI rRetValue = PPT_COLSCHEME_TEXT_UND_ZEILEN; if ((nDestinationInstance != 0xffffffff) && !m_PortionList.empty()) { - PPTPortionObj const& rPortion = m_PortionList.front(); + PPTPortionObj const& rPortion = *m_PortionList.front(); if (rPortion.pCharSet->mnAttrSet & (1 << PPT_CharAttr_FontColor)) { rRetValue = rPortion.pCharSet->mnColor; @@ -5803,7 +5804,7 @@ bool PPTParagraphObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& rRetValue, sal_uI rRetValue = 0; if ((nDestinationInstance != 0xffffffff) && !m_PortionList.empty()) { - PPTPortionObj const& rPortion = m_PortionList.front(); + PPTPortionObj const& rPortion = *m_PortionList.front(); if (rPortion.pCharSet->mnAttrSet & ( 1 << PPT_CharAttr_Font ) ) { rRetValue = rPortion.pCharSet->mnFont; @@ -5869,7 +5870,7 @@ bool PPTParagraphObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& rRetValue, sal_uI { if (!m_PortionList.empty()) { - PPTPortionObj const& rPortion = m_PortionList.front(); + PPTPortionObj const& rPortion = *m_PortionList.front(); bIsHardAttribute = rPortion.GetAttrib( PPT_CharAttr_Font, rRetValue, nDestinationInstance); } @@ -5905,7 +5906,7 @@ bool PPTParagraphObj::GetAttrib( sal_uInt32 nAttr, sal_uInt32& rRetValue, sal_uI { if (!m_PortionList.empty()) { - PPTPortionObj const& rPortion = m_PortionList.front(); + PPTPortionObj const& rPortion = *m_PortionList.front(); if (rPortion.mbIsHyperlink ) { if( rPortion.mbHardHylinkOrigColor ) @@ -6137,7 +6138,7 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >& if (!m_PortionList.empty()) { sal_uInt32 nFontHeight = 0; - m_PortionList.back().GetAttrib( + m_PortionList.back()->GetAttrib( PPT_CharAttr_FontHeight, nFontHeight, nDestinationInstance); if ( ((sal_Int16)nUpperDist) > 0 ) nUpperDist = - (sal_Int16)( ( nFontHeight * nUpperDist * 100 ) / 1000 ); @@ -6219,7 +6220,7 @@ sal_uInt32 PPTParagraphObj::GetTextSize() sal_uInt32 nCount, nRetValue = 0; for (size_t i = 0; i < m_PortionList.size(); i++) { - PPTPortionObj const& rPortionObj = m_PortionList[i]; + PPTPortionObj const& rPortionObj = *m_PortionList[i]; nCount = rPortionObj.Count(); if ((!nCount) && rPortionObj.mpFieldItem) nCount++; @@ -6233,7 +6234,7 @@ PPTPortionObj* PPTParagraphObj::First() mnCurrentObject = 0; if (m_PortionList.empty()) return NULL; - return &m_PortionList.front(); + return m_PortionList.front().get(); } PPTPortionObj* PPTParagraphObj::Next() @@ -6242,7 +6243,7 @@ PPTPortionObj* PPTParagraphObj::Next() if (i >= m_PortionList.size()) return NULL; mnCurrentObject++; - return &m_PortionList[i]; + return m_PortionList[i].get(); } PPTFieldEntry::~PPTFieldEntry() diff --git a/include/filter/msfilter/svdfppt.hxx b/include/filter/msfilter/svdfppt.hxx index b864c67d96ee..cabb4b9f4bca 100644 --- a/include/filter/msfilter/svdfppt.hxx +++ b/include/filter/msfilter/svdfppt.hxx @@ -1161,7 +1161,7 @@ public: bool mbTab; // if true, this paragraph has tabulators in text sal_uInt32 mnCurrentObject; - ::boost::ptr_vector<PPTPortionObj> m_PortionList; + ::std::vector<std::unique_ptr<PPTPortionObj>> m_PortionList; void UpdateBulletRelSize( sal_uInt32& nBulletRelSize ) const; bool GetAttrib( sal_uInt32 nAttr, sal_uInt32& nVal, sal_uInt32 nInstanceInSheet ); |