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 /svx | |
parent | 8bf8c9ba4f031fa8c838321b0cf4c7bb8dd44753 (diff) |
Replace some std::auto_ptr function parameters with std::unique_ptr
Change-Id: Ic66d325fd9559c6dde9556c26e5b2a7e60376c49
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/accessibility/AccessibleShape.cxx | 14 | ||||
-rw-r--r-- | svx/source/accessibility/AccessibleTextHelper.cxx | 34 | ||||
-rw-r--r-- | svx/source/table/accessiblecell.cxx | 10 |
3 files changed, 23 insertions, 35 deletions
diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx index ad4104295e72..a3d18ea32ce2 100644 --- a/svx/source/accessibility/AccessibleShape.cxx +++ b/svx/source/accessibility/AccessibleShape.cxx @@ -55,6 +55,8 @@ #include "AccessibleEmptyEditSource.hxx" #include <algorithm> +#include <memory> +#include <utility> using namespace ::com::sun::star; using namespace ::com::sun::star::accessibility; @@ -169,18 +171,14 @@ void AccessibleShape::Init (void) if( !pOutlinerParaObject ) { // empty text -> use proxy edit source to delay creation of EditEngine - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<SvxEditSource> pEditSource( new AccessibleEmptyEditSource ( *pSdrObject, *pView, *pWindow) ); - SAL_WNODEPRECATED_DECLARATIONS_POP - mpText = new AccessibleTextHelper( pEditSource ); + ::std::unique_ptr<SvxEditSource> pEditSource( new AccessibleEmptyEditSource ( *pSdrObject, *pView, *pWindow) ); + mpText = new AccessibleTextHelper( std::move(pEditSource) ); } else { // non-empty text -> use full-fledged edit source right away - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<SvxEditSource> pEditSource( new SvxTextEditSource ( *pSdrObject, 0, *pView, *pWindow) ); - SAL_WNODEPRECATED_DECLARATIONS_POP - mpText = new AccessibleTextHelper( pEditSource ); + ::std::unique_ptr<SvxEditSource> pEditSource( new SvxTextEditSource ( *pSdrObject, 0, *pView, *pWindow) ); + mpText = new AccessibleTextHelper( std::move(pEditSource) ); } if( bOwnParaObj ) diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx index 32444e634ffe..97a62ced63f2 100644 --- a/svx/source/accessibility/AccessibleTextHelper.cxx +++ b/svx/source/accessibility/AccessibleTextHelper.cxx @@ -26,6 +26,7 @@ #include <limits.h> #include <memory> +#include <utility> #include <algorithm> #include <deque> #include <osl/mutex.hxx> @@ -116,9 +117,8 @@ namespace accessibility uno::Reference< XAccessible > SAL_CALL getAccessibleAtPoint( const awt::Point& aPoint ); SvxEditSourceAdapter& GetEditSource() const; - 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 ) { @@ -763,13 +763,10 @@ namespace accessibility if( maEditSource.IsValid() ) EndListening( maEditSource.GetBroadcaster() ); - SAL_WNODEPRECATED_DECLARATIONS_PUSH - maEditSource.SetEditSource( ::std::auto_ptr< SvxEditSource >(NULL) ); - SAL_WNODEPRECATED_DECLARATIONS_POP + maEditSource.SetEditSource( ::std::unique_ptr< SvxEditSource >() ); } - SAL_WNODEPRECATED_DECLARATIONS_PUSH - void AccessibleTextHelper_Impl::SetEditSource( ::std::auto_ptr< SvxEditSource > pEditSource ) + void AccessibleTextHelper_Impl::SetEditSource( ::std::unique_ptr< SvxEditSource > && pEditSource ) { // This should only be called with solar mutex locked, i.e. from the main office thread @@ -778,7 +775,7 @@ namespace accessibility ShutdownEditSource(); // set new edit source - maEditSource.SetEditSource( pEditSource ); + maEditSource.SetEditSource( std::move(pEditSource) ); // init child vector to the current child count if( maEditSource.IsValid() ) @@ -791,7 +788,6 @@ namespace accessibility UpdateVisibleChildren(); } } - SAL_WNODEPRECATED_DECLARATIONS_POP void AccessibleTextHelper_Impl::SetOffset( const Point& rPoint ) { @@ -1561,9 +1557,7 @@ namespace accessibility EndListening( maEditSource.GetBroadcaster() ); // clear references - SAL_WNODEPRECATED_DECLARATIONS_PUSH - maEditSource.SetEditSource( ::std::auto_ptr< SvxEditSource >(NULL) ); - SAL_WNODEPRECATED_DECLARATIONS_POP + maEditSource.SetEditSource( ::std::unique_ptr< SvxEditSource >() ); mxFrontEnd = NULL; } @@ -1692,17 +1686,13 @@ namespace accessibility // AccessibleTextHelper implementation (simply forwards to impl) - - - SAL_WNODEPRECATED_DECLARATIONS_PUSH - AccessibleTextHelper::AccessibleTextHelper( ::std::auto_ptr< SvxEditSource > pEditSource ) : + AccessibleTextHelper::AccessibleTextHelper( ::std::unique_ptr< SvxEditSource > && pEditSource ) : mpImpl( new AccessibleTextHelper_Impl() ) { SolarMutexGuard aGuard; - SetEditSource( pEditSource ); + SetEditSource( std::move(pEditSource) ); } - SAL_WNODEPRECATED_DECLARATIONS_PUSH AccessibleTextHelper::~AccessibleTextHelper() { @@ -1723,8 +1713,7 @@ namespace accessibility #endif } - SAL_WNODEPRECATED_DECLARATIONS_PUSH - void AccessibleTextHelper::SetEditSource( ::std::auto_ptr< SvxEditSource > pEditSource ) + void AccessibleTextHelper::SetEditSource( ::std::unique_ptr< SvxEditSource > && pEditSource ) { #ifdef DBG_UTIL // precondition: solar mutex locked @@ -1733,13 +1722,12 @@ namespace accessibility mpImpl->CheckInvariants(); #endif - mpImpl->SetEditSource( pEditSource ); + mpImpl->SetEditSource( std::move(pEditSource) ); #ifdef DBG_UTIL mpImpl->CheckInvariants(); #endif } - SAL_WNODEPRECATED_DECLARATIONS_POP void AccessibleTextHelper::SetEventSource( const uno::Reference< XAccessible >& rInterface ) { diff --git a/svx/source/table/accessiblecell.cxx b/svx/source/table/accessiblecell.cxx index b223f23ef7f0..60b25c76cd55 100644 --- a/svx/source/table/accessiblecell.cxx +++ b/svx/source/table/accessiblecell.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <memory> +#include <utility> #include <accessiblecell.hxx> @@ -79,10 +83,8 @@ void AccessibleCell::Init (void) if( pOutlinerParaObject ) { // non-empty text -> use full-fledged edit source right away - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<SvxEditSource> pEditSource( new SvxTextEditSource( mxCell->GetObject(), mxCell.get(), *pView, *pWindow) ); - SAL_WNODEPRECATED_DECLARATIONS_POP - mpText = new AccessibleTextHelper( pEditSource ); + ::std::unique_ptr<SvxEditSource> pEditSource( new SvxTextEditSource( mxCell->GetObject(), mxCell.get(), *pView, *pWindow) ); + mpText = new AccessibleTextHelper( std::move(pEditSource) ); mpText->SetEventSource(this); } |