diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-09-30 08:50:14 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-09-30 10:33:26 +0200 |
commit | b8ea41a98ded7dc2eae22f05ad427b6958702d0b (patch) | |
tree | 2a3757daa64f816b472a068208a7696e214ddd01 | |
parent | 05dfa2f6bfaffd0caa380d246027082bd2969aba (diff) |
cui: std::auto_ptr -> std::unique_ptr
Change-Id: Iea8b3def77842541129c16346270aa262654fea4
-rw-r--r-- | cui/source/dialogs/scriptdlg.cxx | 32 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.cxx | 2 | ||||
-rw-r--r-- | cui/source/inc/passwdomdlg.hxx | 2 | ||||
-rw-r--r-- | cui/source/inc/scriptdlg.hxx | 4 |
4 files changed, 13 insertions, 27 deletions
diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx index 23d46bf10627..f740a896a7a2 100644 --- a/cui/source/dialogs/scriptdlg.cxx +++ b/cui/source/dialogs/scriptdlg.cxx @@ -18,6 +18,7 @@ */ #include <memory> +#include <utility> #include <sfx2/objsh.hxx> #include <vcl/svapp.hxx> @@ -238,10 +239,8 @@ void SFTreeListBox::Init( const OUString& language ) Reference< browse::XBrowseNode > langEntries = getLangNodeFromRootNode( children[ n ], lang ); - SAL_WNODEPRECATED_DECLARATIONS_PUSH insertEntry( uiName, app ? RID_CUIIMG_HARDDISK : RID_CUIIMG_DOC, - 0, true, std::auto_ptr< SFEntry >(new SFEntry( OBJTYPE_SFROOT, langEntries, xDocumentModel )), factoryURL ); - SAL_WNODEPRECATED_DECLARATIONS_POP + 0, true, std::unique_ptr< SFEntry >(new SFEntry( OBJTYPE_SFROOT, langEntries, xDocumentModel )), factoryURL ); } SetUpdateMode( true ); @@ -322,17 +321,13 @@ void SFTreeListBox:: RequestSubEntries( SvTreeListEntry* pRootEntry, Reference< OUString name( children[ n ]->getName() ); if ( children[ n ]->getType() != browse::BrowseNodeTypes::SCRIPT) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - insertEntry( name, RID_CUIIMG_LIB, pRootEntry, true, std::auto_ptr< SFEntry >(new SFEntry( OBJTYPE_SCRIPTCONTAINER, children[ n ],model ))); - SAL_WNODEPRECATED_DECLARATIONS_POP + insertEntry( name, RID_CUIIMG_LIB, pRootEntry, true, std::unique_ptr< SFEntry >(new SFEntry( OBJTYPE_SCRIPTCONTAINER, children[ n ],model ))); } else { if ( children[ n ]->getType() == browse::BrowseNodeTypes::SCRIPT ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - insertEntry( name, RID_CUIIMG_MACRO, pRootEntry, false, std::auto_ptr< SFEntry >(new SFEntry( OBJTYPE_METHOD, children[ n ],model ))); - SAL_WNODEPRECATED_DECLARATIONS_POP + insertEntry( name, RID_CUIIMG_MACRO, pRootEntry, false, std::unique_ptr< SFEntry >(new SFEntry( OBJTYPE_METHOD, children[ n ],model ))); } } @@ -348,10 +343,9 @@ void SFTreeListBox::ExpandAllTrees() { } -SAL_WNODEPRECATED_DECLARATIONS_PUSH SvTreeListEntry * SFTreeListBox::insertEntry( OUString const & rText, sal_uInt16 nBitmap, SvTreeListEntry * pParent, - bool bChildrenOnDemand, std::auto_ptr< SFEntry > aUserData, const OUString& factoryURL ) + bool bChildrenOnDemand, std::unique_ptr< SFEntry > && aUserData, const OUString& factoryURL ) { SvTreeListEntry * p; if( nBitmap == RID_CUIIMG_DOC && !factoryURL.isEmpty() ) @@ -363,16 +357,14 @@ SvTreeListEntry * SFTreeListBox::insertEntry( } else { - p = insertEntry( rText, nBitmap, pParent, bChildrenOnDemand, aUserData ); + p = insertEntry( rText, nBitmap, pParent, bChildrenOnDemand, std::move(aUserData) ); } return p; } -SAL_WNODEPRECATED_DECLARATIONS_POP -SAL_WNODEPRECATED_DECLARATIONS_PUSH SvTreeListEntry * SFTreeListBox::insertEntry( OUString const & rText, sal_uInt16 nBitmap, SvTreeListEntry * pParent, - bool bChildrenOnDemand, std::auto_ptr< SFEntry > aUserData ) + bool bChildrenOnDemand, std::unique_ptr< SFEntry > && aUserData ) { Image aImage; if( nBitmap == RID_CUIIMG_HARDDISK ) @@ -396,7 +388,6 @@ SvTreeListEntry * SFTreeListBox::insertEntry( aUserData.release()); // XXX possible leak return p; } -SAL_WNODEPRECATED_DECLARATIONS_POP void SFTreeListBox::RequestingChildren( SvTreeListEntry* pEntry ) { @@ -962,18 +953,13 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry ) // not in alphabetical order if ( aChildNode->getType() == browse::BrowseNodeTypes::SCRIPT ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH pNewEntry = m_pScriptsBox->insertEntry( aChildName, - RID_CUIIMG_MACRO, pEntry, false, std::auto_ptr< SFEntry >(new SFEntry( OBJTYPE_METHOD, aChildNode,xDocumentModel ) ) ); - SAL_WNODEPRECATED_DECLARATIONS_POP - + RID_CUIIMG_MACRO, pEntry, false, std::unique_ptr< SFEntry >(new SFEntry( OBJTYPE_METHOD, aChildNode,xDocumentModel ) ) ); } else { - SAL_WNODEPRECATED_DECLARATIONS_PUSH pNewEntry = m_pScriptsBox->insertEntry( aChildName, - RID_CUIIMG_LIB, pEntry, false, std::auto_ptr< SFEntry >(new SFEntry( OBJTYPE_SCRIPTCONTAINER, aChildNode,xDocumentModel ) ) ); - SAL_WNODEPRECATED_DECLARATIONS_POP + RID_CUIIMG_LIB, pEntry, false, std::unique_ptr< SFEntry >(new SFEntry( OBJTYPE_SCRIPTCONTAINER, aChildNode,xDocumentModel ) ) ); // If the Parent is not loaded then set to // loaded, this will prevent RequestingChildren ( called diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index 5dc045dbabb0..07c63f315c2b 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -1615,7 +1615,7 @@ public: private: SfxItemSet m_aItems; - ::std::auto_ptr< SvxMacroAssignDlg > m_pDialog; + ::std::unique_ptr< SvxMacroAssignDlg > m_pDialog; }; short SvxMacroAssignDialog::Execute() diff --git a/cui/source/inc/passwdomdlg.hxx b/cui/source/inc/passwdomdlg.hxx index 1fe8c58551f8..179d99bca75a 100644 --- a/cui/source/inc/passwdomdlg.hxx +++ b/cui/source/inc/passwdomdlg.hxx @@ -30,7 +30,7 @@ struct PasswordToOpenModifyDialog_Impl; class PasswordToOpenModifyDialog : public SfxModalDialog { - std::auto_ptr< PasswordToOpenModifyDialog_Impl > m_pImpl; + std::unique_ptr< PasswordToOpenModifyDialog_Impl > m_pImpl; // disallow use of copy c-tor and assignment operator PasswordToOpenModifyDialog( const PasswordToOpenModifyDialog & ); diff --git a/cui/source/inc/scriptdlg.hxx b/cui/source/inc/scriptdlg.hxx index 3b7240675e13..a3d3f0df267b 100644 --- a/cui/source/inc/scriptdlg.hxx +++ b/cui/source/inc/scriptdlg.hxx @@ -85,12 +85,12 @@ public: SvTreeListEntry * insertEntry(OUString const & rText, sal_uInt16 nBitmap, SvTreeListEntry * pParent, bool bChildrenOnDemand, - std::auto_ptr< SFEntry > aUserData, + std::unique_ptr< SFEntry > && aUserData, const OUString& factoryURL ); SvTreeListEntry * insertEntry(OUString const & rText, sal_uInt16 nBitmap, SvTreeListEntry * pParent, bool bChildrenOnDemand, - std::auto_ptr< SFEntry > aUserData ); + std::unique_ptr< SFEntry > && aUserData ); void deleteTree( SvTreeListEntry * pEntry ); void deleteAllTree( ); }; |