[Libreoffice-commits] core.git: chart2/source editeng/source include/editeng include/svx sc/source sd/source starmath/source svx/source sw/source

Stephan Bergmann sbergman at redhat.com
Wed Sep 24 07:07:19 PDT 2014


 chart2/source/controller/accessibility/AccessibleTextHelper.cxx |    9 ++
 editeng/source/accessibility/AccessibleStaticTextBase.cxx       |   28 ++------
 editeng/source/uno/unoedprx.cxx                                 |   13 +--
 include/editeng/AccessibleStaticTextBase.hxx                    |   11 +--
 include/editeng/unoedprx.hxx                                    |    9 --
 include/svx/AccessibleTextHelper.hxx                            |   11 +--
 sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx    |    5 -
 sc/source/ui/Accessibility/AccessibleEditObject.cxx             |   11 ++-
 sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx         |    9 ++
 sc/source/ui/Accessibility/AccessiblePreviewCell.cxx            |    9 ++
 sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx      |    9 ++
 sd/source/ui/accessibility/AccessibleOutlineView.cxx            |    4 -
 starmath/source/accessibility.cxx                               |   13 ++-
 svx/source/accessibility/AccessibleShape.cxx                    |   14 +---
 svx/source/accessibility/AccessibleTextHelper.cxx               |   34 +++-------
 svx/source/table/accessiblecell.cxx                             |   10 +-
 sw/source/uibase/docvw/SidebarTxtControlAcc.cxx                 |    9 ++
 17 files changed, 103 insertions(+), 105 deletions(-)

New commits:
commit 4e820251892917a92996f1aa6978ad609112001c
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Sep 24 16:03:36 2014 +0200

    Replace some std::auto_ptr function parameters with std::unique_ptr
    
    Change-Id: Ic66d325fd9559c6dde9556c26e5b2a7e60376c49

diff --git a/chart2/source/controller/accessibility/AccessibleTextHelper.cxx b/chart2/source/controller/accessibility/AccessibleTextHelper.cxx
index 9c3f3c1..96564fc 100644
--- a/chart2/source/controller/accessibility/AccessibleTextHelper.cxx
+++ b/chart2/source/controller/accessibility/AccessibleTextHelper.cxx
@@ -17,6 +17,11 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <memory>
+#include <utility>
+
 #include "AccessibleTextHelper.hxx"
 #include "DrawViewWrapper.hxx"
 
@@ -87,9 +92,9 @@ void SAL_CALL AccessibleTextHelper::initialize( const Sequence< uno::Any >& aArg
             SdrObject * pTextObj = m_pDrawViewWrapper->getNamedSdrObject( aCID );
             if( pTextObj )
             {
-                SvxEditSource * pEditSource = new SvxTextEditSource( *pTextObj, 0, *pView, *pWindow );
+                std::unique_ptr<SvxEditSource> pEditSource(new SvxTextEditSource( *pTextObj, 0, *pView, *pWindow ));
                 m_pTextHelper = new ::accessibility::AccessibleTextHelper(
-                    ::std::auto_ptr< SvxEditSource >( pEditSource ));
+                    std::move(pEditSource));
                 if( m_pTextHelper )
                     m_pTextHelper->SetEventSource( xEventSource );
             }
diff --git a/editeng/source/accessibility/AccessibleStaticTextBase.cxx b/editeng/source/accessibility/AccessibleStaticTextBase.cxx
index 9d70af9..37a30c6 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 81f64dd..ad198b5 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)
diff --git a/include/editeng/AccessibleStaticTextBase.hxx b/include/editeng/AccessibleStaticTextBase.hxx
index 9d74ad1..e061f84 100644
--- a/include/editeng/AccessibleStaticTextBase.hxx
+++ b/include/editeng/AccessibleStaticTextBase.hxx
@@ -101,9 +101,8 @@ namespace accessibility
             model) contained in the given SvxEditSource.
 
         */
-        SAL_WNODEPRECATED_DECLARATIONS_PUSH
-        explicit AccessibleStaticTextBase( ::std::auto_ptr< SvxEditSource > pEditSource );
-        SAL_WNODEPRECATED_DECLARATIONS_POP
+        explicit AccessibleStaticTextBase( ::std::unique_ptr< SvxEditSource > && pEditSource );
+
         virtual ~AccessibleStaticTextBase();
 
     private:
@@ -144,16 +143,14 @@ namespace accessibility
             This class does not have a dispose method, since it is not
             a UNO component. Nevertheless, it holds C++ references to
             several core objects, so you should issue a
-            SetEditSource(::std::auto_ptr<SvxEditSource>(NULL)) in
+            SetEditSource(::std::unique_ptr<SvxEditSource>()) in
             your dispose() method.
 
             @param pEditSource
             The new edit source to set. Object ownership is transferred
             from the caller to the callee.
         */
-        SAL_WNODEPRECATED_DECLARATIONS_PUSH
-        virtual void SetEditSource( ::std::auto_ptr< SvxEditSource > pEditSource );
-        SAL_WNODEPRECATED_DECLARATIONS_POP
+        virtual void SetEditSource( ::std::unique_ptr< SvxEditSource > && pEditSource );
 
         /** Set the event source
 
diff --git a/include/editeng/unoedprx.hxx b/include/editeng/unoedprx.hxx
index bbe67ff..091adcc 100644
--- a/include/editeng/unoedprx.hxx
+++ b/include/editeng/unoedprx.hxx
@@ -151,9 +151,8 @@ public:
     virtual void                                UpdateData() SAL_OVERRIDE;
     virtual SfxBroadcaster&                     GetBroadcaster() const SAL_OVERRIDE;
 
-    SAL_WNODEPRECATED_DECLARATIONS_PUSH
-    void        SetEditSource( ::std::auto_ptr< SvxEditSource > pAdaptee );
-    SAL_WNODEPRECATED_DECLARATIONS_POP
+    void        SetEditSource( ::std::unique_ptr< SvxEditSource > && pAdaptee );
+
     bool        IsValid() const { return mbEditSourceValid;}
 
 private:
@@ -161,9 +160,7 @@ private:
     SvxEditSourceAdapter( const SvxEditSourceAdapter& );
     SvxEditSourceAdapter& operator= ( const SvxEditSourceAdapter& );
 
-    SAL_WNODEPRECATED_DECLARATIONS_PUSH
-    ::std::auto_ptr< SvxEditSource >    mpAdaptee;
-    SAL_WNODEPRECATED_DECLARATIONS_POP
+    ::std::unique_ptr< SvxEditSource >    mpAdaptee;
 
     SvxAccessibleTextAdapter            maTextAdapter;
     SvxAccessibleTextEditViewAdapter    maEditViewAdapter;
diff --git a/include/svx/AccessibleTextHelper.hxx b/include/svx/AccessibleTextHelper.hxx
index d369c0d..8d13e9d 100644
--- a/include/svx/AccessibleTextHelper.hxx
+++ b/include/svx/AccessibleTextHelper.hxx
@@ -124,9 +124,8 @@ namespace accessibility
             model) contained in the given SvxEditSource.
 
         */
-        SAL_WNODEPRECATED_DECLARATIONS_PUSH
-        explicit AccessibleTextHelper( ::std::auto_ptr< SvxEditSource > pEditSource );
-        SAL_WNODEPRECATED_DECLARATIONS_POP
+        explicit AccessibleTextHelper( ::std::unique_ptr< SvxEditSource > && pEditSource );
+
         virtual ~AccessibleTextHelper();
 
     protected:
@@ -180,16 +179,14 @@ namespace accessibility
             This class does not have a dispose method, since it is not
             a UNO component. Nevertheless, it holds C++ references to
             several core objects, so you should issue a
-            SetEditSource(::std::auto_ptr<SvxEditSource>(NULL)) in
+            SetEditSource(::std::unique_ptr<SvxEditSource>()) in
             your dispose() method.
 
             @param pEditSource
             The new edit source to set. Object ownership is transferred
             from the caller to the callee.
         */
-        SAL_WNODEPRECATED_DECLARATIONS_PUSH
-        virtual void SetEditSource( ::std::auto_ptr< SvxEditSource > pEditSource );
-        SAL_WNODEPRECATED_DECLARATIONS_POP
+        virtual void SetEditSource( ::std::unique_ptr< SvxEditSource > && pEditSource );
 
         /** Set the event source
 
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
index aaae4ef..9a4013a 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
@@ -53,6 +53,7 @@
 #include <sfx2/docfile.hxx>
 #include <comphelper/servicehelper.hxx>
 
+#include <utility>
 #include <vector>
 #include <list>
 #include <algorithm>
@@ -144,10 +145,10 @@ ScNotesChildren::~ScNotesChildren()
     SAL_WNODEPRECATED_DECLARATIONS_PUSH
     ::std::auto_ptr < ScAccessibleTextData > pAccessiblePreviewHeaderCellTextData
         (new ScAccessibleNoteTextData(mpViewShell, rString, aCellPos, bMarkNote));
-    ::std::auto_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(pAccessiblePreviewHeaderCellTextData));
     SAL_WNODEPRECATED_DECLARATIONS_POP
+    ::std::unique_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(pAccessiblePreviewHeaderCellTextData));
 
-    pTextHelper = new ::accessibility::AccessibleTextHelper(pEditSource);
+    pTextHelper = new ::accessibility::AccessibleTextHelper(std::move(pEditSource));
 
     if (pTextHelper)
     {
diff --git a/sc/source/ui/Accessibility/AccessibleEditObject.cxx b/sc/source/ui/Accessibility/AccessibleEditObject.cxx
index 6981ece..364ddab 100644
--- a/sc/source/ui/Accessibility/AccessibleEditObject.cxx
+++ b/sc/source/ui/Accessibility/AccessibleEditObject.cxx
@@ -17,6 +17,11 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <memory>
+#include <utility>
+
 #include "AccessibleEditObject.hxx"
 #include "scitems.hxx"
 #include <editeng/eeitem.hxx>
@@ -366,10 +371,8 @@ void ScAccessibleEditObject::CreateTextHelper()
                 (new ScAccessibleEditLineTextData(NULL, mpWindow));
         }
 
-        SAL_WNODEPRECATED_DECLARATIONS_PUSH
-        ::std::auto_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(pAccessibleTextData));
-        SAL_WNODEPRECATED_DECLARATIONS_POP
-        mpTextHelper = new ::accessibility::AccessibleTextHelper(pEditSource );
+        ::std::unique_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(pAccessibleTextData));
+        mpTextHelper = new ::accessibility::AccessibleTextHelper(std::move(pEditSource));
         mpTextHelper->SetEventSource(this);
         mpTextHelper->SetFocus(mbHasFocus);
 
diff --git a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx
index 68682e0..b261af6 100644
--- a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx
@@ -17,6 +17,11 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <memory>
+#include <utility>
+
 #include <tools/gen.hxx>
 #include "AccessiblePageHeaderArea.hxx"
 #include "AccessibleText.hxx"
@@ -298,10 +303,10 @@ void ScAccessiblePageHeaderArea::CreateTextHelper()
         SAL_WNODEPRECATED_DECLARATIONS_PUSH
         ::std::auto_ptr < ScAccessibleTextData > pAccessibleHeaderTextData
             (new ScAccessibleHeaderTextData(mpViewShell, mpEditObj, mbHeader, meAdjust));
-        ::std::auto_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(pAccessibleHeaderTextData));
         SAL_WNODEPRECATED_DECLARATIONS_POP
+        ::std::unique_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(pAccessibleHeaderTextData));
 
-        mpTextHelper = new ::accessibility::AccessibleTextHelper(pEditSource );
+        mpTextHelper = new ::accessibility::AccessibleTextHelper(std::move(pEditSource));
         mpTextHelper->SetEventSource(this);
     }
 }
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
index 68e8cd6..ef0f0cf 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx
@@ -17,6 +17,11 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <memory>
+#include <utility>
+
 #include "scitems.hxx"
 #include <editeng/eeitem.hxx>
 #include <tools/gen.hxx>
@@ -281,10 +286,10 @@ void ScAccessiblePreviewCell::CreateTextHelper()
         SAL_WNODEPRECATED_DECLARATIONS_PUSH
         ::std::auto_ptr < ScAccessibleTextData > pAccessiblePreviewCellTextData
             (new ScAccessiblePreviewCellTextData(mpViewShell, maCellAddress));
-        ::std::auto_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(pAccessiblePreviewCellTextData));
         SAL_WNODEPRECATED_DECLARATIONS_POP
+        ::std::unique_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(pAccessiblePreviewCellTextData));
 
-        mpTextHelper = new ::accessibility::AccessibleTextHelper( pEditSource );
+        mpTextHelper = new ::accessibility::AccessibleTextHelper( std::move(pEditSource) );
         mpTextHelper->SetEventSource( this );
 
         // paragraphs in preview are transient
diff --git a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
index 4b50e63..b42a305 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx
@@ -17,6 +17,11 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <memory>
+#include <utility>
+
 /* Somehow, under same circumstances, MSVC creates object code for 2
  * inlined functions. Nobody here uses them, so simply define them away
  * so that there be no dupplicate symbols anymore.
@@ -425,10 +430,10 @@ void ScAccessiblePreviewHeaderCell::CreateTextHelper()
         SAL_WNODEPRECATED_DECLARATIONS_PUSH
         ::std::auto_ptr < ScAccessibleTextData > pAccessiblePreviewHeaderCellTextData
             (new ScAccessiblePreviewHeaderCellTextData(mpViewShell, OUString(getAccessibleName()), maCellPos, mbColumnHeader, mbRowHeader));
-        ::std::auto_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(pAccessiblePreviewHeaderCellTextData));
         SAL_WNODEPRECATED_DECLARATIONS_POP
+        ::std::unique_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(pAccessiblePreviewHeaderCellTextData));
 
-        mpTextHelper = new ::accessibility::AccessibleTextHelper(pEditSource );
+        mpTextHelper = new ::accessibility::AccessibleTextHelper(std::move(pEditSource));
         mpTextHelper->SetEventSource(this);
     }
 }
diff --git a/sd/source/ui/accessibility/AccessibleOutlineView.cxx b/sd/source/ui/accessibility/AccessibleOutlineView.cxx
index 1104f9e2..a347f9c 100644
--- a/sd/source/ui/accessibility/AccessibleOutlineView.cxx
+++ b/sd/source/ui/accessibility/AccessibleOutlineView.cxx
@@ -83,10 +83,8 @@ AccessibleOutlineView::AccessibleOutlineView (
 
             if( pOutlineView )
             {
-                SAL_WNODEPRECATED_DECLARATIONS_PUSH
-                maTextHelper.SetEditSource( ::std::auto_ptr< SvxEditSource >( new AccessibleOutlineEditSource(
+                maTextHelper.SetEditSource( ::std::unique_ptr< SvxEditSource >( new AccessibleOutlineEditSource(
                                                                                   rOutliner, *pView, *pOutlineView, *pSdWindow ) ) );
-                SAL_WNODEPRECATED_DECLARATIONS_POP
             }
         }
     }
diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx
index 6388cc6..5ef1168 100644
--- a/starmath/source/accessibility.cxx
+++ b/starmath/source/accessibility.cxx
@@ -17,6 +17,11 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <memory>
+#include <utility>
+
 #include <com/sun/star/accessibility/AccessibleRole.hpp>
 #include <com/sun/star/accessibility/AccessibleStateType.hpp>
 #include <com/sun/star/accessibility/AccessibleTextType.hpp>
@@ -1647,9 +1652,9 @@ void SmEditAccessible::Init()
         EditView   *pEditView   = pWin->GetEditView();
         if (pEditEngine && pEditView)
         {
-            ::std::auto_ptr< SvxEditSource > pEditSource(
+            ::std::unique_ptr< SvxEditSource > pEditSource(
                     new SmEditSource( pWin, *this ) );
-            pTextHelper = new ::accessibility::AccessibleTextHelper( pEditSource );
+            pTextHelper = new ::accessibility::AccessibleTextHelper( std::move(pEditSource) );
             pTextHelper->SetEventSource( this );
         }
     }
@@ -1666,9 +1671,7 @@ void SmEditAccessible::ClearWin()
     pWin = 0;   // implicitly results in AccessibleStateType::DEFUNC set
 
     //! make TextHelper implicitly release C++ references to some core objects
-    SAL_WNODEPRECATED_DECLARATIONS_PUSH
-    pTextHelper->SetEditSource( ::std::auto_ptr<SvxEditSource>(NULL) );
-    SAL_WNODEPRECATED_DECLARATIONS_POP
+    pTextHelper->SetEditSource( ::std::unique_ptr<SvxEditSource>() );
     //! make TextHelper release references
     //! (e.g. the one set by the 'SetEventSource' call)
     pTextHelper->Dispose();
diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx
index ad41042..a3d18ea 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 32444e6..97a62ce 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 b223f23..60b25c7 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);
         }
 
diff --git a/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx b/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx
index 4ed9d55..d7bdc2d 100644
--- a/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx
+++ b/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx
@@ -17,6 +17,11 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <memory>
+#include <utility>
+
 #include <SidebarTxtControlAcc.hxx>
 
 #include <SidebarTxtControl.hxx>
@@ -168,9 +173,9 @@ SidebarTxtControlAccessibleContext::SidebarTxtControlAccessibleContext( SidebarT
     , mpAccessibleTextHelper( 0 )
     , maMutex()
 {
-    ::std::auto_ptr<SvxEditSource> pEditSource(
+    ::std::unique_ptr<SvxEditSource> pEditSource(
                         new SidebarTextEditSource( mrSidebarTxtControl ) );
-    mpAccessibleTextHelper = new ::accessibility::AccessibleTextHelper( pEditSource );
+    mpAccessibleTextHelper = new ::accessibility::AccessibleTextHelper( std::move(pEditSource) );
     mpAccessibleTextHelper->SetEventSource( mrSidebarTxtControl.GetWindowPeer() );
 }
 


More information about the Libreoffice-commits mailing list