Kaydet (Commit) 5f86c1f3 authored tarafından Noel Grandin's avatar Noel Grandin

editeng: boost::ptr_vector->std::vector<std::unique_ptr>

Change-Id: Iee1e64d22e799653bc58d6a72c57c55787e45d84
üst 5a7a4325
...@@ -501,14 +501,14 @@ EditUndoSetAttribs::EditUndoSetAttribs(EditEngine* pEE, const ESelection& rESel, ...@@ -501,14 +501,14 @@ EditUndoSetAttribs::EditUndoSetAttribs(EditEngine* pEE, const ESelection& rESel,
namespace { namespace {
struct RemoveAttribsFromPool : std::unary_function<ContentAttribsInfo, void> struct RemoveAttribsFromPool : std::unary_function<std::unique_ptr<ContentAttribsInfo>, void>
{ {
SfxItemPool& mrPool; SfxItemPool& mrPool;
public: public:
explicit RemoveAttribsFromPool(SfxItemPool& rPool) : mrPool(rPool) {} explicit RemoveAttribsFromPool(SfxItemPool& rPool) : mrPool(rPool) {}
void operator() (ContentAttribsInfo& rInfo) void operator() (std::unique_ptr<ContentAttribsInfo>& rInfo)
{ {
rInfo.RemoveAllCharAttribsFromPool(mrPool); rInfo->RemoveAllCharAttribsFromPool(mrPool);
} }
}; };
...@@ -528,7 +528,7 @@ void EditUndoSetAttribs::Undo() ...@@ -528,7 +528,7 @@ void EditUndoSetAttribs::Undo()
bool bFields = false; bool bFields = false;
for ( sal_Int32 nPara = aESel.nStartPara; nPara <= aESel.nEndPara; nPara++ ) for ( sal_Int32 nPara = aESel.nStartPara; nPara <= aESel.nEndPara; nPara++ )
{ {
const ContentAttribsInfo& rInf = aPrevAttribs[nPara-aESel.nStartPara]; const ContentAttribsInfo& rInf = *aPrevAttribs[nPara-aESel.nStartPara].get();
// first the paragraph attributes ... // first the paragraph attributes ...
pEE->SetParaAttribsOnly(nPara, rInf.GetPrevParaAttribs()); pEE->SetParaAttribsOnly(nPara, rInf.GetPrevParaAttribs());
...@@ -568,7 +568,7 @@ void EditUndoSetAttribs::Redo() ...@@ -568,7 +568,7 @@ void EditUndoSetAttribs::Redo()
void EditUndoSetAttribs::AppendContentInfo(ContentAttribsInfo* pNew) void EditUndoSetAttribs::AppendContentInfo(ContentAttribsInfo* pNew)
{ {
aPrevAttribs.push_back(pNew); aPrevAttribs.push_back(std::unique_ptr<ContentAttribsInfo>(pNew));
} }
void EditUndoSetAttribs::ImpSetSelection( EditView* /*pView*/ ) void EditUndoSetAttribs::ImpSetSelection( EditView* /*pView*/ )
......
...@@ -23,7 +23,8 @@ ...@@ -23,7 +23,8 @@
#include <editdoc.hxx> #include <editdoc.hxx>
#include <editeng/editund2.hxx> #include <editeng/editund2.hxx>
#include <editeng/editdata.hxx> #include <editeng/editdata.hxx>
#include <boost/ptr_container/ptr_vector.hpp> #include <vector>
#include <memory>
class EditEngine; class EditEngine;
class EditView; class EditView;
...@@ -212,7 +213,7 @@ public: ...@@ -212,7 +213,7 @@ public:
class EditUndoSetAttribs: public EditUndo class EditUndoSetAttribs: public EditUndo
{ {
private: private:
typedef boost::ptr_vector<ContentAttribsInfo> InfoArrayType; typedef std::vector<std::unique_ptr<ContentAttribsInfo> > InfoArrayType;
ESelection aESel; ESelection aESel;
SfxItemSet aNewAttribs; SfxItemSet aNewAttribs;
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
#include <LibreOfficeKit/LibreOfficeKitTypes.h> #include <LibreOfficeKit/LibreOfficeKitTypes.h>
#include <boost/noncopyable.hpp> #include <boost/noncopyable.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
#define DEL_LEFT 1 #define DEL_LEFT 1
#define DEL_RIGHT 2 #define DEL_RIGHT 2
......
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