diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-09-24 16:03:36 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-09-24 16:06:52 +0200 |
commit | 4e820251892917a92996f1aa6978ad609112001c (patch) | |
tree | 8459a52aec67f0950aa9c12cd12b98b9eb02c89f /editeng/source | |
parent | 8bf8c9ba4f031fa8c838321b0cf4c7bb8dd44753 (diff) |
Replace some std::auto_ptr function parameters with std::unique_ptr
Change-Id: Ic66d325fd9559c6dde9556c26e5b2a7e60376c49
Diffstat (limited to 'editeng/source')
-rw-r--r-- | editeng/source/accessibility/AccessibleStaticTextBase.cxx | 28 | ||||
-rw-r--r-- | editeng/source/uno/unoedprx.cxx | 13 |
2 files changed, 15 insertions, 26 deletions
diff --git a/editeng/source/accessibility/AccessibleStaticTextBase.cxx b/editeng/source/accessibility/AccessibleStaticTextBase.cxx index 9d70af9cc623..37a30c64af03 100644 --- a/editeng/source/accessibility/AccessibleStaticTextBase.cxx +++ b/editeng/source/accessibility/AccessibleStaticTextBase.cxx @@ -25,6 +25,7 @@ #include <limits.h> +#include <utility> #include <vector> #include <algorithm> #include <boost/ref.hpp> @@ -124,9 +125,8 @@ namespace accessibility return maEditSource; } - SAL_WNODEPRECATED_DECLARATIONS_PUSH - void SetEditSource( ::std::auto_ptr< SvxEditSource > pEditSource ); - SAL_WNODEPRECATED_DECLARATIONS_POP + + void SetEditSource( ::std::unique_ptr< SvxEditSource > && pEditSource ); void SetEventSource( const uno::Reference< XAccessible >& rInterface ) { @@ -230,15 +230,13 @@ namespace accessibility { } - SAL_WNODEPRECATED_DECLARATIONS_PUSH - void AccessibleStaticTextBase_Impl::SetEditSource( ::std::auto_ptr< SvxEditSource > pEditSource ) + void AccessibleStaticTextBase_Impl::SetEditSource( ::std::unique_ptr< SvxEditSource > && pEditSource ) { - maEditSource.SetEditSource( pEditSource ); + maEditSource.SetEditSource( std::move(pEditSource) ); if( mpTextParagraph ) mpTextParagraph->SetEditSource( &maEditSource ); } - SAL_WNODEPRECATED_DECLARATIONS_POP void AccessibleStaticTextBase_Impl::SetOffset( const Point& rPoint ) { @@ -495,17 +493,13 @@ namespace accessibility // AccessibleStaticTextBase implementation - - - SAL_WNODEPRECATED_DECLARATIONS_PUSH - AccessibleStaticTextBase::AccessibleStaticTextBase( ::std::auto_ptr< SvxEditSource > pEditSource ) : + AccessibleStaticTextBase::AccessibleStaticTextBase( ::std::unique_ptr< SvxEditSource > && pEditSource ) : mpImpl( new AccessibleStaticTextBase_Impl() ) { SolarMutexGuard aGuard; - SetEditSource( pEditSource ); + SetEditSource( std::move(pEditSource) ); } - SAL_WNODEPRECATED_DECLARATIONS_POP AccessibleStaticTextBase::~AccessibleStaticTextBase() { @@ -526,8 +520,7 @@ namespace accessibility #endif } - SAL_WNODEPRECATED_DECLARATIONS_PUSH - void AccessibleStaticTextBase::SetEditSource( ::std::auto_ptr< SvxEditSource > pEditSource ) + void AccessibleStaticTextBase::SetEditSource( ::std::unique_ptr< SvxEditSource > && pEditSource ) { #ifdef DBG_UTIL // precondition: solar mutex locked @@ -535,14 +528,13 @@ namespace accessibility mpImpl->CheckInvariants(); - mpImpl->SetEditSource( pEditSource ); + mpImpl->SetEditSource( std::move(pEditSource) ); mpImpl->CheckInvariants(); #else - mpImpl->SetEditSource( pEditSource ); + mpImpl->SetEditSource( std::move(pEditSource) ); #endif } - SAL_WNODEPRECATED_DECLARATIONS_POP void AccessibleStaticTextBase::SetEventSource( const uno::Reference< XAccessible >& rInterface ) { diff --git a/editeng/source/uno/unoedprx.cxx b/editeng/source/uno/unoedprx.cxx index 81f64dd5842e..ad198b55bbbf 100644 --- a/editeng/source/uno/unoedprx.cxx +++ b/editeng/source/uno/unoedprx.cxx @@ -25,6 +25,7 @@ #include <limits.h> +#include <utility> #include <vector> #include <algorithm> #include <osl/mutex.hxx> @@ -314,9 +315,7 @@ SvxEditSource* SvxEditSourceAdapter::Clone() const { if( mbEditSourceValid && mpAdaptee.get() ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr< SvxEditSource > pClonedAdaptee( mpAdaptee->Clone() ); - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr< SvxEditSource > pClonedAdaptee( mpAdaptee->Clone() ); if( pClonedAdaptee.get() ) { @@ -324,7 +323,7 @@ SvxEditSource* SvxEditSourceAdapter::Clone() const if( pClone ) { - pClone->SetEditSource( pClonedAdaptee ); + pClone->SetEditSource( std::move(pClonedAdaptee) ); return pClone; } } @@ -404,12 +403,11 @@ SfxBroadcaster& SvxEditSourceAdapter::GetBroadcaster() const return maDummyBroadcaster; } -SAL_WNODEPRECATED_DECLARATIONS_PUSH -void SvxEditSourceAdapter::SetEditSource( ::std::auto_ptr< SvxEditSource > pAdaptee ) +void SvxEditSourceAdapter::SetEditSource( ::std::unique_ptr< SvxEditSource > && pAdaptee ) { if( pAdaptee.get() ) { - mpAdaptee = pAdaptee; + mpAdaptee = std::move(pAdaptee); mbEditSourceValid = true; } else @@ -420,7 +418,6 @@ void SvxEditSourceAdapter::SetEditSource( ::std::auto_ptr< SvxEditSource > pAdap mbEditSourceValid = false; } } -SAL_WNODEPRECATED_DECLARATIONS_POP SvxAccessibleTextAdapter::SvxAccessibleTextAdapter() : mpTextForwarder(NULL) |