diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-06-01 19:50:57 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-06-09 12:54:51 +0200 |
commit | aa0301e6d941b512e18a094f567f5c47dd08ffc9 (patch) | |
tree | 5f63176421c0172702b7ba04b2a8af2da538a4a4 | |
parent | e1323281875e3937c812a2e172fd75d16a573fd0 (diff) |
RAII for ParagraphFrameEnumeration
Change-Id: I23d9beabe38587eca2b0620b5c431835ce70d37b
-rw-r--r-- | sw/source/core/unocore/unoobj2.cxx | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 1489d8b82543..c7d9ca442bc7 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -1676,8 +1676,7 @@ lcl_FillFrame(SwUnoCrsr& rUnoCrsr, FrameClientList_t & rFrames) { const SwFormatFlyCnt& rFlyCnt = pTextAttr->GetFlyCnt(); SwFrameFormat * const pFrameFormat = rFlyCnt.GetFrameFormat(); - sw::FrameClient* const pNewClient = new sw::FrameClient(pFrameFormat); - rFrames.push_back( std::shared_ptr<sw::FrameClient>(pNewClient) ); + rFrames.push_back(std::shared_ptr<sw::FrameClient>(new sw::FrameClient(pFrameFormat))); } } @@ -1697,9 +1696,7 @@ SwXParaFrameEnumeration::SwXParaFrameEnumeration( } else if (pFormat) { - // create SwDepend for frame and insert into array - sw::FrameClient* const pNewClient = new sw::FrameClient(pFormat); - m_pImpl->m_Frames.push_back(std::shared_ptr<sw::FrameClient>(pNewClient)); + m_pImpl->m_Frames.push_back(std::shared_ptr<sw::FrameClient>(new sw::FrameClient(pFormat))); } else if ((PARAFRAME_PORTION_CHAR == eParaFrameMode) || (PARAFRAME_PORTION_TEXTRANGE == eParaFrameMode)) @@ -1713,9 +1710,7 @@ SwXParaFrameEnumeration::SwXParaFrameEnumeration( { SwFrameFormat *const pFrameFormat = const_cast<SwFrameFormat*>(&((*aIter)->GetFormat())); - // create SwDepend for frame and insert into array - sw::FrameClient* const pNewClient = new sw::FrameClient(pFrameFormat); - m_pImpl->m_Frames.push_back(std::shared_ptr<sw::FrameClient>(pNewClient)); + m_pImpl->m_Frames.push_back(std::shared_ptr<sw::FrameClient>(new sw::FrameClient(pFrameFormat))); } } |