summaryrefslogtreecommitdiff
path: root/fpicker
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-04-28 11:41:31 +0100
committerMichael Meeks <michael.meeks@collabora.com>2015-04-28 15:08:48 +0100
commite8b97a52c96df9c8e8055407b1e40ed7cb9cfc67 (patch)
treeb322529f4a54a6427862cb20cb4cf87fb6a5d065 /fpicker
parent2b0be6c0e9d23f1b8535ba7033732ae2e3bfb5c9 (diff)
parent0cde74f788a054fa2b65107a030dd463b8d11c7a (diff)
Merge remote-tracking branch 'origin/feature/vclptr'
Resolve several thousand lines of conflicts. Conflicts: accessibility/source/extended/accessiblelistbox.cxx accessibility/source/standard/vclxaccessiblecombobox.cxx accessibility/source/standard/vclxaccessibledropdowncombobox.cxx accessibility/source/standard/vclxaccessibledropdownlistbox.cxx accessibility/source/standard/vclxaccessiblelistbox.cxx accessibility/source/standard/vclxaccessibletextfield.cxx basctl/source/basicide/basidesh.cxx cui/source/inc/chardlg.hxx cui/source/tabpages/tpbitmap.cxx dbaccess/source/ui/dlg/UserAdmin.cxx dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx extensions/source/propctrlr/propertyeditor.hxx extensions/source/scanner/sanedlg.cxx filter/source/pdf/impdialog.cxx include/sfx2/mgetempl.hxx include/sfx2/sidebar/SidebarToolBox.hxx include/sfx2/viewsh.hxx include/svtools/brwbox.hxx include/svtools/filectrl.hxx include/svtools/scrwin.hxx include/svx/dlgctrl.hxx include/svx/sidebar/Popup.hxx include/svx/sidebar/PopupContainer.hxx include/svx/sidebar/PopupControl.hxx include/svx/sidebar/SidebarDialControl.hxx include/svx/sidebar/ValueSetWithTextControl.hxx sc/source/ui/condformat/condformatdlgentry.cxx sc/source/ui/navipi/navipi.cxx sc/source/ui/sidebar/CellBorderStyleControl.hxx sd/source/ui/animations/CustomAnimationDialog.cxx sd/source/ui/inc/DrawViewShell.hxx sd/source/ui/inc/Ruler.hxx sd/source/ui/inc/SlideSorter.hxx sd/source/ui/inc/ViewTabBar.hxx sd/source/ui/inc/Window.hxx sd/source/ui/inc/morphdlg.hxx sd/source/ui/inc/sdpreslt.hxx sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx sd/source/ui/sidebar/LayoutMenu.hxx sd/source/ui/sidebar/MasterPagesSelector.hxx sd/source/ui/sidebar/NavigatorWrapper.hxx sd/source/ui/sidebar/PanelBase.hxx sd/source/ui/sidebar/RecentMasterPagesSelector.cxx sd/source/ui/sidebar/RecentMasterPagesSelector.hxx sd/source/ui/slideshow/showwindow.hxx sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx sd/source/ui/slidesorter/view/SlsLayeredDevice.hxx sd/source/ui/view/ViewShellBase.cxx sd/source/ui/view/drviewsa.cxx sfx2/source/appl/fileobj.hxx sfx2/source/appl/opengrf.cxx sfx2/source/control/thumbnailviewacc.hxx sfx2/source/dialog/securitypage.cxx sfx2/source/dialog/templdlg.cxx sfx2/source/doc/docinsert.cxx sfx2/source/doc/guisaveas.cxx sfx2/source/inc/alienwarn.hxx sfx2/source/sidebar/Deck.cxx sfx2/source/sidebar/Deck.hxx sfx2/source/sidebar/DeckTitleBar.cxx sfx2/source/sidebar/DeckTitleBar.hxx sfx2/source/sidebar/MenuButton.cxx sfx2/source/sidebar/MenuButton.hxx sfx2/source/sidebar/Panel.cxx sfx2/source/sidebar/Panel.hxx sfx2/source/sidebar/PanelTitleBar.hxx sfx2/source/sidebar/SidebarDockingWindow.hxx sfx2/source/sidebar/SidebarToolBox.cxx sfx2/source/sidebar/TabBar.hxx sfx2/source/sidebar/TabItem.cxx sfx2/source/sidebar/TabItem.hxx sfx2/source/sidebar/TitleBar.hxx sfx2/source/toolbox/imgmgr.cxx starmath/inc/edit.hxx starmath/inc/smmod.hxx starmath/qa/cppunit/test_starmath.cxx starmath/source/edit.cxx starmath/source/smmod.cxx svtools/source/brwbox/brwbox1.cxx svtools/source/brwbox/datwin.hxx svtools/source/contnr/fileview.cxx svtools/source/contnr/simptabl.cxx svtools/source/control/filectrl.cxx svtools/source/control/valueimp.hxx svx/inc/GalleryControl.hxx svx/source/dialog/dlgctrl.cxx svx/source/dialog/swframeexample.cxx svx/source/fmcomp/fmgridif.cxx svx/source/gallery2/GalleryControl.cxx svx/source/sidebar/EmptyPanel.hxx svx/source/sidebar/area/AreaPropertyPanel.hxx svx/source/sidebar/area/AreaTransparencyGradientControl.hxx svx/source/sidebar/graphic/GraphicPropertyPanel.hxx svx/source/sidebar/insert/InsertPropertyPanel.cxx svx/source/sidebar/insert/InsertPropertyPanel.hxx svx/source/sidebar/line/LinePropertyPanel.hxx svx/source/sidebar/line/LineWidthControl.cxx svx/source/sidebar/line/LineWidthControl.hxx svx/source/sidebar/line/LineWidthValueSet.hxx svx/source/sidebar/paragraph/ParaPropertyPanel.hxx svx/source/sidebar/possize/SidebarDialControl.cxx svx/source/sidebar/text/TextCharacterSpacingPopup.hxx svx/source/sidebar/text/TextPropertyPanel.hxx svx/source/sidebar/tools/PopupContainer.cxx svx/source/sidebar/tools/PopupControl.cxx svx/source/sidebar/tools/ValueSetWithTextControl.cxx svx/source/svdraw/svdfmtf.hxx svx/source/svdraw/svdibrow.cxx svx/source/tbxctrls/colrctrl.cxx svx/source/tbxctrls/tbcontrl.cxx sw/source/ui/dbui/mmaddressblockpage.cxx sw/source/ui/dialog/uiregionsw.cxx sw/source/ui/index/cnttab.cxx sw/source/uibase/inc/drpcps.hxx sw/source/uibase/sidebar/PageColumnControl.hxx sw/source/uibase/sidebar/PageMarginControl.hxx sw/source/uibase/sidebar/PageOrientationControl.hxx sw/source/uibase/sidebar/PagePropertyPanel.hxx sw/source/uibase/sidebar/PageSizeControl.hxx sw/source/uibase/uiview/view2.cxx sw/source/uibase/utlui/navipi.cxx vcl/inc/svdata.hxx vcl/source/control/combobox.cxx vcl/source/control/lstbox.cxx vcl/source/window/dockwin.cxx vcl/source/window/winproc.cxx Change-Id: I056cf3026ff17d65cca0b6e6588bda4a88fa8d95
Diffstat (limited to 'fpicker')
-rw-r--r--fpicker/source/office/OfficeControlAccess.hxx2
-rw-r--r--fpicker/source/office/OfficeFilePicker.cxx4
-rw-r--r--fpicker/source/office/OfficeFilePicker.hxx2
-rw-r--r--fpicker/source/office/OfficeFolderPicker.cxx4
-rw-r--r--fpicker/source/office/OfficeFolderPicker.hxx2
-rw-r--r--fpicker/source/office/PlacesListBox.cxx39
-rw-r--r--fpicker/source/office/PlacesListBox.hxx14
-rw-r--r--fpicker/source/office/QueryFolderName.hxx8
-rw-r--r--fpicker/source/office/asyncfilepicker.hxx5
-rw-r--r--fpicker/source/office/commonpicker.cxx12
-rw-r--r--fpicker/source/office/commonpicker.hxx5
-rw-r--r--fpicker/source/office/iodlg.cxx87
-rw-r--r--fpicker/source/office/iodlg.hxx23
-rw-r--r--fpicker/source/office/iodlgimp.cxx11
-rw-r--r--fpicker/source/office/iodlgimp.hxx51
-rw-r--r--fpicker/test/svdem.cxx3
16 files changed, 164 insertions, 108 deletions
diff --git a/fpicker/source/office/OfficeControlAccess.hxx b/fpicker/source/office/OfficeControlAccess.hxx
index 3214ebe534b4..e1ff8050c23c 100644
--- a/fpicker/source/office/OfficeControlAccess.hxx
+++ b/fpicker/source/office/OfficeControlAccess.hxx
@@ -46,7 +46,7 @@ namespace svt
class OControlAccess
{
IFilePickerController* m_pFilePickerController;
- SvtFileView* m_pFileView;
+ VclPtr<SvtFileView> m_pFileView;
public:
OControlAccess( IFilePickerController* _pController, SvtFileView* _pFileView );
diff --git a/fpicker/source/office/OfficeFilePicker.cxx b/fpicker/source/office/OfficeFilePicker.cxx
index f9d755ac4fcc..6fd28edfd242 100644
--- a/fpicker/source/office/OfficeFilePicker.cxx
+++ b/fpicker/source/office/OfficeFilePicker.cxx
@@ -463,12 +463,12 @@ sal_Int16 SvtFilePicker::implExecutePicker( )
}
-SvtFileDialog* SvtFilePicker::implCreateDialog( vcl::Window* _pParent )
+VclPtr<SvtFileDialog> SvtFilePicker::implCreateDialog( vcl::Window* _pParent )
{
WinBits nExtraBits;
WinBits nBits = getWinBits( nExtraBits );
- SvtFileDialog* dialog = new SvtFileDialog( _pParent, nBits, nExtraBits );
+ VclPtrInstance<SvtFileDialog> dialog( _pParent, nBits, nExtraBits );
// Set StandardDir if present
if ( !m_aStandardDir.isEmpty())
diff --git a/fpicker/source/office/OfficeFilePicker.hxx b/fpicker/source/office/OfficeFilePicker.hxx
index 65e4eab4b970..fa8313e16a85 100644
--- a/fpicker/source/office/OfficeFilePicker.hxx
+++ b/fpicker/source/office/OfficeFilePicker.hxx
@@ -205,7 +205,7 @@ protected:
// OCommonPicker overridables
- virtual SvtFileDialog* implCreateDialog( vcl::Window* _pParent ) SAL_OVERRIDE;
+ virtual VclPtr<SvtFileDialog> implCreateDialog( vcl::Window* _pParent ) SAL_OVERRIDE;
virtual sal_Int16 implExecutePicker( ) SAL_OVERRIDE;
virtual bool implHandleInitializationArgument(
const OUString& _rName,
diff --git a/fpicker/source/office/OfficeFolderPicker.cxx b/fpicker/source/office/OfficeFolderPicker.cxx
index de062ac8e7cc..8f524856884c 100644
--- a/fpicker/source/office/OfficeFolderPicker.cxx
+++ b/fpicker/source/office/OfficeFolderPicker.cxx
@@ -69,9 +69,9 @@ void SAL_CALL SvtFolderPicker::startExecuteModal( const Reference< ::com::sun::s
getDialog()->StartExecuteModal( LINK( this, SvtFolderPicker, DialogClosedHdl ) );
}
-SvtFileDialog* SvtFolderPicker::implCreateDialog( vcl::Window* _pParent )
+VclPtr<SvtFileDialog> SvtFolderPicker::implCreateDialog( vcl::Window* _pParent )
{
- return new SvtFileDialog( _pParent, SFXWB_PATHDIALOG );
+ return VclPtr<SvtFileDialog>::Create( _pParent, SFXWB_PATHDIALOG );
}
sal_Int16 SvtFolderPicker::implExecutePicker( )
diff --git a/fpicker/source/office/OfficeFolderPicker.hxx b/fpicker/source/office/OfficeFolderPicker.hxx
index 6261c50f74f0..266c99cbef8a 100644
--- a/fpicker/source/office/OfficeFolderPicker.hxx
+++ b/fpicker/source/office/OfficeFolderPicker.hxx
@@ -99,7 +99,7 @@ protected:
// OCommonPicker overridables
- virtual SvtFileDialog* implCreateDialog( vcl::Window* _pParent ) SAL_OVERRIDE;
+ virtual VclPtr<SvtFileDialog> implCreateDialog( vcl::Window* _pParent ) SAL_OVERRIDE;
virtual sal_Int16 implExecutePicker( ) SAL_OVERRIDE;
};
diff --git a/fpicker/source/office/PlacesListBox.cxx b/fpicker/source/office/PlacesListBox.cxx
index d5baa25babdd..5d75edd0e095 100644
--- a/fpicker/source/office/PlacesListBox.cxx
+++ b/fpicker/source/office/PlacesListBox.cxx
@@ -24,7 +24,7 @@ PlacesListBox_Impl::PlacesListBox_Impl( PlacesListBox* pParent, const OUString&
mpParent( pParent )
{
Size aBoxSize = pParent->GetSizePixel( );
- mpHeaderBar = new HeaderBar( pParent, WB_BUTTONSTYLE | WB_BOTTOMBORDER );
+ mpHeaderBar = VclPtr<HeaderBar>::Create( pParent, WB_BUTTONSTYLE | WB_BOTTOMBORDER );
mpHeaderBar->SetPosSizePixel( Point( 0, 0 ), Size( 600, 16 ) );
long pTabs[] = { 2, 20, 600 };
@@ -43,8 +43,14 @@ PlacesListBox_Impl::PlacesListBox_Impl( PlacesListBox* pParent, const OUString&
PlacesListBox_Impl::~PlacesListBox_Impl( )
{
- delete mpHeaderBar;
- mpParent = NULL;
+ disposeOnce();
+}
+
+void PlacesListBox_Impl::dispose()
+{
+ mpHeaderBar.disposeAndClear();
+ mpParent.clear();
+ SvHeaderTabListBox::dispose();
}
void PlacesListBox_Impl::MouseButtonUp( const MouseEvent& rMEvt )
@@ -64,17 +70,17 @@ PlacesListBox::PlacesListBox( vcl::Window* pParent, SvtFileDialog* pFileDlg, con
mbUpdated( false ),
mbSelectionChanged( false )
{
- mpImpl = new PlacesListBox_Impl( this, rTitle );
+ mpImpl = VclPtr<PlacesListBox_Impl>::Create( this, rTitle );
mpImpl->SetSelectHdl( LINK( this, PlacesListBox, Selection ) );
mpImpl->SetDoubleClickHdl( LINK( this, PlacesListBox, DoubleClick ) ) ;
- mpAddBtn = new ImageButton( this, 0 );
+ mpAddBtn.reset( VclPtr<ImageButton>::Create( this, 0 ) );
mpAddBtn->SetText( OUString( "+" ) );
mpAddBtn->SetPosSizePixel( Point( 0, 0 ), Size( 22, 22 ) );
mpAddBtn->Show();
- mpDelBtn = new ImageButton( this, 0 );
+ mpDelBtn.reset( VclPtr<ImageButton>::Create( this, 0 ) );
mpDelBtn->SetText( OUString( "-" ) );
mpDelBtn->SetPosSizePixel( Point( 0, 0 ), Size( 22, 22 ) );
mpDelBtn->Show();
@@ -82,9 +88,16 @@ PlacesListBox::PlacesListBox( vcl::Window* pParent, SvtFileDialog* pFileDlg, con
PlacesListBox::~PlacesListBox( )
{
- delete mpImpl;
- delete mpAddBtn;
- delete mpDelBtn;
+ disposeOnce();
+}
+
+void PlacesListBox::dispose()
+{
+ mpImpl.disposeAndClear();
+ mpAddBtn.disposeAndClear();
+ mpDelBtn.disposeAndClear();
+ mpDlg.clear();
+ Control::dispose();
}
void PlacesListBox::AppendPlace( PlacePtr pPlace )
@@ -181,13 +194,13 @@ IMPL_LINK ( PlacesListBox, DoubleClick, void*, EMPTYARG )
PlacePtr pPlace = maPlaces[nSelected];
if ( pPlace->IsEditable() && !pPlace->IsLocal( ) )
{
- PlaceEditDialog aDlg( mpDlg, pPlace );
- short aRetCode = aDlg.Execute();
+ ScopedVclPtrInstance< PlaceEditDialog > aDlg(mpDlg, pPlace);
+ short aRetCode = aDlg->Execute();
switch(aRetCode) {
case RET_OK :
{
- pPlace->SetName ( aDlg.GetServerName() );
- pPlace->SetUrl( aDlg.GetServerUrl() );
+ pPlace->SetName ( aDlg->GetServerName() );
+ pPlace->SetUrl( aDlg->GetServerUrl() );
mbUpdated = true;
break;
}
diff --git a/fpicker/source/office/PlacesListBox.hxx b/fpicker/source/office/PlacesListBox.hxx
index 8fa24beb2907..0cf700d6b142 100644
--- a/fpicker/source/office/PlacesListBox.hxx
+++ b/fpicker/source/office/PlacesListBox.hxx
@@ -23,12 +23,13 @@ class PlacesListBox;
class PlacesListBox_Impl : public SvHeaderTabListBox
{
private:
- HeaderBar* mpHeaderBar;
- PlacesListBox* mpParent;
+ VclPtr<HeaderBar> mpHeaderBar;
+ VclPtr<PlacesListBox> mpParent;
public:
PlacesListBox_Impl( PlacesListBox* pParent, const OUString& rTitle );
virtual ~PlacesListBox_Impl( );
+ virtual void dispose() SAL_OVERRIDE;
virtual void MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
};
@@ -39,10 +40,10 @@ class PlacesListBox : public Control
{
private:
std::vector< PlacePtr > maPlaces;
- SvtFileDialog* mpDlg;
- PlacesListBox_Impl* mpImpl;
- PushButton* mpAddBtn;
- PushButton* mpDelBtn;
+ VclPtr<SvtFileDialog> mpDlg;
+ VclPtr<PlacesListBox_Impl> mpImpl;
+ VclPtr<PushButton> mpAddBtn;
+ VclPtr<PushButton> mpDelBtn;
sal_Int32 mnNbEditables;
bool mbUpdated;
bool mbSelectionChanged;
@@ -50,6 +51,7 @@ class PlacesListBox : public Control
public:
PlacesListBox( vcl::Window* pParent, SvtFileDialog* pFileDlg, const OUString& rTitle, WinBits nBits );
virtual ~PlacesListBox( );
+ virtual void dispose() SAL_OVERRIDE;
void AppendPlace( PlacePtr pPlace );
void RemovePlace( sal_uInt16 nPos );
diff --git a/fpicker/source/office/QueryFolderName.hxx b/fpicker/source/office/QueryFolderName.hxx
index 49733bbb46a4..cf864aff88ef 100644
--- a/fpicker/source/office/QueryFolderName.hxx
+++ b/fpicker/source/office/QueryFolderName.hxx
@@ -28,9 +28,9 @@
class QueryFolderNameDialog : public ModalDialog
{
private:
- Edit* m_pNameEdit;
- VclFrame* m_pNameLine;
- OKButton* m_pOKBtn;
+ VclPtr<Edit> m_pNameEdit;
+ VclPtr<VclFrame> m_pNameLine;
+ VclPtr<OKButton> m_pOKBtn;
DECL_LINK( OKHdl, void * );
DECL_LINK( NameHdl, void * );
@@ -38,6 +38,8 @@ private:
public:
QueryFolderNameDialog(vcl::Window* _pParent, const OUString& rTitle,
const OUString& rDefaultText, OUString* pGroupName = NULL);
+ virtual ~QueryFolderNameDialog();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetName() const { return m_pNameEdit->GetText(); }
};
diff --git a/fpicker/source/office/asyncfilepicker.hxx b/fpicker/source/office/asyncfilepicker.hxx
index a2dfa11c7076..2174eb50e6ca 100644
--- a/fpicker/source/office/asyncfilepicker.hxx
+++ b/fpicker/source/office/asyncfilepicker.hxx
@@ -25,6 +25,7 @@
#include <rtl/ustring.hxx>
#include <com/sun/star/uno/Sequence.h>
#include <salhelper/simplereferenceobject.hxx>
+#include <vcl/vclptr.hxx>
class SvtFileView;
class SvtFileDialog;
@@ -52,8 +53,8 @@ namespace svt
private:
Action m_eAction;
- SvtFileView* m_pView;
- SvtFileDialog* m_pDialog;
+ VclPtr<SvtFileView> m_pView;
+ VclPtr<SvtFileDialog> m_pDialog;
OUString m_sURL;
OUString m_sFileName;
bool m_bRunning;
diff --git a/fpicker/source/office/commonpicker.cxx b/fpicker/source/office/commonpicker.cxx
index c6da4db6ac26..b3192d2c419d 100644
--- a/fpicker/source/office/commonpicker.cxx
+++ b/fpicker/source/office/commonpicker.cxx
@@ -123,8 +123,7 @@ namespace svt
m_pDlg->EndDialog( RET_CANCEL );
}
- delete m_pDlg;
- m_pDlg = NULL;
+ m_pDlg.disposeAndClear();
m_xWindow = NULL;
m_xDialogParent = NULL;
}
@@ -150,9 +149,10 @@ namespace svt
stopWindowListening();
if ( !bDialogDying ) // it's the parent which is dying -> delete the dialog
- delete m_pDlg;
+ m_pDlg.disposeAndClear();
+ else
+ m_pDlg.clear();
- m_pDlg = NULL;
m_xWindow = NULL;
m_xDialogParent = NULL;
}
@@ -201,7 +201,7 @@ namespace svt
{
if ( !m_pDlg )
{
- m_pDlg = implCreateDialog( VCLUnoHelper::GetWindow( m_xDialogParent ) );
+ m_pDlg.reset( implCreateDialog( VCLUnoHelper::GetWindow( m_xDialogParent ) ) );
DBG_ASSERT( m_pDlg, "OCommonPicker::createPicker: invalid dialog returned!" );
if ( m_pDlg )
@@ -240,7 +240,7 @@ namespace svt
}
}
- return NULL != m_pDlg;
+ return nullptr != m_pDlg;
}
diff --git a/fpicker/source/office/commonpicker.hxx b/fpicker/source/office/commonpicker.hxx
index a0cb97896b4c..a08c31ee2ba0 100644
--- a/fpicker/source/office/commonpicker.hxx
+++ b/fpicker/source/office/commonpicker.hxx
@@ -33,6 +33,7 @@
#include <comphelper/proparrhlp.hxx>
#include <comphelper/uno3.hxx>
#include <tools/link.hxx>
+#include <vcl/vclptr.hxx>
class SvtFileDialog;
namespace vcl { class Window; }
@@ -64,7 +65,7 @@ namespace svt
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xWindow;
// </properties>
- SvtFileDialog* m_pDlg;
+ VclPtr<SvtFileDialog> m_pDlg;
ImplSVEvent * m_nCancelEvent;
bool m_bExecuting;
@@ -92,7 +93,7 @@ namespace svt
// overridables
// will be called with locked SolarMutex
- virtual SvtFileDialog* implCreateDialog( vcl::Window* _pParent ) = 0;
+ virtual VclPtr<SvtFileDialog> implCreateDialog( vcl::Window* _pParent ) = 0;
virtual sal_Int16 implExecutePicker( ) = 0;
// do NOT override XExecutableDialog::execute! We need to do some stuff there ourself ...
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index 93ace60721cd..fda0c56321b9 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -348,8 +348,8 @@ SvtFileDialog::SvtFileDialog ( vcl::Window* _pParent, WinBits nBits )
class CustomContainer : public vcl::Window
{
SvtExpFileDlg_Impl* _pImp;
- SvtFileView* _pFileView;
- Splitter* _pSplitter;
+ VclPtr<SvtFileView> _pFileView;
+ VclPtr<Splitter> _pSplitter;
public:
CustomContainer(vcl::Window *pParent)
@@ -359,6 +359,13 @@ public:
, _pSplitter(NULL)
{
}
+ virtual ~CustomContainer() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE
+ {
+ _pFileView.clear();
+ _pSplitter.clear();
+ vcl::Window::dispose();
+ }
void init(SvtExpFileDlg_Impl* pImp,
SvtFileView* pFileView,
@@ -404,6 +411,11 @@ public:
SvtFileDialog::~SvtFileDialog()
{
+ disposeOnce();
+}
+
+void SvtFileDialog::dispose()
+{
if ( !_pImp->_aIniKey.isEmpty() )
{
// save window state
@@ -437,10 +449,17 @@ SvtFileDialog::~SvtFileDialog()
}
delete _pImp;
- delete _pFileView;
- delete _pSplitter;
- delete _pContainer;
- delete _pPrevBmp;
+ _pFileView.disposeAndClear();
+ _pSplitter.disposeAndClear();
+ _pContainer.disposeAndClear();
+ _pPrevBmp.disposeAndClear();
+ _pCbReadOnly.clear();
+ _pCbLinkBox.clear();
+ _pCbPreviewBox.clear();
+ _pCbSelection.clear();
+ _pPbPlay.clear();
+ _pPrevWin.clear();
+ ModalDialog::dispose();
}
void SvtFileDialog::Init_Impl
@@ -480,7 +499,7 @@ void SvtFileDialog::Init_Impl
m_aImages = ImageList( SvtResId( RID_FILEPICKER_IMAGES ) );
vcl::Window *pUpContainer = get<vcl::Window>("up");
- _pImp->_pBtnUp = new SvtUpButton_Impl(pUpContainer, this, 0);
+ _pImp->_pBtnUp = VclPtr<SvtUpButton_Impl>::Create(pUpContainer, this, 0);
_pImp->_pBtnUp->SetHelpId( HID_FILEOPEN_LEVELUP );
_pImp->_pBtnUp->set_vexpand(true);
_pImp->_pBtnUp->Show();
@@ -522,7 +541,7 @@ void SvtFileDialog::Init_Impl
if ( ( nStyle & SFXWB_MULTISELECTION ) == SFXWB_MULTISELECTION )
_pImp->_bMultiSelection = true;
- _pContainer = new CustomContainer(get<vcl::Window>("container"));
+ _pContainer.reset(VclPtr<CustomContainer>::Create(get<vcl::Window>("container")));
Size aSize(LogicToPixel(Size(270, 85), MAP_APPFONT));
_pContainer->set_height_request(aSize.Height());
_pContainer->set_width_request(aSize.Width());
@@ -530,7 +549,7 @@ void SvtFileDialog::Init_Impl
_pContainer->set_vexpand(true);
_pContainer->SetStyle( _pContainer->GetStyle() | WB_TABSTOP );
- _pFileView = new SvtFileView( _pContainer, WB_BORDER,
+ _pFileView = VclPtr<SvtFileView>::Create( _pContainer, WB_BORDER,
FILEDLG_TYPE_PATHDLG == _pImp->_eDlgType,
_pImp->_bMultiSelection );
_pFileView->Show();
@@ -538,7 +557,7 @@ void SvtFileDialog::Init_Impl
_pFileView->SetHelpId( HID_FILEDLG_STANDARD );
_pFileView->SetStyle( _pFileView->GetStyle() | WB_TABSTOP );
- _pSplitter = new Splitter( _pContainer, WB_HSCROLL );
+ _pSplitter = VclPtr<Splitter>::Create( _pContainer, WB_HSCROLL );
_pSplitter->SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor() ));
_pSplitter->SetSplitHdl( LINK( this, SvtFileDialog, Split_Hdl ) );
@@ -662,17 +681,17 @@ IMPL_STATIC_LINK( SvtFileDialog, NewFolderHdl_Impl, PushButton*, EMPTYARG )
SmartContent aContent( pThis->_pFileView->GetViewURL( ) );
OUString aTitle;
aContent.getTitle( aTitle );
- QueryFolderNameDialog aDlg( pThis, aTitle, SVT_RESSTR(STR_SVT_NEW_FOLDER) );
+ ScopedVclPtrInstance< QueryFolderNameDialog > aDlg(pThis, aTitle, SVT_RESSTR(STR_SVT_NEW_FOLDER));
bool bHandled = false;
while ( !bHandled )
{
- if ( aDlg.Execute() == RET_OK )
+ if ( aDlg->Execute() == RET_OK )
{
- OUString aUrl = aContent.createFolder( aDlg.GetName( ) );
+ OUString aUrl = aContent.createFolder( aDlg->GetName( ) );
if ( !aUrl.isEmpty( ) )
{
- pThis->_pFileView->CreatedFolder( aUrl, aDlg.GetName() );
+ pThis->_pFileView->CreatedFolder( aUrl, aDlg->GetName() );
bHandled = true;
}
}
@@ -1046,8 +1065,8 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid )
"$filename$",
aFileObj.getName(INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET)
);
- MessageDialog aBox(pThis, aMsg, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
- if ( aBox.Execute() != RET_YES )
+ ScopedVclPtrInstance< MessageDialog > aBox(pThis, aMsg, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ if ( aBox->Execute() != RET_YES )
return 0;
}
else
@@ -1091,8 +1110,8 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid )
}
sError = sError.replaceFirst( "$name$", sInvalidFile );
- MessageDialog aError(pThis, sError);
- aError.Execute();
+ ScopedVclPtrInstance< MessageDialog > aError(pThis, sError);
+ aError->Execute();
return 0;
}
}
@@ -1244,13 +1263,13 @@ IMPL_STATIC_LINK ( SvtFileDialog, ConnectToServerPressed_Hdl, void*, EMPTYARG )
{
pThis->_pFileView->EndInplaceEditing( false );
- PlaceEditDialog aDlg( pThis );
- short aRetCode = aDlg.Execute();
+ ScopedVclPtrInstance< PlaceEditDialog > aDlg(pThis);
+ short aRetCode = aDlg->Execute();
switch (aRetCode) {
case RET_OK :
{
- PlacePtr newPlace = aDlg.GetPlace();
+ PlacePtr newPlace = aDlg->GetPlace();
pThis->_pImp->_pPlaces->AppendPlace(newPlace);
break;
@@ -1625,7 +1644,7 @@ bool SvtFileDialog::Notify( NotifyEvent& rNEvt )
class SvtDefModalDialogParent_Impl
{
private:
- vcl::Window* _pOld;
+ VclPtr<vcl::Window> _pOld;
public:
SvtDefModalDialogParent_Impl( vcl::Window *pNew ) :
@@ -1812,7 +1831,7 @@ void SvtFileDialog::EnableUI( bool _bEnable )
if ( _bEnable )
{
- for ( ::std::set< Control* >::iterator aLoop = m_aDisabledControls.begin();
+ for ( auto aLoop = m_aDisabledControls.begin();
aLoop != m_aDisabledControls.end();
++aLoop
)
@@ -1835,7 +1854,7 @@ void SvtFileDialog::EnableControl( Control* _pControl, bool _bEnable )
if ( _bEnable )
{
- ::std::set< Control* >::iterator aPos = m_aDisabledControls.find( _pControl );
+ auto aPos = m_aDisabledControls.find( _pControl );
if ( m_aDisabledControls.end() != aPos )
m_aDisabledControls.erase( aPos );
}
@@ -1880,8 +1899,8 @@ short SvtFileDialog::PrepareExecute()
if ( bEmpty )
{
- MessageDialog aBox(this, SVT_RESSTR(STR_SVT_NOREMOVABLEDEVICE));
- aBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aBox(this, SVT_RESSTR(STR_SVT_NOREMOVABLEDEVICE));
+ aBox->Execute();
return 0;
}
}
@@ -2528,7 +2547,7 @@ void SvtFileDialog::AddControls_Impl( )
_pPrevWin->SetOutputSizePixel(Size(200, 300));
_pPrevWin->Show();
- _pPrevBmp = new FixedBitmap( _pPrevWin, WinBits( WB_BORDER ) );
+ _pPrevBmp = VclPtr<FixedBitmap>::Create( _pPrevWin, WinBits( WB_BORDER ) );
_pPrevBmp->SetBackground( Wallpaper( Color( COL_WHITE ) ) );
_pPrevBmp->SetSizePixel(_pPrevWin->GetSizePixel());
_pPrevBmp->Show();
@@ -2593,7 +2612,7 @@ void SvtFileDialog::AddControls_Impl( )
_pImp->_pLbImageTemplates->Show();
}
- _pImp->_pPlaces = new PlacesListBox(_pContainer, this, SVT_RESSTR(STR_PLACES_TITLE), WB_BORDER);
+ _pImp->_pPlaces = VclPtr<PlacesListBox>::Create(_pContainer, this, SVT_RESSTR(STR_PLACES_TITLE), WB_BORDER);
_pImp->_pPlaces->SetHelpId("SVT_HID_FILESAVE_PLACES_LISTBOX");
Size aSize(LogicToPixel(Size(50, 85), MAP_APPFONT));
_pImp->_pPlaces->set_height_request(aSize.Height());
@@ -2829,6 +2848,18 @@ QueryFolderNameDialog::QueryFolderNameDialog(vcl::Window* _pParent,
m_pNameLine->set_label( *pGroupName );
};
+QueryFolderNameDialog::~QueryFolderNameDialog()
+{
+ disposeOnce();
+}
+
+void QueryFolderNameDialog::dispose()
+{
+ m_pNameEdit.clear();
+ m_pNameLine.clear();
+ m_pOKBtn.clear();
+ ModalDialog::dispose();
+}
IMPL_LINK_NOARG(QueryFolderNameDialog, OKHdl)
{
diff --git a/fpicker/source/office/iodlg.hxx b/fpicker/source/office/iodlg.hxx
index 1bb88689b353..d25ce831110e 100644
--- a/fpicker/source/office/iodlg.hxx
+++ b/fpicker/source/office/iodlg.hxx
@@ -82,16 +82,16 @@ class CustomContainer;
class SvtFileDialog : public ModalDialog, public ::svt::IFilePickerController
{
private:
- CheckBox* _pCbReadOnly;
- CheckBox* _pCbLinkBox;
- CheckBox* _pCbPreviewBox;
- CheckBox* _pCbSelection;
- PushButton* _pPbPlay;
- vcl::Window* _pPrevWin;
- FixedBitmap* _pPrevBmp;
- CustomContainer* _pContainer;
- SvtFileView* _pFileView;
- Splitter* _pSplitter;
+ VclPtr<CheckBox> _pCbReadOnly;
+ VclPtr<CheckBox> _pCbLinkBox;
+ VclPtr<CheckBox> _pCbPreviewBox;
+ VclPtr<CheckBox> _pCbSelection;
+ VclPtr<PushButton> _pPbPlay;
+ VclPtr<vcl::Window> _pPrevWin;
+ VclPtr<FixedBitmap> _pPrevBmp;
+ VclPtr<CustomContainer> _pContainer;
+ VclPtr<SvtFileView> _pFileView;
+ VclPtr<Splitter> _pSplitter;
::svt::IFilePickerListener* _pFileNotifier;
SvtExpFileDlg_Impl* _pImp;
WinBits _nExtraBits;
@@ -100,7 +100,7 @@ private:
ImageList m_aImages;
::svt::SmartContent m_aContent;
- ::std::set< Control* > m_aDisabledControls;
+ ::std::set< VclPtr<Control> > m_aDisabledControls;
::utl::OConfigurationNode m_aConfiguration;
::rtl::Reference< ::svt::AsyncPickerAction >
@@ -194,6 +194,7 @@ public:
SvtFileDialog( vcl::Window* _pParent, WinBits nBits, WinBits nExtraBits );
SvtFileDialog( vcl::Window* _pParent, WinBits nBits );
virtual ~SvtFileDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
virtual void StartExecuteModal( const Link& rEndDialogHdl ) SAL_OVERRIDE;
diff --git a/fpicker/source/office/iodlgimp.cxx b/fpicker/source/office/iodlgimp.cxx
index 8994f9a2c027..99cf5b0e8ea6 100644
--- a/fpicker/source/office/iodlgimp.cxx
+++ b/fpicker/source/office/iodlgimp.cxx
@@ -106,7 +106,14 @@ SvtFileDialogURLSelector::SvtFileDialogURLSelector( vcl::Window* _pParent, SvtFi
SvtFileDialogURLSelector::~SvtFileDialogURLSelector()
{
+ disposeOnce();
+}
+
+void SvtFileDialogURLSelector::dispose()
+{
delete m_pMenu;
+ m_pDlg.clear();
+ MenuButton::dispose();
}
@@ -244,10 +251,10 @@ SvtExpFileDlg_Impl::SvtExpFileDlg_Impl( WinBits ) :
SvtExpFileDlg_Impl::~SvtExpFileDlg_Impl()
{
- delete _pBtnUp;
+ _pBtnUp.disposeAndClear();
delete _pUserFilter;
delete _pFilter;
- delete _pPlaces;
+ _pPlaces.disposeAndClear();
}
diff --git a/fpicker/source/office/iodlgimp.hxx b/fpicker/source/office/iodlgimp.hxx
index 2af75e6cb7b1..04b986453a21 100644
--- a/fpicker/source/office/iodlgimp.hxx
+++ b/fpicker/source/office/iodlgimp.hxx
@@ -78,20 +78,19 @@ enum SvtFileDlgType
class SvtFileDialogURLSelector : public MenuButton
{
+public:
+ virtual ~SvtFileDialogURLSelector();
+ virtual void dispose() SAL_OVERRIDE;
private:
- SvtFileDialog* m_pDlg;
+ VclPtr<SvtFileDialog> m_pDlg;
PopupMenu* m_pMenu;
protected:
inline SvtFileDialog* GetDialogParent() { return m_pDlg; }
-protected:
-
virtual void FillURLMenu( PopupMenu* _pMenu ) = 0;
-protected:
SvtFileDialogURLSelector( vcl::Window* _pParent, SvtFileDialog* _pDlg, WinBits nBits, sal_uInt16 _nButtonId );
- virtual ~SvtFileDialogURLSelector();
virtual void Activate() SAL_OVERRIDE;
};
@@ -133,32 +132,32 @@ public:
SvtFileDialogFilterList_Impl* _pFilter;
SvtFileDialogFilter_Impl* _pUserFilter;
- FixedText* _pFtFileName;
- SvtURLBox* _pEdFileName;
+ VclPtr<FixedText> _pFtFileName;
+ VclPtr<SvtURLBox> _pEdFileName;
- FixedText* _pFtFileVersion;
- ListBox* _pLbFileVersion;
+ VclPtr<FixedText> _pFtFileVersion;
+ VclPtr<ListBox> _pLbFileVersion;
- FixedText* _pFtTemplates;
- ListBox* _pLbTemplates;
+ VclPtr<FixedText> _pFtTemplates;
+ VclPtr<ListBox> _pLbTemplates;
- FixedText* _pFtImageTemplates;
- ListBox* _pLbImageTemplates;
+ VclPtr<FixedText> _pFtImageTemplates;
+ VclPtr<ListBox> _pLbImageTemplates;
- FixedText* _pFtFileType;
- ListBox* _pLbFilter;
- PushButton* _pBtnFileOpen;
- PushButton* _pBtnCancel;
- HelpButton* _pBtnHelp;
- SvtUpButton_Impl* _pBtnUp;
- PushButton* _pBtnNewFolder;
- CheckBox* _pCbPassword;
- SvtURLBox* _pEdCurrentPath;
- CheckBox* _pCbAutoExtension;
- CheckBox* _pCbOptions;
+ VclPtr<FixedText> _pFtFileType;
+ VclPtr<ListBox> _pLbFilter;
+ VclPtr<PushButton> _pBtnFileOpen;
+ VclPtr<PushButton> _pBtnCancel;
+ VclPtr<HelpButton> _pBtnHelp;
+ VclPtr<SvtUpButton_Impl> _pBtnUp;
+ VclPtr<PushButton> _pBtnNewFolder;
+ VclPtr<CheckBox> _pCbPassword;
+ VclPtr<SvtURLBox> _pEdCurrentPath;
+ VclPtr<CheckBox> _pCbAutoExtension;
+ VclPtr<CheckBox> _pCbOptions;
- PlacesListBox* _pPlaces;
- PushButton* _pBtnConnectToServer;
+ VclPtr<PlacesListBox> _pPlaces;
+ VclPtr<PushButton> _pBtnConnectToServer;
SvtFileDlgMode _eMode;
SvtFileDlgType _eDlgType;
diff --git a/fpicker/test/svdem.cxx b/fpicker/test/svdem.cxx
index 1f4bc6b58e9f..61217a7c692a 100644
--- a/fpicker/test/svdem.cxx
+++ b/fpicker/test/svdem.cxx
@@ -185,9 +185,8 @@ IMPL_LINK( MyWin, Test, PushButton*, pBtn )
printf("Test\n");
if ( pBtn == &aOKBtn )
{
- SvtFileDialog* pDlg = new SvtFileDialog( this,SFXWB_PATHDIALOG);
+ ScopedVclPtrInstance<SvtFileDialog> pDlg(this,SFXWB_PATHDIALOG);
pDlg->Execute();
- delete pDlg;
printf("ok\n");
}