summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-11-10 15:18:31 +0200
committerNoel Grandin <noel@peralex.com>2015-11-10 15:30:04 +0200
commit97ebf71c8bbe1755e02fe4d486d04353cf2575da (patch)
tree182eed891bc12380274fc591eed588eb79ca0bad /editeng
parent5f86c1f3792a5161e2d661276c529ce05e53d44b (diff)
editeng: boost::ptr_vector->std::vector<std::unique_ptr>
Change-Id: I49cf179016a0690cb87bc12880da8b1824ac01cc
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/editeng.cxx2
-rw-r--r--editeng/source/editeng/impedit.hxx5
-rw-r--r--editeng/source/editeng/impedit2.cxx9
-rw-r--r--editeng/source/editeng/impedit3.cxx4
4 files changed, 10 insertions, 10 deletions
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index 203531aa63ff..eb4921c6ffa7 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -684,7 +684,7 @@ bool EditEngine::IsCallParaInsertedOrDeleted() const
void EditEngine::AppendDeletedNodeInfo(DeletedNodeInfo* pInfo)
{
- pImpEditEngine->aDeletedNodes.push_back(pInfo);
+ pImpEditEngine->aDeletedNodes.push_back(std::unique_ptr<DeletedNodeInfo>(pInfo));
}
void EditEngine::UpdateSelections()
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 815e7ae4d546..40bb0f701c70 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -59,7 +59,8 @@
#include <LibreOfficeKit/LibreOfficeKitTypes.h>
#include <boost/noncopyable.hpp>
-#include <boost/ptr_container/ptr_vector.hpp>
+#include <memory>
+#include <vector>
#define DEL_LEFT 1
#define DEL_RIGHT 2
@@ -467,7 +468,7 @@ private:
OnDemandTransliterationWrapper xTransliterationWrapper;
// For Formatting / Update ....
- boost::ptr_vector<DeletedNodeInfo> aDeletedNodes;
+ std::vector<std::unique_ptr<DeletedNodeInfo> > aDeletedNodes;
Rectangle aInvalidRect;
sal_uInt32 nCurTextHeight;
sal_uInt32 nCurTextHeightNTP; // without trailing empty paragraphs
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index ee31b8e67891..1ae1dd8a722d 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -61,6 +61,7 @@
#include <sot/exchange.hxx>
#include <sot/formats.hxx>
+#include <o3tl/make_unique.hxx>
#include <unicode/ubidi.h>
#include <algorithm>
@@ -2202,8 +2203,7 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pR
}
sal_Int32 nParagraphTobeDeleted = aEditDoc.GetPos( pRight );
- DeletedNodeInfo* pInf = new DeletedNodeInfo( pRight, nParagraphTobeDeleted );
- aDeletedNodes.push_back(pInf);
+ aDeletedNodes.push_back(o3tl::make_unique<DeletedNodeInfo>( pRight, nParagraphTobeDeleted ));
GetEditEnginePtr()->ParagraphConnected( aEditDoc.GetPos( pLeft ), aEditDoc.GetPos( pRight ) );
@@ -2441,8 +2441,7 @@ void ImpEditEngine::ImpRemoveParagraph( sal_Int32 nPara )
OSL_ENSURE( pNode, "Blind Node in ImpRemoveParagraph" );
- DeletedNodeInfo* pInf = new DeletedNodeInfo( pNode, nPara );
- aDeletedNodes.push_back(pInf);
+ aDeletedNodes.push_back(o3tl::make_unique<DeletedNodeInfo>( pNode, nPara ));
// The node is managed by the undo and possibly destroyed!
aEditDoc.Release( nPara );
@@ -3293,7 +3292,7 @@ void ImpEditEngine::UpdateSelections()
bool bChanged = false;
for (size_t i = 0, n = aDeletedNodes.size(); i < n; ++i)
{
- const DeletedNodeInfo& rInf = aDeletedNodes[i];
+ const DeletedNodeInfo& rInf = *aDeletedNodes[i].get();
if ( ( aCurSel.Min().GetNode() == rInf.GetNode() ) ||
( aCurSel.Max().GetNode() == rInf.GetNode() ) )
{
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 9d878aeaeeb2..5b3498e07985 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -69,6 +69,7 @@
#include <com/sun/star/text/CharacterCompressionType.hpp>
#include <vcl/pdfextoutdevdata.hxx>
#include <i18nlangtag/mslangid.hxx>
+#include <o3tl/make_unique.hxx>
#include <comphelper/processfactory.hxx>
#include <rtl/ustrbuf.hxx>
@@ -3947,8 +3948,7 @@ void ImpEditEngine::ShowParagraph( sal_Int32 nParagraph, bool bShow )
{
// Mark as deleted, so that no selection will end or begin at
// this paragraph...
- DeletedNodeInfo* pDelInfo = new DeletedNodeInfo( pPPortion->GetNode(), nParagraph );
- aDeletedNodes.push_back(pDelInfo);
+ aDeletedNodes.push_back(o3tl::make_unique<DeletedNodeInfo>( pPPortion->GetNode(), nParagraph ));
UpdateSelections();
// The region below will not be invalidated if UpdateMode = sal_False!
// If anyway, then save as sal_False before SetVisible !