summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-08-11 09:13:23 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-08-11 09:13:23 +0200
commit039b7c50c9d164e9d3e1274f7246e03a2b23fe50 (patch)
tree3381ca2d7e7e87bd149ab71c3db7e248354ec676 /sw
parente7c134af920b007e697e0f7ed20a22af347c0690 (diff)
sw: use std::unique_ptr in crsr code
Change-Id: I108683bc2548c9572d2800c062a2e036808464a8
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/crsr/bookmrk.cxx5
-rw-r--r--sw/source/core/crsr/findattr.cxx8
-rw-r--r--sw/source/core/crsr/findfmt.cxx4
-rw-r--r--sw/source/core/crsr/viscrs.cxx4
-rw-r--r--sw/source/core/inc/bookmrk.hxx6
5 files changed, 14 insertions, 13 deletions
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index 6b81556660ed..76536daff6b6 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <memory>
#include <bookmrk.hxx>
#include <IDocumentMarkAccess.hxx>
#include <IDocumentUndoRedo.hxx>
@@ -160,13 +161,13 @@ namespace sw { namespace mark
void MarkBase::SetMarkPos(const SwPosition& rNewPos)
{
- ::boost::scoped_ptr<SwPosition>(new SwPosition(rNewPos)).swap(m_pPos1);
+ std::unique_ptr<SwPosition>(new SwPosition(rNewPos)).swap(m_pPos1);
m_pPos1->nContent.SetMark(this);
}
void MarkBase::SetOtherMarkPos(const SwPosition& rNewPos)
{
- ::boost::scoped_ptr<SwPosition>(new SwPosition(rNewPos)).swap(m_pPos2);
+ std::unique_ptr<SwPosition>(new SwPosition(rNewPos)).swap(m_pPos2);
m_pPos2->nContent.SetMark(this);
}
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index 9ff5944d7e5c..c8bb015c1a7b 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -43,7 +43,7 @@
#include <swundo.hxx>
#include <crsskip.hxx>
#include <boost/optional.hpp>
-#include <boost/scoped_ptr.hpp>
+#include <memory>
using namespace ::com::sun::star;
using namespace ::com::sun::star::lang;
@@ -888,7 +888,7 @@ bool SwPaM::Find( const SfxPoolItem& rAttr, bool bValue, SwMoveFn fnMove,
const sal_uInt16 nWhich = rAttr.Which();
bool bCharAttr = isCHRATR(nWhich) || isTXTATR(nWhich);
- boost::scoped_ptr<SwPaM> pPam(MakeRegion( fnMove, pRegion ));
+ std::unique_ptr<SwPaM> pPam(MakeRegion( fnMove, pRegion ));
bool bFound = false;
bool bFirst = true;
@@ -966,7 +966,7 @@ typedef bool (*FnSearchAttr)( const SwTextNode&, SwAttrCheckArr&, SwPaM& );
bool SwPaM::Find( const SfxItemSet& rSet, bool bNoColls, SwMoveFn fnMove,
const SwPaM *pRegion, bool bInReadOnly, bool bMoveFirst )
{
- boost::scoped_ptr<SwPaM> pPam(MakeRegion( fnMove, pRegion ));
+ std::unique_ptr<SwPaM> pPam(MakeRegion( fnMove, pRegion ));
bool bFound = false;
bool bFirst = true;
@@ -1153,7 +1153,7 @@ int SwFindParaAttr::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion,
const_cast< SwPaM* >(pRegion)->GetRingContainer().merge( rCursor.GetRingContainer() );
}
- boost::scoped_ptr<OUString> pRepl( (bRegExp) ?
+ std::unique_ptr<OUString> pRepl( (bRegExp) ?
ReplaceBackReferences( *pSearchOpt, pCrsr ) : 0 );
rCursor.GetDoc()->getIDocumentContentOperations().ReplaceRange( *pCrsr,
(pRepl.get()) ? *pRepl : pSearchOpt->replaceString,
diff --git a/sw/source/core/crsr/findfmt.cxx b/sw/source/core/crsr/findfmt.cxx
index e9e745514557..42713d526319 100644
--- a/sw/source/core/crsr/findfmt.cxx
+++ b/sw/source/core/crsr/findfmt.cxx
@@ -19,14 +19,14 @@
#include <doc.hxx>
#include <pamtyp.hxx>
-#include <boost/scoped_ptr.hpp>
+#include <memory>
bool SwPaM::Find( const SwFormat& rFormat, SwMoveFn fnMove,
const SwPaM *pRegion, bool bInReadOnly )
{
bool bFound = false;
const bool bSrchForward = (fnMove == fnMoveForward);
- boost::scoped_ptr<SwPaM> pPam(MakeRegion( fnMove, pRegion ));
+ std::unique_ptr<SwPaM> pPam(MakeRegion( fnMove, pRegion ));
// if at beginning/end then move it out of the node
if( bSrchForward
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index 6ff459641d94..1eb02bae31a7 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -51,7 +51,7 @@
#include <svx/sdr/overlay/overlayselection.hxx>
#include <overlayrangesoutline.hxx>
-#include <boost/scoped_ptr.hpp>
+#include <memory>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <paintfrm.hxx>
@@ -410,7 +410,7 @@ void SwSelPaintRects::HighlightInputField()
if ( pCurTextInputFieldAtCrsr != NULL )
{
SwTextNode* pTextNode = pCurTextInputFieldAtCrsr->GetpTextNode();
- ::boost::scoped_ptr<SwShellCrsr> pCrsrForInputTextField(
+ std::unique_ptr<SwShellCrsr> pCrsrForInputTextField(
new SwShellCrsr( *GetShell(), SwPosition( *pTextNode, pCurTextInputFieldAtCrsr->GetStart() ) ) );
pCrsrForInputTextField->SetMark();
pCrsrForInputTextField->GetMark()->nNode = *pTextNode;
diff --git a/sw/source/core/inc/bookmrk.hxx b/sw/source/core/inc/bookmrk.hxx
index a47040b75e8f..df6671f9c097 100644
--- a/sw/source/core/inc/bookmrk.hxx
+++ b/sw/source/core/inc/bookmrk.hxx
@@ -23,7 +23,7 @@
#include <cppuhelper/weakref.hxx>
#include <sfx2/Metadatable.hxx>
#include <vcl/keycod.hxx>
-#include <boost/scoped_ptr.hpp>
+#include <memory>
#include <boost/noncopyable.hpp>
#include <map>
#include <rtl/ustring.hxx>
@@ -114,8 +114,8 @@ namespace sw {
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) SAL_OVERRIDE;
MarkBase(const SwPaM& rPaM, const OUString& rName);
- ::boost::scoped_ptr<SwPosition> m_pPos1;
- ::boost::scoped_ptr<SwPosition> m_pPos2;
+ std::unique_ptr<SwPosition> m_pPos1;
+ std::unique_ptr<SwPosition> m_pPos2;
OUString m_aName;
static OUString GenerateNewName(const OUString& rPrefix);