diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-02-07 15:54:45 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-02-07 18:43:31 +0100 |
commit | bf28399df0b73364b12309032e4a8b571389c2cf (patch) | |
tree | d5a3d4d36ae82fec4b5d61d2629ba2a91ee8c6b7 /basctl | |
parent | aef614d0931d9b1ef0431ebc6aa8aad38d0445c1 (diff) |
auto_ptr -> heap_ptr
Change-Id: I401505ee15f71e8655570233b953951aa22ad668
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/basicide/bastype2.cxx | 69 | ||||
-rw-r--r-- | basctl/source/basicide/bastype2.hxx | 4 | ||||
-rw-r--r-- | basctl/source/basicide/moduldl2.cxx | 14 | ||||
-rw-r--r-- | basctl/source/basicide/moduldlg.cxx | 14 |
4 files changed, 32 insertions, 69 deletions
diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx index c89944740de3..522e5e495d3f 100644 --- a/basctl/source/basicide/bastype2.cxx +++ b/basctl/source/basicide/bastype2.cxx @@ -17,9 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - -#include <memory> - #include <vcl/bitmap.hxx> #include <vcl/builder.hxx> @@ -43,6 +40,7 @@ #include <comphelper/processfactory.hxx> #include <sfx2/dispatch.hxx> +#include <cassert> #include <map> #include <com/sun/star/script/ModuleType.hpp> #include <com/sun/star/script/vba/XVBAModuleInfo.hpp> @@ -249,14 +247,11 @@ void TreeListBox::ScanEntry( const ScriptDocument& rDocument, LibraryLocation eL OUString aRootName( GetRootEntryName( rDocument, eLocation ) ); Image aImage; GetRootEntryBitmaps( rDocument, aImage ); - SAL_WNODEPRECATED_DECLARATIONS_PUSH + o3tl::heap_ptr<Entry> e(new DocumentEntry(rDocument, eLocation)); AddEntry( aRootName, aImage, - 0, true, - std::auto_ptr<Entry>(new DocumentEntry(rDocument, eLocation)) - ); - SAL_WNODEPRECATED_DECLARATIONS_POP + 0, true, &e); } SetUpdateMode(true); @@ -315,14 +310,11 @@ void TreeListBox::ImpCreateLibEntries( SvTreeListEntry* pDocumentRootEntry, cons } else { - SAL_WNODEPRECATED_DECLARATIONS_PUSH + o3tl::heap_ptr<Entry> e(new Entry(OBJ_TYPE_LIBRARY)); AddEntry( aLibName, Image( IDEResId( nId ) ), - pDocumentRootEntry, true, - std::auto_ptr<Entry>(new Entry(OBJ_TYPE_LIBRARY)) - ); - SAL_WNODEPRECATED_DECLARATIONS_POP + pDocumentRootEntry, true, &e); } } } @@ -354,14 +346,11 @@ void TreeListBox::ImpCreateLibSubEntries( SvTreeListEntry* pLibRootEntry, const SvTreeListEntry* pModuleEntry = FindEntry( pLibRootEntry, aModName, OBJ_TYPE_MODULE ); if ( !pModuleEntry ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH + o3tl::heap_ptr<Entry> e(new Entry(OBJ_TYPE_MODULE)); pModuleEntry = AddEntry( aModName, Image( IDEResId( RID_IMG_MODULE ) ), - pLibRootEntry, false, - std::auto_ptr<Entry>(new Entry(OBJ_TYPE_MODULE)) - ); - SAL_WNODEPRECATED_DECLARATIONS_POP + pLibRootEntry, false, &e); } // methods @@ -377,14 +366,12 @@ void TreeListBox::ImpCreateLibSubEntries( SvTreeListEntry* pLibRootEntry, const SvTreeListEntry* pEntry = FindEntry( pModuleEntry, aName, OBJ_TYPE_METHOD ); if ( !pEntry ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH + o3tl::heap_ptr<Entry> e( + new Entry(OBJ_TYPE_METHOD)); pEntry = AddEntry( aName, Image( IDEResId( RID_IMG_MACRO ) ), - pModuleEntry, false, - std::auto_ptr<Entry>(new Entry(OBJ_TYPE_METHOD)) - ); - SAL_WNODEPRECATED_DECLARATIONS_POP + pModuleEntry, false, &e); } } } @@ -418,14 +405,11 @@ void TreeListBox::ImpCreateLibSubEntries( SvTreeListEntry* pLibRootEntry, const SvTreeListEntry* pDialogEntry = FindEntry( pLibRootEntry, aDlgName, OBJ_TYPE_DIALOG ); if ( !pDialogEntry ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH + o3tl::heap_ptr<Entry> e(new Entry(OBJ_TYPE_DIALOG)); pDialogEntry = AddEntry( aDlgName, Image( IDEResId( RID_IMG_DIALOG ) ), - pLibRootEntry, false, - std::auto_ptr<Entry>(new Entry(OBJ_TYPE_DIALOG)) - ); - SAL_WNODEPRECATED_DECLARATIONS_POP + pLibRootEntry, false, &e); } } } @@ -460,14 +444,11 @@ void TreeListBox::ImpCreateLibSubEntriesInVBAMode( SvTreeListEntry* pLibRootEntr } else { - SAL_WNODEPRECATED_DECLARATIONS_PUSH + o3tl::heap_ptr<Entry> e(new Entry(eType)); AddEntry( aEntryName, Image( IDEResId( RID_IMG_MODLIB ) ), - pLibRootEntry, true, - std::auto_ptr<Entry>(new Entry(eType)) - ); - SAL_WNODEPRECATED_DECLARATIONS_POP + pLibRootEntry, true, &e); } } } @@ -525,14 +506,11 @@ void TreeListBox::ImpCreateLibSubSubEntriesInVBAMode( SvTreeListEntry* pLibSubRo SvTreeListEntry* pModuleEntry = FindEntry( pLibSubRootEntry, aEntryName, OBJ_TYPE_MODULE ); if ( !pModuleEntry ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH + o3tl::heap_ptr<Entry> e(new Entry(OBJ_TYPE_MODULE)); pModuleEntry = AddEntry( aEntryName, Image( IDEResId( RID_IMG_MODULE ) ), - pLibSubRootEntry, false, - std::auto_ptr<Entry>(new Entry(OBJ_TYPE_MODULE)) - ); - SAL_WNODEPRECATED_DECLARATIONS_POP + pLibSubRootEntry, false, &e); } // methods @@ -548,14 +526,11 @@ void TreeListBox::ImpCreateLibSubSubEntriesInVBAMode( SvTreeListEntry* pLibSubRo SvTreeListEntry* pEntry = FindEntry( pModuleEntry, aName, OBJ_TYPE_METHOD ); if ( !pEntry ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH + o3tl::heap_ptr<Entry> e(new Entry(OBJ_TYPE_METHOD)); pEntry = AddEntry( aName, Image( IDEResId( RID_IMG_MACRO ) ), - pModuleEntry, false, - std::auto_ptr<Entry>(new Entry(OBJ_TYPE_METHOD)) - ); - SAL_WNODEPRECATED_DECLARATIONS_POP + pModuleEntry, false, &e); } } } @@ -761,22 +736,22 @@ bool TreeListBox::IsEntryProtected( SvTreeListEntry* pEntry ) return bProtected; } -SAL_WNODEPRECATED_DECLARATIONS_PUSH SvTreeListEntry* TreeListBox::AddEntry( OUString const& rText, const Image& rImage, SvTreeListEntry* pParent, bool bChildrenOnDemand, - std::auto_ptr<Entry> aUserData + o3tl::heap_ptr<Entry> * aUserData ) { + assert(aUserData != 0); SvTreeListEntry* p = InsertEntry( rText, rImage, rImage, pParent, bChildrenOnDemand, LIST_APPEND, - aUserData.release() // XXX possible leak + aUserData->get() ); + aUserData->release(); return p; } -SAL_WNODEPRECATED_DECLARATIONS_POP void TreeListBox::SetEntryBitmaps( SvTreeListEntry * pEntry, const Image& rImage ) { diff --git a/basctl/source/basicide/bastype2.hxx b/basctl/source/basicide/bastype2.hxx index bc7d669e713e..482899604d61 100644 --- a/basctl/source/basicide/bastype2.hxx +++ b/basctl/source/basicide/bastype2.hxx @@ -21,7 +21,7 @@ #include "doceventnotifier.hxx" -#include <memory> +#include <o3tl/heap_ptr.hxx> #include <tools/solar.h> #include <svtools/treelistbox.hxx> @@ -231,7 +231,7 @@ public: SvTreeListEntry* AddEntry( const OUString& rText, const Image& rImage, SvTreeListEntry* pParent, bool bChildrenOnDemand, - std::auto_ptr<Entry> aUserData + o3tl::heap_ptr<Entry> * aUserData ); void RemoveEntry (SvTreeListEntry*); void RemoveEntry (ScriptDocument const&); diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index a27cf45f7590..475d182ec29f 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -1597,26 +1597,20 @@ void createLibImpl( Window* pWin, const ScriptDocument& rDocument, sal_uInt16 nMode = pBasicBox->GetMode(); bool bDlgMode = ( nMode & BROWSEMODE_DIALOGS ) && !( nMode & BROWSEMODE_MODULES ); sal_uInt16 nId = bDlgMode ? RID_IMG_DLGLIB : RID_IMG_MODLIB; - SAL_WNODEPRECATED_DECLARATIONS_PUSH + o3tl::heap_ptr<Entry> e(new Entry(OBJ_TYPE_LIBRARY)); SvTreeListEntry* pNewLibEntry = pBasicBox->AddEntry( aLibName, Image( IDEResId( nId ) ), - pRootEntry, false, - std::auto_ptr<Entry>(new Entry(OBJ_TYPE_LIBRARY)) - ); - SAL_WNODEPRECATED_DECLARATIONS_POP + pRootEntry, false, &e); DBG_ASSERT( pNewLibEntry, "InsertEntry fehlgeschlagen!" ); if( pNewLibEntry ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH + o3tl::heap_ptr<Entry>(new Entry(OBJ_TYPE_MODULE)); SvTreeListEntry* pEntry_ = pBasicBox->AddEntry( aModName, Image( IDEResId( RID_IMG_MODULE ) ), - pNewLibEntry, false, - std::auto_ptr<Entry>(new Entry(OBJ_TYPE_MODULE)) - ); - SAL_WNODEPRECATED_DECLARATIONS_POP + pNewLibEntry, false, &e); DBG_ASSERT( pEntry_, "InsertEntry fehlgeschlagen!" ); pBasicBox->SetCurEntry( pEntry_ ); pBasicBox->Select( pBasicBox->GetCurEntry() ); // OV-Bug?! diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx index 0d27f1bc9f66..793e873e3e3f 100644 --- a/basctl/source/basicide/moduldlg.cxx +++ b/basctl/source/basicide/moduldlg.cxx @@ -855,14 +855,11 @@ void ObjectPage::NewDialog() SvTreeListEntry* pEntry = m_pBasicBox->FindEntry( pLibEntry, aDlgName, OBJ_TYPE_DIALOG ); if ( !pEntry ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH + o3tl::heap_ptr<Entry> e(new Entry(OBJ_TYPE_DIALOG)); pEntry = m_pBasicBox->AddEntry( aDlgName, Image( IDEResId( RID_IMG_DIALOG ) ), - pLibEntry, false, - std::auto_ptr<Entry>(new Entry(OBJ_TYPE_DIALOG)) - ); - SAL_WNODEPRECATED_DECLARATIONS_POP + pLibEntry, false, &e); DBG_ASSERT( pEntry, "InsertEntry fehlgeschlagen!" ); } m_pBasicBox->SetCurEntry( pEntry ); @@ -1013,14 +1010,11 @@ SbModule* createModImpl( Window* pWin, const ScriptDocument& rDocument, SvTreeListEntry* pEntry = rBasicBox.FindEntry( pSubRootEntry, aModName, OBJ_TYPE_MODULE ); if ( !pEntry ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH + o3tl::heap_ptr<Entry> e(new Entry(OBJ_TYPE_MODULE)); pEntry = rBasicBox.AddEntry( aModName, Image( IDEResId( RID_IMG_MODULE ) ), - pSubRootEntry, false, - std::auto_ptr<Entry>(new Entry(OBJ_TYPE_MODULE)) - ); - SAL_WNODEPRECATED_DECLARATIONS_POP + pSubRootEntry, false, &e); DBG_ASSERT( pEntry, "InsertEntry fehlgeschlagen!" ); } rBasicBox.SetCurEntry( pEntry ); |