Kaydet (Commit) bf211635 authored tarafından Michael Stahl's avatar Michael Stahl

sw: replace boost::ptr_vector with std::vector<std::unique_ptr>

Change-Id: I4abd8fcbbe8ef439097eed7c2b20584450182cd5
üst 0a601a0c
......@@ -25,7 +25,8 @@
#include <rtl/ustring.hxx>
#include <redline.hxx>
#include <boost/ptr_container/ptr_vector.hpp>
#include <memory>
#include <vector>
class SfxItemSet;
class SwFormatColl;
......@@ -65,17 +66,17 @@ public:
class SwRedlineSaveDatas {
private:
boost::ptr_vector<SwRedlineSaveData> mvData;
std::vector<std::unique_ptr<SwRedlineSaveData>> m_Data;
public:
SwRedlineSaveDatas() : mvData() {}
void clear() { mvData.clear(); }
bool empty() const { return mvData.empty(); }
size_t size() const { return mvData.size(); }
void push_back (SwRedlineSaveData* value) { mvData.push_back(value); }
const SwRedlineSaveData& operator[]( size_t nIdx ) const { return mvData[ nIdx ]; }
SwRedlineSaveData& operator[]( size_t nIdx ) { return mvData[ nIdx ]; }
SwRedlineSaveDatas() : m_Data() {}
void clear() { m_Data.clear(); }
bool empty() const { return m_Data.empty(); }
size_t size() const { return m_Data.size(); }
void push_back(std::unique_ptr<SwRedlineSaveData> pNew) { m_Data.push_back(std::move(pNew)); }
const SwRedlineSaveData& operator[](size_t const nIdx) const { return *m_Data[ nIdx ]; }
SwRedlineSaveData& operator[](size_t const nIdx) { return *m_Data[ nIdx ]; }
};
namespace sw {
......
......@@ -979,7 +979,6 @@ bool SwUndo::FillSaveData(
{
rSData.clear();
SwRedlineSaveData* pNewData;
const SwPosition* pStt = rRange.Start();
const SwPosition* pEnd = rRange.End();
const SwRedlineTable& rTable = rRange.GetDoc()->getIDocumentRedlineAccess().GetRedlineTable();
......@@ -996,8 +995,9 @@ bool SwUndo::FillSaveData(
&& eCmpPos != POS_COLLIDE_END
&& eCmpPos != POS_COLLIDE_START )
{
pNewData = new SwRedlineSaveData( eCmpPos, *pStt, *pEnd, *pRedl, bCopyNext );
rSData.push_back( pNewData );
std::unique_ptr<SwRedlineSaveData> pNewData(
new SwRedlineSaveData(eCmpPos, *pStt, *pEnd, *pRedl, bCopyNext));
rSData.push_back(std::move(pNewData));
}
}
if( !rSData.empty() && bDelRange )
......@@ -1013,7 +1013,6 @@ bool SwUndo::FillSaveDataForFormat(
{
rSData.clear();
SwRedlineSaveData* pNewData;
const SwPosition *pStt = rRange.Start(), *pEnd = rRange.End();
const SwRedlineTable& rTable = rRange.GetDoc()->getIDocumentRedlineAccess().GetRedlineTable();
sal_uInt16 n = 0;
......@@ -1029,8 +1028,9 @@ bool SwUndo::FillSaveDataForFormat(
&& eCmpPos != POS_COLLIDE_END
&& eCmpPos != POS_COLLIDE_START )
{
pNewData = new SwRedlineSaveData( eCmpPos, *pStt, *pEnd, *pRedl, true );
rSData.push_back( pNewData );
std::unique_ptr<SwRedlineSaveData> pNewData(
new SwRedlineSaveData(eCmpPos, *pStt, *pEnd, *pRedl, true));
rSData.push_back(std::move(pNewData));
}
}
......
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