diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-10-01 15:03:54 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-10-01 17:35:08 +0200 |
commit | 4281abdfa8a417f7ba47c466410e1cbfed4342e0 (patch) | |
tree | e63ad9c555ef59f0c4d46a4b394d8c27ce6b70ef /sd | |
parent | 2d1e026e7a148761d30db77c57f36cceff3d327d (diff) |
sd: std::auto_ptr -> std::unique_ptr
ToolBarManager::Implementation::Update in sd/source/ui/view/ToolBarManager.cxx
is dubious. It takes its parameter by value (so in UnlockUpdate() the passed-in
mpSynchronousLayouterLock is reset upon passing it in), but the comment that it
"is [...] released at its end" together with the redundant
pLocalLayouterLock.reset() at the end of Update() make it look as though the
intention was to pass by reference. However, resetting
mpSynchronousLayouterLock even in the case where pass-by-ref would fail to reset
it is apparently important, as otherwise e.g. JunitTest_svx_unoapi would run
into the OSL_ASSERT(mpSynchronousLayouterLock.get()==NULL) in LockUpdate() with
a call stack of ... -> Update -> SetValid -> UpdateLockImplementation ->
LockUpdate.
Change-Id: I7d2717d5e1f8aa69c79a626c100d7fefb0cfb120
Diffstat (limited to 'sd')
63 files changed, 131 insertions, 167 deletions
diff --git a/sd/inc/Outliner.hxx b/sd/inc/Outliner.hxx index c05993d68ed2..4999b48d1dac 100644 --- a/sd/inc/Outliner.hxx +++ b/sd/inc/Outliner.hxx @@ -176,7 +176,7 @@ public: private: class Implementation; - ::std::auto_ptr<Implementation> mpImpl; + ::std::unique_ptr<Implementation> mpImpl; /// Specifies whether to search and replace, to spell check or to do a /// text conversion. diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx index f31f371f2319..6cd99ce335cf 100644 --- a/sd/inc/drawdoc.hxx +++ b/sd/inc/drawdoc.hxx @@ -181,8 +181,8 @@ private: CharClass* mpCharClass; ::com::sun::star::lang::Locale* mpLocale; - ::std::auto_ptr<ImpDrawPageListWatcher> mpDrawPageListWatcher; - ::std::auto_ptr<ImpMasterPageListWatcher> mpMasterPageListWatcher; + ::std::unique_ptr<ImpDrawPageListWatcher> mpDrawPageListWatcher; + ::std::unique_ptr<ImpMasterPageListWatcher> mpMasterPageListWatcher; SAL_DLLPRIVATE void UpdatePageObjectsInNotes(sal_uInt16 nStartPos); SAL_DLLPRIVATE void UpdatePageRelativeURLs(SdPage* pPage, sal_uInt16 nPos, sal_Int32 nIncrement); diff --git a/sd/inc/sdmod.hxx b/sd/inc/sdmod.hxx index d182a301bf6a..b1b42915500f 100644 --- a/sd/inc/sdmod.hxx +++ b/sd/inc/sdmod.hxx @@ -148,7 +148,7 @@ private: /** The resource container controls the lifetime of some singletons. */ - ::std::auto_ptr< ::sd::SdGlobalResourceContainer> mpResourceContainer; + ::std::unique_ptr< ::sd::SdGlobalResourceContainer> mpResourceContainer; /** Create a new summary page. When the document has been created in the kiosk mode with automatical transitions then this method adds diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx index c8d7bf22d764..89d5f2bd14e5 100644 --- a/sd/source/core/drawdoc.cxx +++ b/sd/source/core/drawdoc.cxx @@ -171,8 +171,6 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh) , meDocType(eType) , mpCharClass(NULL) , mpLocale(NULL) -, mpDrawPageListWatcher(0) -, mpMasterPageListWatcher(0) , mbUseEmbedFonts(false) { mpDrawPageListWatcher.reset(new ImpDrawPageListWatcher(*this)); diff --git a/sd/source/filter/sdfilter.cxx b/sd/source/filter/sdfilter.cxx index 343edb5a3139..93678abf639d 100644 --- a/sd/source/filter/sdfilter.cxx +++ b/sd/source/filter/sdfilter.cxx @@ -68,7 +68,7 @@ extern "C" { static void SAL_CALL thisModule() {} } ::osl::Module* SdFilter::OpenLibrary( const OUString& rLibraryName ) const { - std::auto_ptr< osl::Module > mod(new osl::Module); + std::unique_ptr< osl::Module > mod(new osl::Module); return mod->loadRelative(&thisModule, ImplGetFullLibraryName(rLibraryName), SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY) ? mod.release() : 0; diff --git a/sd/source/ui/accessibility/AccessibleOutlineView.cxx b/sd/source/ui/accessibility/AccessibleOutlineView.cxx index a347f9cd0c63..1dca0337b0b9 100644 --- a/sd/source/ui/accessibility/AccessibleOutlineView.cxx +++ b/sd/source/ui/accessibility/AccessibleOutlineView.cxx @@ -64,7 +64,7 @@ AccessibleOutlineView::AccessibleOutlineView ( const uno::Reference<frame::XController>& rxController, const uno::Reference<XAccessible>& rxParent) : AccessibleDocumentViewBase (pSdWindow, pViewShell, rxController, rxParent), - maTextHelper( ::std::auto_ptr< SvxEditSource >( NULL ) ) + maTextHelper( ::std::unique_ptr< SvxEditSource >() ) { SolarMutexGuard aGuard; diff --git a/sd/source/ui/annotations/annotationtag.hxx b/sd/source/ui/annotations/annotationtag.hxx index 97dda94438db..96085f253fcb 100644 --- a/sd/source/ui/annotations/annotationtag.hxx +++ b/sd/source/ui/annotations/annotationtag.hxx @@ -79,7 +79,7 @@ protected: private: AnnotationManagerImpl& mrManager; css::uno::Reference< css::office::XAnnotation > mxAnnotation; - std::auto_ptr<AnnotationWindow> mpAnnotationWindow; + std::unique_ptr<AnnotationWindow> mpAnnotationWindow; Color maColor; int mnIndex; const ::vcl::Font& mrFont; diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx index f822c0960c90..b5c6d0852183 100644 --- a/sd/source/ui/dlg/dlgass.cxx +++ b/sd/source/ui/dlg/dlgass.cxx @@ -195,7 +195,7 @@ public: SfxObjectShellLock xDocShell; - ::std::auto_ptr<WindowUpdater> mpWindowUpdater; + ::std::unique_ptr<WindowUpdater> mpWindowUpdater; bool mbPreview; sal_uInt16 mnShowPage; diff --git a/sd/source/ui/framework/factories/BasicPaneFactory.cxx b/sd/source/ui/framework/factories/BasicPaneFactory.cxx index 5d3aa53ac941..0099542928d8 100644 --- a/sd/source/ui/framework/factories/BasicPaneFactory.cxx +++ b/sd/source/ui/framework/factories/BasicPaneFactory.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <utility> + #include "BasicPaneFactory.hxx" #include "facreg.hxx" @@ -409,9 +413,7 @@ Reference<XResource> BasicPaneFactory::CreateChildWindowPane ( { // Create the corresponding shell and determine the id of the child window. sal_uInt16 nChildWindowId = 0; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<SfxShell> pShell; - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<SfxShell> pShell; switch (rDescriptor.mePaneId) { case LeftImpressPaneId: @@ -436,7 +438,7 @@ Reference<XResource> BasicPaneFactory::CreateChildWindowPane ( rxPaneId, nChildWindowId, *mpViewShellBase, - pShell); + std::move(pShell)); } } diff --git a/sd/source/ui/framework/factories/ChildWindowPane.cxx b/sd/source/ui/framework/factories/ChildWindowPane.cxx index c08c590db1ee..f69ea2644bfb 100644 --- a/sd/source/ui/framework/factories/ChildWindowPane.cxx +++ b/sd/source/ui/framework/factories/ChildWindowPane.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <utility> + #include "ChildWindowPane.hxx" #include "PaneDockingWindow.hxx" @@ -37,11 +41,11 @@ ChildWindowPane::ChildWindowPane ( const Reference<XResourceId>& rxPaneId, sal_uInt16 nChildWindowId, ViewShellBase& rViewShellBase, - ::std::auto_ptr<SfxShell> pShell) + ::std::unique_ptr<SfxShell> && pShell) : ChildWindowPaneInterfaceBase(rxPaneId,(vcl::Window*)NULL), mnChildWindowId(nChildWindowId), mrViewShellBase(rViewShellBase), - mpShell(pShell), + mpShell(std::move(pShell)), mbHasBeenActivated(false) { mrViewShellBase.GetViewShellManager()->ActivateShell(mpShell.get()); diff --git a/sd/source/ui/framework/factories/ChildWindowPane.hxx b/sd/source/ui/framework/factories/ChildWindowPane.hxx index 72d42a51562d..a4725002bbdc 100644 --- a/sd/source/ui/framework/factories/ChildWindowPane.hxx +++ b/sd/source/ui/framework/factories/ChildWindowPane.hxx @@ -56,7 +56,7 @@ public: ::com::sun::star::drawing::framework::XResourceId>& rxPaneId, sal_uInt16 nChildWindowId, ViewShellBase& rViewShellBase, - ::std::auto_ptr<SfxShell> pShell); + ::std::unique_ptr<SfxShell> && pShell); virtual ~ChildWindowPane (void); /** Hide the pane. To make the pane visible again, call GetWindow(). @@ -94,7 +94,7 @@ private: ::com::sun::star::uno::Reference<com::sun::star::drawing::framework::XResourceId> mxPaneId; sal_uInt16 mnChildWindowId; ViewShellBase& mrViewShellBase; - ::std::auto_ptr<SfxShell> mpShell; + ::std::unique_ptr<SfxShell> mpShell; /** This flag is set when the pane shell has been activated at least once. It is used to optimize the start-up performance (by not diff --git a/sd/source/ui/inc/AccessibleSlideSorterView.hxx b/sd/source/ui/inc/AccessibleSlideSorterView.hxx index 89f606efbe9d..5d20cd2b0d50 100644 --- a/sd/source/ui/inc/AccessibleSlideSorterView.hxx +++ b/sd/source/ui/inc/AccessibleSlideSorterView.hxx @@ -288,7 +288,7 @@ public: virtual void SwitchViewActivated (void); private: class Implementation; - ::std::auto_ptr<Implementation> mpImpl; + ::std::unique_ptr<Implementation> mpImpl; ::sd::slidesorter::SlideSorter& mrSlideSorter; diff --git a/sd/source/ui/inc/DrawController.hxx b/sd/source/ui/inc/DrawController.hxx index 4c5cb0ec5154..5f1a5dc1bb70 100644 --- a/sd/source/ui/inc/DrawController.hxx +++ b/sd/source/ui/inc/DrawController.hxx @@ -306,7 +306,7 @@ private: */ bool mbDisposing; - ::std::auto_ptr< ::cppu::IPropertyArrayHelper> mpPropertyArrayHelper; + ::std::unique_ptr< ::cppu::IPropertyArrayHelper> mpPropertyArrayHelper; /** The current sub controller. May be NULL. */ diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx index 967c7e3ce1e5..42fbabe36d6a 100644 --- a/sd/source/ui/inc/DrawViewShell.hxx +++ b/sd/source/ui/inc/DrawViewShell.hxx @@ -432,7 +432,7 @@ private: content that are supported both by that content and by the DrawViewShell. */ - ::std::auto_ptr<SvxClipboardFmtItem> mpCurrentClipboardFormats; + ::std::unique_ptr<SvxClipboardFmtItem> mpCurrentClipboardFormats; /** On some occasions it is necessary to make SwitchPage calls asynchronously. @@ -504,8 +504,8 @@ private: using ViewShell::Notify; - ::std::auto_ptr< AnnotationManager > mpAnnotationManager; - ::std::auto_ptr< ViewOverlayManager > mpViewOverlayManager; + ::std::unique_ptr< AnnotationManager > mpAnnotationManager; + ::std::unique_ptr< ViewOverlayManager > mpViewOverlayManager; }; } // end of namespace sd diff --git a/sd/source/ui/inc/EventMultiplexer.hxx b/sd/source/ui/inc/EventMultiplexer.hxx index 7b8cab5d3660..f7cb8088a5af 100644 --- a/sd/source/ui/inc/EventMultiplexer.hxx +++ b/sd/source/ui/inc/EventMultiplexer.hxx @@ -205,7 +205,7 @@ public: private: class Implementation; - ::std::auto_ptr<Implementation> mpImpl; + ::std::unique_ptr<Implementation> mpImpl; }; } } // end of namespace ::sd::tools diff --git a/sd/source/ui/inc/MasterPageObserver.hxx b/sd/source/ui/inc/MasterPageObserver.hxx index b10b4de17712..0c8d7f657d65 100644 --- a/sd/source/ui/inc/MasterPageObserver.hxx +++ b/sd/source/ui/inc/MasterPageObserver.hxx @@ -75,7 +75,7 @@ private: static ::osl::Mutex maMutex; class Implementation; - ::std::auto_ptr<Implementation> mpImpl; + ::std::unique_ptr<Implementation> mpImpl; MasterPageObserver (void); virtual ~MasterPageObserver (void); diff --git a/sd/source/ui/inc/OutlineView.hxx b/sd/source/ui/inc/OutlineView.hxx index fb80a355f9b2..91b678fdcd2a 100644 --- a/sd/source/ui/inc/OutlineView.hxx +++ b/sd/source/ui/inc/OutlineView.hxx @@ -209,7 +209,7 @@ private: DECL_LINK(EventMultiplexerListener, sd::tools::EventMultiplexerEvent*); /** holds a model guard during drag and drop between BeginMovingHdl and EndMovingHdl */ - std::auto_ptr< OutlineViewModelChangeGuard > maDragAndDropModelGuard; + std::unique_ptr< OutlineViewModelChangeGuard > maDragAndDropModelGuard; ::vcl::Font maPageNumberFont; ::vcl::Font maBulletFont; diff --git a/sd/source/ui/inc/PreviewRenderer.hxx b/sd/source/ui/inc/PreviewRenderer.hxx index 86442f152cc7..515918491b3c 100644 --- a/sd/source/ui/inc/PreviewRenderer.hxx +++ b/sd/source/ui/inc/PreviewRenderer.hxx @@ -126,8 +126,8 @@ protected: virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) SAL_OVERRIDE; private: - ::std::auto_ptr<VirtualDevice> mpPreviewDevice; - ::std::auto_ptr<DrawView> mpView; + ::std::unique_ptr<VirtualDevice> mpPreviewDevice; + ::std::unique_ptr<DrawView> mpView; DrawDocShell* mpDocShellOfView; const Color maFrameColor; const bool mbHasFrame; diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx index 936ae4786c1a..6714daefaacc 100644 --- a/sd/source/ui/inc/View.hxx +++ b/sd/source/ui/inc/View.hxx @@ -291,7 +291,7 @@ protected: SmartTagSet maSmartTags; private: - ::std::auto_ptr<ViewClipboard> mpClipboard; + ::std::unique_ptr<ViewClipboard> mpClipboard; OutlinerMasterViewFilter maMasterViewFilter; }; diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx index fc909a389388..74e2bd254227 100644 --- a/sd/source/ui/inc/ViewShell.hxx +++ b/sd/source/ui/inc/ViewShell.hxx @@ -465,18 +465,14 @@ protected: ::boost::shared_ptr<ScrollBar> mpHorizontalScrollBar; /// Vertical scroll bar for whole document is always visible. ::boost::shared_ptr<ScrollBar> mpVerticalScrollBar; - SAL_WNODEPRECATED_DECLARATIONS_PUSH /// Horizontal ruler is not shown by default. - ::std::auto_ptr<SvxRuler> mpHorizontalRuler; + ::std::unique_ptr<SvxRuler> mpHorizontalRuler; /// Vertical ruler is not shown by default. - ::std::auto_ptr<SvxRuler> mpVerticalRuler; - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<SvxRuler> mpVerticalRuler; /// Filler of the little square enclosed by the two scroll bars. ::boost::shared_ptr<ScrollBarBox> mpScrollBarBox; /// Layer tab bar. - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<LayerTabBar> mpLayerTabBar; - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<LayerTabBar> mpLayerTabBar; /// This flag controls whether the rulers are visible. bool mbHasRulers; @@ -516,9 +512,7 @@ protected: /// The type of the shell. Returned by GetShellType(). ShellType meShellType; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<Implementation> mpImpl; - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<Implementation> mpImpl; // Support methods for centralized UNDO/REDO virtual ::svl::IUndoManager* ImpGetUndoManager (void) const; @@ -573,9 +567,7 @@ private: with reference to the digit langugage used to display digits in text shapes. */ - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr< ::sd::WindowUpdater> mpWindowUpdater; - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr< ::sd::WindowUpdater> mpWindowUpdater; /** Code common to all constructors. It generally is a bad idea to call this function from outside a constructor. diff --git a/sd/source/ui/inc/ViewShellImplementation.hxx b/sd/source/ui/inc/ViewShellImplementation.hxx index 5ae4dbc47328..a98a89f1dcbd 100644 --- a/sd/source/ui/inc/ViewShellImplementation.hxx +++ b/sd/source/ui/inc/ViewShellImplementation.hxx @@ -76,7 +76,7 @@ public: void Release (bool bForce = false); DECL_LINK(TimeoutCallback, void *); private: - ::std::auto_ptr<ToolBarManager::UpdateLock> mpLock; + ::std::unique_ptr<ToolBarManager::UpdateLock> mpLock; /** The timer is used both as a safe guard to unlock the update lock when Release() is not called explicitly. It is also used to defer the release of the lock to a time when the UI is not @@ -94,7 +94,7 @@ public: class Deleter; friend class Deleter; }; - // The member is not an auto_ptr because it takes over its own life time + // The member is not a unqiue_ptr because it takes over its own life time // control. ::boost::weak_ptr<ToolBarManagerLock> mpUpdateLockForMouse; diff --git a/sd/source/ui/inc/ViewShellManager.hxx b/sd/source/ui/inc/ViewShellManager.hxx index ac8bbfb3b2a1..a88408ff27e3 100644 --- a/sd/source/ui/inc/ViewShellManager.hxx +++ b/sd/source/ui/inc/ViewShellManager.hxx @@ -179,7 +179,7 @@ public: private: class Implementation; - ::std::auto_ptr<ViewShellManager::Implementation> mpImpl; + ::std::unique_ptr<ViewShellManager::Implementation> mpImpl; bool mbValid; void LockUpdate (void); diff --git a/sd/source/ui/inc/filedlg.hxx b/sd/source/ui/inc/filedlg.hxx index 37c60fb93b62..232752216c07 100644 --- a/sd/source/ui/inc/filedlg.hxx +++ b/sd/source/ui/inc/filedlg.hxx @@ -38,7 +38,7 @@ class SdFileDialog_Imp; */ class SD_DLLPUBLIC SdOpenSoundFileDialog { - const std::auto_ptr< SdFileDialog_Imp > mpImpl; + const std::unique_ptr< SdFileDialog_Imp > mpImpl; // forbidden and not implemented SdOpenSoundFileDialog (const SdOpenSoundFileDialog &); diff --git a/sd/source/ui/inc/taskpane/ControlContainer.hxx b/sd/source/ui/inc/taskpane/ControlContainer.hxx index f0b5e2ba9e77..f9901e26c289 100644 --- a/sd/source/ui/inc/taskpane/ControlContainer.hxx +++ b/sd/source/ui/inc/taskpane/ControlContainer.hxx @@ -74,7 +74,7 @@ public: the container. It is the same index that is returned by GetControlIndex(). */ - sal_uInt32 AddControl (::std::auto_ptr<TreeNode> pControl); + sal_uInt32 AddControl (::std::unique_ptr<TreeNode> && pControl); /** Expand (default) or collapse the specified control. When expanding a control in a single expansion environment then all diff --git a/sd/source/ui/inc/taskpane/ScrollPanel.hxx b/sd/source/ui/inc/taskpane/ScrollPanel.hxx index a57cdfb851ea..77daddd51e4c 100644 --- a/sd/source/ui/inc/taskpane/ScrollPanel.hxx +++ b/sd/source/ui/inc/taskpane/ScrollPanel.hxx @@ -66,13 +66,13 @@ public: title bar as children is returned. */ TitledControl* AddControl ( - ::std::auto_ptr<TreeNode> pControl, + ::std::unique_ptr<TreeNode> && pControl, const OUString& rTitle, const OString& sHelpId); /** Add a control to the sub panel without a title bar. */ - void AddControl (::std::auto_ptr<TreeNode> pControl); + void AddControl (::std::unique_ptr<TreeNode> && pControl); virtual void Paint (const Rectangle& rRect); diff --git a/sd/source/ui/inc/taskpane/TaskPaneControlFactory.hxx b/sd/source/ui/inc/taskpane/TaskPaneControlFactory.hxx index d80f5c49683e..61d6bf6db578 100644 --- a/sd/source/ui/inc/taskpane/TaskPaneControlFactory.hxx +++ b/sd/source/ui/inc/taskpane/TaskPaneControlFactory.hxx @@ -47,7 +47,7 @@ public: Derived classes should overload InternalCreateControl. */ - ::std::auto_ptr<TreeNode> CreateControl( vcl::Window& i_rParent ); + ::std::unique_ptr<TreeNode> CreateControl( vcl::Window& i_rParent ); protected: virtual TreeNode* InternalCreateControl( vcl::Window& i_rParent ) = 0; diff --git a/sd/source/ui/inc/taskpane/TaskPaneTreeNode.hxx b/sd/source/ui/inc/taskpane/TaskPaneTreeNode.hxx index 96121085cd98..797b7545a3fc 100644 --- a/sd/source/ui/inc/taskpane/TaskPaneTreeNode.hxx +++ b/sd/source/ui/inc/taskpane/TaskPaneTreeNode.hxx @@ -168,7 +168,7 @@ public: TreeNode* pChild = NULL) const; protected: - ::std::auto_ptr<ControlContainer> mpControlContainer; + ::std::unique_ptr<ControlContainer> mpControlContainer; private: TreeNode* mpParent; diff --git a/sd/source/ui/inc/taskpane/TitleBar.hxx b/sd/source/ui/inc/taskpane/TitleBar.hxx index d6910acfbebc..05f34c540cf7 100644 --- a/sd/source/ui/inc/taskpane/TitleBar.hxx +++ b/sd/source/ui/inc/taskpane/TitleBar.hxx @@ -94,9 +94,7 @@ private: bool mbExpanded; bool mbFocused; // Size of the bounding box that encloses the title string. - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<VirtualDevice> mpDevice; - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<VirtualDevice> mpDevice; bool mbIsExpandable; /** Return whether this TitleBar object has an expansion indicator diff --git a/sd/source/ui/inc/taskpane/TitledControl.hxx b/sd/source/ui/inc/taskpane/TitledControl.hxx index 6282a549a6a7..bf1e183ac519 100644 --- a/sd/source/ui/inc/taskpane/TitledControl.hxx +++ b/sd/source/ui/inc/taskpane/TitledControl.hxx @@ -63,7 +63,7 @@ public: */ TitledControl ( TreeNode* pParent, - ::std::auto_ptr<TreeNode> pControl, + ::std::unique_ptr<TreeNode> pControl, const OUString& rTitle, const ClickHandler& rClickHandler, TitleBar::TitleBarType eType); @@ -128,7 +128,7 @@ private: OUString msTitle; bool mbVisible; void* mpUserData; - ::std::auto_ptr<ClickHandler> mpClickHandler; + ::std::unique_ptr<ClickHandler> mpClickHandler; /// Do not use! Assignment operator is not supported. const TitledControl& operator= ( diff --git a/sd/source/ui/inc/taskpane/ToolPanelViewShell.hxx b/sd/source/ui/inc/taskpane/ToolPanelViewShell.hxx index 894f5d5bad50..522deeb59f67 100644 --- a/sd/source/ui/inc/taskpane/ToolPanelViewShell.hxx +++ b/sd/source/ui/inc/taskpane/ToolPanelViewShell.hxx @@ -137,7 +137,7 @@ private: According to this flag one of the lock/unlock entries is made disabled. */ - ::std::auto_ptr<PopupMenu> CreatePopupMenu (bool bIsDocking); + ::std::unique_ptr<PopupMenu> CreatePopupMenu (bool bIsDocking); /** Initialize the task pane view shell if that has not yet been done before. If mbIsInitialized is already set to <TRUE/> then this diff --git a/sd/source/ui/inc/tools/AsynchronousCall.hxx b/sd/source/ui/inc/tools/AsynchronousCall.hxx index 6aac74f50986..c6d101d01257 100644 --- a/sd/source/ui/inc/tools/AsynchronousCall.hxx +++ b/sd/source/ui/inc/tools/AsynchronousCall.hxx @@ -73,7 +73,7 @@ private: /** The function object that will be executed when the TimerCallback function is called the next time. This pointer may be NULL. */ - ::std::auto_ptr<AsynchronousFunction> mpFunction; + ::std::unique_ptr<AsynchronousFunction> mpFunction; DECL_LINK(TimerCallback,Timer*); }; diff --git a/sd/source/ui/inc/tools/IconCache.hxx b/sd/source/ui/inc/tools/IconCache.hxx index a39e1de01e00..3ef8bc7dc2bb 100644 --- a/sd/source/ui/inc/tools/IconCache.hxx +++ b/sd/source/ui/inc/tools/IconCache.hxx @@ -53,7 +53,7 @@ public: private: class Implementation; - ::std::auto_ptr<Implementation> mpImpl; + ::std::unique_ptr<Implementation> mpImpl; /** The constructor creates the one instance of the cache and registers it at the SdGlobalResourceContainer to limit is lifetime to that of diff --git a/sd/source/ui/inc/tools/SdGlobalResourceContainer.hxx b/sd/source/ui/inc/tools/SdGlobalResourceContainer.hxx index 6117c17237fd..65e1065a1a35 100644 --- a/sd/source/ui/inc/tools/SdGlobalResourceContainer.hxx +++ b/sd/source/ui/inc/tools/SdGlobalResourceContainer.hxx @@ -66,7 +66,7 @@ public: When in doubt, use the shared_ptr variant of this method. */ - void AddResource (::std::auto_ptr<SdGlobalResource> pResource); + void AddResource (::std::unique_ptr<SdGlobalResource> && pResource); /** Add a resource to the container. By using a shared_ptr and releasing it only when the SgGlobalResourceContainer is destroyed @@ -84,12 +84,10 @@ public: protected: friend class ::SdModule; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - friend class ::std::auto_ptr<SdGlobalResourceContainer>; - SAL_WNODEPRECATED_DECLARATIONS_POP + friend struct ::std::default_delete<SdGlobalResourceContainer>; class Implementation; - ::std::auto_ptr<Implementation> mpImpl; + ::std::unique_ptr<Implementation> mpImpl; SdGlobalResourceContainer (void); ~SdGlobalResourceContainer (void); diff --git a/sd/source/ui/sidebar/AllMasterPagesSelector.hxx b/sd/source/ui/sidebar/AllMasterPagesSelector.hxx index 0ce98e24ada6..346411809ba7 100644 --- a/sd/source/ui/sidebar/AllMasterPagesSelector.hxx +++ b/sd/source/ui/sidebar/AllMasterPagesSelector.hxx @@ -56,7 +56,7 @@ private: /** The list of master pages displayed by this class. */ class SortedMasterPageDescriptorList; - ::std::auto_ptr<SortedMasterPageDescriptorList> mpSortedMasterPages; + ::std::unique_ptr<SortedMasterPageDescriptorList> mpSortedMasterPages; AllMasterPagesSelector ( vcl::Window* pParent, diff --git a/sd/source/ui/sidebar/MasterPageContainer.cxx b/sd/source/ui/sidebar/MasterPageContainer.cxx index 657e0217b6d1..dae5dffdc231 100644 --- a/sd/source/ui/sidebar/MasterPageContainer.cxx +++ b/sd/source/ui/sidebar/MasterPageContainer.cxx @@ -27,6 +27,7 @@ #include "strings.hrc" #include <algorithm> #include <list> +#include <memory> #include <set> #include "unomodel.hxx" @@ -684,7 +685,7 @@ MasterPageContainer::Token MasterPageContainer::Implementation::PutMasterPage ( { // Update an existing MasterPageDescriptor. aResult = (*aEntry)->maToken; - boost::scoped_ptr<std::vector<MasterPageContainerChangeEvent::EventType> > pEventTypes( + std::unique_ptr<std::vector<MasterPageContainerChangeEvent::EventType> > pEventTypes( (*aEntry)->Update(*rpDescriptor)); if (pEventTypes.get()!=NULL && pEventTypes->size()>0) { diff --git a/sd/source/ui/sidebar/MasterPageContainerFiller.hxx b/sd/source/ui/sidebar/MasterPageContainerFiller.hxx index 31c44dcf4538..d6229edd36bc 100644 --- a/sd/source/ui/sidebar/MasterPageContainerFiller.hxx +++ b/sd/source/ui/sidebar/MasterPageContainerFiller.hxx @@ -77,7 +77,7 @@ private: ERROR, DONE } meState; - ::std::auto_ptr<TemplateScanner> mpScannerTask; + ::std::unique_ptr<TemplateScanner> mpScannerTask; const TemplateEntry* mpLastAddedEntry; int mnIndex; diff --git a/sd/source/ui/sidebar/MasterPageDescriptor.cxx b/sd/source/ui/sidebar/MasterPageDescriptor.cxx index d4a18755d5b7..5ec98d9ff3bb 100644 --- a/sd/source/ui/sidebar/MasterPageDescriptor.cxx +++ b/sd/source/ui/sidebar/MasterPageDescriptor.cxx @@ -90,8 +90,7 @@ Image MasterPageDescriptor::GetPreview (MasterPageContainer::PreviewSize eSize) return maLargePreview; } -SAL_WNODEPRECATED_DECLARATIONS_PUSH -::std::auto_ptr<std::vector<MasterPageContainerChangeEvent::EventType> > +::std::unique_ptr<std::vector<MasterPageContainerChangeEvent::EventType> > MasterPageDescriptor::Update ( const MasterPageDescriptor& rDescriptor) { @@ -143,7 +142,7 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH } // Prepare the list of event types that will be returned. - ::std::auto_ptr<std::vector<MasterPageContainerChangeEvent::EventType> > pResult; + ::std::unique_ptr<std::vector<MasterPageContainerChangeEvent::EventType> > pResult; if (bDataChanged || bIndexChanged || bPreviewChanged) { pResult.reset(new std::vector<MasterPageContainerChangeEvent::EventType>()); @@ -157,7 +156,6 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH return pResult; } -SAL_WNODEPRECATED_DECLARATIONS_POP int MasterPageDescriptor::UpdatePageObject ( sal_Int32 nCostThreshold, diff --git a/sd/source/ui/sidebar/MasterPageDescriptor.hxx b/sd/source/ui/sidebar/MasterPageDescriptor.hxx index 28a52ec7a54c..c77b2197cda8 100644 --- a/sd/source/ui/sidebar/MasterPageDescriptor.hxx +++ b/sd/source/ui/sidebar/MasterPageDescriptor.hxx @@ -59,7 +59,7 @@ public: Returns a list of event types for which event notifications have to be sent to listeners. The list may be empty or NULL. */ - ::std::auto_ptr<std::vector<MasterPageContainerChangeEvent::EventType> > + ::std::unique_ptr<std::vector<MasterPageContainerChangeEvent::EventType> > Update ( const MasterPageDescriptor& rDescriptor); diff --git a/sd/source/ui/sidebar/MasterPageObserver.cxx b/sd/source/ui/sidebar/MasterPageObserver.cxx index 4751635b10b1..bec5042642e8 100644 --- a/sd/source/ui/sidebar/MasterPageObserver.cxx +++ b/sd/source/ui/sidebar/MasterPageObserver.cxx @@ -102,7 +102,7 @@ MasterPageObserver& MasterPageObserver::Instance (void) { MasterPageObserver* pInstance = new MasterPageObserver (); SdGlobalResourceContainer::Instance().AddResource ( - ::std::auto_ptr<SdGlobalResource>(pInstance)); + ::std::unique_ptr<SdGlobalResource>(pInstance)); OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER(); Implementation::mpInstance = pInstance; } diff --git a/sd/source/ui/sidebar/MasterPagesSelector.cxx b/sd/source/ui/sidebar/MasterPagesSelector.cxx index e198b0f681c9..b233c1598ed6 100644 --- a/sd/source/ui/sidebar/MasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <utility> + #include "MasterPagesSelector.hxx" #include "MasterPageContainer.hxx" @@ -163,12 +167,12 @@ void MasterPagesSelector::UpdateLocks (const ItemList& rItemList) void MasterPagesSelector::Fill (void) { - ::std::auto_ptr<ItemList> pItemList (new ItemList()); + ::std::unique_ptr<ItemList> pItemList (new ItemList()); Fill(*pItemList); UpdateLocks(*pItemList); - UpdateItemList(pItemList); + UpdateItemList(std::move(pItemList)); } ResId MasterPagesSelector::GetContextMenuResId (void) const @@ -683,7 +687,7 @@ void MasterPagesSelector::InvalidateItem (MasterPageContainer::Token aToken) } SAL_WNODEPRECATED_DECLARATIONS_PUSH -void MasterPagesSelector::UpdateItemList (::std::auto_ptr<ItemList> pNewItemList) +void MasterPagesSelector::UpdateItemList (::std::unique_ptr<ItemList> && pNewItemList) { const ::osl::MutexGuard aGuard (maMutex); diff --git a/sd/source/ui/sidebar/MasterPagesSelector.hxx b/sd/source/ui/sidebar/MasterPagesSelector.hxx index 1d9097f9d4c3..c64a103be368 100644 --- a/sd/source/ui/sidebar/MasterPagesSelector.hxx +++ b/sd/source/ui/sidebar/MasterPagesSelector.hxx @@ -170,7 +170,7 @@ protected: virtual sal_Int32 GetIndexForToken (MasterPageContainer::Token aToken) const; typedef ::std::vector<MasterPageContainer::Token> ItemList; - void UpdateItemList (::std::auto_ptr<ItemList> pList); + void UpdateItemList (::std::unique_ptr<ItemList> && pList); void Clear (void); /** Invalidate the specified item so that on the next Fill() this item is updated. diff --git a/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx b/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx index c7e295ec6040..235ddb884e3b 100644 --- a/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx +++ b/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx @@ -76,7 +76,7 @@ RecentlyUsedMasterPages& RecentlyUsedMasterPages::Instance (void) RecentlyUsedMasterPages* pInstance = new RecentlyUsedMasterPages(); pInstance->LateInit(); SdGlobalResourceContainer::Instance().AddResource ( - ::std::auto_ptr<SdGlobalResource>(pInstance)); + ::std::unique_ptr<SdGlobalResource>(pInstance)); OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER(); mpInstance = pInstance; } diff --git a/sd/source/ui/sidebar/SidebarFocusManager.hxx b/sd/source/ui/sidebar/SidebarFocusManager.hxx index 6fde5d417695..b20e06e01a8f 100644 --- a/sd/source/ui/sidebar/SidebarFocusManager.hxx +++ b/sd/source/ui/sidebar/SidebarFocusManager.hxx @@ -98,7 +98,7 @@ private: friend struct FocusManagerCreator; class LinkMap; - ::std::auto_ptr<LinkMap> mpLinks; + ::std::unqiue_ptr<LinkMap> mpLinks; FocusManager (void); ~FocusManager (void); diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx b/sd/source/ui/slideshow/slideshowimpl.hxx index 901f09e45529..22eb6fc657a5 100644 --- a/sd/source/ui/slideshow/slideshowimpl.hxx +++ b/sd/source/ui/slideshow/slideshowimpl.hxx @@ -390,7 +390,7 @@ private: css::uno::Reference< css::media::XPlayer > mxPlayer; - ::std::auto_ptr<PaneHider> mpPaneHider; + ::std::unique_ptr<PaneHider> mpPaneHider; ImplSVEvent * mnEndShowEvent; ImplSVEvent * mnContextMenuEvent; diff --git a/sd/source/ui/slideshow/slideshowviewimpl.hxx b/sd/source/ui/slideshow/slideshowviewimpl.hxx index 0bfd22ce9228..f17f477e34a4 100644 --- a/sd/source/ui/slideshow/slideshowviewimpl.hxx +++ b/sd/source/ui/slideshow/slideshowviewimpl.hxx @@ -114,7 +114,7 @@ protected: ::osl::Mutex& mrMutex; }; -typedef ::std::auto_ptr< SlideShowViewListeners > SlideShowViewListenersPtr; +typedef ::std::unique_ptr< SlideShowViewListeners > SlideShowViewListenersPtr; // SlideShowViewPaintListeners typedef ::comphelper::OListenerContainerBase< ::com::sun::star::awt::XPaintListener, @@ -128,7 +128,7 @@ public: protected: virtual bool implTypedNotify( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& rListener, const ::com::sun::star::awt::PaintEvent& rEvent ) throw( ::com::sun::star::uno::Exception ) SAL_OVERRIDE; }; -typedef ::std::auto_ptr< SlideShowViewPaintListeners > SlideShowViewPaintListenersPtr; +typedef ::std::unique_ptr< SlideShowViewPaintListeners > SlideShowViewPaintListenersPtr; // SlideShowViewMouseListeners typedef ::comphelper::OListenerContainerBase< ::com::sun::star::awt::XMouseListener, WrappedMouseEvent > SlideShowViewMouseListeners_Base; @@ -143,7 +143,7 @@ protected: const WrappedMouseEvent& rEvent ) throw( ::com::sun::star::uno::Exception ) SAL_OVERRIDE; }; -typedef ::std::auto_ptr< SlideShowViewMouseListeners > SlideShowViewMouseListenersPtr; +typedef ::std::unique_ptr< SlideShowViewMouseListeners > SlideShowViewMouseListenersPtr; // SlideShowViewMouseMotionListeners typedef ::comphelper::OListenerContainerBase< ::com::sun::star::awt::XMouseMotionListener, @@ -158,7 +158,7 @@ protected: virtual bool implTypedNotify( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& rListener, const WrappedMouseMotionEvent& rEvent ) throw( ::com::sun::star::uno::Exception ) SAL_OVERRIDE; }; -typedef ::std::auto_ptr< SlideShowViewMouseMotionListeners > SlideShowViewMouseMotionListenersPtr; +typedef ::std::unique_ptr< SlideShowViewMouseMotionListeners > SlideShowViewMouseMotionListenersPtr; // SlideShowView class ShowWindow; diff --git a/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx b/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx index 34de47bc9495..e8b387244b80 100644 --- a/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx +++ b/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx @@ -376,8 +376,7 @@ void BitmapCache::Recycle (const BitmapCache& rCache) } } -SAL_WNODEPRECATED_DECLARATIONS_PUSH -::std::auto_ptr<BitmapCache::CacheIndex> BitmapCache::GetCacheIndex ( +::std::unique_ptr<BitmapCache::CacheIndex> BitmapCache::GetCacheIndex ( bool bIncludePrecious, bool bIncludeNoPreview) const { @@ -405,14 +404,13 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH ::std::sort(aSortedContainer.begin(), aSortedContainer.end(), AccessTimeComparator()); // Return a list with the keys of the sorted entries. - ::std::auto_ptr<CacheIndex> pIndex(new CacheIndex()); + ::std::unique_ptr<CacheIndex> pIndex(new CacheIndex()); SortableBitmapContainer::iterator iIndexEntry; pIndex->reserve(aSortedContainer.size()); for (iIndexEntry=aSortedContainer.begin(); iIndexEntry!=aSortedContainer.end(); ++iIndexEntry) pIndex->push_back(iIndexEntry->first); return pIndex; } -SAL_WNODEPRECATED_DECLARATIONS_POP void BitmapCache::Compress ( const CacheKey& rKey, diff --git a/sd/source/ui/slidesorter/cache/SlsBitmapCache.hxx b/sd/source/ui/slidesorter/cache/SlsBitmapCache.hxx index 4ccd2214ce65..e453e05a91c8 100644 --- a/sd/source/ui/slidesorter/cache/SlsBitmapCache.hxx +++ b/sd/source/ui/slidesorter/cache/SlsBitmapCache.hxx @@ -161,7 +161,7 @@ public: bitmaps are included in the index. When the flag is <FALSE/> these entries are omitted. */ - ::std::auto_ptr<CacheIndex> GetCacheIndex ( + ::std::unique_ptr<CacheIndex> GetCacheIndex ( bool bIncludePrecious, bool bIncludeNoPreview) const; @@ -203,7 +203,7 @@ private: /** The cache compactor is used to reduce the number of bytes used by off-screen preview bitmaps. */ - ::std::auto_ptr<CacheCompactor> mpCacheCompactor; + ::std::unique_ptr<CacheCompactor> mpCacheCompactor; /** This flag stores if the cache is or recently was full, i.e. the cache compactor has or had to be run in order to reduce the cache diff --git a/sd/source/ui/slidesorter/cache/SlsCacheCompactor.cxx b/sd/source/ui/slidesorter/cache/SlsCacheCompactor.cxx index 4217ba068660..0de992a6b0a4 100644 --- a/sd/source/ui/slidesorter/cache/SlsCacheCompactor.cxx +++ b/sd/source/ui/slidesorter/cache/SlsCacheCompactor.cxx @@ -77,8 +77,7 @@ private: namespace sd { namespace slidesorter { namespace cache { -SAL_WNODEPRECATED_DECLARATIONS_PUSH -::std::auto_ptr<CacheCompactor> CacheCompactor::Create ( +::std::unique_ptr<CacheCompactor> CacheCompactor::Create ( BitmapCache& rCache, sal_Int32 nMaximalCacheSize) { @@ -102,7 +101,7 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH else pCompressor.reset(new PngCompression()); - ::std::auto_ptr<CacheCompactor> pCompactor (NULL); + ::std::unique_ptr<CacheCompactor> pCompactor; OUString sCompactionPolicy(sCompress); Any aCompactionPolicy (CacheConfiguration::Instance()->GetValue("CompactionPolicy")); if (aCompactionPolicy.has<OUString>()) @@ -114,7 +113,6 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH return pCompactor; } -SAL_WNODEPRECATED_DECLARATIONS_POP void CacheCompactor::RequestCompaction (void) { @@ -174,10 +172,8 @@ void CacheCompactionByCompression::Run (void) { SAL_INFO("sd.sls", OSL_THIS_FUNC << ": bitmap cache uses to much space: " << mrCache.GetSize() << " > " << mnMaximalCacheSize); - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr< ::sd::slidesorter::cache::BitmapCache::CacheIndex> pIndex ( + ::std::unique_ptr< ::sd::slidesorter::cache::BitmapCache::CacheIndex> pIndex ( mrCache.GetCacheIndex(false,false)); - SAL_WNODEPRECATED_DECLARATIONS_POP ::sd::slidesorter::cache::BitmapCache::CacheIndex::iterator iIndex; for (iIndex=pIndex->begin(); iIndex!=pIndex->end(); ++iIndex) { diff --git a/sd/source/ui/slidesorter/cache/SlsCacheCompactor.hxx b/sd/source/ui/slidesorter/cache/SlsCacheCompactor.hxx index 2edf11717e4e..aab64e2fea21 100644 --- a/sd/source/ui/slidesorter/cache/SlsCacheCompactor.hxx +++ b/sd/source/ui/slidesorter/cache/SlsCacheCompactor.hxx @@ -52,11 +52,9 @@ public: under this number. However, it is not guaranteed that this works in all cases. */ - SAL_WNODEPRECATED_DECLARATIONS_PUSH - static ::std::auto_ptr<CacheCompactor> Create ( + static ::std::unique_ptr<CacheCompactor> Create ( BitmapCache& rCache, sal_Int32 nMaximalCacheSize); - SAL_WNODEPRECATED_DECLARATIONS_POP /** Request a compaction of the off-screen previews in the bitmap cache. This calls via a timer the Run() method. diff --git a/sd/source/ui/slidesorter/inc/cache/SlsPageCacheManager.hxx b/sd/source/ui/slidesorter/inc/cache/SlsPageCacheManager.hxx index 568b6eb4ee75..d093da56d010 100644 --- a/sd/source/ui/slidesorter/inc/cache/SlsPageCacheManager.hxx +++ b/sd/source/ui/slidesorter/inc/cache/SlsPageCacheManager.hxx @@ -113,11 +113,11 @@ private: /// List of active caches. class PageCacheContainer; - ::std::auto_ptr<PageCacheContainer> mpPageCaches; + ::std::unique_ptr<PageCacheContainer> mpPageCaches; /// List of inactive, recently used caches. class RecentlyUsedPageCaches; - ::std::auto_ptr<RecentlyUsedPageCaches> mpRecentlyUsedPageCaches; + ::std::unique_ptr<RecentlyUsedPageCaches> mpRecentlyUsedPageCaches; /** The maximal number of recently used caches that are kept alive after they have become inactive, i.e. after they are not used anymore by a diff --git a/sd/source/ui/slidesorter/inc/model/SlsEnumeration.hxx b/sd/source/ui/slidesorter/inc/model/SlsEnumeration.hxx index 546745c38988..b66a41285d08 100644 --- a/sd/source/ui/slidesorter/inc/model/SlsEnumeration.hxx +++ b/sd/source/ui/slidesorter/inc/model/SlsEnumeration.hxx @@ -38,7 +38,7 @@ public: */ virtual T GetNextElement (void) = 0; virtual void Rewind (void) = 0; - virtual ::std::auto_ptr<Enumeration<T> > Clone (void) = 0; + virtual ::std::unique_ptr<Enumeration<T> > Clone (void) = 0; }; } } } // end of namespace ::sd::slidesorter::model diff --git a/sd/source/ui/slidesorter/inc/model/SlsPageEnumeration.hxx b/sd/source/ui/slidesorter/inc/model/SlsPageEnumeration.hxx index 6f812c2a9822..959f9276dad9 100644 --- a/sd/source/ui/slidesorter/inc/model/SlsPageEnumeration.hxx +++ b/sd/source/ui/slidesorter/inc/model/SlsPageEnumeration.hxx @@ -80,9 +80,7 @@ public: /** Create and return an exact copy of the called object. */ - SAL_WNODEPRECATED_DECLARATIONS_PUSH - virtual ::std::auto_ptr<Enumeration<SharedPageDescriptor> > Clone (void) SAL_OVERRIDE; - SAL_WNODEPRECATED_DECLARATIONS_POP + virtual ::std::unique_ptr<Enumeration<SharedPageDescriptor> > Clone (void) SAL_OVERRIDE; PageEnumeration& operator= (const PageEnumeration& rEnumeration); @@ -105,16 +103,12 @@ public: private: /// Implementation object. - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<Enumeration<SharedPageDescriptor> > mpImpl; - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<Enumeration<SharedPageDescriptor> > mpImpl; /** This constructor expects an implementation object that holds the predicate that filters the pages. */ - SAL_WNODEPRECATED_DECLARATIONS_PUSH - PageEnumeration (::std::auto_ptr<Enumeration<SharedPageDescriptor> > pImpl); - SAL_WNODEPRECATED_DECLARATIONS_POP + PageEnumeration (::std::unique_ptr<Enumeration<SharedPageDescriptor> > && pImpl); // Default constructor not implemented. PageEnumeration (void); diff --git a/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx b/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx index 048c05bca25d..0816c1822f7f 100644 --- a/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx +++ b/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx @@ -241,7 +241,7 @@ private: SlideSorter& mrSlideSorter; model::SlideSorterModel& mrModel; bool mbIsDisposed; - ::std::auto_ptr<Layouter> mpLayouter; + ::std::unique_ptr<Layouter> mpLayouter; bool mbPageObjectVisibilitiesValid; ::boost::shared_ptr<cache::PageCache> mpPreviewCache; ::boost::shared_ptr<LayeredDevice> mpLayeredDevice; diff --git a/sd/source/ui/slidesorter/model/SlsPageEnumeration.cxx b/sd/source/ui/slidesorter/model/SlsPageEnumeration.cxx index f0086e7a871e..b769ce736919 100644 --- a/sd/source/ui/slidesorter/model/SlsPageEnumeration.cxx +++ b/sd/source/ui/slidesorter/model/SlsPageEnumeration.cxx @@ -19,6 +19,8 @@ #include <sal/config.h> +#include <utility> + #include <boost/noncopyable.hpp> #include "model/SlideSorterModel.hxx" @@ -39,9 +41,7 @@ public: virtual ~PageEnumerationImpl (void); /** Create a copy of the called enumeration object. */ - SAL_WNODEPRECATED_DECLARATIONS_PUSH - virtual ::std::auto_ptr<Enumeration<SharedPageDescriptor> > Clone (void) SAL_OVERRIDE; - SAL_WNODEPRECATED_DECLARATIONS_POP + virtual ::std::unique_ptr<Enumeration<SharedPageDescriptor> > Clone (void) SAL_OVERRIDE; virtual bool HasMoreElements (void) const SAL_OVERRIDE; virtual SharedPageDescriptor GetNextElement (void) SAL_OVERRIDE; @@ -71,23 +71,19 @@ private: namespace sd { namespace slidesorter { namespace model { -SAL_WNODEPRECATED_DECLARATIONS_PUSH PageEnumeration PageEnumeration::Create ( const SlideSorterModel& rModel, const PagePredicate& rPredicate) { - return PageEnumeration(::std::auto_ptr<Enumeration<SharedPageDescriptor> >( + return PageEnumeration(::std::unique_ptr<Enumeration<SharedPageDescriptor> >( new PageEnumerationImpl(rModel, rPredicate))); } -SAL_WNODEPRECATED_DECLARATIONS_POP -SAL_WNODEPRECATED_DECLARATIONS_PUSH PageEnumeration::PageEnumeration ( - ::std::auto_ptr<Enumeration<SharedPageDescriptor> > pImpl) - : mpImpl(pImpl) + ::std::unique_ptr<Enumeration<SharedPageDescriptor> > && pImpl) + : mpImpl(std::move(pImpl)) { } -SAL_WNODEPRECATED_DECLARATIONS_POP PageEnumeration::PageEnumeration ( PageEnumeration& rEnumeration, @@ -100,7 +96,7 @@ PageEnumeration::PageEnumeration ( } else { - mpImpl = rEnumeration.mpImpl; + mpImpl = std::move(rEnumeration.mpImpl); } } @@ -121,13 +117,11 @@ PageEnumeration& PageEnumeration::operator= ( return *this; } -SAL_WNODEPRECATED_DECLARATIONS_PUSH -::std::auto_ptr<Enumeration<SharedPageDescriptor> > PageEnumeration::Clone (void) +::std::unique_ptr<Enumeration<SharedPageDescriptor> > PageEnumeration::Clone (void) { - return ::std::auto_ptr<Enumeration<SharedPageDescriptor> >( + return ::std::unique_ptr<Enumeration<SharedPageDescriptor> >( new PageEnumeration (*this, true)); } -SAL_WNODEPRECATED_DECLARATIONS_POP bool PageEnumeration::HasMoreElements (void) const { @@ -172,14 +166,12 @@ PageEnumerationImpl::~PageEnumerationImpl (void) { } -SAL_WNODEPRECATED_DECLARATIONS_PUSH -::std::auto_ptr<Enumeration<SharedPageDescriptor> > +::std::unique_ptr<Enumeration<SharedPageDescriptor> > PageEnumerationImpl::Clone (void) { - return ::std::auto_ptr<Enumeration<SharedPageDescriptor> >( + return ::std::unique_ptr<Enumeration<SharedPageDescriptor> >( new PageEnumerationImpl(mrModel,maPredicate,mnIndex)); } -SAL_WNODEPRECATED_DECLARATIONS_POP bool PageEnumerationImpl::HasMoreElements (void) const { diff --git a/sd/source/ui/slidesorter/view/SlsFontProvider.cxx b/sd/source/ui/slidesorter/view/SlsFontProvider.cxx index 970351c33355..90bf000283a4 100644 --- a/sd/source/ui/slidesorter/view/SlsFontProvider.cxx +++ b/sd/source/ui/slidesorter/view/SlsFontProvider.cxx @@ -42,7 +42,7 @@ FontProvider& FontProvider::Instance (void) // SdGlobalResourceContainer so that it is eventually released. FontProvider* pInstance = new FontProvider(); SdGlobalResourceContainer::Instance().AddResource ( - ::std::auto_ptr<SdGlobalResource>(pInstance)); + ::std::unique_ptr<SdGlobalResource>(pInstance)); OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER(); mpInstance = pInstance; } diff --git a/sd/source/ui/tools/AsynchronousCall.cxx b/sd/source/ui/tools/AsynchronousCall.cxx index dd444f517fc3..13b890406291 100644 --- a/sd/source/ui/tools/AsynchronousCall.cxx +++ b/sd/source/ui/tools/AsynchronousCall.cxx @@ -50,10 +50,8 @@ IMPL_LINK(AsynchronousCall,TimerCallback,Timer*,pTimer) { if (pTimer == &maTimer) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<AsynchronousFunction> pFunction (mpFunction); - SAL_WNODEPRECATED_DECLARATIONS_POP - mpFunction.reset(); + ::std::unique_ptr<AsynchronousFunction> pFunction; + pFunction.swap(mpFunction); (*pFunction)(); } return 0; diff --git a/sd/source/ui/tools/EventMultiplexer.cxx b/sd/source/ui/tools/EventMultiplexer.cxx index 8549a749834c..ede1c01f2abb 100644 --- a/sd/source/ui/tools/EventMultiplexer.cxx +++ b/sd/source/ui/tools/EventMultiplexer.cxx @@ -176,7 +176,7 @@ EventMultiplexer::~EventMultiplexer (void) mpImpl->dispose(); // Now we call release twice. One decreases the use count of the // implementation object (if all goes well to zero and thus deletes - // it.) The other releases the auto_ptr and prevents the + // it.) The other releases the unique_ptr and prevents the // implementation object from being deleted a second time. mpImpl->release(); mpImpl.release(); diff --git a/sd/source/ui/tools/IconCache.cxx b/sd/source/ui/tools/IconCache.cxx index 1de1924bfb8b..33858b82955b 100644 --- a/sd/source/ui/tools/IconCache.cxx +++ b/sd/source/ui/tools/IconCache.cxx @@ -75,7 +75,7 @@ IconCache& IconCache::Instance (void) { IconCache* pCache = new IconCache (); SdGlobalResourceContainer::Instance().AddResource ( - ::std::auto_ptr<SdGlobalResource>(pCache)); + ::std::unique_ptr<SdGlobalResource>(pCache)); OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER(); Implementation::mpInstance = pCache; } diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx index e1da6f46da30..4de09a10c1a6 100644 --- a/sd/source/ui/tools/PreviewRenderer.cxx +++ b/sd/source/ui/tools/PreviewRenderer.cxx @@ -65,7 +65,6 @@ PreviewRenderer::PreviewRenderer ( OutputDevice* pTemplate, const bool bHasFrame) : mpPreviewDevice (new VirtualDevice()), - mpView(NULL), mpDocShellOfView(NULL), maFrameColor (svtools::ColorConfig().GetColorValue(svtools::DOCBOUNDARIES).nColor), mbHasFrame(bHasFrame) diff --git a/sd/source/ui/tools/SdGlobalResourceContainer.cxx b/sd/source/ui/tools/SdGlobalResourceContainer.cxx index c2542c924f6f..6b310dd177f6 100644 --- a/sd/source/ui/tools/SdGlobalResourceContainer.cxx +++ b/sd/source/ui/tools/SdGlobalResourceContainer.cxx @@ -65,7 +65,7 @@ SdGlobalResourceContainer* //===== SdGlobalResourceContainer ============================================= void SdGlobalResourceContainer::AddResource ( - ::std::auto_ptr<SdGlobalResource> pResource) + ::std::unique_ptr<SdGlobalResource> && pResource) { ::osl::MutexGuard aGuard (mpImpl->maMutex); @@ -78,13 +78,13 @@ void SdGlobalResourceContainer::AddResource ( mpImpl->maResources.push_back(pResource.get()); else { - // Because the given resource is an auto_ptr it is highly unlikely + // Because the given resource is a unique_ptr it is highly unlikely // that we come here. But who knows? DBG_ASSERT (false, "SdGlobalResourceContainer:AddResource(): Resource added twice."); } - // We can not put the auto_ptr into the vector so we release the - // auto_ptr and document that we take ownership explicitly. + // We can not put the unique_ptr into the vector so we release the + // unique_ptr and document that we take ownership explicitly. pResource.release(); } diff --git a/sd/source/ui/unoidl/DrawController.cxx b/sd/source/ui/unoidl/DrawController.cxx index 02e9e9dc5fc8..620e7a276368 100644 --- a/sd/source/ui/unoidl/DrawController.cxx +++ b/sd/source/ui/unoidl/DrawController.cxx @@ -74,7 +74,6 @@ DrawController::DrawController (ViewShellBase& rBase) throw() mbMasterPageMode(false), mbLayerMode(false), mbDisposing(false), - mpPropertyArrayHelper(NULL), mxSubController(), mxConfigurationController(), mxModuleController() diff --git a/sd/source/ui/view/ToolBarManager.cxx b/sd/source/ui/view/ToolBarManager.cxx index db255cb26e26..69dfe86f9a7c 100644 --- a/sd/source/ui/view/ToolBarManager.cxx +++ b/sd/source/ui/view/ToolBarManager.cxx @@ -43,6 +43,7 @@ #include <tools/link.hxx> #include <map> +#include <utility> #include <vector> using namespace ::com::sun::star; @@ -277,9 +278,7 @@ public: this method and that is either released at its end or assigned to mpAsynchronousLock in order to be unlocked later. */ - SAL_WNODEPRECATED_DECLARATIONS_PUSH - void Update (::std::auto_ptr<LayouterLock> pLayouterLock); - SAL_WNODEPRECATED_DECLARATIONS_POP + void Update (::std::unique_ptr<LayouterLock> pLayouterLock); class UpdateLockImplementation { @@ -315,11 +314,9 @@ private: (final) unlocking is usually done asynchronously *after* the list of requested toolbars is updated. */ - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<LayouterLock> mpSynchronousLayouterLock; - ::std::auto_ptr<LayouterLock> mpAsynchronousLayouterLock; - ::std::auto_ptr<ViewShellManager::UpdateLock> mpViewShellManagerLock; - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<LayouterLock> mpSynchronousLayouterLock; + ::std::unique_ptr<LayouterLock> mpAsynchronousLayouterLock; + ::std::unique_ptr<ViewShellManager::UpdateLock> mpViewShellManagerLock; ImplSVEvent * mnPendingUpdateCall; ImplSVEvent * mnPendingSetValidCall; ToolBarRules maToolBarRules; @@ -771,13 +768,12 @@ void ToolBarManager::Implementation::UnlockUpdate (void) --mnLockCount; if (mnLockCount == 0) { - Update(mpSynchronousLayouterLock); + Update(std::move(mpSynchronousLayouterLock)); } } -SAL_WNODEPRECATED_DECLARATIONS_PUSH void ToolBarManager::Implementation::Update ( - ::std::auto_ptr<LayouterLock> pLocalLayouterLock) + ::std::unique_ptr<LayouterLock> pLocalLayouterLock) { // When the lock is released and there are pending changes to the set of // tool bars then update this set now. @@ -818,7 +814,7 @@ void ToolBarManager::Implementation::Update ( // 3) Unlock the ViewShellManager::UpdateLock. This updates the // shell stack. We have to be carfull here. The deletion of // the lock may end in a synchronous call to LockUpdate(). When - // at this time the lock has been deleted but the auto_ptr has + // at this time the lock has been deleted but the unique_ptr has // not yet been reset then the lock is deleted a second time. ViewShellManager::UpdateLock* pLock = mpViewShellManagerLock.release(); delete pLock; @@ -835,7 +831,7 @@ void ToolBarManager::Implementation::Update ( // UnlockUpdate() calls will post the UpdateCallback. if (mnPendingUpdateCall==0 && mnLockCount==0) { - mpAsynchronousLayouterLock = pLocalLayouterLock; + mpAsynchronousLayouterLock = std::move(pLocalLayouterLock); mnPendingUpdateCall = Application::PostUserEvent( LINK(this,ToolBarManager::Implementation,UpdateCallback)); } @@ -851,7 +847,6 @@ void ToolBarManager::Implementation::Update ( } } } -SAL_WNODEPRECATED_DECLARATIONS_POP IMPL_LINK_NOARG(ToolBarManager::Implementation, UpdateCallback) { diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index ccb460184933..c47b4a14cf06 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <utility> + #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/Locale.hpp> #include <com/sun/star/linguistic2/XThesaurus.hpp> @@ -91,11 +95,10 @@ using namespace ::com::sun::star::linguistic2; current clipboard content and the DrawViewShell. The list is stored in a new instance of SvxClipboardFmtItem. */ -SAL_WNODEPRECATED_DECLARATIONS_PUSH -::std::auto_ptr<SvxClipboardFmtItem> GetSupportedClipboardFormats ( +::std::unique_ptr<SvxClipboardFmtItem> GetSupportedClipboardFormats ( TransferableDataHelper& rDataHelper) { - ::std::auto_ptr<SvxClipboardFmtItem> pResult ( + ::std::unique_ptr<SvxClipboardFmtItem> pResult ( new SvxClipboardFmtItem(SID_CLIPBOARD_FORMAT_ITEMS)); sal_uInt32 nFormatCount (rDataHelper.GetFormatCount()); @@ -172,7 +175,6 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH return pResult; } -SAL_WNODEPRECATED_DECLARATIONS_POP namespace sd { @@ -190,12 +192,10 @@ IMPL_LINK( DrawViewShell, ClipboardChanged, TransferableDataHelper*, pDataHelper // exit immediately. TransferableDataHelper aDataHelper ( TransferableDataHelper::CreateFromSystemClipboard(GetActiveWindow())); - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr<SvxClipboardFmtItem> pFormats (GetSupportedClipboardFormats(aDataHelper)); - SAL_WNODEPRECATED_DECLARATIONS_POP + ::std::unique_ptr<SvxClipboardFmtItem> pFormats (GetSupportedClipboardFormats(aDataHelper)); if (mpDrawView == NULL) return 0; - mpCurrentClipboardFormats = pFormats; + mpCurrentClipboardFormats = std::move(pFormats); SfxBindings& rBindings = GetViewFrame()->GetBindings(); rBindings.Invalidate( SID_PASTE ); |