summaryrefslogtreecommitdiff
path: root/fpicker/source/office
diff options
context:
space:
mode:
Diffstat (limited to 'fpicker/source/office')
-rw-r--r--fpicker/source/office/OfficeControlAccess.hxx2
-rw-r--r--fpicker/source/office/PlacesListBox.cxx14
-rw-r--r--fpicker/source/office/PlacesListBox.hxx12
-rw-r--r--fpicker/source/office/QueryFolderName.hxx8
-rw-r--r--fpicker/source/office/asyncfilepicker.hxx5
-rw-r--r--fpicker/source/office/commonpicker.cxx10
-rw-r--r--fpicker/source/office/commonpicker.hxx3
-rw-r--r--fpicker/source/office/iodlg.cxx43
-rw-r--r--fpicker/source/office/iodlg.hxx22
-rw-r--r--fpicker/source/office/iodlgimp.cxx5
-rw-r--r--fpicker/source/office/iodlgimp.hxx52
11 files changed, 99 insertions, 77 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/PlacesListBox.cxx b/fpicker/source/office/PlacesListBox.cxx
index 23dfa0f185b1..eef7e27a6be8 100644
--- a/fpicker/source/office/PlacesListBox.cxx
+++ b/fpicker/source/office/PlacesListBox.cxx
@@ -48,8 +48,8 @@ PlacesListBox_Impl::~PlacesListBox_Impl( )
void PlacesListBox_Impl::dispose()
{
- delete mpHeaderBar;
- mpParent = NULL;
+ mpHeaderBar.clear();
+ mpParent.clear();
SvHeaderTabListBox::dispose();
}
@@ -93,12 +93,10 @@ PlacesListBox::~PlacesListBox( )
void PlacesListBox::dispose()
{
- delete mpImpl;
- mpImpl = NULL;
- delete mpAddBtn;
- mpAddBtn = NULL;
- delete mpDelBtn;
- mpDelBtn = NULL;
+ mpImpl.clear();
+ mpAddBtn.clear();
+ mpDelBtn.clear();
+ mpDlg.clear();
Control::dispose();
}
diff --git a/fpicker/source/office/PlacesListBox.hxx b/fpicker/source/office/PlacesListBox.hxx
index 9b2443649ebf..0cf700d6b142 100644
--- a/fpicker/source/office/PlacesListBox.hxx
+++ b/fpicker/source/office/PlacesListBox.hxx
@@ -23,8 +23,8 @@ 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 );
@@ -40,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;
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 84488d85a1c8..8243d5159223 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.clear();
m_xWindow = NULL;
m_xDialogParent = NULL;
}
@@ -149,10 +148,7 @@ namespace svt
{
stopWindowListening();
- if ( !bDialogDying ) // it's the parent which is dying -> delete the dialog
- delete m_pDlg;
-
- m_pDlg = NULL;
+ m_pDlg.clear();
m_xWindow = NULL;
m_xDialogParent = NULL;
}
@@ -240,7 +236,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..52141c54598c 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;
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index 2991262b781c..5d93cb1087d5 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() { dispose(); }
+ virtual void dispose() SAL_OVERRIDE
+ {
+ _pFileView.clear();
+ _pSplitter.clear();
+ vcl::Window::dispose();
+ }
void init(SvtExpFileDlg_Impl* pImp,
SvtFileView* pFileView,
@@ -442,10 +449,16 @@ void SvtFileDialog::dispose()
}
delete _pImp;
- delete _pFileView;
- delete _pSplitter;
- delete _pContainer;
- delete _pPrevBmp;
+ _pFileView.clear();
+ _pSplitter.clear();
+ _pContainer.clear();
+ _pPrevBmp.clear();
+ _pCbReadOnly.clear();
+ _pCbLinkBox.clear();
+ _pCbPreviewBox.clear();
+ _pCbSelection.clear();
+ _pPbPlay.clear();
+ _pPrevWin.clear();
ModalDialog::dispose();
}
@@ -1631,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 ) :
@@ -1818,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
)
@@ -1841,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 );
}
@@ -2835,6 +2848,18 @@ QueryFolderNameDialog::QueryFolderNameDialog(vcl::Window* _pParent,
m_pNameLine->set_label( *pGroupName );
};
+QueryFolderNameDialog::~QueryFolderNameDialog()
+{
+ dispose();
+}
+
+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 4a9395778237..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 >
diff --git a/fpicker/source/office/iodlgimp.cxx b/fpicker/source/office/iodlgimp.cxx
index f648d78a4c3d..c06d1bf693ff 100644
--- a/fpicker/source/office/iodlgimp.cxx
+++ b/fpicker/source/office/iodlgimp.cxx
@@ -112,6 +112,7 @@ SvtFileDialogURLSelector::~SvtFileDialogURLSelector()
void SvtFileDialogURLSelector::dispose()
{
delete m_pMenu;
+ m_pDlg.clear();
MenuButton::dispose();
}
@@ -250,10 +251,10 @@ SvtExpFileDlg_Impl::SvtExpFileDlg_Impl( WinBits ) :
SvtExpFileDlg_Impl::~SvtExpFileDlg_Impl()
{
- delete _pBtnUp;
+ _pBtnUp.clear();
delete _pUserFilter;
delete _pFilter;
- delete _pPlaces;
+ _pPlaces.clear();
}
diff --git a/fpicker/source/office/iodlgimp.hxx b/fpicker/source/office/iodlgimp.hxx
index d62479a65f51..04b986453a21 100644
--- a/fpicker/source/office/iodlgimp.hxx
+++ b/fpicker/source/office/iodlgimp.hxx
@@ -78,21 +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 dispose() SAL_OVERRIDE;
virtual void Activate() SAL_OVERRIDE;
};
@@ -134,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;