[Libreoffice-commits] core.git: Branch 'feature/vclptr' - 7 commits - avmedia/inc avmedia/source compilerplugins/clang desktop/source include/sfx2 include/svtools include/toolkit include/vcl sfx2/inc sfx2/source svtools/inc svtools/source toolkit/source vcl/generic vcl/inc vcl/source vcl/unx vcl/workben
Noel Grandin
noel at peralex.com
Thu Apr 9 12:54:59 PDT 2015
avmedia/inc/mediacontrol.hxx | 13
avmedia/source/framework/mediacontrol.cxx | 276 ++++++++-------
avmedia/source/framework/mediaplayer.cxx | 6
avmedia/source/framework/mediatoolbox.cxx | 7
avmedia/source/viewer/mediawindow_impl.cxx | 18 -
avmedia/source/viewer/mediawindow_impl.hxx | 3
compilerplugins/clang/vclwidgets.cxx | 64 +--
desktop/source/splash/splash.cxx | 8
include/sfx2/basedlgs.hxx | 4
include/sfx2/dinfdlg.hxx | 52 +-
include/sfx2/dockwin.hxx | 1
include/sfx2/infobar.hxx | 2
include/sfx2/mgetempl.hxx | 1
include/sfx2/new.hxx | 1
include/sfx2/newstyle.hxx | 3
include/sfx2/printopt.hxx | 1
include/sfx2/prnmon.hxx | 1
include/sfx2/recentdocsview.hxx | 1
include/sfx2/securitypage.hxx | 1
include/sfx2/sidebar/SidebarToolBox.hxx | 1
include/sfx2/styledlg.hxx | 1
include/sfx2/tabdlg.hxx | 2
include/sfx2/taskpane.hxx | 7
include/sfx2/tbxctrl.hxx | 1
include/sfx2/templateabstractview.hxx | 7
include/sfx2/templatedefaultview.hxx | 1
include/sfx2/templatedlg.hxx | 3
include/sfx2/templateinfodlg.hxx | 3
include/sfx2/templatelocalview.hxx | 1
include/sfx2/templateremoteview.hxx | 2
include/sfx2/templdlg.hxx | 1
include/sfx2/thumbnailview.hxx | 1
include/sfx2/titledockwin.hxx | 14
include/svtools/DocumentInfoPreview.hxx | 5
include/svtools/GraphicExportOptionsDialog.hxx | 1
include/svtools/PlaceEditDialog.hxx | 3
include/svtools/addresstemplate.hxx | 1
include/svtools/brwbox.hxx | 10
include/svtools/calendar.hxx | 6
include/svtools/ctrlbox.hxx | 5
include/svtools/editbrowsebox.hxx | 2
include/svtools/editsyntaxhighlighter.hxx | 1
include/svtools/filectrl.hxx | 21 -
include/svtools/fileview.hxx | 1
include/svtools/fmtfield.hxx | 2
include/svtools/headbar.hxx | 1
include/svtools/hyperlabel.hxx | 3
include/svtools/inettbc.hxx | 1
include/svtools/ivctrl.hxx | 1
include/svtools/prnsetup.hxx | 3
include/svtools/roadmapwizard.hxx | 3
include/svtools/ruler.hxx | 1
include/svtools/scrwin.hxx | 10
include/svtools/simptabl.hxx | 7
include/svtools/svmedit2.hxx | 3
include/svtools/svtabbx.hxx | 4
include/svtools/tabbar.hxx | 1
include/svtools/toolbarmenu.hxx | 1
include/svtools/toolpanel/paneltabbar.hxx | 1
include/svtools/toolpanel/toolpaneldeck.hxx | 1
include/svtools/treelistbox.hxx | 1
include/svtools/valueset.hxx | 3
include/svtools/wizardmachine.hxx | 2
include/svtools/wizdlg.hxx | 1
include/toolkit/awt/scrollabledialog.hxx | 5
include/vcl/btndlg.hxx | 1
include/vcl/button.hxx | 10
include/vcl/combobox.hxx | 7
include/vcl/ctrl.hxx | 1
include/vcl/dialog.hxx | 4
include/vcl/dockingarea.hxx | 1
include/vcl/dockwin.hxx | 1
include/vcl/edit.hxx | 2
include/vcl/field.hxx | 10
include/vcl/fixed.hxx | 2
include/vcl/fixedhyper.hxx | 5
include/vcl/floatwin.hxx | 1
include/vcl/introwin.hxx | 6
include/vcl/longcurr.hxx | 2
include/vcl/lstbox.hxx | 1
include/vcl/menubtn.hxx | 1
include/vcl/morebtn.hxx | 3
include/vcl/msgbox.hxx | 3
include/vcl/openglwin.hxx | 6
include/vcl/popupmenuwindow.hxx | 1
include/vcl/prgsbar.hxx | 5
include/vcl/scrbar.hxx | 1
include/vcl/spin.hxx | 1
include/vcl/spinfld.hxx | 6
include/vcl/split.hxx | 3
include/vcl/splitwin.hxx | 3
include/vcl/status.hxx | 9
include/vcl/syschild.hxx | 1
include/vcl/syswin.hxx | 4
include/vcl/tabctrl.hxx | 7
include/vcl/tabdlg.hxx | 3
include/vcl/throbber.hxx | 1
include/vcl/toolbox.hxx | 3
include/vcl/vclmedit.hxx | 6
include/vcl/wrkwin.hxx | 1
sfx2/inc/srchdlg.hxx | 7
sfx2/source/appl/newhelp.cxx | 172 +++++----
sfx2/source/appl/newhelp.hxx | 27 -
sfx2/source/control/recentdocsview.cxx | 4
sfx2/source/control/templateabstractview.cxx | 36 +-
sfx2/source/control/templatedefaultview.cxx | 4
sfx2/source/control/templatelocalview.cxx | 18 -
sfx2/source/control/templateremoteview.cxx | 6
sfx2/source/control/templatesearchview.cxx | 4
sfx2/source/control/thumbnailview.cxx | 6
sfx2/source/control/thumbnailviewitem.cxx | 5
sfx2/source/dialog/alienwarn.cxx | 6
sfx2/source/dialog/backingwindow.cxx | 6
sfx2/source/dialog/backingwindow.hxx | 1
sfx2/source/dialog/basedlgs.cxx | 36 +-
sfx2/source/dialog/dinfdlg.cxx | 342 ++++++++++---------
sfx2/source/dialog/dockwin.cxx | 15
sfx2/source/dialog/infobar.cxx | 34 +
sfx2/source/dialog/mgetempl.cxx | 11
sfx2/source/dialog/newstyle.cxx | 13
sfx2/source/dialog/partwnd.cxx | 6
sfx2/source/dialog/printopt.cxx | 4
sfx2/source/dialog/recfloat.cxx | 6
sfx2/source/dialog/securitypage.cxx | 4
sfx2/source/dialog/splitwin.cxx | 9
sfx2/source/dialog/srchdlg.cxx | 6
sfx2/source/dialog/styledlg.cxx | 5
sfx2/source/dialog/tabdlg.cxx | 14
sfx2/source/dialog/taskpane.cxx | 63 +--
sfx2/source/dialog/templateinfodlg.cxx | 6
sfx2/source/dialog/templdlg.cxx | 234 ++++++-------
sfx2/source/dialog/titledockwin.cxx | 45 +-
sfx2/source/dialog/versdlg.cxx | 12
sfx2/source/doc/doctemplates.cxx | 9
sfx2/source/doc/new.cxx | 6
sfx2/source/doc/templatedlg.cxx | 8
sfx2/source/inc/alienwarn.hxx | 1
sfx2/source/inc/partwnd.hxx | 1
sfx2/source/inc/recfloat.hxx | 1
sfx2/source/inc/splitwin.hxx | 1
sfx2/source/inc/templatesearchview.hxx | 2
sfx2/source/inc/templdgi.hxx | 13
sfx2/source/inc/versdlg.hxx | 2
sfx2/source/sidebar/Deck.cxx | 12
sfx2/source/sidebar/Deck.hxx | 2
sfx2/source/sidebar/DeckTitleBar.cxx | 14
sfx2/source/sidebar/DeckTitleBar.hxx | 1
sfx2/source/sidebar/MenuButton.cxx | 4
sfx2/source/sidebar/MenuButton.hxx | 1
sfx2/source/sidebar/Panel.cxx | 8
sfx2/source/sidebar/Panel.hxx | 1
sfx2/source/sidebar/PanelTitleBar.cxx | 20 -
sfx2/source/sidebar/PanelTitleBar.hxx | 1
sfx2/source/sidebar/SidebarDockingWindow.cxx | 6
sfx2/source/sidebar/SidebarDockingWindow.hxx | 1
sfx2/source/sidebar/SidebarToolBox.cxx | 8
sfx2/source/sidebar/TabBar.cxx | 8
sfx2/source/sidebar/TabBar.hxx | 1
sfx2/source/sidebar/TabItem.cxx | 4
sfx2/source/sidebar/TabItem.hxx | 1
sfx2/source/sidebar/TitleBar.cxx | 23 -
sfx2/source/sidebar/TitleBar.hxx | 7
sfx2/source/toolbox/tbxitem.cxx | 6
sfx2/source/view/frame2.cxx | 5
sfx2/source/view/printer.cxx | 6
svtools/inc/roadmap.hxx | 1
svtools/inc/table/tablecontrol.hxx | 1
svtools/source/brwbox/brwbox1.cxx | 33 +
svtools/source/brwbox/brwbox2.cxx | 40 +-
svtools/source/brwbox/datwin.cxx | 8
svtools/source/brwbox/datwin.hxx | 3
svtools/source/brwbox/ebbcontrols.cxx | 6
svtools/source/brwbox/editbrowsebox.cxx | 7
svtools/source/contnr/DocumentInfoPreview.cxx | 42 +-
svtools/source/contnr/fileview.cxx | 15
svtools/source/contnr/imivctl.hxx | 7
svtools/source/contnr/imivctl1.cxx | 145 ++++----
svtools/source/contnr/ivctrl.cxx | 6
svtools/source/contnr/simptabl.cxx | 99 ++---
svtools/source/contnr/svimpbox.cxx | 191 +++++-----
svtools/source/contnr/svtabbx.cxx | 12
svtools/source/contnr/treelistbox.cxx | 18 -
svtools/source/control/calendar.cxx | 21 +
svtools/source/control/ctrlbox.cxx | 26 +
svtools/source/control/filectrl.cxx | 54 +--
svtools/source/control/fmtfield.cxx | 10
svtools/source/control/headbar.cxx | 6
svtools/source/control/hyperlabel.cxx | 6
svtools/source/control/inettbc.cxx | 6
svtools/source/control/roadmap.cxx | 12
svtools/source/control/ruler.cxx | 6
svtools/source/control/scrwin.cxx | 89 ++--
svtools/source/control/tabbar.cxx | 6
svtools/source/control/toolbarmenu.cxx | 6
svtools/source/control/valueset.cxx | 6
svtools/source/dialogs/PlaceEditDialog.cxx | 4
svtools/source/dialogs/addresstemplate.cxx | 6
svtools/source/dialogs/prnsetup.cxx | 6
svtools/source/dialogs/roadmapwizard.cxx | 6
svtools/source/dialogs/wizardmachine.cxx | 11
svtools/source/dialogs/wizdlg.cxx | 7
svtools/source/edit/editsyntaxhighlighter.cxx | 4
svtools/source/edit/svmedit2.cxx | 6
svtools/source/filter/GraphicExportOptionsDialog.cxx | 3
svtools/source/filter/exportdialog.cxx | 6
svtools/source/filter/exportdialog.hxx | 7
svtools/source/inc/svimpbox.hxx | 8
svtools/source/table/tablecontrol.cxx | 6
svtools/source/table/tabledatawindow.cxx | 6
svtools/source/table/tabledatawindow.hxx | 1
svtools/source/toolpanel/paneltabbar.cxx | 58 +--
svtools/source/toolpanel/toolpaneldeck.cxx | 27 -
svtools/source/toolpanel/toolpaneldrawer.cxx | 19 -
svtools/source/toolpanel/toolpaneldrawer.hxx | 5
svtools/source/uno/treecontrolpeer.cxx | 7
svtools/source/uno/wizard/wizardshell.cxx | 5
svtools/source/uno/wizard/wizardshell.hxx | 1
toolkit/source/awt/scrollabledialog.cxx | 47 +-
vcl/generic/print/prtsetup.cxx | 14
vcl/generic/print/prtsetup.hxx | 3
vcl/inc/brdwin.hxx | 7
vcl/inc/helpwin.hxx | 7
vcl/inc/ilstbox.hxx | 5
vcl/inc/printdlg.hxx | 3
vcl/source/app/help.cxx | 6
vcl/source/control/button.cxx | 33 -
vcl/source/control/combobox.cxx | 13
vcl/source/control/ctrl.cxx | 6
vcl/source/control/edit.cxx | 4
vcl/source/control/field.cxx | 24 -
vcl/source/control/field2.cxx | 24 -
vcl/source/control/fixed.cxx | 8
vcl/source/control/fixedhyper.cxx | 4
vcl/source/control/ilstbox.cxx | 6
vcl/source/control/longcurr.cxx | 8
vcl/source/control/lstbox.cxx | 6
vcl/source/control/menubtn.cxx | 6
vcl/source/control/morebtn.cxx | 6
vcl/source/control/prgsbar.cxx | 4
vcl/source/control/scrbar.cxx | 6
vcl/source/control/spinbtn.cxx | 4
vcl/source/control/spinfld.cxx | 1
vcl/source/control/tabctrl.cxx | 6
vcl/source/control/throbber.cxx | 6
vcl/source/edit/vclmedit.cxx | 17
vcl/source/window/brdwin.cxx | 8
vcl/source/window/btndlg.cxx | 8
vcl/source/window/dialog.cxx | 10
vcl/source/window/dockingarea.cxx | 6
vcl/source/window/dockmgr.cxx | 14
vcl/source/window/dockwin.cxx | 13
vcl/source/window/floatwin.cxx | 28 +
vcl/source/window/introwin.cxx | 6
vcl/source/window/menubarwindow.cxx | 20 -
vcl/source/window/menubarwindow.hxx | 4
vcl/source/window/menufloatingwindow.cxx | 7
vcl/source/window/menufloatingwindow.hxx | 3
vcl/source/window/msgbox.cxx | 12
vcl/source/window/openglwin.cxx | 8
vcl/source/window/popupmenuwindow.cxx | 6
vcl/source/window/printdlg.cxx | 13
vcl/source/window/scrwnd.cxx | 8
vcl/source/window/scrwnd.hxx | 3
vcl/source/window/split.cxx | 6
vcl/source/window/splitwin.cxx | 6
vcl/source/window/status.cxx | 6
vcl/source/window/syschild.cxx | 8
vcl/source/window/syswin.cxx | 8
vcl/source/window/tabdlg.cxx | 6
vcl/source/window/toolbox.cxx | 6
vcl/source/window/window2.cxx | 8
vcl/source/window/wrkwin.cxx | 6
vcl/unx/generic/app/i18n_status.cxx | 3
vcl/workben/outdevgrind.cxx | 1
vcl/workben/vcldemo.cxx | 13
275 files changed, 2200 insertions(+), 1527 deletions(-)
New commits:
commit 0dfcb43dec1fec3861c87870cc0e5e21ebc06b76
Author: Noel Grandin <noel at peralex.com>
Date: Tue Jan 13 14:50:37 2015 +0200
vcl: VclPtr conversion in avmedia
Change-Id: I6eba828f6d443802361417397cdf643fbd8755c3
diff --git a/avmedia/inc/mediacontrol.hxx b/avmedia/inc/mediacontrol.hxx
index c6e0622..9a1933b 100644
--- a/avmedia/inc/mediacontrol.hxx
+++ b/avmedia/inc/mediacontrol.hxx
@@ -58,6 +58,7 @@ public:
MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyle );
virtual ~MediaControl();
+ virtual void dispose() SAL_OVERRIDE;
const Size& getMinSizePixel() const;
@@ -89,13 +90,13 @@ private:
ImageList maImageList;
Idle maIdle;
MediaItem maItem;
- ToolBox maPlayToolBox;
- Slider maTimeSlider;
- ToolBox maMuteToolBox;
- Slider maVolumeSlider;
- ToolBox maZoomToolBox;
+ VclPtr<ToolBox> maPlayToolBox;
+ VclPtr<Slider> maTimeSlider;
+ VclPtr<ToolBox> maMuteToolBox;
+ VclPtr<Slider> maVolumeSlider;
+ VclPtr<ToolBox> maZoomToolBox;
ListBox* mpZoomListBox;
- Edit maTimeEdit;
+ VclPtr<Edit> maTimeEdit;
Size maMinSize;
MediaControlStyle meControlStyle;
bool mbLocked;
diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx
index 1359261..e222a64 100644
--- a/avmedia/source/framework/mediacontrol.cxx
+++ b/avmedia/source/framework/mediacontrol.cxx
@@ -65,13 +65,13 @@ MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyl
Control( pParent ),
maImageList( SvtMiscOptions().AreCurrentSymbolsLarge() ? AVMEDIA_RESID( AVMEDIA_IMGLST_L ) : AVMEDIA_RESID( AVMEDIA_IMGLST ) ),
maItem( 0, AVMediaSetMask::ALL ),
- maPlayToolBox( this, WB_3DLOOK ),
- maTimeSlider( this, WB_HORZ | WB_DRAG | WB_3DLOOK | WB_SLIDERSET ),
- maMuteToolBox( this, WB_3DLOOK ),
- maVolumeSlider( this, WB_HORZ | WB_DRAG | WB_SLIDERSET ),
- maZoomToolBox( this, WB_3DLOOK ),
- mpZoomListBox( new ListBox( &maZoomToolBox, WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL | WB_3DLOOK ) ),
- maTimeEdit( this, WB_CENTER | WB_READONLY | WB_BORDER | WB_3DLOOK | WB_READONLY ),
+ maPlayToolBox( new ToolBox(this, WB_3DLOOK) ),
+ maTimeSlider( new Slider(this, WB_HORZ | WB_DRAG | WB_3DLOOK | WB_SLIDERSET) ),
+ maMuteToolBox( new ToolBox(this, WB_3DLOOK) ),
+ maVolumeSlider( new Slider(this, WB_HORZ | WB_DRAG | WB_SLIDERSET) ),
+ maZoomToolBox( new ToolBox(this, WB_3DLOOK) ),
+ mpZoomListBox( new ListBox( maZoomToolBox.get(), WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL | WB_3DLOOK ) ),
+ maTimeEdit( new Edit(this, WB_CENTER | WB_READONLY | WB_BORDER | WB_3DLOOK | WB_READONLY) ),
meControlStyle( eControlStyle ),
mbLocked( false )
{
@@ -83,88 +83,88 @@ MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyl
if( MEDIACONTROLSTYLE_SINGLELINE != meControlStyle )
{
- maPlayToolBox.InsertItem( AVMEDIA_TOOLBOXITEM_OPEN, implGetImage( AVMEDIA_IMG_OPEN ), OUString( AVMEDIA_RESID( AVMEDIA_STR_OPEN ) ) );
- maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_OPEN, HID_AVMEDIA_TOOLBOXITEM_OPEN );
+ maPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_OPEN, implGetImage( AVMEDIA_IMG_OPEN ), OUString( AVMEDIA_RESID( AVMEDIA_STR_OPEN ) ) );
+ maPlayToolBox->SetHelpId( AVMEDIA_TOOLBOXITEM_OPEN, HID_AVMEDIA_TOOLBOXITEM_OPEN );
- maPlayToolBox.InsertItem( AVMEDIA_TOOLBOXITEM_INSERT, implGetImage( AVMEDIA_IMG_INSERT ), OUString( AVMEDIA_RESID( AVMEDIA_STR_INSERT ) ) );
- maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_INSERT, HID_AVMEDIA_TOOLBOXITEM_INSERT );
+ maPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_INSERT, implGetImage( AVMEDIA_IMG_INSERT ), OUString( AVMEDIA_RESID( AVMEDIA_STR_INSERT ) ) );
+ maPlayToolBox->SetHelpId( AVMEDIA_TOOLBOXITEM_INSERT, HID_AVMEDIA_TOOLBOXITEM_INSERT );
- maPlayToolBox.InsertSeparator();
+ maPlayToolBox->InsertSeparator();
}
else
{
mpZoomListBox->SetBackground();
- maZoomToolBox.SetBackground();
- maZoomToolBox.SetPaintTransparent( true );
- maPlayToolBox.SetBackground();
- maPlayToolBox.SetPaintTransparent( true );
- maMuteToolBox.SetBackground();
- maMuteToolBox.SetPaintTransparent( true );
+ maZoomToolBox->SetBackground();
+ maZoomToolBox->SetPaintTransparent( true );
+ maPlayToolBox->SetBackground();
+ maPlayToolBox->SetPaintTransparent( true );
+ maMuteToolBox->SetBackground();
+ maMuteToolBox->SetPaintTransparent( true );
}
- maPlayToolBox.InsertItem( AVMEDIA_TOOLBOXITEM_PLAY, implGetImage( AVMEDIA_IMG_PLAY ), OUString( AVMEDIA_RESID( AVMEDIA_STR_PLAY ) ), ToolBoxItemBits::CHECKABLE );
- maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_PLAY, HID_AVMEDIA_TOOLBOXITEM_PLAY );
+ maPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_PLAY, implGetImage( AVMEDIA_IMG_PLAY ), OUString( AVMEDIA_RESID( AVMEDIA_STR_PLAY ) ), ToolBoxItemBits::CHECKABLE );
+ maPlayToolBox->SetHelpId( AVMEDIA_TOOLBOXITEM_PLAY, HID_AVMEDIA_TOOLBOXITEM_PLAY );
- maPlayToolBox.InsertItem( AVMEDIA_TOOLBOXITEM_PAUSE, implGetImage( AVMEDIA_IMG_PAUSE ), OUString( AVMEDIA_RESID( AVMEDIA_STR_PAUSE ) ), ToolBoxItemBits::CHECKABLE );
- maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_PAUSE, HID_AVMEDIA_TOOLBOXITEM_PAUSE );
+ maPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_PAUSE, implGetImage( AVMEDIA_IMG_PAUSE ), OUString( AVMEDIA_RESID( AVMEDIA_STR_PAUSE ) ), ToolBoxItemBits::CHECKABLE );
+ maPlayToolBox->SetHelpId( AVMEDIA_TOOLBOXITEM_PAUSE, HID_AVMEDIA_TOOLBOXITEM_PAUSE );
- maPlayToolBox.InsertItem( AVMEDIA_TOOLBOXITEM_STOP, implGetImage( AVMEDIA_IMG_STOP ), OUString( AVMEDIA_RESID( AVMEDIA_STR_STOP ) ), ToolBoxItemBits::CHECKABLE );
- maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_STOP, HID_AVMEDIA_TOOLBOXITEM_STOP );
+ maPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_STOP, implGetImage( AVMEDIA_IMG_STOP ), OUString( AVMEDIA_RESID( AVMEDIA_STR_STOP ) ), ToolBoxItemBits::CHECKABLE );
+ maPlayToolBox->SetHelpId( AVMEDIA_TOOLBOXITEM_STOP, HID_AVMEDIA_TOOLBOXITEM_STOP );
- maPlayToolBox.InsertSeparator();
+ maPlayToolBox->InsertSeparator();
- maPlayToolBox.InsertItem( AVMEDIA_TOOLBOXITEM_LOOP, implGetImage( AVMEDIA_IMG_ENDLESS ), OUString( AVMEDIA_RESID( AVMEDIA_STR_ENDLESS ) ) );
- maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_LOOP, HID_AVMEDIA_TOOLBOXITEM_LOOP );
+ maPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_LOOP, implGetImage( AVMEDIA_IMG_ENDLESS ), OUString( AVMEDIA_RESID( AVMEDIA_STR_ENDLESS ) ) );
+ maPlayToolBox->SetHelpId( AVMEDIA_TOOLBOXITEM_LOOP, HID_AVMEDIA_TOOLBOXITEM_LOOP );
if( MEDIACONTROLSTYLE_SINGLELINE == meControlStyle )
- maPlayToolBox.InsertSeparator();
-
- maPlayToolBox.SetSelectHdl( LINK( this, MediaControl, implSelectHdl ) );
- maPlayToolBox.SetSizePixel( maPlayToolBox.CalcWindowSizePixel() );
- maPlayToolBox.Show();
- maMinSize = maPlayToolBox.GetSizePixel();
-
- maTimeSlider.SetSlideHdl( LINK( this, MediaControl, implTimeHdl ) );
- maTimeSlider.SetEndSlideHdl( LINK( this, MediaControl, implTimeEndHdl ) );
- maTimeSlider.SetRange( Range( 0, AVMEDIA_TIME_RANGE ) );
- maTimeSlider.SetHelpId( HID_AVMEDIA_TIMESLIDER );
- maTimeSlider.SetUpdateMode( true );
- maTimeSlider.SetSizePixel( Size( 128, maPlayToolBox.GetSizePixel().Height() ) );
- maTimeSlider.Show();
- maMinSize.Width() += maTimeSlider.GetSizePixel().Width();
-
- maTimeEdit.SetText( aTimeText );
- maTimeEdit.SetUpdateMode( true );
- maTimeEdit.SetSizePixel( Size( maTimeEdit.GetTextWidth( aTimeText ) + 8, maPlayToolBox.GetSizePixel().Height() ) );
- maTimeEdit.SetControlBackground( Application::GetSettings().GetStyleSettings().GetWindowColor() );
- maTimeEdit.SetHelpId( HID_AVMEDIA_TIMEEDIT );
- maTimeEdit.Disable();
- maTimeEdit.Show();
- maMinSize.Width() += maTimeEdit.GetSizePixel().Width();
+ maPlayToolBox->InsertSeparator();
+
+ maPlayToolBox->SetSelectHdl( LINK( this, MediaControl, implSelectHdl ) );
+ maPlayToolBox->SetSizePixel( maPlayToolBox->CalcWindowSizePixel() );
+ maPlayToolBox->Show();
+ maMinSize = maPlayToolBox->GetSizePixel();
+
+ maTimeSlider->SetSlideHdl( LINK( this, MediaControl, implTimeHdl ) );
+ maTimeSlider->SetEndSlideHdl( LINK( this, MediaControl, implTimeEndHdl ) );
+ maTimeSlider->SetRange( Range( 0, AVMEDIA_TIME_RANGE ) );
+ maTimeSlider->SetHelpId( HID_AVMEDIA_TIMESLIDER );
+ maTimeSlider->SetUpdateMode( true );
+ maTimeSlider->SetSizePixel( Size( 128, maPlayToolBox->GetSizePixel().Height() ) );
+ maTimeSlider->Show();
+ maMinSize.Width() += maTimeSlider->GetSizePixel().Width();
+
+ maTimeEdit->SetText( aTimeText );
+ maTimeEdit->SetUpdateMode( true );
+ maTimeEdit->SetSizePixel( Size( maTimeEdit->GetTextWidth( aTimeText ) + 8, maPlayToolBox->GetSizePixel().Height() ) );
+ maTimeEdit->SetControlBackground( Application::GetSettings().GetStyleSettings().GetWindowColor() );
+ maTimeEdit->SetHelpId( HID_AVMEDIA_TIMEEDIT );
+ maTimeEdit->Disable();
+ maTimeEdit->Show();
+ maMinSize.Width() += maTimeEdit->GetSizePixel().Width();
if( MEDIACONTROLSTYLE_SINGLELINE == meControlStyle )
- maMuteToolBox.InsertSeparator();
-
- maMuteToolBox.InsertItem( AVMEDIA_TOOLBOXITEM_MUTE, implGetImage( AVMEDIA_IMG_MUTE ), OUString( AVMEDIA_RESID( AVMEDIA_STR_MUTE ) ) );
- maMuteToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_MUTE, HID_AVMEDIA_TOOLBOXITEM_MUTE );
-
- maMuteToolBox.SetSelectHdl( LINK( this, MediaControl, implSelectHdl ) );
- maMuteToolBox.SetSizePixel( maMuteToolBox.CalcWindowSizePixel() );
- maMuteToolBox.Show();
- maMinSize.Width() += maMuteToolBox.GetSizePixel().Width();
-
- maVolumeSlider.SetSlideHdl( LINK( this, MediaControl, implVolumeHdl ) );
- maVolumeSlider.SetEndSlideHdl( LINK( this, MediaControl, implVolumeEndHdl ) );
- maVolumeSlider.SetRange( Range( AVMEDIA_DB_RANGE, 0 ) );
- maVolumeSlider.SetUpdateMode( true );
- maVolumeSlider.SetHelpId( HID_AVMEDIA_VOLUMESLIDER );
- maVolumeSlider.SetSizePixel( Size( 48, maPlayToolBox.GetSizePixel().Height() ) );
- maVolumeSlider.Show();
- maMinSize.Width() += maVolumeSlider.GetSizePixel().Width();
-
- mpZoomListBox->SetSizePixel( Size( maTimeEdit.GetSizePixel().Width(), 260 ) );
+ maMuteToolBox->InsertSeparator();
+
+ maMuteToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_MUTE, implGetImage( AVMEDIA_IMG_MUTE ), OUString( AVMEDIA_RESID( AVMEDIA_STR_MUTE ) ) );
+ maMuteToolBox->SetHelpId( AVMEDIA_TOOLBOXITEM_MUTE, HID_AVMEDIA_TOOLBOXITEM_MUTE );
+
+ maMuteToolBox->SetSelectHdl( LINK( this, MediaControl, implSelectHdl ) );
+ maMuteToolBox->SetSizePixel( maMuteToolBox->CalcWindowSizePixel() );
+ maMuteToolBox->Show();
+ maMinSize.Width() += maMuteToolBox->GetSizePixel().Width();
+
+ maVolumeSlider->SetSlideHdl( LINK( this, MediaControl, implVolumeHdl ) );
+ maVolumeSlider->SetEndSlideHdl( LINK( this, MediaControl, implVolumeEndHdl ) );
+ maVolumeSlider->SetRange( Range( AVMEDIA_DB_RANGE, 0 ) );
+ maVolumeSlider->SetUpdateMode( true );
+ maVolumeSlider->SetHelpId( HID_AVMEDIA_VOLUMESLIDER );
+ maVolumeSlider->SetSizePixel( Size( 48, maPlayToolBox->GetSizePixel().Height() ) );
+ maVolumeSlider->Show();
+ maMinSize.Width() += maVolumeSlider->GetSizePixel().Width();
+
+ mpZoomListBox->SetSizePixel( Size( maTimeEdit->GetSizePixel().Width(), 260 ) );
mpZoomListBox->InsertEntry( OUString( AVMEDIA_RESID( AVMEDIA_STR_ZOOM_50 ) ), AVMEDIA_ZOOMLEVEL_50 );
mpZoomListBox->InsertEntry( OUString( AVMEDIA_RESID( AVMEDIA_STR_ZOOM_100 ) ), AVMEDIA_ZOOMLEVEL_100 );
mpZoomListBox->InsertEntry( OUString( AVMEDIA_RESID( AVMEDIA_STR_ZOOM_200 ) ), AVMEDIA_ZOOMLEVEL_200 );
@@ -172,14 +172,14 @@ MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyl
mpZoomListBox->SetSelectHdl( LINK( this, MediaControl, implZoomSelectHdl ) );
mpZoomListBox->SetHelpId( HID_AVMEDIA_ZOOMLISTBOX );
- maZoomToolBox.InsertItem( AVMEDIA_TOOLBOXITEM_ZOOM, OUString( AVMEDIA_RESID( AVMEDIA_STR_ZOOM ) ) );
- maZoomToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_ZOOM, HID_AVMEDIA_ZOOMLISTBOX );
+ maZoomToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_ZOOM, OUString( AVMEDIA_RESID( AVMEDIA_STR_ZOOM ) ) );
+ maZoomToolBox->SetHelpId( AVMEDIA_TOOLBOXITEM_ZOOM, HID_AVMEDIA_ZOOMLISTBOX );
- maZoomToolBox.SetItemWindow( AVMEDIA_TOOLBOXITEM_ZOOM, mpZoomListBox );
- maZoomToolBox.SetSelectHdl( LINK( this, MediaControl, implSelectHdl ) );
- maZoomToolBox.SetSizePixel( maZoomToolBox.CalcWindowSizePixel() );
- maZoomToolBox.Show();
- maMinSize.Width() += maZoomToolBox.GetSizePixel().Width();
+ maZoomToolBox->SetItemWindow( AVMEDIA_TOOLBOXITEM_ZOOM, mpZoomListBox );
+ maZoomToolBox->SetSelectHdl( LINK( this, MediaControl, implSelectHdl ) );
+ maZoomToolBox->SetSizePixel( maZoomToolBox->CalcWindowSizePixel() );
+ maZoomToolBox->Show();
+ maMinSize.Width() += maZoomToolBox->GetSizePixel().Width();
if( MEDIACONTROLSTYLE_MULTILINE == meControlStyle )
{
@@ -196,8 +196,20 @@ MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyl
MediaControl::~MediaControl()
{
- maZoomToolBox.SetItemWindow( AVMEDIA_TOOLBOXITEM_ZOOM, NULL );
+ dispose();
+}
+
+void MediaControl::dispose()
+{
+ maZoomToolBox->SetItemWindow( AVMEDIA_TOOLBOXITEM_ZOOM, NULL );
delete mpZoomListBox;
+ maTimeEdit.disposeAndClear();
+ maZoomToolBox.disposeAndClear();
+ maVolumeSlider.disposeAndClear();
+ maMuteToolBox.disposeAndClear();
+ maTimeSlider.disposeAndClear();
+ maPlayToolBox.disposeAndClear();
+ Control::dispose();
}
@@ -212,56 +224,56 @@ const Size& MediaControl::getMinSizePixel() const
void MediaControl::Resize()
{
Point aPos( 0, 0 );
- const sal_Int32 nPlayToolBoxWidth = maPlayToolBox.GetSizePixel().Width();
- const sal_Int32 nMuteToolBoxWidth = maMuteToolBox.GetSizePixel().Width();
- const sal_Int32 nVolumeSliderWidth = maVolumeSlider.GetSizePixel().Width();
- const sal_Int32 nZoomToolBoxWidth = maZoomToolBox.GetSizePixel().Width();
- const sal_Int32 nTimeEditWidth = maTimeEdit.GetSizePixel().Width();
- const sal_Int32 nTimeSliderHeight = maTimeSlider.GetSizePixel().Height();
+ const sal_Int32 nPlayToolBoxWidth = maPlayToolBox->GetSizePixel().Width();
+ const sal_Int32 nMuteToolBoxWidth = maMuteToolBox->GetSizePixel().Width();
+ const sal_Int32 nVolumeSliderWidth = maVolumeSlider->GetSizePixel().Width();
+ const sal_Int32 nZoomToolBoxWidth = maZoomToolBox->GetSizePixel().Width();
+ const sal_Int32 nTimeEditWidth = maTimeEdit->GetSizePixel().Width();
+ const sal_Int32 nTimeSliderHeight = maTimeSlider->GetSizePixel().Height();
if( MEDIACONTROLSTYLE_SINGLELINE == meControlStyle )
{
const sal_Int32 nTimeSliderWidth = GetSizePixel().Width() - ( AVMEDIA_CONTROLOFFSET * 3 ) -
nPlayToolBoxWidth - nMuteToolBoxWidth - nVolumeSliderWidth - nTimeEditWidth - nZoomToolBoxWidth;
- maPlayToolBox.SetPosSizePixel( aPos, maPlayToolBox.GetSizePixel() );
+ maPlayToolBox->SetPosSizePixel( aPos, maPlayToolBox->GetSizePixel() );
aPos.X() += nPlayToolBoxWidth;
- maTimeSlider.SetPosSizePixel( aPos, Size( nTimeSliderWidth, nTimeSliderHeight ) );
+ maTimeSlider->SetPosSizePixel( aPos, Size( nTimeSliderWidth, nTimeSliderHeight ) );
aPos.X() += nTimeSliderWidth + AVMEDIA_CONTROLOFFSET;
- maTimeEdit.SetPosSizePixel( aPos, maTimeEdit.GetSizePixel() );
+ maTimeEdit->SetPosSizePixel( aPos, maTimeEdit->GetSizePixel() );
aPos.X() += nTimeEditWidth + AVMEDIA_CONTROLOFFSET;
- maMuteToolBox.SetPosSizePixel( aPos, maMuteToolBox.GetSizePixel() );
+ maMuteToolBox->SetPosSizePixel( aPos, maMuteToolBox->GetSizePixel() );
aPos.X() += nMuteToolBoxWidth;
- maVolumeSlider.SetPosSizePixel( aPos, maVolumeSlider.GetSizePixel() );
+ maVolumeSlider->SetPosSizePixel( aPos, maVolumeSlider->GetSizePixel() );
aPos.X() += nVolumeSliderWidth + AVMEDIA_CONTROLOFFSET;
- maZoomToolBox.SetPosSizePixel( aPos, maZoomToolBox.GetSizePixel() );
+ maZoomToolBox->SetPosSizePixel( aPos, maZoomToolBox->GetSizePixel() );
}
else
{
const sal_Int32 nTimeSliderWidth = GetSizePixel().Width() - AVMEDIA_CONTROLOFFSET - nTimeEditWidth;
- maTimeSlider.SetPosSizePixel( aPos, Size( nTimeSliderWidth, nTimeSliderHeight ) );
+ maTimeSlider->SetPosSizePixel( aPos, Size( nTimeSliderWidth, nTimeSliderHeight ) );
aPos.X() += nTimeSliderWidth + AVMEDIA_CONTROLOFFSET;
- maTimeEdit.SetPosSizePixel( aPos, maTimeEdit.GetSizePixel() );
+ maTimeEdit->SetPosSizePixel( aPos, maTimeEdit->GetSizePixel() );
aPos.X() = 0;
aPos.Y() += nTimeSliderHeight + AVMEDIA_CONTROLOFFSET;
- maPlayToolBox.SetPosSizePixel( aPos, maPlayToolBox.GetSizePixel() );
+ maPlayToolBox->SetPosSizePixel( aPos, maPlayToolBox->GetSizePixel() );
aPos.X() = GetSizePixel().Width() - nVolumeSliderWidth - nMuteToolBoxWidth - nZoomToolBoxWidth - AVMEDIA_CONTROLOFFSET;
- maMuteToolBox.SetPosSizePixel( aPos, maMuteToolBox.GetSizePixel() );
+ maMuteToolBox->SetPosSizePixel( aPos, maMuteToolBox->GetSizePixel() );
aPos.X() += nMuteToolBoxWidth;
- maVolumeSlider.SetPosSizePixel( aPos, maVolumeSlider.GetSizePixel() );
+ maVolumeSlider->SetPosSizePixel( aPos, maVolumeSlider->GetSizePixel() );
aPos.X() = GetSizePixel().Width() - nZoomToolBoxWidth;
- maZoomToolBox.SetPosSizePixel( aPos, maZoomToolBox.GetSizePixel() );
+ maZoomToolBox->SetPosSizePixel( aPos, maZoomToolBox->GetSizePixel() );
}
}
@@ -286,48 +298,48 @@ void MediaControl::implUpdateToolboxes()
{
const bool bValidURL = !maItem.getURL().isEmpty();
- maPlayToolBox.EnableItem( AVMEDIA_TOOLBOXITEM_INSERT, bValidURL );
- maPlayToolBox.EnableItem( AVMEDIA_TOOLBOXITEM_PLAY, bValidURL );
- maPlayToolBox.EnableItem( AVMEDIA_TOOLBOXITEM_PAUSE, bValidURL );
- maPlayToolBox.EnableItem( AVMEDIA_TOOLBOXITEM_STOP, bValidURL );
- maPlayToolBox.EnableItem( AVMEDIA_TOOLBOXITEM_LOOP, bValidURL );
- maMuteToolBox.EnableItem( AVMEDIA_TOOLBOXITEM_MUTE, bValidURL );
+ maPlayToolBox->EnableItem( AVMEDIA_TOOLBOXITEM_INSERT, bValidURL );
+ maPlayToolBox->EnableItem( AVMEDIA_TOOLBOXITEM_PLAY, bValidURL );
+ maPlayToolBox->EnableItem( AVMEDIA_TOOLBOXITEM_PAUSE, bValidURL );
+ maPlayToolBox->EnableItem( AVMEDIA_TOOLBOXITEM_STOP, bValidURL );
+ maPlayToolBox->EnableItem( AVMEDIA_TOOLBOXITEM_LOOP, bValidURL );
+ maMuteToolBox->EnableItem( AVMEDIA_TOOLBOXITEM_MUTE, bValidURL );
if( !bValidURL || !IsEnabled() )
{
mpZoomListBox->Disable();
if( MEDIACONTROLSTYLE_SINGLELINE == meControlStyle )
- maPlayToolBox.Disable();
+ maPlayToolBox->Disable();
- maMuteToolBox.Disable();
+ maMuteToolBox->Disable();
}
else
{
- maPlayToolBox.Enable();
- maMuteToolBox.Enable();
+ maPlayToolBox->Enable();
+ maMuteToolBox->Enable();
if( MEDIASTATE_PLAY == maItem.getState() )
{
- maPlayToolBox.CheckItem( AVMEDIA_TOOLBOXITEM_PLAY, true );
- maPlayToolBox.CheckItem( AVMEDIA_TOOLBOXITEM_PAUSE, false );
- maPlayToolBox.CheckItem( AVMEDIA_TOOLBOXITEM_STOP, false );
+ maPlayToolBox->CheckItem( AVMEDIA_TOOLBOXITEM_PLAY, true );
+ maPlayToolBox->CheckItem( AVMEDIA_TOOLBOXITEM_PAUSE, false );
+ maPlayToolBox->CheckItem( AVMEDIA_TOOLBOXITEM_STOP, false );
}
else if( maItem.getTime() > 0.0 && ( maItem.getTime() < maItem.getDuration() ) )
{
- maPlayToolBox.CheckItem( AVMEDIA_TOOLBOXITEM_PLAY, false );
- maPlayToolBox.CheckItem( AVMEDIA_TOOLBOXITEM_PAUSE, true );
- maPlayToolBox.CheckItem( AVMEDIA_TOOLBOXITEM_STOP, false );
+ maPlayToolBox->CheckItem( AVMEDIA_TOOLBOXITEM_PLAY, false );
+ maPlayToolBox->CheckItem( AVMEDIA_TOOLBOXITEM_PAUSE, true );
+ maPlayToolBox->CheckItem( AVMEDIA_TOOLBOXITEM_STOP, false );
}
else
{
- maPlayToolBox.CheckItem( AVMEDIA_TOOLBOXITEM_PLAY, false );
- maPlayToolBox.CheckItem( AVMEDIA_TOOLBOXITEM_PAUSE, false );
- maPlayToolBox.CheckItem( AVMEDIA_TOOLBOXITEM_STOP, true );
+ maPlayToolBox->CheckItem( AVMEDIA_TOOLBOXITEM_PLAY, false );
+ maPlayToolBox->CheckItem( AVMEDIA_TOOLBOXITEM_PAUSE, false );
+ maPlayToolBox->CheckItem( AVMEDIA_TOOLBOXITEM_STOP, true );
}
- maPlayToolBox.CheckItem( AVMEDIA_TOOLBOXITEM_LOOP, maItem.isLoop() );
- maMuteToolBox.CheckItem( AVMEDIA_TOOLBOXITEM_MUTE, maItem.isMute() );
+ maPlayToolBox->CheckItem( AVMEDIA_TOOLBOXITEM_LOOP, maItem.isLoop() );
+ maMuteToolBox->CheckItem( AVMEDIA_TOOLBOXITEM_MUTE, maItem.isMute() );
if( !mpZoomListBox->IsTravelSelect() && !mpZoomListBox->IsInDropDown() )
{
@@ -360,10 +372,10 @@ void MediaControl::implUpdateToolboxes()
void MediaControl::implUpdateTimeSlider()
{
if( maItem.getURL().isEmpty() || !IsEnabled() )
- maTimeSlider.Disable();
+ maTimeSlider->Disable();
else
{
- maTimeSlider.Enable();
+ maTimeSlider->Enable();
const double fDuration = maItem.getDuration();
@@ -371,13 +383,13 @@ void MediaControl::implUpdateTimeSlider()
{
const double fTime = ::std::min( maItem.getTime(), fDuration );
- if( !maTimeSlider.GetLineSize() )
- maTimeSlider.SetLineSize( static_cast< sal_uInt32 >( AVMEDIA_TIME_RANGE * AVMEDIA_LINEINCREMENT / fDuration ) );
+ if( !maTimeSlider->GetLineSize() )
+ maTimeSlider->SetLineSize( static_cast< sal_uInt32 >( AVMEDIA_TIME_RANGE * AVMEDIA_LINEINCREMENT / fDuration ) );
- if( !maTimeSlider.GetPageSize() )
- maTimeSlider.SetPageSize( static_cast< sal_uInt32 >( AVMEDIA_TIME_RANGE * AVMEDIA_PAGEINCREMENT / fDuration ) );
+ if( !maTimeSlider->GetPageSize() )
+ maTimeSlider->SetPageSize( static_cast< sal_uInt32 >( AVMEDIA_TIME_RANGE * AVMEDIA_PAGEINCREMENT / fDuration ) );
- maTimeSlider.SetThumbPos( static_cast< sal_Int32 >( fTime / fDuration * AVMEDIA_TIME_RANGE ) );
+ maTimeSlider->SetThumbPos( static_cast< sal_Int32 >( fTime / fDuration * AVMEDIA_TIME_RANGE ) );
}
}
}
@@ -387,14 +399,14 @@ void MediaControl::implUpdateTimeSlider()
void MediaControl::implUpdateVolumeSlider()
{
if( maItem.getURL().isEmpty() || !IsEnabled() )
- maVolumeSlider.Disable();
+ maVolumeSlider->Disable();
else
{
- maVolumeSlider.Enable();
+ maVolumeSlider->Enable();
const sal_Int32 nVolumeDB = maItem.getVolumeDB();
- maVolumeSlider.SetThumbPos( ::std::min( ::std::max( nVolumeDB, static_cast< sal_Int32 >( AVMEDIA_DB_RANGE ) ),
+ maVolumeSlider->SetThumbPos( ::std::min( ::std::max( nVolumeDB, static_cast< sal_Int32 >( AVMEDIA_DB_RANGE ) ),
static_cast< sal_Int32 >( 0 ) ) );
}
}
@@ -414,8 +426,8 @@ void MediaControl::implUpdateTimeField( double fCurTime )
" / " +
rLocaleData.getDuration( tools::Time( 0, 0, static_cast< sal_uInt32 >( floor( maItem.getDuration() ) )) );
- if( maTimeEdit.GetText() != aTimeString )
- maTimeEdit.SetText( aTimeString );
+ if( maTimeEdit->GetText() != aTimeString )
+ maTimeEdit->SetText( aTimeString );
}
}
@@ -535,13 +547,13 @@ IMPL_LINK( MediaControl, implSelectHdl, ToolBox*, p )
case( AVMEDIA_TOOLBOXITEM_MUTE ):
{
- aExecItem.setMute( !maMuteToolBox.IsItemChecked( AVMEDIA_TOOLBOXITEM_MUTE ) );
+ aExecItem.setMute( !maMuteToolBox->IsItemChecked( AVMEDIA_TOOLBOXITEM_MUTE ) );
}
break;
case( AVMEDIA_TOOLBOXITEM_LOOP ):
{
- aExecItem.setLoop( !maPlayToolBox.IsItemChecked( AVMEDIA_TOOLBOXITEM_LOOP ) );
+ aExecItem.setLoop( !maPlayToolBox->IsItemChecked( AVMEDIA_TOOLBOXITEM_LOOP ) );
}
break;
diff --git a/avmedia/source/framework/mediaplayer.cxx b/avmedia/source/framework/mediaplayer.cxx
index 6090b62..f9dee9a 100644
--- a/avmedia/source/framework/mediaplayer.cxx
+++ b/avmedia/source/framework/mediaplayer.cxx
@@ -75,8 +75,14 @@ MediaFloater::MediaFloater( SfxBindings* _pBindings, SfxChildWindow* pCW, vcl::W
MediaFloater::~MediaFloater()
{
+ dispose();
+}
+
+void MediaFloater::dispose()
+{
delete mpMediaWindow;
mpMediaWindow = NULL;
+ SfxDockingWindow::dispose();
}
diff --git a/avmedia/source/framework/mediatoolbox.cxx b/avmedia/source/framework/mediatoolbox.cxx
index ea4131f..124da20 100644
--- a/avmedia/source/framework/mediatoolbox.cxx
+++ b/avmedia/source/framework/mediatoolbox.cxx
@@ -42,7 +42,6 @@ class MediaToolBoxControl_Impl : public MediaControl
public:
MediaToolBoxControl_Impl( vcl::Window& rParent, MediaToolBoxControl& rControl );
- virtual ~MediaToolBoxControl_Impl();
void update() SAL_OVERRIDE;
void execute( const MediaItem& rItem ) SAL_OVERRIDE;
@@ -63,12 +62,6 @@ MediaToolBoxControl_Impl::MediaToolBoxControl_Impl( vcl::Window& rParent, MediaT
-MediaToolBoxControl_Impl::~MediaToolBoxControl_Impl()
-{
-}
-
-
-
void MediaToolBoxControl_Impl::update()
{
mpToolBoxControl->implUpdateMediaControl();
diff --git a/avmedia/source/viewer/mediawindow_impl.cxx b/avmedia/source/viewer/mediawindow_impl.cxx
index 7a6863b..2042858 100644
--- a/avmedia/source/viewer/mediawindow_impl.cxx
+++ b/avmedia/source/viewer/mediawindow_impl.cxx
@@ -56,12 +56,6 @@ MediaWindowControl::MediaWindowControl( vcl::Window* pParent ) :
-MediaWindowControl::~MediaWindowControl()
-{
-}
-
-
-
void MediaWindowControl::update()
{
MediaItem aItem;
@@ -93,12 +87,6 @@ MediaChildWindow::MediaChildWindow( vcl::Window* pParent, SystemWindowData* pDat
}
#endif
-MediaChildWindow::~MediaChildWindow()
-{
-}
-
-
-
void MediaChildWindow::MouseMove( const MouseEvent& rMEvt )
{
const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ),
@@ -183,6 +171,11 @@ MediaWindowImpl::MediaWindowImpl( vcl::Window* pParent, MediaWindow* pMediaWindo
MediaWindowImpl::~MediaWindowImpl()
{
+ dispose();
+}
+
+void MediaWindowImpl::dispose()
+{
if( mpEvents )
mpEvents->cleanUp();
@@ -210,6 +203,7 @@ MediaWindowImpl::~MediaWindowImpl()
delete mpEmptyBmpEx;
delete mpAudioBmpEx;
delete mpMediaWindowControl;
+ Control::dispose();
}
uno::Reference< media::XPlayer > MediaWindowImpl::createPlayer( const OUString& rURL, const OUString& rReferer, const OUString* pMimeType )
diff --git a/avmedia/source/viewer/mediawindow_impl.hxx b/avmedia/source/viewer/mediawindow_impl.hxx
index c5c65fa..1311a2b 100644
--- a/avmedia/source/viewer/mediawindow_impl.hxx
+++ b/avmedia/source/viewer/mediawindow_impl.hxx
@@ -49,7 +49,6 @@ namespace avmedia
public:
MediaWindowControl( vcl::Window* pParent );
- virtual ~MediaWindowControl();
protected:
@@ -67,7 +66,6 @@ namespace avmedia
MediaChildWindow( vcl::Window* pParent );
MediaChildWindow( vcl::Window* pParent, SystemWindowData* pData );
- virtual ~MediaChildWindow();
protected:
@@ -94,6 +92,7 @@ namespace avmedia
MediaWindowImpl( vcl::Window* parent, MediaWindow* pMediaWindow, bool bInternalMediaControl );
virtual ~MediaWindowImpl();
+ virtual void dispose() SAL_OVERRIDE;
static ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > createPlayer( const OUString& rURL, const OUString& rReferer, const OUString* pMimeType = 0 );
commit fbe6619a34b617a04a5135e40c70a172a44eefef
Author: Noel Grandin <noel at peralex.com>
Date: Tue Jan 13 14:50:19 2015 +0200
vcl: VclPtr conversion in sfx2
Change-Id: I78ea3f4304ace27c6db0e3d0651bd65043dcbc68
diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx
index 5a19603..438a2b5 100644
--- a/include/sfx2/basedlgs.hxx
+++ b/include/sfx2/basedlgs.hxx
@@ -81,6 +81,7 @@ protected:
public:
virtual ~SfxModalDialog();
+ virtual void dispose() SAL_OVERRIDE;
const SfxItemSet* GetOutputItemSet() const { return pOutputSet; }
const SfxItemSet* GetInputItemSet() const { return pInputSet; }
};
@@ -102,6 +103,7 @@ protected:
SfxModelessDialog( SfxBindings*, SfxChildWindow*,
vcl::Window*, const OUString& rID, const OUString& rUIXMLDescription );
virtual ~SfxModelessDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool Close() SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
virtual void Move() SAL_OVERRIDE;
@@ -140,6 +142,7 @@ protected:
const OString& rID, const OUString& rUIXMLDescription,
const css::uno::Reference<css::frame::XFrame> &rFrame = css::uno::Reference<css::frame::XFrame>());
virtual ~SfxFloatingWindow();
+ virtual void dispose() SAL_OVERRIDE;
virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
virtual bool Close() SAL_OVERRIDE;
@@ -187,6 +190,7 @@ public:
const OUString& rUIXMLDescription = OUString("sfx/ui/singletabdialog.ui"));
virtual ~SfxSingleTabDialog();
+ virtual void dispose() SAL_OVERRIDE;
void SetTabPage(SfxTabPage* pTabPage, GetTabPageRanges pRangesFunc = 0, sal_uInt32 nSettingsId = 0);
SfxTabPage* GetTabPage() const { return pImpl->m_pSfxPage; }
diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx
index 9179c69..e5496c0 100644
--- a/include/sfx2/dinfdlg.hxx
+++ b/include/sfx2/dinfdlg.hxx
@@ -370,33 +370,35 @@ public:
class CustomPropertiesYesNoButton : public Control
{
private:
- RadioButton m_aYesButton;
- RadioButton m_aNoButton;
+ VclPtr<RadioButton> m_aYesButton;
+ VclPtr<RadioButton> m_aNoButton;
public:
CustomPropertiesYesNoButton( vcl::Window* pParent, const ResId& rResId );
+ virtual ~CustomPropertiesYesNoButton();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
- inline void CheckYes() { m_aYesButton.Check(); }
- inline void CheckNo() { m_aNoButton.Check(); }
- inline bool IsYesChecked() const { return m_aYesButton.IsChecked(); }
+ inline void CheckYes() { m_aYesButton->Check(); }
+ inline void CheckNo() { m_aNoButton->Check(); }
+ inline bool IsYesChecked() const { return m_aYesButton->IsChecked(); }
};
// struct CustomPropertyLine ---------------------------------------------
struct CustomPropertyLine
{
- ComboBox m_aNameBox;
- CustomPropertiesTypeBox m_aTypeBox;
- CustomPropertiesEdit m_aValueEdit;
- CustomPropertiesDateField m_aDateField;
- CustomPropertiesTimeField m_aTimeField;
- const OUString m_sDurationFormat;
- CustomPropertiesDurationField m_aDurationField;
- CustomPropertiesEditButton m_aEditButton;
- CustomPropertiesYesNoButton m_aYesNoButton;
- CustomPropertiesRemoveButton m_aRemoveButton;
+ VclPtr<ComboBox> m_aNameBox;
+ VclPtr<CustomPropertiesTypeBox> m_aTypeBox;
+ VclPtr<CustomPropertiesEdit> m_aValueEdit;
+ VclPtr<CustomPropertiesDateField> m_aDateField;
+ VclPtr<CustomPropertiesTimeField> m_aTimeField;
+ const OUString m_sDurationFormat;
+ VclPtr<CustomPropertiesDurationField> m_aDurationField;
+ VclPtr<CustomPropertiesEditButton> m_aEditButton;
+ VclPtr<CustomPropertiesYesNoButton> m_aYesNoButton;
+ VclPtr<CustomPropertiesRemoveButton> m_aRemoveButton;
bool m_bIsDate;
bool m_bIsRemoved;
@@ -416,15 +418,15 @@ private:
FixedText* m_pHeaderAccType;
FixedText* m_pHeaderAccValue;
- ComboBox m_aNameBox;
- ListBox m_aTypeBox;
- Edit m_aValueEdit;
- DateField m_aDateField;
- TimeField m_aTimeField;
- Edit m_aDurationField;
- PushButton m_aEditButton;
- CustomPropertiesYesNoButton m_aYesNoButton;
- ImageButton m_aRemoveButton;
+ VclPtr<ComboBox> m_aNameBox;
+ VclPtr<ListBox> m_aTypeBox;
+ VclPtr<Edit> m_aValueEdit;
+ VclPtr<DateField> m_aDateField;
+ VclPtr<TimeField> m_aTimeField;
+ VclPtr<Edit> m_aDurationField;
+ VclPtr<PushButton> m_aEditButton;
+ VclPtr<CustomPropertiesYesNoButton> m_aYesNoButton;
+ VclPtr<ImageButton> m_aRemoveButton;
sal_Int32 m_nLineHeight;
sal_Int32 m_nScrollPos;
@@ -454,6 +456,7 @@ public:
FixedText *pHeaderAccType,
FixedText *pHeaderAccValue);
virtual ~CustomPropertiesWindow();
+ virtual void dispose() SAL_OVERRIDE;
bool InitControls( HeaderBar* pHeaderBar, const ScrollBar* pScrollBar );
sal_uInt16 GetVisibleLineCount() const;
@@ -490,6 +493,7 @@ private:
public:
CustomPropertiesControl(vcl::Window* pParent);
virtual ~CustomPropertiesControl();
+ virtual void dispose() SAL_OVERRIDE;
void AddLine( const OUString& sName, com::sun::star::uno::Any& rAny, bool bInteractive );
diff --git a/include/sfx2/dockwin.hxx b/include/sfx2/dockwin.hxx
index 57f2567..e5a5ff8 100644
--- a/include/sfx2/dockwin.hxx
+++ b/include/sfx2/dockwin.hxx
@@ -84,6 +84,7 @@ public:
vcl::Window* pParent,
const OString& rID, const OUString& rUIXMLDescription );
virtual ~SfxDockingWindow();
+ virtual void dispose() SAL_OVERRIDE;
void Initialize (SfxChildWinInfo* pInfo);
virtual void FillInfo(SfxChildWinInfo&) const;
diff --git a/include/sfx2/infobar.hxx b/include/sfx2/infobar.hxx
index eb0c4c6..8fe7920 100644
--- a/include/sfx2/infobar.hxx
+++ b/include/sfx2/infobar.hxx
@@ -53,6 +53,7 @@ class SfxInfoBarWindow : public vcl::Window
public:
SfxInfoBarWindow(vcl::Window* parent, const OUString& sId, const OUString& sMessage);
virtual ~SfxInfoBarWindow( );
+ virtual void dispose() SAL_OVERRIDE;
const OUString& getId() const { return m_sId; }
virtual void Paint( const Rectangle& ) SAL_OVERRIDE;
@@ -77,6 +78,7 @@ class SfxInfoBarContainerWindow : public vcl::Window
public:
SfxInfoBarContainerWindow(SfxInfoBarContainerChild* pChildWin);
virtual ~SfxInfoBarContainerWindow( );
+ virtual void dispose() SAL_OVERRIDE;
SfxInfoBarWindow* appendInfoBar(const OUString& sId, const OUString& sMessage);
SfxInfoBarWindow* getInfoBar(const OUString& sId);
diff --git a/include/sfx2/mgetempl.hxx b/include/sfx2/mgetempl.hxx
index eded8ba..42c2656 100644
--- a/include/sfx2/mgetempl.hxx
+++ b/include/sfx2/mgetempl.hxx
@@ -81,6 +81,7 @@ friend class SfxStyleDialog;
SfxManageStyleSheetPage(vcl::Window *pParent, const SfxItemSet &rAttrSet );
virtual ~SfxManageStyleSheetPage();
+ virtual void dispose() SAL_OVERRIDE;
static SfxTabPage* Create(vcl::Window *pParent, const SfxItemSet *rAttrSet );
diff --git a/include/sfx2/new.hxx b/include/sfx2/new.hxx
index 48b6dab..05482a4 100644
--- a/include/sfx2/new.hxx
+++ b/include/sfx2/new.hxx
@@ -67,6 +67,7 @@ public:
SfxNewFileDialog(vcl::Window *pParent, sal_uInt16 nFlags = 0);
virtual ~SfxNewFileDialog();
+ virtual void dispose() SAL_OVERRIDE;
// Returns false, when '- No -' is set as Template
// Template names can only be obtained when IsTemplate() returns true.
diff --git a/include/sfx2/newstyle.hxx b/include/sfx2/newstyle.hxx
index f0f47e2..c41744f 100644
--- a/include/sfx2/newstyle.hxx
+++ b/include/sfx2/newstyle.hxx
@@ -36,7 +36,7 @@ private:
ComboBox* m_pColBox;
OKButton* m_pOKBtn;
- MessageDialog aQueryOverwriteBox;
+ VclPtr<MessageDialog> aQueryOverwriteBox;
SfxStyleSheetBasePool& rPool;
DECL_DLLPRIVATE_LINK( OKHdl, Control * );
@@ -45,6 +45,7 @@ private:
public:
SfxNewStyleDlg( vcl::Window* pParent, SfxStyleSheetBasePool& );
virtual ~SfxNewStyleDlg();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetName() const { return comphelper::string::stripStart(m_pColBox->GetText(), ' '); }
};
diff --git a/include/sfx2/printopt.hxx b/include/sfx2/printopt.hxx
index 4857ce4..477e98e 100644
--- a/include/sfx2/printopt.hxx
+++ b/include/sfx2/printopt.hxx
@@ -94,7 +94,6 @@ protected:
public:
SfxCommonPrintOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
- virtual ~SfxCommonPrintOptionsTabPage();
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
diff --git a/include/sfx2/prnmon.hxx b/include/sfx2/prnmon.hxx
index 1468ee8..22378a5 100644
--- a/include/sfx2/prnmon.hxx
+++ b/include/sfx2/prnmon.hxx
@@ -45,6 +45,7 @@ public:
SfxViewShell *pViewShell,
const SfxItemSet *rOptions );
virtual ~SfxPrintOptionsDialog();
+ virtual void dispose() SAL_OVERRIDE;
bool Construct();
virtual short Execute() SAL_OVERRIDE;
diff --git a/include/sfx2/recentdocsview.hxx b/include/sfx2/recentdocsview.hxx
index 68176cf..1affc2e 100644
--- a/include/sfx2/recentdocsview.hxx
+++ b/include/sfx2/recentdocsview.hxx
@@ -42,7 +42,6 @@ class SFX2_DLLPUBLIC RecentDocsView : public ThumbnailView
{
public:
RecentDocsView( vcl::Window* pParent );
- virtual ~RecentDocsView();
void insertItem(const OUString &rURL, const OUString &rTitle, const BitmapEx &rThumbnail, sal_uInt16 nId);
diff --git a/include/sfx2/securitypage.hxx b/include/sfx2/securitypage.hxx
index 2777088..eaf83e7 100644
--- a/include/sfx2/securitypage.hxx
+++ b/include/sfx2/securitypage.hxx
@@ -34,7 +34,6 @@ class SfxSecurityPage : public SfxTabPage
protected:
SfxSecurityPage( vcl::Window* pParent, const SfxItemSet& );
- virtual ~SfxSecurityPage();
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* ) SAL_OVERRIDE;
diff --git a/include/sfx2/sidebar/SidebarToolBox.hxx b/include/sfx2/sidebar/SidebarToolBox.hxx
index 381745d..4bb527a 100644
--- a/include/sfx2/sidebar/SidebarToolBox.hxx
+++ b/include/sfx2/sidebar/SidebarToolBox.hxx
@@ -41,6 +41,7 @@ class SFX2_DLLPUBLIC SidebarToolBox
public:
SidebarToolBox(vcl::Window* pParentWindow);
virtual ~SidebarToolBox (void);
+ virtual void dispose() SAL_OVERRIDE;
using ToolBox::InsertItem;
virtual void InsertItem(const OUString& rCommand,
diff --git a/include/sfx2/styledlg.hxx b/include/sfx2/styledlg.hxx
index 9e9bef9..e837c87 100644
--- a/include/sfx2/styledlg.hxx
+++ b/include/sfx2/styledlg.hxx
@@ -41,6 +41,7 @@ public:
const OUString& rUIXMLDescription, SfxStyleSheetBase&);
virtual ~SfxStyleDialog();
+ virtual void dispose() SAL_OVERRIDE;
SfxStyleSheetBase& GetStyleSheet() { return *pStyle; }
const SfxStyleSheetBase& GetStyleSheet() const { return *pStyle; }
diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx
index 2465321..e30588f 100644
--- a/include/sfx2/tabdlg.hxx
+++ b/include/sfx2/tabdlg.hxx
@@ -129,6 +129,7 @@ public:
const OUString& rID, const OUString& rUIXMLDescription,
const SfxItemSet * = 0, bool bEditFmt = false);
virtual ~SfxTabDialog();
+ virtual void dispose() SAL_OVERRIDE;
sal_uInt16 AddTabPage( const OString& rName, // Name of the label for the page in the notebook .ui
CreateTabPage pCreateFunc, // != 0
@@ -249,6 +250,7 @@ protected:
public:
virtual ~SfxTabPage();
+ virtual void dispose() SAL_OVERRIDE;
const SfxItemSet& GetItemSet() const { return *pSet; }
diff --git a/include/sfx2/taskpane.hxx b/include/sfx2/taskpane.hxx
index dadbdf1..9768716 100644
--- a/include/sfx2/taskpane.hxx
+++ b/include/sfx2/taskpane.hxx
@@ -93,7 +93,6 @@ namespace sfx2
vcl::Window& i_rParentWindow,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rDocumentFrame
);
- virtual ~ModuleTaskPane();
/** determines whether a given module has any registered tool panels
*/
@@ -163,6 +162,8 @@ namespace sfx2
public:
TaskPaneDockingWindow( SfxBindings* i_pBindings, TaskPaneWrapper& i_rWrapper,
vcl::Window* i_pParent, WinBits i_nBits );
+ virtual ~TaskPaneDockingWindow();
+ virtual void dispose() SAL_OVERRIDE;
// ITaskPaneToolPanelAccess
virtual void ActivateToolPanel( const OUString& i_rPanelURL ) SAL_OVERRIDE;
@@ -175,8 +176,8 @@ namespace sfx2
virtual void onLayoutDone() SAL_OVERRIDE;
private:
- ModuleTaskPane m_aTaskPane;
- TaskPaneController m_aPaneController;
+ VclPtr<ModuleTaskPane> m_aTaskPane;
+ TaskPaneController m_aPaneController;
};
diff --git a/include/sfx2/tbxctrl.hxx b/include/sfx2/tbxctrl.hxx
index e6d5388..6061a5b 100644
--- a/include/sfx2/tbxctrl.hxx
+++ b/include/sfx2/tbxctrl.hxx
@@ -151,6 +151,7 @@ public:
vcl::Window* pParentWindow,
WinBits nBits );
virtual ~SfxPopupWindow();
+ virtual void dispose() SAL_OVERRIDE;
virtual SfxPopupWindow* Clone() const;
virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
diff --git a/include/sfx2/templateabstractview.hxx b/include/sfx2/templateabstractview.hxx
index 5509374..41979ca 100644
--- a/include/sfx2/templateabstractview.hxx
+++ b/include/sfx2/templateabstractview.hxx
@@ -83,7 +83,8 @@ public:
TemplateAbstractView(vcl::Window *pParent, WinBits nWinStyle, bool bDisableTransientChildren);
TemplateAbstractView(vcl::Window* pParent);
- virtual ~TemplateAbstractView ();
+ virtual ~TemplateAbstractView();
+ virtual void dispose() SAL_OVERRIDE;
void insertItem (const TemplateItemProperties &rTemplate);
@@ -137,8 +138,8 @@ protected:
sal_uInt16 mnCurRegionId;
OUString maCurRegionName;
- PushButton maAllButton;
- FixedText maFTName;
+ VclPtr<PushButton> maAllButton;
+ VclPtr<FixedText> maFTName;
Link maOpenRegionHdl;
Link maOpenTemplateHdl;
diff --git a/include/sfx2/templatedefaultview.hxx b/include/sfx2/templatedefaultview.hxx
index 005201b..2050835 100644
--- a/include/sfx2/templatedefaultview.hxx
+++ b/include/sfx2/templatedefaultview.hxx
@@ -17,7 +17,6 @@ class SFX2_DLLPUBLIC TemplateDefaultView : public TemplateLocalView
{
public:
TemplateDefaultView(Window *pParent);
- virtual ~TemplateDefaultView();
virtual void reload() SAL_OVERRIDE;
protected:
diff --git a/include/sfx2/templatedlg.hxx b/include/sfx2/templatedlg.hxx
index 8b133f4..76ea4bd 100644
--- a/include/sfx2/templatedlg.hxx
+++ b/include/sfx2/templatedlg.hxx
@@ -50,7 +50,8 @@ public:
SfxTemplateManagerDlg(vcl::Window *parent = NULL);
- virtual ~SfxTemplateManagerDlg ();
+ virtual ~SfxTemplateManagerDlg();
+ virtual void dispose() SAL_OVERRIDE;
void setSaveMode();
diff --git a/include/sfx2/templateinfodlg.hxx b/include/sfx2/templateinfodlg.hxx
index 9f5d9df..fabd740 100644
--- a/include/sfx2/templateinfodlg.hxx
+++ b/include/sfx2/templateinfodlg.hxx
@@ -27,7 +27,8 @@ public:
SfxTemplateInfoDlg (vcl::Window *pParent = NULL);
- virtual ~SfxTemplateInfoDlg ();
+ virtual ~SfxTemplateInfoDlg();
+ virtual void dispose() SAL_OVERRIDE;
void loadDocument (const OUString &rURL);
diff --git a/include/sfx2/templatelocalview.hxx b/include/sfx2/templatelocalview.hxx
index 6d2e1d0..123a6f6 100644
--- a/include/sfx2/templatelocalview.hxx
+++ b/include/sfx2/templatelocalview.hxx
@@ -32,6 +32,7 @@ public:
TemplateLocalView ( vcl::Window* pParent );
virtual ~TemplateLocalView ();
+ virtual void dispose() SAL_OVERRIDE;
// Fill view with template folders thumbnails
virtual void Populate () SAL_OVERRIDE;
diff --git a/include/sfx2/templateremoteview.hxx b/include/sfx2/templateremoteview.hxx
index 6c64e9a..ada041d 100644
--- a/include/sfx2/templateremoteview.hxx
+++ b/include/sfx2/templateremoteview.hxx
@@ -23,8 +23,6 @@ public:
TemplateRemoteView (vcl::Window *pParent, WinBits nWinStyle, bool bDisableTransientChildren);
- virtual ~TemplateRemoteView ();
-
virtual void showRootRegion () SAL_OVERRIDE;
virtual void showRegion (ThumbnailViewItem *pItem) SAL_OVERRIDE;
diff --git a/include/sfx2/templdlg.hxx b/include/sfx2/templdlg.hxx
index a3237d3..b9eb528 100644
--- a/include/sfx2/templdlg.hxx
+++ b/include/sfx2/templdlg.hxx
@@ -43,6 +43,7 @@ class SFX2_DLLPUBLIC SfxTemplatePanelControl : public DockingWindow
public:
SfxTemplatePanelControl (SfxBindings* pBindings, vcl::Window* pParentWindow);
virtual ~SfxTemplatePanelControl();
+ virtual void dispose() SAL_OVERRIDE;
virtual void DataChanged( const DataChangedEvent& _rDCEvt ) SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx
index 2c9967b..2191ef5 100644
--- a/include/sfx2/thumbnailview.hxx
+++ b/include/sfx2/thumbnailview.hxx
@@ -183,6 +183,7 @@ public:
ThumbnailView(vcl::Window* pParent, WinBits nWinStyle = WB_TABSTOP, bool bDisableTransientChildren = false);
virtual ~ThumbnailView();
+ virtual void dispose() SAL_OVERRIDE;
virtual void MouseMove(const MouseEvent& rMEvt) SAL_OVERRIDE;
diff --git a/include/sfx2/titledockwin.hxx b/include/sfx2/titledockwin.hxx
index 97fdebc..6c4b5e9 100644
--- a/include/sfx2/titledockwin.hxx
+++ b/include/sfx2/titledockwin.hxx
@@ -24,6 +24,7 @@
#include <sfx2/dockwin.hxx>
#include <vcl/toolbox.hxx>
+#include <vcl/vclptr.hxx>
#include <tools/svborder.hxx>
@@ -43,6 +44,7 @@ namespace sfx2
);
virtual ~TitledDockingWindow();
+ virtual void dispose() SAL_OVERRIDE;
/** sets a title to be displayed in the docking window
*/
@@ -77,11 +79,11 @@ namespace sfx2
/** returns the content window, which is to be used as parent window for any content to be displayed
in the docking window.
*/
- vcl::Window& GetContentWindow() { return m_aContentWindow; }
- const vcl::Window& GetContentWindow() const { return m_aContentWindow; }
+ vcl::Window& GetContentWindow() { return *m_aContentWindow.get(); }
+ const vcl::Window& GetContentWindow() const { return *m_aContentWindow.get(); }
- ToolBox& GetToolBox() { return m_aToolbox; }
- const ToolBox& GetToolBox() const { return m_aToolbox; }
+ ToolBox& GetToolBox() { return *m_aToolbox.get(); }
+ const ToolBox& GetToolBox() const { return *m_aToolbox.get(); }
/** Return the border that is painted around the inner window as
decoration.
@@ -126,8 +128,8 @@ namespace sfx2
private:
OUString m_sTitle;
- ToolBox m_aToolbox;
- Window m_aContentWindow;
+ VclPtr<ToolBox> m_aToolbox;
+ VclPtr<Window> m_aContentWindow;
Link m_aEndDockingHdl;
diff --git a/sfx2/inc/srchdlg.hxx b/sfx2/inc/srchdlg.hxx
index 95b7a00..b5abe7b 100644
--- a/sfx2/inc/srchdlg.hxx
+++ b/sfx2/inc/srchdlg.hxx
@@ -59,6 +59,7 @@ private:
public:
SearchDialog( vcl::Window* pWindow, const OUString& rConfigName );
virtual ~SearchDialog();
+ virtual void dispose() SAL_OVERRIDE;
void SetFindHdl( const Link& rLink ) { m_aFindHdl = rLink; }
void SetCloseHdl( const Link& rLink ) { m_aCloseHdl = rLink; }
@@ -70,11 +71,11 @@ public:
bool IsWrapAround() const { return ( m_pWrapAroundBox->IsChecked() ); }
bool IsSearchBackwards() const { return ( m_pBackwardsBox->IsChecked() ); }
- void SetFocusOnEdit();
+ void SetFocusOnEdit();
virtual bool Close() SAL_OVERRIDE;
- virtual void Move() SAL_OVERRIDE;
- virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
+ virtual void Move() SAL_OVERRIDE;
+ virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
};
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 3f90d2d..eb800ba 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -303,6 +303,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeContentListBox(vcl::Wi
ContentListBox_Impl::~ContentListBox_Impl()
{
+ dispose();
+}
+
+void ContentListBox_Impl::dispose()
+{
sal_uInt16 nPos = 0;
SvTreeListEntry* pEntry = GetEntry( nPos++ );
while ( pEntry )
@@ -311,6 +316,7 @@ ContentListBox_Impl::~ContentListBox_Impl()
delete static_cast<ContentEntry_Impl*>(pEntry->GetUserData());
pEntry = GetEntry( nPos++ );
}
+ SvTreeListBox::dispose();
}
void ContentListBox_Impl::InitRoot()
@@ -545,7 +551,13 @@ IndexTabPage_Impl::IndexTabPage_Impl(vcl::Window* pParent, SfxHelpIndexWindow_Im
IndexTabPage_Impl::~IndexTabPage_Impl()
{
+ dispose();
+}
+
+void IndexTabPage_Impl::dispose()
+{
ClearIndex();
+ HelpTabPage_Impl::dispose();
}
@@ -946,6 +958,11 @@ SearchTabPage_Impl::SearchTabPage_Impl(vcl::Window* pParent, SfxHelpIndexWindow_
SearchTabPage_Impl::~SearchTabPage_Impl()
{
+ dispose();
+}
+
+void SearchTabPage_Impl::dispose()
+{
SvtViewOptions aViewOpt( E_TABPAGE, CONFIGNAME_SEARCHPAGE );
sal_Int32 nChecked = m_pFullWordsCB->IsChecked() ? 1 : 0;
OUString aUserData = OUString::number( nChecked );
@@ -967,6 +984,7 @@ SearchTabPage_Impl::~SearchTabPage_Impl()
aUserData = comphelper::string::stripEnd(aUserData, ';');
Any aUserItem = makeAny( OUString( aUserData ) );
aViewOpt.SetUserItem( USERITEM_NAME, aUserItem );
+ HelpTabPage_Impl::dispose();
}
@@ -1141,6 +1159,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeBookmarksBox(vcl::Wind
BookmarksBox_Impl::~BookmarksBox_Impl()
{
+ dispose();
+}
+
+void BookmarksBox_Impl::dispose()
+{
// save bookmarks to configuration
SvtHistoryOptions aHistOpt;
aHistOpt.Clear( eHELPBOOKMARKS );
@@ -1153,6 +1176,7 @@ BookmarksBox_Impl::~BookmarksBox_Impl()
aHistOpt.AppendItem(eHELPBOOKMARKS, *pURL, sEmpty, aTitle, sEmpty, sEmpty);
delete pURL;
}
+ ListBox::dispose();
}
@@ -1416,6 +1440,11 @@ SfxHelpIndexWindow_Impl::SfxHelpIndexWindow_Impl(SfxHelpWindow_Impl* _pParent)
SfxHelpIndexWindow_Impl::~SfxHelpIndexWindow_Impl()
{
+ dispose();
+}
+
+void SfxHelpIndexWindow_Impl::dispose()
+{
sfx2::RemoveFromTaskPaneList( this );
DELETEZ( pCPage );
@@ -1428,6 +1457,7 @@ SfxHelpIndexWindow_Impl::~SfxHelpIndexWindow_Impl()
SvtViewOptions aViewOpt( E_TABDIALOG, CONFIGNAME_INDEXWIN );
aViewOpt.SetPageID( (sal_Int32)m_pTabCtrl->GetCurPageId() );
+ vcl::Window::dispose();
}
@@ -1805,10 +1835,6 @@ TextWin_Impl::TextWin_Impl( vcl::Window* p ) : DockingWindow( p, 0 )
{
}
-TextWin_Impl::~TextWin_Impl()
-{
-}
-
bool TextWin_Impl::Notify( NotifyEvent& rNEvt )
{
if( ( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT ) && rNEvt.GetKeyEvent()->GetKeyCode().GetCode() == KEY_TAB )
@@ -1830,8 +1856,8 @@ SfxHelpTextWindow_Impl::SfxHelpTextWindow_Impl( SfxHelpWindow_Impl* pParent ) :
Window( pParent, WB_CLIPCHILDREN | WB_TABSTOP | WB_DIALOGCONTROL ),
- aToolBox ( this, 0 ),
- aOnStartupCB ( this, SfxResId( RID_HELP_ONSTARTUP_BOX ) ),
+ aToolBox ( new ToolBox(this, 0) ),
+ aOnStartupCB ( new CheckBox(this, SfxResId( RID_HELP_ONSTARTUP_BOX )) ),
aIndexOnImage ( SfxResId( IMG_HELP_TOOLBOX_INDEX_ON ) ),
aIndexOffImage ( SfxResId( IMG_HELP_TOOLBOX_INDEX_OFF ) ),
aIndexOnText ( SfxResId( STR_HELP_BUTTON_INDEX_ON ).toString() ),
@@ -1847,36 +1873,36 @@ SfxHelpTextWindow_Impl::SfxHelpTextWindow_Impl( SfxHelpWindow_Impl* pParent ) :
bIsFullWordSearch ( false )
{
- sfx2::AddToTaskPaneList( &aToolBox );
+ sfx2::AddToTaskPaneList( aToolBox.get() );
xFrame = Frame::create( ::comphelper::getProcessComponentContext() );
xFrame->initialize( VCLUnoHelper::GetInterface ( pTextWin ) );
xFrame->setName( "OFFICE_HELP" );
lcl_disableLayoutOfFrame(xFrame);
- aToolBox.SetHelpId( HID_HELP_TOOLBOX );
-
- aToolBox.InsertItem( TBI_INDEX, aIndexOffText );
- aToolBox.SetHelpId( TBI_INDEX, HID_HELP_TOOLBOXITEM_INDEX );
- aToolBox.InsertSeparator();
- aToolBox.InsertItem( TBI_BACKWARD, SfxResId( STR_HELP_BUTTON_PREV ).toString() );
- aToolBox.SetHelpId( TBI_BACKWARD, HID_HELP_TOOLBOXITEM_BACKWARD );
- aToolBox.InsertItem( TBI_FORWARD, SfxResId( STR_HELP_BUTTON_NEXT ).toString() );
- aToolBox.SetHelpId( TBI_FORWARD, HID_HELP_TOOLBOXITEM_FORWARD );
- aToolBox.InsertItem( TBI_START, SfxResId( STR_HELP_BUTTON_START ).toString() );
- aToolBox.SetHelpId( TBI_START, HID_HELP_TOOLBOXITEM_START );
- aToolBox.InsertSeparator();
- aToolBox.InsertItem( TBI_PRINT, SfxResId( STR_HELP_BUTTON_PRINT ).toString() );
- aToolBox.SetHelpId( TBI_PRINT, HID_HELP_TOOLBOXITEM_PRINT );
- aToolBox.InsertItem( TBI_BOOKMARKS, SfxResId( STR_HELP_BUTTON_ADDBOOKMARK ).toString() );
- aToolBox.SetHelpId( TBI_BOOKMARKS, HID_HELP_TOOLBOXITEM_BOOKMARKS );
- aToolBox.InsertItem( TBI_SEARCHDIALOG, SfxResId( STR_HELP_BUTTON_SEARCHDIALOG ).toString() );
- aToolBox.SetHelpId( TBI_SEARCHDIALOG, HID_HELP_TOOLBOXITEM_SEARCHDIALOG );
+ aToolBox->SetHelpId( HID_HELP_TOOLBOX );
+
+ aToolBox->InsertItem( TBI_INDEX, aIndexOffText );
+ aToolBox->SetHelpId( TBI_INDEX, HID_HELP_TOOLBOXITEM_INDEX );
+ aToolBox->InsertSeparator();
+ aToolBox->InsertItem( TBI_BACKWARD, SfxResId( STR_HELP_BUTTON_PREV ).toString() );
+ aToolBox->SetHelpId( TBI_BACKWARD, HID_HELP_TOOLBOXITEM_BACKWARD );
+ aToolBox->InsertItem( TBI_FORWARD, SfxResId( STR_HELP_BUTTON_NEXT ).toString() );
+ aToolBox->SetHelpId( TBI_FORWARD, HID_HELP_TOOLBOXITEM_FORWARD );
+ aToolBox->InsertItem( TBI_START, SfxResId( STR_HELP_BUTTON_START ).toString() );
+ aToolBox->SetHelpId( TBI_START, HID_HELP_TOOLBOXITEM_START );
+ aToolBox->InsertSeparator();
+ aToolBox->InsertItem( TBI_PRINT, SfxResId( STR_HELP_BUTTON_PRINT ).toString() );
+ aToolBox->SetHelpId( TBI_PRINT, HID_HELP_TOOLBOXITEM_PRINT );
+ aToolBox->InsertItem( TBI_BOOKMARKS, SfxResId( STR_HELP_BUTTON_ADDBOOKMARK ).toString() );
+ aToolBox->SetHelpId( TBI_BOOKMARKS, HID_HELP_TOOLBOXITEM_BOOKMARKS );
+ aToolBox->InsertItem( TBI_SEARCHDIALOG, SfxResId( STR_HELP_BUTTON_SEARCHDIALOG ).toString() );
+ aToolBox->SetHelpId( TBI_SEARCHDIALOG, HID_HELP_TOOLBOXITEM_SEARCHDIALOG );
InitToolBoxImages();
- aToolBox.Show();
+ aToolBox->Show();
InitOnStartupBox( false );
- aOnStartupCB.SetClickHdl( LINK( this, SfxHelpTextWindow_Impl, CheckHdl ) );
+ aOnStartupCB->SetClickHdl( LINK( this, SfxHelpTextWindow_Impl, CheckHdl ) );
aSelectIdle.SetIdleHdl( LINK( this, SfxHelpTextWindow_Impl, SelectHdl ) );
aSelectIdle.SetPriority( SchedulerPriority::LOWEST );
@@ -1887,19 +1913,27 @@ SfxHelpTextWindow_Impl::SfxHelpTextWindow_Impl( SfxHelpWindow_Impl* pParent ) :
SvtMiscOptions().AddListenerLink( LINK( this, SfxHelpTextWindow_Impl, NotifyHdl ) );
- if ( !aOnStartupCB.GetHelpId().getLength() )
- aOnStartupCB.SetHelpId( HID_HELP_ONSTARTUP_BOX );
+ if ( !aOnStartupCB->GetHelpId().getLength() )
+ aOnStartupCB->SetHelpId( HID_HELP_ONSTARTUP_BOX );
}
SfxHelpTextWindow_Impl::~SfxHelpTextWindow_Impl()
{
- sfx2::RemoveFromTaskPaneList( &aToolBox );
+ dispose();
+}
+
+void SfxHelpTextWindow_Impl::dispose()
+{
+ sfx2::RemoveFromTaskPaneList( aToolBox.get() );
bIsInClose = true;
SvtMiscOptions().RemoveListenerLink( LINK( this, SfxHelpTextWindow_Impl, NotifyHdl ) );
delete pSrchDlg;
+ aToolBox.disposeAndClear();
+ aOnStartupCB.disposeAndClear();
+ vcl::Window::dispose();
}
@@ -1928,39 +1962,39 @@ void SfxHelpTextWindow_Impl::InitToolBoxImages()
aIndexOnImage = Image( SfxResId( bLarge ? IMG_HELP_TOOLBOX_L_INDEX_ON : IMG_HELP_TOOLBOX_INDEX_ON ) );
aIndexOffImage = Image( SfxResId( bLarge ? IMG_HELP_TOOLBOX_L_INDEX_OFF : IMG_HELP_TOOLBOX_INDEX_OFF ) );
- aToolBox.SetItemImage( TBI_INDEX, bIsIndexOn ? aIndexOffImage : aIndexOnImage );
+ aToolBox->SetItemImage( TBI_INDEX, bIsIndexOn ? aIndexOffImage : aIndexOnImage );
- aToolBox.SetItemImage( TBI_BACKWARD,
+ aToolBox->SetItemImage( TBI_BACKWARD,
Image( SfxResId( bLarge ? IMG_HELP_TOOLBOX_L_PREV : IMG_HELP_TOOLBOX_PREV ) )
);
- aToolBox.SetItemImage( TBI_FORWARD,
+ aToolBox->SetItemImage( TBI_FORWARD,
Image( SfxResId( bLarge ? IMG_HELP_TOOLBOX_L_NEXT : IMG_HELP_TOOLBOX_NEXT ) )
);
- aToolBox.SetItemImage( TBI_START,
+ aToolBox->SetItemImage( TBI_START,
Image( SfxResId( bLarge ? IMG_HELP_TOOLBOX_L_START : IMG_HELP_TOOLBOX_START ) )
);
- aToolBox.SetItemImage( TBI_PRINT,
+ aToolBox->SetItemImage( TBI_PRINT,
Image( SfxResId( bLarge ? IMG_HELP_TOOLBOX_L_PRINT : IMG_HELP_TOOLBOX_PRINT ) )
);
- aToolBox.SetItemImage( TBI_BOOKMARKS,
+ aToolBox->SetItemImage( TBI_BOOKMARKS,
Image( SfxResId( bLarge ? IMG_HELP_TOOLBOX_L_BOOKMARKS : IMG_HELP_TOOLBOX_BOOKMARKS ) )
);
- aToolBox.SetItemImage( TBI_SEARCHDIALOG,
+ aToolBox->SetItemImage( TBI_SEARCHDIALOG,
Image( SfxResId( bLarge ? IMG_HELP_TOOLBOX_L_SEARCHDIALOG : IMG_HELP_TOOLBOX_SEARCHDIALOG ) )
);
- Size aSize = aToolBox.CalcWindowSizePixel();
+ Size aSize = aToolBox->CalcWindowSizePixel();
aSize.Height() += TOOLBOX_OFFSET;
- aToolBox.SetPosSizePixel( Point( 0, TOOLBOX_OFFSET ), aSize );
+ aToolBox->SetPosSizePixel( Point( 0, TOOLBOX_OFFSET ), aSize );
SvtMiscOptions aMiscOptions;
- if ( aMiscOptions.GetToolboxStyle() != aToolBox.GetOutStyle() )
- aToolBox.SetOutStyle( aMiscOptions.GetToolboxStyle() );
+ if ( aMiscOptions.GetToolboxStyle() != aToolBox->GetOutStyle() )
+ aToolBox->SetOutStyle( aMiscOptions.GetToolboxStyle() );
}
@@ -1998,7 +2032,7 @@ void SfxHelpTextWindow_Impl::InitOnStartupBox( bool bOnlyText )
}
if ( bHideBox )
- aOnStartupCB.Hide();
+ aOnStartupCB->Hide();
else
{
// detect module name
@@ -2025,20 +2059,20 @@ void SfxHelpTextWindow_Impl::InitOnStartupBox( bool bOnlyText )
// set module name in checkbox text
OUString sText( aOnStartupText );
sText = sText.replaceFirst( "%MODULENAME", sModuleName );
- aOnStartupCB.SetText( sText );
+ aOnStartupCB->SetText( sText );
// and show it
- aOnStartupCB.Show();
+ aOnStartupCB->Show();
// set check state
- aOnStartupCB.Check( bHelpAtStartup );
- aOnStartupCB.SaveValue();
+ aOnStartupCB->Check( bHelpAtStartup );
+ aOnStartupCB->SaveValue();
// calculate and set optimal width of the onstartup checkbox
OUString sCBText( "XXX" );
- sCBText += aOnStartupCB.GetText();
- long nTextWidth = aOnStartupCB.GetTextWidth( sCBText );
- Size aSize = aOnStartupCB.GetSizePixel();
+ sCBText += aOnStartupCB->GetText();
+ long nTextWidth = aOnStartupCB->GetTextWidth( sCBText );
+ Size aSize = aOnStartupCB->GetSizePixel();
aSize.Width() = nTextWidth;
- aOnStartupCB.SetSizePixel( aSize );
+ aOnStartupCB->SetSizePixel( aSize );
SetOnStartupBoxPosition();
}
@@ -2046,12 +2080,12 @@ void SfxHelpTextWindow_Impl::InitOnStartupBox( bool bOnlyText )
{
// set position of the checkbox
Size a3Size = LogicToPixel( Size( 3, 3 ), MAP_APPFONT );
- Size aTBSize = aToolBox.GetSizePixel();
- Size aCBSize = aOnStartupCB.GetSizePixel();
- Point aPnt = aToolBox.GetPosPixel();
+ Size aTBSize = aToolBox->GetSizePixel();
+ Size aCBSize = aOnStartupCB->GetSizePixel();
+ Point aPnt = aToolBox->GetPosPixel();
aPnt.X() += aTBSize.Width() + a3Size.Width();
aPnt.Y() += ( ( aTBSize.Height() - aCBSize.Height() ) / 2 );
- aOnStartupCB.SetPosPixel( aPnt );
+ aOnStartupCB->SetPosPixel( aPnt );
nMinPos = aPnt.X();
}
}
@@ -2061,10 +2095,10 @@ void SfxHelpTextWindow_Impl::InitOnStartupBox( bool bOnlyText )
void SfxHelpTextWindow_Impl::SetOnStartupBoxPosition()
{
- long nX = std::max( GetOutputSizePixel().Width() - aOnStartupCB.GetSizePixel().Width(), nMinPos );
- Point aPos = aOnStartupCB.GetPosPixel();
+ long nX = std::max( GetOutputSizePixel().Width() - aOnStartupCB->GetSizePixel().Width(), nMinPos );
+ Point aPos = aOnStartupCB->GetPosPixel();
aPos.X() = nX;
- aOnStartupCB.SetPosPixel( aPos );
+ aOnStartupCB->SetPosPixel( aPos );
}
@@ -2181,7 +2215,7 @@ IMPL_LINK( SfxHelpTextWindow_Impl, NotifyHdl, SvtMiscOptions*, pOptions )
(void)pOptions; // unused variable
InitToolBoxImages();
Resize();
- aToolBox.Invalidate();
+ aToolBox->Invalidate();
return 0;
}
@@ -2308,7 +2342,7 @@ IMPL_LINK( SfxHelpTextWindow_Impl, CheckHdl, CheckBox*, pBox )
void SfxHelpTextWindow_Impl::Resize()
{
Size aSize = GetOutputSizePixel();
- long nToolBoxHeight = aToolBox.GetSizePixel().Height() + TOOLBOX_OFFSET;
+ long nToolBoxHeight = aToolBox->GetSizePixel().Height() + TOOLBOX_OFFSET;
aSize.Height() -= nToolBoxHeight;
pTextWin->SetPosSizePixel( Point( 0, nToolBoxHeight ), aSize );
SetOnStartupBoxPosition();
@@ -2325,7 +2359,7 @@ bool SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt )
const CommandEvent* pCmdEvt = rNEvt.GetCommandEvent();
vcl::Window* pCmdWin = rNEvt.GetWindow();
- if ( pCmdEvt->GetCommand() == COMMAND_CONTEXTMENU && pCmdWin != this && pCmdWin != &aToolBox )
+ if ( pCmdEvt->GetCommand() == COMMAND_CONTEXTMENU && pCmdWin != this && pCmdWin != aToolBox.get() )
{
Point aPos;
if ( pCmdEvt->IsMouseEvent() )
@@ -2430,9 +2464,9 @@ bool SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt )
pHelpWin->CloseWindow();
nDone = true;
}
- else if ( KEY_TAB == nKey && aOnStartupCB.HasChildPathFocus() )
+ else if ( KEY_TAB == nKey && aOnStartupCB->HasChildPathFocus() )
{
- aToolBox.GrabFocus();
+ aToolBox->GrabFocus();
nDone = true;
}
}
@@ -2484,13 +2518,13 @@ void SfxHelpTextWindow_Impl::ToggleIndex( bool bOn )
bIsIndexOn = bOn;
if ( bIsIndexOn )
{
- aToolBox.SetItemImage( TBI_INDEX, aIndexOffImage );
- aToolBox.SetItemText( TBI_INDEX, aIndexOffText );
+ aToolBox->SetItemImage( TBI_INDEX, aIndexOffImage );
+ aToolBox->SetItemText( TBI_INDEX, aIndexOffText );
}
else
{
- aToolBox.SetItemImage( TBI_INDEX, aIndexOnImage );
- aToolBox.SetItemText( TBI_INDEX, aIndexOnText );
+ aToolBox->SetItemImage( TBI_INDEX, aIndexOnImage );
+ aToolBox->SetItemText( TBI_INDEX, aIndexOnText );
}
}
@@ -2993,6 +3027,11 @@ SfxHelpWindow_Impl::SfxHelpWindow_Impl(
SfxHelpWindow_Impl::~SfxHelpWindow_Impl()
{
+ dispose();
+}
+
+void SfxHelpWindow_Impl::dispose()
+{
SaveConfig();
vcl::Window* pDel = pIndexWin;
pIndexWin = NULL;
@@ -3000,6 +3039,7 @@ SfxHelpWindow_Impl::~SfxHelpWindow_Impl()
pTextWin->CloseFrame();
delete pTextWin;
+ SplitWindow::dispose();
}
bool SfxHelpWindow_Impl::PreNotify( NotifyEvent& rNEvt )
diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx
index 4ccf236..38d15e8 100644
--- a/sfx2/source/appl/newhelp.hxx
+++ b/sfx2/source/appl/newhelp.hxx
@@ -60,7 +60,7 @@ private:
public:
ContentListBox_Impl(vcl::Window* pParent, WinBits nStyle);
virtual ~ContentListBox_Impl();
-
+ virtual void dispose() SAL_OVERRIDE;
virtual void RequestingChildren( SvTreeListEntry* pParent ) SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -141,6 +141,7 @@ private:
public:
IndexTabPage_Impl( vcl::Window* pParent, SfxHelpIndexWindow_Impl* _pIdxWin );
virtual ~IndexTabPage_Impl();
+ virtual void dispose() SAL_OVERRIDE;
virtual void ActivatePage() SAL_OVERRIDE;
virtual Control* GetLastFocusControl() SAL_OVERRIDE;
@@ -217,6 +218,7 @@ private:
public:
SearchTabPage_Impl( vcl::Window* pParent, SfxHelpIndexWindow_Impl* _pIdxWin );
virtual ~SearchTabPage_Impl();
+ virtual void dispose() SAL_OVERRIDE;
virtual void ActivatePage() SAL_OVERRIDE;
virtual Control* GetLastFocusControl() SAL_OVERRIDE;
@@ -242,6 +244,7 @@ private:
public:
BookmarksBox_Impl(vcl::Window* pParent, WinBits nStyle);
virtual ~BookmarksBox_Impl();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
};
@@ -312,6 +315,7 @@ private:
public:
SfxHelpIndexWindow_Impl( SfxHelpWindow_Impl* pParent );
virtual ~SfxHelpIndexWindow_Impl();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
virtual Size GetOptimalSize() const SAL_OVERRIDE;
@@ -392,7 +396,6 @@ class TextWin_Impl : public DockingWindow
{
public:
TextWin_Impl( vcl::Window* pParent );
- virtual ~TextWin_Impl();
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
};
@@ -405,8 +408,8 @@ class SfxHelpWindow_Impl;
class SfxHelpTextWindow_Impl : public vcl::Window
{
private:
- ToolBox aToolBox;
- CheckBox aOnStartupCB;
+ VclPtr<ToolBox> aToolBox;
+ VclPtr<CheckBox> aOnStartupCB;
Idle aSelectIdle;
Image aIndexOnImage;
Image aIndexOffImage;
@@ -426,12 +429,12 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
xConfiguration;
long nMinPos;
- bool bIsDebug;
- bool bIsIndexOn;
- bool bIsInClose;
- bool bIsFullWordSearch;
+ bool bIsDebug;
+ bool bIsIndexOn;
+ bool bIsInClose;
+ bool bIsFullWordSearch;
- bool HasSelection() const;
+ bool HasSelection() const;
void InitToolBoxImages();
void InitOnStartupBox( bool bOnlyText );
void SetOnStartupBoxPosition();
@@ -451,6 +454,7 @@ private:
public:
SfxHelpTextWindow_Impl( SfxHelpWindow_Impl* pParent );
virtual ~SfxHelpTextWindow_Impl();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -460,11 +464,11 @@ public:
inline ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame2 >
getFrame() const { return xFrame; }
- inline void SetSelectHdl( const Link& rLink ) { aToolBox.SetSelectHdl( rLink ); }
+ inline void SetSelectHdl( const Link& rLink ) { aToolBox->SetSelectHdl( rLink ); }
void ToggleIndex( bool bOn );
void SelectSearchText( const OUString& rSearchText, bool _bIsFullWordSearch );
void SetPageStyleHeaderOff() const;
- inline ToolBox& GetToolBox() { return aToolBox; }
+ inline ToolBox& GetToolBox() { return *aToolBox.get(); }
void CloseFrame();
void DoSearch();
};
@@ -519,6 +523,7 @@ public:
SfxHelpWindow_Impl( const ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame2 >& rFrame,
vcl::Window* pParent, WinBits nBits );
virtual ~SfxHelpWindow_Impl();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx
index 9b68a0e..dc22fdd 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -62,10 +62,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeRecentDocsView(vcl::Wi
return new RecentDocsView(pParent);
}
-RecentDocsView::~RecentDocsView()
-{
-}
-
bool RecentDocsView::typeMatchesExtension(ApplicationType type, const OUString &rExt)
{
bool bRet = false;
diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx
index 51b213d..cfbd886 100644
--- a/sfx2/source/control/templateabstractview.cxx
+++ b/sfx2/source/control/templateabstractview.cxx
@@ -128,29 +128,37 @@ bool ViewFilter_Keyword::operator ()(const ThumbnailViewItem *pItem)
TemplateAbstractView::TemplateAbstractView (vcl::Window *pParent, WinBits nWinStyle, bool bDisableTransientChildren)
: ThumbnailView(pParent,nWinStyle,bDisableTransientChildren),
mnCurRegionId(0),
- maAllButton(this, SfxResId(BTN_ALL_TEMPLATES)),
- maFTName(this, SfxResId(FT_NAME))
+ maAllButton(new PushButton(this, SfxResId(BTN_ALL_TEMPLATES))),
+ maFTName(new FixedText(this, SfxResId(FT_NAME)))
{
- maAllButton.Hide();
- maAllButton.SetStyle(maAllButton.GetStyle() | WB_FLATBUTTON);
- maAllButton.SetClickHdl(LINK(this,TemplateAbstractView,ShowRootRegionHdl));
- maFTName.Hide();
+ maAllButton->Hide();
+ maAllButton->SetStyle(maAllButton->GetStyle() | WB_FLATBUTTON);
+ maAllButton->SetClickHdl(LINK(this,TemplateAbstractView,ShowRootRegionHdl));
+ maFTName->Hide();
}
TemplateAbstractView::TemplateAbstractView(vcl::Window *pParent)
: ThumbnailView(pParent),
mnCurRegionId(0),
- maAllButton(this, SfxResId(BTN_ALL_TEMPLATES)),
- maFTName(this, SfxResId(FT_NAME))
+ maAllButton(new PushButton(this, SfxResId(BTN_ALL_TEMPLATES))),
+ maFTName(new FixedText(this, SfxResId(FT_NAME)))
{
- maAllButton.Hide();
- maAllButton.SetStyle(maAllButton.GetStyle() | WB_FLATBUTTON);
- maAllButton.SetClickHdl(LINK(this,TemplateAbstractView,ShowRootRegionHdl));
- maFTName.Hide();
+ maAllButton->Hide();
+ maAllButton->SetStyle(maAllButton->GetStyle() | WB_FLATBUTTON);
+ maAllButton->SetClickHdl(LINK(this,TemplateAbstractView,ShowRootRegionHdl));
+ maFTName->Hide();
}
-TemplateAbstractView::~TemplateAbstractView ()
+TemplateAbstractView::~TemplateAbstractView()
{
+ dispose();
+}
+
+void TemplateAbstractView::dispose()
+{
+ maAllButton.disposeAndClear();
+ maFTName.disposeAndClear();
+ ThumbnailView::dispose();
}
void TemplateAbstractView::insertItem(const TemplateItemProperties &rTemplate)
@@ -283,7 +291,7 @@ void TemplateAbstractView::OnItemDblClicked (ThumbnailViewItem *pItem)
mnCurRegionId = pContainerItem->mnRegionId+1;
maCurRegionName = pContainerItem->maTitle;
- maFTName.SetText(maCurRegionName);
+ maFTName->SetText(maCurRegionName);
showRegion(pItem);
}
else
diff --git a/sfx2/source/control/templatedefaultview.cxx b/sfx2/source/control/templatedefaultview.cxx
index 9e2f83a..3c42d29 100644
--- a/sfx2/source/control/templatedefaultview.cxx
+++ b/sfx2/source/control/templatedefaultview.cxx
@@ -28,10 +28,6 @@ TemplateDefaultView::TemplateDefaultView( Window* pParent)
ThumbnailView::setItemDimensions( mnItemMaxSize, mnItemMaxSize, mnTextHeight, mnItemPadding );
}
-TemplateDefaultView::~TemplateDefaultView()
-{
-}
-
void TemplateDefaultView::reload()
{
TemplateLocalView::reload();
diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx
index ad14ae8..022172a 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -45,12 +45,18 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeTemplateLocalView(vcl:
TemplateLocalView::~TemplateLocalView()
{
+ dispose();
+}
+
+void TemplateLocalView::dispose()
+{
for (size_t i = 0; i < maRegions.size(); ++i)
delete maRegions[i];
maRegions.clear();
delete mpDocTemplates;
+ TemplateAbstractView::dispose();
}
void TemplateLocalView::Populate ()
@@ -141,8 +147,8 @@ void TemplateLocalView::showRootRegion()
items[i] = pItem;
}
- maAllButton.Show(false);
- maFTName.Show(false);
+ maAllButton->Show(false);
+ maFTName->Show(false);
updateItems(items);
@@ -151,12 +157,12 @@ void TemplateLocalView::showRootRegion()
void TemplateLocalView::showRegion(ThumbnailViewItem *pItem)
{
- mnHeaderHeight = maAllButton.GetSizePixel().getHeight() + maAllButton.GetPosPixel().Y() * 2;
+ mnHeaderHeight = maAllButton->GetSizePixel().getHeight() + maAllButton->GetPosPixel().Y() * 2;
mnCurRegionId = static_cast<TemplateContainerItem*>(pItem)->mnRegionId+1;
maCurRegionName = pItem->maTitle;
- maAllButton.Show(true);
- maFTName.Show(true);
+ maAllButton->Show(true);
+ maFTName->Show(true);
insertItems(reinterpret_cast<TemplateContainerItem*>(pItem)->maTemplates);
@@ -169,7 +175,7 @@ void TemplateLocalView::showRegion(const OUString &rName)
{
if (maRegions[i]->maTitle == rName)
{
- maFTName.SetText(rName);
+ maFTName->SetText(rName);
showRegion(maRegions[i]);
break;
}
diff --git a/sfx2/source/control/templateremoteview.cxx b/sfx2/source/control/templateremoteview.cxx
index 0729a6b..f33407a 100644
--- a/sfx2/source/control/templateremoteview.cxx
+++ b/sfx2/source/control/templateremoteview.cxx
@@ -59,10 +59,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeTemplateRemoteView(vcl
return new TemplateRemoteView(pParent, WB_VSCROLL, false);
}
-TemplateRemoteView::~TemplateRemoteView ()
-{
-}
-
void TemplateRemoteView::showRootRegion()
{
//TODO:
@@ -86,7 +82,7 @@ bool TemplateRemoteView::loadRepository (TemplateRepository* pItem, bool bRefres
mnCurRegionId = pItem->mnId;
maCurRegionName = pItem->maTitle;
- maFTName.SetText(maCurRegionName);
+ maFTName->SetText(maCurRegionName);
OUString aURL = pItem->getURL();
diff --git a/sfx2/source/control/templatesearchview.cxx b/sfx2/source/control/templatesearchview.cxx
index fb21ac6..582dd5a 100644
--- a/sfx2/source/control/templatesearchview.cxx
+++ b/sfx2/source/control/templatesearchview.cxx
@@ -22,10 +22,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeTemplateSearchView(vcl
return new TemplateSearchView(pParent);
}
-TemplateSearchView::~TemplateSearchView ()
-{
-}
-
void TemplateSearchView::setOpenTemplateHdl(const Link &rLink)
{
maOpenTemplateHdl = rLink;
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index d855614..c62eeda 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -66,6 +66,11 @@ ThumbnailView::ThumbnailView (vcl::Window *pParent, WinBits nWinStyle, bool bDis
ThumbnailView::~ThumbnailView()
{
+ dispose();
+}
+
+void ThumbnailView::dispose()
+{
com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent>
xComponent(GetAccessible(false),
com::sun::star::uno::UNO_QUERY);
@@ -78,6 +83,7 @@ ThumbnailView::~ThumbnailView()
delete mpProcessor;
ImplDeleteItems();
+ Control::dispose();
}
void ThumbnailView::MouseMove(const MouseEvent& rMEvt)
diff --git a/sfx2/source/control/thumbnailviewitem.cxx b/sfx2/source/control/thumbnailviewitem.cxx
index 040eb18..c866a8f 100644
--- a/sfx2/source/control/thumbnailviewitem.cxx
+++ b/sfx2/source/control/thumbnailviewitem.cxx
@@ -53,7 +53,6 @@ class ResizableMultiLineEdit : public VclMultiLineEdit
public:
ResizableMultiLineEdit (vcl::Window* pParent, ThumbnailViewItem* pItem);
- virtual ~ResizableMultiLineEdit ();
void SetInGrabFocus(bool bInGrabFocus) { mbIsInGrabFocus = bInGrabFocus; }
@@ -68,10 +67,6 @@ ResizableMultiLineEdit::ResizableMultiLineEdit (vcl::Window* pParent, ThumbnailV
{
}
-ResizableMultiLineEdit::~ResizableMultiLineEdit ()
-{
-}
-
bool ResizableMultiLineEdit::PreNotify(NotifyEvent& rNEvt)
{
bool nDone = false;
diff --git a/sfx2/source/dialog/alienwarn.cxx b/sfx2/source/dialog/alienwarn.cxx
index d1dc6ea..e157e6e 100644
--- a/sfx2/source/dialog/alienwarn.cxx
+++ b/sfx2/source/dialog/alienwarn.cxx
@@ -51,11 +51,17 @@ SfxAlienWarningDialog::SfxAlienWarningDialog(vcl::Window* pParent, const OUStrin
SfxAlienWarningDialog::~SfxAlienWarningDialog()
{
+ dispose();
+}
+
+void SfxAlienWarningDialog::dispose()
+{
// save value of "warning off" checkbox, if necessary
SvtSaveOptions aSaveOpt;
bool bChecked = m_pWarningOnBox->IsChecked();
if ( aSaveOpt.IsWarnAlienFormat() != bChecked )
aSaveOpt.SetWarnAlienFormat( bChecked );
+ MessageDialog::dispose();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx
index ad9f98f..fa3f403 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -195,6 +195,11 @@ BackingWindow::BackingWindow( vcl::Window* i_pParent ) :
BackingWindow::~BackingWindow()
{
+ dispose();
+}
+
+void BackingWindow::dispose()
+{
// deregister drag&drop helper
if (mxDropTargetListener.is())
{
@@ -212,6 +217,7 @@ BackingWindow::~BackingWindow()
}
mxDropTargetListener = css::uno::Reference< css::datatransfer::dnd::XDropTargetListener >();
}
+ vcl::Window::dispose();
}
void BackingWindow::initControls()
diff --git a/sfx2/source/dialog/backingwindow.hxx b/sfx2/source/dialog/backingwindow.hxx
index aa6e498..023e1cb 100644
--- a/sfx2/source/dialog/backingwindow.hxx
+++ b/sfx2/source/dialog/backingwindow.hxx
@@ -125,6 +125,7 @@ class BackingWindow
public:
BackingWindow( vcl::Window* pParent );
virtual ~BackingWindow();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 5662278..0637d7d 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -163,15 +163,15 @@ SfxModalDialog::SfxModalDialog(vcl::Window *pParent, const OUString& rID, const
}
SfxModalDialog::~SfxModalDialog()
+{
+ dispose();
+}
-/* [Description]
-
- Destructor; writes the Dialog position in the ini-file.
-*/
-
+void SfxModalDialog::dispose()
{
SetDialogData_Impl();
delete pOutputSet;
+ ModalDialog::dispose();
}
void SfxModalDialog::CreateOutputItemSet( SfxItemPool& rPool )
@@ -355,16 +355,16 @@ bool SfxModelessDialog::Notify( NotifyEvent& rEvt )
SfxModelessDialog::~SfxModelessDialog()
+{
+ dispose();
+}
-/* [Description]
-
- Destructor
-*/
-
+void SfxModelessDialog::dispose()
{
if ( pImp->pMgr->GetFrame().is() && pImp->pMgr->GetFrame() == pBindings->GetActiveFrame() )
pBindings->SetActiveFrame( NULL );
delete pImp;
+ ModelessDialog::dispose();
}
@@ -505,16 +505,16 @@ bool SfxFloatingWindow::Close()
SfxFloatingWindow::~SfxFloatingWindow()
+{
+ dispose();
+}
-/* [Description]
-
- Destructor
-*/
-
+void SfxFloatingWindow::dispose()
{
if ( pImp->pMgr->GetFrame() == pBindings->GetActiveFrame() )
pBindings->SetActiveFrame( NULL );
delete pImp;
+ FloatingWindow::dispose();
}
@@ -702,9 +702,15 @@ SfxSingleTabDialog::SfxSingleTabDialog(vcl::Window* pParent, const SfxItemSet* p
SfxSingleTabDialog::~SfxSingleTabDialog()
{
+ dispose();
+}
+
+void SfxSingleTabDialog::dispose()
+{
delete pImpl->m_pSfxPage;
delete pImpl->m_pLine;
delete pImpl;
+ SfxModalDialog::dispose();
}
void SfxSingleTabDialog::SetTabPage(SfxTabPage* pTabPage,
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 4317295..03b9028 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1182,16 +1182,29 @@ void SfxDocumentInfoDialog::AddFontTabPage()
CustomPropertiesYesNoButton::CustomPropertiesYesNoButton( vcl::Window* pParent, const ResId& rResId ) :
Control( pParent, rResId ),
- m_aYesButton( this, ResId( RB_PROPERTY_YES, *rResId.GetResMgr() ) ),
- m_aNoButton ( this, ResId( RB_PROPERTY_NO, *rResId.GetResMgr() ) )
+ m_aYesButton( new RadioButton(this, ResId( RB_PROPERTY_YES, *rResId.GetResMgr() )) ),
+ m_aNoButton ( new RadioButton(this, ResId( RB_PROPERTY_NO, *rResId.GetResMgr() )) )
{
FreeResource();
Wallpaper aWall( Color( COL_TRANSPARENT ) );
SetBackground( aWall );
SetBorderStyle( WindowBorderStyle::MONO );
CheckNo();
- m_aYesButton.SetBackground( aWall );
- m_aNoButton.SetBackground( aWall );
+ m_aYesButton->SetBackground( aWall );
+ m_aNoButton->SetBackground( aWall );
+}
+
+
+CustomPropertiesYesNoButton::~CustomPropertiesYesNoButton()
+{
+ dispose();
+}
+
+void CustomPropertiesYesNoButton::dispose()
+{
+ m_aYesButton.disposeAndClear();
+ m_aNoButton.disposeAndClear();
+ Control::dispose();
}
class DurationDialog_Impl : public ModalDialog
@@ -1259,10 +1272,6 @@ CustomPropertiesDurationField::CustomPropertiesDurationField(vcl::Window* pParen
SetDuration( util::Duration(false, 0, 0, 0, 0, 0, 0, 0) );
}
-CustomPropertiesDurationField::~CustomPropertiesDurationField()
-{
-}
-
void CustomPropertiesDurationField::RequestHelp( const HelpEvent& rHEvt )
{
if ( rHEvt.GetMode() & HelpEventMode::QUICK )
@@ -1299,15 +1308,11 @@ CustomPropertiesEditButton::CustomPropertiesEditButton(vcl::Window* pParent, Win
SetClickHdl( LINK( this, CustomPropertiesEditButton, ClickHdl ));
}
-CustomPropertiesEditButton::~CustomPropertiesEditButton()
-{
-}
-
IMPL_LINK_NOARG(CustomPropertiesEditButton, ClickHdl)
{
- boost::scoped_ptr<DurationDialog_Impl> pDurationDlg(new DurationDialog_Impl( this, m_pLine->m_aDurationField.GetDuration() ));
+ boost::scoped_ptr<DurationDialog_Impl> pDurationDlg(new DurationDialog_Impl( this, m_pLine->m_aDurationField->GetDuration() ));
if ( RET_OK == pDurationDlg->Execute() )
- m_pLine->m_aDurationField.SetDuration( pDurationDlg->GetDuration() );
+ m_pLine->m_aDurationField->SetDuration( pDurationDlg->GetDuration() );
return 1;
}
@@ -1316,54 +1321,54 @@ void CustomPropertiesYesNoButton::Resize()
const long nWidth = GetSizePixel().Width();
const long n3Width = LogicToPixel( Size( 3, 3 ), MAP_APPFONT ).Width();
const long nNewWidth = ( nWidth / 2 ) - n3Width - 2;
- Size aSize = m_aYesButton.GetSizePixel();
+ Size aSize = m_aYesButton->GetSizePixel();
const long nDelta = aSize.Width() - nNewWidth;
aSize.Width() = nNewWidth;
- m_aYesButton.SetSizePixel( aSize );
- Point aPos = m_aNoButton.GetPosPixel();
+ m_aYesButton->SetSizePixel( aSize );
+ Point aPos = m_aNoButton->GetPosPixel();
aPos.X() -= nDelta;
- m_aNoButton.SetPosSizePixel( aPos, aSize );
+ m_aNoButton->SetPosSizePixel( aPos, aSize );
}
// struct CustomPropertyLine ---------------------------------------------
CustomPropertyLine::CustomPropertyLine( vcl::Window* pParent ) :
- m_aNameBox ( pParent, SfxResId( SFX_CB_PROPERTY_NAME ) ),
- m_aTypeBox ( pParent, SfxResId( SFX_LB_PROPERTY_TYPE ), this ),
- m_aValueEdit ( pParent, WB_BORDER|WB_TABSTOP|WB_LEFT, this ),
- m_aDateField ( pParent, WB_BORDER|WB_TABSTOP|WB_SPIN|WB_LEFT, this ),
- m_aTimeField ( pParent, WB_BORDER|WB_TABSTOP|WB_SPIN|WB_LEFT, this ),
+ m_aNameBox ( new ComboBox(pParent, SfxResId( SFX_CB_PROPERTY_NAME )) ),
+ m_aTypeBox ( new CustomPropertiesTypeBox(pParent, SfxResId( SFX_LB_PROPERTY_TYPE ), this) ),
+ m_aValueEdit ( new CustomPropertiesEdit(pParent, WB_BORDER|WB_TABSTOP|WB_LEFT, this ) ),
+ m_aDateField ( new CustomPropertiesDateField(pParent, WB_BORDER|WB_TABSTOP|WB_SPIN|WB_LEFT, this ) ),
+ m_aTimeField ( new CustomPropertiesTimeField(pParent, WB_BORDER|WB_TABSTOP|WB_SPIN|WB_LEFT, this ) ),
m_sDurationFormat( SfxResId( SFX_ST_DURATION_FORMAT ).toString() ),
- m_aDurationField( pParent, WB_BORDER|WB_TABSTOP|WB_READONLY, this ),
- m_aEditButton ( pParent, WB_TABSTOP, this ),
- m_aYesNoButton ( pParent, SfxResId( SFX_WIN_PROPERTY_YESNO ) ),
- m_aRemoveButton ( pParent, 0, this ),
+ m_aDurationField( new CustomPropertiesDurationField(pParent, WB_BORDER|WB_TABSTOP|WB_READONLY, this ) ),
+ m_aEditButton ( new CustomPropertiesEditButton(pParent, WB_TABSTOP, this) ),
+ m_aYesNoButton ( new CustomPropertiesYesNoButton(pParent, SfxResId( SFX_WIN_PROPERTY_YESNO )) ),
+ m_aRemoveButton ( new CustomPropertiesRemoveButton(pParent, 0, this) ),
m_bIsDate ( false ),
m_bIsRemoved ( false ),
m_bTypeLostFocus( false )
{
- m_aTimeField.SetExtFormat( EXTTIMEF_24H_LONG );
- m_aDateField.SetExtDateFormat( XTDATEF_SYSTEM_SHORT_YYYY );
+ m_aTimeField->SetExtFormat( EXTTIMEF_24H_LONG );
+ m_aDateField->SetExtDateFormat( XTDATEF_SYSTEM_SHORT_YYYY );
- m_aRemoveButton.SetModeImage(Image(SfxResId(SFX_IMG_PROPERTY_REMOVE)));
- m_aRemoveButton.SetQuickHelpText(SfxResId(STR_SFX_REMOVE_PROPERTY).toString());
+ m_aRemoveButton->SetModeImage(Image(SfxResId(SFX_IMG_PROPERTY_REMOVE)));
+ m_aRemoveButton->SetQuickHelpText(SfxResId(STR_SFX_REMOVE_PROPERTY).toString());
- m_aEditButton.SetText(SfxResId(SFX_ST_EDIT).toString());
+ m_aEditButton->SetText(SfxResId(SFX_ST_EDIT).toString());
}
void CustomPropertyLine::SetRemoved()
{
DBG_ASSERT( !m_bIsRemoved, "CustomPropertyLine::SetRemoved(): line already removed" );
m_bIsRemoved = true;
- m_aNameBox.Hide();
- m_aTypeBox.Hide();
- m_aValueEdit.Hide();
- m_aDateField.Hide();
- m_aTimeField.Hide();
- m_aDurationField.Hide();
- m_aEditButton.Hide();
- m_aYesNoButton.Hide();
- m_aRemoveButton.Hide();
+ m_aNameBox->Hide();
+ m_aTypeBox->Hide();
+ m_aValueEdit->Hide();
+ m_aDateField->Hide();
+ m_aTimeField->Hide();
+ m_aDurationField->Hide();
+ m_aEditButton->Hide();
+ m_aYesNoButton->Hide();
+ m_aRemoveButton->Hide();
}
CustomPropertiesWindow::CustomPropertiesWindow(vcl::Window* pParent,
@@ -1374,15 +1379,15 @@ CustomPropertiesWindow::CustomPropertiesWindow(vcl::Window* pParent,
m_pHeaderAccName(pHeaderAccName),
m_pHeaderAccType(pHeaderAccType),
m_pHeaderAccValue(pHeaderAccValue),
- m_aNameBox ( this, SfxResId( SFX_CB_PROPERTY_NAME ) ),
- m_aTypeBox ( this, SfxResId( SFX_LB_PROPERTY_TYPE ) ),
- m_aValueEdit ( this, WB_BORDER|WB_TABSTOP|WB_LEFT ),
- m_aDateField ( this, WB_BORDER|WB_TABSTOP|WB_SPIN|WB_LEFT ),
- m_aTimeField ( this, WB_BORDER|WB_TABSTOP|WB_SPIN|WB_LEFT ),
- m_aDurationField( this, WB_BORDER|WB_TABSTOP|WB_READONLY ),
- m_aEditButton( this, WB_TABSTOP ),
- m_aYesNoButton ( this, SfxResId( SFX_WIN_PROPERTY_YESNO ) ),
- m_aRemoveButton ( this, 0 ),
+ m_aNameBox ( new ComboBox( this, SfxResId( SFX_CB_PROPERTY_NAME ) ) ),
+ m_aTypeBox ( new ListBox( this, SfxResId( SFX_LB_PROPERTY_TYPE ) ) ),
+ m_aValueEdit ( new Edit( this, WB_BORDER|WB_TABSTOP|WB_LEFT ) ),
+ m_aDateField ( new DateField( this, WB_BORDER|WB_TABSTOP|WB_SPIN|WB_LEFT ) ),
+ m_aTimeField ( new TimeField( this, WB_BORDER|WB_TABSTOP|WB_SPIN|WB_LEFT ) ),
+ m_aDurationField( new Edit( this, WB_BORDER|WB_TABSTOP|WB_READONLY ),
+ m_aEditButton ( new PushButton( this, WB_TABSTOP ) ),
+ m_aYesNoButton ( new CustomPropertiesYesNoButton( this, SfxResId( SFX_WIN_PROPERTY_YESNO )) ),
+ m_aRemoveButton ( new ImageButton( this, 0 ),
m_nScrollPos (0),
m_pCurrentLine (NULL),
m_aNumberFormatter( ::comphelper::getProcessComponentContext(),
@@ -1403,57 +1408,72 @@ CustomPropertiesWindow::CustomPropertiesWindow(vcl::Window* pParent,
m_aBoxLoseFocusIdle.SetPriority( SchedulerPriority::LOWEST );
m_aBoxLoseFocusIdle.SetIdleHdl( LINK( this, CustomPropertiesWindow, BoxTimeoutHdl ) );
- m_aNameBox.add_mnemonic_label(m_pHeaderAccName);
- m_aNameBox.SetAccessibleName(m_pHeaderAccName->GetText());
- m_aTypeBox.add_mnemonic_label(m_pHeaderAccType);
- m_aTypeBox.SetAccessibleName(m_pHeaderAccType->GetText());
- m_aValueEdit.add_mnemonic_label(m_pHeaderAccValue);
- m_aValueEdit.SetAccessibleName(m_pHeaderAccValue->GetText());
-
- m_aNameBox.Hide();
- m_aTypeBox.Hide();
- m_aValueEdit.Hide();
- m_aDateField.Hide();
- m_aTimeField.Hide();
- m_aDurationField.Hide();
- m_aEditButton.Hide();
- m_aYesNoButton.Hide();
- m_aRemoveButton.Hide();
+ m_aNameBox->add_mnemonic_label(m_pHeaderAccName);
+ m_aNameBox->SetAccessibleName(m_pHeaderAccName->GetText());
+ m_aTypeBox->add_mnemonic_label(m_pHeaderAccType);
+ m_aTypeBox->SetAccessibleName(m_pHeaderAccType->GetText());
+ m_aValueEdit->add_mnemonic_label(m_pHeaderAccValue);
+ m_aValueEdit->SetAccessibleName(m_pHeaderAccValue->GetText());
+
+ m_aNameBox->Hide();
+ m_aTypeBox->Hide();
+ m_aValueEdit->Hide();
+ m_aDateField->Hide();
+ m_aTimeField->Hide();
+ m_aDurationField->Hide();
+ m_aEditButton->Hide();
+ m_aYesNoButton->Hide();
+ m_aRemoveButton->Hide();
m_nLineHeight =
- ( m_aRemoveButton.GetPosPixel().Y() * 2 ) + m_aRemoveButton.GetSizePixel().Height();
+ ( m_aRemoveButton->GetPosPixel().Y() * 2 ) + m_aRemoveButton->GetSizePixel().Height();
}
CustomPropertiesWindow::~CustomPropertiesWindow()
{
+ dispose();
+}
+
+void CustomPropertiesWindow::dispose()
+{
m_aEditLoseFocusIdle.Stop();
m_aBoxLoseFocusIdle.Stop();
ClearAllLines();
+ m_aNameBox.disposeAndClear();
+ m_aTypeBox.disposeAndClear();
+ m_aValueEdit.disposeAndClear();
+ m_aDateField.disposeAndClear();
+ m_aTimeField.disposeAndClear();
+ m_aDurationField.disposeAndClear();
+ m_aEditButton.disposeAndClear();
+ m_aYesNoButton.disposeAndClear();
+ m_aRemoveButton.disposeAndClear();
+ vcl::Window::dispose();
}
IMPL_LINK( CustomPropertiesWindow, TypeHdl, CustomPropertiesTypeBox*, pBox )
{
long nType = reinterpret_cast<long>( pBox->GetSelectEntryData() );
CustomPropertyLine* pLine = pBox->GetLine();
- pLine->m_aValueEdit.Show( (CUSTOM_TYPE_TEXT == nType) || (CUSTOM_TYPE_NUMBER == nType) );
- pLine->m_aDateField.Show( (CUSTOM_TYPE_DATE == nType) || (CUSTOM_TYPE_DATETIME == nType) );
- pLine->m_aTimeField.Show( CUSTOM_TYPE_DATETIME == nType );
- pLine->m_aDurationField.Show( CUSTOM_TYPE_DURATION == nType );
- pLine->m_aEditButton.Show( CUSTOM_TYPE_DURATION == nType );
- pLine->m_aYesNoButton.Show( CUSTOM_TYPE_BOOLEAN == nType );
+ pLine->m_aValueEdit->Show( (CUSTOM_TYPE_TEXT == nType) || (CUSTOM_TYPE_NUMBER == nType) );
+ pLine->m_aDateField->Show( (CUSTOM_TYPE_DATE == nType) || (CUSTOM_TYPE_DATETIME == nType) );
+ pLine->m_aTimeField->Show( CUSTOM_TYPE_DATETIME == nType );
+ pLine->m_aDurationField->Show( CUSTOM_TYPE_DURATION == nType );
+ pLine->m_aEditButton->Show( CUSTOM_TYPE_DURATION == nType );
+ pLine->m_aYesNoButton->Show( CUSTOM_TYPE_BOOLEAN == nType );
//adjust positions of date and time controls
if ( nType == CUSTOM_TYPE_DATE )
{
pLine->m_bIsDate = true;
- pLine->m_aDateField.SetSizePixel( pLine->m_aValueEdit.GetSizePixel() );
+ pLine->m_aDateField->SetSizePixel( pLine->m_aValueEdit->GetSizePixel() );
}
else if ( nType == CUSTOM_TYPE_DATETIME)
{
// because m_aDateField and m_aTimeField have the same size for type "DateTime",
// we just rely on m_aTimeField here.
pLine->m_bIsDate = false;
- pLine->m_aDateField.SetSizePixel( pLine->m_aTimeField.GetSizePixel() );
+ pLine->m_aDateField->SetSizePixel( pLine->m_aTimeField->GetSizePixel() );
}
return 0;
@@ -1476,10 +1496,10 @@ IMPL_LINK( CustomPropertiesWindow, RemoveHdl, CustomPropertiesRemoveButton*, pBu
if ( pLine->m_bIsRemoved )
continue;
- vcl::Window* pWindows[] = { &pLine->m_aNameBox, &pLine->m_aTypeBox, &pLine->m_aValueEdit,
- &pLine->m_aDateField, &pLine->m_aTimeField,
- &pLine->m_aDurationField, &pLine->m_aEditButton,
- &pLine->m_aYesNoButton, &pLine->m_aRemoveButton, NULL };
+ vcl::Window* pWindows[] = { pLine->m_aNameBox.get(), pLine->m_aTypeBox.get(), pLine->m_aValueEdit.get(),
+ pLine->m_aDateField.get(), pLine->m_aTimeField.get(),
+ pLine->m_aDurationField.get(), pLine->m_aEditButton.get(),
+ pLine->m_aYesNoButton.get(), pLine->m_aRemoveButton.get(), NULL };
vcl::Window** pCurrent = pWindows;
while ( *pCurrent )
{
@@ -1539,8 +1559,8 @@ bool CustomPropertiesWindow::IsLineValid( CustomPropertyLine* pLine ) const
bool bIsValid = true;
pLine->m_bTypeLostFocus = false;
long nType = reinterpret_cast<long>(
- pLine->m_aTypeBox.GetSelectEntryData() );
- OUString sValue = pLine->m_aValueEdit.GetText();
+ pLine->m_aTypeBox->GetSelectEntryData() );
+ OUString sValue = pLine->m_aValueEdit->GetText();
if ( sValue.isEmpty() )
return true;
@@ -1574,9 +1594,9 @@ void CustomPropertiesWindow::ValidateLine( CustomPropertyLine* pLine, bool bIsFr
pLine->m_bTypeLostFocus = true;
vcl::Window* pParent = GetParent()->GetParent();
if (MessageDialog(pParent, SfxResId(STR_SFX_QUERY_WRONG_TYPE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_OK_CANCEL).Execute() == RET_OK)
- pLine->m_aTypeBox.SelectEntryPos( m_aTypeBox.GetEntryPos( reinterpret_cast<void*>(CUSTOM_TYPE_TEXT) ) );
+ pLine->m_aTypeBox->SelectEntryPos( m_aTypeBox->GetEntryPos( reinterpret_cast<void*>(CUSTOM_TYPE_TEXT) ) );
else
- pLine->m_aValueEdit.GrabFocus();
+ pLine->m_aValueEdit->GrabFocus();
}
}
@@ -1589,8 +1609,8 @@ bool CustomPropertiesWindow::InitControls( HeaderBar* pHeaderBar, const ScrollBa
const long nOffset = 4;
const long nScrollBarWidth = pScrollBar->GetSizePixel().Width();
- const long nButtonWidth = m_aRemoveButton.GetSizePixel().Width() + nScrollBarWidth + nOffset;
- long nTypeWidth = m_aTypeBox.CalcMinimumSize().Width() + ( 2 * nOffset );
+ const long nButtonWidth = m_aRemoveButton->GetSizePixel().Width() + nScrollBarWidth + nOffset;
+ long nTypeWidth = m_aTypeBox->CalcMinimumSize().Width() + ( 2 * nOffset );
long nFullWidth = pHeaderBar->GetSizePixel().Width();
long nItemWidth = ( nFullWidth - nTypeWidth - nButtonWidth ) / 2;
pHeaderBar->SetItemSize( HI_NAME, nItemWidth );
@@ -1598,7 +1618,7 @@ bool CustomPropertiesWindow::InitControls( HeaderBar* pHeaderBar, const ScrollBa
pHeaderBar->SetItemSize( HI_VALUE, nItemWidth );
pHeaderBar->SetItemSize( HI_ACTION, nButtonWidth );
- vcl::Window* pWindows[] = { &m_aNameBox, &m_aTypeBox, &m_aValueEdit, &m_aRemoveButton, NULL };
+ vcl::Window* pWindows[] = { m_aNameBox.get(), m_aTypeBox.get(), m_aValueEdit.get(), m_aRemoveButton.get(), NULL };
vcl::Window** pCurrent = pWindows;
sal_uInt16 nPos = 0;
while ( *pCurrent )
@@ -1609,7 +1629,7 @@ bool CustomPropertiesWindow::InitControls( HeaderBar* pHeaderBar, const ScrollBa
Size aSize(aOrigSize);
Point aPos(aOrigPos);
long nWidth = aRect.GetWidth() - nOffset;
- if ( *pCurrent == &m_aRemoveButton )
+ if ( *pCurrent == m_aRemoveButton.get() )
nWidth -= pScrollBar->GetSizePixel().Width();
aSize.Width() = nWidth;
aPos.X() = aRect.getX() + ( nOffset / 2 );
@@ -1620,23 +1640,23 @@ bool CustomPropertiesWindow::InitControls( HeaderBar* pHeaderBar, const ScrollBa
bChanged = true;
}
- if ( *pCurrent == &m_aValueEdit )
+ if ( *pCurrent == m_aValueEdit.get() )
{
Point aDurationPos( aPos );
- m_aDurationField.SetPosPixel( aDurationPos );
+ m_aDurationField->SetPosPixel( aDurationPos );
Size aDurationSize(aSize);
- aDurationSize.Width() -= (m_aEditButton.GetSizePixel().Width() + 3 );
- m_aDurationField.SetSizePixel(aDurationSize);
- aDurationPos.X() = aPos.X() - m_aEditButton.GetSizePixel().Width() + aSize.Width();
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list