Kaydet (Commit) b8ea41a9 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

cui: std::auto_ptr -> std::unique_ptr

Change-Id: Iea8b3def77842541129c16346270aa262654fea4
üst 05dfa2f6
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
#include <memory> #include <memory>
#include <utility>
#include <sfx2/objsh.hxx> #include <sfx2/objsh.hxx>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
...@@ -238,10 +239,8 @@ void SFTreeListBox::Init( const OUString& language ) ...@@ -238,10 +239,8 @@ void SFTreeListBox::Init( const OUString& language )
Reference< browse::XBrowseNode > langEntries = Reference< browse::XBrowseNode > langEntries =
getLangNodeFromRootNode( children[ n ], lang ); getLangNodeFromRootNode( children[ n ], lang );
SAL_WNODEPRECATED_DECLARATIONS_PUSH
insertEntry( uiName, app ? RID_CUIIMG_HARDDISK : RID_CUIIMG_DOC, insertEntry( uiName, app ? RID_CUIIMG_HARDDISK : RID_CUIIMG_DOC,
0, true, std::auto_ptr< SFEntry >(new SFEntry( OBJTYPE_SFROOT, langEntries, xDocumentModel )), factoryURL ); 0, true, std::unique_ptr< SFEntry >(new SFEntry( OBJTYPE_SFROOT, langEntries, xDocumentModel )), factoryURL );
SAL_WNODEPRECATED_DECLARATIONS_POP
} }
SetUpdateMode( true ); SetUpdateMode( true );
...@@ -322,17 +321,13 @@ void SFTreeListBox:: RequestSubEntries( SvTreeListEntry* pRootEntry, Reference< ...@@ -322,17 +321,13 @@ void SFTreeListBox:: RequestSubEntries( SvTreeListEntry* pRootEntry, Reference<
OUString name( children[ n ]->getName() ); OUString name( children[ n ]->getName() );
if ( children[ n ]->getType() != browse::BrowseNodeTypes::SCRIPT) if ( children[ n ]->getType() != browse::BrowseNodeTypes::SCRIPT)
{ {
SAL_WNODEPRECATED_DECLARATIONS_PUSH insertEntry( name, RID_CUIIMG_LIB, pRootEntry, true, std::unique_ptr< SFEntry >(new SFEntry( OBJTYPE_SCRIPTCONTAINER, children[ n ],model )));
insertEntry( name, RID_CUIIMG_LIB, pRootEntry, true, std::auto_ptr< SFEntry >(new SFEntry( OBJTYPE_SCRIPTCONTAINER, children[ n ],model )));
SAL_WNODEPRECATED_DECLARATIONS_POP
} }
else else
{ {
if ( children[ n ]->getType() == browse::BrowseNodeTypes::SCRIPT ) if ( children[ n ]->getType() == browse::BrowseNodeTypes::SCRIPT )
{ {
SAL_WNODEPRECATED_DECLARATIONS_PUSH insertEntry( name, RID_CUIIMG_MACRO, pRootEntry, false, std::unique_ptr< SFEntry >(new SFEntry( OBJTYPE_METHOD, children[ n ],model )));
insertEntry( name, RID_CUIIMG_MACRO, pRootEntry, false, std::auto_ptr< SFEntry >(new SFEntry( OBJTYPE_METHOD, children[ n ],model )));
SAL_WNODEPRECATED_DECLARATIONS_POP
} }
} }
...@@ -348,10 +343,9 @@ void SFTreeListBox::ExpandAllTrees() ...@@ -348,10 +343,9 @@ void SFTreeListBox::ExpandAllTrees()
{ {
} }
SAL_WNODEPRECATED_DECLARATIONS_PUSH
SvTreeListEntry * SFTreeListBox::insertEntry( SvTreeListEntry * SFTreeListBox::insertEntry(
OUString const & rText, sal_uInt16 nBitmap, SvTreeListEntry * pParent, 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; SvTreeListEntry * p;
if( nBitmap == RID_CUIIMG_DOC && !factoryURL.isEmpty() ) if( nBitmap == RID_CUIIMG_DOC && !factoryURL.isEmpty() )
...@@ -363,16 +357,14 @@ SvTreeListEntry * SFTreeListBox::insertEntry( ...@@ -363,16 +357,14 @@ SvTreeListEntry * SFTreeListBox::insertEntry(
} }
else else
{ {
p = insertEntry( rText, nBitmap, pParent, bChildrenOnDemand, aUserData ); p = insertEntry( rText, nBitmap, pParent, bChildrenOnDemand, std::move(aUserData) );
} }
return p; return p;
} }
SAL_WNODEPRECATED_DECLARATIONS_POP
SAL_WNODEPRECATED_DECLARATIONS_PUSH
SvTreeListEntry * SFTreeListBox::insertEntry( SvTreeListEntry * SFTreeListBox::insertEntry(
OUString const & rText, sal_uInt16 nBitmap, SvTreeListEntry * pParent, OUString const & rText, sal_uInt16 nBitmap, SvTreeListEntry * pParent,
bool bChildrenOnDemand, std::auto_ptr< SFEntry > aUserData ) bool bChildrenOnDemand, std::unique_ptr< SFEntry > && aUserData )
{ {
Image aImage; Image aImage;
if( nBitmap == RID_CUIIMG_HARDDISK ) if( nBitmap == RID_CUIIMG_HARDDISK )
...@@ -396,7 +388,6 @@ SvTreeListEntry * SFTreeListBox::insertEntry( ...@@ -396,7 +388,6 @@ SvTreeListEntry * SFTreeListBox::insertEntry(
aUserData.release()); // XXX possible leak aUserData.release()); // XXX possible leak
return p; return p;
} }
SAL_WNODEPRECATED_DECLARATIONS_POP
void SFTreeListBox::RequestingChildren( SvTreeListEntry* pEntry ) void SFTreeListBox::RequestingChildren( SvTreeListEntry* pEntry )
{ {
...@@ -962,18 +953,13 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry ) ...@@ -962,18 +953,13 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry )
// not in alphabetical order // not in alphabetical order
if ( aChildNode->getType() == browse::BrowseNodeTypes::SCRIPT ) if ( aChildNode->getType() == browse::BrowseNodeTypes::SCRIPT )
{ {
SAL_WNODEPRECATED_DECLARATIONS_PUSH
pNewEntry = m_pScriptsBox->insertEntry( aChildName, pNewEntry = m_pScriptsBox->insertEntry( aChildName,
RID_CUIIMG_MACRO, pEntry, false, std::auto_ptr< SFEntry >(new SFEntry( OBJTYPE_METHOD, aChildNode,xDocumentModel ) ) ); RID_CUIIMG_MACRO, pEntry, false, std::unique_ptr< SFEntry >(new SFEntry( OBJTYPE_METHOD, aChildNode,xDocumentModel ) ) );
SAL_WNODEPRECATED_DECLARATIONS_POP
} }
else else
{ {
SAL_WNODEPRECATED_DECLARATIONS_PUSH
pNewEntry = m_pScriptsBox->insertEntry( aChildName, pNewEntry = m_pScriptsBox->insertEntry( aChildName,
RID_CUIIMG_LIB, pEntry, false, std::auto_ptr< SFEntry >(new SFEntry( OBJTYPE_SCRIPTCONTAINER, aChildNode,xDocumentModel ) ) ); RID_CUIIMG_LIB, pEntry, false, std::unique_ptr< SFEntry >(new SFEntry( OBJTYPE_SCRIPTCONTAINER, aChildNode,xDocumentModel ) ) );
SAL_WNODEPRECATED_DECLARATIONS_POP
// If the Parent is not loaded then set to // If the Parent is not loaded then set to
// loaded, this will prevent RequestingChildren ( called // loaded, this will prevent RequestingChildren ( called
......
...@@ -1615,7 +1615,7 @@ public: ...@@ -1615,7 +1615,7 @@ public:
private: private:
SfxItemSet m_aItems; SfxItemSet m_aItems;
::std::auto_ptr< SvxMacroAssignDlg > m_pDialog; ::std::unique_ptr< SvxMacroAssignDlg > m_pDialog;
}; };
short SvxMacroAssignDialog::Execute() short SvxMacroAssignDialog::Execute()
......
...@@ -30,7 +30,7 @@ struct PasswordToOpenModifyDialog_Impl; ...@@ -30,7 +30,7 @@ struct PasswordToOpenModifyDialog_Impl;
class PasswordToOpenModifyDialog : public SfxModalDialog 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 // disallow use of copy c-tor and assignment operator
PasswordToOpenModifyDialog( const PasswordToOpenModifyDialog & ); PasswordToOpenModifyDialog( const PasswordToOpenModifyDialog & );
......
...@@ -85,12 +85,12 @@ public: ...@@ -85,12 +85,12 @@ public:
SvTreeListEntry * insertEntry(OUString const & rText, sal_uInt16 nBitmap, SvTreeListEntry * insertEntry(OUString const & rText, sal_uInt16 nBitmap,
SvTreeListEntry * pParent, SvTreeListEntry * pParent,
bool bChildrenOnDemand, bool bChildrenOnDemand,
std::auto_ptr< SFEntry > aUserData, std::unique_ptr< SFEntry > && aUserData,
const OUString& factoryURL ); const OUString& factoryURL );
SvTreeListEntry * insertEntry(OUString const & rText, sal_uInt16 nBitmap, SvTreeListEntry * insertEntry(OUString const & rText, sal_uInt16 nBitmap,
SvTreeListEntry * pParent, SvTreeListEntry * pParent,
bool bChildrenOnDemand, bool bChildrenOnDemand,
std::auto_ptr< SFEntry > aUserData ); std::unique_ptr< SFEntry > && aUserData );
void deleteTree( SvTreeListEntry * pEntry ); void deleteTree( SvTreeListEntry * pEntry );
void deleteAllTree( ); void deleteAllTree( );
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment