summaryrefslogtreecommitdiff
path: root/scaddins
ModeNameSize
-rw-r--r--AllLangMoTarget_sca.mk465logplain
-rw-r--r--InternalUnoApi_scaddins.mk841logplain
-rw-r--r--IwyuFilter_scaddins.yaml1006logplain
-rw-r--r--Library_analysis.mk1696logplain
-rw-r--r--Library_date.mk1530logplain
-rw-r--r--Library_pricing.mk1595logplain
-rw-r--r--Makefile225logplain
-rw-r--r--Module_scaddins.mk1163logplain
-rw-r--r--README216logplain
d---------idl / com / sun / star / sheet / addin30logplain
d---------inc158logplain
d---------source104logplain
c/accessibility/standard/vclxaccessiblestatusbar.hxx3
-rw-r--r--accessibility/inc/accessibility/standard/vclxaccessiblestatusbaritem.hxx8
-rw-r--r--accessibility/inc/accessibility/standard/vclxaccessibletabcontrol.hxx3
-rw-r--r--accessibility/inc/accessibility/standard/vclxaccessibletabpage.hxx3
-rw-r--r--accessibility/inc/accessibility/standard/vclxaccessibletabpagewindow.hxx5
-rw-r--r--accessibility/inc/accessibility/standard/vclxaccessibletoolboxitem.hxx13
-rw-r--r--accessibility/source/extended/AccessibleToolPanelDeck.cxx6
-rw-r--r--accessibility/source/extended/AccessibleToolPanelDeckTabBar.cxx4
-rw-r--r--accessibility/source/extended/AccessibleToolPanelDeckTabBarItem.cxx4
-rw-r--r--accessibility/source/extended/accessibleiconchoicectrl.cxx5
-rw-r--r--accessibility/source/extended/accessibleiconchoicectrlentry.cxx2
-rw-r--r--accessibility/source/extended/accessiblelistbox.cxx10
-rw-r--r--accessibility/source/extended/textwindowaccessibility.cxx6
-rw-r--r--accessibility/source/helper/acc_factory.cxx4
-rw-r--r--accessibility/source/standard/vclxaccessiblebox.cxx24
-rw-r--r--accessibility/source/standard/vclxaccessiblebutton.cxx10
-rw-r--r--accessibility/source/standard/vclxaccessiblecheckbox.cxx4
-rw-r--r--accessibility/source/standard/vclxaccessiblecombobox.cxx9
-rw-r--r--accessibility/source/standard/vclxaccessibledropdowncombobox.cxx8
-rw-r--r--accessibility/source/standard/vclxaccessibledropdownlistbox.cxx9
-rw-r--r--accessibility/source/standard/vclxaccessibleedit.cxx8
-rw-r--r--accessibility/source/standard/vclxaccessiblelist.cxx22
-rw-r--r--accessibility/source/standard/vclxaccessiblelistbox.cxx12
-rw-r--r--accessibility/source/standard/vclxaccessibleradiobutton.cxx8
-rw-r--r--accessibility/source/standard/vclxaccessiblescrollbar.cxx2
-rw-r--r--accessibility/source/standard/vclxaccessiblestatusbar.cxx2
-rw-r--r--accessibility/source/standard/vclxaccessibletabcontrol.cxx2
-rw-r--r--accessibility/source/standard/vclxaccessibletabpagewindow.cxx4
-rw-r--r--accessibility/source/standard/vclxaccessibletextcomponent.cxx4
-rw-r--r--accessibility/source/standard/vclxaccessibletextfield.cxx10
-rw-r--r--accessibility/source/standard/vclxaccessibletoolbox.cxx44
-rw-r--r--avmedia/inc/mediacontrol.hxx15
-rw-r--r--avmedia/source/framework/mediacontrol.cxx278
-rw-r--r--avmedia/source/framework/mediaplayer.cxx10
-rw-r--r--avmedia/source/framework/mediatoolbox.cxx11
-rw-r--r--avmedia/source/viewer/mediaevent_impl.cxx14
-rw-r--r--avmedia/source/viewer/mediaevent_impl.hxx3
-rw-r--r--avmedia/source/viewer/mediawindow.cxx7
-rw-r--r--avmedia/source/viewer/mediawindow_impl.cxx32
-rw-r--r--avmedia/source/viewer/mediawindow_impl.hxx7
-rw-r--r--basctl/source/basicide/basdoc.cxx7
-rw-r--r--basctl/source/basicide/basdoc.hxx7
-rw-r--r--basctl/source/basicide/basicbox.cxx36
-rw-r--r--basctl/source/basicide/basicbox.hxx11
-rw-r--r--basctl/source/basicide/basicrenderable.cxx8
-rw-r--r--basctl/source/basicide/basicrenderable.hxx4
-rw-r--r--basctl/source/basicide/baside2.cxx79
-rw-r--r--basctl/source/basicide/baside2.hxx72
-rw-r--r--basctl/source/basicide/baside2b.cxx323
-rw-r--r--basctl/source/basicide/baside3.cxx26
-rw-r--r--basctl/source/basicide/basides1.cxx54
-rw-r--r--basctl/source/basicide/basides2.cxx14
-rw-r--r--basctl/source/basicide/basides3.cxx10
-rw-r--r--basctl/source/basicide/basidesh.cxx69
-rw-r--r--basctl/source/basicide/basobj2.cxx10
-rw-r--r--basctl/source/basicide/basobj3.cxx8
-rw-r--r--basctl/source/basicide/bastype2.cxx9
-rw-r--r--basctl/source/basicide/bastype2.hxx1
-rw-r--r--basctl/source/basicide/bastypes.cxx39
-rw-r--r--basctl/source/basicide/brkdlg.cxx16
-rw-r--r--basctl/source/basicide/brkdlg.hxx14
-rw-r--r--basctl/source/basicide/layout.cxx31
-rw-r--r--basctl/source/basicide/layout.hxx13
-rw-r--r--basctl/source/basicide/linenumberwindow.cxx10
-rw-r--r--basctl/source/basicide/linenumberwindow.hxx3
-rw-r--r--basctl/source/basicide/macrodlg.cxx25
-rw-r--r--basctl/source/basicide/macrodlg.hxx29
-rw-r--r--basctl/source/basicide/moduldl2.cxx94
-rw-r--r--basctl/source/basicide/moduldlg.cxx81
-rw-r--r--basctl/source/basicide/moduldlg.hxx66
-rw-r--r--basctl/source/basicide/objdlg.cxx49
-rw-r--r--basctl/source/basicide/objdlg.hxx7
-rw-r--r--basctl/source/basicide/tbxctl.cxx2
-rw-r--r--basctl/source/basicide/tbxctl.hxx2
-rw-r--r--basctl/source/dlged/managelang.cxx36
-rw-r--r--basctl/source/dlged/propbrw.cxx6
-rw-r--r--basctl/source/inc/accessibledialogcontrolshape.hxx3
-rw-r--r--basctl/source/inc/accessibledialogwindow.hxx3
-rw-r--r--basctl/source/inc/baside3.hxx8
-rw-r--r--basctl/source/inc/basidesh.hxx30
-rw-r--r--basctl/source/inc/bastypes.hxx10
-rw-r--r--basctl/source/inc/dlged.hxx5
-rw-r--r--basctl/source/inc/managelang.hxx23
-rw-r--r--basctl/source/inc/propbrw.hxx1
-rw-r--r--basic/source/runtime/inputbox.cxx65
-rw-r--r--basic/source/runtime/iosys.cxx44
-rw-r--r--basic/source/runtime/methods.cxx12
-rw-r--r--canvas/source/cairo/cairo_canvasfont.cxx2
-rw-r--r--canvas/source/cairo/cairo_canvashelper.cxx4
-rw-r--r--canvas/source/cairo/cairo_canvashelper.hxx4
-rw-r--r--canvas/source/cairo/cairo_canvashelper_text.cxx4
-rw-r--r--canvas/source/cairo/cairo_devicehelper.cxx2
-rw-r--r--canvas/source/cairo/cairo_devicehelper.hxx2
-rw-r--r--canvas/source/cairo/cairo_textlayout.cxx10
-rw-r--r--canvas/source/directx/dx_9rm.cxx3
-rw-r--r--canvas/source/directx/dx_devicehelper.cxx6
-rw-r--r--canvas/source/directx/dx_devicehelper.hxx5
-rw-r--r--canvas/source/opengl/ogl_canvashelper.cxx12
-rw-r--r--canvas/source/vcl/backbuffer.cxx12
-rw-r--r--canvas/source/vcl/backbuffer.hxx3
-rw-r--r--canvas/source/vcl/bitmapbackbuffer.cxx7
-rw-r--r--canvas/source/vcl/bitmapbackbuffer.hxx2
-rw-r--r--canvas/source/vcl/canvasfont.cxx6
-rw-r--r--canvas/source/vcl/canvashelper_texturefill.cxx14
-rw-r--r--canvas/source/vcl/impltools.hxx2
-rw-r--r--canvas/source/vcl/spritecanvashelper.cxx10
-rw-r--r--canvas/source/vcl/spritecanvashelper.hxx4
-rw-r--r--canvas/source/vcl/textlayout.cxx26
-rw-r--r--chart2/inc/ChartModel.hxx2
-rw-r--r--chart2/source/controller/accessibility/AccessibleViewForwarder.hxx3
-rw-r--r--chart2/source/controller/dialogs/ChartTypeDialogController.hxx4
-rw-r--r--chart2/source/controller/dialogs/DataBrowser.cxx74
-rw-r--r--chart2/source/controller/dialogs/DataBrowser.hxx5
-rw-r--r--chart2/source/controller/dialogs/TextDirectionListBox.cxx4
-rw-r--r--chart2/source/controller/dialogs/dlg_ChartType.cxx11
-rw-r--r--chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx4
-rw-r--r--chart2/source/controller/dialogs/dlg_CreationWizard.cxx16
-rw-r--r--chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx14
-rw-r--r--chart2/source/controller/dialogs/dlg_DataEditor.cxx10
-rw-r--r--chart2/source/controller/dialogs/dlg_DataSource.cxx21
-rw-r--r--chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx17
-rw-r--r--chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx4
-rw-r--r--chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx4
-rw-r--r--chart2/source/controller/dialogs/dlg_NumberFormat.cxx4
-rw-r--r--chart2/source/controller/dialogs/dlg_NumberFormat.hxx3
-rw-r--r--chart2/source/controller/dialogs/dlg_ObjectProperties.cxx8
-rw-r--r--chart2/source/controller/dialogs/dlg_View3D.cxx21
-rw-r--r--chart2/source/controller/dialogs/res_BarGeometry.hxx4
-rw-r--r--chart2/source/controller/dialogs/res_DataLabel.cxx8
-rw-r--r--chart2/source/controller/dialogs/res_DataLabel.hxx38
-rw-r--r--chart2/source/controller/dialogs/res_Trendline.hxx46
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx13
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx9
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx14
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneGeometry.hxx15
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx26
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx28
-rw-r--r--chart2/source/controller/dialogs/tp_AxisLabel.cxx32
-rw-r--r--chart2/source/controller/dialogs/tp_AxisLabel.hxx37
-rw-r--r--chart2/source/controller/dialogs/tp_AxisPositions.cxx28
-rw-r--r--chart2/source/controller/dialogs/tp_AxisPositions.hxx40
-rw-r--r--chart2/source/controller/dialogs/tp_ChartType.cxx82
-rw-r--r--chart2/source/controller/dialogs/tp_ChartType.hxx7
-rw-r--r--chart2/source/controller/dialogs/tp_DataLabel.cxx8
-rw-r--r--chart2/source/controller/dialogs/tp_DataLabel.hxx3
-rw-r--r--chart2/source/controller/dialogs/tp_DataSource.cxx27
-rw-r--r--chart2/source/controller/dialogs/tp_DataSource.hxx41
-rw-r--r--chart2/source/controller/dialogs/tp_ErrorBars.cxx4
-rw-r--r--chart2/source/controller/dialogs/tp_ErrorBars.hxx2
-rw-r--r--chart2/source/controller/dialogs/tp_LegendPosition.cxx16
-rw-r--r--chart2/source/controller/dialogs/tp_LegendPosition.hxx6
-rw-r--r--chart2/source/controller/dialogs/tp_PointGeometry.cxx13
-rw-r--r--chart2/source/controller/dialogs/tp_PointGeometry.hxx3
-rw-r--r--chart2/source/controller/dialogs/tp_PolarOptions.cxx16
-rw-r--r--chart2/source/controller/dialogs/tp_PolarOptions.hxx15
-rw-r--r--chart2/source/controller/dialogs/tp_RangeChooser.cxx20
-rw-r--r--chart2/source/controller/dialogs/tp_RangeChooser.hxx29
-rw-r--r--chart2/source/controller/dialogs/tp_Scale.cxx39
-rw-r--r--chart2/source/controller/dialogs/tp_Scale.hxx68
-rw-r--r--chart2/source/controller/dialogs/tp_SeriesToAxis.cxx25
-rw-r--r--chart2/source/controller/dialogs/tp_SeriesToAxis.hxx37
-rw-r--r--chart2/source/controller/dialogs/tp_TitleRotation.cxx26
-rw-r--r--chart2/source/controller/dialogs/tp_TitleRotation.hxx19
-rw-r--r--chart2/source/controller/dialogs/tp_Trendline.cxx8
-rw-r--r--chart2/source/controller/dialogs/tp_Trendline.hxx3
-rw-r--r--chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx13
-rw-r--r--chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.hxx8
-rw-r--r--chart2/source/controller/drawinglayer/ViewElementListProvider.cxx6
-rw-r--r--chart2/source/controller/inc/TextDirectionListBox.hxx1
-rw-r--r--chart2/source/controller/inc/dlg_ChartType.hxx3
-rw-r--r--chart2/source/controller/inc/dlg_ChartType_UNO.hxx2
-rw-r--r--chart2/source/controller/inc/dlg_CreationWizard.hxx5
-rw-r--r--chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx2
-rw-r--r--chart2/source/controller/inc/dlg_DataEditor.hxx5
-rw-r--r--chart2/source/controller/inc/dlg_DataSource.hxx9
-rw-r--r--chart2/source/controller/inc/dlg_InsertAxis_Grid.hxx14
-rw-r--r--chart2/source/controller/inc/dlg_InsertDataLabel.hxx3
-rw-r--r--chart2/source/controller/inc/dlg_InsertErrorBars.hxx1
-rw-r--r--chart2/source/controller/inc/dlg_ObjectProperties.hxx1
-rw-r--r--chart2/source/controller/inc/dlg_View3D.hxx9
-rw-r--r--chart2/source/controller/inc/res_ErrorBar.hxx54
-rw-r--r--chart2/source/controller/inc/res_LegendPosition.hxx10
-rw-r--r--chart2/source/controller/inc/res_Titles.hxx28
-rw-r--r--chart2/source/controller/main/ChartController.cxx10
-rw-r--r--chart2/source/controller/main/ChartController.hxx2
-rw-r--r--chart2/source/controller/main/ChartController_EditData.cxx7
-rw-r--r--chart2/source/controller/main/ChartController_Insert.cxx64
-rw-r--r--chart2/source/controller/main/ChartController_Properties.cxx19
-rw-r--r--chart2/source/controller/main/ChartWindow.cxx12
-rw-r--r--chart2/source/controller/main/ChartWindow.hxx3
-rw-r--r--chart2/source/controller/main/ElementSelector.cxx6
-rw-r--r--chart2/source/controller/main/ElementSelector.hxx3
-rw-r--r--chart2/source/controller/main/ShapeController.cxx24
-rw-r--r--chart2/source/controller/main/ShapeToolbarController.cxx2
-rw-r--r--chart2/source/inc/chartview/DrawModelWrapper.hxx2
-rw-r--r--chart2/source/view/charttypes/GL3DBarChart.cxx2
-rw-r--r--chart2/source/view/inc/GL3DBarChart.hxx2
-rw-r--r--chart2/source/view/main/3DChartObjects.cxx16
-rw-r--r--chart2/source/view/main/ChartView.cxx2
-rw-r--r--chart2/source/view/main/DrawModelWrapper.cxx4
-rw-r--r--chart2/source/view/main/DummyXShape.cxx16
-rw-r--r--chart2/source/view/main/OpenGLRender.cxx16
-rw-r--r--compilerplugins/clang/vclwidgets.cxx458
-rw-r--r--connectivity/source/drivers/file/fcomp.cxx2
-rw-r--r--cppcanvas/qa/unit/test.cxx2
-rw-r--r--cppcanvas/source/mtfrenderer/implrenderer.cxx12
-rw-r--r--cppcanvas/source/mtfrenderer/transparencygroupaction.cxx12
-rw-r--r--cui/source/customize/acccfg.cxx31
-rw-r--r--cui/source/customize/cfg.cxx250
-rw-r--r--cui/source/customize/cfgutil.cxx13
-rw-r--r--cui/source/customize/eventdlg.cxx7
-rw-r--r--cui/source/customize/eventdlg.hxx3
-rw-r--r--cui/source/customize/macropg.cxx82
-rw-r--r--cui/source/customize/macropg_impl.hxx13
-rw-r--r--cui/source/customize/selector.cxx25
-rw-r--r--cui/source/dialogs/SpellDialog.cxx59
-rw-r--r--cui/source/dialogs/about.cxx23
-rw-r--r--cui/source/dialogs/colorpicker.cxx104
-rw-r--r--cui/source/dialogs/cuicharmap.cxx25
-rw-r--r--cui/source/dialogs/cuifmsearch.cxx45
-rw-r--r--cui/source/dialogs/cuigaldlg.cxx120
-rw-r--r--cui/source/dialogs/cuigrfflt.cxx72
-rw-r--r--cui/source/dialogs/cuihyperdlg.cxx10
-rw-r--r--cui/source/dialogs/cuiimapwnd.cxx15
-rw-r--r--cui/source/dialogs/cuitbxform.cxx11
-rw-r--r--cui/source/dialogs/dlgname.cxx48
-rw-r--r--cui/source/dialogs/hangulhanjadlg.cxx191
-rw-r--r--cui/source/dialogs/hldocntp.cxx31
-rw-r--r--cui/source/dialogs/hldoctp.cxx17
-rw-r--r--cui/source/dialogs/hlinettp.cxx23
-rw-r--r--cui/source/dialogs/hlmailtp.cxx16
-rw-r--r--cui/source/dialogs/hlmarkwn.cxx21
-rw-r--r--cui/source/dialogs/hltpbase.cxx30
-rw-r--r--cui/source/dialogs/hyphen.cxx15
-rw-r--r--cui/source/dialogs/iconcdlg.cxx46
-rw-r--r--cui/source/dialogs/insdlg.cxx54
-rw-r--r--cui/source/dialogs/insrc.cxx22
-rw-r--r--cui/source/dialogs/linkdlg.cxx24
-rw-r--r--cui/source/dialogs/multipat.cxx41
-rw-r--r--cui/source/dialogs/newtabledlg.cxx15
-rw-r--r--cui/source/dialogs/passwdomdlg.cxx30
-rw-r--r--cui/source/dialogs/pastedlg.cxx17
-rw-r--r--cui/source/dialogs/postdlg.cxx13
-rw-r--r--cui/source/dialogs/scriptdlg.cxx69
-rw-r--r--cui/source/dialogs/showcols.cxx11
-rw-r--r--cui/source/dialogs/splitcelldlg.cxx32
-rw-r--r--cui/source/dialogs/srchxtra.cxx32
-rw-r--r--cui/source/dialogs/thesdlg.cxx55
-rw-r--r--cui/source/dialogs/zoom.cxx23
-rw-r--r--cui/source/factory/cuiexp.cxx29
-rw-r--r--cui/source/factory/dlgfact.cxx163
-rw-r--r--cui/source/factory/dlgfact.hxx8
-rw-r--r--cui/source/factory/init.cxx2
-rw-r--r--cui/source/inc/ControlFocusHelper.hxx4
-rw-r--r--cui/source/inc/SpellDialog.hxx42
-rw-r--r--cui/source/inc/about.hxx16
-rw-r--r--cui/source/inc/acccfg.hxx27
-rw-r--r--cui/source/inc/align.hxx55
-rw-r--r--cui/source/inc/autocdlg.hxx141
-rw-r--r--cui/source/inc/backgrnd.hxx61
-rw-r--r--cui/source/inc/border.hxx69
-rw-r--r--cui/source/inc/cfg.hxx82
-rw-r--r--cui/source/inc/cfgutil.hxx4
-rw-r--r--cui/source/inc/chardlg.hxx194
-rw-r--r--cui/source/inc/connect.hxx28
-rw-r--r--cui/source/inc/cuicharmap.hxx24
-rw-r--r--cui/source/inc/cuifmsearch.hxx55
-rw-r--r--cui/source/inc/cuigaldlg.hxx78
-rw-r--r--cui/source/inc/cuigrfflt.hxx34
-rw-r--r--cui/source/inc/cuihyperdlg.hxx3
-rw-r--r--cui/source/inc/cuiimapwnd.hxx12
-rw-r--r--cui/source/inc/cuioptgenrl.hxx7
-rw-r--r--cui/source/inc/cuisrchdlg.hxx6
-rw-r--r--cui/source/inc/cuitabarea.hxx297
-rw-r--r--cui/source/inc/cuitabline.hxx117
-rw-r--r--cui/source/inc/cuitbxform.hxx4
-rw-r--r--cui/source/inc/dbregister.hxx14
-rw-r--r--cui/source/inc/dlgname.hxx30
-rw-r--r--cui/source/inc/dstribut.hxx28
-rw-r--r--cui/source/inc/grfpage.hxx45
-rw-r--r--cui/source/inc/hangulhanjadlg.hxx100
-rw-r--r--cui/source/inc/headertablistbox.hxx10
-rw-r--r--cui/source/inc/hldocntp.hxx13
-rw-r--r--cui/source/inc/hldoctp.hxx15
-rw-r--r--cui/source/inc/hlinettp.hxx23
-rw-r--r--cui/source/inc/hlmailtp.hxx13
-rw-r--r--cui/source/inc/hlmarkwn.hxx13
-rw-r--r--cui/source/inc/hltpbase.hxx15
-rw-r--r--cui/source/inc/hyphen.hxx17
-rw-r--r--cui/source/inc/iconcdlg.hxx32
-rw-r--r--cui/source/inc/insdlg.hxx55
-rw-r--r--cui/source/inc/insrc.hxx12
-rw-r--r--cui/source/inc/labdlg.hxx24
-rw-r--r--cui/source/inc/linkdlg.hxx21
-rw-r--r--cui/source/inc/macroass.hxx3
-rw-r--r--cui/source/inc/macropg.hxx1
-rw-r--r--cui/source/inc/measure.hxx37
-rw-r--r--cui/source/inc/multipat.hxx14
-rw-r--r--cui/source/inc/newtabledlg.hxx8
-rw-r--r--cui/source/inc/numfmt.hxx63
-rw-r--r--cui/source/inc/numpages.hxx168
-rw-r--r--cui/source/inc/optasian.hxx32
-rw-r--r--cui/source/inc/optdict.hxx29
-rw-r--r--cui/source/inc/optlingu.hxx40
-rw-r--r--cui/source/inc/optpath.hxx11
-rw-r--r--cui/source/inc/page.hxx63
-rw-r--r--cui/source/inc/paragrph.hxx140
-rw-r--r--cui/source/inc/passwdomdlg.hxx1
-rw-r--r--cui/source/inc/pastedlg.hxx9
-rw-r--r--cui/source/inc/postdlg.hxx15
-rw-r--r--cui/source/inc/radiobtnbox.hxx1
-rw-r--r--cui/source/inc/scriptdlg.hxx20
-rw-r--r--cui/source/inc/selector.hxx20
-rw-r--r--cui/source/inc/showcols.hxx6
-rw-r--r--cui/source/inc/splitcelldlg.hxx13
-rw-r--r--cui/source/inc/srchxtra.hxx17
-rw-r--r--cui/source/inc/swpossizetabpage.hxx55
-rw-r--r--cui/source/inc/tabstpge.hxx58
-rw-r--r--cui/source/inc/textanim.hxx39
-rw-r--r--cui/source/inc/textattr.hxx36
-rw-r--r--cui/source/inc/thesdlg.hxx24
-rw-r--r--cui/source/inc/transfrm.hxx69
-rw-r--r--cui/source/inc/treeopt.hxx12
-rw-r--r--cui/source/inc/zoom.hxx27
-rw-r--r--cui/source/options/certpath.cxx13
-rw-r--r--cui/source/options/certpath.hxx9
-rw-r--r--cui/source/options/connpooloptions.cxx20
-rw-r--r--cui/source/options/connpooloptions.hxx24
-rw-r--r--cui/source/options/cuisrchdlg.cxx16
-rw-r--r--cui/source/options/dbregister.cxx36
-rw-r--r--cui/source/options/doclinkdialog.cxx26
-rw-r--r--cui/source/options/doclinkdialog.hxx10
-rw-r--r--cui/source/options/fontsubs.cxx27
-rw-r--r--cui/source/options/fontsubs.hxx25
-rw-r--r--cui/source/options/optaboutconfig.cxx30
-rw-r--r--cui/source/options/optaboutconfig.hxx18
-rw-r--r--cui/source/options/optaccessibility.cxx20
-rw-r--r--cui/source/options/optaccessibility.hxx24
-rw-r--r--cui/source/options/optasian.cxx24
-rw-r--r--cui/source/options/optbasic.cxx16
-rw-r--r--cui/source/options/optbasic.hxx15
-rw-r--r--cui/source/options/optchart.cxx34
-rw-r--r--cui/source/options/optchart.hxx13
-rw-r--r--cui/source/options/optcolor.cxx157
-rw-r--r--cui/source/options/optcolor.hxx11
-rw-r--r--cui/source/options/optctl.cxx16
-rw-r--r--cui/source/options/optctl.hxx20
-rw-r--r--cui/source/options/optdict.cxx41
-rw-r--r--cui/source/options/optfltr.cxx42
-rw-r--r--cui/source/options/optfltr.hxx37
-rw-r--r--cui/source/options/optgdlg.cxx82
-rw-r--r--cui/source/options/optgdlg.hxx99
-rw-r--r--cui/source/options/optgenrl.cxx21
-rw-r--r--cui/source/options/opthtml.cxx28
-rw-r--r--cui/source/options/opthtml.hxx41
-rw-r--r--cui/source/options/optinet2.cxx91
-rw-r--r--cui/source/options/optinet2.hxx86
-rw-r--r--cui/source/options/optjava.cxx83
-rw-r--r--cui/source/options/optjava.hxx47
-rw-r--r--cui/source/options/optjsearch.cxx29
-rw-r--r--cui/source/options/optjsearch.hxx50
-rw-r--r--cui/source/options/optlingu.cxx78
-rw-r--r--cui/source/options/optmemory.cxx19
-rw-r--r--cui/source/options/optmemory.hxx17
-rw-r--r--cui/source/options/optopencl.cxx65
-rw-r--r--cui/source/options/optopencl.hxx43
-rw-r--r--cui/source/options/optpath.cxx31
-rw-r--r--cui/source/options/optsave.cxx33
-rw-r--r--cui/source/options/optsave.hxx41
-rw-r--r--cui/source/options/optupdt.cxx27
-rw-r--r--cui/source/options/optupdt.hxx23
-rw-r--r--cui/source/options/personalization.cxx45
-rw-r--r--cui/source/options/personalization.hxx37
-rw-r--r--cui/source/options/radiobtnbox.cxx4
-rw-r--r--cui/source/options/securityoptions.cxx13
-rw-r--r--cui/source/options/securityoptions.hxx17
-rw-r--r--cui/source/options/treeopt.cxx53
-rw-r--r--cui/source/options/tsaurls.cxx11
-rw-r--r--cui/source/options/tsaurls.hxx10
-rw-r--r--cui/source/options/webconninfo.cxx12
-rw-r--r--cui/source/options/webconninfo.hxx9
-rw-r--r--cui/source/tabpages/align.cxx36
-rw-r--r--cui/source/tabpages/autocdlg.cxx198
-rw-r--r--cui/source/tabpages/backgrnd.cxx66
-rw-r--r--cui/source/tabpages/border.cxx42
-rw-r--r--cui/source/tabpages/chardlg.cxx153
-rw-r--r--cui/source/tabpages/connect.cxx42
-rw-r--r--cui/source/tabpages/dstribut.cxx38
-rw-r--r--cui/source/tabpages/grfpage.cxx45
-rw-r--r--cui/source/tabpages/labdlg.cxx26
-rw-r--r--cui/source/tabpages/macroass.cxx32
-rw-r--r--cui/source/tabpages/measure.cxx41
-rw-r--r--cui/source/tabpages/numfmt.cxx52
-rw-r--r--cui/source/tabpages/numpages.cxx154
-rw-r--r--cui/source/tabpages/page.cxx42
-rw-r--r--cui/source/tabpages/paragrph.cxx99
-rw-r--r--cui/source/tabpages/swpossizetabpage.cxx45
-rw-r--r--cui/source/tabpages/tabarea.cxx4
-rw-r--r--cui/source/tabpages/tabline.cxx6
-rw-r--r--cui/source/tabpages/tabstpge.cxx41
-rw-r--r--cui/source/tabpages/textanim.cxx34
-rw-r--r--cui/source/tabpages/textattr.cxx37
-rw-r--r--cui/source/tabpages/tparea.cxx82
-rw-r--r--cui/source/tabpages/tpbitmap.cxx55
-rw-r--r--cui/source/tabpages/tpcolor.cxx79
-rw-r--r--cui/source/tabpages/tpgradnt.cxx58
-rw-r--r--cui/source/tabpages/tphatch.cxx51
-rw-r--r--cui/source/tabpages/tpline.cxx67
-rw-r--r--cui/source/tabpages/tplnedef.cxx62
-rw-r--r--cui/source/tabpages/tplneend.cxx63
-rw-r--r--cui/source/tabpages/tpshadow.cxx23
-rw-r--r--cui/source/tabpages/transfrm.cxx76
-rw-r--r--dbaccess/source/core/dataaccess/databasedocument.cxx1
-rw-r--r--dbaccess/source/ext/macromigration/macromigrationdialog.cxx4
-rw-r--r--dbaccess/source/ext/macromigration/macromigrationpages.cxx64
-rw-r--r--dbaccess/source/ext/macromigration/macromigrationpages.hxx43
-rw-r--r--dbaccess/source/ext/macromigration/macromigrationwizard.cxx6
-rw-r--r--dbaccess/source/ext/macromigration/rangeprogressbar.hxx2
-rw-r--r--dbaccess/source/ui/app/AppController.cxx13
-rw-r--r--dbaccess/source/ui/app/AppControllerDnD.cxx23
-rw-r--r--dbaccess/source/ui/app/AppControllerGen.cxx14
-rw-r--r--dbaccess/source/ui/app/AppDetailPageHelper.cxx150
-rw-r--r--dbaccess/source/ui/app/AppDetailPageHelper.hxx19
-rw-r--r--dbaccess/source/ui/app/AppDetailView.cxx146
-rw-r--r--dbaccess/source/ui/app/AppDetailView.hxx24
-rw-r--r--dbaccess/source/ui/app/AppIconControl.cxx7
-rw-r--r--dbaccess/source/ui/app/AppIconControl.hxx1
-rw-r--r--dbaccess/source/ui/app/AppSwapWindow.cxx44
-rw-r--r--dbaccess/source/ui/app/AppSwapWindow.hxx10
-rw-r--r--dbaccess/source/ui/app/AppTitleWindow.cxx33
-rw-r--r--dbaccess/source/ui/app/AppTitleWindow.hxx9
-rw-r--r--dbaccess/source/ui/app/AppView.cxx41
-rw-r--r--dbaccess/source/ui/app/AppView.hxx10
-rw-r--r--dbaccess/source/ui/app/subcomponentmanager.cxx1
-rw-r--r--dbaccess/source/ui/browser/brwctrlr.cxx26
-rw-r--r--dbaccess/source/ui/browser/brwview.cxx34
-rw-r--r--dbaccess/source/ui/browser/dataview.cxx28
-rw-r--r--dbaccess/source/ui/browser/dbtreeview.cxx11
-rw-r--r--dbaccess/source/ui/browser/dbtreeview.hxx3
-rw-r--r--dbaccess/source/ui/browser/genericcontroller.cxx13
-rw-r--r--dbaccess/source/ui/browser/sbagrid.cxx32
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx4
-rw-r--r--dbaccess/source/ui/control/ColumnControlWindow.cxx5
-rw-r--r--dbaccess/source/ui/control/FieldDescControl.cxx155
-rw-r--r--dbaccess/source/ui/control/RelationControl.cxx11
-rw-r--r--dbaccess/source/ui/control/TableGrantCtrl.cxx14
-rw-r--r--dbaccess/source/ui/control/VertSplitView.cxx10
-rw-r--r--dbaccess/source/ui/control/charsetlistbox.cxx4
-rw-r--r--dbaccess/source/ui/control/curledit.cxx17
-rw-r--r--dbaccess/source/ui/control/dbtreelistbox.cxx6
-rw-r--r--dbaccess/source/ui/control/marktree.cxx7
-rw-r--r--dbaccess/source/ui/control/sqledit.cxx7
-rw-r--r--dbaccess/source/ui/control/toolboxcontroller.cxx6
-rw-r--r--dbaccess/source/ui/dlg/CollectionView.cxx17
-rw-r--r--dbaccess/source/ui/dlg/ConnectionHelper.cxx37
-rw-r--r--dbaccess/source/ui/dlg/ConnectionHelper.hxx10
-rw-r--r--dbaccess/source/ui/dlg/ConnectionPage.cxx24
-rw-r--r--dbaccess/source/ui/dlg/ConnectionPage.hxx27
-rw-r--r--dbaccess/source/ui/dlg/ConnectionPageSetup.cxx28
-rw-r--r--dbaccess/source/ui/dlg/ConnectionPageSetup.hxx17
-rw-r--r--dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx186
-rw-r--r--dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx138
-rw-r--r--dbaccess/source/ui/dlg/DbAdminImpl.hxx3
-rw-r--r--dbaccess/source/ui/dlg/DriverSettings.hxx27
-rw-r--r--dbaccess/source/ui/dlg/QueryPropertiesDialog.cxx9
-rw-r--r--dbaccess/source/ui/dlg/RelationDlg.cxx24
-rw-r--r--dbaccess/source/ui/dlg/TablesSingleDlg.cxx8
-rw-r--r--dbaccess/source/ui/dlg/TextConnectionHelper.cxx26
-rw-r--r--dbaccess/source/ui/dlg/TextConnectionHelper.hxx39
-rw-r--r--dbaccess/source/ui/dlg/UserAdmin.cxx85
-rw-r--r--dbaccess/source/ui/dlg/UserAdmin.hxx13
-rw-r--r--dbaccess/source/ui/dlg/UserAdminDlg.cxx8
-rw-r--r--dbaccess/source/ui/dlg/admincontrols.cxx18
-rw-r--r--dbaccess/source/ui/dlg/admincontrols.hxx26
-rw-r--r--dbaccess/source/ui/dlg/adminpages.cxx16
-rw-r--r--dbaccess/source/ui/dlg/adminpages.hxx2
-rw-r--r--dbaccess/source/ui/dlg/adtabdlg.cxx12
-rw-r--r--dbaccess/source/ui/dlg/advancedsettings.cxx65
-rw-r--r--dbaccess/source/ui/dlg/advancedsettings.hxx58
-rw-r--r--dbaccess/source/ui/dlg/dbadmin.cxx7
-rw-r--r--dbaccess/source/ui/dlg/dbfindex.cxx19
-rw-r--r--dbaccess/source/ui/dlg/dbfindex.hxx20
-rw-r--r--dbaccess/source/ui/dlg/dbwiz.cxx18
-rw-r--r--dbaccess/source/ui/dlg/dbwizsetup.cxx31
-rw-r--r--dbaccess/source/ui/dlg/detailpages.cxx192
-rw-r--r--dbaccess/source/ui/dlg/detailpages.hxx98
-rw-r--r--dbaccess/source/ui/dlg/directsql.cxx18
-rw-r--r--dbaccess/source/ui/dlg/dlgattr.cxx7
-rw-r--r--dbaccess/source/ui/dlg/dlgsave.cxx22
-rw-r--r--dbaccess/source/ui/dlg/dlgsize.cxx13
-rw-r--r--dbaccess/source/ui/dlg/dsselect.cxx10
-rw-r--r--dbaccess/source/ui/dlg/dsselect.hxx10
-rw-r--r--dbaccess/source/ui/dlg/generalpage.cxx30
-rw-r--r--dbaccess/source/ui/dlg/generalpage.hxx27
-rw-r--r--dbaccess/source/ui/dlg/indexdialog.cxx38
-rw-r--r--dbaccess/source/ui/dlg/indexfieldscontrol.cxx13
-rw-r--r--dbaccess/source/ui/dlg/paramdialog.cxx12
-rw-r--r--dbaccess/source/ui/dlg/queryfilter.cxx17
-rw-r--r--dbaccess/source/ui/dlg/queryorder.cxx14
-rw-r--r--dbaccess/source/ui/dlg/sqlmessage.cxx82
-rw-r--r--dbaccess/source/ui/dlg/tablespage.cxx14
-rw-r--r--dbaccess/source/ui/dlg/tablespage.hxx7
-rw-r--r--dbaccess/source/ui/dlg/textconnectionsettings.cxx10
-rw-r--r--dbaccess/source/ui/inc/CollectionView.hxx14
-rw-r--r--dbaccess/source/ui/inc/ColumnControlWindow.hxx1
-rw-r--r--dbaccess/source/ui/inc/ConnectionLine.hxx5
-rw-r--r--dbaccess/source/ui/inc/ConnectionLineAccess.hxx3
-rw-r--r--dbaccess/source/ui/inc/FieldDescControl.hxx75
-rw-r--r--dbaccess/source/ui/inc/JAccess.hxx3
-rw-r--r--dbaccess/source/ui/inc/JoinController.hxx2
-rw-r--r--dbaccess/source/ui/inc/JoinDesignView.hxx5
-rw-r--r--dbaccess/source/ui/inc/JoinTableView.hxx35
-rw-r--r--dbaccess/source/ui/inc/LimitBox.hxx1
-rw-r--r--dbaccess/source/ui/inc/QueryDesignView.hxx9
-rw-r--r--dbaccess/source/ui/inc/QueryPropertiesDialog.hxx8
-rw-r--r--dbaccess/source/ui/inc/QueryTableView.hxx3
-rw-r--r--dbaccess/source/ui/inc/QueryTextView.hxx3
-rw-r--r--dbaccess/source/ui/inc/QueryViewSwitch.hxx4
-rw-r--r--dbaccess/source/ui/inc/RelationControl.hxx6
-rw-r--r--dbaccess/source/ui/inc/RelationDesignView.hxx1
-rw-r--r--dbaccess/source/ui/inc/RelationDlg.hxx21
-rw-r--r--dbaccess/source/ui/inc/RelationTableView.hxx5
-rw-r--r--dbaccess/source/ui/inc/TableConnection.hxx3
-rw-r--r--dbaccess/source/ui/inc/TableDesignControl.hxx1
-rw-r--r--dbaccess/source/ui/inc/TableDesignHelpBar.hxx3
-rw-r--r--dbaccess/source/ui/inc/TableDesignView.hxx10
-rw-r--r--dbaccess/source/ui/inc/TableFieldDescription.hxx3
-rw-r--r--dbaccess/source/ui/inc/TableGrantCtrl.hxx5
-rw-r--r--dbaccess/source/ui/inc/TableWindow.hxx11
-rw-r--r--dbaccess/source/ui/inc/TableWindowAccess.hxx3
-rw-r--r--dbaccess/source/ui/inc/TableWindowListBox.hxx5
-rw-r--r--dbaccess/source/ui/inc/TableWindowTitle.hxx3
-rw-r--r--dbaccess/source/ui/inc/TablesSingleDlg.hxx1
-rw-r--r--dbaccess/source/ui/inc/TokenWriter.hxx2
-rw-r--r--dbaccess/source/ui/inc/UserAdminDlg.hxx1
-rw-r--r--dbaccess/source/ui/inc/VertSplitView.hxx7
-rw-r--r--dbaccess/source/ui/inc/WCPage.hxx23
-rw-r--r--dbaccess/source/ui/inc/WColumnSelect.hxx13
-rw-r--r--dbaccess/source/ui/inc/WCopyTable.hxx11
-rw-r--r--dbaccess/source/ui/inc/WExtendPages.hxx8
-rw-r--r--dbaccess/source/ui/inc/WNameMatch.hxx22
-rw-r--r--dbaccess/source/ui/inc/WTabPage.hxx4
-rw-r--r--dbaccess/source/ui/inc/WTypeSelect.hxx24
-rw-r--r--dbaccess/source/ui/inc/adtabdlg.hxx13
-rw-r--r--dbaccess/source/ui/inc/advancedsettingsdlg.hxx1
-rw-r--r--dbaccess/source/ui/inc/brwview.hxx11
-rw-r--r--dbaccess/source/ui/inc/charsetlistbox.hxx1
-rw-r--r--dbaccess/source/ui/inc/curledit.hxx3
-rw-r--r--dbaccess/source/ui/inc/datasourceconnector.hxx7
-rw-r--r--dbaccess/source/ui/inc/dbadmin.hxx1
-rw-r--r--dbaccess/source/ui/inc/dbtreelistbox.hxx1
-rw-r--r--dbaccess/source/ui/inc/dbwiz.hxx3
-rw-r--r--dbaccess/source/ui/inc/dbwizsetup.hxx9
-rw-r--r--dbaccess/source/ui/inc/directsql.hxx15
-rw-r--r--dbaccess/source/ui/inc/dlgattr.hxx1
-rw-r--r--dbaccess/source/ui/inc/dlgsave.hxx1
-rw-r--r--dbaccess/source/ui/inc/dlgsize.hxx6
-rw-r--r--dbaccess/source/ui/inc/indexdialog.hxx19
-rw-r--r--dbaccess/source/ui/inc/indexfieldscontrol.hxx5
-rw-r--r--dbaccess/source/ui/inc/linkeddocuments.hxx3
-rw-r--r--dbaccess/source/ui/inc/marktree.hxx1
-rw-r--r--dbaccess/source/ui/inc/paramdialog.hxx11
-rw-r--r--dbaccess/source/ui/inc/querycontainerwindow.hxx5
-rw-r--r--dbaccess/source/ui/inc/queryfilter.hxx23
-rw-r--r--dbaccess/source/ui/inc/queryorder.hxx19
-rw-r--r--dbaccess/source/ui/inc/queryview.hxx1
-rw-r--r--dbaccess/source/ui/inc/sbagrid.hxx5
-rw-r--r--dbaccess/source/ui/inc/sqledit.hxx3
-rw-r--r--dbaccess/source/ui/inc/sqlmessage.hxx7
-rw-r--r--dbaccess/source/ui/inc/textconnectionsettings.hxx5
-rw-r--r--dbaccess/source/ui/inc/undosqledit.hxx3
-rw-r--r--dbaccess/source/ui/inc/unodatbr.hxx10
-rw-r--r--dbaccess/source/ui/inc/unosqlmessage.hxx2
-rw-r--r--dbaccess/source/ui/misc/DExport.cxx24
-rw-r--r--dbaccess/source/ui/misc/RowSetDrop.cxx4
-rw-r--r--dbaccess/source/ui/misc/ToolBoxHelper.cxx2
-rw-r--r--dbaccess/source/ui/misc/UITools.cxx31
-rw-r--r--dbaccess/source/ui/misc/WCPage.cxx19
-rw-r--r--dbaccess/source/ui/misc/WColumnSelect.cxx23
-rw-r--r--dbaccess/source/ui/misc/WCopyTable.cxx46
-rw-r--r--dbaccess/source/ui/misc/WNameMatch.cxx16
-rw-r--r--dbaccess/source/ui/misc/WTypeSelect.cxx58
-rw-r--r--dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx4
-rw-r--r--dbaccess/source/ui/misc/singledoccontroller.cxx1
-rw-r--r--dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx14
-rw-r--r--dbaccess/source/ui/querydesign/JoinController.cxx9
-rw-r--r--dbaccess/source/ui/querydesign/JoinDesignView.cxx14
-rw-r--r--dbaccess/source/ui/querydesign/JoinTableView.cxx85
-rw-r--r--dbaccess/source/ui/querydesign/LimitBox.cxx7
-rw-r--r--dbaccess/source/ui/querydesign/QTableConnection.cxx4
-rw-r--r--dbaccess/source/ui/querydesign/QTableConnection.hxx1
-rw-r--r--dbaccess/source/ui/querydesign/QTableWindow.cxx10
-rw-r--r--dbaccess/source/ui/querydesign/QTableWindow.hxx1
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx2
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx3
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignView.cxx105
-rw-r--r--dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.hxx2
-rw-r--r--dbaccess/source/ui/querydesign/QuerySizeTabWinUndoAct.hxx2
-rw-r--r--dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx19
-rw-r--r--dbaccess/source/ui/querydesign/QueryTabConnUndoAction.hxx2
-rw-r--r--dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx10
-rw-r--r--dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx6
-rw-r--r--dbaccess/source/ui/querydesign/QueryTableView.cxx92
-rw-r--r--dbaccess/source/ui/querydesign/QueryTextView.cxx11
-rw-r--r--dbaccess/source/ui/querydesign/QueryViewSwitch.cxx12
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx43
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx15
-rw-r--r--dbaccess/source/ui/querydesign/TableConnection.cxx2
-rw-r--r--dbaccess/source/ui/querydesign/TableFieldDescription.cxx1
-rw-r--r--dbaccess/source/ui/querydesign/TableWindow.cxx48
-rw-r--r--dbaccess/source/ui/querydesign/TableWindowAccess.cxx8
-rw-r--r--dbaccess/source/ui/querydesign/TableWindowListBox.cxx8
-rw-r--r--dbaccess/source/ui/querydesign/TableWindowTitle.cxx14
-rw-r--r--dbaccess/source/ui/querydesign/limitboxcontroller.cxx10
-rw-r--r--dbaccess/source/ui/querydesign/limitboxcontroller.hxx3
-rw-r--r--dbaccess/source/ui/querydesign/querycontainerwindow.cxx15
-rw-r--r--dbaccess/source/ui/querydesign/querycontroller.cxx38
-rw-r--r--dbaccess/source/ui/querydesign/querydlg.cxx11
-rw-r--r--dbaccess/source/ui/querydesign/querydlg.hxx11
-rw-r--r--dbaccess/source/ui/querydesign/queryview.cxx5
-rw-r--r--dbaccess/source/ui/relationdesign/RTableConnection.cxx4
-rw-r--r--dbaccess/source/ui/relationdesign/RTableConnection.hxx1
-rw-r--r--dbaccess/source/ui/relationdesign/RelationController.cxx12
-rw-r--r--dbaccess/source/ui/relationdesign/RelationDesignView.cxx6
-rw-r--r--dbaccess/source/ui/relationdesign/RelationTableView.cxx61
-rw-r--r--dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx12
-rw-r--r--dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx3
-rw-r--r--dbaccess/source/ui/tabledesign/TEditControl.cxx23
-rw-r--r--dbaccess/source/ui/tabledesign/TEditControl.hxx13
-rw-r--r--dbaccess/source/ui/tabledesign/TableController.cxx58
-rw-r--r--dbaccess/source/ui/tabledesign/TableDesignControl.cxx5
-rw-r--r--dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx11
-rw-r--r--dbaccess/source/ui/tabledesign/TableDesignView.cxx55
-rw-r--r--dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx27
-rw-r--r--dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx7
-rw-r--r--dbaccess/source/ui/tabledesign/TableUndo.hxx7
-rw-r--r--dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx7
-rw-r--r--dbaccess/source/ui/uno/ColumnPeer.cxx13
-rw-r--r--dbaccess/source/ui/uno/DBTypeWizDlg.cxx5
-rw-r--r--dbaccess/source/ui/uno/DBTypeWizDlg.hxx2
-rw-r--r--dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx6
-rw-r--r--dbaccess/source/ui/uno/DBTypeWizDlgSetup.hxx2
-rw-r--r--dbaccess/source/ui/uno/TableFilterDlg.cxx5
-rw-r--r--dbaccess/source/ui/uno/TableFilterDlg.hxx2
-rw-r--r--dbaccess/source/ui/uno/UserSettingsDlg.cxx5
-rw-r--r--dbaccess/source/ui/uno/UserSettingsDlg.hxx2
-rw-r--r--dbaccess/source/ui/uno/admindlg.cxx5
-rw-r--r--dbaccess/source/ui/uno/admindlg.hxx2
-rw-r--r--dbaccess/source/ui/uno/composerdialogs.cxx16
-rw-r--r--dbaccess/source/ui/uno/composerdialogs.hxx8
-rw-r--r--dbaccess/source/ui/uno/copytablewizard.cxx8
-rw-r--r--dbaccess/source/ui/uno/dbinteraction.cxx16
-rw-r--r--dbaccess/source/ui/uno/textconnectionsettings_uno.cxx6
-rw-r--r--dbaccess/source/ui/uno/unoDirectSql.cxx4
-rw-r--r--dbaccess/source/ui/uno/unoDirectSql.hxx2
-rw-r--r--dbaccess/source/ui/uno/unosqlmessage.cxx6
-rw-r--r--desktop/source/app/app.cxx10
-rw-r--r--desktop/source/app/cmdlinehelp.hxx8
-rw-r--r--desktop/source/app/lockfile2.cxx12
-rw-r--r--desktop/source/deployment/gui/dp_gui_dependencydialog.cxx10
-rw-r--r--desktop/source/deployment/gui/dp_gui_dependencydialog.hxx4
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.cxx111
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.hxx44
-rw-r--r--desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx28
-rw-r--r--desktop/source/deployment/gui/dp_gui_extlistbox.cxx24
-rw-r--r--desktop/source/deployment/gui/dp_gui_extlistbox.hxx7
-rw-r--r--desktop/source/deployment/gui/dp_gui_service.cxx5
-rw-r--r--desktop/source/deployment/gui/dp_gui_theextmgr.cxx23
-rw-r--r--desktop/source/deployment/gui/dp_gui_theextmgr.hxx6
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedialog.cxx27
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedialog.hxx33
-rw-r--r--desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx17
-rw-r--r--desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx15
-rw-r--r--desktop/source/deployment/gui/license_dialog.cxx41
-rw-r--r--desktop/source/lib/init.cxx22
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_misc.cxx8
-rw-r--r--desktop/source/splash/splash.cxx141
-rw-r--r--drawinglayer/source/primitive2d/controlprimitive2d.cxx8
-rw-r--r--drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx48
-rw-r--r--drawinglayer/source/primitive2d/textlayoutdevice.cxx6
-rw-r--r--drawinglayer/source/processor2d/vclhelperbufferdevice.cxx10
-rw-r--r--drawinglayer/source/processor2d/vclhelperbufferdevice.hxx6
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx40
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.hxx3
-rw-r--r--drawinglayer/source/tools/converters.cxx24
-rw-r--r--editeng/source/editeng/editeng.cxx4
-rw-r--r--editeng/source/editeng/impedit.cxx2
-rw-r--r--editeng/source/editeng/impedit.hxx19
-rw-r--r--editeng/source/editeng/impedit2.cxx6
-rw-r--r--editeng/source/editeng/impedit3.cxx2
-rw-r--r--editeng/source/editeng/textconv.hxx3
-rw-r--r--editeng/source/items/svxfont.cxx2
-rw-r--r--editeng/source/misc/hangulhanja.cxx2
-rw-r--r--editeng/source/misc/splwrap.cxx8
-rw-r--r--extensions/source/abpilot/abpfinalpage.cxx12
-rw-r--r--extensions/source/abpilot/abpfinalpage.hxx14
-rw-r--r--extensions/source/abpilot/abspilot.cxx17
-rw-r--r--extensions/source/abpilot/abspilot.hxx4
-rw-r--r--extensions/source/abpilot/admininvokationimpl.hxx3
-rw-r--r--extensions/source/abpilot/admininvokationpage.cxx11
-rw-r--r--extensions/source/abpilot/admininvokationpage.hxx7
-rw-r--r--extensions/source/abpilot/fieldmappingpage.cxx12
-rw-r--r--extensions/source/abpilot/fieldmappingpage.hxx8
-rw-r--r--extensions/source/abpilot/tableselectionpage.cxx10
-rw-r--r--extensions/source/abpilot/tableselectionpage.hxx6
-rw-r--r--extensions/source/abpilot/typeselectionpage.cxx21
-rw-r--r--extensions/source/abpilot/typeselectionpage.hxx26
-rw-r--r--extensions/source/abpilot/unodialogabp.cxx6
-rw-r--r--extensions/source/abpilot/unodialogabp.hxx2
-rw-r--r--extensions/source/bibliography/bibbeam.cxx32
-rw-r--r--extensions/source/bibliography/bibbeam.hxx5
-rw-r--r--extensions/source/bibliography/bibcont.cxx44
-rw-r--r--extensions/source/bibliography/bibcont.hxx10
-rw-r--r--extensions/source/bibliography/bibload.cxx2
-rw-r--r--extensions/source/bibliography/bibmod.cxx1
-rw-r--r--extensions/source/bibliography/bibshortcuthandler.hxx4
-rw-r--r--extensions/source/bibliography/bibview.cxx45
-rw-r--r--extensions/source/bibliography/bibview.hxx37
-rw-r--r--extensions/source/bibliography/datman.cxx124
-rw-r--r--extensions/source/bibliography/datman.hxx5
-rw-r--r--extensions/source/bibliography/framectr.cxx1
-rw-r--r--extensions/source/bibliography/general.cxx68
-rw-r--r--extensions/source/bibliography/general.hxx99
-rw-r--r--extensions/source/bibliography/toolbar.cxx79
-rw-r--r--extensions/source/bibliography/toolbar.hxx17
-rw-r--r--extensions/source/dbpilots/commonpagesdbp.cxx39
-rw-r--r--extensions/source/dbpilots/commonpagesdbp.hxx28
-rw-r--r--extensions/source/dbpilots/controlwizard.cxx12
-rw-r--r--extensions/source/dbpilots/controlwizard.hxx13
-rw-r--r--extensions/source/dbpilots/gridwizard.cxx24
-rw-r--r--extensions/source/dbpilots/gridwizard.hxx16
-rw-r--r--extensions/source/dbpilots/groupboxwiz.cxx62
-rw-r--r--extensions/source/dbpilots/groupboxwiz.hxx30
-rw-r--r--extensions/source/dbpilots/listcombowizard.cxx47
-rw-r--r--extensions/source/dbpilots/listcombowizard.hxx20
-rw-r--r--extensions/source/dbpilots/unoautopilot.hxx2
-rw-r--r--extensions/source/dbpilots/unoautopilot.inl4
-rw-r--r--extensions/source/plugin/base/plctrl.cxx2
-rw-r--r--extensions/source/plugin/inc/plugin/plctrl.hxx13
-rw-r--r--extensions/source/propctrlr/MasterDetailLinkDialog.cxx4
-rw-r--r--extensions/source/propctrlr/MasterDetailLinkDialog.hxx2
-rw-r--r--extensions/source/propctrlr/browserline.cxx37
-rw-r--r--extensions/source/propctrlr/browserline.hxx12
-rw-r--r--extensions/source/propctrlr/browserlistbox.cxx123
-rw-r--r--extensions/source/propctrlr/browserlistbox.hxx8
-rw-r--r--extensions/source/propctrlr/browserpage.cxx22
-rw-r--r--extensions/source/propctrlr/browserpage.hxx7
-rw-r--r--extensions/source/propctrlr/browserview.cxx13
-rw-r--r--extensions/source/propctrlr/browserview.hxx3
-rw-r--r--extensions/source/propctrlr/commoncontrol.cxx15
-rw-r--r--extensions/source/propctrlr/commoncontrol.hxx2
-rw-r--r--extensions/source/propctrlr/controlfontdialog.cxx7
-rw-r--r--extensions/source/propctrlr/controlfontdialog.hxx2
-rw-r--r--extensions/source/propctrlr/formcomponenthandler.cxx29
-rw-r--r--extensions/source/propctrlr/formlinkdialog.cxx41
-rw-r--r--extensions/source/propctrlr/formlinkdialog.hxx19
-rw-r--r--extensions/source/propctrlr/inspectorhelpwindow.cxx47
-rw-r--r--extensions/source/propctrlr/inspectorhelpwindow.hxx6
-rw-r--r--extensions/source/propctrlr/listselectiondlg.cxx11
-rw-r--r--extensions/source/propctrlr/listselectiondlg.hxx4
-rw-r--r--extensions/source/propctrlr/newdatatype.cxx11
-rw-r--r--extensions/source/propctrlr/newdatatype.hxx6
-rw-r--r--extensions/source/propctrlr/pcrunodialogs.cxx4
-rw-r--r--extensions/source/propctrlr/pcrunodialogs.hxx2
-rw-r--r--extensions/source/propctrlr/propcontroller.cxx5
-rw-r--r--extensions/source/propctrlr/propcontroller.hxx4
-rw-r--r--extensions/source/propctrlr/propertyeditor.cxx131
-rw-r--r--extensions/source/propctrlr/propertyeditor.hxx9
-rw-r--r--extensions/source/propctrlr/selectlabeldialog.cxx10
-rw-r--r--extensions/source/propctrlr/selectlabeldialog.hxx7
-rw-r--r--extensions/source/propctrlr/standardcontrol.cxx56
-rw-r--r--extensions/source/propctrlr/standardcontrol.hxx7
-rw-r--r--extensions/source/propctrlr/taborder.cxx12
-rw-r--r--extensions/source/propctrlr/taborder.hxx11
-rw-r--r--extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx10
-rw-r--r--extensions/source/scanner/grid.cxx21
-rw-r--r--extensions/source/scanner/grid.hxx11
-rw-r--r--extensions/source/scanner/sanedlg.cxx67
-rw-r--r--extensions/source/scanner/sanedlg.hxx49
-rw-r--r--extensions/source/scanner/scanunx.cxx6
-rw-r--r--extensions/workben/testframecontrol.cxx2
-rw-r--r--filter/source/flash/impswfdialog.cxx13
-rw-r--r--filter/source/flash/impswfdialog.hxx17
-rw-r--r--filter/source/flash/swfdialog.cxx9
-rw-r--r--filter/source/flash/swfdialog.hxx2
-rw-r--r--filter/source/flash/swfwriter.cxx3
-rw-r--r--filter/source/flash/swfwriter.hxx3
-rw-r--r--filter/source/graphic/GraphicExportDialog.cxx6
-rw-r--r--filter/source/graphicfilter/eos2met/eos2met.cxx39
-rw-r--r--filter/source/graphicfilter/epict/epict.cxx41
-rw-r--r--filter/source/graphicfilter/eps/eps.cxx42
-rw-r--r--filter/source/graphicfilter/icgm/cgm.cxx2
-rw-r--r--filter/source/graphicfilter/icgm/cgm.hxx3
-rw-r--r--filter/source/graphicfilter/idxf/dxf2mtf.cxx2
-rw-r--r--filter/source/graphicfilter/idxf/dxf2mtf.hxx2
-rw-r--r--filter/source/graphicfilter/ieps/ieps.cxx36
-rw-r--r--filter/source/graphicfilter/ios2met/ios2met.cxx6
-rw-r--r--filter/source/graphicfilter/ipict/ipict.cxx6
-rw-r--r--filter/source/msfilter/escherex.cxx18
-rw-r--r--filter/source/msfilter/msdffimp.cxx6
-rw-r--r--filter/source/pdf/impdialog.cxx194
-rw-r--r--filter/source/pdf/impdialog.hxx206
-rw-r--r--filter/source/pdf/pdfdialog.cxx14
-rw-r--r--filter/source/pdf/pdfdialog.hxx2
-rw-r--r--filter/source/pdf/pdffilter.cxx4
-rw-r--r--filter/source/pdf/pdfinteract.cxx4
-rw-r--r--filter/source/svg/impsvgdialog.cxx91
-rw-r--r--filter/source/svg/impsvgdialog.hxx19
-rw-r--r--filter/source/svg/svgdialog.cxx11
-rw-r--r--filter/source/svg/svgdialog.hxx2
-rw-r--r--filter/source/svg/svgfontexport.cxx24
-rw-r--r--filter/source/svg/svgwriter.cxx2
-rw-r--r--filter/source/svg/svgwriter.hxx4
-rw-r--r--filter/source/xsltdialog/xmlfilterdialogcomponent.cxx12
-rw-r--r--filter/source/xsltdialog/xmlfiltersettingsdialog.cxx71
-rw-r--r--filter/source/xsltdialog/xmlfiltersettingsdialog.hxx31
-rw-r--r--filter/source/xsltdialog/xmlfiltertabdialog.cxx20
-rw-r--r--filter/source/xsltdialog/xmlfiltertabdialog.hxx9
-rw-r--r--filter/source/xsltdialog/xmlfiltertabpagebasic.cxx12
-rw-r--r--filter/source/xsltdialog/xmlfiltertabpagebasic.hxx11
-rw-r--r--filter/source/xsltdialog/xmlfiltertabpagexslt.cxx14
-rw-r--r--filter/source/xsltdialog/xmlfiltertabpagexslt.hxx17
-rw-r--r--filter/source/xsltdialog/xmlfiltertestdialog.cxx22
-rw-r--r--filter/source/xsltdialog/xmlfiltertestdialog.hxx31
-rw-r--r--forms/source/richtext/richtextcontrol.cxx14
-rw-r--r--forms/source/richtext/richtextimplcontrol.cxx27
-rw-r--r--forms/source/richtext/richtextimplcontrol.hxx14
-rw-r--r--forms/source/richtext/richtextvclcontrol.cxx6
-rw-r--r--forms/source/richtext/richtextvclcontrol.hxx1
-rw-r--r--forms/source/runtime/formoperations.cxx4
-rw-r--r--forms/source/solar/component/navbarcontrol.cxx10
-rw-r--r--forms/source/solar/control/navtoolbar.cxx31
-rw-r--r--forms/source/solar/inc/navtoolbar.hxx6
-rw-r--r--formula/source/ui/dlg/ControlHelper.hxx19
-rw-r--r--formula/source/ui/dlg/formula.cxx72
-rw-r--r--formula/source/ui/dlg/funcpage.cxx12
-rw-r--r--formula/source/ui/dlg/funcpage.hxx6
-rw-r--r--formula/source/ui/dlg/funcutl.cxx69
-rw-r--r--formula/source/ui/dlg/parawin.cxx26
-rw-r--r--formula/source/ui/dlg/parawin.hxx51
-rw-r--r--formula/source/ui/dlg/structpg.cxx11
-rw-r--r--formula/source/ui/dlg/structpg.hxx4
-rw-r--r--fpicker/source/office/OfficeControlAccess.hxx2
-rw-r--r--fpicker/source/office/OfficeFilePicker.cxx4
-rw-r--r--fpicker/source/office/OfficeFilePicker.hxx2
-rw-r--r--fpicker/source/office/OfficeFolderPicker.cxx4
-rw-r--r--fpicker/source/office/OfficeFolderPicker.hxx2
-rw-r--r--fpicker/source/office/PlacesListBox.cxx39
-rw-r--r--fpicker/source/office/PlacesListBox.hxx14
-rw-r--r--fpicker/source/office/QueryFolderName.hxx8
-rw-r--r--fpicker/source/office/asyncfilepicker.hxx5
-rw-r--r--fpicker/source/office/commonpicker.cxx12
-rw-r--r--fpicker/source/office/commonpicker.hxx5
-rw-r--r--fpicker/source/office/iodlg.cxx87
-rw-r--r--fpicker/source/office/iodlg.hxx23
-rw-r--r--fpicker/source/office/iodlgimp.cxx11
-rw-r--r--fpicker/source/office/iodlgimp.hxx51
-rw-r--r--fpicker/test/svdem.cxx3
-rw-r--r--framework/inc/classes/fwktabwindow.hxx13
-rw-r--r--framework/inc/dispatch/closedispatcher.hxx3
-rw-r--r--framework/inc/helper/vclstatusindicator.hxx2
-rw-r--r--framework/inc/uielement/buttontoolbarcontroller.hxx7
-rw-r--r--framework/inc/uielement/comboboxtoolbarcontroller.hxx2
-rw-r--r--framework/inc/uielement/complextoolbarcontroller.hxx5
-rw-r--r--framework/inc/uielement/dropdownboxtoolbarcontroller.hxx3
-rw-r--r--framework/inc/uielement/edittoolbarcontroller.hxx2
-rw-r--r--framework/inc/uielement/generictoolbarcontroller.hxx11
-rw-r--r--framework/inc/uielement/spinfieldtoolbarcontroller.hxx3
-rw-r--r--framework/inc/uielement/statusbar.hxx1
-rw-r--r--framework/inc/uielement/statusbaritem.hxx3
-rw-r--r--framework/inc/uielement/statusbarmanager.hxx11
-rw-r--r--framework/inc/uielement/toolbarmanager.hxx2
-rw-r--r--framework/inc/uielement/toolbarmerger.hxx2
-rw-r--r--framework/source/classes/fwktabwindow.cxx51
-rw-r--r--framework/source/helper/vclstatusindicator.cxx5
-rw-r--r--framework/source/layoutmanager/layoutmanager.cxx2
-rw-r--r--framework/source/layoutmanager/toolbarlayoutmanager.cxx14
-rw-r--r--framework/source/services/autorecovery.cxx8
-rw-r--r--framework/source/services/tabwindowservice.cxx8
-rw-r--r--framework/source/uielement/addonstoolbarwrapper.cxx2
-rw-r--r--framework/source/uielement/buttontoolbarcontroller.cxx2
-rw-r--r--framework/source/uielement/comboboxtoolbarcontroller.cxx13
-rw-r--r--framework/source/uielement/complextoolbarcontroller.cxx2
-rw-r--r--framework/source/uielement/dropdownboxtoolbarcontroller.cxx13
-rw-r--r--framework/source/uielement/edittoolbarcontroller.cxx13
-rw-r--r--framework/source/uielement/fontsizemenucontroller.cxx4
-rw-r--r--framework/source/uielement/generictoolbarcontroller.cxx2
-rw-r--r--framework/source/uielement/popuptoolbarcontroller.cxx6
-rw-r--r--framework/source/uielement/spinfieldtoolbarcontroller.cxx13
-rw-r--r--framework/source/uielement/statusbar.cxx4
-rw-r--r--framework/source/uielement/statusbarmanager.cxx51
-rw-r--r--framework/source/uielement/statusbarwrapper.cxx2
-rw-r--r--framework/source/uielement/toolbarmanager.cxx8
-rw-r--r--framework/source/uielement/toolbarwrapper.cxx2
-rw-r--r--include/avmedia/mediaplayer.hxx1
-rw-r--r--include/avmedia/mediatoolbox.hxx2
-rw-r--r--include/avmedia/mediawindow.hxx3
-rw-r--r--include/dbaccess/ToolBoxHelper.hxx3
-rw-r--r--include/dbaccess/dataview.hxx7
-rw-r--r--include/dbaccess/genericcontroller.hxx7
-rw-r--r--include/drawinglayer/processor2d/canvasprocessor.hxx2
-rw-r--r--include/editeng/outliner.hxx3
-rw-r--r--include/editeng/splwrap.hxx3
-rw-r--r--include/formula/funcutl.hxx7
-rw-r--r--include/rtl/ref.hxx8
-rw-r--r--include/sfx2/basedlgs.hxx20
-rw-r--r--include/sfx2/checkin.hxx8
-rw-r--r--include/sfx2/childwin.hxx8
-rw-r--r--include/sfx2/ctrlitem.hxx1
-rw-r--r--include/sfx2/dinfdlg.hxx159
-rw-r--r--include/sfx2/dockwin.hxx1
-rw-r--r--include/sfx2/fcontnr.hxx5
-rw-r--r--include/sfx2/frame.hxx3
-rw-r--r--include/sfx2/infobar.hxx19
-rw-r--r--include/sfx2/ipclient.hxx4
-rw-r--r--include/sfx2/mgetempl.hxx31
-rw-r--r--include/sfx2/module.hxx2
-rw-r--r--include/sfx2/new.hxx1
-rw-r--r--include/sfx2/newstyle.hxx7
-rw-r--r--include/sfx2/objsh.hxx3
-rw-r--r--include/sfx2/passwd.hxx30
-rw-r--r--include/sfx2/printer.hxx5
-rw-r--r--include/sfx2/printopt.hxx46
-rw-r--r--include/sfx2/prnmon.hxx3
-rw-r--r--include/sfx2/recentdocsview.hxx1
-rw-r--r--include/sfx2/securitypage.hxx6
-rw-r--r--include/sfx2/sidebar/ControlFactory.hxx5
-rw-r--r--include/sfx2/sidebar/ControllerItem.hxx3
-rw-r--r--include/sfx2/sidebar/SidebarPanelBase.hxx3
-rw-r--r--include/sfx2/sidebar/SidebarToolBox.hxx1
-rw-r--r--include/sfx2/stbitem.hxx6
-rw-r--r--include/sfx2/styledlg.hxx1
-rw-r--r--include/sfx2/tabdlg.hxx24
-rw-r--r--include/sfx2/taskpane.hxx6
-rw-r--r--include/sfx2/tbxctrl.hxx11
-rw-r--r--include/sfx2/templateabstractview.hxx7
-rw-r--r--include/sfx2/templatedefaultview.hxx1
-rw-r--r--include/sfx2/templatedlg.hxx21
-rw-r--r--include/sfx2/templateinfodlg.hxx11
-rw-r--r--include/sfx2/templatelocalview.hxx1
-rw-r--r--include/sfx2/templateremoteview.hxx2
-rw-r--r--include/sfx2/templdlg.hxx3
-rw-r--r--include/sfx2/thumbnailview.hxx3
-rw-r--r--include/sfx2/thumbnailviewitem.hxx2
-rw-r--r--include/sfx2/titledockwin.hxx14
-rw-r--r--include/sfx2/viewsh.hxx9
-rw-r--r--include/svtools/DocumentInfoPreview.hxx5
-rw-r--r--include/svtools/GraphicExportOptionsDialog.hxx8
-rw-r--r--include/svtools/PlaceEditDialog.hxx16
-rw-r--r--include/svtools/ServerDetailsControls.hxx26
-rw-r--r--include/svtools/accessibleruler.hxx3
-rw-r--r--include/svtools/addresstemplate.hxx9
-rw-r--r--include/svtools/brwbox.hxx24
-rw-r--r--include/svtools/brwhead.hxx5
-rw-r--r--include/svtools/calendar.hxx16
-rw-r--r--include/svtools/colrdlg.hxx8
-rw-r--r--include/svtools/ctrlbox.hxx7
-rw-r--r--include/svtools/ctrltool.hxx4
-rw-r--r--include/svtools/editbrowsebox.hxx16
-rw-r--r--include/svtools/editsyntaxhighlighter.hxx1
-rw-r--r--include/svtools/filectrl.hxx21
-rw-r--r--include/svtools/fileview.hxx5
-rw-r--r--include/svtools/fmtfield.hxx2
-rw-r--r--include/svtools/generictoolboxcontroller.hxx4
-rw-r--r--include/svtools/genericunodialog.hxx5
-rw-r--r--include/svtools/headbar.hxx1
-rw-r--r--include/svtools/hyperlabel.hxx3
-rw-r--r--include/svtools/inettbc.hxx1
-rw-r--r--include/svtools/ivctrl.hxx1
-rw-r--r--include/svtools/popupwindowcontroller.hxx3
-rw-r--r--include/svtools/prnsetup.hxx23
-rw-r--r--include/svtools/roadmapwizard.hxx7
-rw-r--r--include/svtools/ruler.hxx3
-rw-r--r--include/svtools/scrwin.hxx9
-rw-r--r--include/svtools/simptabl.hxx11
-rw-r--r--include/svtools/svmedit.hxx1
-rw-r--r--include/svtools/svmedit2.hxx3
-rw-r--r--include/svtools/svtabbx.hxx4
-rw-r--r--include/svtools/tabbar.hxx3
-rw-r--r--include/svtools/toolbarmenu.hxx3
-rw-r--r--include/svtools/toolpanel/drawerlayouter.hxx6
-rw-r--r--include/svtools/toolpanel/paneltabbar.hxx1
-rw-r--r--include/svtools/toolpanel/toolpaneldeck.hxx1
-rw-r--r--include/svtools/treelistbox.hxx11
-rw-r--r--include/svtools/valueset.hxx7
-rw-r--r--include/svtools/wizardmachine.hxx17
-rw-r--r--include/svtools/wizdlg.hxx11
-rw-r--r--include/svx/AccessibleShapeTreeInfo.hxx3
-rw-r--r--include/svx/ParaLineSpacingPopup.hxx2
-rw-r--r--include/svx/bmpmask.hxx51
-rw-r--r--include/svx/charmap.hxx7
-rw-r--r--include/svx/checklbx.hxx1
-rw-r--r--include/svx/clipboardctl.hxx2
-rw-r--r--include/svx/colrctrl.hxx4
-rw-r--r--include/svx/compressgraphicdialog.hxx34
-rw-r--r--include/svx/connctrl.hxx1
-rw-r--r--include/svx/contdlg.hxx7
-rw-r--r--include/svx/ctredlin.hxx59
-rw-r--r--include/svx/dialcontrol.hxx10
-rw-r--r--include/svx/dlgctl3d.hxx17
-rw-r--r--include/svx/dlgctrl.hxx13
-rw-r--r--include/svx/fillctrl.hxx13
-rw-r--r--include/svx/float3d.hxx175
-rw-r--r--include/svx/fmgridcl.hxx3
-rw-r--r--include/svx/fmgridif.hxx2
-rw-r--r--include/svx/fmshell.hxx2
-rw-r--r--include/svx/fntctrl.hxx1
-rw-r--r--include/svx/fontwork.hxx23
-rw-r--r--include/svx/fontworkgallery.hxx11
-rw-r--r--include/svx/frmdirlbox.hxx1
-rw-r--r--include/svx/frmsel.hxx2
-rw-r--r--include/svx/galctrl.hxx2
-rw-r--r--include/svx/grafctrl.hxx6
-rw-r--r--include/svx/graphctl.hxx5
-rw-r--r--include/svx/gridctrl.hxx31
-rw-r--r--include/svx/hdft.hxx47
-rw-r--r--include/svx/imapdlg.hxx19
-rw-r--r--include/svx/itemwin.hxx4
-rw-r--r--include/svx/langbox.hxx2
-rw-r--r--include/svx/layctrl.hxx4
-rw-r--r--include/svx/lboxctrl.hxx6
-rw-r--r--include/svx/linectrl.hxx11
-rw-r--r--include/svx/linkwarn.hxx3
-rw-r--r--include/svx/measctrl.hxx1
-rw-r--r--include/svx/numvset.hxx28
-rw-r--r--include/svx/optgrid.hxx42
-rw-r--r--include/svx/pagectrl.hxx1
-rw-r--r--include/svx/passwd.hxx15
-rw-r--r--include/svx/prtqry.hxx1
-rw-r--r--include/svx/rubydialog.hxx49
-rw-r--r--include/svx/ruler.hxx3
-rw-r--r--include/svx/sdrpaintwindow.hxx6
-rw-r--r--include/svx/sidebar/PanelLayout.hxx2
-rw-r--r--include/svx/sidebar/Popup.hxx14
-rw-r--r--include/svx/sidebar/PopupControl.hxx1
-rw-r--r--include/svx/sidebar/SidebarDialControl.hxx1
-rw-r--r--include/svx/sidebar/ValueSetWithTextControl.hxx2
-rw-r--r--include/svx/srchdlg.hxx101
-rw-r--r--include/svx/stddlg.hxx1
-rw-r--r--include/svx/subtoolboxcontrol.hxx2
-rw-r--r--include/svx/svdedxv.hxx4
-rw-r--r--include/svx/svdmodel.hxx4
-rw-r--r--include/svx/svdobj.hxx3
-rw-r--r--include/svx/svdpntv.hxx8
-rw-r--r--include/svx/svxdlg.hxx4
-rw-r--r--include/svx/swframeexample.hxx1
-rw-r--r--include/svx/tbcontrl.hxx10
-rw-r--r--include/svx/tbxalign.hxx2
-rw-r--r--include/svx/tbxcolorupdate.hxx7
-rw-r--r--include/svx/tbxcustomshapes.hxx2
-rw-r--r--include/svx/txencbox.hxx1
-rw-r--r--include/toolkit/awt/scrollabledialog.hxx5
-rw-r--r--include/toolkit/awt/vclxaccessiblecomponent.hxx7
-rw-r--r--include/toolkit/awt/vclxdevice.hxx19
-rw-r--r--include/toolkit/awt/vclxgraphics.hxx3
-rw-r--r--include/toolkit/awt/vclxprinter.hxx4
-rw-r--r--include/toolkit/awt/vclxwindow.hxx8
-rw-r--r--include/toolkit/controls/accessiblecontrolcontext.hxx3
-rw-r--r--include/toolkit/helper/vclunohelper.hxx9
-rw-r--r--include/tools/errinf.hxx10
-rw-r--r--include/vcl/animate.hxx9
-rw-r--r--include/vcl/btndlg.hxx1
-rw-r--r--include/vcl/builder.hxx40
-rw-r--r--include/vcl/button.hxx21
-rw-r--r--include/vcl/cairo.hxx3
-rw-r--r--include/vcl/combobox.hxx24
-rw-r--r--include/vcl/controllayout.hxx7
-rw-r--r--include/vcl/ctrl.hxx1
-rw-r--r--include/vcl/cursor.hxx3
-rw-r--r--include/vcl/decoview.hxx3
-rw-r--r--include/vcl/dialog.hxx16
-rw-r--r--include/vcl/dockingarea.hxx1
-rw-r--r--include/vcl/dockwin.hxx15
-rw-r--r--include/vcl/edit.hxx6
-rw-r--r--include/vcl/event.hxx26
-rw-r--r--include/vcl/field.hxx14
-rw-r--r--include/vcl/fixed.hxx5
-rw-r--r--include/vcl/fixedhyper.hxx5
-rw-r--r--include/vcl/floatwin.hxx5
-rw-r--r--include/vcl/fltcall.hxx2
-rw-r--r--include/vcl/gdimtf.hxx3
-rw-r--r--include/vcl/introwin.hxx6
-rw-r--r--include/vcl/layout.hxx63
-rw-r--r--include/vcl/lazydelete.hxx11
-rw-r--r--include/vcl/longcurr.hxx2
-rw-r--r--include/vcl/lstbox.hxx9
-rw-r--r--include/vcl/menu.hxx2
-rw-r--r--include/vcl/menubtn.hxx1
-rw-r--r--include/vcl/morebtn.hxx3
-rw-r--r--include/vcl/msgbox.hxx19
-rw-r--r--include/vcl/oldprintadaptor.hxx2
-rw-r--r--include/vcl/opengl/OpenGLContext.hxx7
-rw-r--r--include/vcl/openglwin.hxx6
-rw-r--r--include/vcl/outdev.hxx38
-rw-r--r--include/vcl/popupmenuwindow.hxx1
-rw-r--r--include/vcl/prgsbar.hxx5
-rw-r--r--include/vcl/print.hxx15
-rw-r--r--include/vcl/scrbar.hxx3
-rw-r--r--include/vcl/seleng.hxx2
-rw-r--r--include/vcl/spin.hxx1
-rw-r--r--include/vcl/spinfld.hxx6
-rw-r--r--include/vcl/split.hxx3
-rw-r--r--include/vcl/splitwin.hxx3
-rw-r--r--include/vcl/status.hxx9
-rw-r--r--include/vcl/syschild.hxx1
-rw-r--r--include/vcl/syswin.hxx6
-rw-r--r--include/vcl/tabctrl.hxx7
-rw-r--r--include/vcl/tabdlg.hxx7
-rw-r--r--include/vcl/tabpage.hxx2
-rw-r--r--include/vcl/taskpanelist.hxx2
-rw-r--r--include/vcl/texteng.hxx3
-rw-r--r--include/vcl/throbber.hxx1
-rw-r--r--include/vcl/toolbox.hxx7
-rw-r--r--include/vcl/vclevent.hxx9
-rw-r--r--include/vcl/vclmedit.hxx7
-rw-r--r--include/vcl/vclptr.hxx357
-rw-r--r--include/vcl/virdev.hxx5
-rw-r--r--include/vcl/waitobj.hxx2
-rw-r--r--include/vcl/window.hxx46
-rw-r--r--include/vcl/wrkwin.hxx1
-rw-r--r--lotuswordpro/source/filter/lwppagelayout.cxx8
-rw-r--r--mysqlc/source/mysqlc_connection.cxx2
-rw-r--r--mysqlc/source/mysqlc_resultset.cxx2
-rw-r--r--mysqlc/source/mysqlc_statement.cxx2
-rw-r--r--odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.cxx2
-rw-r--r--odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.cxx2
-rw-r--r--odk/examples/DevelopersGuide/Database/DriverSkeleton/SStatement.cxx2
-rw-r--r--reportdesign/source/ui/dlg/AddField.cxx89
-rw-r--r--reportdesign/source/ui/dlg/CondFormat.cxx15
-rw-r--r--reportdesign/source/ui/dlg/Condition.cxx75
-rw-r--r--reportdesign/source/ui/dlg/Condition.hxx33
-rw-r--r--reportdesign/source/ui/dlg/DateTime.cxx13
-rw-r--r--reportdesign/source/ui/dlg/Formula.cxx13
-rw-r--r--reportdesign/source/ui/dlg/GroupsSorting.cxx91
-rw-r--r--reportdesign/source/ui/dlg/Navigator.cxx13
-rw-r--r--reportdesign/source/ui/dlg/PageNumber.cxx12
-rw-r--r--reportdesign/source/ui/inc/AddField.hxx17
-rw-r--r--reportdesign/source/ui/inc/ColorChanger.hxx2
-rw-r--r--reportdesign/source/ui/inc/ColorListener.hxx1
-rw-r--r--reportdesign/source/ui/inc/CondFormat.hxx15
-rw-r--r--reportdesign/source/ui/inc/DateTime.hxx15
-rw-r--r--reportdesign/source/ui/inc/DesignView.hxx21
-rw-r--r--reportdesign/source/ui/inc/Formula.hxx7
-rw-r--r--reportdesign/source/ui/inc/GroupsSorting.hxx21
-rw-r--r--reportdesign/source/ui/inc/MarkedSection.hxx2
-rw-r--r--reportdesign/source/ui/inc/PageNumber.hxx13
-rw-r--r--reportdesign/source/ui/inc/ReportController.hxx4
-rw-r--r--reportdesign/source/ui/inc/ReportSection.hxx3
-rw-r--r--reportdesign/source/ui/inc/ReportWindow.hxx15
-rw-r--r--reportdesign/source/ui/inc/ScrollHelper.hxx27
-rw-r--r--reportdesign/source/ui/inc/SectionView.hxx4
-rw-r--r--reportdesign/source/ui/inc/SectionWindow.hxx17
-rw-r--r--reportdesign/source/ui/inc/StartMarker.hxx9
-rw-r--r--reportdesign/source/ui/inc/ViewsWindow.hxx22
-rw-r--r--reportdesign/source/ui/inc/dlgedfunc.hxx2
-rw-r--r--reportdesign/source/ui/inc/propbrw.hxx3
-rw-r--r--reportdesign/source/ui/misc/ColorListener.cxx6
-rw-r--r--reportdesign/source/ui/misc/UITools.cxx17
-rw-r--r--reportdesign/source/ui/misc/statusbarcontroller.cxx2
-rw-r--r--reportdesign/source/ui/misc/toolboxcontroller.cxx2
-rw-r--r--reportdesign/source/ui/report/DesignView.cxx155
-rw-r--r--reportdesign/source/ui/report/FixedTextColor.cxx2
-rw-r--r--reportdesign/source/ui/report/FormattedFieldBeautifier.cxx2
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx61
-rw-r--r--reportdesign/source/ui/report/ReportSection.cxx7
-rw-r--r--reportdesign/source/ui/report/ReportWindow.cxx147
-rw-r--r--reportdesign/source/ui/report/ScrollHelper.cxx134
-rw-r--r--reportdesign/source/ui/report/SectionWindow.cxx133
-rw-r--r--reportdesign/source/ui/report/StartMarker.cxx94
-rw-r--r--reportdesign/source/ui/report/ViewsWindow.cxx37
-rw-r--r--reportdesign/source/ui/report/propbrw.cxx9
-rw-r--r--sc/inc/AccessibleFilterMenu.hxx3
-rw-r--r--sc/inc/AccessibleFilterMenuItem.hxx3
-rw-r--r--sc/inc/dociter.hxx3
-rw-r--r--sc/inc/document.hxx6
-rw-r--r--sc/inc/editutil.hxx9
-rw-r--r--sc/inc/rowheightcontext.hxx6
-rw-r--r--sc/inc/scmod.hxx6
-rw-r--r--sc/inc/scopetools.hxx3
-rw-r--r--sc/inc/waitoff.hxx2
-rw-r--r--sc/source/core/data/documen2.cxx4
-rw-r--r--sc/source/core/data/documen8.cxx15
-rw-r--r--sc/source/core/data/dpobject.cxx6
-rw-r--r--sc/source/core/data/global.cxx10
-rw-r--r--sc/source/core/data/validat.cxx12
-rw-r--r--sc/source/core/tool/editutil.cxx8
-rw-r--r--sc/source/filter/inc/htmlexp.hxx2
-rw-r--r--sc/source/filter/oox/workbookhelper.cxx8
-rw-r--r--sc/source/filter/rtf/eeimpars.cxx4
-rw-r--r--sc/source/ui/Accessibility/AccessibleText.cxx24
-rw-r--r--sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx13
-rw-r--r--sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx10
-rw-r--r--sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx10
-rw-r--r--sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx28
-rw-r--r--sc/source/ui/StatisticsDialogs/SamplingDialog.cxx25
-rw-r--r--sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx19
-rw-r--r--sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx24
-rw-r--r--sc/source/ui/app/inputhdl.cxx5
-rw-r--r--sc/source/ui/app/inputwin.cxx175
-rw-r--r--sc/source/ui/app/scmod.cxx20
-rw-r--r--sc/source/ui/app/transobj.cxx20
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.cxx114
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.hxx10
-rw-r--r--sc/source/ui/attrdlg/scuiexp.cxx30
-rw-r--r--sc/source/ui/attrdlg/tabpages.cxx18
-rw-r--r--sc/source/ui/cctrl/checklistmenu.cxx250
-rw-r--r--sc/source/ui/cctrl/tbinsert.cxx2
-rw-r--r--sc/source/ui/cctrl/tbzoomsliderctrl.cxx17
-rw-r--r--sc/source/ui/condformat/colorformat.cxx28
-rw-r--r--sc/source/ui/condformat/condformatdlg.cxx123
-rw-r--r--sc/source/ui/condformat/condformatdlgentry.cxx835
-rw-r--r--sc/source/ui/condformat/condformatmgr.cxx21
-rw-r--r--sc/source/ui/dbgui/PivotLayoutDialog.cxx40
-rw-r--r--sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx12
-rw-r--r--sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx2
-rw-r--r--sc/source/ui/dbgui/consdlg.cxx23
-rw-r--r--sc/source/ui/dbgui/csvcontrol.cxx6
-rw-r--r--sc/source/ui/dbgui/csvgrid.cxx142
-rw-r--r--sc/source/ui/dbgui/csvruler.cxx60
-rw-r--r--sc/source/ui/dbgui/csvtablebox.cxx155
-rw-r--r--sc/source/ui/dbgui/dapidata.cxx13
-rw-r--r--sc/source/ui/dbgui/dapitype.cxx23
-rw-r--r--sc/source/ui/dbgui/dbnamdlg.cxx25
-rw-r--r--sc/source/ui/dbgui/dpgroupdlg.cxx39
-rw-r--r--sc/source/ui/dbgui/filtdlg.cxx38
-rw-r--r--sc/source/ui/dbgui/pfiltdlg.cxx24
-rw-r--r--sc/source/ui/dbgui/pvfundlg.cxx80
-rw-r--r--sc/source/ui/dbgui/scendlg.cxx18
-rw-r--r--sc/source/ui/dbgui/scuiasciiopt.cxx28
-rw-r--r--sc/source/ui/dbgui/scuiimoptdlg.cxx18
-rw-r--r--sc/source/ui/dbgui/sfiltdlg.cxx25
-rw-r--r--sc/source/ui/dbgui/sortdlg.cxx13
-rw-r--r--sc/source/ui/dbgui/subtdlg.cxx11
-rw-r--r--sc/source/ui/dbgui/textimportoptions.cxx12
-rw-r--r--sc/source/ui/dbgui/tpsort.cxx49
-rw-r--r--sc/source/ui/dbgui/tpsubt.cxx42
-rw-r--r--sc/source/ui/dbgui/validate.cxx75
-rw-r--r--sc/source/ui/dialogs/searchresults.cxx12
-rw-r--r--sc/source/ui/docshell/arealink.cxx6
-rw-r--r--sc/source/ui/docshell/dbdocfun.cxx20
-rw-r--r--sc/source/ui/docshell/dbdocimp.cxx4
-rw-r--r--sc/source/ui/docshell/docfunc.cxx9
-rw-r--r--sc/source/ui/docshell/docsh.cxx36
-rw-r--r--sc/source/ui/docshell/docsh3.cxx22
-rw-r--r--sc/source/ui/docshell/docsh4.cxx60
-rw-r--r--sc/source/ui/docshell/docsh5.cxx16
-rw-r--r--sc/source/ui/docshell/docsh6.cxx4
-rw-r--r--sc/source/ui/docshell/documentlinkmgr.cxx4
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx4
-rw-r--r--sc/source/ui/docshell/impex.cxx8
-rw-r--r--sc/source/ui/docshell/sizedev.cxx2
-rw-r--r--sc/source/ui/docshell/tablink.cxx6
-rw-r--r--sc/source/ui/docshell/tpstat.cxx14
-rw-r--r--sc/source/ui/drawfunc/fuins1.cxx4
-rw-r--r--sc/source/ui/drawfunc/fupoor.cxx3
-rw-r--r--sc/source/ui/drawfunc/graphsh.cxx6
-rw-r--r--sc/source/ui/formdlg/dwfunctr.cxx259
-rw-r--r--sc/source/ui/formdlg/formula.cxx6
-rw-r--r--sc/source/ui/inc/AccessibleCsvControl.hxx3
-rw-r--r--sc/source/ui/inc/AccessibleEditObject.hxx3
-rw-r--r--sc/source/ui/inc/AccessibleText.hxx4
-rw-r--r--sc/source/ui/inc/AnalysisOfVarianceDialog.hxx9
-rw-r--r--sc/source/ui/inc/ExponentialSmoothingDialog.hxx3
-rw-r--r--sc/source/ui/inc/MovingAverageDialog.hxx3
-rw-r--r--sc/source/ui/inc/PivotLayoutDialog.hxx55
-rw-r--r--sc/source/ui/inc/PivotLayoutTreeListBase.hxx3
-rw-r--r--sc/source/ui/inc/RandomNumberGeneratorDialog.hxx31
-rw-r--r--sc/source/ui/inc/SamplingDialog.hxx29
-rw-r--r--sc/source/ui/inc/StatisticsInputOutputDialog.hxx21
-rw-r--r--sc/source/ui/inc/StatisticsTwoVariableDialog.hxx27
-rw-r--r--sc/source/ui/inc/acredlin.hxx9
-rw-r--r--sc/source/ui/inc/anyrefdg.hxx18
-rw-r--r--sc/source/ui/inc/areasdlg.hxx26
-rw-r--r--sc/source/ui/inc/autofmt.hxx3
-rw-r--r--sc/source/ui/inc/cbutton.hxx3
-rw-r--r--sc/source/ui/inc/checklistmenu.hxx34
-rw-r--r--sc/source/ui/inc/colorformat.hxx30
-rw-r--r--sc/source/ui/inc/condformatdlg.hxx25
-rw-r--r--sc/source/ui/inc/condformatdlgentry.hxx103
-rw-r--r--sc/source/ui/inc/condformatmgr.hxx9
-rw-r--r--sc/source/ui/inc/conflictsdlg.hxx13
-rw-r--r--sc/source/ui/inc/consdlg.hxx35
-rw-r--r--sc/source/ui/inc/content.hxx3
-rw-r--r--sc/source/ui/inc/corodlg.hxx11
-rw-r--r--sc/source/ui/inc/crdlg.hxx10
-rw-r--r--sc/source/ui/inc/crnrdlg.hxx25
-rw-r--r--sc/source/ui/inc/csvcontrol.hxx1
-rw-r--r--sc/source/ui/inc/csvgrid.hxx5
-rw-r--r--sc/source/ui/inc/csvruler.hxx5
-rw-r--r--sc/source/ui/inc/csvtablebox.hxx15
-rw-r--r--sc/source/ui/inc/dapidata.hxx8
-rw-r--r--sc/source/ui/inc/dapitype.hxx23
-rw-r--r--sc/source/ui/inc/datafdlg.hxx25
-rw-r--r--sc/source/ui/inc/datastreamdlg.hxx36
-rw-r--r--sc/source/ui/inc/dbnamdlg.hxx37
-rw-r--r--sc/source/ui/inc/delcldlg.hxx10
-rw-r--r--sc/source/ui/inc/delcodlg.hxx19
-rw-r--r--sc/source/ui/inc/docsh.hxx2
-rw-r--r--sc/source/ui/inc/dpcontrol.hxx3
-rw-r--r--sc/source/ui/inc/dpgroupdlg.hxx55
-rw-r--r--sc/source/ui/inc/drawview.hxx2
-rw-r--r--sc/source/ui/inc/dwfunctr.hxx15
-rw-r--r--sc/source/ui/inc/filldlg.hxx41
-rw-r--r--sc/source/ui/inc/filtdlg.hxx122
-rw-r--r--sc/source/ui/inc/foptmgr.hxx24
-rw-r--r--sc/source/ui/inc/formula.hxx1
-rw-r--r--sc/source/ui/inc/fupoor.hxx4
-rw-r--r--sc/source/ui/inc/gridmerg.hxx2
-rw-r--r--sc/source/ui/inc/gridwin.hxx9
-rw-r--r--sc/source/ui/inc/groupdlg.hxx6
-rw-r--r--sc/source/ui/inc/highred.hxx15
-rw-r--r--sc/source/ui/inc/inputhdl.hxx9
-rw-r--r--sc/source/ui/inc/inputwin.hxx22
-rw-r--r--sc/source/ui/inc/inscldlg.hxx9
-rw-r--r--sc/source/ui/inc/inscodlg.hxx53
-rw-r--r--sc/source/ui/inc/instbdlg.hxx27
-rw-r--r--sc/source/ui/inc/lbseldlg.hxx4
-rw-r--r--sc/source/ui/inc/linkarea.hxx15
-rw-r--r--sc/source/ui/inc/mtrindlg.hxx6
-rw-r--r--sc/source/ui/inc/mvtabdlg.hxx15
-rw-r--r--sc/source/ui/inc/namecrea.hxx11
-rw-r--r--sc/source/ui/inc/namedefdlg.hxx25
-rw-r--r--sc/source/ui/inc/namedlg.hxx29
-rw-r--r--sc/source/ui/inc/namemgrtable.hxx1
-rw-r--r--sc/source/ui/inc/namepast.hxx9
-rw-r--r--sc/source/ui/inc/navipi.hxx26
-rw-r--r--sc/source/ui/inc/notemark.hxx8
-rw-r--r--sc/source/ui/inc/olinewin.hxx1
-rw-r--r--sc/source/ui/inc/opredlin.hxx12
-rw-r--r--sc/source/ui/inc/optsolver.hxx131
-rw-r--r--sc/source/ui/inc/output.hxx6
-rw-r--r--sc/source/ui/inc/pfiltdlg.hxx43
-rw-r--r--sc/source/ui/inc/preview.hxx1
-rw-r--r--sc/source/ui/inc/prevloc.hxx2
-rw-r--r--sc/source/ui/inc/prevwsh.hxx12
-rw-r--r--sc/source/ui/inc/printfun.hxx4
-rw-r--r--sc/source/ui/inc/protectiondlg.hxx15
-rw-r--r--sc/source/ui/inc/pvfundlg.hxx88
-rw-r--r--sc/source/ui/inc/reffact.hxx2
-rw-r--r--sc/source/ui/inc/retypepassdlg.hxx26
-rw-r--r--sc/source/ui/inc/scendlg.hxx19
-rw-r--r--sc/source/ui/inc/scuiasciiopt.hxx45
-rw-r--r--sc/source/ui/inc/scuiautofmt.hxx28
-rw-r--r--sc/source/ui/inc/scuiimoptdlg.hxx25
-rw-r--r--sc/source/ui/inc/scuitphfedit.hxx51
-rw-r--r--sc/source/ui/inc/searchresults.hxx3
-rw-r--r--sc/source/ui/inc/sharedocdlg.hxx7
-rw-r--r--sc/source/ui/inc/shtabdlg.hxx6
-rw-r--r--sc/source/ui/inc/simpref.hxx11
-rw-r--r--sc/source/ui/inc/sizedev.hxx12
-rw-r--r--sc/source/ui/inc/solveroptions.hxx19
-rw-r--r--sc/source/ui/inc/solvrdlg.hxx21
-rw-r--r--sc/source/ui/inc/sortdlg.hxx8
-rw-r--r--sc/source/ui/inc/sortkeydlg.hxx12
-rw-r--r--sc/source/ui/inc/strindlg.hxx7
-rw-r--r--sc/source/ui/inc/subtdlg.hxx4
-rw-r--r--sc/source/ui/inc/tabbgcolordlg.hxx11
-rw-r--r--sc/source/ui/inc/tabopdlg.hxx25
-rw-r--r--sc/source/ui/inc/tabpages.hxx13
-rw-r--r--sc/source/ui/inc/tabview.hxx38
-rw-r--r--sc/source/ui/inc/tabvwsh.hxx2
-rw-r--r--sc/source/ui/inc/tbinsert.hxx2
-rw-r--r--sc/source/ui/inc/tbzoomsliderctrl.hxx3
-rw-r--r--sc/source/ui/inc/textimportoptions.hxx12
-rw-r--r--sc/source/ui/inc/tpcalc.hxx35
-rw-r--r--sc/source/ui/inc/tpcompatibility.hxx8
-rw-r--r--sc/source/ui/inc/tpdefaults.hxx7
-rw-r--r--sc/source/ui/inc/tpformula.hxx26
-rw-r--r--sc/source/ui/inc/tphf.hxx17
-rw-r--r--sc/source/ui/inc/tphfedit.hxx1
-rw-r--r--sc/source/ui/inc/tpprint.hxx12
-rw-r--r--sc/source/ui/inc/tpsort.hxx39
-rw-r--r--sc/source/ui/inc/tpstat.hxx12
-rw-r--r--sc/source/ui/inc/tpsubt.hxx35
-rw-r--r--sc/source/ui/inc/tptable.hxx50
-rw-r--r--sc/source/ui/inc/tpusrlst.hxx27
-rw-r--r--sc/source/ui/inc/tpview.hxx93
-rw-r--r--sc/source/ui/inc/validate.hxx72
-rw-r--r--sc/source/ui/inc/viewfunc.hxx2
-rw-r--r--sc/source/ui/inc/xmlsourcedlg.hxx20
-rw-r--r--sc/source/ui/miscdlgs/acredlin.cxx13
-rw-r--r--sc/source/ui/miscdlgs/anyrefdg.cxx18
-rw-r--r--sc/source/ui/miscdlgs/autofmt.cxx38
-rw-r--r--sc/source/ui/miscdlgs/conflictsdlg.cxx14
-rw-r--r--sc/source/ui/miscdlgs/crdlg.cxx15
-rw-r--r--sc/source/ui/miscdlgs/crnrdlg.cxx20
-rw-r--r--sc/source/ui/miscdlgs/datafdlg.cxx56
-rw-r--r--sc/source/ui/miscdlgs/datastreamdlg.cxx27
-rw-r--r--sc/source/ui/miscdlgs/delcldlg.cxx15
-rw-r--r--sc/source/ui/miscdlgs/delcodlg.cxx23
-rw-r--r--sc/source/ui/miscdlgs/filldlg.cxx26
-rw-r--r--sc/source/ui/miscdlgs/groupdlg.cxx14
-rw-r--r--sc/source/ui/miscdlgs/highred.cxx16
-rw-r--r--sc/source/ui/miscdlgs/inscldlg.cxx18
-rw-r--r--sc/source/ui/miscdlgs/inscodlg.cxx28
-rw-r--r--sc/source/ui/miscdlgs/instbdlg.cxx19
-rw-r--r--sc/source/ui/miscdlgs/lbseldlg.cxx12
-rw-r--r--sc/source/ui/miscdlgs/linkarea.cxx13
-rw-r--r--sc/source/ui/miscdlgs/mtrindlg.cxx12
-rw-r--r--sc/source/ui/miscdlgs/mvtabdlg.cxx13
-rw-r--r--sc/source/ui/miscdlgs/namecrea.cxx14
-rw-r--r--sc/source/ui/miscdlgs/optsolver.cxx131
-rw-r--r--sc/source/ui/miscdlgs/protectiondlg.cxx13
-rw-r--r--sc/source/ui/miscdlgs/retypepassdlg.cxx49
-rw-r--r--sc/source/ui/miscdlgs/scuiautofmt.cxx43
-rw-r--r--sc/source/ui/miscdlgs/sharedocdlg.cxx12
-rw-r--r--sc/source/ui/miscdlgs/shtabdlg.cxx12
-rw-r--r--sc/source/ui/miscdlgs/simpref.cxx11
-rw-r--r--sc/source/ui/miscdlgs/solveroptions.cxx53
-rw-r--r--sc/source/ui/miscdlgs/solvrdlg.cxx18
-rw-r--r--sc/source/ui/miscdlgs/strindlg.cxx12
-rw-r--r--sc/source/ui/miscdlgs/tabbgcolordlg.cxx23
-rw-r--r--sc/source/ui/miscdlgs/tabopdlg.cxx19
-rw-r--r--sc/source/ui/namedlg/namedefdlg.cxx21
-rw-r--r--sc/source/ui/namedlg/namedlg.cxx23
-rw-r--r--sc/source/ui/namedlg/namemgrtable.cxx6
-rw-r--r--sc/source/ui/namedlg/namepast.cxx13
-rw-r--r--sc/source/ui/navipi/content.cxx7
-rw-r--r--sc/source/ui/navipi/navcitem.cxx2
-rw-r--r--sc/source/ui/navipi/navipi.cxx211
-rw-r--r--sc/source/ui/navipi/scenwnd.cxx50
-rw-r--r--sc/source/ui/optdlg/calcoptionsdlg.cxx20
-rw-r--r--sc/source/ui/optdlg/calcoptionsdlg.hxx33
-rw-r--r--sc/source/ui/optdlg/opredlin.cxx14
-rw-r--r--sc/source/ui/optdlg/tpcalc.cxx26
-rw-r--r--sc/source/ui/optdlg/tpcompatibility.cxx11
-rw-r--r--sc/source/ui/optdlg/tpdefaults.cxx12
-rw-r--r--sc/source/ui/optdlg/tpformula.cxx27
-rw-r--r--sc/source/ui/optdlg/tpprint.cxx13
-rw-r--r--sc/source/ui/optdlg/tpusrlst.cxx22
-rw-r--r--sc/source/ui/optdlg/tpview.cxx61
-rw-r--r--sc/source/ui/pagedlg/areasdlg.cxx18
-rw-r--r--sc/source/ui/pagedlg/scuitphfedit.cxx42
-rw-r--r--sc/source/ui/pagedlg/tphf.cxx18
-rw-r--r--sc/source/ui/pagedlg/tphfedit.cxx6
-rw-r--r--sc/source/ui/pagedlg/tptable.cxx31
-rw-r--r--sc/source/ui/sidebar/AlignmentPropertyPanel.cxx30
-rw-r--r--sc/source/ui/sidebar/AlignmentPropertyPanel.hxx33
-rw-r--r--sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx26
-rw-r--r--sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx25
-rw-r--r--sc/source/ui/sidebar/CellBorderStyleControl.cxx119
-rw-r--r--sc/source/ui/sidebar/CellBorderStyleControl.hxx11
-rw-r--r--sc/source/ui/sidebar/CellLineStyleControl.cxx78
-rw-r--r--sc/source/ui/sidebar/CellLineStyleControl.hxx10
-rw-r--r--sc/source/ui/sidebar/CellLineStyleValueSet.cxx8
-rw-r--r--sc/source/ui/sidebar/CellLineStyleValueSet.hxx3
-rw-r--r--sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx24
-rw-r--r--sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx28
-rw-r--r--sc/source/ui/sidebar/ScPanelFactory.cxx46
-rw-r--r--sc/source/ui/undo/undobase.cxx8
-rw-r--r--sc/source/ui/undo/undoblk.cxx4
-rw-r--r--sc/source/ui/undo/undoblk3.cxx6
-rw-r--r--sc/source/ui/undo/undostyl.cxx6
-rw-r--r--sc/source/ui/unoobj/confuno.cxx4
-rw-r--r--sc/source/ui/unoobj/styleuno.cxx24
-rw-r--r--sc/source/ui/vba/vbaeventshelper.cxx8
-rw-r--r--sc/source/ui/view/cellsh1.cxx20
-rw-r--r--sc/source/ui/view/cellsh2.cxx8
-rw-r--r--sc/source/ui/view/cellsh3.cxx4
-rw-r--r--sc/source/ui/view/dbfunc.cxx4
-rw-r--r--sc/source/ui/view/gridwin.cxx62
-rw-r--r--sc/source/ui/view/gridwin2.cxx4
-rw-r--r--sc/source/ui/view/gridwin4.cxx2
-rw-r--r--sc/source/ui/view/olinewin.cxx6
-rw-r--r--sc/source/ui/view/preview.cxx6
-rw-r--r--sc/source/ui/view/prevwsh.cxx25
-rw-r--r--sc/source/ui/view/printfun.cxx2
-rw-r--r--sc/source/ui/view/reffact.cxx37
-rw-r--r--sc/source/ui/view/spelleng.cxx4
-rw-r--r--sc/source/ui/view/tabview.cxx162
-rw-r--r--sc/source/ui/view/tabview2.cxx4
-rw-r--r--sc/source/ui/view/tabview3.cxx2
-rw-r--r--sc/source/ui/view/tabview4.cxx16
-rw-r--r--sc/source/ui/view/tabview5.cxx47
-rw-r--r--sc/source/ui/view/tabvwsh3.cxx8
-rw-r--r--sc/source/ui/view/tabvwsh4.cxx7
-rw-r--r--sc/source/ui/view/tabvwshc.cxx60
-rw-r--r--sc/source/ui/view/tabvwshh.cxx2
-rw-r--r--sc/source/ui/view/viewfun2.cxx8
-rw-r--r--sc/source/ui/view/viewfun3.cxx14
-rw-r--r--sc/source/ui/view/viewfun4.cxx8
-rw-r--r--sc/source/ui/view/viewfunc.cxx12
-rw-r--r--sc/source/ui/xmlsource/xmlsourcedlg.cxx21
-rw-r--r--sd/inc/Outliner.hxx2
-rw-r--r--sd/inc/sdmod.hxx4
-rw-r--r--sd/source/core/drawdoc3.cxx4
-rw-r--r--sd/source/filter/eppt/epptbase.hxx5
-rw-r--r--sd/source/filter/eppt/pptx-text.cxx2
-rw-r--r--sd/source/filter/grf/sdgrffilter.cxx4
-rw-r--r--sd/source/filter/html/buttonset.cxx12
-rw-r--r--sd/source/filter/html/htmlex.cxx6
-rw-r--r--sd/source/filter/html/pubdlg.cxx118
-rw-r--r--sd/source/ui/accessibility/AccessibleSlideSorterView.cxx16
-rw-r--r--sd/source/ui/animations/CustomAnimationCreateDialog.cxx50
-rw-r--r--sd/source/ui/animations/CustomAnimationCreateDialog.hxx7
-rw-r--r--sd/source/ui/animations/CustomAnimationDialog.cxx270
-rw-r--r--sd/source/ui/animations/CustomAnimationDialog.hxx10
-rw-r--r--sd/source/ui/animations/CustomAnimationList.cxx8
-rw-r--r--sd/source/ui/animations/CustomAnimationList.hxx1
-rw-r--r--sd/source/ui/animations/CustomAnimationPane.cxx35
-rw-r--r--sd/source/ui/animations/CustomAnimationPane.hxx35
-rw-r--r--sd/source/ui/animations/SlideTransitionPane.cxx29
-rw-r--r--sd/source/ui/animations/SlideTransitionPane.hxx27
-rw-r--r--sd/source/ui/annotations/annotationmanager.cxx7
-rw-r--r--sd/source/ui/annotations/annotationtag.cxx22
-rw-r--r--sd/source/ui/annotations/annotationtag.hxx4
-rw-r--r--sd/source/ui/annotations/annotationwindow.cxx25
-rw-r--r--sd/source/ui/annotations/annotationwindow.hxx10
-rw-r--r--sd/source/ui/app/sdmod.cxx2
-rw-r--r--sd/source/ui/app/sdmod2.cxx4
-rw-r--r--sd/source/ui/app/sdxfer.cxx4
-rw-r--r--sd/source/ui/app/tbxww.cxx2
-rw-r--r--sd/source/ui/controller/slidelayoutcontroller.cxx19
-rw-r--r--sd/source/ui/controller/slidelayoutcontroller.hxx2
-rw-r--r--sd/source/ui/dlg/AnimationChildWindow.cxx2
-rw-r--r--sd/source/ui/dlg/LayerTabBar.cxx4
-rw-r--r--sd/source/ui/dlg/NavigatorChildWindow.cxx3
-rw-r--r--sd/source/ui/dlg/PaneChildWindows.cxx7
-rw-r--r--sd/source/ui/dlg/PhotoAlbumDialog.cxx25
-rw-r--r--sd/source/ui/dlg/PhotoAlbumDialog.hxx24
-rw-r--r--sd/source/ui/dlg/RemoteDialog.cxx13
-rw-r--r--sd/source/ui/dlg/RemoteDialog.hxx8
-rw-r--r--sd/source/ui/dlg/RemoteDialogClientBox.cxx88
-rw-r--r--sd/source/ui/dlg/RemoteDialogClientBox.hxx13
-rw-r--r--sd/source/ui/dlg/animobjs.cxx51
-rw-r--r--sd/source/ui/dlg/assclass.cxx4
-rw-r--r--sd/source/ui/dlg/brkdlg.cxx16
-rw-r--r--sd/source/ui/dlg/copydlg.cxx39
-rw-r--r--sd/source/ui/dlg/custsdlg.cxx41
-rw-r--r--sd/source/ui/dlg/diactrl.cxx4
-rw-r--r--sd/source/ui/dlg/dlgass.cxx128
-rw-r--r--sd/source/ui/dlg/dlgassim.cxx6
-rw-r--r--sd/source/ui/dlg/dlgassim.hxx1
-rw-r--r--sd/source/ui/dlg/dlgctrls.cxx6
-rw-r--r--sd/source/ui/dlg/dlgfield.cxx15
-rw-r--r--sd/source/ui/dlg/dlgolbul.cxx6
-rw-r--r--sd/source/ui/dlg/dlgsnap.cxx19
-rw-r--r--sd/source/ui/dlg/docprev.cxx24
-rw-r--r--sd/source/ui/dlg/gluectrl.cxx8
-rw-r--r--sd/source/ui/dlg/headerfooterdlg.cxx76
-rw-r--r--sd/source/ui/dlg/ins_paste.cxx12
-rw-r--r--sd/source/ui/dlg/inspagob.cxx9
-rw-r--r--sd/source/ui/dlg/layeroptionsdlg.cxx16
-rw-r--r--sd/source/ui/dlg/masterlayoutdlg.cxx15
-rw-r--r--sd/source/ui/dlg/morphdlg.cxx9
-rw-r--r--sd/source/ui/dlg/navigatr.cxx253
-rw-r--r--sd/source/ui/dlg/paragr.cxx22
-rw-r--r--sd/source/ui/dlg/present.cxx33
-rw-r--r--sd/source/ui/dlg/prltempl.cxx6
-rw-r--r--sd/source/ui/dlg/prntopts.cxx33
-rw-r--r--sd/source/ui/dlg/sddlgfact.cxx48
-rw-r--r--sd/source/ui/dlg/sddlgfact.hxx3
-rw-r--r--sd/source/ui/dlg/sdpreslt.cxx12
-rw-r--r--sd/source/ui/dlg/sdtreelb.cxx14
-rw-r--r--sd/source/ui/dlg/sduiexp.cxx15
-rw-r--r--sd/source/ui/dlg/tpaction.cxx31
-rw-r--r--sd/source/ui/dlg/tpoption.cxx65
-rw-r--r--sd/source/ui/dlg/vectdlg.cxx16
-rw-r--r--sd/source/ui/docshell/docshel2.cxx20
-rw-r--r--sd/source/ui/docshell/docshel4.cxx20
-rw-r--r--sd/source/ui/docshell/docshell.cxx2
-rw-r--r--sd/source/ui/framework/factories/BasicViewFactory.cxx2
-rw-r--r--sd/source/ui/framework/factories/BasicViewFactory.hxx3
-rw-r--r--sd/source/ui/framework/factories/ChildWindowPane.cxx2
-rw-r--r--sd/source/ui/framework/factories/FullScreenPane.cxx21
-rw-r--r--sd/source/ui/framework/factories/FullScreenPane.hxx2
-rw-r--r--sd/source/ui/framework/factories/Pane.cxx2
-rw-r--r--sd/source/ui/func/fuinsert.cxx4
-rw-r--r--sd/source/ui/func/fuinsfil.cxx12
-rw-r--r--sd/source/ui/func/fulinend.cxx4
-rw-r--r--sd/source/ui/func/fupage.cxx6
-rw-r--r--sd/source/ui/func/fupoor.cxx11
-rw-r--r--sd/source/ui/inc/AccessibleDocumentViewBase.hxx2
-rw-r--r--sd/source/ui/inc/AccessibleSlideSorterView.hxx3
-rw-r--r--sd/source/ui/inc/BreakDlg.hxx9
-rw-r--r--sd/source/ui/inc/DrawDocShell.hxx4
-rw-r--r--sd/source/ui/inc/DrawViewShell.hxx6
-rw-r--r--sd/source/ui/inc/FormShellManager.hxx3
-rw-r--r--sd/source/ui/inc/OutlineBulletDlg.hxx1
-rw-r--r--sd/source/ui/inc/PreviewRenderer.hxx2
-rw-r--r--sd/source/ui/inc/Ruler.hxx3
-rw-r--r--sd/source/ui/inc/SlideSorter.hxx35
-rw-r--r--sd/source/ui/inc/View.hxx4
-rw-r--r--sd/source/ui/inc/ViewShell.hxx18
-rw-r--r--sd/source/ui/inc/ViewTabBar.hxx6
-rw-r--r--sd/source/ui/inc/Window.hxx5
-rw-r--r--sd/source/ui/inc/WindowUpdater.hxx3
-rw-r--r--sd/source/ui/inc/animobjs.hxx47
-rw-r--r--sd/source/ui/inc/assclass.hxx2
-rw-r--r--sd/source/ui/inc/copydlg.hxx23
-rw-r--r--sd/source/ui/inc/createtabledesignpanel.hxx3
-rw-r--r--sd/source/ui/inc/custsdlg.hxx41
-rw-r--r--sd/source/ui/inc/diactrl.hxx2
-rw-r--r--sd/source/ui/inc/dlgass.hxx1
-rw-r--r--sd/source/ui/inc/dlgctrls.hxx3
-rw-r--r--sd/source/ui/inc/dlgfield.hxx11
-rw-r--r--sd/source/ui/inc/dlgsnap.hxx20
-rw-r--r--sd/source/ui/inc/docprev.hxx1
-rw-r--r--sd/source/ui/inc/drawview.hxx2
-rw-r--r--sd/source/ui/inc/framework/Pane.hxx3
-rw-r--r--sd/source/ui/inc/fupoor.hxx6
-rw-r--r--sd/source/ui/inc/gluectrl.hxx2
-rw-r--r--sd/source/ui/inc/headerfooterdlg.hxx13
-rw-r--r--sd/source/ui/inc/ins_paste.hxx6
-rw-r--r--sd/source/ui/inc/inspagob.hxx7
-rw-r--r--sd/source/ui/inc/layeroptionsdlg.hxx15
-rw-r--r--sd/source/ui/inc/masterlayoutdlg.hxx12
-rw-r--r--sd/source/ui/inc/morphdlg.hxx7
-rw-r--r--sd/source/ui/inc/navigatr.hxx11
-rw-r--r--sd/source/ui/inc/present.hxx48
-rw-r--r--sd/source/ui/inc/prltempl.hxx1
-rw-r--r--sd/source/ui/inc/prntopts.hxx41
-rw-r--r--sd/source/ui/inc/pubdlg.hxx169
-rw-r--r--sd/source/ui/inc/sdpreslt.hxx10
-rw-r--r--sd/source/ui/inc/sdtreelb.hxx5
-rw-r--r--sd/source/ui/inc/sdxfer.hxx2
-rw-r--r--sd/source/ui/inc/taskpane/SlideSorterCacheDisplay.hxx2
-rw-r--r--sd/source/ui/inc/tbx_ww.hxx2
-rw-r--r--sd/source/ui/inc/tpaction.hxx33
-rw-r--r--sd/source/ui/inc/tpoption.hxx68
-rw-r--r--sd/source/ui/inc/vectdlg.hxx21
-rw-r--r--sd/source/ui/presenter/PresenterHelper.cxx4
-rw-r--r--sd/source/ui/presenter/PresenterTextView.cxx11
-rw-r--r--sd/source/ui/sidebar/AllMasterPagesSelector.cxx7
-rw-r--r--sd/source/ui/sidebar/AllMasterPagesSelector.hxx2
-rw-r--r--sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx14
-rw-r--r--sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx3
-rw-r--r--sd/source/ui/sidebar/LayoutMenu.cxx6
-rw-r--r--sd/source/ui/sidebar/LayoutMenu.hxx1
-rw-r--r--sd/source/ui/sidebar/MasterPagesSelector.cxx6
-rw-r--r--sd/source/ui/sidebar/MasterPagesSelector.hxx1
-rw-r--r--sd/source/ui/sidebar/NavigatorWrapper.cxx25
-rw-r--r--sd/source/ui/sidebar/NavigatorWrapper.hxx4
-rw-r--r--sd/source/ui/sidebar/PanelBase.cxx14
-rw-r--r--sd/source/ui/sidebar/PanelBase.hxx3
-rw-r--r--sd/source/ui/sidebar/PanelFactory.cxx14
-rw-r--r--sd/source/ui/sidebar/RecentMasterPagesSelector.cxx13
-rw-r--r--sd/source/ui/sidebar/RecentMasterPagesSelector.hxx3
-rw-r--r--sd/source/ui/slideshow/showwin.cxx22
-rw-r--r--sd/source/ui/slideshow/showwindow.hxx1
-rw-r--r--sd/source/ui/slideshow/slideshow.cxx4
-rw-r--r--sd/source/ui/slideshow/slideshowimpl.cxx22
-rw-r--r--sd/source/ui/slideshow/slideshowimpl.hxx12
-rw-r--r--sd/source/ui/slidesorter/controller/SlideSorterController.cxx16
-rw-r--r--sd/source/ui/slidesorter/controller/SlsClipboard.cxx6
-rw-r--r--sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx2
-rw-r--r--sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx34
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx4
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSlotManager.cxx14
-rw-r--r--sd/source/ui/slidesorter/controller/SlsVisibleAreaManager.cxx4
-rw-r--r--sd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx9
-rw-r--r--sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx2
-rw-r--r--sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx4
-rw-r--r--sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx4
-rw-r--r--sd/source/ui/slidesorter/shell/SlideSorter.cxx60
-rw-r--r--sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx2
-rw-r--r--sd/source/ui/slidesorter/view/SlideSorterView.cxx28
-rw-r--r--sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx10
-rw-r--r--sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx18
-rw-r--r--sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx26
-rw-r--r--sd/source/ui/slidesorter/view/SlsLayeredDevice.hxx8
-rw-r--r--sd/source/ui/slidesorter/view/SlsLayouter.cxx20
-rw-r--r--sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx6
-rw-r--r--sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx6
-rw-r--r--sd/source/ui/slidesorter/view/SlsToolTip.cxx8
-rw-r--r--sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx2
-rw-r--r--sd/source/ui/table/TableDesignPane.cxx6
-rw-r--r--sd/source/ui/table/TableDesignPane.hxx4
-rw-r--r--sd/source/ui/tools/PreviewRenderer.cxx2
-rw-r--r--sd/source/ui/unoidl/UnoDocumentSettings.cxx2
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx4
-rw-r--r--sd/source/ui/view/DocumentRenderer.cxx19
-rw-r--r--sd/source/ui/view/FormShellManager.cxx4
-rw-r--r--sd/source/ui/view/Outliner.cxx24
-rw-r--r--sd/source/ui/view/ViewShellBase.cxx17
-rw-r--r--sd/source/ui/view/ViewTabBar.cxx6
-rw-r--r--sd/source/ui/view/drawview.cxx5
-rw-r--r--sd/source/ui/view/drviews1.cxx64
-rw-r--r--sd/source/ui/view/drviews2.cxx20
-rw-r--r--sd/source/ui/view/drviews3.cxx2
-rw-r--r--sd/source/ui/view/drviews4.cxx2
-rw-r--r--sd/source/ui/view/drviews5.cxx4
-rw-r--r--sd/source/ui/view/drviews6.cxx4
-rw-r--r--sd/source/ui/view/drviews7.cxx2
-rw-r--r--sd/source/ui/view/drviews9.cxx10
-rw-r--r--sd/source/ui/view/drviewsa.cxx8
-rw-r--r--sd/source/ui/view/drviewsb.cxx4
-rw-r--r--sd/source/ui/view/drviewse.cxx2
-rw-r--r--sd/source/ui/view/drviewsi.cxx4
-rw-r--r--sd/source/ui/view/grviewsh.cxx2
-rw-r--r--sd/source/ui/view/sdruler.cxx7
-rw-r--r--sd/source/ui/view/sdview2.cxx2
-rw-r--r--sd/source/ui/view/sdwindow.cxx7
-rw-r--r--sd/source/ui/view/viewshe2.cxx2
-rw-r--r--sd/source/ui/view/viewshel.cxx18
-rw-r--r--sfx2/inc/inettbc.hxx2
-rw-r--r--sfx2/inc/srchdlg.hxx19
-rw-r--r--sfx2/source/appl/appopen.cxx10
-rw-r--r--sfx2/source/appl/appserv.cxx12
-rw-r--r--sfx2/source/appl/childwin.cxx24
-rw-r--r--sfx2/source/appl/fileobj.hxx2
-rw-r--r--sfx2/source/appl/helpinterceptor.hxx3
-rw-r--r--sfx2/source/appl/impldde.cxx30
-rw-r--r--sfx2/source/appl/lnkbase2.cxx4
-rw-r--r--sfx2/source/appl/module.cxx5
-rw-r--r--sfx2/source/appl/newhelp.cxx285
-rw-r--r--sfx2/source/appl/newhelp.hxx93
-rw-r--r--sfx2/source/appl/opengrf.cxx4
-rw-r--r--sfx2/source/appl/openuriexternally.cxx6
-rw-r--r--sfx2/source/appl/sfxhelp.cxx12
-rw-r--r--sfx2/source/appl/workwin.cxx29
-rw-r--r--sfx2/source/bastyp/fltfnc.cxx4
-rw-r--r--sfx2/source/control/ctrlitem.cxx9
-rw-r--r--sfx2/source/control/recentdocsview.cxx4
-rw-r--r--sfx2/source/control/templateabstractview.cxx36
-rw-r--r--sfx2/source/control/templatedefaultview.cxx4
-rw-r--r--sfx2/source/control/templatelocalview.cxx18
-rw-r--r--sfx2/source/control/templateremoteview.cxx6
-rw-r--r--sfx2/source/control/templatesearchview.cxx4
-rw-r--r--sfx2/source/control/thumbnailview.cxx14
-rw-r--r--sfx2/source/control/thumbnailviewacc.cxx2
-rw-r--r--sfx2/source/control/thumbnailviewacc.hxx3
-rw-r--r--sfx2/source/control/thumbnailviewitem.cxx13
-rw-r--r--sfx2/source/dialog/alienwarn.cxx9
-rw-r--r--sfx2/source/dialog/backingcomp.cxx12
-rw-r--r--sfx2/source/dialog/backingwindow.cxx44
-rw-r--r--sfx2/source/dialog/backingwindow.hxx47
-rw-r--r--sfx2/source/dialog/basedlgs.cxx56
-rw-r--r--sfx2/source/dialog/checkin.cxx13
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx478
-rw-r--r--sfx2/source/dialog/dockwin.cxx27
-rw-r--r--sfx2/source/dialog/documentfontsdialog.cxx15
-rw-r--r--sfx2/source/dialog/filedlgimpl.hxx2
-rw-r--r--sfx2/source/dialog/infobar.cxx71
-rw-r--r--sfx2/source/dialog/inputdlg.cxx14
-rw-r--r--sfx2/source/dialog/mailmodel.cxx4
-rw-r--r--sfx2/source/dialog/mgetempl.cxx52
-rw-r--r--sfx2/source/dialog/navigat.cxx4
-rw-r--r--sfx2/source/dialog/newstyle.cxx15
-rw-r--r--sfx2/source/dialog/partwnd.cxx16
-rw-r--r--sfx2/source/dialog/passwd.cxx26
-rw-r--r--sfx2/source/dialog/printopt.cxx30
-rw-r--r--sfx2/source/dialog/recfloat.cxx17
-rw-r--r--sfx2/source/dialog/securitypage.cxx30
-rw-r--r--sfx2/source/dialog/splitwin.cxx30
-rw-r--r--sfx2/source/dialog/srchdlg.cxx12
-rw-r--r--sfx2/source/dialog/styledlg.cxx5
-rw-r--r--sfx2/source/dialog/tabdlg.cxx64
-rw-r--r--sfx2/source/dialog/taskpane.cxx63
-rw-r--r--sfx2/source/dialog/templateinfodlg.cxx12
-rw-r--r--sfx2/source/dialog/templdlg.cxx265
-rw-r--r--sfx2/source/dialog/titledockwin.cxx45
-rw-r--r--sfx2/source/dialog/versdlg.cxx53
-rw-r--r--sfx2/source/doc/QuerySaveDocument.cxx6
-rw-r--r--sfx2/source/doc/docinsert.cxx8
-rw-r--r--sfx2/source/doc/doctemplates.cxx14
-rw-r--r--sfx2/source/doc/guisaveas.cxx8
-rw-r--r--sfx2/source/doc/iframe.cxx2
-rw-r--r--sfx2/source/doc/new.cxx28
-rw-r--r--sfx2/source/doc/objcont.cxx20
-rw-r--r--sfx2/source/doc/objserv.cxx28
-rw-r--r--sfx2/source/doc/objstor.cxx4
-rw-r--r--sfx2/source/doc/plugin.cxx2
-rw-r--r--sfx2/source/doc/printhelper.cxx6
-rw-r--r--sfx2/source/doc/templatedlg.cxx84
-rw-r--r--sfx2/source/inc/alienwarn.hxx7
-rw-r--r--sfx2/source/inc/documentfontsdialog.hxx6
-rw-r--r--sfx2/source/inc/inputdlg.hxx10
-rw-r--r--sfx2/source/inc/partwnd.hxx1
-rw-r--r--sfx2/source/inc/recfloat.hxx3
-rw-r--r--sfx2/source/inc/splitwin.hxx11
-rw-r--r--sfx2/source/inc/templatesearchview.hxx2
-rw-r--r--sfx2/source/inc/templdgi.hxx17
-rw-r--r--sfx2/source/inc/versdlg.hxx42
-rw-r--r--sfx2/source/inc/workwin.hxx14
-rw-r--r--sfx2/source/inet/inettbc.cxx7
-rw-r--r--sfx2/source/sidebar/ControlFactory.cxx8
-rw-r--r--sfx2/source/sidebar/ControllerItem.cxx8
-rw-r--r--sfx2/source/sidebar/Deck.cxx67
-rw-r--r--sfx2/source/sidebar/Deck.hxx16
-rw-r--r--sfx2/source/sidebar/DeckLayouter.cxx4
-rw-r--r--sfx2/source/sidebar/DeckTitleBar.cxx14
-rw-r--r--sfx2/source/sidebar/DeckTitleBar.hxx1
-rw-r--r--sfx2/source/sidebar/FocusManager.cxx24
-rw-r--r--sfx2/source/sidebar/FocusManager.hxx10
-rw-r--r--sfx2/source/sidebar/MenuButton.cxx4
-rw-r--r--sfx2/source/sidebar/MenuButton.hxx1
-rw-r--r--sfx2/source/sidebar/Panel.cxx10
-rw-r--r--sfx2/source/sidebar/Panel.hxx8
-rw-r--r--sfx2/source/sidebar/PanelTitleBar.cxx31
-rw-r--r--sfx2/source/sidebar/PanelTitleBar.hxx3
-rw-r--r--sfx2/source/sidebar/SidebarChildWindow.cxx6
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx83
-rw-r--r--sfx2/source/sidebar/SidebarController.hxx12
-rw-r--r--sfx2/source/sidebar/SidebarDockingWindow.cxx6
-rw-r--r--sfx2/source/sidebar/SidebarDockingWindow.hxx1
-rw-r--r--sfx2/source/sidebar/SidebarPanelBase.cxx16
-rw-r--r--sfx2/source/sidebar/SidebarToolBox.cxx8
-rw-r--r--sfx2/source/sidebar/TabBar.cxx25
-rw-r--r--sfx2/source/sidebar/TabBar.hxx7
-rw-r--r--sfx2/source/sidebar/TabItem.cxx4
-rw-r--r--sfx2/source/sidebar/TabItem.hxx1
-rw-r--r--sfx2/source/sidebar/TitleBar.cxx21
-rw-r--r--sfx2/source/sidebar/TitleBar.hxx7
-rw-r--r--sfx2/source/statbar/stbitem.cxx2
-rw-r--r--sfx2/source/toolbox/imgmgr.cxx2
-rw-r--r--sfx2/source/toolbox/tbxitem.cxx48
-rw-r--r--sfx2/source/view/frame.cxx2
-rw-r--r--sfx2/source/view/frame2.cxx9
-rw-r--r--sfx2/source/view/impframe.hxx14
-rw-r--r--sfx2/source/view/impviewframe.hxx4
-rw-r--r--sfx2/source/view/printer.cxx27
-rw-r--r--sfx2/source/view/sfxbasecontroller.cxx2
-rw-r--r--sfx2/source/view/viewfrm.cxx20
-rw-r--r--sfx2/source/view/viewprn.cxx57
-rw-r--r--sfx2/source/view/viewsh.cxx12
-rw-r--r--slideshow/source/engine/rehearsetimingsactivity.cxx40
-rw-r--r--slideshow/source/engine/shapes/gdimtftools.cxx42
-rw-r--r--slideshow/source/engine/shapes/viewmediashape.cxx6
-rw-r--r--slideshow/source/engine/shapes/viewmediashape.hxx5
-rw-r--r--starmath/inc/ElementsDockingWindow.hxx8
-rw-r--r--starmath/inc/dialog.hxx182
-rw-r--r--starmath/inc/document.hxx12
-rw-r--r--starmath/inc/edit.hxx7
-rw-r--r--starmath/inc/smmod.hxx4
-rw-r--r--starmath/inc/toolbox.hxx7
-rw-r--r--starmath/inc/view.hxx18
-rw-r--r--starmath/inc/visitors.hxx2
-rw-r--r--starmath/qa/cppunit/test_nodetotextvisitors.cxx32
-rw-r--r--starmath/qa/cppunit/test_starmath.cxx12
-rw-r--r--starmath/source/ElementsDockingWindow.cxx24
-rw-r--r--starmath/source/accessibility.hxx4
-rw-r--r--starmath/source/dialog.cxx187
-rw-r--r--starmath/source/document.cxx16
-rw-r--r--starmath/source/edit.cxx26
-rw-r--r--starmath/source/smmod.cxx7
-rw-r--r--starmath/source/toolbox.cxx24
-rw-r--r--starmath/source/unomodel.cxx10
-rw-r--r--starmath/source/view.cxx62
-rw-r--r--svtools/inc/roadmap.hxx1
-rw-r--r--svtools/inc/table/tablecontrol.hxx1
-rw-r--r--svtools/inc/vclxaccessibleheaderbar.hxx2
-rw-r--r--svtools/inc/vclxaccessibleheaderbaritem.hxx3
-rw-r--r--svtools/source/brwbox/brwbox1.cxx79
-rw-r--r--svtools/source/brwbox/brwbox2.cxx74
-rw-r--r--svtools/source/brwbox/brwhead.cxx12
-rw-r--r--svtools/source/brwbox/datwin.cxx20
-rw-r--r--svtools/source/brwbox/datwin.hxx13
-rw-r--r--svtools/source/brwbox/ebbcontrols.cxx10
-rw-r--r--svtools/source/brwbox/editbrowsebox.cxx21
-rw-r--r--svtools/source/contnr/DocumentInfoPreview.cxx42
-rw-r--r--svtools/source/contnr/fileview.cxx54
-rw-r--r--svtools/source/contnr/imivctl.hxx19
-rw-r--r--svtools/source/contnr/imivctl1.cxx173
-rw-r--r--svtools/source/contnr/ivctrl.cxx23
-rw-r--r--svtools/source/contnr/simptabl.cxx110
-rw-r--r--svtools/source/contnr/svimpbox.cxx191
-rw-r--r--svtools/source/contnr/svtabbx.cxx14
-rw-r--r--svtools/source/contnr/treelistbox.cxx85
-rw-r--r--svtools/source/control/calendar.cxx75
-rw-r--r--svtools/source/control/ctrlbox.cxx71
-rw-r--r--svtools/source/control/ctrltool.cxx2
-rw-r--r--svtools/source/control/filectrl.cxx54
-rw-r--r--svtools/source/control/fmtfield.cxx10
-rw-r--r--svtools/source/control/headbar.cxx19
-rw-r--r--svtools/source/control/hyperlabel.cxx6
-rw-r--r--svtools/source/control/inettbc.cxx14
-rw-r--r--svtools/source/control/roadmap.cxx34
-rw-r--r--svtools/source/control/ruler.cxx109
-rw-r--r--svtools/source/control/scrwin.cxx89
-rw-r--r--svtools/source/control/tabbar.cxx64
-rw-r--r--svtools/source/control/toolbarmenu.cxx22
-rw-r--r--svtools/source/control/toolbarmenuimp.hxx2
-rw-r--r--svtools/source/control/valueacc.cxx2
-rw-r--r--svtools/source/control/valueimp.hxx2
-rw-r--r--svtools/source/control/valueset.cxx94
-rw-r--r--svtools/source/control/vclxaccessibleheaderbar.cxx3
-rw-r--r--svtools/source/dialogs/PlaceEditDialog.cxx12
-rw-r--r--svtools/source/dialogs/addresstemplate.cxx42
-rw-r--r--svtools/source/dialogs/colrdlg.cxx1
-rw-r--r--svtools/source/dialogs/prnsetup.cxx37
-rw-r--r--svtools/source/dialogs/restartdialog.cxx15
-rw-r--r--svtools/source/dialogs/roadmapwizard.cxx19
-rw-r--r--svtools/source/dialogs/wizardmachine.cxx34
-rw-r--r--svtools/source/dialogs/wizdlg.cxx15
-rw-r--r--svtools/source/edit/editsyntaxhighlighter.cxx4
-rw-r--r--svtools/source/edit/svmedit2.cxx6
-rw-r--r--svtools/source/filter/GraphicExportOptionsDialog.cxx12
-rw-r--r--svtools/source/filter/exportdialog.cxx39
-rw-r--r--svtools/source/filter/exportdialog.hxx73
-rw-r--r--svtools/source/graphic/grfmgr2.cxx16
-rw-r--r--svtools/source/graphic/provider.cxx16
-rw-r--r--svtools/source/hatchwindow/hatchwindow.cxx4
-rw-r--r--svtools/source/inc/hatchwindow.hxx2
-rw-r--r--svtools/source/inc/renderer.hxx2
-rw-r--r--svtools/source/inc/svimpbox.hxx12
-rw-r--r--svtools/source/inc/unoiface.hxx9
-rw-r--r--svtools/source/java/javainteractionhandler.cxx28
-rw-r--r--svtools/source/misc/dialogcontrolling.cxx4
-rw-r--r--svtools/source/misc/ehdl.cxx10
-rw-r--r--svtools/source/misc/sampletext.cxx14
-rw-r--r--svtools/source/table/gridtablerenderer.cxx8
-rw-r--r--svtools/source/table/tablecontrol.cxx6
-rw-r--r--svtools/source/table/tablecontrol_impl.cxx31
-rw-r--r--svtools/source/table/tablecontrol_impl.hxx9
-rw-r--r--svtools/source/table/tabledatawindow.cxx6
-rw-r--r--svtools/source/table/tabledatawindow.hxx1
-rw-r--r--svtools/source/toolpanel/drawerlayouter.cxx14
-rw-r--r--svtools/source/toolpanel/paneltabbar.cxx84
-rw-r--r--svtools/source/toolpanel/paneltabbarpeer.cxx4
-rw-r--r--svtools/source/toolpanel/paneltabbarpeer.hxx2
-rw-r--r--svtools/source/toolpanel/tablayouter.cxx4
-rw-r--r--svtools/source/toolpanel/toolpaneldeck.cxx27
-rw-r--r--svtools/source/toolpanel/toolpaneldeckpeer.cxx4
-rw-r--r--svtools/source/toolpanel/toolpaneldeckpeer.hxx2
-rw-r--r--svtools/source/toolpanel/toolpaneldrawer.cxx26
-rw-r--r--svtools/source/toolpanel/toolpaneldrawer.hxx7
-rw-r--r--svtools/source/toolpanel/toolpaneldrawerpeer.cxx2
-rw-r--r--svtools/source/uno/addrtempuno.cxx10
-rw-r--r--svtools/source/uno/generictoolboxcontroller.cxx6
-rw-r--r--svtools/source/uno/genericunodialog.cxx5
-rw-r--r--svtools/source/uno/popupwindowcontroller.cxx10
-rw-r--r--svtools/source/uno/statusbarcontroller.cxx2
-rw-r--r--svtools/source/uno/svtxgridcontrol.cxx58
-rw-r--r--svtools/source/uno/svtxgridcontrol.hxx2
-rw-r--r--svtools/source/uno/toolboxcontroller.cxx2
-rw-r--r--svtools/source/uno/treecontrolpeer.cxx11
-rw-r--r--svtools/source/uno/treecontrolpeer.hxx4
-rw-r--r--svtools/source/uno/unoiface.cxx221
-rw-r--r--svtools/source/uno/wizard/unowizard.cxx28
-rw-r--r--svtools/source/uno/wizard/wizardshell.cxx16
-rw-r--r--svtools/source/uno/wizard/wizardshell.hxx5
-rw-r--r--svx/inc/GalleryControl.hxx9
-rw-r--r--svx/inc/extrusiondepthdialog.hxx4
-rw-r--r--svx/inc/galbrws2.hxx16
-rw-r--r--svx/inc/sdr/overlay/overlaymanagerbuffered.hxx4
-rw-r--r--svx/inc/svdibrow.hxx13
-rw-r--r--svx/inc/tbunosearchcontrollers.hxx5
-rw-r--r--svx/source/accessibility/AccessibleShapeTreeInfo.cxx1
-rw-r--r--svx/source/accessibility/GraphCtlAccessibleContext.cxx6
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeFontWork.cxx30
-rw-r--r--svx/source/customshapes/tbxcustomshapes.cxx2
-rw-r--r--svx/source/dialog/_bmpmask.cxx66
-rw-r--r--svx/source/dialog/_contdlg.cxx72
-rw-r--r--svx/source/dialog/charmap.cxx55
-rw-r--r--svx/source/dialog/checklbx.cxx6
-rw-r--r--svx/source/dialog/compressgraphicdialog.cxx31
-rw-r--r--svx/source/dialog/connctrl.cxx6
-rw-r--r--svx/source/dialog/contimp.hxx9
-rw-r--r--svx/source/dialog/contwnd.cxx4
-rw-r--r--svx/source/dialog/contwnd.hxx1
-rw-r--r--svx/source/dialog/ctredlin.cxx76
-rw-r--r--svx/source/dialog/dialcontrol.cxx10
-rw-r--r--svx/source/dialog/dlgctl3d.cxx134
-rw-r--r--svx/source/dialog/dlgctrl.cxx88
-rw-r--r--svx/source/dialog/docrecovery.cxx73
-rw-r--r--svx/source/dialog/fntctrl.cxx12
-rw-r--r--svx/source/dialog/fontwork.cxx22
-rw-r--r--svx/source/dialog/frmdirlbox.cxx4
-rw-r--r--svx/source/dialog/frmsel.cxx39
-rw-r--r--svx/source/dialog/graphctl.cxx6
-rw-r--r--svx/source/dialog/hdft.cxx30
-rw-r--r--svx/source/dialog/imapdlg.cxx30
-rw-r--r--svx/source/dialog/imapwnd.cxx6
-rw-r--r--svx/source/dialog/imapwnd.hxx1
-rw-r--r--svx/source/dialog/langbox.cxx10
-rw-r--r--svx/source/dialog/linkwarn.cxx7
-rw-r--r--svx/source/dialog/measctrl.cxx6
-rw-r--r--svx/source/dialog/optgrid.cxx31
-rw-r--r--svx/source/dialog/orienthelper.cxx2
-rw-r--r--svx/source/dialog/pagectrl.cxx6
-rw-r--r--svx/source/dialog/passwd.cxx14
-rw-r--r--svx/source/dialog/prtqry.cxx5
-rw-r--r--svx/source/dialog/rubydialog.cxx41
-rw-r--r--svx/source/dialog/srchdlg.cxx52
-rw-r--r--svx/source/dialog/stddlg.cxx4
-rw-r--r--svx/source/dialog/svxbmpnumvalueset.cxx16
-rw-r--r--svx/source/dialog/svxruler.cxx32
-rw-r--r--svx/source/dialog/swframeexample.cxx4
-rw-r--r--svx/source/dialog/txencbox.cxx6
-rw-r--r--svx/source/engine3d/float3d.cxx21
-rw-r--r--svx/source/fmcomp/fmgridcl.cxx11
-rw-r--r--svx/source/fmcomp/fmgridif.cxx61
-rw-r--r--svx/source/fmcomp/gridcell.cxx381
-rw-r--r--svx/source/fmcomp/gridctrl.cxx339
-rw-r--r--svx/source/form/databaselocationinput.cxx4
-rw-r--r--svx/source/form/datanavi.cxx370
-rw-r--r--svx/source/form/filtnav.cxx20
-rw-r--r--svx/source/form/fmPropBrw.cxx13
-rw-r--r--svx/source/form/fmexpl.cxx14
-rw-r--r--svx/source/form/fmobj.cxx4
-rw-r--r--svx/source/form/fmshell.cxx7
-rw-r--r--svx/source/form/fmtextcontrolshell.cxx8
-rw-r--r--svx/source/form/navigatortree.cxx6
-rw-r--r--svx/source/form/tabwin.cxx22
-rw-r--r--svx/source/form/tbxform.cxx27
-rw-r--r--svx/source/form/xfm_addcondition.cxx6
-rw-r--r--svx/source/gallery2/GalleryControl.cxx31
-rw-r--r--svx/source/gallery2/galbrws1.cxx34
-rw-r--r--svx/source/gallery2/galbrws1.hxx7
-rw-r--r--svx/source/gallery2/galbrws2.cxx140
-rw-r--r--svx/source/gallery2/galctrl.cxx8
-rw-r--r--svx/source/gallery2/galobj.cxx4
-rw-r--r--svx/source/gallery2/galtheme.cxx6
-rw-r--r--svx/source/inc/AccessibleFrameSelector.hxx3
-rw-r--r--svx/source/inc/GraphCtlAccessibleContext.hxx2
-rw-r--r--svx/source/inc/charmapacc.hxx2
-rw-r--r--svx/source/inc/datalistener.hxx3
-rw-r--r--svx/source/inc/datanavi.hxx143
-rw-r--r--svx/source/inc/docrecovery.hxx46
-rw-r--r--svx/source/inc/filtnav.hxx4
-rw-r--r--svx/source/inc/fmPropBrw.hxx1
-rw-r--r--svx/source/inc/fmexch.hxx7
-rw-r--r--svx/source/inc/fmexpl.hxx4
-rw-r--r--svx/source/inc/fmobj.hxx2
-rw-r--r--svx/source/inc/fmvwimp.hxx3
-rw-r--r--svx/source/inc/frmselimpl.hxx2
-rw-r--r--svx/source/inc/gridcell.hxx22
-rw-r--r--svx/source/inc/svxrectctaccessiblecontext.hxx3
-rw-r--r--svx/source/inc/tabwin.hxx6
-rw-r--r--svx/source/inc/tbxform.hxx13
-rw-r--r--svx/source/inc/xfm_addcondition.hxx2
-rw-r--r--svx/source/mnuctrls/clipboardctl.cxx2
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx6
-rw-r--r--svx/source/sdr/overlay/overlaymanagerbuffered.cxx94
-rw-r--r--svx/source/sidebar/EmptyPanel.cxx17
-rw-r--r--svx/source/sidebar/EmptyPanel.hxx3
-rw-r--r--svx/source/sidebar/PanelFactory.cxx12
-rw-r--r--svx/source/sidebar/PanelLayout.cxx7
-rw-r--r--svx/source/sidebar/area/AreaPropertyPanel.cxx41
-rw-r--r--svx/source/sidebar/area/AreaPropertyPanel.hxx37
-rw-r--r--svx/source/sidebar/area/AreaTransparencyGradientControl.cxx274
-rw-r--r--svx/source/sidebar/area/AreaTransparencyGradientControl.hxx29
-rw-r--r--svx/source/sidebar/graphic/GraphicPropertyPanel.cxx35
-rw-r--r--svx/source/sidebar/graphic/GraphicPropertyPanel.hxx34
-rw-r--r--svx/source/sidebar/insert/InsertPropertyPanel.cxx15
-rw-r--r--svx/source/sidebar/insert/InsertPropertyPanel.hxx5
-rw-r--r--svx/source/sidebar/line/LinePropertyPanel.cxx39
-rw-r--r--svx/source/sidebar/line/LinePropertyPanel.hxx46
-rw-r--r--svx/source/sidebar/line/LineWidthControl.cxx153
-rw-r--r--svx/source/sidebar/line/LineWidthControl.hxx11
-rw-r--r--svx/source/sidebar/line/LineWidthValueSet.cxx11
-rw-r--r--svx/source/sidebar/line/LineWidthValueSet.hxx3
-rw-r--r--svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx25
-rw-r--r--svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx19
-rw-r--r--svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx4
-rw-r--r--svx/source/sidebar/paragraph/ParaPropertyPanel.cxx45
-rw-r--r--svx/source/sidebar/paragraph/ParaPropertyPanel.hxx38
-rw-r--r--svx/source/sidebar/possize/PosSizePropertyPanel.cxx50
-rw-r--r--svx/source/sidebar/possize/PosSizePropertyPanel.hxx48
-rw-r--r--svx/source/sidebar/possize/SidebarDialControl.cxx4
-rw-r--r--svx/source/sidebar/text/TextCharacterSpacingControl.cxx235
-rw-r--r--svx/source/sidebar/text/TextCharacterSpacingControl.hxx13
-rw-r--r--svx/source/sidebar/text/TextCharacterSpacingPopup.cxx2
-rw-r--r--svx/source/sidebar/text/TextCharacterSpacingPopup.hxx2
-rw-r--r--svx/source/sidebar/text/TextPropertyPanel.cxx36
-rw-r--r--svx/source/sidebar/text/TextPropertyPanel.hxx33
-rw-r--r--svx/source/sidebar/text/TextUnderlineControl.cxx178
-rw-r--r--svx/source/sidebar/text/TextUnderlineControl.hxx6
-rw-r--r--svx/source/sidebar/tools/Popup.cxx8
-rw-r--r--svx/source/sidebar/tools/PopupContainer.cxx7
-rw-r--r--svx/source/sidebar/tools/PopupControl.cxx10
-rw-r--r--svx/source/sidebar/tools/ValueSetWithTextControl.cxx6
-rw-r--r--svx/source/svdraw/sdrpaintwindow.cxx38
-rw-r--r--svx/source/svdraw/svdedxv.cxx30
-rw-r--r--svx/source/svdraw/svdfmtf.cxx54
-rw-r--r--svx/source/svdraw/svdfmtf.hxx36
-rw-r--r--svx/source/svdraw/svdibrow.cxx51
-rw-r--r--svx/source/svdraw/svdmrkv.cxx2
-rw-r--r--svx/source/svdraw/svdmrkv1.cxx2
-rw-r--r--svx/source/svdraw/svdograf.cxx10
-rw-r--r--svx/source/svdraw/svdotext.cxx8
-rw-r--r--svx/source/svdraw/svdpntv.cxx26
-rw-r--r--svx/source/svdraw/svdtrans.cxx16
-rw-r--r--svx/source/svdraw/svdview.cxx18
-rw-r--r--svx/source/svdraw/svdxcgv.cxx22
-rw-r--r--svx/source/tbxctrls/SvxColorChildWindow.cxx3
-rw-r--r--svx/source/tbxctrls/bulletsnumbering.cxx23
-rw-r--r--svx/source/tbxctrls/colorwindow.hxx15
-rw-r--r--svx/source/tbxctrls/colrctrl.cxx71
-rw-r--r--svx/source/tbxctrls/extrusioncontrols.cxx49
-rw-r--r--svx/source/tbxctrls/extrusioncontrols.hxx16
-rw-r--r--svx/source/tbxctrls/fillctrl.cxx22
-rw-r--r--svx/source/tbxctrls/fontworkgallery.cxx48
-rw-r--r--svx/source/tbxctrls/grafctrl.cxx73
-rw-r--r--svx/source/tbxctrls/itemwin.cxx24
-rw-r--r--svx/source/tbxctrls/layctrl.cxx44
-rw-r--r--svx/source/tbxctrls/lboxctrl.cxx35
-rw-r--r--svx/source/tbxctrls/linectrl.cxx85
-rw-r--r--svx/source/tbxctrls/subtoolboxcontrol.cxx2
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx223
-rw-r--r--svx/source/tbxctrls/tbunocontroller.cxx8
-rw-r--r--svx/source/tbxctrls/tbunosearchcontrollers.cxx16
-rw-r--r--svx/source/tbxctrls/tbxalign.cxx2
-rw-r--r--svx/source/toolbars/extrusionbar.cxx6
-rw-r--r--svx/source/toolbars/fontworkbar.cxx10
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx41
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx41
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx5
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx3
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx15
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx13
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx52
-rw-r--r--svx/source/unodraw/recoveryui.cxx6
-rw-r--r--svx/source/unodraw/unoshape.cxx6
-rw-r--r--svx/source/unodraw/unoshtxt.cxx2
-rw-r--r--svx/source/xoutdev/_xoutbmp.cxx38
-rw-r--r--svx/source/xoutdev/xattrbmp.cxx24
-rw-r--r--svx/source/xoutdev/xtabdash.cxx16
-rw-r--r--svx/source/xoutdev/xtabgrdt.cxx10
-rw-r--r--svx/source/xoutdev/xtabhtch.cxx16
-rw-r--r--svx/source/xoutdev/xtablend.cxx16
-rw-r--r--svx/workben/msview/msview.cxx2
-rw-r--r--svx/workben/pixelctl.cxx23
-rw-r--r--sw/inc/AnnotationWin.hxx3
-rw-r--r--sw/inc/PostItMgr.hxx5
-rw-r--r--sw/inc/SidebarWin.hxx13
-rw-r--r--sw/inc/colwd.hxx6
-rw-r--r--sw/inc/docsh.hxx2
-rw-r--r--sw/inc/hhcwrp.hxx2
-rw-r--r--sw/inc/hints.hxx5
-rw-r--r--sw/inc/postithelper.hxx6
-rw-r--r--sw/inc/printdata.hxx2
-rw-r--r--sw/inc/swmodule.hxx2
-rw-r--r--sw/inc/viewsh.hxx14
-rw-r--r--sw/qa/tiledrendering/tiledrendering.cxx215
-rw-r--r--sw/source/core/access/accdoc.hxx2
-rw-r--r--sw/source/core/access/accfrmobj.cxx2
-rw-r--r--sw/source/core/access/accfrmobj.hxx3
-rw-r--r--sw/source/core/attr/hints.cxx2
-rw-r--r--sw/source/core/doc/DocumentDeviceManager.cxx37
-rw-r--r--sw/source/core/doc/DocumentRedlineManager.cxx4
-rw-r--r--sw/source/core/draw/dflyobj.cxx2
-rw-r--r--sw/source/core/fields/postithelper.cxx4
-rw-r--r--sw/source/core/frmedt/fecopy.cxx20
-rw-r--r--sw/source/core/inc/DocumentDeviceManager.hxx6
-rw-r--r--sw/source/core/inc/drawfont.hxx5
-rw-r--r--sw/source/core/inc/fntcache.hxx5
-rw-r--r--sw/source/core/layout/paintfrm.cxx26
-rw-r--r--sw/source/core/layout/virtoutp.cxx5
-rw-r--r--sw/source/core/layout/virtoutp.hxx6
-rw-r--r--sw/source/core/text/inftxt.hxx4
-rw-r--r--sw/source/core/text/itratr.cxx6
-rw-r--r--sw/source/core/text/itratr.hxx2
-rw-r--r--sw/source/core/text/itrtxt.hxx2
-rw-r--r--sw/source/core/text/txtpaint.hxx4
-rw-r--r--sw/source/core/txtnode/fntcache.cxx10
-rw-r--r--sw/source/core/view/printdata.cxx8
-rw-r--r--sw/source/core/view/viewsh.cxx24
-rw-r--r--sw/source/core/view/vnew.cxx2
-rw-r--r--sw/source/core/view/vprint.cxx2
-rw-r--r--sw/source/filter/ww8/wrtww8gr.cxx12
-rw-r--r--sw/source/ui/chrdlg/break.cxx21
-rw-r--r--sw/source/ui/chrdlg/chardlg.cxx22
-rw-r--r--sw/source/ui/chrdlg/drpcps.cxx41
-rw-r--r--sw/source/ui/chrdlg/numpara.cxx29
-rw-r--r--sw/source/ui/chrdlg/swuiccoll.cxx21
-rw-r--r--sw/source/ui/config/mailconfigpage.cxx141
-rw-r--r--sw/source/ui/config/optcomp.cxx20
-rw-r--r--sw/source/ui/config/optload.cxx62
-rw-r--r--sw/source/ui/config/optpage.cxx230
-rw-r--r--sw/source/ui/dbui/addresslistdialog.cxx30
-rw-r--r--sw/source/ui/dbui/addresslistdialog.hxx19
-rw-r--r--sw/source/ui/dbui/createaddresslistdialog.cxx95
-rw-r--r--sw/source/ui/dbui/createaddresslistdialog.hxx39
-rw-r--r--sw/source/ui/dbui/customizeaddresslistdialog.cxx33
-rw-r--r--sw/source/ui/dbui/customizeaddresslistdialog.hxx20
-rw-r--r--sw/source/ui/dbui/dbinsdlg.cxx39
-rw-r--r--sw/source/ui/dbui/dbtablepreviewdialog.cxx8
-rw-r--r--sw/source/ui/dbui/dbtablepreviewdialog.hxx5
-rw-r--r--sw/source/ui/dbui/mailmergewizard.cxx20
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.cxx266
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.hxx99
-rw-r--r--sw/source/ui/dbui/mmdocselectpage.cxx17
-rw-r--r--sw/source/ui/dbui/mmdocselectpage.hxx19
-rw-r--r--sw/source/ui/dbui/mmgreetingspage.cxx29
-rw-r--r--sw/source/ui/dbui/mmgreetingspage.hxx52
-rw-r--r--sw/source/ui/dbui/mmlayoutpage.cxx18
-rw-r--r--sw/source/ui/dbui/mmlayoutpage.hxx23
-rw-r--r--sw/source/ui/dbui/mmmergepage.cxx19
-rw-r--r--sw/source/ui/dbui/mmmergepage.hxx18
-rw-r--r--sw/source/ui/dbui/mmoutputpage.cxx116
-rw-r--r--sw/source/ui/dbui/mmoutputpage.hxx88
-rw-r--r--sw/source/ui/dbui/mmoutputtypepage.cxx48
-rw-r--r--sw/source/ui/dbui/mmoutputtypepage.hxx12
-rw-r--r--sw/source/ui/dbui/mmpreparemergepage.cxx18
-rw-r--r--sw/source/ui/dbui/mmpreparemergepage.hxx18
-rw-r--r--sw/source/ui/dbui/selectdbtabledialog.cxx13
-rw-r--r--sw/source/ui/dbui/selectdbtabledialog.hxx5
-rw-r--r--sw/source/ui/dialog/abstract.cxx12
-rw-r--r--sw/source/ui/dialog/ascfldlg.cxx21
-rw-r--r--sw/source/ui/dialog/docstdlg.cxx23
-rw-r--r--sw/source/ui/dialog/swdlgfact.cxx145
-rw-r--r--sw/source/ui/dialog/swdlgfact.hxx5
-rw-r--r--sw/source/ui/dialog/swmessdialog.cxx15
-rw-r--r--sw/source/ui/dialog/swuiexp.cxx25
-rw-r--r--sw/source/ui/dialog/uiregionsw.cxx134
-rw-r--r--sw/source/ui/dialog/wordcountdialog.cxx19
-rw-r--r--sw/source/ui/dochdl/selglos.cxx11
-rw-r--r--sw/source/ui/envelp/envfmt.cxx27
-rw-r--r--sw/source/ui/envelp/envfmt.hxx27
-rw-r--r--sw/source/ui/envelp/envlop1.cxx24
-rw-r--r--sw/source/ui/envelp/envprt.cxx23
-rw-r--r--sw/source/ui/envelp/envprt.hxx23
-rw-r--r--sw/source/ui/envelp/label1.cxx130
-rw-r--r--sw/source/ui/envelp/labfmt.cxx51
-rw-r--r--sw/source/ui/envelp/labfmt.hxx46
-rw-r--r--sw/source/ui/envelp/labprt.cxx23
-rw-r--r--sw/source/ui/envelp/labprt.hxx28
-rw-r--r--sw/source/ui/envelp/mailmrge.cxx60
-rw-r--r--sw/source/ui/envelp/swuilabimp.hxx131
-rw-r--r--sw/source/ui/fldui/DropDownFieldDialog.cxx14
-rw-r--r--sw/source/ui/fldui/changedb.cxx12
-rw-r--r--sw/source/ui/fldui/flddb.cxx24
-rw-r--r--sw/source/ui/fldui/flddb.hxx27
-rw-r--r--sw/source/ui/fldui/flddinf.cxx18
-rw-r--r--sw/source/ui/fldui/flddinf.hxx15
-rw-r--r--sw/source/ui/fldui/flddok.cxx27
-rw-r--r--sw/source/ui/fldui/flddok.hxx31
-rw-r--r--sw/source/ui/fldui/fldedt.cxx28
-rw-r--r--sw/source/ui/fldui/fldfunc.cxx37
-rw-r--r--sw/source/ui/fldui/fldfunc.hxx53
-rw-r--r--sw/source/ui/fldui/fldref.cxx21
-rw-r--r--sw/source/ui/fldui/fldref.hxx21
-rw-r--r--sw/source/ui/fldui/fldvar.cxx28
-rw-r--r--sw/source/ui/fldui/fldvar.hxx35
-rw-r--r--sw/source/ui/fldui/inpdlg.cxx14
-rw-r--r--sw/source/ui/fldui/javaedit.cxx16
-rw-r--r--sw/source/ui/fmtui/tmpdlg.cxx12
-rw-r--r--sw/source/ui/frmdlg/column.cxx45
-rw-r--r--sw/source/ui/frmdlg/cption.cxx67
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx117
-rw-r--r--sw/source/ui/frmdlg/wrap.cxx26
-rw-r--r--sw/source/ui/index/cnttab.cxx304
-rw-r--r--sw/source/ui/index/multmrk.cxx13
-rw-r--r--sw/source/ui/index/swuiidxmrk.cxx59
-rw-r--r--sw/source/ui/misc/bookmark.cxx9
-rw-r--r--sw/source/ui/misc/docfnote.cxx39
-rw-r--r--sw/source/ui/misc/glosbib.cxx16
-rw-r--r--sw/source/ui/misc/glossary.cxx61
-rw-r--r--sw/source/ui/misc/impfnote.hxx39
-rw-r--r--sw/source/ui/misc/insfnote.cxx17
-rw-r--r--sw/source/ui/misc/linenum.cxx22
-rw-r--r--sw/source/ui/misc/num.cxx52
-rw-r--r--sw/source/ui/misc/outline.cxx55
-rw-r--r--sw/source/ui/misc/pgfnote.cxx20
-rw-r--r--sw/source/ui/misc/pggrid.cxx35
-rw-r--r--sw/source/ui/misc/srtdlg.cxx35
-rw-r--r--sw/source/ui/misc/swmodalredlineacceptdlg.cxx6
-rw-r--r--sw/source/ui/misc/titlepage.cxx18
-rw-r--r--sw/source/ui/table/colwd.cxx12
-rw-r--r--sw/source/ui/table/convert.cxx20
-rw-r--r--sw/source/ui/table/instable.cxx17
-rw-r--r--sw/source/ui/table/mergetbl.cxx12
-rw-r--r--sw/source/ui/table/rowht.cxx12
-rw-r--r--sw/source/ui/table/splittbl.cxx14
-rw-r--r--sw/source/ui/table/tabledlg.cxx90
-rw-r--r--sw/source/ui/table/tautofmt.cxx103
-rw-r--r--sw/source/ui/utlui/swrenamexnameddlg.cxx12
-rw-r--r--sw/source/uibase/app/appopt.cxx4
-rw-r--r--sw/source/uibase/app/docsh2.cxx16
-rw-r--r--sw/source/uibase/app/docst.cxx3
-rw-r--r--sw/source/uibase/dbui/dbmgr.cxx16
-rw-r--r--sw/source/uibase/dbui/dbtree.cxx8
-rw-r--r--sw/source/uibase/dbui/dbui.cxx36
-rw-r--r--sw/source/uibase/dbui/mailmergechildwindow.cxx15
-rw-r--r--sw/source/uibase/dbui/mailmergehelper.cxx49
-rw-r--r--sw/source/uibase/dochdl/swdtflvr.cxx6
-rw-r--r--sw/source/uibase/docvw/AnnotationMenuButton.cxx6
-rw-r--r--sw/source/uibase/docvw/AnnotationMenuButton.hxx1
-rw-r--r--sw/source/uibase/docvw/AnnotationWin.cxx10
-rw-r--r--sw/source/uibase/docvw/FrameControlsManager.cxx5
-rw-r--r--sw/source/uibase/docvw/HeaderFooterWin.cxx10
-rw-r--r--sw/source/uibase/docvw/PageBreakWin.cxx17
-rw-r--r--sw/source/uibase/docvw/PostItMgr.cxx14
-rw-r--r--sw/source/uibase/docvw/SidebarTxtControl.cxx6
-rw-r--r--sw/source/uibase/docvw/SidebarTxtControl.hxx1
-rw-r--r--sw/source/uibase/docvw/SidebarWin.cxx35
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx24
-rw-r--r--sw/source/uibase/docvw/frmsidebarwincontainer.cxx2
-rw-r--r--sw/source/uibase/docvw/srcedtw.cxx21
-rw-r--r--sw/source/uibase/envelp/syncbtn.cxx15
-rw-r--r--sw/source/uibase/frmdlg/colex.cxx6
-rw-r--r--sw/source/uibase/inc/DropDownFieldDialog.hxx10
-rw-r--r--sw/source/uibase/inc/FrameControl.hxx2
-rw-r--r--sw/source/uibase/inc/FrameControlsManager.hxx5
-rw-r--r--sw/source/uibase/inc/HeaderFooterWin.hxx5
-rw-r--r--sw/source/uibase/inc/PageBreakWin.hxx3
-rw-r--r--sw/source/uibase/inc/abstract.hxx8
-rw-r--r--sw/source/uibase/inc/ascfldlg.hxx17
-rw-r--r--sw/source/uibase/inc/bookmark.hxx7
-rw-r--r--sw/source/uibase/inc/break.hxx15
-rw-r--r--sw/source/uibase/inc/changedb.hxx11
-rw-r--r--sw/source/uibase/inc/chrdlg.hxx27
-rw-r--r--sw/source/uibase/inc/colex.hxx1
-rw-r--r--sw/source/uibase/inc/column.hxx63
-rw-r--r--sw/source/uibase/inc/conttree.hxx8
-rw-r--r--sw/source/uibase/inc/convert.hxx29
-rw-r--r--sw/source/uibase/inc/cption.hxx31
-rw-r--r--sw/source/uibase/inc/dbinsdlg.hxx51
-rw-r--r--sw/source/uibase/inc/dbtree.hxx1
-rw-r--r--sw/source/uibase/inc/dbui.hxx18
-rw-r--r--sw/source/uibase/inc/docstdlg.hxx25
-rw-r--r--sw/source/uibase/inc/drawbase.hxx2
-rw-r--r--sw/source/uibase/inc/drpcps.hxx36
-rw-r--r--sw/source/uibase/inc/edtwin.hxx2
-rw-r--r--sw/source/uibase/inc/envlop.hxx27
-rw-r--r--sw/source/uibase/inc/fldedt.hxx9
-rw-r--r--sw/source/uibase/inc/fldmgr.hxx3
-rw-r--r--sw/source/uibase/inc/formedt.hxx35
-rw-r--r--sw/source/uibase/inc/frmpage.hxx183
-rw-r--r--sw/source/uibase/inc/glosbib.hxx13
-rw-r--r--sw/source/uibase/inc/glossary.hxx25
-rw-r--r--sw/source/uibase/inc/inpdlg.hxx10
-rw-r--r--sw/source/uibase/inc/inputwin.hxx9
-rw-r--r--sw/source/uibase/inc/insfnote.hxx21
-rw-r--r--sw/source/uibase/inc/instable.hxx23
-rw-r--r--sw/source/uibase/inc/javaedit.hxx21
-rw-r--r--sw/source/uibase/inc/label.hxx3
-rw-r--r--sw/source/uibase/inc/linenum.hxx31
-rw-r--r--sw/source/uibase/inc/mailconfigpage.hxx25
-rw-r--r--sw/source/uibase/inc/mailmergechildwindow.hxx4
-rw-r--r--sw/source/uibase/inc/mailmergehelper.hxx6
-rw-r--r--sw/source/uibase/inc/mailmergewizard.hxx2
-rw-r--r--sw/source/uibase/inc/mailmrge.hxx90
-rw-r--r--sw/source/uibase/inc/mergetbl.hxx4
-rw-r--r--sw/source/uibase/inc/multmrk.hxx5
-rw-r--r--sw/source/uibase/inc/navipi.hxx17
-rw-r--r--sw/source/uibase/inc/num.hxx53
-rw-r--r--sw/source/uibase/inc/numberingtypelistbox.hxx1
-rw-r--r--sw/source/uibase/inc/numfmtlb.hxx1
-rw-r--r--sw/source/uibase/inc/numpara.hxx37
-rw-r--r--sw/source/uibase/inc/optcomp.hxx11
-rw-r--r--sw/source/uibase/inc/optload.hxx79
-rw-r--r--sw/source/uibase/inc/optpage.hxx310
-rw-r--r--sw/source/uibase/inc/outline.hxx36
-rw-r--r--sw/source/uibase/inc/pgfnote.hxx29
-rw-r--r--sw/source/uibase/inc/pggrid.hxx51
-rw-r--r--sw/source/uibase/inc/prcntfld.hxx2
-rw-r--r--sw/source/uibase/inc/pview.hxx14
-rw-r--r--sw/source/uibase/inc/redlndlg.hxx12
-rw-r--r--sw/source/uibase/inc/regionsw.hxx136
-rw-r--r--sw/source/uibase/inc/rowht.hxx6
-rw-r--r--sw/source/uibase/inc/selglos.hxx5
-rw-r--r--sw/source/uibase/inc/shdwcrsr.hxx2
-rw-r--r--sw/source/uibase/inc/splittbl.hxx10
-rw-r--r--sw/source/uibase/inc/srcedtw.hxx7
-rw-r--r--sw/source/uibase/inc/srcview.hxx6
-rw-r--r--sw/source/uibase/inc/srtdlg.hxx51
-rw-r--r--sw/source/uibase/inc/swmessdialog.hxx12
-rw-r--r--sw/source/uibase/inc/swmodalredlineacceptdlg.hxx1
-rw-r--r--sw/source/uibase/inc/swrenamexnameddlg.hxx6
-rw-r--r--sw/source/uibase/inc/swruler.hxx5
-rw-r--r--sw/source/uibase/inc/swuiccoll.hxx23
-rw-r--r--sw/source/uibase/inc/swuicnttab.hxx228
-rw-r--r--sw/source/uibase/inc/swuiidxmrk.hxx90
-rw-r--r--sw/source/uibase/inc/syncbtn.hxx4
-rw-r--r--sw/source/uibase/inc/tautofmt.hxx27
-rw-r--r--sw/source/uibase/inc/tblctrl.hxx2
-rw-r--r--sw/source/uibase/inc/tbxanchr.hxx2
-rw-r--r--sw/source/uibase/inc/titlepage.hxx25
-rw-r--r--sw/source/uibase/inc/unotools.hxx2
-rw-r--r--sw/source/uibase/inc/view.hxx28
-rw-r--r--sw/source/uibase/inc/wordcountdialog.hxx27
-rw-r--r--sw/source/uibase/inc/workctrl.hxx19
-rw-r--r--sw/source/uibase/inc/wrap.hxx33
-rw-r--r--sw/source/uibase/lingu/olmenu.cxx6
-rw-r--r--sw/source/uibase/misc/glshell.cxx2
-rw-r--r--sw/source/uibase/misc/numberingtypelistbox.cxx6
-rw-r--r--sw/source/uibase/misc/redlndlg.cxx31
-rw-r--r--sw/source/uibase/misc/swruler.cxx45
-rw-r--r--sw/source/uibase/ribbar/inputwin.cxx81
-rw-r--r--sw/source/uibase/ribbar/tblctrl.cxx2
-rw-r--r--sw/source/uibase/ribbar/tbxanchr.cxx2
-rw-r--r--sw/source/uibase/ribbar/workctrl.cxx39
-rw-r--r--sw/source/uibase/shells/grfsh.cxx8
-rw-r--r--sw/source/uibase/shells/tabsh.cxx4
-rw-r--r--sw/source/uibase/shells/textsh1.cxx20
-rw-r--r--sw/source/uibase/shells/txtattr.cxx1
-rw-r--r--sw/source/uibase/shells/txtcrsr.cxx1
-rw-r--r--sw/source/uibase/sidebar/PageColumnControl.cxx15
-rw-r--r--sw/source/uibase/sidebar/PageColumnControl.hxx5
-rw-r--r--sw/source/uibase/sidebar/PageMarginControl.cxx149
-rw-r--r--sw/source/uibase/sidebar/PageMarginControl.hxx29
-rw-r--r--sw/source/uibase/sidebar/PageOrientationControl.cxx8
-rw-r--r--sw/source/uibase/sidebar/PageOrientationControl.hxx3
-rw-r--r--sw/source/uibase/sidebar/PagePropertyPanel.cxx61
-rw-r--r--sw/source/uibase/sidebar/PagePropertyPanel.hxx21
-rw-r--r--sw/source/uibase/sidebar/PageSizeControl.cxx46
-rw-r--r--sw/source/uibase/sidebar/PageSizeControl.hxx7
-rw-r--r--sw/source/uibase/sidebar/StylePresetsPanel.cxx12
-rw-r--r--sw/source/uibase/sidebar/StylePresetsPanel.hxx5
-rw-r--r--sw/source/uibase/sidebar/SwPanelFactory.cxx12
-rw-r--r--sw/source/uibase/sidebar/ThemePanel.cxx14
-rw-r--r--sw/source/uibase/sidebar/ThemePanel.hxx9
-rw-r--r--sw/source/uibase/sidebar/WrapPropertyPanel.cxx30
-rw-r--r--sw/source/uibase/sidebar/WrapPropertyPanel.hxx22
-rw-r--r--sw/source/uibase/table/tablepg.hxx93
-rw-r--r--sw/source/uibase/uiview/pview.cxx49
-rw-r--r--sw/source/uibase/uiview/srcview.cxx66
-rw-r--r--sw/source/uibase/uiview/view.cxx22
-rw-r--r--sw/source/uibase/uiview/view2.cxx46
-rw-r--r--sw/source/uibase/uiview/viewdraw.cxx6
-rw-r--r--sw/source/uibase/uiview/viewfunc.hxx2
-rw-r--r--sw/source/uibase/uiview/viewling.cxx41
-rw-r--r--sw/source/uibase/uiview/viewmdi.cxx16
-rw-r--r--sw/source/uibase/uiview/viewprt.cxx23
-rw-r--r--sw/source/uibase/uno/SwXDocumentSettings.cxx13
-rw-r--r--sw/source/uibase/uno/SwXDocumentSettings.hxx2
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx16
-rw-r--r--sw/source/uibase/utlui/content.cxx31
-rw-r--r--sw/source/uibase/utlui/glbltree.cxx22
-rw-r--r--sw/source/uibase/utlui/gloslst.cxx33
-rw-r--r--sw/source/uibase/utlui/navipi.cxx348
-rw-r--r--sw/source/uibase/utlui/numfmtlb.cxx6
-rw-r--r--sw/source/uibase/utlui/unotools.cxx16
-rw-r--r--toolkit/source/awt/animatedimagespeer.cxx39
-rw-r--r--toolkit/source/awt/scrollabledialog.cxx47
-rw-r--r--toolkit/source/awt/vclxaccessiblecomponent.cxx21
-rw-r--r--toolkit/source/awt/vclxdevice.cxx25
-rw-r--r--toolkit/source/awt/vclxprinter.cxx2
-rw-r--r--toolkit/source/awt/vclxspinbutton.cxx2
-rw-r--r--toolkit/source/awt/vclxtabpagecontainer.cxx31
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx130
-rw-r--r--toolkit/source/awt/vclxwindow.cxx9
-rw-r--r--toolkit/source/awt/vclxwindows.cxx515
-rw-r--r--toolkit/source/controls/accessiblecontrolcontext.cxx11
-rw-r--r--toolkit/source/helper/unowrapper.cxx28
-rw-r--r--toolkit/source/helper/vclunohelper.cxx12
-rw-r--r--tools/source/ref/errinf.cxx29
-rw-r--r--uui/source/authfallbackdlg.cxx15
-rw-r--r--uui/source/authfallbackdlg.hxx12
-rw-r--r--uui/source/fltdlg.cxx16
-rw-r--r--uui/source/fltdlg.hxx6
-rw-r--r--uui/source/iahndl-authentication.cxx22
-rw-r--r--uui/source/iahndl-errorhandler.cxx12
-rw-r--r--uui/source/iahndl-filter.cxx3
-rw-r--r--uui/source/iahndl-locking.cxx18
-rw-r--r--uui/source/iahndl-ssl.cxx6
-rw-r--r--uui/source/iahndl.cxx22
-rw-r--r--uui/source/logindlg.cxx25
-rw-r--r--uui/source/logindlg.hxx32
-rw-r--r--uui/source/masterpasscrtdlg.cxx17
-rw-r--r--uui/source/masterpasscrtdlg.hxx8
-rw-r--r--uui/source/masterpassworddlg.cxx16
-rw-r--r--uui/source/masterpassworddlg.hxx6
-rw-r--r--uui/source/nameclashdlg.cxx19
-rw-r--r--uui/source/nameclashdlg.hxx12
-rw-r--r--uui/source/passworddlg.cxx23
-rw-r--r--uui/source/passworddlg.hxx12
-rw-r--r--uui/source/secmacrowarnings.cxx15
-rw-r--r--uui/source/secmacrowarnings.hxx19
-rw-r--r--uui/source/unknownauthdlg.cxx14
-rw-r--r--uui/source/unknownauthdlg.hxx10
-rw-r--r--vcl/CppunitTest_vcl_lifecycle.mk52
-rw-r--r--vcl/Module_vcl.mk1
-rw-r--r--vcl/README.lifecycle261
-rw-r--r--vcl/generic/print/genprnpsp.cxx22
-rw-r--r--vcl/generic/print/prtsetup.cxx50
-rw-r--r--vcl/generic/print/prtsetup.hxx43
-rw-r--r--vcl/inc/brdwin.hxx19
-rw-r--r--vcl/inc/controldata.hxx2
-rw-r--r--vcl/inc/dndevdis.hxx4
-rw-r--r--vcl/inc/helpwin.hxx7
-rw-r--r--vcl/inc/ilstbox.hxx115
-rw-r--r--vcl/inc/outdev.h3
-rw-r--r--vcl/inc/printdlg.hxx118
-rw-r--r--vcl/inc/salframe.hxx9
-rw-r--r--vcl/inc/svdata.hxx67
-rw-r--r--vcl/inc/toolbox.h2
-rw-r--r--vcl/inc/unx/i18n_status.hxx3
-rw-r--r--vcl/inc/window.h65
-rw-r--r--vcl/osx/a11ylistener.cxx2
-rw-r--r--vcl/osx/salprn.cxx2
-rw-r--r--vcl/qa/cppunit/complextext.cxx6
-rw-r--r--vcl/qa/cppunit/lifecycle.cxx150
-rw-r--r--vcl/qa/cppunit/outdev.cxx30
-rw-r--r--vcl/quartz/cairo_quartz_cairo.cxx6
-rw-r--r--vcl/quartz/cairo_quartz_cairo.hxx2
-rw-r--r--vcl/source/app/dbggui.cxx163
-rw-r--r--vcl/source/app/help.cxx20
-rw-r--r--vcl/source/app/salvtables.cxx9
-rw-r--r--vcl/source/app/stdtext.cxx4
-rw-r--r--vcl/source/app/svapp.cxx39
-rw-r--r--vcl/source/app/svdata.cxx18
-rw-r--r--vcl/source/app/svmain.cxx6
-rw-r--r--vcl/source/app/vclevent.cxx9
-rw-r--r--vcl/source/control/button.cxx64
-rw-r--r--vcl/source/control/combobox.cxx84
-rw-r--r--vcl/source/control/ctrl.cxx18
-rw-r--r--vcl/source/control/edit.cxx26
-rw-r--r--vcl/source/control/field.cxx24
-rw-r--r--vcl/source/control/field2.cxx24
-rw-r--r--vcl/source/control/fixed.cxx15
-rw-r--r--vcl/source/control/fixedhyper.cxx4
-rw-r--r--vcl/source/control/ilstbox.cxx113
-rw-r--r--vcl/source/control/longcurr.cxx8
-rw-r--r--vcl/source/control/lstbox.cxx96
-rw-r--r--vcl/source/control/menubtn.cxx6
-rw-r--r--vcl/source/control/morebtn.cxx8
-rw-r--r--vcl/source/control/prgsbar.cxx4
-rw-r--r--vcl/source/control/scrbar.cxx8
-rw-r--r--vcl/source/control/spinbtn.cxx4
-rw-r--r--vcl/source/control/spinfld.cxx15
-rw-r--r--vcl/source/control/tabctrl.cxx38
-rw-r--r--vcl/source/control/throbber.cxx6
-rw-r--r--vcl/source/edit/texteng.cxx2
-rw-r--r--vcl/source/edit/textview.cxx9
-rw-r--r--vcl/source/edit/vclmedit.cxx64
-rw-r--r--vcl/source/filter/graphicfilter.cxx16
-rw-r--r--vcl/source/filter/sgfbram.cxx14
-rw-r--r--vcl/source/filter/sgvmain.cxx4
-rw-r--r--vcl/source/filter/sgvtext.cxx16
-rw-r--r--vcl/source/filter/wmf/emfwr.cxx114
-rw-r--r--vcl/source/filter/wmf/emfwr.hxx5
-rw-r--r--vcl/source/filter/wmf/winmtf.cxx43
-rw-r--r--vcl/source/filter/wmf/wmfwr.cxx2
-rw-r--r--vcl/source/filter/wmf/wmfwr.hxx2
-rw-r--r--vcl/source/gdi/animate.cxx6
-rw-r--r--vcl/source/gdi/bitmapex.cxx14
-rw-r--r--vcl/source/gdi/cvtsvm.cxx26
-rw-r--r--vcl/source/gdi/gdimetafiletools.cxx20
-rw-r--r--vcl/source/gdi/gdimtf.cxx180
-rw-r--r--vcl/source/gdi/impanmvw.cxx22
-rw-r--r--vcl/source/gdi/impanmvw.hxx6
-rw-r--r--vcl/source/gdi/impgraph.cxx16
-rw-r--r--vcl/source/gdi/impvect.cxx4
-rw-r--r--vcl/source/gdi/oldprintadaptor.cxx6
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx16
-rw-r--r--vcl/source/gdi/pdfwriter_impl.hxx2
-rw-r--r--vcl/source/gdi/pdfwriter_impl2.cxx6
-rw-r--r--vcl/source/gdi/print.cxx19
-rw-r--r--vcl/source/gdi/print2.cxx94
-rw-r--r--vcl/source/gdi/print3.cxx37
-rw-r--r--vcl/source/gdi/virdev.cxx13
-rw-r--r--vcl/source/helper/lazydelete.cxx13
-rw-r--r--vcl/source/opengl/OpenGLContext.cxx13
-rw-r--r--vcl/source/outdev/bitmap.cxx10
-rw-r--r--vcl/source/outdev/font.cxx5
-rw-r--r--vcl/source/outdev/map.cxx6
-rw-r--r--vcl/source/outdev/outdev.cxx31
-rw-r--r--vcl/source/outdev/outdevstate.cxx1
-rw-r--r--vcl/source/outdev/text.cxx58
-rw-r--r--vcl/source/outdev/transparent.cxx16
-rw-r--r--vcl/source/outdev/wallpaper.cxx10
-rw-r--r--vcl/source/uipreviewer/previewer.cxx5
-rw-r--r--vcl/source/window/accel.cxx1
-rw-r--r--vcl/source/window/accessibility.cxx7
-rw-r--r--vcl/source/window/brdwin.cxx18
-rw-r--r--vcl/source/window/btndlg.cxx40
-rw-r--r--vcl/source/window/builder.cxx78
-rw-r--r--vcl/source/window/clipping.cxx10
-rw-r--r--vcl/source/window/cursor.cxx4
-rw-r--r--vcl/source/window/decoview.cxx2
-rw-r--r--vcl/source/window/dialog.cxx51
-rw-r--r--vcl/source/window/dlgctrl.cxx20
-rw-r--r--vcl/source/window/dndevdis.cxx6
-rw-r--r--vcl/source/window/dockingarea.cxx6
-rw-r--r--vcl/source/window/dockmgr.cxx43
-rw-r--r--vcl/source/window/dockwin.cxx43
-rw-r--r--vcl/source/window/event.cxx28
-rw-r--r--vcl/source/window/floatwin.cxx40
-rw-r--r--vcl/source/window/introwin.cxx11
-rw-r--r--vcl/source/window/layout.cxx136
-rw-r--r--vcl/source/window/menu.cxx29
-rw-r--r--vcl/source/window/menubarwindow.cxx135
-rw-r--r--vcl/source/window/menubarwindow.hxx28
-rw-r--r--vcl/source/window/menufloatingwindow.cxx11
-rw-r--r--vcl/source/window/menufloatingwindow.hxx3
-rw-r--r--vcl/source/window/mouse.cxx28
-rw-r--r--vcl/source/window/msgbox.cxx29
-rw-r--r--vcl/source/window/openglwin.cxx14
-rw-r--r--vcl/source/window/paint.cxx6
-rw-r--r--vcl/source/window/popupmenuwindow.cxx6
-rw-r--r--vcl/source/window/printdlg.cxx137
-rw-r--r--vcl/source/window/scrwnd.cxx8
-rw-r--r--vcl/source/window/scrwnd.hxx3
-rw-r--r--vcl/source/window/settings.cxx8
-rw-r--r--vcl/source/window/split.cxx15
-rw-r--r--vcl/source/window/splitwin.cxx15
-rw-r--r--vcl/source/window/stacking.cxx45
-rw-r--r--vcl/source/window/status.cxx12
-rw-r--r--vcl/source/window/syschild.cxx8
-rw-r--r--vcl/source/window/syswin.cxx35
-rw-r--r--vcl/source/window/tabdlg.cxx11
-rw-r--r--vcl/source/window/tabpage.cxx11
-rw-r--r--vcl/source/window/taskpanelist.cxx19
-rw-r--r--vcl/source/window/toolbox.cxx34
-rw-r--r--vcl/source/window/toolbox2.cxx18
-rw-r--r--vcl/source/window/window.cxx178
-rw-r--r--vcl/source/window/window2.cxx116
-rw-r--r--vcl/source/window/winproc.cxx17
-rw-r--r--vcl/source/window/wrkwin.cxx8
-rw-r--r--vcl/unx/generic/app/i18n_status.cxx81
-rw-r--r--vcl/unx/generic/gdi/cairo_xlib_cairo.cxx6
-rw-r--r--vcl/unx/generic/gdi/cairo_xlib_cairo.hxx2
-rw-r--r--vcl/unx/generic/printer/cupsmgr.cxx30
-rw-r--r--vcl/unx/gtk/a11y/atkutil.cxx2
-rw-r--r--vcl/unx/gtk3/gdi/cairo_gtk3_cairo.cxx4
-rw-r--r--vcl/unx/gtk3/gdi/cairo_gtk3_cairo.hxx2
-rw-r--r--vcl/unx/x11/x11sys.cxx12
-rw-r--r--vcl/win/source/gdi/cairo_win32_cairo.cxx8
-rw-r--r--vcl/win/source/gdi/cairo_win32_cairo.hxx2
-rw-r--r--vcl/workben/icontest.cxx9
-rw-r--r--vcl/workben/mtfdemo.cxx4
-rw-r--r--vcl/workben/outdevgrind.cxx5
-rw-r--r--vcl/workben/svdem.cxx6
-rw-r--r--vcl/workben/svpclient.cxx77
-rw-r--r--vcl/workben/svptest.cxx7
-rw-r--r--vcl/workben/vcldemo.cxx97
-rw-r--r--writerperfect/source/writer/WordPerfectImportFilter.cxx16
-rw-r--r--xmlsecurity/inc/xmlsecurity/certificatechooser.hxx7
-rw-r--r--xmlsecurity/inc/xmlsecurity/certificateviewer.hxx41
-rw-r--r--xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx37
-rw-r--r--xmlsecurity/inc/xmlsecurity/macrosecurity.hxx42
-rw-r--r--xmlsecurity/source/component/documentdigitalsignatures.cxx33
-rw-r--r--xmlsecurity/source/dialogs/certificatechooser.cxx16
-rw-r--r--xmlsecurity/source/dialogs/certificateviewer.cxx78
-rw-r--r--xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx39
-rw-r--r--xmlsecurity/source/dialogs/macrosecurity.cxx65
2632 files changed, 41659 insertions, 24794 deletions
diff --git a/UnoControls/source/controls/progressmonitor.cxx b/UnoControls/source/controls/progressmonitor.cxx
index e752b006031e..709ea0fe207b 100644
--- a/UnoControls/source/controls/progressmonitor.cxx
+++ b/UnoControls/source/controls/progressmonitor.cxx
@@ -57,7 +57,7 @@ ProgressMonitor::ProgressMonitor( const css::uno::Reference< XComponentContext >
m_xTopic_Bottom = css::uno::Reference< XFixedText > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_SERVICENAME, rxContext ), UNO_QUERY );
m_xText_Bottom = css::uno::Reference< XFixedText > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_SERVICENAME, rxContext ), UNO_QUERY );
m_xButton = css::uno::Reference< XButton > ( rxContext->getServiceManager()->createInstanceWithContext( BUTTON_SERVICENAME, rxContext ), UNO_QUERY );
- m_xProgressBar = new ProgressBar(rxContext);
+ m_xProgressBar = VclPtr<ProgressBar>::Create(rxContext);
// ... cast controls to Reference< XControl > (for "setModel"!) ...
css::uno::Reference< XControl > xRef_Topic_Top ( m_xTopic_Top , UNO_QUERY );
diff --git a/UnoControls/source/controls/statusindicator.cxx b/UnoControls/source/controls/statusindicator.cxx
index 240d148743a9..f4e54570f23c 100644
--- a/UnoControls/source/controls/statusindicator.cxx
+++ b/UnoControls/source/controls/statusindicator.cxx
@@ -47,7 +47,7 @@ StatusIndicator::StatusIndicator( const css::uno::Reference< XComponentContext >
// Create instances for fixedtext and progress ...
m_xText = css::uno::Reference< XFixedText > ( rxContext->getServiceManager()->createInstanceWithContext( FIXEDTEXT_SERVICENAME, rxContext ), UNO_QUERY );
- m_xProgressBar = new ProgressBar(rxContext);
+ m_xProgressBar = VclPtr<ProgressBar>::Create(rxContext);
// ... cast controls to css::uno::Reference< XControl > and set model ...
// ( ProgressBar has no model !!! )
css::uno::Reference< XControl > xTextControl ( m_xText , UNO_QUERY );
diff --git a/UnoControls/source/inc/progressbar.hxx b/UnoControls/source/inc/progressbar.hxx
index 11994533af19..2b1dee2de696 100644
--- a/UnoControls/source/inc/progressbar.hxx
+++ b/UnoControls/source/inc/progressbar.hxx
@@ -23,6 +23,8 @@
#include <com/sun/star/lang/XServiceName.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <vcl/vclptr.hxx>
+
#include "basecontrol.hxx"
// namespaces
diff --git a/accessibility/inc/accessibility/extended/accessibleiconchoicectrl.hxx b/accessibility/inc/accessibility/extended/accessibleiconchoicectrl.hxx
index 92c8cc3087b7..9fc58e200b6b 100644
--- a/accessibility/inc/accessibility/extended/accessibleiconchoicectrl.hxx
+++ b/accessibility/inc/accessibility/extended/accessibleiconchoicectrl.hxx
@@ -30,11 +30,8 @@
class SvtIconChoiceCtrl;
-
namespace accessibility
{
-
-
typedef ::cppu::ImplHelper2< ::com::sun::star::accessibility::XAccessible
, ::com::sun::star::accessibility::XAccessibleSelection> AccessibleIconChoiceCtrl_BASE;
@@ -55,7 +52,8 @@ namespace accessibility
virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) SAL_OVERRIDE;
virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) SAL_OVERRIDE;
- SvtIconChoiceCtrl* getCtrl();
+ VclPtr< SvtIconChoiceCtrl > getCtrl();
+
public:
/** OAccessibleBase needs a valid view
@param _rIconCtrl
diff --git a/accessibility/inc/accessibility/extended/accessibleiconchoicectrlentry.hxx b/accessibility/inc/accessibility/extended/accessibleiconchoicectrlentry.hxx
index da1a386b1643..b56ca82df4a8 100644
--- a/accessibility/inc/accessibility/extended/accessibleiconchoicectrlentry.hxx
+++ b/accessibility/inc/accessibility/extended/accessibleiconchoicectrlentry.hxx
@@ -35,6 +35,7 @@
#include <comphelper/broadcasthelper.hxx>
#include <comphelper/accessibletexthelper.hxx>
#include <tools/gen.hxx>
+#include <vcl/vclptr.hxx>
// forward
@@ -63,7 +64,7 @@ namespace accessibility
{
private:
/** The treelistbox control */
- SvtIconChoiceCtrl* m_pIconCtrl;
+ VclPtr<SvtIconChoiceCtrl> m_pIconCtrl;
sal_Int32 m_nIndex;
protected:
diff --git a/accessibility/inc/accessibility/extended/accessiblelistbox.hxx b/accessibility/inc/accessibility/extended/accessiblelistbox.hxx
index 3032a8b9b578..ac5bbe69c157 100644
--- a/accessibility/inc/accessibility/extended/accessiblelistbox.hxx
+++ b/accessibility/inc/accessibility/extended/accessiblelistbox.hxx
@@ -62,7 +62,7 @@ namespace accessibility
virtual void ProcessWindowChildEvent( const VclWindowEvent& rVclWindowEvent ) SAL_OVERRIDE;
virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) SAL_OVERRIDE;
- SvTreeListBox* getListBox() const;
+ VclPtr< SvTreeListBox > getListBox() const;
void RemoveChildEntries(SvTreeListEntry*);
diff --git a/accessibility/inc/accessibility/extended/accessibletabbarbase.hxx b/accessibility/inc/accessibility/extended/accessibletabbarbase.hxx
index 81401f177564..ed920c89399d 100644
--- a/accessibility/inc/accessibility/extended/accessibletabbarbase.hxx
+++ b/accessibility/inc/accessibility/extended/accessibletabbarbase.hxx
@@ -22,6 +22,7 @@
#include <comphelper/accessiblecomponenthelper.hxx>
#include <tools/link.hxx>
+#include <vcl/vclptr.hxx>
class TabBar;
class VCLExternalSolarLock;
@@ -57,7 +58,7 @@ private:
protected:
VCLExternalSolarLock* m_pExternalLock;
- TabBar* m_pTabBar;
+ VclPtr<TabBar> m_pTabBar;
};
diff --git a/accessibility/inc/accessibility/extended/accessibletablistbox.hxx b/accessibility/inc/accessibility/extended/accessibletablistbox.hxx
index e5e16809b038..f6e1d416bf30 100644
--- a/accessibility/inc/accessibility/extended/accessibletablistbox.hxx
+++ b/accessibility/inc/accessibility/extended/accessibletablistbox.hxx
@@ -43,7 +43,7 @@ class AccessibleTabListBox
,public ::svt::IAccessibleTabListBox
{
private:
- SvHeaderTabListBox* m_pTabListBox;
+ VclPtr<SvHeaderTabListBox> m_pTabListBox;
public:
/** ctor()
diff --git a/accessibility/inc/accessibility/extended/accessibletablistboxtable.hxx b/accessibility/inc/accessibility/extended/accessibletablistboxtable.hxx
index 272f3fcc7e22..8c47222f2ff2 100644
--- a/accessibility/inc/accessibility/extended/accessibletablistboxtable.hxx
+++ b/accessibility/inc/accessibility/extended/accessibletablistboxtable.hxx
@@ -37,7 +37,7 @@ typedef ::cppu::ImplHelper1< ::com::sun::star::accessibility::XAccessibleSelecti
class AccessibleTabListBoxTable : public AccessibleBrowseBoxTable, public AccessibleTabListBoxTableImplHelper
{
private:
- SvHeaderTabListBox* m_pTabListBox;
+ VclPtr<SvHeaderTabListBox> m_pTabListBox;
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > m_xCurChild;
diff --git a/accessibility/inc/accessibility/extended/listboxaccessible.hxx b/accessibility/inc/accessibility/extended/listboxaccessible.hxx
index fc3bb245b2c4..4ce38c5090b6 100644
--- a/accessibility/inc/accessibility/extended/listboxaccessible.hxx
+++ b/accessibility/inc/accessibility/extended/listboxaccessible.hxx
@@ -22,6 +22,7 @@
#include <com/sun/star/uno/RuntimeException.hpp>
#include <tools/link.hxx>
+#include <vcl/vclptr.hxx>
class SvTreeListBox;
class VclSimpleEvent;
@@ -41,7 +42,7 @@ namespace accessibility
class ListBoxAccessibleBase
{
private:
- SvTreeListBox* m_pWindow;
+ VclPtr<SvTreeListBox> m_pWindow;
protected:
inline SvTreeListBox* getListBox() const
@@ -49,7 +50,7 @@ namespace accessibility
return const_cast< ListBoxAccessibleBase* >( this )->m_pWindow;
}
- inline bool isAlive() const { return NULL != m_pWindow; }
+ inline bool isAlive() const { return nullptr != m_pWindow; }
public:
ListBoxAccessibleBase( SvTreeListBox& _rWindow );
diff --git a/accessibility/inc/accessibility/extended/textwindowaccessibility.hxx b/accessibility/inc/accessibility/extended/textwindowaccessibility.hxx
index 1f2b65c99a8d..d64254608271 100644
--- a/accessibility/inc/accessibility/extended/textwindowaccessibility.hxx
+++ b/accessibility/inc/accessibility/extended/textwindowaccessibility.hxx
@@ -99,7 +99,7 @@ public:
private:
::Link m_aListener;
- vcl::Window * m_pNotifier;
+ VclPtr<vcl::Window> m_pNotifier;
};
class ParagraphInfo
diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblemenubar.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblemenubar.hxx
index 2ca6def7ba42..b6dc89864fec 100644
--- a/accessibility/inc/accessibility/standard/vclxaccessiblemenubar.hxx
+++ b/accessibility/inc/accessibility/standard/vclxaccessiblemenubar.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLEMENUBAR_HXX
#include <accessibility/standard/accessiblemenucomponent.hxx>
+#include <vcl/vclptr.hxx>
class VclSimpleEvent;
class VclWindowEvent;
@@ -34,7 +35,7 @@ namespace vcl { class Window; }
class VCLXAccessibleMenuBar : public OAccessibleMenuComponent
{
protected:
- vcl::Window* m_pWindow;
+ VclPtr<vcl::Window> m_pWindow;
virtual bool IsFocused() SAL_OVERRIDE;
diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblestatusbar.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblestatusbar.hxx
index a07e4502c111..249f5cafa6ec 100644
--- a/accessibility/inc/accessibility/standard/vclxaccessiblestatusbar.hxx
+++ b/accessibility/inc/accessibility/standard/vclxaccessiblestatusbar.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLESTATUSBAR_HXX
#include <toolkit/awt/vclxaccessiblecomponent.hxx>
+#include <vcl/vclptr.hxx>
#include <vector>
@@ -36,7 +37,7 @@ private:
typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > > AccessibleChildren;
AccessibleChildren m_aAccessibleChildren;
- StatusBar* m_pStatusBar;
+ VclPtr<StatusBar> m_pStatusBar;
protected:
void UpdateShowing( sal_Int32 i, bool bShowing );
diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblestatusbaritem.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblestatusbaritem.hxx
index f720374f3af5..0432abc9db7a 100644
--- a/accessibility/inc/accessibility/standard/vclxaccessiblestatusbaritem.hxx
+++ b/accessibility/inc/accessibility/standard/vclxaccessiblestatusbaritem.hxx
@@ -24,7 +24,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <comphelper/accessibletexthelper.hxx>
#include <cppuhelper/implbase2.hxx>
-
+#include <vcl/vclptr.hxx>
class StatusBar;
class VCLExternalSolarLock;
@@ -51,14 +51,14 @@ class VCLXAccessibleStatusBarItem : public AccessibleTextHelper_BASE,
private:
VCLExternalSolarLock* m_pExternalLock;
- StatusBar* m_pStatusBar;
+ VclPtr<StatusBar> m_pStatusBar;
sal_uInt16 m_nItemId;
OUString m_sItemName;
OUString m_sItemText;
- bool m_bShowing;
+ bool m_bShowing;
protected:
- bool IsShowing();
+ bool IsShowing();
void SetShowing( bool bShowing );
void SetItemName( const OUString& sItemName );
OUString GetItemName();
diff --git a/accessibility/inc/accessibility/standard/vclxaccessibletabcontrol.hxx b/accessibility/inc/accessibility/standard/vclxaccessibletabcontrol.hxx
index b4e7b54fd197..358213855df2 100644
--- a/accessibility/inc/accessibility/standard/vclxaccessibletabcontrol.hxx
+++ b/accessibility/inc/accessibility/standard/vclxaccessibletabcontrol.hxx
@@ -22,6 +22,7 @@
#include <toolkit/awt/vclxaccessiblecomponent.hxx>
#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
+#include <vcl/vclptr.hxx>
#include <vector>
@@ -42,7 +43,7 @@ private:
typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > > AccessibleChildren;
AccessibleChildren m_aAccessibleChildren;
- TabControl* m_pTabControl;
+ VclPtr<TabControl> m_pTabControl;
protected:
void UpdateFocused();
diff --git a/accessibility/inc/accessibility/standard/vclxaccessibletabpage.hxx b/accessibility/inc/accessibility/standard/vclxaccessibletabpage.hxx
index 182235a0ad12..8c0aa5dcac5b 100644
--- a/accessibility/inc/accessibility/standard/vclxaccessibletabpage.hxx
+++ b/accessibility/inc/accessibility/standard/vclxaccessibletabpage.hxx
@@ -24,6 +24,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <comphelper/accessibletexthelper.hxx>
#include <cppuhelper/implbase2.hxx>
+#include <vcl/vclptr.hxx>
class TabControl;
@@ -51,7 +52,7 @@ class VCLXAccessibleTabPage : public AccessibleTextHelper_BASE,
private:
VCLExternalSolarLock* m_pExternalLock;
- TabControl* m_pTabControl;
+ VclPtr<TabControl> m_pTabControl;
sal_uInt16 m_nPageId;
bool m_bFocused;
bool m_bSelected;
diff --git a/accessibility/inc/accessibility/standard/vclxaccessibletabpagewindow.hxx b/accessibility/inc/accessibility/standard/vclxaccessibletabpagewindow.hxx
index 0fb8f614bd0c..9393579b6883 100644
--- a/accessibility/inc/accessibility/standard/vclxaccessibletabpagewindow.hxx
+++ b/accessibility/inc/accessibility/standard/vclxaccessibletabpagewindow.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_ACCESSIBILITY_INC_ACCESSIBILITY_STANDARD_VCLXACCESSIBLETABPAGEWINDOW_HXX
#include <toolkit/awt/vclxaccessiblecomponent.hxx>
+#include <vcl/vclptr.hxx>
class TabControl;
@@ -34,8 +35,8 @@ class TabPage;
class VCLXAccessibleTabPageWindow : public VCLXAccessibleComponent
{
private:
- TabControl* m_pTabControl;
- TabPage* m_pTabPage;
+ VclPtr<TabControl> m_pTabControl;
+ VclPtr<TabPage> m_pTabPage;
sal_uInt16 m_nPageId;
protected:
diff --git a/accessibility/inc/accessibility/standard/vclxaccessibletoolboxitem.hxx b/accessibility/inc/accessibility/standard/vclxaccessibletoolboxitem.hxx
index b7d3c15fd3f8..a05f31b89d1f 100644
--- a/accessibility/inc/accessibility/standard/vclxaccessibletoolboxitem.hxx
+++ b/accessibility/inc/accessibility/standard/vclxaccessibletoolboxitem.hxx
@@ -30,6 +30,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/implbase4.hxx>
#include <comphelper/accessibletexthelper.hxx>
+#include <vcl/vclptr.hxx>
class ToolBox;
@@ -46,13 +47,13 @@ class VCLXAccessibleToolBoxItem : public AccessibleTextHelper_BASE,
{
private:
OUString m_sOldName;
- ToolBox* m_pToolBox;
+ VclPtr<ToolBox> m_pToolBox;
VCLExternalSolarLock* m_pExternalLock;
sal_Int32 m_nIndexInParent;
sal_Int16 m_nRole;
- sal_uInt16 m_nItemId;
- bool m_bHasFocus;
- bool m_bIsChecked;
+ sal_uInt16 m_nItemId;
+ bool m_bHasFocus;
+ bool m_bIsChecked;
bool m_bIndeterminate;
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > m_xChild;
@@ -80,9 +81,9 @@ public:
VCLXAccessibleToolBoxItem( ToolBox* _pToolBox, sal_Int32 _nPos );
void SetFocus( bool _bFocus );
- inline bool HasFocus() const { return m_bHasFocus; }
+ inline bool HasFocus() const { return m_bHasFocus; }
void SetChecked( bool _bCheck );
- inline bool IsChecked() const { return m_bIsChecked; }
+ inline bool IsChecked() const { return m_bIsChecked; }
void SetIndeterminate( bool _bIndeterminate );
inline bool IsIndeterminate() const { return m_bIndeterminate; }
inline void ReleaseToolBox() { m_pToolBox = NULL; }
diff --git a/accessibility/source/extended/AccessibleToolPanelDeck.cxx b/accessibility/source/extended/AccessibleToolPanelDeck.cxx
index dfb8ede26120..4f69764bcf29 100644
--- a/accessibility/source/extended/AccessibleToolPanelDeck.cxx
+++ b/accessibility/source/extended/AccessibleToolPanelDeck.cxx
@@ -76,7 +76,7 @@ namespace accessibility
);
void checkDisposed();
- bool isDisposed() const { return m_pPanelDeck == NULL; }
+ bool isDisposed() const { return m_pPanelDeck == nullptr; }
void dispose();
virtual ~AccessibleToolPanelDeck_Impl();
@@ -95,7 +95,7 @@ namespace accessibility
public:
AccessibleToolPanelDeck& m_rAntiImpl;
Reference< XAccessible > m_xAccessibleParent;
- ::svt::ToolPanelDeck* m_pPanelDeck;
+ VclPtr<::svt::ToolPanelDeck> m_pPanelDeck;
Reference< XAccessible > m_xActivePanelAccessible;
};
@@ -141,7 +141,7 @@ namespace accessibility
{
ENSURE_OR_RETURN_VOID( !isDisposed(), "disposed twice" );
m_pPanelDeck->RemoveListener( *this );
- m_pPanelDeck = NULL;
+ m_pPanelDeck.clear();
m_xAccessibleParent.clear();
}
diff --git a/accessibility/source/extended/AccessibleToolPanelDeckTabBar.cxx b/accessibility/source/extended/AccessibleToolPanelDeckTabBar.cxx
index 757c45257c6e..1700aed946b1 100644
--- a/accessibility/source/extended/AccessibleToolPanelDeckTabBar.cxx
+++ b/accessibility/source/extended/AccessibleToolPanelDeckTabBar.cxx
@@ -120,7 +120,7 @@ namespace accessibility
AccessibleToolPanelTabBar& m_rAntiImpl;
Reference< XAccessible > m_xAccessibleParent;
::svt::IToolPanelDeck* m_pPanelDeck;
- ::svt::PanelTabBar* m_pTabBar;
+ VclPtr<::svt::PanelTabBar> m_pTabBar;
::std::vector< Reference< XAccessible > > m_aChildren;
};
@@ -163,7 +163,7 @@ namespace accessibility
m_pTabBar->GetScrollButton( true ).RemoveEventListener( LINK( this, AccessibleToolPanelTabBar_Impl, OnWindowEvent ) );
m_pTabBar->GetScrollButton( false ).RemoveEventListener( LINK( this, AccessibleToolPanelTabBar_Impl, OnWindowEvent ) );
- m_pTabBar = NULL;
+ m_pTabBar.clear();
m_xAccessibleParent.clear();
}
diff --git a/accessibility/source/extended/AccessibleToolPanelDeckTabBarItem.cxx b/accessibility/source/extended/AccessibleToolPanelDeckTabBarItem.cxx
index 33bca93ae759..f89cb3d7f807 100644
--- a/accessibility/source/extended/AccessibleToolPanelDeckTabBarItem.cxx
+++ b/accessibility/source/extended/AccessibleToolPanelDeckTabBarItem.cxx
@@ -105,7 +105,7 @@ namespace accessibility
AccessibleToolPanelDeckTabBarItem& m_rAntiImpl;
Reference< XAccessible > m_xAccessibleParent;
::svt::IToolPanelDeck* m_pPanelDeck;
- ::svt::PanelTabBar* m_pTabBar;
+ VclPtr<::svt::PanelTabBar> m_pTabBar;
size_t m_nItemPos;
};
@@ -139,7 +139,7 @@ namespace accessibility
m_xAccessibleParent.clear();
m_pPanelDeck->RemoveListener( *this );
m_pPanelDeck = NULL;
- m_pTabBar = NULL;
+ m_pTabBar.clear();
}
Reference< XAccessibleComponent > AccessibleToolPanelDeckTabBarItem_Impl::getParentAccessibleComponent() const
diff --git a/accessibility/source/extended/accessibleiconchoicectrl.cxx b/accessibility/source/extended/accessibleiconchoicectrl.cxx
index 5ed05d9c27e1..1d512aa0631c 100644
--- a/accessibility/source/extended/accessibleiconchoicectrl.cxx
+++ b/accessibility/source/extended/accessibleiconchoicectrl.cxx
@@ -367,12 +367,11 @@ namespace accessibility
}
}
- SvtIconChoiceCtrl* AccessibleIconChoiceCtrl::getCtrl()
+ VclPtr< SvtIconChoiceCtrl > AccessibleIconChoiceCtrl::getCtrl()
{
- return static_cast<SvtIconChoiceCtrl*>(GetWindow());
+ return GetAs<SvtIconChoiceCtrl >();
}
-
}// namespace accessibility
diff --git a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx
index 8a5e6efef8ba..811fca30f4b5 100644
--- a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx
+++ b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx
@@ -91,7 +91,7 @@ throw(RuntimeException, std::exception)
if ( _rSource.Source == m_xParent )
{
dispose();
- OSL_ENSURE( !m_xParent.is() && ( NULL == m_pIconCtrl ), "" );
+ OSL_ENSURE( !m_xParent.is() && ( nullptr == m_pIconCtrl ), "" );
}
}
diff --git a/accessibility/source/extended/accessiblelistbox.cxx b/accessibility/source/extended/accessiblelistbox.cxx
index 2c33734abd30..22cc0202e7bb 100644
--- a/accessibility/source/extended/accessiblelistbox.cxx
+++ b/accessibility/source/extended/accessiblelistbox.cxx
@@ -67,11 +67,6 @@ namespace accessibility
IMPLEMENT_FORWARD_XINTERFACE2(AccessibleListBox, VCLXAccessibleComponent, AccessibleListBox_BASE)
IMPLEMENT_FORWARD_XTYPEPROVIDER2(AccessibleListBox, VCLXAccessibleComponent, AccessibleListBox_BASE)
- SvTreeListBox* AccessibleListBox::getListBox() const
- {
- return static_cast< SvTreeListBox* >( GetWindow() );
- }
-
void AccessibleListBox::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
{
if ( isAlive() )
@@ -592,7 +587,10 @@ namespace accessibility
}
}
-
+ VclPtr< SvTreeListBox > AccessibleListBox::getListBox() const
+ {
+ return GetAs< SvTreeListBox >();
+ }
}// namespace accessibility
diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx
index 2dd16ace0380..fbe72a0e9d07 100644
--- a/accessibility/source/extended/textwindowaccessibility.cxx
+++ b/accessibility/source/extended/textwindowaccessibility.cxx
@@ -47,17 +47,17 @@ void SfxListenerGuard::endListening()
void WindowListenerGuard::startListening(vcl::Window & rNotifier)
{
- OSL_ENSURE(m_pNotifier == 0, "called more than once");
+ OSL_ENSURE(m_pNotifier == nullptr, "called more than once");
m_pNotifier = &rNotifier;
m_pNotifier->AddEventListener(m_aListener);
}
void WindowListenerGuard::endListening()
{
- if (m_pNotifier != 0)
+ if (m_pNotifier)
{
m_pNotifier->RemoveEventListener(m_aListener);
- m_pNotifier = 0;
+ m_pNotifier = nullptr;
}
}
diff --git a/accessibility/source/helper/acc_factory.cxx b/accessibility/source/helper/acc_factory.cxx
index 34e29e5f27a7..ef67482170a3 100644
--- a/accessibility/source/helper/acc_factory.cxx
+++ b/accessibility/source/helper/acc_factory.cxx
@@ -257,7 +257,7 @@ Reference< XAccessibleContext > AccessibleFactory::createAccessibleContext( VCLX
Reference< XAccessibleContext > AccessibleFactory::createAccessibleContext( VCLXListBox* _pXWindow )
{
bool bIsDropDownBox = false;
- ListBox* pBox = static_cast< ListBox* >( _pXWindow->GetWindow() );
+ VclPtr< ListBox > pBox = _pXWindow->GetAs< ListBox >();
if ( pBox )
bIsDropDownBox = ( ( pBox->GetStyle() & WB_DROPDOWN ) == WB_DROPDOWN );
@@ -290,7 +290,7 @@ Reference< XAccessibleContext > AccessibleFactory::createAccessibleContext( VCLX
Reference< XAccessibleContext > AccessibleFactory::createAccessibleContext( VCLXComboBox* _pXWindow )
{
bool bIsDropDownBox = false;
- ComboBox* pBox = static_cast< ComboBox* >( _pXWindow->GetWindow() );
+ VclPtr< ComboBox > pBox = _pXWindow->GetAs< ComboBox >();
if ( pBox )
bIsDropDownBox = ( ( pBox->GetStyle() & WB_DROPDOWN ) == WB_DROPDOWN );
diff --git a/accessibility/source/standard/vclxaccessiblebox.cxx b/accessibility/source/standard/vclxaccessiblebox.cxx
index 95d8258ce501..1e801a86e8fb 100644
--- a/accessibility/source/standard/vclxaccessiblebox.cxx
+++ b/accessibility/source/standard/vclxaccessiblebox.cxx
@@ -75,8 +75,8 @@ void VCLXAccessibleBox::ProcessWindowChildEvent( const VclWindowEvent& rVclWindo
// be removed in a short time.
if (m_aBoxType==COMBOBOX)
{
- ComboBox* pComboBox = static_cast<ComboBox*>(GetWindow());
- if ( ( pComboBox != NULL ) && ( pChildWindow != NULL ) )
+ VclPtr< ComboBox > pComboBox = GetAs< ComboBox >();
+ if ( ( pComboBox != nullptr ) && ( pChildWindow != NULL ) )
if (pChildWindow == pComboBox->GetSubEdit())
{
if (rVclWindowEvent.GetId() == VCLEVENT_WINDOW_SHOW)
@@ -327,8 +327,8 @@ Reference<XAccessible> SAL_CALL VCLXAccessibleBox::getAccessibleChild (sal_Int32
{
if (m_aBoxType==COMBOBOX)
{
- ComboBox* pComboBox = static_cast<ComboBox*>(GetWindow());
- if (pComboBox!=NULL && pComboBox->GetSubEdit()!=NULL)
+ VclPtr< ComboBox > pComboBox = GetAs< ComboBox >();
+ if (pComboBox!=nullptr && pComboBox->GetSubEdit()!=NULL)
//Set the edit's acc name the same as parent
{
pComboBox->GetSubEdit()->SetAccessibleName(getAccessibleName());
@@ -398,8 +398,8 @@ sal_Bool SAL_CALL VCLXAccessibleBox::doAccessibleAction (sal_Int32 nIndex)
if (m_aBoxType == COMBOBOX)
{
- ComboBox* pComboBox = static_cast< ComboBox* >( GetWindow() );
- if (pComboBox != NULL)
+ VclPtr< ComboBox > pComboBox = GetAs< ComboBox >();
+ if (pComboBox != nullptr)
{
pComboBox->ToggleDropDown();
bNotify = true;
@@ -407,8 +407,8 @@ sal_Bool SAL_CALL VCLXAccessibleBox::doAccessibleAction (sal_Int32 nIndex)
}
else if (m_aBoxType == LISTBOX)
{
- ListBox* pListBox = static_cast< ListBox* >( GetWindow() );
- if (pListBox != NULL)
+ VclPtr< ListBox > pListBox = GetAs< ListBox >();
+ if (pListBox != nullptr)
{
pListBox->ToggleDropDown();
bNotify = true;
@@ -532,8 +532,8 @@ void VCLXAccessibleBox::FillAccessibleStateSet( utl::AccessibleStateSetHelper& r
{
OUString sText;
sal_Int32 nEntryCount = 0;
- ComboBox* pComboBox = static_cast<ComboBox*>(GetWindow());
- if (pComboBox != NULL)
+ VclPtr< ComboBox > pComboBox = GetAs< ComboBox >();
+ if (pComboBox != nullptr)
{
Edit* pSubEdit = pComboBox->GetSubEdit();
if ( pSubEdit)
@@ -546,8 +546,8 @@ void VCLXAccessibleBox::FillAccessibleStateSet( utl::AccessibleStateSetHelper& r
else if (m_aBoxType == LISTBOX && m_bIsDropDownBox)
{
sal_Int32 nSelectedEntryCount = 0;
- ListBox* pListBox = static_cast< ListBox* >( GetWindow() );
- if (pListBox != NULL && pListBox->GetEntryCount() > 0)
+ VclPtr< ListBox > pListBox = GetAs< ListBox >();
+ if (pListBox != nullptr && pListBox->GetEntryCount() > 0)
{
nSelectedEntryCount = pListBox->GetSelectEntryCount();
if ( nSelectedEntryCount == 0)
diff --git a/accessibility/source/standard/vclxaccessiblebutton.cxx b/accessibility/source/standard/vclxaccessiblebutton.cxx
index 622565a8d6f3..ae3698d6b298 100644
--- a/accessibility/source/standard/vclxaccessiblebutton.cxx
+++ b/accessibility/source/standard/vclxaccessiblebutton.cxx
@@ -65,7 +65,7 @@ void VCLXAccessibleButton::ProcessWindowEvent( const VclWindowEvent& rVclWindowE
Any aOldValue;
Any aNewValue;
- PushButton* pButton = static_cast<PushButton*>( GetWindow() );
+ VclPtr< PushButton > pButton = GetAs< PushButton >();
if ( pButton && pButton->GetState() == TRISTATE_TRUE )
aNewValue <<= AccessibleStateType::CHECKED;
else
@@ -85,7 +85,7 @@ void VCLXAccessibleButton::FillAccessibleStateSet( utl::AccessibleStateSetHelper
{
VCLXAccessibleTextComponent::FillAccessibleStateSet( rStateSet );
- PushButton* pButton = static_cast<PushButton*>( GetWindow() );
+ VclPtr< PushButton > pButton = GetAs< PushButton >();
if ( pButton )
{
rStateSet.AddState( AccessibleStateType::FOCUSABLE );
@@ -196,7 +196,7 @@ sal_Bool VCLXAccessibleButton::doAccessibleAction ( sal_Int32 nIndex ) throw (In
if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
throw IndexOutOfBoundsException();
- PushButton* pButton = static_cast<PushButton*>( GetWindow() );
+ VclPtr< PushButton > pButton = GetAs< PushButton >();
if ( pButton )
pButton->Click();
@@ -264,7 +264,7 @@ Any VCLXAccessibleButton::getCurrentValue( ) throw (RuntimeException, std::exce
Any aValue;
- PushButton* pButton = static_cast<PushButton*>( GetWindow() );
+ VclPtr< PushButton > pButton = GetAs< PushButton >();
if ( pButton )
aValue <<= (sal_Int32) pButton->IsPressed();
@@ -279,7 +279,7 @@ sal_Bool VCLXAccessibleButton::setCurrentValue( const Any& aNumber ) throw (Runt
bool bReturn = false;
- PushButton* pButton = static_cast<PushButton*>( GetWindow() );
+ VclPtr< PushButton > pButton = GetAs< PushButton >();
if ( pButton )
{
sal_Int32 nValue = 0;
diff --git a/accessibility/source/standard/vclxaccessiblecheckbox.cxx b/accessibility/source/standard/vclxaccessiblecheckbox.cxx
index 327510ee1d1c..377fe9a96d1d 100644
--- a/accessibility/source/standard/vclxaccessiblecheckbox.cxx
+++ b/accessibility/source/standard/vclxaccessiblecheckbox.cxx
@@ -198,7 +198,7 @@ sal_Bool VCLXAccessibleCheckBox::doAccessibleAction ( sal_Int32 nIndex ) throw (
if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
throw IndexOutOfBoundsException();
- CheckBox* pCheckBox = static_cast<CheckBox*>(GetWindow());
+ VclPtr< CheckBox > pCheckBox = GetAs< CheckBox >();
VCLXCheckBox* pVCLXCheckBox = static_cast< VCLXCheckBox* >( GetVCLXWindow() );
if ( pCheckBox && pVCLXCheckBox )
{
@@ -328,7 +328,7 @@ Any VCLXAccessibleCheckBox::getMaximumValue( ) throw (RuntimeException, std::ex
Any aValue;
- CheckBox* pCheckBox = static_cast<CheckBox*>(GetWindow());
+ VclPtr< CheckBox > pCheckBox = GetAs< CheckBox >();
if ( pCheckBox && pCheckBox->IsTriStateEnabled() )
aValue <<= (sal_Int32) 2;
else
diff --git a/accessibility/source/standard/vclxaccessiblecombobox.cxx b/accessibility/source/standard/vclxaccessiblecombobox.cxx
index 25ed8f65c279..de97daac0cc1 100644
--- a/accessibility/source/standard/vclxaccessiblecombobox.cxx
+++ b/accessibility/source/standard/vclxaccessiblecombobox.cxx
@@ -43,18 +43,11 @@ VCLXAccessibleComboBox::~VCLXAccessibleComboBox()
{
}
-
-
-
bool VCLXAccessibleComboBox::IsValid() const
{
- return static_cast<ComboBox*>(GetWindow()) != NULL;
-
+ return GetWindow().get() != NULL;
}
-
-
-
void VCLXAccessibleComboBox::ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent)
{
VCLXAccessibleBox::ProcessWindowEvent( rVclWindowEvent );
diff --git a/accessibility/source/standard/vclxaccessibledropdowncombobox.cxx b/accessibility/source/standard/vclxaccessibledropdowncombobox.cxx
index 9659e5e4afcd..0e50ac8c8ea3 100644
--- a/accessibility/source/standard/vclxaccessibledropdowncombobox.cxx
+++ b/accessibility/source/standard/vclxaccessibledropdowncombobox.cxx
@@ -57,17 +57,11 @@ VCLXAccessibleDropDownComboBox::~VCLXAccessibleDropDownComboBox()
{
}
-
-
bool VCLXAccessibleDropDownComboBox::IsValid() const
{
- return static_cast<ComboBox*>(GetWindow()) != NULL;
-
+ return GetWindow().get() != NULL;
}
-
-
-
void VCLXAccessibleDropDownComboBox::ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent)
{
switch ( rVclWindowEvent.GetId() )
diff --git a/accessibility/source/standard/vclxaccessibledropdownlistbox.cxx b/accessibility/source/standard/vclxaccessibledropdownlistbox.cxx
index 23e44f0b2bbd..2875852fd82d 100644
--- a/accessibility/source/standard/vclxaccessibledropdownlistbox.cxx
+++ b/accessibility/source/standard/vclxaccessibledropdownlistbox.cxx
@@ -56,18 +56,11 @@ VCLXAccessibleDropDownListBox::~VCLXAccessibleDropDownListBox()
{
}
-
-
-
bool VCLXAccessibleDropDownListBox::IsValid() const
{
- return static_cast<ListBox*>(GetWindow()) != NULL;
-
+ return GetWindow().get() != NULL;
}
-
-
-
void VCLXAccessibleDropDownListBox::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
{
VCLXAccessibleBox::ProcessWindowEvent (rVclWindowEvent);
diff --git a/accessibility/source/standard/vclxaccessibleedit.cxx b/accessibility/source/standard/vclxaccessibleedit.cxx
index 1b9027dd05c3..7cc89bb58229 100644
--- a/accessibility/source/standard/vclxaccessibleedit.cxx
+++ b/accessibility/source/standard/vclxaccessibleedit.cxx
@@ -133,7 +133,7 @@ OUString VCLXAccessibleEdit::implGetText()
{
OUString aText;
- Edit* pEdit = static_cast< Edit* >( GetWindow() );
+ VclPtr< Edit > pEdit = GetAs< Edit >();
if ( pEdit )
{
aText = OutputDevice::GetNonMnemonicString( pEdit->GetText() );
@@ -225,7 +225,7 @@ sal_Int16 VCLXAccessibleEdit::getAccessibleRole( ) throw (RuntimeException, std
OExternalLockGuard aGuard( this );
sal_Int16 nRole;
- Edit* pEdit = static_cast< Edit* >( GetWindow() );
+ VclPtr< Edit > pEdit = GetAs< Edit >();
if ( pEdit && ( ( pEdit->GetStyle() & WB_PASSWORD ) || pEdit->GetEchoChar() ) )
nRole = AccessibleRole::PASSWORD_TEXT;
else
@@ -336,7 +336,7 @@ awt::Rectangle VCLXAccessibleEdit::getCharacterBounds( sal_Int32 nIndex ) throw
if ( !implIsValidRange( nIndex, nIndex, nLength ) )
throw IndexOutOfBoundsException();
- Control* pControl = static_cast< Control* >( GetWindow() );
+ VclPtr< Control > pControl = GetAs< Control >();
if ( pControl )
{
if ( nIndex == nLength )
@@ -425,7 +425,7 @@ sal_Bool VCLXAccessibleEdit::setSelection( sal_Int32 nStartIndex, sal_Int32 nEnd
throw IndexOutOfBoundsException();
VCLXEdit* pVCLXEdit = static_cast< VCLXEdit* >( GetVCLXWindow() );
- Edit* pEdit = static_cast< Edit* >( GetWindow() );
+ VclPtr< Edit > pEdit = GetAs< Edit >();
if ( pVCLXEdit && pEdit && pEdit->IsEnabled() )
{
pVCLXEdit->setSelection( awt::Selection( nStartIndex, nEndIndex ) );
diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx b/accessibility/source/standard/vclxaccessiblelist.cxx
index cb70d1a3711d..f494d4b8629f 100644
--- a/accessibility/source/standard/vclxaccessiblelist.cxx
+++ b/accessibility/source/standard/vclxaccessiblelist.cxx
@@ -72,16 +72,16 @@ VCLXAccessibleList::VCLXAccessibleList (VCLXWindow* pVCLWindow, BoxType aBoxType
{
case COMBOBOX:
{
- ComboBox* pBox = static_cast<ComboBox*>(GetWindow());
- if ( pBox != NULL )
+ VclPtr< ComboBox > pBox = GetAs< ComboBox >();
+ if ( pBox )
m_pListBoxHelper = new VCLListBoxHelper<ComboBox> (*pBox);
break;
}
case LISTBOX:
{
- ListBox* pBox = static_cast<ListBox*>(GetWindow());
- if ( pBox != NULL )
+ VclPtr< ListBox > pBox = GetAs< ListBox >();
+ if ( pBox )
m_pListBoxHelper = new VCLListBoxHelper<ListBox> (*pBox);
break;
}
@@ -189,8 +189,8 @@ void VCLXAccessibleList::UpdateSelection_Acc (const ::rtl::OUString& sTextOfSele
{
if ( m_aBoxType == COMBOBOX )
{
- ComboBox* pBox = static_cast<ComboBox*>(GetWindow());
- if ( pBox != NULL )
+ VclPtr< ComboBox > pBox = GetAs< ComboBox >();
+ if ( pBox )
{
// Find the index of the selected item inside the VCL control...
sal_Int32 nIndex = pBox->GetEntryPos(sTextOfSelectedItem);
@@ -458,7 +458,7 @@ void VCLXAccessibleList::ProcessWindowEvent (const VclWindowEvent& rVclWindowEve
void VCLXAccessibleList::FillAccessibleRelationSet( utl::AccessibleRelationSetHelper& rRelationSet )
{
- ListBox* pBox = static_cast<ListBox*>(GetWindow());
+ VclPtr< ListBox > pBox = GetAs< ListBox >();
if( m_aBoxType == LISTBOX )
{
if (m_pListBoxHelper && (m_pListBoxHelper->GetStyle() & WB_DROPDOWN ) != WB_DROPDOWN)
@@ -483,8 +483,8 @@ void VCLXAccessibleList::UpdateSelection (const OUString& sTextOfSelectedItem)
{
if ( m_aBoxType == COMBOBOX )
{
- ComboBox* pBox = static_cast<ComboBox*>(GetWindow());
- if ( pBox != NULL )
+ VclPtr< ComboBox > pBox = GetAs< ComboBox >();
+ if ( pBox )
{
// Find the index of the selected item inside the VCL control...
sal_Int32 nIndex = pBox->GetEntryPos(sTextOfSelectedItem);
@@ -930,7 +930,7 @@ awt::Rectangle VCLXAccessibleList::implGetBounds() throw (uno::RuntimeException)
aBounds.Y = 0;
if ( m_aBoxType == COMBOBOX )
{
- ComboBox* pBox = static_cast<ComboBox*>(GetWindow());
+ VclPtr< ComboBox > pBox = GetAs< ComboBox >();
if ( pBox )
{
Size aSize = pBox->GetSubEdit()->GetSizePixel();
@@ -960,7 +960,7 @@ awt::Point VCLXAccessibleList::getLocationOnScreen( ) throw (uno::RuntimeExcept
aPos = VCLXAccessibleComponent::getLocationOnScreen();
if ( m_aBoxType == COMBOBOX )
{
- ComboBox* pBox = static_cast<ComboBox*>(GetWindow());
+ VclPtr< ComboBox > pBox = GetAs< ComboBox >();
if ( pBox )
{
aPos.Y += pBox->GetSubEdit()->GetSizePixel().Height();
diff --git a/accessibility/source/standard/vclxaccessiblelistbox.cxx b/accessibility/source/standard/vclxaccessiblelistbox.cxx
index 3fb9b1be3081..bc48680703ae 100644
--- a/accessibility/source/standard/vclxaccessiblelistbox.cxx
+++ b/accessibility/source/standard/vclxaccessiblelistbox.cxx
@@ -54,26 +54,16 @@ VCLXAccessibleListBox::~VCLXAccessibleListBox()
{
}
-
-
-
bool VCLXAccessibleListBox::IsValid() const
{
- return static_cast<ListBox*>(GetWindow()) != NULL;
-
+ return GetWindow().get() != NULL;
}
-
-
-
void VCLXAccessibleListBox::ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent)
{
VCLXAccessibleBox::ProcessWindowEvent( rVclWindowEvent );
}
-
-
-
//===== XServiceInfo ========================================================
OUString VCLXAccessibleListBox::getImplementationName()
diff --git a/accessibility/source/standard/vclxaccessibleradiobutton.cxx b/accessibility/source/standard/vclxaccessibleradiobutton.cxx
index baabdd5555f1..23d8a92b268b 100644
--- a/accessibility/source/standard/vclxaccessibleradiobutton.cxx
+++ b/accessibility/source/standard/vclxaccessibleradiobutton.cxx
@@ -90,16 +90,16 @@ void VCLXAccessibleRadioButton::FillAccessibleRelationSet( utl::AccessibleRelati
{
VCLXAccessibleTextComponent::FillAccessibleRelationSet( rRelationSet );
- RadioButton* pRadioButton = dynamic_cast< RadioButton* >( GetWindow() );
+ VclPtr< RadioButton > pRadioButton = GetAsDynamic< RadioButton >();
if ( pRadioButton )
{
- ::std::vector< RadioButton* > aGroup(pRadioButton->GetRadioButtonGroup(true));
+ ::std::vector< VclPtr<RadioButton> > aGroup(pRadioButton->GetRadioButtonGroup(true));
if (!aGroup.empty())
{
sal_Int32 i = 0;
Sequence< Reference< XInterface > > aSequence( static_cast< sal_Int32 >( aGroup.size() ) );
- ::std::vector< RadioButton* >::const_iterator aEndItr = aGroup.end();
- for ( ::std::vector< RadioButton* >::const_iterator aItr = aGroup.begin(); aItr < aEndItr; ++aItr )
+ auto aEndItr = aGroup.end();
+ for ( auto aItr = aGroup.begin(); aItr < aEndItr; ++aItr )
{
aSequence[i++] = (*aItr)->GetAccessible();
}
diff --git a/accessibility/source/standard/vclxaccessiblescrollbar.cxx b/accessibility/source/standard/vclxaccessiblescrollbar.cxx
index 44faa7ed8ba9..76e58a67537d 100644
--- a/accessibility/source/standard/vclxaccessiblescrollbar.cxx
+++ b/accessibility/source/standard/vclxaccessiblescrollbar.cxx
@@ -139,7 +139,7 @@ sal_Bool VCLXAccessibleScrollBar::doAccessibleAction ( sal_Int32 nIndex ) throw
throw IndexOutOfBoundsException();
bool bReturn = false;
- ScrollBar* pScrollBar = static_cast< ScrollBar* >( GetWindow() );
+ VclPtr< ScrollBar > pScrollBar = GetAs< ScrollBar >();
if ( pScrollBar )
{
ScrollType eScrollType;
diff --git a/accessibility/source/standard/vclxaccessiblestatusbar.cxx b/accessibility/source/standard/vclxaccessiblestatusbar.cxx
index 921c7075f7f1..42d1db5eb38e 100644
--- a/accessibility/source/standard/vclxaccessiblestatusbar.cxx
+++ b/accessibility/source/standard/vclxaccessiblestatusbar.cxx
@@ -38,7 +38,7 @@ using namespace ::comphelper;
VCLXAccessibleStatusBar::VCLXAccessibleStatusBar( VCLXWindow* pVCLXWindow )
:VCLXAccessibleComponent( pVCLXWindow )
{
- m_pStatusBar = static_cast< StatusBar* >( GetWindow() );
+ m_pStatusBar = static_cast< StatusBar *>( GetWindow().get() );
if ( m_pStatusBar )
m_aAccessibleChildren.assign( m_pStatusBar->GetItemCount(), Reference< XAccessible >() );
diff --git a/accessibility/source/standard/vclxaccessibletabcontrol.cxx b/accessibility/source/standard/vclxaccessibletabcontrol.cxx
index 268a6f335d80..26ffc8ebd81e 100644
--- a/accessibility/source/standard/vclxaccessibletabcontrol.cxx
+++ b/accessibility/source/standard/vclxaccessibletabcontrol.cxx
@@ -43,7 +43,7 @@ using namespace ::comphelper;
VCLXAccessibleTabControl::VCLXAccessibleTabControl( VCLXWindow* pVCLXWindow )
:VCLXAccessibleComponent( pVCLXWindow )
{
- m_pTabControl = static_cast< TabControl* >( GetWindow() );
+ m_pTabControl = static_cast< TabControl* >( GetWindow().get() );
if ( m_pTabControl )
m_aAccessibleChildren.assign( m_pTabControl->GetPageCount(), Reference< XAccessible >() );
diff --git a/accessibility/source/standard/vclxaccessibletabpagewindow.cxx b/accessibility/source/standard/vclxaccessibletabpagewindow.cxx
index 6b43aa3d4b2c..3edb2b815864 100644
--- a/accessibility/source/standard/vclxaccessibletabpagewindow.cxx
+++ b/accessibility/source/standard/vclxaccessibletabpagewindow.cxx
@@ -36,7 +36,7 @@ using namespace ::comphelper;
VCLXAccessibleTabPageWindow::VCLXAccessibleTabPageWindow( VCLXWindow* pVCLXWindow )
:VCLXAccessibleComponent( pVCLXWindow )
{
- m_pTabPage = static_cast< TabPage* >( GetWindow() );
+ m_pTabPage = static_cast< TabPage* >( GetWindow().get() );
m_pTabControl = 0;
m_nPageId = 0;
if ( m_pTabPage )
@@ -50,7 +50,7 @@ VCLXAccessibleTabPageWindow::VCLXAccessibleTabPageWindow( VCLXWindow* pVCLXWindo
for ( sal_uInt16 i = 0, nCount = m_pTabControl->GetPageCount(); i < nCount; ++i )
{
sal_uInt16 nPageId = m_pTabControl->GetPageId( i );
- if ( m_pTabControl->GetTabPage( nPageId ) == m_pTabPage )
+ if ( m_pTabControl->GetTabPage( nPageId ) == m_pTabPage.get() )
m_nPageId = nPageId;
}
}
diff --git a/accessibility/source/standard/vclxaccessibletextcomponent.cxx b/accessibility/source/standard/vclxaccessibletextcomponent.cxx
index 1bfa1891cddc..7fbe48ab018f 100644
--- a/accessibility/source/standard/vclxaccessibletextcomponent.cxx
+++ b/accessibility/source/standard/vclxaccessibletextcomponent.cxx
@@ -254,7 +254,7 @@ awt::Rectangle VCLXAccessibleTextComponent::getCharacterBounds( sal_Int32 nIndex
throw IndexOutOfBoundsException();
awt::Rectangle aRect;
- Control* pControl = static_cast< Control* >( GetWindow() );
+ VclPtr< Control > pControl = GetAs< Control >();
if ( pControl )
aRect = AWTRectangle( pControl->GetCharacterBounds( nIndex ) );
@@ -277,7 +277,7 @@ sal_Int32 VCLXAccessibleTextComponent::getIndexAtPoint( const awt::Point& aPoint
OExternalLockGuard aGuard( this );
sal_Int32 nIndex = -1;
- Control* pControl = static_cast< Control* >( GetWindow() );
+ VclPtr< Control > pControl = GetAs< Control >();
if ( pControl )
nIndex = pControl->GetIndexForPoint( VCLPoint( aPoint ) );
diff --git a/accessibility/source/standard/vclxaccessibletextfield.cxx b/accessibility/source/standard/vclxaccessibletextfield.cxx
index 82e27f87eb60..44461225ffdd 100644
--- a/accessibility/source/standard/vclxaccessibletextfield.cxx
+++ b/accessibility/source/standard/vclxaccessibletextfield.cxx
@@ -53,22 +53,16 @@ VCLXAccessibleTextField::~VCLXAccessibleTextField()
{
}
-
-
-
OUString VCLXAccessibleTextField::implGetText()
{
OUString aText;
- ListBox* pListBox = static_cast<ListBox*>(GetWindow());
- if (pListBox!=NULL && !pListBox->IsInDropDown())
+ VclPtr< ListBox > pListBox = GetAs< ListBox >();
+ if (pListBox && !pListBox->IsInDropDown())
aText = pListBox->GetSelectEntry();
return aText;
}
-
-
-
IMPLEMENT_FORWARD_XINTERFACE2(VCLXAccessibleTextField, VCLXAccessibleTextComponent, VCLXAccessible_BASE)
IMPLEMENT_FORWARD_XTYPEPROVIDER2(VCLXAccessibleTextField, VCLXAccessibleTextComponent, VCLXAccessible_BASE)
diff --git a/accessibility/source/standard/vclxaccessibletoolbox.cxx b/accessibility/source/standard/vclxaccessibletoolbox.cxx
index 3dc32a1e1795..bbb4e26f2efa 100644
--- a/accessibility/source/standard/vclxaccessibletoolbox.cxx
+++ b/accessibility/source/standard/vclxaccessibletoolbox.cxx
@@ -184,7 +184,7 @@ VCLXAccessibleToolBox::~VCLXAccessibleToolBox()
VCLXAccessibleToolBoxItem* VCLXAccessibleToolBox::GetItem_Impl( sal_Int32 _nPos, bool _bMustHaveFocus )
{
VCLXAccessibleToolBoxItem* pItem = NULL;
- ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() );
+ VclPtr< ToolBox > pToolBox = GetAs< ToolBox >();
if ( pToolBox && ( !_bMustHaveFocus || pToolBox->HasFocus() ) )
{
ToolBoxItemsMap::iterator aIter = m_aAccessibleChildren.find( _nPos );
@@ -198,7 +198,7 @@ VCLXAccessibleToolBoxItem* VCLXAccessibleToolBox::GetItem_Impl( sal_Int32 _nPos,
void VCLXAccessibleToolBox::UpdateFocus_Impl()
{
- ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() );
+ VclPtr< ToolBox > pToolBox = GetAs< ToolBox >();
if( !pToolBox )
return;
@@ -250,7 +250,7 @@ void VCLXAccessibleToolBox::UpdateFocus_Impl()
void VCLXAccessibleToolBox::ReleaseFocus_Impl( sal_Int32 _nPos )
{
- ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() );
+ VclPtr< ToolBox > pToolBox = GetAs< ToolBox >();
if ( pToolBox ) // #107124#, do not check for focus because this message is also handled in losefocus
{
ToolBoxItemsMap::iterator aIter = m_aAccessibleChildren.find( _nPos );
@@ -266,7 +266,7 @@ void VCLXAccessibleToolBox::ReleaseFocus_Impl( sal_Int32 _nPos )
void VCLXAccessibleToolBox::UpdateChecked_Impl( sal_Int32 _nPos )
{
- ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() );
+ VclPtr< ToolBox > pToolBox = GetAs< ToolBox >();
if ( pToolBox )
{
sal_uInt16 nFocusId = pToolBox->GetItemId( (sal_uInt16)_nPos );
@@ -291,7 +291,7 @@ void VCLXAccessibleToolBox::UpdateChecked_Impl( sal_Int32 _nPos )
void VCLXAccessibleToolBox::UpdateIndeterminate_Impl( sal_Int32 _nPos )
{
- ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() );
+ VclPtr< ToolBox > pToolBox = GetAs< ToolBox >();
if ( pToolBox )
{
sal_uInt16 nItemId = pToolBox->GetItemId( (sal_uInt16)_nPos );
@@ -347,7 +347,7 @@ void VCLXAccessibleToolBox::UpdateItem_Impl( sal_Int32 _nPos, bool _bItemAdded )
return;
}
- ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() );
+ VclPtr< ToolBox > pToolBox = GetAs< ToolBox >();
if ( pToolBox )
{
if ( !_bItemAdded )
@@ -403,7 +403,7 @@ void VCLXAccessibleToolBox::UpdateItem_Impl( sal_Int32 _nPos, bool _bItemAdded )
void VCLXAccessibleToolBox::UpdateAllItems_Impl()
{
- ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() );
+ VclPtr< ToolBox > pToolBox = GetAs< ToolBox >();
if ( pToolBox )
{
// deregister the old items
@@ -427,7 +427,7 @@ void VCLXAccessibleToolBox::UpdateAllItems_Impl()
void VCLXAccessibleToolBox::UpdateCustomPopupItemp_Impl( vcl::Window* pWindow, bool bOpen )
{
- ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() );
+ VclPtr< ToolBox > pToolBox = GetAs< ToolBox >();
if( pWindow && pToolBox )
{
const sal_uInt16 nDownItem = pToolBox->GetDownItemId();
@@ -465,7 +465,7 @@ void VCLXAccessibleToolBox::UpdateItemEnabled_Impl( sal_Int32 _nPos )
void VCLXAccessibleToolBox::HandleSubToolBarEvent( const VclWindowEvent& rVclWindowEvent, bool _bShow )
{
vcl::Window* pChildWindow = static_cast<vcl::Window *>(rVclWindowEvent.GetData());
- ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() );
+ VclPtr< ToolBox > pToolBox = GetAs< ToolBox >();
if ( pChildWindow
&& pToolBox
&& pToolBox == pChildWindow->GetParent()
@@ -486,7 +486,7 @@ void VCLXAccessibleToolBox::HandleSubToolBarEvent( const VclWindowEvent& rVclWin
void VCLXAccessibleToolBox::ReleaseSubToolBox( ToolBox* _pSubToolBox )
{
- ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() );
+ VclPtr< ToolBox > pToolBox = GetAs< ToolBox >();
if ( !pToolBox )
return;
@@ -512,7 +512,7 @@ void VCLXAccessibleToolBox::FillAccessibleStateSet( utl::AccessibleStateSetHelpe
{
VCLXAccessibleComponent::FillAccessibleStateSet( rStateSet );
- ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() );
+ VclPtr< ToolBox > pToolBox = GetAs< ToolBox >();
if ( pToolBox )
{
rStateSet.AddState( AccessibleStateType::FOCUSABLE );
@@ -533,7 +533,7 @@ void VCLXAccessibleToolBox::ProcessWindowEvent( const VclWindowEvent& rVclWindow
case VCLEVENT_TOOLBOX_CLICK:
case VCLEVENT_TOOLBOX_SELECT:
{
- ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() );
+ VclPtr< ToolBox > pToolBox = GetAs< ToolBox >();
if ( rVclWindowEvent.GetData() )
{
UpdateChecked_Impl( (sal_Int32)reinterpret_cast<sal_IntPtr>(rVclWindowEvent.GetData()) );
@@ -617,14 +617,14 @@ void VCLXAccessibleToolBox::ProcessWindowEvent( const VclWindowEvent& rVclWindow
case VCLEVENT_OBJECT_DYING :
{
// if this toolbox is a subtoolbox, we have to relese it from its parent
- vcl::Window * pWin = GetWindow();
+ VclPtr< vcl::Window > pWin = GetAs< vcl::Window >();
if ( pWin && pWin->GetParent() &&
pWin->GetParent()->GetType() == WINDOW_TOOLBOX )
{
VCLXAccessibleToolBox* pParent = static_cast< VCLXAccessibleToolBox* >(
pWin->GetParent()->GetAccessible()->getAccessibleContext().get() );
if ( pParent )
- pParent->ReleaseSubToolBox(static_cast<ToolBox *>(pWin));
+ pParent->ReleaseSubToolBox(static_cast<ToolBox *>(pWin.get()));
}
// dispose all items
@@ -704,7 +704,7 @@ sal_Int32 SAL_CALL VCLXAccessibleToolBox::getAccessibleChildCount( ) throw (Run
comphelper::OExternalLockGuard aGuard( this );
sal_Int32 nCount = 0;
- ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() );
+ VclPtr< ToolBox > pToolBox = GetAs< ToolBox >();
if ( pToolBox )
nCount = pToolBox->GetItemCount();
@@ -718,7 +718,7 @@ Reference< XAccessible > SAL_CALL VCLXAccessibleToolBox::getAccessibleChild( sal
comphelper::OExternalLockGuard aGuard( this );
- ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() );
+ VclPtr< ToolBox > pToolBox = GetAs< ToolBox >();
if ( pToolBox )
{
Reference< XAccessible > xChild;
@@ -763,7 +763,7 @@ Reference< XAccessible > SAL_CALL VCLXAccessibleToolBox::getAccessibleAtPoint( c
comphelper::OExternalLockGuard aGuard( this );
Reference< XAccessible > xAccessible;
- ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() );
+ VclPtr< ToolBox > pToolBox = GetAs< ToolBox >();
if ( pToolBox )
{
sal_uInt16 nItemPos = pToolBox->GetItemPos( VCLPoint( _rPoint ) );
@@ -778,7 +778,7 @@ Reference< XAccessible > VCLXAccessibleToolBox::GetItemWindowAccessible( const V
{
Reference< XAccessible > xReturn;
vcl::Window* pChildWindow = static_cast<vcl::Window *>(rVclWindowEvent.GetData());
- ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() );
+ VclPtr< ToolBox > pToolBox = GetAs< ToolBox >();
if ( pChildWindow && pToolBox )
{
sal_uInt16 nCount = pToolBox->GetItemCount();
@@ -808,7 +808,7 @@ void VCLXAccessibleToolBox::selectAccessibleChild( sal_Int32 nChildIndex ) throw
OExternalLockGuard aGuard( this );
if ( nChildIndex < 0 || nChildIndex >= getAccessibleChildCount() )
throw IndexOutOfBoundsException();
- ToolBox * pToolBox = static_cast < ToolBox * > ( GetWindow() );
+ VclPtr< ToolBox > pToolBox = GetAs< ToolBox >();
sal_uInt16 nPos = static_cast < sal_uInt16 > (nChildIndex);
pToolBox->ChangeHighlight( nPos );
}
@@ -818,9 +818,9 @@ sal_Bool VCLXAccessibleToolBox::isAccessibleChildSelected( sal_Int32 nChildIndex
OExternalLockGuard aGuard( this );
if ( nChildIndex < 0 || nChildIndex >= getAccessibleChildCount() )
throw IndexOutOfBoundsException();
- ToolBox * pToolBox = static_cast < ToolBox * > ( GetWindow() );
+ VclPtr< ToolBox > pToolBox = GetAs< ToolBox >();
sal_uInt16 nPos = static_cast < sal_uInt16 > (nChildIndex);
- if ( pToolBox != NULL && pToolBox->GetHighlightItemId() == pToolBox->GetItemId( nPos ) )
+ if ( pToolBox && pToolBox->GetHighlightItemId() == pToolBox->GetItemId( nPos ) )
return true;
else
return false;
@@ -829,7 +829,7 @@ sal_Bool VCLXAccessibleToolBox::isAccessibleChildSelected( sal_Int32 nChildIndex
void VCLXAccessibleToolBox::clearAccessibleSelection( ) throw (RuntimeException, std::exception)
{
OExternalLockGuard aGuard( this );
- ToolBox * pToolBox = static_cast < ToolBox * > ( GetWindow() );
+ VclPtr< ToolBox > pToolBox = GetAs< ToolBox >();
pToolBox -> LoseFocus();
}
diff --git a/avmedia/inc/mediacontrol.hxx b/avmedia/inc/mediacontrol.hxx
index c6e0622c5421..b24e1a590ee7 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;
- ListBox* mpZoomListBox;
- Edit maTimeEdit;
+ VclPtr<ToolBox> maPlayToolBox;
+ VclPtr<Slider> maTimeSlider;
+ VclPtr<ToolBox> maMuteToolBox;
+ VclPtr<Slider> maVolumeSlider;
+ VclPtr<ToolBox> maZoomToolBox;
+ VclPtr<ListBox> mpZoomListBox;
+ VclPtr<Edit> maTimeEdit;
Size maMinSize;
MediaControlStyle meControlStyle;
bool mbLocked;
diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx
index 13592611093f..5168c12e34e3 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( VclPtr<ToolBox>::Create(this, WB_3DLOOK) ),
+ maTimeSlider( VclPtr<Slider>::Create(this, WB_HORZ | WB_DRAG | WB_3DLOOK | WB_SLIDERSET) ),
+ maMuteToolBox( VclPtr<ToolBox>::Create(this, WB_3DLOOK) ),
+ maVolumeSlider( VclPtr<Slider>::Create(this, WB_HORZ | WB_DRAG | WB_SLIDERSET) ),
+ maZoomToolBox( VclPtr<ToolBox>::Create(this, WB_3DLOOK) ),
+ mpZoomListBox( VclPtr<ListBox>::Create( maZoomToolBox.get(), WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL | WB_3DLOOK ) ),
+ maTimeEdit( VclPtr<Edit>::Create(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 );
- delete mpZoomListBox;
+ disposeOnce();
+}
+
+void MediaControl::dispose()
+{
+ maZoomToolBox->SetItemWindow( AVMEDIA_TOOLBOXITEM_ZOOM, NULL );
+ mpZoomListBox.disposeAndClear();
+ 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 6090b6289394..28adf1959c8e 100644
--- a/avmedia/source/framework/mediaplayer.cxx
+++ b/avmedia/source/framework/mediaplayer.cxx
@@ -40,9 +40,9 @@ namespace avmedia
MediaPlayer::MediaPlayer( vcl::Window* _pParent, sal_uInt16 nId, SfxBindings* _pBindings, SfxChildWinInfo* pInfo ) :
SfxChildWindow( _pParent, nId )
{
- pWindow = new MediaFloater( _pBindings, this, _pParent );
+ pWindow.reset( VclPtr<MediaFloater>::Create( _pBindings, this, _pParent ) );
eChildAlignment = SfxChildAlignment::NOALIGNMENT;
- static_cast< MediaFloater* >( pWindow )->Initialize( pInfo );
+ static_cast< MediaFloater* >( pWindow.get() )->Initialize( pInfo );
};
@@ -75,8 +75,14 @@ MediaFloater::MediaFloater( SfxBindings* _pBindings, SfxChildWindow* pCW, vcl::W
MediaFloater::~MediaFloater()
{
+ disposeOnce();
+}
+
+void MediaFloater::dispose()
+{
delete mpMediaWindow;
mpMediaWindow = NULL;
+ SfxDockingWindow::dispose();
}
diff --git a/avmedia/source/framework/mediatoolbox.cxx b/avmedia/source/framework/mediatoolbox.cxx
index ea4131fe4713..4f20a781c676 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();
@@ -131,9 +124,9 @@ void MediaToolBoxControl::StateChanged( sal_uInt16 /* nSID */, SfxItemState eSta
-vcl::Window* MediaToolBoxControl::CreateItemWindow( vcl::Window *pParent )
+VclPtr<vcl::Window> MediaToolBoxControl::CreateItemWindow( vcl::Window *pParent )
{
- return( pParent ? new MediaToolBoxControl_Impl( *pParent, *this ) : NULL );
+ return ( pParent ? VclPtr<MediaToolBoxControl_Impl>::Create( *pParent, *this ) : nullptr );
}
diff --git a/avmedia/source/viewer/mediaevent_impl.cxx b/avmedia/source/viewer/mediaevent_impl.cxx
index 86e18175101c..3e42ebb223b4 100644
--- a/avmedia/source/viewer/mediaevent_impl.cxx
+++ b/avmedia/source/viewer/mediaevent_impl.cxx
@@ -45,7 +45,7 @@ MediaEventListenersImpl::~MediaEventListenersImpl()
void MediaEventListenersImpl::cleanUp()
{
- Application::RemoveMouseAndKeyEvents( reinterpret_cast< vcl::Window* >( mpNotifyWindow ) );
+ Application::RemoveMouseAndKeyEvents( reinterpret_cast< vcl::Window* >( mpNotifyWindow.get() ) );
mpNotifyWindow = NULL;
}
@@ -72,7 +72,7 @@ void SAL_CALL MediaEventListenersImpl::keyPressed( const ::com::sun::star::awt::
( ( e.Modifiers & 4 ) ? KEY_MOD2 : 0 ) );
KeyEvent aVCLKeyEvt( e.KeyChar, aVCLKeyCode );
- Application::PostKeyEvent( VCLEVENT_WINDOW_KEYINPUT, reinterpret_cast< vcl::Window* >( mpNotifyWindow ), &aVCLKeyEvt );
+ Application::PostKeyEvent( VCLEVENT_WINDOW_KEYINPUT, reinterpret_cast< vcl::Window* >( mpNotifyWindow.get() ), &aVCLKeyEvt );
}
}
@@ -91,7 +91,7 @@ void SAL_CALL MediaEventListenersImpl::keyReleased( const ::com::sun::star::awt:
( ( e.Modifiers & 2 ) ? KEY_MOD1 : 0 ) |
( ( e.Modifiers & 4 ) ? KEY_MOD2 : 0 ) );
KeyEvent aVCLKeyEvt( e.KeyChar, aVCLKeyCode );
- Application::PostKeyEvent( VCLEVENT_WINDOW_KEYUP, reinterpret_cast< vcl::Window* >( mpNotifyWindow ), &aVCLKeyEvt );
+ Application::PostKeyEvent( VCLEVENT_WINDOW_KEYUP, reinterpret_cast< vcl::Window* >( mpNotifyWindow.get() ), &aVCLKeyEvt );
}
}
@@ -112,7 +112,7 @@ void SAL_CALL MediaEventListenersImpl::mousePressed( const ::com::sun::star::awt
( ( e.Buttons & 2 ) ? MOUSE_RIGHT : 0 ) |
( ( e.Buttons & 4 ) ? MOUSE_MIDDLE : 0 ),
e.Modifiers );
- Application::PostMouseEvent( VCLEVENT_WINDOW_MOUSEBUTTONDOWN, reinterpret_cast< vcl::Window* >( mpNotifyWindow ), &aVCLMouseEvt );
+ Application::PostMouseEvent( VCLEVENT_WINDOW_MOUSEBUTTONDOWN, reinterpret_cast< vcl::Window* >( mpNotifyWindow.get() ), &aVCLMouseEvt );
}
}
@@ -133,7 +133,7 @@ void SAL_CALL MediaEventListenersImpl::mouseReleased( const ::com::sun::star::aw
( ( e.Buttons & 2 ) ? MOUSE_RIGHT : 0 ) |
( ( e.Buttons & 4 ) ? MOUSE_MIDDLE : 0 ),
e.Modifiers );
- Application::PostMouseEvent( VCLEVENT_WINDOW_MOUSEBUTTONUP, reinterpret_cast< vcl::Window* >( mpNotifyWindow ), &aVCLMouseEvt );
+ Application::PostMouseEvent( VCLEVENT_WINDOW_MOUSEBUTTONUP, reinterpret_cast< vcl::Window* >( mpNotifyWindow.get() ), &aVCLMouseEvt );
}
}
@@ -174,7 +174,7 @@ void SAL_CALL MediaEventListenersImpl::mouseDragged( const ::com::sun::star::awt
if( mpNotifyWindow )
{
MouseEvent aVCLMouseEvt( Point( e.X, e.Y ), 0, MouseEventModifiers::NONE, e.Buttons, e.Modifiers );
- Application::PostMouseEvent( VCLEVENT_WINDOW_MOUSEMOVE, reinterpret_cast< vcl::Window* >( mpNotifyWindow ), &aVCLMouseEvt );
+ Application::PostMouseEvent( VCLEVENT_WINDOW_MOUSEMOVE, reinterpret_cast< vcl::Window* >( mpNotifyWindow.get() ), &aVCLMouseEvt );
}
}
@@ -189,7 +189,7 @@ void SAL_CALL MediaEventListenersImpl::mouseMoved( const ::com::sun::star::awt::
if( mpNotifyWindow )
{
MouseEvent aVCLMouseEvt( Point( e.X, e.Y ), 0, MouseEventModifiers::NONE, e.Buttons, e.Modifiers );
- Application::PostMouseEvent( VCLEVENT_WINDOW_MOUSEMOVE, reinterpret_cast< vcl::Window* >( mpNotifyWindow ), &aVCLMouseEvt );
+ Application::PostMouseEvent( VCLEVENT_WINDOW_MOUSEMOVE, reinterpret_cast< vcl::Window* >( mpNotifyWindow.get() ), &aVCLMouseEvt );
}
}
diff --git a/avmedia/source/viewer/mediaevent_impl.hxx b/avmedia/source/viewer/mediaevent_impl.hxx
index 63e1a0d77ba2..27676c749d84 100644
--- a/avmedia/source/viewer/mediaevent_impl.hxx
+++ b/avmedia/source/viewer/mediaevent_impl.hxx
@@ -26,6 +26,7 @@
#include <com/sun/star/awt/XMouseListener.hpp>
#include <com/sun/star/awt/XMouseMotionListener.hpp>
#include <com/sun/star/awt/XFocusListener.hpp>
+#include <vcl/vclptr.hxx>
namespace avmedia
{
@@ -69,7 +70,7 @@ namespace avmedia
private:
- vcl::Window* mpNotifyWindow;
+ VclPtr<vcl::Window> mpNotifyWindow;
mutable ::osl::Mutex maMutex;
};
}
diff --git a/avmedia/source/viewer/mediawindow.cxx b/avmedia/source/viewer/mediawindow.cxx
index a40d8a384be2..267e39fb7d6a 100644
--- a/avmedia/source/viewer/mediawindow.cxx
+++ b/avmedia/source/viewer/mediawindow.cxx
@@ -46,7 +46,7 @@ namespace avmedia {
MediaWindow::MediaWindow( vcl::Window* parent, bool bInternalMediaControl ) :
- mpImpl( new priv::MediaWindowImpl( parent, this, bInternalMediaControl ) )
+ mpImpl( VclPtr<priv::MediaWindowImpl>::Create( parent, this, bInternalMediaControl ) )
{
mpImpl->Show();
}
@@ -327,9 +327,10 @@ bool MediaWindow::executeMediaURLDialog(vcl::Window* /* pParent */,
void MediaWindow::executeFormatErrorBox( vcl::Window* pParent )
{
- MessageDialog aErrBox( pParent, AVMEDIA_RESID( AVMEDIA_STR_ERR_URL ) );
+ ScopedVclPtrInstance< MessageDialog > aErrBox( pParent, AVMEDIA_RESID( AVMEDIA_STR_ERR_URL ) );
- aErrBox.Execute();
+ aErrBox->Execute();
+ aErrBox.disposeAndClear();
}
diff --git a/avmedia/source/viewer/mediawindow_impl.cxx b/avmedia/source/viewer/mediawindow_impl.cxx
index 7a6863b1b2bc..c84849b2dec3 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() ) ),
@@ -168,7 +156,7 @@ MediaWindowImpl::MediaWindowImpl( vcl::Window* pParent, MediaWindow* pMediaWindo
mpMediaWindow( pMediaWindow ),
mpEvents( NULL ),
mbEventTransparent(true),
- mpMediaWindowControl( bInternalMediaControl ? new MediaWindowControl( this ) : NULL ),
+ mpMediaWindowControl( bInternalMediaControl ? VclPtr<MediaWindowControl>::Create( this ) : nullptr ),
mpEmptyBmpEx( NULL ),
mpAudioBmpEx( NULL )
{
@@ -183,6 +171,11 @@ MediaWindowImpl::MediaWindowImpl( vcl::Window* pParent, MediaWindow* pMediaWindo
MediaWindowImpl::~MediaWindowImpl()
{
+ disposeOnce();
+}
+
+void MediaWindowImpl::dispose()
+{
if( mpEvents )
mpEvents->cleanUp();
@@ -208,8 +201,13 @@ MediaWindowImpl::~MediaWindowImpl()
mpMediaWindow = NULL;
delete mpEmptyBmpEx;
+ mpEmptyBmpEx = NULL;
delete mpAudioBmpEx;
- delete mpMediaWindowControl;
+ mpAudioBmpEx = NULL;
+ mpMediaWindowControl.disposeAndClear();
+ mpChildWindow.disposeAndClear();
+
+ Control::dispose();
}
uno::Reference< media::XPlayer > MediaWindowImpl::createPlayer( const OUString& rURL, const OUString& rReferer, const OUString* pMimeType )
@@ -510,13 +508,15 @@ void MediaWindowImpl::onURLChanged()
{
if( m_sMimeType == AVMEDIA_MIMETYPE_COMMON )
{
- mpChildWindow.reset(new MediaChildWindow(this) );
+ mpChildWindow.disposeAndClear();
+ mpChildWindow.reset(VclPtr<MediaChildWindow>::Create(this) );
}
#if HAVE_FEATURE_GLTF
else if ( m_sMimeType == AVMEDIA_MIMETYPE_JSON )
{
SystemWindowData aWinData = OpenGLContext::generateWinData(this, false);
- mpChildWindow.reset(new MediaChildWindow(this,&aWinData));
+ mpChildWindow.disposeAndClear();
+ mpChildWindow.reset(VclPtr<MediaChildWindow>::Create(this,&aWinData));
mbEventTransparent = false;
}
#endif
diff --git a/avmedia/source/viewer/mediawindow_impl.hxx b/avmedia/source/viewer/mediawindow_impl.hxx
index c5c65fa41aa0..c56558c375db 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 );
@@ -173,8 +172,8 @@ namespace avmedia
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxEventsIf;
MediaEventListenersImpl* mpEvents;
bool mbEventTransparent;
- std::unique_ptr<MediaChildWindow> mpChildWindow;
- MediaWindowControl* mpMediaWindowControl;
+ VclPtr<MediaChildWindow> mpChildWindow;
+ VclPtr<MediaWindowControl> mpMediaWindowControl;
BitmapEx* mpEmptyBmpEx;
BitmapEx* mpAudioBmpEx;
};
diff --git a/basctl/source/basicide/basdoc.cxx b/basctl/source/basicide/basdoc.cxx
index 7f0388960c11..93302febee1d 100644
--- a/basctl/source/basicide/basdoc.cxx
+++ b/basctl/source/basicide/basdoc.cxx
@@ -51,7 +51,9 @@ DocShell::DocShell()
}
DocShell::~DocShell()
-{ }
+{
+ pPrinter.disposeAndClear();
+}
SfxPrinter* DocShell::GetPrinter( bool bCreate )
{
@@ -66,7 +68,10 @@ SfxPrinter* DocShell::GetPrinter( bool bCreate )
void DocShell::SetPrinter( SfxPrinter* pPr )
{
if (pPr != pPrinter.get())
+ {
+ pPrinter.disposeAndClear();
pPrinter.reset(pPr);
+ }
}
void DocShell::FillClass( SvGlobalName*, SotClipboardFormatId*, OUString*, OUString*, OUString*, sal_Int32, bool bTemplate) const
diff --git a/basctl/source/basicide/basdoc.hxx b/basctl/source/basicide/basdoc.hxx
index 5b6210d5dcab..083049ce073d 100644
--- a/basctl/source/basicide/basdoc.hxx
+++ b/basctl/source/basicide/basdoc.hxx
@@ -23,17 +23,16 @@
#include <iderid.hxx>
#include <sfx2/docfac.hxx>
#include <svx/ifaceids.hxx>
-
+#include <vcl/vclptr.hxx>
+#include <sfx2/printer.hxx>
#include <boost/scoped_ptr.hpp>
-class SfxPrinter;
-
namespace basctl
{
class DocShell: public SfxObjectShell
{
- boost::scoped_ptr<SfxPrinter> pPrinter;
+ ScopedVclPtr<SfxPrinter> pPrinter;
protected:
virtual void Draw( OutputDevice *, const JobSetup & rSetup,
diff --git a/basctl/source/basicide/basicbox.cxx b/basctl/source/basicide/basicbox.cxx
index d4cbae63aa88..a774c1bd796d 100644
--- a/basctl/source/basicide/basicbox.cxx
+++ b/basctl/source/basicide/basicbox.cxx
@@ -46,12 +46,6 @@ LibBoxControl::LibBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx
-LibBoxControl::~LibBoxControl()
-{
-}
-
-
-
void LibBoxControl::StateChanged( sal_uInt16, SfxItemState eState, const SfxPoolItem* pState )
{
LibBox* pBox = static_cast<LibBox*>(GetToolBox().GetItemWindow(GetId()));
@@ -71,9 +65,9 @@ void LibBoxControl::StateChanged( sal_uInt16, SfxItemState eState, const SfxPool
-vcl::Window* LibBoxControl::CreateItemWindow( vcl::Window *pParent )
+VclPtr<vcl::Window> LibBoxControl::CreateItemWindow( vcl::Window *pParent )
{
- return new LibBox( pParent, m_xFrame );
+ return VclPtr<LibBox>::Create( pParent, m_xFrame );
}
@@ -88,7 +82,13 @@ DocListenerBox::DocListenerBox( vcl::Window* pParent )
DocListenerBox::~DocListenerBox()
{
+ disposeOnce();
+}
+
+void DocListenerBox::dispose()
+{
m_aNotifier.dispose();
+ ListBox::dispose();
}
void DocListenerBox::onDocumentCreated( const ScriptDocument& /*_rDocument*/ )
@@ -156,7 +156,13 @@ LibBox::LibBox( vcl::Window* pParent, const uno::Reference< frame::XFrame >& rFr
LibBox::~LibBox()
{
+ disposeOnce();
+}
+
+void LibBox::dispose()
+{
ClearBox();
+ DocListenerBox::dispose();
}
void LibBox::Update( const SfxStringItem* pItem )
@@ -341,10 +347,6 @@ LanguageBoxControl::LanguageBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, Tool
{
}
-LanguageBoxControl::~LanguageBoxControl()
-{
-}
-
void LanguageBoxControl::StateChanged( sal_uInt16 nID, SfxItemState eState, const SfxPoolItem* pItem )
{
(void)nID;
@@ -360,9 +362,9 @@ void LanguageBoxControl::StateChanged( sal_uInt16 nID, SfxItemState eState, cons
}
}
-vcl::Window* LanguageBoxControl::CreateItemWindow( vcl::Window *pParent )
+VclPtr<vcl::Window> LanguageBoxControl::CreateItemWindow( vcl::Window *pParent )
{
- return new LanguageBox( pParent );
+ return VclPtr<LanguageBox>::Create( pParent );
}
// class basctl::LanguageBox -----------------------------------------------
@@ -384,7 +386,13 @@ LanguageBox::LanguageBox( vcl::Window* pParent ) :
LanguageBox::~LanguageBox()
{
+ disposeOnce();
+}
+
+void LanguageBox::dispose()
+{
ClearBox();
+ DocListenerBox::dispose();
}
void LanguageBox::FillBox()
diff --git a/basctl/source/basicide/basicbox.hxx b/basctl/source/basicide/basicbox.hxx
index f6d31703f7d1..3e4cc8045f04 100644
--- a/basctl/source/basicide/basicbox.hxx
+++ b/basctl/source/basicide/basicbox.hxx
@@ -33,11 +33,10 @@ public:
SFX_DECL_TOOLBOX_CONTROL();
LibBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
- virtual ~LibBoxControl();
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState ) SAL_OVERRIDE;
- virtual vcl::Window* CreateItemWindow( vcl::Window *pParent ) SAL_OVERRIDE;
+ virtual VclPtr<vcl::Window> CreateItemWindow( vcl::Window *pParent ) SAL_OVERRIDE;
};
/** base class for list boxes which need to update their content according to the list
@@ -49,6 +48,7 @@ class DocListenerBox :public ListBox
protected:
DocListenerBox( vcl::Window* pParent );
virtual ~DocListenerBox();
+ virtual void dispose() SAL_OVERRIDE;
protected:
virtual void FillBox() = 0;
@@ -95,7 +95,8 @@ protected:
public:
LibBox( vcl::Window* pParent,
const com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
- virtual ~LibBox();
+ virtual ~LibBox();
+ virtual void dispose() SAL_OVERRIDE;
using Window::Update;
void Update( const SfxStringItem* pItem );
@@ -107,10 +108,9 @@ public:
SFX_DECL_TOOLBOX_CONTROL();
LanguageBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
- virtual ~LanguageBoxControl();
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) SAL_OVERRIDE;
- virtual vcl::Window* CreateItemWindow( vcl::Window *pParent ) SAL_OVERRIDE;
+ virtual VclPtr<vcl::Window> CreateItemWindow( vcl::Window *pParent ) SAL_OVERRIDE;
};
class LanguageBox : public DocListenerBox
@@ -135,6 +135,7 @@ protected:
public:
LanguageBox( vcl::Window* pParent );
virtual ~LanguageBox();
+ virtual void dispose() SAL_OVERRIDE;
using Window::Update;
void Update( const SfxStringItem* pItem );
diff --git a/basctl/source/basicide/basicrenderable.cxx b/basctl/source/basicide/basicrenderable.cxx
index ee5ed4bef958..72814178984b 100644
--- a/basctl/source/basicide/basicrenderable.cxx
+++ b/basctl/source/basicide/basicrenderable.cxx
@@ -77,17 +77,17 @@ Renderable::~Renderable()
{
}
-Printer* Renderable::getPrinter()
+VclPtr< Printer > Renderable::getPrinter()
{
- Printer* pPrinter = NULL;
+ VclPtr< Printer > pPrinter;
Any aValue( getValue( "RenderDevice" ) );
Reference<awt::XDevice> xRenderDevice;
if( aValue >>= xRenderDevice )
{
VCLXDevice* pDevice = VCLXDevice::GetImplementation(xRenderDevice);
- OutputDevice* pOut = pDevice ? pDevice->GetOutputDevice() : NULL;
- pPrinter = dynamic_cast<Printer*>(pOut);
+ VclPtr< OutputDevice > pOut = pDevice ? pDevice->GetOutputDevice() : VclPtr< OutputDevice >();
+ pPrinter = dynamic_cast<Printer*>(pOut.get());
}
return pPrinter;
}
diff --git a/basctl/source/basicide/basicrenderable.hxx b/basctl/source/basicide/basicrenderable.hxx
index f91a5ef8a9d3..dd60f1653b03 100644
--- a/basctl/source/basicide/basicrenderable.hxx
+++ b/basctl/source/basicide/basicrenderable.hxx
@@ -33,10 +33,10 @@ class Renderable :
public cppu::WeakComponentImplHelper1< com::sun::star::view::XRenderable >,
public vcl::PrinterOptionsHelper
{
- BaseWindow* mpWindow;
+ VclPtr<BaseWindow> mpWindow;
osl::Mutex maMutex;
- Printer* getPrinter();
+ VclPtr<Printer> getPrinter();
public:
Renderable (BaseWindow*);
virtual ~Renderable();
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index 1c11bb11a24d..f6e491a03abe 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -192,10 +192,10 @@ ModulWindow::ModulWindow (
BaseWindow(pParent, rDocument, aLibName, aName),
rLayout(*pParent),
nValid(ValidWindow),
- aXEditorWindow(this),
+ aXEditorWindow(VclPtr<ComplexEditorWindow>::Create(this)),
m_aModule(aModule)
{
- aXEditorWindow.Show();
+ aXEditorWindow->Show();
SetBackground();
}
@@ -227,9 +227,15 @@ SbModuleRef ModulWindow::XModule()
ModulWindow::~ModulWindow()
{
- nValid = 0;
+ disposeOnce();
+}
+void ModulWindow::dispose()
+{
+ nValid = 0;
StarBASIC::Stop();
+ aXEditorWindow.disposeAndClear();
+ BaseWindow::dispose();
}
@@ -237,7 +243,7 @@ void ModulWindow::GetFocus()
{
if (nValid != ValidWindow)
return;
- aXEditorWindow.GetEdtWindow().GrabFocus();
+ aXEditorWindow->GetEdtWindow().GrabFocus();
// don't call basic calls because focus is somewhere else...
}
@@ -256,7 +262,7 @@ void ModulWindow::Paint( const Rectangle& )
void ModulWindow::Resize()
{
- aXEditorWindow.SetPosSizePixel( Point( 0, 0 ),
+ aXEditorWindow->SetPosSizePixel( Point( 0, 0 ),
Size( GetOutputSizePixel() ) );
}
@@ -580,7 +586,7 @@ bool ModulWindow::BasicToggleBreakPoint()
bNewBreakPoint = true;
}
- aXEditorWindow.GetBrkWindow().Invalidate();
+ aXEditorWindow->GetBrkWindow().Invalidate();
return bNewBreakPoint;
}
@@ -613,8 +619,8 @@ void ModulWindow::BasicToggleBreakPointEnabled()
void ModulWindow::ManageBreakPoints()
{
BreakPointWindow& rBrkWin = GetBreakPointWindow();
- BreakPointDialog aBrkDlg( &rBrkWin, GetBreakPoints() );
- aBrkDlg.Execute();
+ ScopedVclPtrInstance< BreakPointDialog > aBrkDlg( &rBrkWin, GetBreakPoints() );
+ aBrkDlg->Execute();
rBrkWin.Invalidate();
}
@@ -638,7 +644,7 @@ bool ModulWindow::BasicErrorHdl( StarBASIC * pBasic )
// if other basic, the IDE should try to display the correct module
bool const bMarkError = pBasic == GetBasic();
if ( bMarkError )
- aXEditorWindow.GetBrkWindow().SetMarkerPos(nErrorLine, true);
+ aXEditorWindow->GetBrkWindow().SetMarkerPos(nErrorLine, true);
// #i47002#
Reference< awt::XWindow > xWindow = VCLUnoHelper::GetInterface( this );
@@ -651,7 +657,7 @@ bool ModulWindow::BasicErrorHdl( StarBASIC * pBasic )
return false;
if ( bMarkError )
- aXEditorWindow.GetBrkWindow().SetNoMarker();
+ aXEditorWindow->GetBrkWindow().SetNoMarker();
return false;
}
@@ -676,7 +682,7 @@ long ModulWindow::BasicBreakHdl( StarBASIC* pBasic )
AssertValidEditEngine();
GetEditView()->SetSelection( TextSelection( TextPaM( nErrorLine, 0 ), TextPaM( nErrorLine, 0 ) ) );
- aXEditorWindow.GetBrkWindow().SetMarkerPos( nErrorLine );
+ aXEditorWindow->GetBrkWindow().SetMarkerPos( nErrorLine );
rLayout.UpdateDebug(false);
@@ -691,7 +697,7 @@ long ModulWindow::BasicBreakHdl( StarBASIC* pBasic )
Application::Yield();
aStatus.bIsInReschedule = false;
- aXEditorWindow.GetBrkWindow().SetNoMarker();
+ aXEditorWindow->GetBrkWindow().SetNoMarker();
ClearStatus( BASWIN_INRESCHEDULE );
@@ -1022,7 +1028,7 @@ void ModulWindow::ExecuteCommand (SfxRequest& rReq)
{
SFX_REQUEST_ARG(rReq, pItem, SfxBoolItem, rReq.GetSlot(), false);
bSourceLinesEnabled = pItem && pItem->GetValue();
- aXEditorWindow.SetLineNumberDisplay(bSourceLinesEnabled);
+ aXEditorWindow->SetLineNumberDisplay(bSourceLinesEnabled);
}
break;
case SID_BASICIDE_DELETECURRENT:
@@ -1037,9 +1043,9 @@ void ModulWindow::ExecuteCommand (SfxRequest& rReq)
break;
case SID_GOTOLINE:
{
- GotoLineDialog aGotoDlg(this);
- if (aGotoDlg.Execute())
- if (sal_Int32 const nLine = aGotoDlg.GetLineNumber())
+ ScopedVclPtrInstance< GotoLineDialog > aGotoDlg(this);
+ if (aGotoDlg->Execute())
+ if (sal_Int32 const nLine = aGotoDlg->GetLineNumber())
{
TextSelection const aSel(TextPaM(nLine - 1, 0), TextPaM(nLine - 1, 0));
GetEditView()->SetSelection(aSel);
@@ -1236,7 +1242,7 @@ void ModulWindow::AssertValidEditEngine()
void ModulWindow::Activating ()
{
- aXEditorWindow.SetLineNumberDisplay(bSourceLinesEnabled);
+ aXEditorWindow->SetLineNumberDisplay(bSourceLinesEnabled);
Show();
}
@@ -1420,7 +1426,7 @@ bool ModulWindow::IsPasteAllowed()
void ModulWindow::OnNewDocument ()
{
- aXEditorWindow.SetLineNumberDisplay(bSourceLinesEnabled);
+ aXEditorWindow->SetLineNumberDisplay(bSourceLinesEnabled);
}
char const* ModulWindow::GetHid () const
@@ -1464,15 +1470,28 @@ void ModulWindow::UpdateModule ()
ModulWindowLayout::ModulWindowLayout (vcl::Window* pParent, ObjectCatalog& rObjectCatalog_) :
Layout(pParent),
pChild(0),
- aWatchWindow(this),
- aStackWindow(this),
+ aWatchWindow(VclPtr<WatchWindow>::Create(this)),
+ aStackWindow(VclPtr<StackWindow>::Create(this)),
rObjectCatalog(rObjectCatalog_)
{ }
+ModulWindowLayout::~ModulWindowLayout()
+{
+ disposeOnce();
+}
+
+void ModulWindowLayout::dispose()
+{
+ aWatchWindow.disposeAndClear();
+ aStackWindow.disposeAndClear();
+ pChild.clear();
+ Layout::dispose();
+}
+
void ModulWindowLayout::UpdateDebug (bool bBasicStopped)
{
- aWatchWindow.UpdateWatches(bBasicStopped);
- aStackWindow.UpdateCalls();
+ aWatchWindow->UpdateWatches(bBasicStopped);
+ aStackWindow->UpdateCalls();
}
void ModulWindowLayout::Paint (Rectangle const&)
@@ -1493,8 +1512,8 @@ void ModulWindowLayout::Activating (BaseWindow& rChild)
{
assert(dynamic_cast<ModulWindow*>(&rChild));
pChild = &static_cast<ModulWindow&>(rChild);
- aWatchWindow.Show();
- aStackWindow.Show();
+ aWatchWindow->Show();
+ aStackWindow->Show();
rObjectCatalog.Show();
rObjectCatalog.SetLayoutWindow(this);
rObjectCatalog.UpdateEntries();
@@ -1506,8 +1525,8 @@ void ModulWindowLayout::Deactivating ()
{
aSyntaxColors.SetActiveEditor(0);
Layout::Deactivating();
- aWatchWindow.Hide();
- aStackWindow.Hide();
+ aWatchWindow->Hide();
+ aStackWindow->Hide();
rObjectCatalog.Hide();
pChild = 0;
}
@@ -1528,19 +1547,19 @@ void ModulWindowLayout::GetState (SfxItemSet &rSet, unsigned nWhich)
void ModulWindowLayout::BasicAddWatch (OUString const& rWatchStr)
{
- aWatchWindow.AddWatch(rWatchStr);
+ aWatchWindow->AddWatch(rWatchStr);
}
void ModulWindowLayout::BasicRemoveWatch ()
{
- aWatchWindow.RemoveSelectedWatch();
+ aWatchWindow->RemoveSelectedWatch();
}
void ModulWindowLayout::OnFirstSize (long const nWidth, long const nHeight)
{
AddToLeft(&rObjectCatalog, Size(nWidth * 0.20, nHeight * 0.75));
- AddToBottom(&aWatchWindow, Size(nWidth * 0.67, nHeight * 0.25));
- AddToBottom(&aStackWindow, Size(nWidth * 0.33, nHeight * 0.25));
+ AddToBottom(aWatchWindow.get(), Size(nWidth * 0.67, nHeight * 0.25));
+ AddToBottom(aStackWindow.get(), Size(nWidth * 0.33, nHeight * 0.25));
}
diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx
index a5c3b91fc29e..2d5afed4fb17 100644
--- a/basctl/source/basicide/baside2.hxx
+++ b/basctl/source/basicide/baside2.hxx
@@ -109,7 +109,7 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >
GetComponentInterface(bool bCreate = true) SAL_OVERRIDE;
CodeCompleteDataCache aCodeCompleteCache;
- boost::scoped_ptr< CodeCompleteWindow > pCodeCompleteWnd;
+ VclPtr<CodeCompleteWindow> pCodeCompleteWnd;
OUString GetActualSubName( sal_uLong nLine ); // gets the actual subroutine name according to line number
void SetupAndShowCodeCompleteWnd(const std::vector< OUString >& aEntryVect, TextSelection aSel );
void HandleAutoCorrect();
@@ -137,6 +137,7 @@ protected:
public:
EditorWindow (vcl::Window* pParent, ModulWindow*);
virtual ~EditorWindow();
+ virtual void dispose() SAL_OVERRIDE;
ExtTextEngine* GetEditEngine() const { return pEditEngine.get(); }
ExtTextView* GetEditView() const { return pEditView.get(); }
@@ -186,7 +187,6 @@ protected:
public:
BreakPointWindow (vcl::Window* pParent, ModulWindow*);
- virtual ~BreakPointWindow();
void SetMarkerPos( sal_uInt16 nLine, bool bErrorMarker = false );
void SetNoMarker ();
@@ -211,6 +211,7 @@ protected:
public:
WatchTreeListBox( vcl::Window* pParent, WinBits nWinBits );
virtual ~WatchTreeListBox();
+ virtual void dispose() SAL_OVERRIDE;
void RequestingChildren( SvTreeListEntry * pParent ) SAL_OVERRIDE;
void UpdateWatches( bool bBasicStopped = false );
@@ -225,10 +226,10 @@ class WatchWindow : public DockingWindow
{
private:
OUString aWatchStr;
- ExtendedEdit aXEdit;
- ImageButton aRemoveWatchButton;
- WatchTreeListBox aTreeListBox;
- HeaderBar aHeaderBar;
+ VclPtr<ExtendedEdit> aXEdit;
+ VclPtr<ImageButton> aRemoveWatchButton;
+ VclPtr<WatchTreeListBox> aTreeListBox;
+ VclPtr<HeaderBar> aHeaderBar;
protected:
virtual void Resize() SAL_OVERRIDE;
@@ -243,20 +244,21 @@ protected:
public:
WatchWindow (Layout* pParent);
virtual ~WatchWindow();
+ virtual void dispose() SAL_OVERRIDE;
void AddWatch( const OUString& rVName );
bool RemoveSelectedWatch();
void UpdateWatches( bool bBasicStopped = false );
- WatchTreeListBox& GetWatchTreeListBox() { return aTreeListBox; }
+ WatchTreeListBox& GetWatchTreeListBox() { return *aTreeListBox.get(); }
};
class StackWindow : public DockingWindow
{
private:
- SvTreeListBox aTreeListBox;
- OUString aStackStr;
+ VclPtr<SvTreeListBox> aTreeListBox;
+ OUString aStackStr;
protected:
virtual void Resize() SAL_OVERRIDE;
@@ -265,6 +267,7 @@ protected:
public:
StackWindow (Layout* pParent);
virtual ~StackWindow();
+ virtual void dispose() SAL_OVERRIDE;
void UpdateCalls();
};
@@ -273,10 +276,10 @@ public:
class ComplexEditorWindow : public vcl::Window
{
private:
- BreakPointWindow aBrkWindow;
- LineNumberWindow aLineNumberWindow;
- EditorWindow aEdtWindow;
- ScrollBar aEWVScrollBar;
+ VclPtr<BreakPointWindow> aBrkWindow;
+ VclPtr<LineNumberWindow> aLineNumberWindow;
+ VclPtr<EditorWindow> aEdtWindow;
+ VclPtr<ScrollBar> aEWVScrollBar;
virtual void DataChanged(DataChangedEvent const & rDCEvt) SAL_OVERRIDE;
@@ -286,11 +289,12 @@ protected:
public:
ComplexEditorWindow( ModulWindow* pParent );
-
- BreakPointWindow& GetBrkWindow() { return aBrkWindow; }
- LineNumberWindow& GetLineNumberWindow() { return aLineNumberWindow; }
- EditorWindow& GetEdtWindow() { return aEdtWindow; }
- ScrollBar& GetEWVScrollBar() { return aEWVScrollBar; }
+ virtual ~ComplexEditorWindow();
+ virtual void dispose() SAL_OVERRIDE;
+ BreakPointWindow& GetBrkWindow() { return *aBrkWindow.get(); }
+ LineNumberWindow& GetLineNumberWindow() { return *aLineNumberWindow.get(); }
+ EditorWindow& GetEdtWindow() { return *aEdtWindow.get(); }
+ ScrollBar& GetEWVScrollBar() { return *aEWVScrollBar.get(); }
void SetLineNumberDisplay(bool b);
};
@@ -302,7 +306,7 @@ private:
ModulWindowLayout& rLayout;
StarBASICRef xBasic;
short nValid;
- ComplexEditorWindow aXEditorWindow;
+ VclPtr<ComplexEditorWindow> aXEditorWindow;
BasicStatus aStatus;
SbModuleRef xModule;
OUString aCurPath;
@@ -328,6 +332,7 @@ public:
ModulWindow( ModulWindowLayout* pParent, const ScriptDocument& rDocument, const OUString& aLibName, const OUString& aName, OUString& aModule );
virtual ~ModulWindow();
+ virtual void dispose() SAL_OVERRIDE;
virtual void ExecuteCommand (SfxRequest& rReq) SAL_OVERRIDE;
virtual void ExecuteGlobal (SfxRequest& rReq) SAL_OVERRIDE;
@@ -386,10 +391,10 @@ public:
virtual SearchOptionFlags GetSearchOptions() SAL_OVERRIDE;
virtual sal_uInt16 StartSearchAndReplace (SvxSearchItem const&, bool bFromStart = false) SAL_OVERRIDE;
- EditorWindow& GetEditorWindow() { return aXEditorWindow.GetEdtWindow(); }
- BreakPointWindow& GetBreakPointWindow() { return aXEditorWindow.GetBrkWindow(); }
- LineNumberWindow& GetLineNumberWindow() { return aXEditorWindow.GetLineNumberWindow(); }
- ScrollBar& GetEditVScrollBar() { return aXEditorWindow.GetEWVScrollBar(); }
+ EditorWindow& GetEditorWindow() { return aXEditorWindow->GetEdtWindow(); }
+ BreakPointWindow& GetBreakPointWindow() { return aXEditorWindow->GetBrkWindow(); }
+ LineNumberWindow& GetLineNumberWindow() { return aXEditorWindow->GetLineNumberWindow(); }
+ ScrollBar& GetEditVScrollBar() { return aXEditorWindow->GetEWVScrollBar(); }
ExtTextEngine* GetEditEngine() { return GetEditorWindow().GetEditEngine(); }
ExtTextView* GetEditView() { return GetEditorWindow().GetEditView(); }
BreakPointList& GetBreakPoints() { return GetBreakPointWindow().GetBreakPoints(); }
@@ -419,6 +424,8 @@ class ModulWindowLayout: public Layout
{
public:
ModulWindowLayout (vcl::Window* pParent, ObjectCatalog&);
+ virtual ~ModulWindowLayout();
+ virtual void dispose() SAL_OVERRIDE;
public:
// Layout:
virtual void Activating (BaseWindow&) SAL_OVERRIDE;
@@ -438,10 +445,10 @@ protected:
private:
// main child window
- ModulWindow* pChild;
+ VclPtr<ModulWindow> pChild;
// dockable windows
- WatchWindow aWatchWindow;
- StackWindow aStackWindow;
+ VclPtr<WatchWindow> aWatchWindow;
+ VclPtr<StackWindow> aStackWindow;
ObjectCatalog& rObjectCatalog;
private:
virtual void DataChanged (DataChangedEvent const& rDCEvt) SAL_OVERRIDE;
@@ -468,7 +475,7 @@ private:
// the configuration
svtools::ColorConfig aConfig;
// the active editor
- EditorWindow* pEditor;
+ VclPtr<EditorWindow> pEditor;
} aSyntaxColors;
};
@@ -482,7 +489,7 @@ private:
/* a buffer to build up function name when typing
* a function name, used for showing/hiding listbox values
* */
- CodeCompleteWindow* pCodeCompleteWindow; // parent window
+ VclPtr<CodeCompleteWindow> pCodeCompleteWindow; // parent window
void SetMatchingEntries(); // sets the visible entries based on aFuncBuffer variable
void HideAndRestoreFocus();
@@ -490,6 +497,8 @@ private:
public:
CodeCompleteListBox( CodeCompleteWindow* pPar );
+ virtual ~CodeCompleteListBox();
+ virtual void dispose() SAL_OVERRIDE;
void InsertSelectedEntry(); //insert the selected entry
DECL_LINK(ImplDoubleClickHdl, void*);
@@ -503,15 +512,16 @@ class CodeCompleteWindow: public vcl::Window
{
friend class CodeCompleteListBox;
private:
- EditorWindow* pParent; // parent window
+ VclPtr<EditorWindow> pParent; // parent window
TextSelection aTextSelection;
- CodeCompleteListBox* pListBox;
+ VclPtr<CodeCompleteListBox> pListBox;
void InitListBox(); // initialize the ListBox
public:
CodeCompleteWindow( EditorWindow* pPar );
- virtual ~CodeCompleteWindow(){ delete pListBox; }
+ virtual ~CodeCompleteWindow();
+ virtual void dispose() SAL_OVERRIDE;
void InsertEntry( const OUString& aStr );
void ClearListBox();
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 46796215108f..fbf4da6470bf 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -227,7 +227,7 @@ EditorWindow::EditorWindow (vcl::Window* pParent, ModulWindow* pModulWindow) :
bHighlightning(false),
bDoSyntaxHighlight(true),
bDelayHighlight(true),
- pCodeCompleteWnd(new CodeCompleteWindow(this))
+ pCodeCompleteWnd(VclPtr<CodeCompleteWindow>::Create(this))
{
SetBackground(Wallpaper(GetSettings().GetStyleSettings().GetFieldColor()));
SetPointer( Pointer( POINTER_TEXT ) );
@@ -250,6 +250,11 @@ EditorWindow::EditorWindow (vcl::Window* pParent, ModulWindow* pModulWindow) :
EditorWindow::~EditorWindow()
{
+ disposeOnce();
+}
+
+void EditorWindow::dispose()
+{
Reference< beans::XMultiPropertySet > n;
{
osl::MutexGuard g(mutex_);
@@ -266,6 +271,8 @@ EditorWindow::~EditorWindow()
EndListening( *pEditEngine );
pEditEngine->RemoveView(pEditView.get());
}
+ pCodeCompleteWnd.disposeAndClear();
+ vcl::Window::dispose();
}
OUString EditorWindow::GetWordAtCursor()
@@ -1376,12 +1383,6 @@ BreakPointWindow::BreakPointWindow (vcl::Window* pParent, ModulWindow* pModulWin
SetHelpId(HID_BASICIDE_BREAKPOINTWINDOW);
}
-BreakPointWindow::~BreakPointWindow()
-{
-}
-
-
-
void BreakPointWindow::Paint( const Rectangle& )
{
if ( SyncYOffset() )
@@ -1519,9 +1520,9 @@ void BreakPointWindow::Command( const CommandEvent& rCEvt )
break;
case RID_BRKPROPS:
{
- BreakPointDialog aBrkDlg( this, GetBreakPoints() );
- aBrkDlg.SetCurrentBreakPoint( pBrk );
- aBrkDlg.Execute();
+ ScopedVclPtrInstance< BreakPointDialog > aBrkDlg( this, GetBreakPoints() );
+ aBrkDlg->SetCurrentBreakPoint( pBrk );
+ aBrkDlg->Execute();
Invalidate();
}
break;
@@ -1534,8 +1535,8 @@ void BreakPointWindow::Command( const CommandEvent& rCEvt )
{
case RID_BRKDLG:
{
- BreakPointDialog aBrkDlg( this, GetBreakPoints() );
- aBrkDlg.Execute();
+ ScopedVclPtrInstance< BreakPointDialog > aBrkDlg( this, GetBreakPoints() );
+ aBrkDlg->Execute();
Invalidate();
}
break;
@@ -1598,69 +1599,69 @@ namespace
WatchWindow::WatchWindow (Layout* pParent) :
DockingWindow(pParent),
aWatchStr( IDEResId( RID_STR_REMOVEWATCH ) ),
- aXEdit( this, IDEResId( RID_EDT_WATCHEDIT ) ),
- aRemoveWatchButton( this, IDEResId( RID_IMGBTN_REMOVEWATCH ) ),
- aTreeListBox( this, WB_BORDER | WB_3DLOOK | WB_HASBUTTONS | WB_HASLINES | WB_HSCROLL | WB_TABSTOP
- | WB_HASLINESATROOT | WB_HASBUTTONSATROOT ),
- aHeaderBar( this, WB_BUTTONSTYLE | WB_BORDER )
+ aXEdit( VclPtr<ExtendedEdit>::Create(this, IDEResId( RID_EDT_WATCHEDIT )) ),
+ aRemoveWatchButton( VclPtr<ImageButton>::Create(this, IDEResId( RID_IMGBTN_REMOVEWATCH )) ),
+ aTreeListBox( VclPtr<WatchTreeListBox>::Create(this, WB_BORDER | WB_3DLOOK | WB_HASBUTTONS | WB_HASLINES | WB_HSCROLL | WB_TABSTOP
+ | WB_HASLINESATROOT | WB_HASBUTTONSATROOT) ),
+ aHeaderBar( VclPtr<HeaderBar>::Create( this, WB_BUTTONSTYLE | WB_BORDER ) )
{
- aXEdit.SetAccessibleName(IDEResId(RID_STR_WATCHNAME).toString());
- aTreeListBox.SetAccessibleName(IDEResId(RID_STR_WATCHNAME).toString());
+ aXEdit->SetAccessibleName(IDEResId(RID_STR_WATCHNAME).toString());
+ aTreeListBox->SetAccessibleName(IDEResId(RID_STR_WATCHNAME).toString());
long nTextLen = GetTextWidth( aWatchStr ) + DWBORDER + 3;
- aXEdit.SetPosPixel( Point( nTextLen, 3 ) );
- aXEdit.SetAccHdl( LINK( this, WatchWindow, EditAccHdl ) );
- aXEdit.GetAccelerator().InsertItem( 1, vcl::KeyCode( KEY_RETURN ) );
- aXEdit.GetAccelerator().InsertItem( 2, vcl::KeyCode( KEY_ESCAPE ) );
- aXEdit.Show();
-
- aRemoveWatchButton.Disable();
- aRemoveWatchButton.SetClickHdl( LINK( this, WatchWindow, ButtonHdl ) );
- aRemoveWatchButton.SetPosPixel( Point( nTextLen + aXEdit.GetSizePixel().Width() + 4, 2 ) );
- Size aSz( aRemoveWatchButton.GetModeImage().GetSizePixel() );
+ aXEdit->SetPosPixel( Point( nTextLen, 3 ) );
+ aXEdit->SetAccHdl( LINK( this, WatchWindow, EditAccHdl ) );
+ aXEdit->GetAccelerator().InsertItem( 1, vcl::KeyCode( KEY_RETURN ) );
+ aXEdit->GetAccelerator().InsertItem( 2, vcl::KeyCode( KEY_ESCAPE ) );
+ aXEdit->Show();
+
+ aRemoveWatchButton->Disable();
+ aRemoveWatchButton->SetClickHdl( LINK( this, WatchWindow, ButtonHdl ) );
+ aRemoveWatchButton->SetPosPixel( Point( nTextLen + aXEdit->GetSizePixel().Width() + 4, 2 ) );
+ Size aSz( aRemoveWatchButton->GetModeImage().GetSizePixel() );
aSz.Width() += 6;
aSz.Height() += 6;
- aRemoveWatchButton.SetSizePixel( aSz );
- aRemoveWatchButton.Show();
+ aRemoveWatchButton->SetSizePixel( aSz );
+ aRemoveWatchButton->Show();
- long nRWBtnSize = aRemoveWatchButton.GetModeImage().GetSizePixel().Height() + 10;
- nVirtToolBoxHeight = aXEdit.GetSizePixel().Height() + 7;
+ long nRWBtnSize = aRemoveWatchButton->GetModeImage().GetSizePixel().Height() + 10;
+ nVirtToolBoxHeight = aXEdit->GetSizePixel().Height() + 7;
if ( nRWBtnSize > nVirtToolBoxHeight )
nVirtToolBoxHeight = nRWBtnSize;
nHeaderBarHeight = 16;
- aTreeListBox.SetHelpId(HID_BASICIDE_WATCHWINDOW_LIST);
- aTreeListBox.EnableInplaceEditing(true);
- aTreeListBox.SetSelectHdl( LINK( this, WatchWindow, TreeListHdl ) );
- aTreeListBox.SetPosPixel( Point( DWBORDER, nVirtToolBoxHeight + nHeaderBarHeight ) );
- aTreeListBox.SetHighlightRange( 1, 5 );
+ aTreeListBox->SetHelpId(HID_BASICIDE_WATCHWINDOW_LIST);
+ aTreeListBox->EnableInplaceEditing(true);
+ aTreeListBox->SetSelectHdl( LINK( this, WatchWindow, TreeListHdl ) );
+ aTreeListBox->SetPosPixel( Point( DWBORDER, nVirtToolBoxHeight + nHeaderBarHeight ) );
+ aTreeListBox->SetHighlightRange( 1, 5 );
Point aPnt( DWBORDER, nVirtToolBoxHeight + 1 );
- aHeaderBar.SetPosPixel( aPnt );
- aHeaderBar.SetEndDragHdl( LINK( this, WatchWindow, implEndDragHdl ) );
+ aHeaderBar->SetPosPixel( aPnt );
+ aHeaderBar->SetEndDragHdl( LINK( this, WatchWindow, implEndDragHdl ) );
long nVarTabWidth = 220;
long nValueTabWidth = 100;
long nTypeTabWidth = 1250;
- aHeaderBar.InsertItem( ITEM_ID_VARIABLE, IDEResId(RID_STR_WATCHVARIABLE).toString(), nVarTabWidth );
- aHeaderBar.InsertItem( ITEM_ID_VALUE, IDEResId(RID_STR_WATCHVALUE).toString(), nValueTabWidth );
- aHeaderBar.InsertItem( ITEM_ID_TYPE, IDEResId(RID_STR_WATCHTYPE).toString(), nTypeTabWidth );
+ aHeaderBar->InsertItem( ITEM_ID_VARIABLE, IDEResId(RID_STR_WATCHVARIABLE).toString(), nVarTabWidth );
+ aHeaderBar->InsertItem( ITEM_ID_VALUE, IDEResId(RID_STR_WATCHVALUE).toString(), nValueTabWidth );
+ aHeaderBar->InsertItem( ITEM_ID_TYPE, IDEResId(RID_STR_WATCHTYPE).toString(), nTypeTabWidth );
long tabs[ 4 ];
tabs[ 0 ] = 3; // two tabs
tabs[ 1 ] = 0;
tabs[ 2 ] = nVarTabWidth;
tabs[ 3 ] = nVarTabWidth + nValueTabWidth;
- aTreeListBox.SvHeaderTabListBox::SetTabs( tabs, MAP_PIXEL );
- aTreeListBox.InitHeaderBar( &aHeaderBar );
+ aTreeListBox->SvHeaderTabListBox::SetTabs( tabs, MAP_PIXEL );
+ aTreeListBox->InitHeaderBar( aHeaderBar.get() );
- aTreeListBox.SetNodeDefaultImages( );
+ aTreeListBox->SetNodeDefaultImages( );
- aHeaderBar.Show();
+ aHeaderBar->Show();
- aTreeListBox.Show();
+ aTreeListBox->Show();
SetText(IDEResId(RID_STR_WATCHNAME).toString());
@@ -1674,7 +1675,18 @@ WatchWindow::WatchWindow (Layout* pParent) :
WatchWindow::~WatchWindow()
{
- GetSystemWindow()->GetTaskPaneList()->RemoveWindow( this );
+ disposeOnce();
+}
+
+void WatchWindow::dispose()
+{
+ aXEdit.disposeAndClear();
+ aRemoveWatchButton.disposeAndClear();
+ aHeaderBar.disposeAndClear();
+ aTreeListBox.disposeAndClear();
+ if (!IsDisposed())
+ GetSystemWindow()->GetTaskPaneList()->RemoveWindow( this );
+ DockingWindow::dispose();
}
@@ -1698,11 +1710,11 @@ void WatchWindow::Resize()
aBoxSz.Height() = 0;
aBoxSz.Height() -= nHeaderBarHeight;
- aTreeListBox.SetSizePixel( aBoxSz );
- aTreeListBox.GetHScroll()->SetPageSize( aTreeListBox.GetHScroll()->GetVisibleSize() );
+ aTreeListBox->SetSizePixel( aBoxSz );
+ aTreeListBox->GetHScroll()->SetPageSize( aTreeListBox->GetHScroll()->GetVisibleSize() );
aBoxSz.Height() = nHeaderBarHeight;
- aHeaderBar.SetSizePixel( aBoxSz );
+ aHeaderBar->SetSizePixel( aBoxSz );
Invalidate();
}
@@ -1766,29 +1778,29 @@ void WatchWindow::AddWatch( const OUString& rVName )
OUString aWatchStr_( aVar );
aWatchStr_ += "\t\t";
- SvTreeListEntry* pNewEntry = aTreeListBox.InsertEntry( aWatchStr_, 0, true, TREELIST_APPEND );
+ SvTreeListEntry* pNewEntry = aTreeListBox->InsertEntry( aWatchStr_, 0, true, TREELIST_APPEND );
pNewEntry->SetUserData( pWatchItem );
- aTreeListBox.Select(pNewEntry, true);
- aTreeListBox.MakeVisible(pNewEntry);
- aRemoveWatchButton.Enable();
+ aTreeListBox->Select(pNewEntry, true);
+ aTreeListBox->MakeVisible(pNewEntry);
+ aRemoveWatchButton->Enable();
UpdateWatches();
}
bool WatchWindow::RemoveSelectedWatch()
{
- SvTreeListEntry* pEntry = aTreeListBox.GetCurEntry();
+ SvTreeListEntry* pEntry = aTreeListBox->GetCurEntry();
if ( pEntry )
{
- aTreeListBox.GetModel()->Remove( pEntry );
- pEntry = aTreeListBox.GetCurEntry();
+ aTreeListBox->GetModel()->Remove( pEntry );
+ pEntry = aTreeListBox->GetCurEntry();
if ( pEntry )
- aXEdit.SetText( static_cast<WatchItem*>(pEntry->GetUserData())->maName );
+ aXEdit->SetText( static_cast<WatchItem*>(pEntry->GetUserData())->maName );
else
- aXEdit.SetText( OUString() );
- if ( !aTreeListBox.GetEntryCount() )
- aRemoveWatchButton.Disable();
+ aXEdit->SetText( OUString() );
+ if ( !aTreeListBox->GetEntryCount() )
+ aRemoveWatchButton->Disable();
return true;
}
else
@@ -1798,7 +1810,7 @@ bool WatchWindow::RemoveSelectedWatch()
IMPL_LINK_INLINE_START( WatchWindow, ButtonHdl, ImageButton *, pButton )
{
- if (pButton == &aRemoveWatchButton)
+ if (pButton == aRemoveWatchButton.get())
if (SfxDispatcher* pDispatcher = GetDispatcher())
pDispatcher->Execute(SID_BASICIDE_REMOVEWATCH);
return 0;
@@ -1809,9 +1821,9 @@ IMPL_LINK_INLINE_END( WatchWindow, ButtonHdl, ImageButton *, pButton )
IMPL_LINK_NOARG_INLINE_START(WatchWindow, TreeListHdl)
{
- SvTreeListEntry* pCurEntry = aTreeListBox.GetCurEntry();
+ SvTreeListEntry* pCurEntry = aTreeListBox->GetCurEntry();
if ( pCurEntry && pCurEntry->GetUserData() )
- aXEdit.SetText( static_cast<WatchItem*>(pCurEntry->GetUserData())->maName );
+ aXEdit->SetText( static_cast<WatchItem*>(pCurEntry->GetUserData())->maName );
return 0;
}
@@ -1824,29 +1836,29 @@ IMPL_LINK_INLINE_START( WatchWindow, implEndDragHdl, HeaderBar *, pBar )
const sal_Int32 TAB_WIDTH_MIN = 10;
sal_Int32 nMaxWidth =
- aHeaderBar.GetSizePixel().getWidth() - 2 * TAB_WIDTH_MIN;
+ aHeaderBar->GetSizePixel().getWidth() - 2 * TAB_WIDTH_MIN;
- sal_Int32 nVariableWith = aHeaderBar.GetItemSize( ITEM_ID_VARIABLE );
+ sal_Int32 nVariableWith = aHeaderBar->GetItemSize( ITEM_ID_VARIABLE );
if( nVariableWith < TAB_WIDTH_MIN )
- aHeaderBar.SetItemSize( ITEM_ID_VARIABLE, TAB_WIDTH_MIN );
+ aHeaderBar->SetItemSize( ITEM_ID_VARIABLE, TAB_WIDTH_MIN );
else if( nVariableWith > nMaxWidth )
- aHeaderBar.SetItemSize( ITEM_ID_VARIABLE, nMaxWidth );
+ aHeaderBar->SetItemSize( ITEM_ID_VARIABLE, nMaxWidth );
- sal_Int32 nValueWith = aHeaderBar.GetItemSize( ITEM_ID_VALUE );
+ sal_Int32 nValueWith = aHeaderBar->GetItemSize( ITEM_ID_VALUE );
if( nValueWith < TAB_WIDTH_MIN )
- aHeaderBar.SetItemSize( ITEM_ID_VALUE, TAB_WIDTH_MIN );
+ aHeaderBar->SetItemSize( ITEM_ID_VALUE, TAB_WIDTH_MIN );
else if( nValueWith > nMaxWidth )
- aHeaderBar.SetItemSize( ITEM_ID_VALUE, nMaxWidth );
+ aHeaderBar->SetItemSize( ITEM_ID_VALUE, nMaxWidth );
- if (aHeaderBar.GetItemSize( ITEM_ID_TYPE ) < TAB_WIDTH_MIN)
- aHeaderBar.SetItemSize( ITEM_ID_TYPE, TAB_WIDTH_MIN );
+ if (aHeaderBar->GetItemSize( ITEM_ID_TYPE ) < TAB_WIDTH_MIN)
+ aHeaderBar->SetItemSize( ITEM_ID_TYPE, TAB_WIDTH_MIN );
sal_Int32 nPos = 0;
- sal_uInt16 nTabs = aHeaderBar.GetItemCount();
+ sal_uInt16 nTabs = aHeaderBar->GetItemCount();
for( sal_uInt16 i = 1 ; i < nTabs ; ++i )
{
- nPos += aHeaderBar.GetItemSize( i );
- aTreeListBox.SetTab( i, nPos, MAP_PIXEL );
+ nPos += aHeaderBar->GetItemSize( i );
+ aTreeListBox->SetTab( i, nPos, MAP_PIXEL );
}
return 0;
}
@@ -1859,17 +1871,17 @@ IMPL_LINK( WatchWindow, EditAccHdl, Accelerator *, pAcc )
{
case KEY_RETURN:
{
- OUString aCurText( aXEdit.GetText() );
+ OUString aCurText( aXEdit->GetText() );
if ( !aCurText.isEmpty() )
{
AddWatch( aCurText );
- aXEdit.SetSelection( Selection( 0, 0xFFFF ) );
+ aXEdit->SetSelection( Selection( 0, 0xFFFF ) );
}
}
break;
case KEY_ESCAPE:
{
- aXEdit.SetText( OUString() );
+ aXEdit->SetText( OUString() );
}
break;
}
@@ -1879,7 +1891,7 @@ IMPL_LINK( WatchWindow, EditAccHdl, Accelerator *, pAcc )
void WatchWindow::UpdateWatches( bool bBasicStopped )
{
- aTreeListBox.UpdateWatches( bBasicStopped );
+ aTreeListBox->UpdateWatches( bBasicStopped );
}
@@ -1890,16 +1902,16 @@ void WatchWindow::UpdateWatches( bool bBasicStopped )
StackWindow::StackWindow (Layout* pParent) :
DockingWindow(pParent),
- aTreeListBox( this, WB_BORDER | WB_3DLOOK | WB_HSCROLL | WB_TABSTOP ),
+ aTreeListBox( VclPtr<SvTreeListBox>::Create(this, WB_BORDER | WB_3DLOOK | WB_HSCROLL | WB_TABSTOP) ),
aStackStr( IDEResId( RID_STR_STACK ) )
{
- aTreeListBox.SetHelpId(HID_BASICIDE_STACKWINDOW_LIST);
- aTreeListBox.SetAccessibleName(IDEResId(RID_STR_STACKNAME).toString());
- aTreeListBox.SetPosPixel( Point( DWBORDER, nVirtToolBoxHeight ) );
- aTreeListBox.SetHighlightRange();
- aTreeListBox.SetSelectionMode( NO_SELECTION );
- aTreeListBox.InsertEntry( OUString(), 0, false, TREELIST_APPEND );
- aTreeListBox.Show();
+ aTreeListBox->SetHelpId(HID_BASICIDE_STACKWINDOW_LIST);
+ aTreeListBox->SetAccessibleName(IDEResId(RID_STR_STACKNAME).toString());
+ aTreeListBox->SetPosPixel( Point( DWBORDER, nVirtToolBoxHeight ) );
+ aTreeListBox->SetHighlightRange();
+ aTreeListBox->SetSelectionMode( NO_SELECTION );
+ aTreeListBox->InsertEntry( OUString(), 0, false, TREELIST_APPEND );
+ aTreeListBox->Show();
SetText(IDEResId(RID_STR_STACKNAME).toString());
@@ -1913,7 +1925,15 @@ StackWindow::StackWindow (Layout* pParent) :
StackWindow::~StackWindow()
{
- GetSystemWindow()->GetTaskPaneList()->RemoveWindow( this );
+ disposeOnce();
+}
+
+void StackWindow::dispose()
+{
+ if (!IsDisposed())
+ GetSystemWindow()->GetTaskPaneList()->RemoveWindow( this );
+ aTreeListBox.disposeAndClear();
+ DockingWindow::dispose();
}
@@ -1936,20 +1956,20 @@ void StackWindow::Resize()
if ( aBoxSz.Height() < 4 )
aBoxSz.Height() = 0;
- aTreeListBox.SetSizePixel( aBoxSz );
+ aTreeListBox->SetSizePixel( aBoxSz );
Invalidate();
}
void StackWindow::UpdateCalls()
{
- aTreeListBox.SetUpdateMode(false);
- aTreeListBox.Clear();
+ aTreeListBox->SetUpdateMode(false);
+ aTreeListBox->Clear();
if ( StarBASIC::IsRunning() )
{
SbxError eOld = SbxBase::GetError();
- aTreeListBox.SetSelectionMode( SINGLE_SELECTION );
+ aTreeListBox->SetSelectionMode( SINGLE_SELECTION );
sal_Int32 nScope = 0;
SbMethod* pMethod = StarBASIC::GetActiveMethod( nScope );
@@ -1998,7 +2018,7 @@ void StackWindow::UpdateCalls()
}
aEntry += ")";
}
- aTreeListBox.InsertEntry( aEntry, 0, false, TREELIST_APPEND );
+ aTreeListBox->InsertEntry( aEntry, 0, false, TREELIST_APPEND );
nScope++;
pMethod = StarBASIC::GetActiveMethod( nScope );
}
@@ -2009,11 +2029,11 @@ void StackWindow::UpdateCalls()
}
else
{
- aTreeListBox.SetSelectionMode( NO_SELECTION );
- aTreeListBox.InsertEntry( OUString(), 0, false, TREELIST_APPEND );
+ aTreeListBox->SetSelectionMode( NO_SELECTION );
+ aTreeListBox->InsertEntry( OUString(), 0, false, TREELIST_APPEND );
}
- aTreeListBox.SetUpdateMode(true);
+ aTreeListBox->SetUpdateMode(true);
}
@@ -2024,18 +2044,33 @@ void StackWindow::UpdateCalls()
ComplexEditorWindow::ComplexEditorWindow( ModulWindow* pParent ) :
Window( pParent, WB_3DLOOK | WB_CLIPCHILDREN ),
- aBrkWindow(this, pParent),
- aLineNumberWindow(this, pParent),
- aEdtWindow(this, pParent),
- aEWVScrollBar( this, WB_VSCROLL | WB_DRAG )
+ aBrkWindow(VclPtr<BreakPointWindow>::Create(this, pParent)),
+ aLineNumberWindow(VclPtr<LineNumberWindow>::Create(this, pParent)),
+ aEdtWindow(VclPtr<EditorWindow>::Create(this, pParent)),
+ aEWVScrollBar( VclPtr<ScrollBar>::Create(this, WB_VSCROLL | WB_DRAG) )
+{
+ aEdtWindow->Show();
+ aBrkWindow->Show();
+
+ aEWVScrollBar->SetLineSize(nScrollLine);
+ aEWVScrollBar->SetPageSize(nScrollPage);
+ aEWVScrollBar->SetScrollHdl( LINK( this, ComplexEditorWindow, ScrollHdl ) );
+ aEWVScrollBar->Show();
+}
+
+
+ComplexEditorWindow::~ComplexEditorWindow()
{
- aEdtWindow.Show();
- aBrkWindow.Show();
+ disposeOnce();
+}
- aEWVScrollBar.SetLineSize(nScrollLine);
- aEWVScrollBar.SetPageSize(nScrollPage);
- aEWVScrollBar.SetScrollHdl( LINK( this, ComplexEditorWindow, ScrollHdl ) );
- aEWVScrollBar.Show();
+void ComplexEditorWindow::dispose()
+{
+ aBrkWindow.disposeAndClear();
+ aLineNumberWindow.disposeAndClear();
+ aEdtWindow.disposeAndClear();
+ aEWVScrollBar.disposeAndClear();
+ vcl::Window::dispose();
}
void ComplexEditorWindow::Resize()
@@ -2045,40 +2080,40 @@ void ComplexEditorWindow::Resize()
aSz.Width() -= 2*DWBORDER;
aSz.Height() -= 2*DWBORDER;
long nBrkWidth = 20;
- long nSBWidth = aEWVScrollBar.GetSizePixel().Width();
+ long nSBWidth = aEWVScrollBar->GetSizePixel().Width();
Size aBrkSz(nBrkWidth, aSz.Height());
- Size aLnSz(aLineNumberWindow.GetWidth(), aSz.Height());
+ Size aLnSz(aLineNumberWindow->GetWidth(), aSz.Height());
- if (aLineNumberWindow.IsVisible())
+ if (aLineNumberWindow->IsVisible())
{
- aBrkWindow.SetPosSizePixel( Point( DWBORDER, DWBORDER ), aBrkSz );
- aLineNumberWindow.SetPosSizePixel(Point(DWBORDER + aBrkSz.Width() - 1, DWBORDER), aLnSz);
- Size aEWSz(aSz.Width() - nBrkWidth - aLineNumberWindow.GetWidth() - nSBWidth + 2, aSz.Height());
- aEdtWindow.SetPosSizePixel( Point( DWBORDER + aBrkSz.Width() + aLnSz.Width() - 1, DWBORDER ), aEWSz );
+ aBrkWindow->SetPosSizePixel( Point( DWBORDER, DWBORDER ), aBrkSz );
+ aLineNumberWindow->SetPosSizePixel(Point(DWBORDER + aBrkSz.Width() - 1, DWBORDER), aLnSz);
+ Size aEWSz(aSz.Width() - nBrkWidth - aLineNumberWindow->GetWidth() - nSBWidth + 2, aSz.Height());
+ aEdtWindow->SetPosSizePixel( Point( DWBORDER + aBrkSz.Width() + aLnSz.Width() - 1, DWBORDER ), aEWSz );
}
else
{
- aBrkWindow.SetPosSizePixel( Point( DWBORDER, DWBORDER ), aBrkSz );
+ aBrkWindow->SetPosSizePixel( Point( DWBORDER, DWBORDER ), aBrkSz );
Size aEWSz(aSz.Width() - nBrkWidth - nSBWidth + 2, aSz.Height());
- aEdtWindow.SetPosSizePixel(Point(DWBORDER + aBrkSz.Width() - 1, DWBORDER), aEWSz);
+ aEdtWindow->SetPosSizePixel(Point(DWBORDER + aBrkSz.Width() - 1, DWBORDER), aEWSz);
}
- aEWVScrollBar.SetPosSizePixel( Point( aOutSz.Width() - DWBORDER - nSBWidth, DWBORDER ), Size( nSBWidth, aSz.Height() ) );
+ aEWVScrollBar->SetPosSizePixel( Point( aOutSz.Width() - DWBORDER - nSBWidth, DWBORDER ), Size( nSBWidth, aSz.Height() ) );
}
IMPL_LINK( ComplexEditorWindow, ScrollHdl, ScrollBar *, pCurScrollBar )
{
- if ( aEdtWindow.GetEditView() )
+ if ( aEdtWindow->GetEditView() )
{
- DBG_ASSERT( pCurScrollBar == &aEWVScrollBar, "Wer scrollt hier ?" );
- long nDiff = aEdtWindow.GetEditView()->GetStartDocPos().Y() - pCurScrollBar->GetThumbPos();
- aEdtWindow.GetEditView()->Scroll( 0, nDiff );
- aBrkWindow.DoScroll( 0, nDiff );
- aLineNumberWindow.DoScroll(0, nDiff);
- aEdtWindow.GetEditView()->ShowCursor(false, true);
- pCurScrollBar->SetThumbPos( aEdtWindow.GetEditView()->GetStartDocPos().Y() );
+ DBG_ASSERT( pCurScrollBar == aEWVScrollBar.get(), "Wer scrollt hier ?" );
+ long nDiff = aEdtWindow->GetEditView()->GetStartDocPos().Y() - pCurScrollBar->GetThumbPos();
+ aEdtWindow->GetEditView()->Scroll( 0, nDiff );
+ aBrkWindow->DoScroll( 0, nDiff );
+ aLineNumberWindow->DoScroll(0, nDiff);
+ aEdtWindow->GetEditView()->ShowCursor(false, true);
+ pCurScrollBar->SetThumbPos( aEdtWindow->GetEditView()->GetStartDocPos().Y() );
}
return 0;
@@ -2102,7 +2137,7 @@ void ComplexEditorWindow::DataChanged(DataChangedEvent const & rDCEvt)
void ComplexEditorWindow::SetLineNumberDisplay(bool b)
{
- aLineNumberWindow.Show(b);
+ aLineNumberWindow->Show(b);
Resize();
}
@@ -2135,13 +2170,20 @@ WatchTreeListBox::WatchTreeListBox( vcl::Window* pParent, WinBits nWinBits )
WatchTreeListBox::~WatchTreeListBox()
{
+ disposeOnce();
+}
+
+void WatchTreeListBox::dispose()
+{
// Destroy user data
SvTreeListEntry* pEntry = First();
while ( pEntry )
{
delete static_cast<WatchItem*>(pEntry->GetUserData());
+ pEntry->SetUserData(NULL);
pEntry = Next( pEntry );
}
+ SvHeaderTabListBox::dispose();
}
void WatchTreeListBox::SetTabs()
@@ -2642,6 +2684,17 @@ pCodeCompleteWindow( pPar )
SetSelectHdl(LINK(this, CodeCompleteListBox, ImplSelectHdl));
}
+CodeCompleteListBox::~CodeCompleteListBox()
+{
+ disposeOnce();
+}
+
+void CodeCompleteListBox::dispose()
+{
+ pCodeCompleteWindow.clear();
+ ListBox::dispose();
+}
+
IMPL_LINK_NOARG(CodeCompleteListBox, ImplDoubleClickHdl)
{
InsertSelectedEntry();
@@ -2807,12 +2860,24 @@ void CodeCompleteListBox::HideAndRestoreFocus()
CodeCompleteWindow::CodeCompleteWindow( EditorWindow* pPar )
: Window( pPar ),
pParent( pPar ),
-pListBox( new CodeCompleteListBox(this) )
+pListBox( VclPtr<CodeCompleteListBox>::Create(this) )
{
SetSizePixel( Size(151,151) ); //default, later it changes
InitListBox();
}
+CodeCompleteWindow::~CodeCompleteWindow()
+{
+ disposeOnce();
+}
+
+void CodeCompleteWindow::dispose()
+{
+ pListBox.disposeAndClear();
+ pParent.clear();
+ vcl::Window::dispose();
+}
+
void CodeCompleteWindow::InitListBox()
{
pListBox->SetSizePixel( Size(150,150) ); //default, this will adopt the line length
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index af89dfb3292d..fa99f7cd2855 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -100,9 +100,6 @@ DialogWindow::DialogWindow (
SetReadOnly(true);
}
-DialogWindow::~DialogWindow()
-{ }
-
void DialogWindow::LoseFocus()
{
if ( IsModified() )
@@ -1027,8 +1024,8 @@ bool implImportDialog( vcl::Window* pWin, const OUString& rCurPath, const Script
OUString aQueryBoxText(IDE_RESSTR(RID_STR_DLGIMP_CLASH_TEXT));
aQueryBoxText = aQueryBoxText.replaceAll("$(ARG1)", aXmlDlgName);
- NameClashQueryBox aQueryBox( pWin, aQueryBoxTitle, aQueryBoxText );
- sal_uInt16 nRet = aQueryBox.Execute();
+ ScopedVclPtrInstance< NameClashQueryBox > aQueryBox( pWin, aQueryBoxTitle, aQueryBoxText );
+ sal_uInt16 nRet = aQueryBox->Execute();
if( RET_YES == nRet )
{
// RET_YES == Rename, see NameClashQueryBox::NameClashQueryBox
@@ -1089,8 +1086,8 @@ bool implImportDialog( vcl::Window* pWin, const OUString& rCurPath, const Script
{
OUString aQueryBoxTitle(IDE_RESSTR(RID_STR_DLGIMP_MISMATCH_TITLE));
OUString aQueryBoxText(IDE_RESSTR(RID_STR_DLGIMP_MISMATCH_TEXT));
- LanguageMismatchQueryBox aQueryBox( pWin, aQueryBoxTitle, aQueryBoxText );
- sal_uInt16 nRet = aQueryBox.Execute();
+ ScopedVclPtrInstance< LanguageMismatchQueryBox > aQueryBox( pWin, aQueryBoxTitle, aQueryBoxText );
+ sal_uInt16 nRet = aQueryBox->Execute();
if( RET_YES == nRet )
{
// RET_YES == Add, see LanguageMismatchQueryBox::LanguageMismatchQueryBox
@@ -1411,11 +1408,16 @@ DialogWindowLayout::DialogWindowLayout (vcl::Window* pParent, ObjectCatalog& rOb
DialogWindowLayout::~DialogWindowLayout()
{
- if (pPropertyBrowser != 0)
- {
+ disposeOnce();
+}
+
+void DialogWindowLayout::dispose()
+{
+ if (pPropertyBrowser)
Remove(pPropertyBrowser);
- delete pPropertyBrowser;
- }
+ pPropertyBrowser.disposeAndClear();
+ pChild.clear();
+ Layout::dispose();
}
// shows the property browser (and creates if necessary)
@@ -1425,7 +1427,7 @@ void DialogWindowLayout::ShowPropertyBrowser ()
if (!pPropertyBrowser)
{
// creating
- pPropertyBrowser = new PropBrw(*this);
+ pPropertyBrowser = VclPtr<PropBrw>::Create(*this);
pPropertyBrowser->Show();
// after OnFirstSize():
if (HasSize())
diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx
index 1a620ce03a41..b713ffe1e878 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -126,7 +126,7 @@ void Shell::ExecuteCurrent( SfxRequest& rReq )
break;
if (it != aWindowTable.end())
++it;
- BaseWindow* pWin = it != aWindowTable.end() ? it->second : 0;
+ BaseWindow* pWin = it != aWindowTable.end() ? it->second.get() : 0;
bool bSearchedFromStart = false;
while ( !nFound && !bCanceled && ( pWin || !bSearchedFromStart ) )
@@ -136,8 +136,8 @@ void Shell::ExecuteCurrent( SfxRequest& rReq )
SfxViewFrame* pViewFrame = GetViewFrame();
SfxChildWindow* pChildWin = pViewFrame ? pViewFrame->GetChildWindow( SID_SEARCH_DLG ) : NULL;
vcl::Window* pParent = pChildWin ? pChildWin->GetWindow() : NULL;
- QueryBox aQuery(pParent, WB_YES_NO|WB_DEF_YES, IDE_RESSTR(RID_STR_SEARCHFROMSTART));
- if ( aQuery.Execute() == RET_YES )
+ ScopedVclPtrInstance< QueryBox > aQuery(pParent, WB_YES_NO|WB_DEF_YES, IDE_RESSTR(RID_STR_SEARCHFROMSTART));
+ if ( aQuery->Execute() == RET_YES )
{
it = aWindowTable.begin();
if ( it != aWindowTable.end() )
@@ -166,7 +166,7 @@ void Shell::ExecuteCurrent( SfxRequest& rReq )
{
if ( it != aWindowTable.end() )
++it;
- pWin = it != aWindowTable.end() ? it->second : 0;
+ pWin = it != aWindowTable.end() ? it->second.get() : 0;
}
else
pWin = 0;
@@ -202,7 +202,7 @@ void Shell::ExecuteGlobal( SfxRequest& rReq )
case SID_BASICSTOP:
{
// maybe do not simply stop if on breakpoint!
- if (ModulWindow* pMCurWin = dynamic_cast<ModulWindow*>(pCurWin))
+ if (ModulWindow* pMCurWin = dynamic_cast<ModulWindow*>(pCurWin.get()))
pMCurWin->BasicStop();
StopBasic();
}
@@ -330,7 +330,7 @@ void Shell::ExecuteGlobal( SfxRequest& rReq )
case SID_BASICIDE_OBJCAT:
// toggling object catalog
- aObjectCatalog.Show(!aObjectCatalog.IsVisible());
+ aObjectCatalog->Show(!aObjectCatalog->IsVisible());
if (pLayout)
pLayout->ArrangeWindows();
// refresh the button state
@@ -676,8 +676,8 @@ void Shell::ExecuteGlobal( SfxRequest& rReq )
case SID_BASICIDE_MANAGE_LANG:
{
- ManageLanguageDialog aDlg(pCurWin, m_pCurLocalizationMgr);
- aDlg.Execute();
+ ScopedVclPtrInstance< ManageLanguageDialog > aDlg(pCurWin, m_pCurLocalizationMgr);
+ aDlg->Execute();
rReq.Done();
}
break;
@@ -750,7 +750,7 @@ void Shell::GetState(SfxItemSet &rSet)
break;
case SID_BASICIDE_OBJCAT:
if (pLayout)
- rSet.Put(SfxBoolItem(nWh, aObjectCatalog.IsVisible()));
+ rSet.Put(SfxBoolItem(nWh, aObjectCatalog->IsVisible()));
else
rSet.Put(SfxVisibilityItem(nWh, false));
break;
@@ -769,7 +769,7 @@ void Shell::GetState(SfxItemSet &rSet)
case SID_BASICSAVEAS:
case SID_BASICIDE_MATCHGROUP:
{
- if (!dynamic_cast<ModulWindow*>(pCurWin))
+ if (!dynamic_cast<ModulWindow*>(pCurWin.get()))
rSet.DisableItem( nWh );
else if ( ( nWh == SID_BASICLOAD ) && ( StarBASIC::IsRunning() || ( pCurWin && pCurWin->IsReadOnly() ) ) )
rSet.DisableItem( nWh );
@@ -782,7 +782,7 @@ void Shell::GetState(SfxItemSet &rSet)
case SID_BASICIDE_TOGGLEBRKPNT:
case SID_BASICIDE_MANAGEBRKPNTS:
{
- if (ModulWindow* pMCurWin = dynamic_cast<ModulWindow*>(pCurWin))
+ if (ModulWindow* pMCurWin = dynamic_cast<ModulWindow*>(pCurWin.get()))
{
if (StarBASIC::IsRunning() && !pMCurWin->GetBasicStatus().bIsInReschedule)
rSet.DisableItem(nWh);
@@ -793,7 +793,7 @@ void Shell::GetState(SfxItemSet &rSet)
break;
case SID_BASICCOMPILE:
{
- if (StarBASIC::IsRunning() || !dynamic_cast<ModulWindow*>(pCurWin))
+ if (StarBASIC::IsRunning() || !dynamic_cast<ModulWindow*>(pCurWin.get()))
rSet.DisableItem( nWh );
}
break;
@@ -814,7 +814,7 @@ void Shell::GetState(SfxItemSet &rSet)
case SID_INSERT_FORM_HSCROLL:
case SID_INSERT_FORM_SPIN:
{
- if (!dynamic_cast<DialogWindow*>(pCurWin))
+ if (!dynamic_cast<DialogWindow*>(pCurWin.get()))
rSet.DisableItem( nWh );
}
break;
@@ -945,7 +945,7 @@ void Shell::GetState(SfxItemSet &rSet)
// if this is not a module window hide the
// setting, doesn't make sense for example if the
// dialog editor is open
- if (pCurWin && !dynamic_cast<ModulWindow*>(pCurWin))
+ if (pCurWin && !dynamic_cast<ModulWindow*>(pCurWin.get()))
{
rSet.DisableItem( nWh );
rSet.Put(SfxVisibilityItem(nWh, false));
@@ -968,7 +968,7 @@ bool Shell::HasUIFeature( sal_uInt32 nFeature )
if ( (nFeature & BASICIDE_UI_FEATURE_SHOW_BROWSER) == BASICIDE_UI_FEATURE_SHOW_BROWSER )
{
// fade out (in) property browser in module (dialog) windows
- if (dynamic_cast<DialogWindow*>(pCurWin) && !pCurWin->IsReadOnly())
+ if (dynamic_cast<DialogWindow*>(pCurWin.get()) && !pCurWin->IsReadOnly())
bResult = true;
}
@@ -1032,10 +1032,10 @@ void Shell::SetCurWindow( BaseWindow* pNewWin, bool bUpdateTabBar, bool bRemembe
GetViewFrame()->GetWindow().SetHelpId( HID_BASICIDE_MODULWINDOW );
SfxObjectShell::SetCurrentComponent(0);
}
- aObjectCatalog.SetCurrentEntry(pCurWin);
+ aObjectCatalog->SetCurrentEntry(pCurWin);
SetUndoManager( pCurWin ? pCurWin->GetUndoManager() : 0 );
InvalidateBasicIDESlots();
- EnableScrollbars(pCurWin != 0);
+ EnableScrollbars(pCurWin != nullptr);
if ( m_pCurLocalizationMgr )
m_pCurLocalizationMgr->handleTranslationbar();
@@ -1067,7 +1067,7 @@ void Shell::ManageToolbars()
if ( xLayoutManager.is() )
{
xLayoutManager->lock();
- if (dynamic_cast<DialogWindow*>(pCurWin))
+ if (dynamic_cast<DialogWindow*>(pCurWin.get()))
{
xLayoutManager->destroyElement( aMacroBarResName );
@@ -1188,13 +1188,13 @@ void Shell::AdjustPosSizePixel( const Point &rPos, const Size &rSize )
return;
Size aSz( rSize );
- Size aScrollBarBoxSz( aScrollBarBox.GetSizePixel() );
+ Size aScrollBarBoxSz( aScrollBarBox->GetSizePixel() );
aSz.Height() -= aScrollBarBoxSz.Height();
Size aOutSz( aSz );
aSz.Width() -= aScrollBarBoxSz.Width();
- aScrollBarBox.SetPosPixel( Point( rSize.Width() - aScrollBarBoxSz.Width(), rSize.Height() - aScrollBarBoxSz.Height() ) );
- aVScrollBar.SetPosSizePixel( Point( rPos.X()+aSz.Width(), rPos.Y() ), Size( aScrollBarBoxSz.Width(), aSz.Height() ) );
+ aScrollBarBox->SetPosPixel( Point( rSize.Width() - aScrollBarBoxSz.Width(), rSize.Height() - aScrollBarBoxSz.Height() ) );
+ aVScrollBar->SetPosSizePixel( Point( rPos.X()+aSz.Width(), rPos.Y() ), Size( aScrollBarBoxSz.Width(), aSz.Height() ) );
if ( bTabBarSplitted )
{
// SplitSize is 0 at a resize!
@@ -1203,17 +1203,17 @@ void Shell::AdjustPosSizePixel( const Point &rPos, const Size &rSize )
nSplitPos = aSz.Width();
pTabBar->SetPosSizePixel( Point( rPos.X(), rPos.Y()+aSz.Height() ), Size( nSplitPos, aScrollBarBoxSz.Height() ) );
long nScrlStart = rPos.X() + nSplitPos;
- aHScrollBar.SetPosSizePixel( Point( nScrlStart, rPos.Y()+aSz.Height() ), Size( aSz.Width() - nScrlStart + 1, aScrollBarBoxSz.Height() ) );
- aHScrollBar.Update();
+ aHScrollBar->SetPosSizePixel( Point( nScrlStart, rPos.Y()+aSz.Height() ), Size( aSz.Width() - nScrlStart + 1, aScrollBarBoxSz.Height() ) );
+ aHScrollBar->Update();
}
else
{
- aHScrollBar.SetPosSizePixel( Point( rPos.X()+ aSz.Width()/2 - 1, rPos.Y()+aSz.Height() ), Size( aSz.Width()/2 + 2, aScrollBarBoxSz.Height() ) );
+ aHScrollBar->SetPosSizePixel( Point( rPos.X()+ aSz.Width()/2 - 1, rPos.Y()+aSz.Height() ), Size( aSz.Width()/2 + 2, aScrollBarBoxSz.Height() ) );
pTabBar->SetPosSizePixel( Point( rPos.X(), rPos.Y()+aSz.Height() ), Size( aSz.Width()/2, aScrollBarBoxSz.Height() ) );
}
if (pLayout)
- pLayout->SetPosSizePixel(rPos, dynamic_cast<DialogWindow*>(pCurWin) ? aSz : aOutSz);
+ pLayout->SetPosSizePixel(rPos, dynamic_cast<DialogWindow*>(pCurWin.get()) ? aSz : aOutSz);
}
Reference< XModel > Shell::GetCurrentDocument() const
@@ -1230,7 +1230,7 @@ void Shell::Activate( bool bMDI )
if ( bMDI )
{
- if (DialogWindow* pDCurWin = dynamic_cast<DialogWindow*>(pCurWin))
+ if (DialogWindow* pDCurWin = dynamic_cast<DialogWindow*>(pCurWin.get()))
pDCurWin->UpdateBrowser();
}
}
@@ -1241,7 +1241,7 @@ void Shell::Deactivate( bool bMDI )
// deactivate due to a MessageBox bMDI is false
if ( bMDI )
{
- if (DialogWindow* pXDlgWin = dynamic_cast<DialogWindow*>(pCurWin))
+ if (DialogWindow* pXDlgWin = dynamic_cast<DialogWindow*>(pCurWin.get()))
{
pXDlgWin->DisableBrowser();
if( pXDlgWin->IsModified() )
diff --git a/basctl/source/basicide/basides2.cxx b/basctl/source/basicide/basides2.cxx
index 1801060e581e..e05869a64831 100644
--- a/basctl/source/basicide/basides2.cxx
+++ b/basctl/source/basicide/basides2.cxx
@@ -44,7 +44,7 @@ Reference< view::XRenderable > Shell::GetRenderable()
bool Shell::HasSelection( bool /* bText */ ) const
{
- if (ModulWindow* pMCurWin = dynamic_cast<ModulWindow*>(pCurWin))
+ if (ModulWindow* pMCurWin = dynamic_cast<ModulWindow*>(pCurWin.get()))
{
TextView* pEditView = pMCurWin->GetEditView();
if ( pEditView && pEditView->HasSelection() )
@@ -56,7 +56,7 @@ bool Shell::HasSelection( bool /* bText */ ) const
OUString Shell::GetSelectionText( bool bWholeWord )
{
OUString aText;
- if (ModulWindow* pMCurWin = dynamic_cast<ModulWindow*>(pCurWin))
+ if (ModulWindow* pMCurWin = dynamic_cast<ModulWindow*>(pCurWin.get()))
{
if (TextView* pEditView = pMCurWin->GetEditView())
{
@@ -166,8 +166,8 @@ ModulWindow* Shell::CreateBasWin( const ScriptDocument& rDocument, const OUStrin
{
// new module window
if (!pModulLayout)
- pModulLayout.reset(new ModulWindowLayout(&GetViewFrame()->GetWindow(), aObjectCatalog));
- pWin = new ModulWindow(pModulLayout.get(), rDocument, aLibName, aModName, aModule);
+ pModulLayout.reset(VclPtr<ModulWindowLayout>::Create(&GetViewFrame()->GetWindow(), *aObjectCatalog.get()));
+ pWin = VclPtr<ModulWindow>::Create(pModulLayout.get(), rDocument, aLibName, aModName, aModule);
nKey = InsertWindowInTable( pWin );
}
else // we've gotten called recursively ( via listener from createModule above ), get outta here
@@ -195,7 +195,7 @@ ModulWindow* Shell::CreateBasWin( const ScriptDocument& rDocument, const OUStrin
pTabBar->Sort();
if(pWin)
{
- pWin->GrabScrollBars( &aHScrollBar, &aVScrollBar );
+ pWin->GrabScrollBars( aHScrollBar.get(), aVScrollBar.get() );
if ( !pCurWin )
SetCurWindow( pWin, false, false );
}
@@ -220,14 +220,14 @@ void Shell::Move()
void Shell::ShowCursor( bool bOn )
{
- if (ModulWindow* pMCurWin = dynamic_cast<ModulWindow*>(pCurWin))
+ if (ModulWindow* pMCurWin = dynamic_cast<ModulWindow*>(pCurWin.get()))
pMCurWin->ShowCursor(bOn);
}
// only if basic window above:
void Shell::ExecuteBasic( SfxRequest& rReq )
{
- if (dynamic_cast<ModulWindow*>(pCurWin))
+ if (dynamic_cast<ModulWindow*>(pCurWin.get()))
{
pCurWin->ExecuteCommand( rReq );
if (nShellCount)
diff --git a/basctl/source/basicide/basides3.cxx b/basctl/source/basicide/basides3.cxx
index ff53a779c932..8479fd8a39a2 100644
--- a/basctl/source/basicide/basides3.cxx
+++ b/basctl/source/basicide/basides3.cxx
@@ -77,8 +77,8 @@ DialogWindow* Shell::CreateDlgWin( const ScriptDocument& rDocument, const OUStri
// new dialog window
if (!pDialogLayout)
- pDialogLayout.reset(new DialogWindowLayout(&GetViewFrame()->GetWindow(), aObjectCatalog));
- pWin = new DialogWindow(pDialogLayout.get(), rDocument, aLibName, aDlgName, xDialogModel);
+ pDialogLayout.reset(VclPtr<DialogWindowLayout>::Create(&GetViewFrame()->GetWindow(), *aObjectCatalog.get()));
+ pWin = VclPtr<DialogWindow>::Create(pDialogLayout.get(), rDocument, aLibName, aDlgName, xDialogModel);
nKey = InsertWindowInTable( pWin );
}
}
@@ -96,7 +96,7 @@ DialogWindow* Shell::CreateDlgWin( const ScriptDocument& rDocument, const OUStri
if( pWin )
{
- pWin->GrabScrollBars( &aHScrollBar, &aVScrollBar );
+ pWin->GrabScrollBars( aHScrollBar.get(), aVScrollBar.get() );
pTabBar->InsertPage( (sal_uInt16)nKey, aDlgName );
pTabBar->Sort();
if ( !pCurWin )
@@ -128,7 +128,7 @@ sal_uInt16 Shell::GetWindowId(const BaseWindow* pWin) const
SdrView* Shell::GetCurDlgView() const
{
- if (DialogWindow* pDCurWin = dynamic_cast<DialogWindow*>(pCurWin))
+ if (DialogWindow* pDCurWin = dynamic_cast<DialogWindow*>(pCurWin.get()))
return &pDCurWin->GetView();
else
return 0;
@@ -137,7 +137,7 @@ SdrView* Shell::GetCurDlgView() const
// only if dialogue window above:
void Shell::ExecuteDialog( SfxRequest& rReq )
{
- if (pCurWin && (dynamic_cast<DialogWindow*>(pCurWin) || rReq.GetSlot() == SID_IMPORT_DIALOG))
+ if (pCurWin && (dynamic_cast<DialogWindow*>(pCurWin.get()) || rReq.GetSlot() == SID_IMPORT_DIALOG))
pCurWin->ExecuteCommand(rReq);
}
diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx
index dce1ea4b680a..214c5b6967db 100644
--- a/basctl/source/basicide/basidesh.cxx
+++ b/basctl/source/basicide/basidesh.cxx
@@ -148,11 +148,11 @@ unsigned Shell::nShellCount = 0;
Shell::Shell( SfxViewFrame* pFrame_, SfxViewShell* /* pOldShell */ ) :
SfxViewShell( pFrame_, SfxViewShellFlags::CAN_PRINT | SfxViewShellFlags::NO_NEWWINDOW ),
m_aCurDocument( ScriptDocument::getApplicationScriptDocument() ),
- aHScrollBar( &GetViewFrame()->GetWindow(), WinBits( WB_HSCROLL | WB_DRAG ) ),
- aVScrollBar( &GetViewFrame()->GetWindow(), WinBits( WB_VSCROLL | WB_DRAG ) ),
- aScrollBarBox( &GetViewFrame()->GetWindow(), WinBits( WB_SIZEABLE ) ),
+ aHScrollBar( VclPtr<ScrollBar>::Create(&GetViewFrame()->GetWindow(), WinBits( WB_HSCROLL | WB_DRAG )) ),
+ aVScrollBar( VclPtr<ScrollBar>::Create(&GetViewFrame()->GetWindow(), WinBits( WB_VSCROLL | WB_DRAG )) ),
+ aScrollBarBox( VclPtr<ScrollBarBox>::Create(&GetViewFrame()->GetWindow(), WinBits( WB_SIZEABLE )) ),
pLayout(0),
- aObjectCatalog(&GetViewFrame()->GetWindow()),
+ aObjectCatalog(VclPtr<ObjectCatalog>::Create(&GetViewFrame()->GetWindow())),
m_bAppBasicModified( false ),
m_aNotifier( *this )
{
@@ -188,7 +188,7 @@ void Shell::Init()
m_aCurDocument = ScriptDocument::getApplicationScriptDocument();
bCreatingWindow = false;
- pTabBar.reset(new TabBar(&GetViewFrame()->GetWindow()));
+ pTabBar.reset(VclPtr<TabBar>::Create(&GetViewFrame()->GetWindow()));
pTabBar->SetSplitHdl( LINK( this, Shell, TabBarSplitHdl ) );
bTabBarSplitted = false;
@@ -225,12 +225,15 @@ Shell::~Shell()
SetWindow( 0 );
SetCurWindow( 0 );
- for (WindowTableIt it = aWindowTable.begin(); it != aWindowTable.end(); ++it)
+ for (WindowTable::iterator it = aWindowTable.begin(); it != aWindowTable.end(); ++it)
{
// no store; does already happen when the BasicManagers are destroyed
- delete it->second;
+ it->second.disposeAndClear();
}
+ // no store; does already happen when the BasicManagers are destroyed
+ aWindowTable.clear();
+
// Destroy all ContainerListeners for Basic Container.
if (ContainerListenerImpl* pListener = static_cast<ContainerListenerImpl*>(m_xLibListener.get()))
pListener->removeContainerListener(m_aCurDocument, m_aCurLibName);
@@ -290,7 +293,7 @@ void Shell::onDocumentClosed( const ScriptDocument& _rDocument )
bool bSetCurWindow = false;
bool bSetCurLib = ( _rDocument == m_aCurDocument );
- std::vector<BaseWindow*> aDeleteVec;
+ std::vector<VclPtr<BaseWindow> > aDeleteVec;
// remove all windows which belong to this document
for (WindowTableIt it = aWindowTable.begin(); it != aWindowTable.end(); ++it)
@@ -311,7 +314,7 @@ void Shell::onDocumentClosed( const ScriptDocument& _rDocument )
}
}
// delete windows outside main loop so we don't invalidate the original iterator
- for (std::vector<BaseWindow*>::const_iterator it = aDeleteVec.begin(); it != aDeleteVec.end(); ++it)
+ for (auto it = aDeleteVec.begin(); it != aDeleteVec.end(); ++it)
{
BaseWindow* pWin = *it;
pWin->StoreData();
@@ -409,15 +412,15 @@ bool Shell::PrepareClose( bool bUI )
void Shell::InitScrollBars()
{
- aVScrollBar.SetLineSize( 300 );
- aVScrollBar.SetPageSize( 2000 );
- aHScrollBar.SetLineSize( 300 );
- aHScrollBar.SetPageSize( 2000 );
- aHScrollBar.Enable();
- aVScrollBar.Enable();
- aVScrollBar.Show();
- aHScrollBar.Show();
- aScrollBarBox.Show();
+ aVScrollBar->SetLineSize( 300 );
+ aVScrollBar->SetPageSize( 2000 );
+ aHScrollBar->SetLineSize( 300 );
+ aHScrollBar->SetPageSize( 2000 );
+ aHScrollBar->Enable();
+ aVScrollBar->Enable();
+ aVScrollBar->Show();
+ aHScrollBar->Show();
+ aScrollBarBox->Show();
}
@@ -485,16 +488,16 @@ bool Shell::NextPage( bool bPrev )
void Shell::ArrangeTabBar()
{
- long nBoxPos = aScrollBarBox.GetPosPixel().X() - 1;
+ long nBoxPos = aScrollBarBox->GetPosPixel().X() - 1;
long nPos = pTabBar->GetSplitSize();
if ( nPos <= nBoxPos )
{
Point aPnt( pTabBar->GetPosPixel() );
- long nH = aHScrollBar.GetSizePixel().Height();
+ long nH = aHScrollBar->GetSizePixel().Height();
pTabBar->SetPosSizePixel( aPnt, Size( nPos, nH ) );
long nScrlStart = aPnt.X() + nPos;
- aHScrollBar.SetPosSizePixel( Point( nScrlStart, aPnt.Y() ), Size( nBoxPos - nScrlStart + 2, nH ) );
- aHScrollBar.Update();
+ aHScrollBar->SetPosSizePixel( Point( nScrlStart, aPnt.Y() ), Size( nBoxPos - nScrlStart + 2, nH ) );
+ aHScrollBar->Update();
}
}
@@ -523,7 +526,7 @@ void Shell::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId&,
case SFX_HINT_DYING:
{
EndListening( rBC, true /* log off all */ );
- aObjectCatalog.UpdateEntries();
+ aObjectCatalog->UpdateEntries();
}
break;
}
@@ -592,14 +595,14 @@ void Shell::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId&,
void Shell::CheckWindows()
{
bool bSetCurWindow = false;
- std::vector<BaseWindow*> aDeleteVec;
+ std::vector<VclPtr<BaseWindow> > aDeleteVec;
for (WindowTableIt it = aWindowTable.begin(); it != aWindowTable.end(); ++it)
{
BaseWindow* pWin = it->second;
if ( pWin->GetStatus() & BASWIN_TOBEKILLED )
aDeleteVec.push_back( pWin );
}
- for ( std::vector<BaseWindow*>::const_iterator it = aDeleteVec.begin(); it != aDeleteVec.end(); ++it )
+ for ( auto it = aDeleteVec.begin(); it != aDeleteVec.end(); ++it )
{
BaseWindow* pWin = *it;
pWin->StoreData();
@@ -615,15 +618,15 @@ void Shell::CheckWindows()
void Shell::RemoveWindows( const ScriptDocument& rDocument, const OUString& rLibName, bool bDestroy )
{
- bool bChangeCurWindow = pCurWin == nullptr;
- std::vector<BaseWindow*> aDeleteVec;
+ bool bChangeCurWindow = pCurWin;
+ std::vector<VclPtr<BaseWindow> > aDeleteVec;
for (WindowTableIt it = aWindowTable.begin(); it != aWindowTable.end(); ++it)
{
BaseWindow* pWin = it->second;
if ( pWin->IsDocument( rDocument ) && pWin->GetLibName() == rLibName )
aDeleteVec.push_back( pWin );
}
- for ( std::vector<BaseWindow*>::const_iterator it = aDeleteVec.begin(); it != aDeleteVec.end(); ++it )
+ for ( auto it = aDeleteVec.begin(); it != aDeleteVec.end(); ++it )
{
BaseWindow* pWin = *it;
if ( pWin == pCurWin )
@@ -643,7 +646,7 @@ void Shell::UpdateWindows()
bool bChangeCurWindow = pCurWin == nullptr;
if ( !m_aCurLibName.isEmpty() )
{
- std::vector<BaseWindow*> aDeleteVec;
+ std::vector<VclPtr<BaseWindow> > aDeleteVec;
for (WindowTableIt it = aWindowTable.begin(); it != aWindowTable.end(); ++it)
{
BaseWindow* pWin = it->second;
@@ -659,7 +662,7 @@ void Shell::UpdateWindows()
aDeleteVec.push_back( pWin );
}
}
- for ( std::vector<BaseWindow*>::const_iterator it = aDeleteVec.begin(); it != aDeleteVec.end(); ++it )
+ for ( auto it = aDeleteVec.begin(); it != aDeleteVec.end(); ++it )
{
RemoveWindow( *it, false, false );
}
@@ -806,7 +809,7 @@ void Shell::RemoveWindow( BaseWindow* pWindow_, bool bDestroy, bool bAllowChange
{
if ( !( pWindow_->GetStatus() & BASWIN_INRESCHEDULE ) )
{
- delete pWindow_;
+ pWindow_->disposeOnce();
}
else
{
@@ -901,8 +904,8 @@ void Shell::InvalidateBasicIDESlots()
void Shell::EnableScrollbars( bool bEnable )
{
- aHScrollBar.Enable(bEnable);
- aVScrollBar.Enable(bEnable);
+ aHScrollBar->Enable(bEnable);
+ aVScrollBar->Enable(bEnable);
}
void Shell::SetCurLib( const ScriptDocument& rDocument, const OUString& aLibName, bool bUpdateWindows, bool bCheck )
diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx
index 2e41965b81c9..43d1be3d6b1f 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -149,16 +149,16 @@ bool RenameModule (
if ( rDocument.hasModule( rLibName, rNewName ) )
{
- MessageDialog aError(pErrorParent, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2));
- aError.Execute();
+ ScopedVclPtrInstance< MessageDialog > aError(pErrorParent, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2));
+ aError->Execute();
return false;
}
// #i74440
if ( rNewName.isEmpty() )
{
- MessageDialog aError(pErrorParent, IDE_RESSTR(RID_STR_BADSBXNAME));
- aError.Execute();
+ ScopedVclPtrInstance< MessageDialog > aError(pErrorParent, IDE_RESSTR(RID_STR_BADSBXNAME));
+ aError->Execute();
return false;
}
@@ -242,7 +242,7 @@ OUString ChooseMacro( const uno::Reference< frame::XModel >& rxLimitToDocument,
OUString aScriptURL;
SbMethod* pMethod = NULL;
- boost::scoped_ptr< MacroChooser > pChooser( new MacroChooser( NULL, true ) );
+ ScopedVclPtrInstance< MacroChooser > pChooser( nullptr, true );
if ( bChooseOnly || !SvtModuleOptions::IsBasicIDE() )
pChooser->SetMode(MacroChooser::ChooseOnly);
diff --git a/basctl/source/basicide/basobj3.cxx b/basctl/source/basicide/basobj3.cxx
index df25cbbfcb6e..dd700b1bb4ce 100644
--- a/basctl/source/basicide/basobj3.cxx
+++ b/basctl/source/basicide/basobj3.cxx
@@ -155,16 +155,16 @@ bool RenameDialog (
if ( rDocument.hasDialog( rLibName, rNewName ) )
{
- MessageDialog aError(pErrorParent, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2));
- aError.Execute();
+ ScopedVclPtrInstance< MessageDialog > aError(pErrorParent, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2));
+ aError->Execute();
return false;
}
// #i74440
if ( rNewName.isEmpty() )
{
- MessageDialog aError(pErrorParent, IDE_RESSTR(RID_STR_BADSBXNAME));
- aError.Execute();
+ ScopedVclPtrInstance< MessageDialog > aError(pErrorParent, IDE_RESSTR(RID_STR_BADSBXNAME));
+ aError->Execute();
return false;
}
diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx
index 5d105dbe1082..79ebd6d8dacd 100644
--- a/basctl/source/basicide/bastype2.cxx
+++ b/basctl/source/basicide/bastype2.cxx
@@ -206,15 +206,22 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeTreeListBox(vcl::Windo
TreeListBox::~TreeListBox ()
{
+ disposeOnce();
+}
+
+void TreeListBox::dispose()
+{
m_aNotifier.dispose();
// destroy user data
SvTreeListEntry* pEntry = First();
while ( pEntry )
{
- delete static_cast<Entry*>(pEntry->GetUserData());
+ delete static_cast<Entry*>( pEntry->GetUserData() );
+ pEntry->SetUserData( NULL );
pEntry = Next( pEntry );
}
+ SvTreeListBox::dispose();
}
void TreeListBox::ScanEntry( const ScriptDocument& rDocument, LibraryLocation eLocation )
diff --git a/basctl/source/basicide/bastype2.hxx b/basctl/source/basicide/bastype2.hxx
index f08f298b6dc8..bf270e28413a 100644
--- a/basctl/source/basicide/bastype2.hxx
+++ b/basctl/source/basicide/bastype2.hxx
@@ -208,6 +208,7 @@ public:
TreeListBox(vcl::Window* pParent, const ResId& rRes);
TreeListBox(vcl::Window* pParent, WinBits nStyle);
virtual ~TreeListBox();
+ virtual void dispose() SAL_OVERRIDE;
void ScanEntry( const ScriptDocument& rDocument, LibraryLocation eLocation );
void ScanAllEntries();
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx
index 854621f0adda..6efa5cb29a19 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -56,10 +56,18 @@ BaseWindow::BaseWindow( vcl::Window* pParent, const ScriptDocument& rDocument, c
BaseWindow::~BaseWindow()
{
+ disposeOnce();
+}
+
+void BaseWindow::dispose()
+{
if ( pShellVScrollBar )
pShellVScrollBar->SetScrollHdl( Link() );
if ( pShellHScrollBar )
pShellHScrollBar->SetScrollHdl( Link() );
+ pShellVScrollBar.clear();
+ pShellHScrollBar.clear();
+ vcl::Window::dispose();
}
@@ -274,6 +282,17 @@ DockingWindow::DockingWindow (Layout* pParent) :
nShowCount(0)
{ }
+DockingWindow::~DockingWindow()
+{
+ disposeOnce();
+}
+
+void DockingWindow::dispose()
+{
+ pLayout.clear();
+ ::DockingWindow::dispose();
+}
+
// Sets the position and the size of the docking window. This property is saved
// when the window is floating. Called by Layout.
void DockingWindow::ResizeIfDocking (Point const& rPos, Size const& rSize)
@@ -521,7 +540,7 @@ void TabBar::Command( const CommandEvent& rCEvt )
{
Shell::WindowTable& aWindowTable = pShell->GetWindowTable();
Shell::WindowTableIt it = aWindowTable.find( GetCurPageId() );
- if (it != aWindowTable.end() && dynamic_cast<ModulWindow*>(it->second))
+ if (it != aWindowTable.end() && dynamic_cast<ModulWindow*>(it->second.get()))
{
SbModule* pActiveModule = pBasic->FindModule( it->second->GetName() );
if( pActiveModule && ( pActiveModule->GetModuleType() == script::ModuleType::DOCUMENT ) )
@@ -785,8 +804,8 @@ bool QueryDel( const OUString& rName, const ResId& rId, vcl::Window* pParent )
aNameBuf.append('\'');
aNameBuf.insert(0, '\'');
aQuery = aQuery.replaceAll("XX", aNameBuf.makeStringAndClear());
- MessageDialog aQueryBox(pParent, aQuery, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
- return ( aQueryBox.Execute() == RET_YES );
+ ScopedVclPtrInstance< MessageDialog > aQueryBox(pParent, aQuery, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ return ( aQueryBox->Execute() == RET_YES );
}
bool QueryDelMacro( const OUString& rName, vcl::Window* pParent )
@@ -822,19 +841,19 @@ bool QueryPassword( const Reference< script::XLibraryContainer >& xLibContainer,
do
{
// password dialog
- SfxPasswordDialog aDlg(Application::GetDefDialogParent());
- aDlg.SetMinLen( 1 );
+ ScopedVclPtrInstance< SfxPasswordDialog > aDlg(Application::GetDefDialogParent());
+ aDlg->SetMinLen( 1 );
// set new title
if ( bNewTitle )
{
OUString aTitle(IDE_RESSTR(RID_STR_ENTERPASSWORD));
aTitle = aTitle.replaceAll("XX", rLibName);
- aDlg.SetText( aTitle );
+ aDlg->SetText( aTitle );
}
// execute dialog
- nRet = aDlg.Execute();
+ nRet = aDlg->Execute();
// verify password
if ( nRet == RET_OK )
@@ -844,14 +863,14 @@ bool QueryPassword( const Reference< script::XLibraryContainer >& xLibContainer,
Reference< script::XLibraryContainerPassword > xPasswd( xLibContainer, UNO_QUERY );
if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( rLibName ) && !xPasswd->isLibraryPasswordVerified( rLibName ) )
{
- rPassword = aDlg.GetPassword();
+ rPassword = aDlg->GetPassword();
// OUString aOUPassword( rPassword );
bOK = xPasswd->verifyLibraryPassword( rLibName, rPassword );
if ( !bOK )
{
- MessageDialog aErrorBox(Application::GetDefDialogParent(), IDE_RESSTR(RID_STR_WRONGPASSWORD));
- aErrorBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(Application::GetDefDialogParent(), IDE_RESSTR(RID_STR_WRONGPASSWORD));
+ aErrorBox->Execute();
}
}
}
diff --git a/basctl/source/basicide/brkdlg.cxx b/basctl/source/basicide/brkdlg.cxx
index b5b2ef17d9dc..fa8399a00512 100644
--- a/basctl/source/basicide/brkdlg.cxx
+++ b/basctl/source/basicide/brkdlg.cxx
@@ -106,6 +106,22 @@ BreakPointDialog::BreakPointDialog( vcl::Window* pParent, BreakPointList& rBrkPn
CheckButtons();
}
+BreakPointDialog::~BreakPointDialog()
+{
+ disposeOnce();
+}
+
+void BreakPointDialog::dispose()
+{
+ m_pComboBox.clear();
+ m_pOKButton.clear();
+ m_pNewButton.clear();
+ m_pDelButton.clear();
+ m_pNumericField.clear();
+ m_pCheckBox.clear();
+ ModalDialog::dispose();
+}
+
void BreakPointDialog::SetCurrentBreakPoint( BreakPoint* pBrk )
{
OUString aStr( "# " + OUString::number(pBrk->nLine) );
diff --git a/basctl/source/basicide/brkdlg.hxx b/basctl/source/basicide/brkdlg.hxx
index 703744efd345..50d18543d846 100644
--- a/basctl/source/basicide/brkdlg.hxx
+++ b/basctl/source/basicide/brkdlg.hxx
@@ -31,12 +31,12 @@ namespace basctl
class BreakPointDialog : public ModalDialog
{
private:
- ComboBox* m_pComboBox;
- OKButton* m_pOKButton;
- PushButton* m_pNewButton;
- PushButton* m_pDelButton;
- ::CheckBox* m_pCheckBox;
- NumericField* m_pNumericField;
+ VclPtr<ComboBox> m_pComboBox;
+ VclPtr<OKButton> m_pOKButton;
+ VclPtr<PushButton> m_pNewButton;
+ VclPtr<PushButton> m_pDelButton;
+ VclPtr<CheckBox> m_pCheckBox;
+ VclPtr<NumericField> m_pNumericField;
BreakPointList & m_rOriginalBreakPointList;
BreakPointList m_aModifiedBreakPointList;
@@ -53,6 +53,8 @@ protected:
public:
BreakPointDialog( vcl::Window* pParent, BreakPointList& rBrkList );
+ virtual ~BreakPointDialog();
+ virtual void dispose() SAL_OVERRIDE;
void SetCurrentBreakPoint( BreakPoint* pBrk );
};
diff --git a/basctl/source/basicide/layout.cxx b/basctl/source/basicide/layout.cxx
index 961a7bde65e4..2bca3ce4349b 100644
--- a/basctl/source/basicide/layout.cxx
+++ b/basctl/source/basicide/layout.cxx
@@ -53,9 +53,16 @@ Layout::Layout (vcl::Window* pParent) :
SetFont(aFont);
}
-// virtual dtor
Layout::~Layout()
-{ }
+{
+ disposeOnce();
+}
+
+void Layout::dispose()
+{
+ pChild.clear();
+ Window::dispose();
+}
// removes a docking window
void Layout::Remove (DockingWindow* pWin)
@@ -166,9 +173,9 @@ Layout::SplittedSide::SplittedSide (Layout* pParent, Side eSide) :
bVertical(eSide == Left || eSide == Right),
bLower(eSide == Left || eSide == Top),
nSize(0),
- aSplitter(pParent, bVertical ? WB_HSCROLL : WB_VSCROLL)
+ aSplitter(VclPtr<Splitter>::Create(pParent, bVertical ? WB_HSCROLL : WB_VSCROLL))
{
- InitSplitter(aSplitter);
+ InitSplitter(*aSplitter.get());
}
@@ -188,7 +195,7 @@ void Layout::SplittedSide::Add (DockingWindow* pWin, Size const& rSize)
// splitter
if (!vItems.empty())
{
- aItem.pSplit = boost::make_shared<Splitter>(&rLayout, bVertical ? WB_VSCROLL : WB_HSCROLL);
+ aItem.pSplit = VclPtr<Splitter>::Create(&rLayout, bVertical ? WB_VSCROLL : WB_HSCROLL);
aItem.pSplit->SetSplitPosPixel(aItem.nStartPos - nSplitThickness);
InitSplitter(*aItem.pSplit);
}
@@ -267,19 +274,19 @@ void Layout::SplittedSide::ArrangeIn (Rectangle const& rRect)
// shown if any of the windows is docked
if (!bEmpty)
{
- aSplitter.Show();
+ aSplitter->Show();
// split position
- aSplitter.SetSplitPosPixel((bLower ? nSize : nPos1) - nSplitThickness);
+ aSplitter->SetSplitPosPixel((bLower ? nSize : nPos1) - nSplitThickness);
// the actual position and size
- aSplitter.SetPosSizePixel(
- MakePoint(nPos2, aSplitter.GetSplitPosPixel()),
+ aSplitter->SetPosSizePixel(
+ MakePoint(nPos2, aSplitter->GetSplitPosPixel()),
MakeSize(nLength, nSplitThickness)
);
// dragging rectangle
- aSplitter.SetDragRectPixel(aRect);
+ aSplitter->SetDragRectPixel(aRect);
}
else
- aSplitter.Hide();
+ aSplitter->Hide();
// positioning separator lines and windows
bool bPrevDocking = false; // is the previous window docked?
@@ -350,7 +357,7 @@ IMPL_LINK(Layout::SplittedSide, SplitHdl, Splitter*, pSplitter)
// checking margins
CheckMarginsFor(pSplitter);
// changing stored sizes
- if (pSplitter == &aSplitter)
+ if (pSplitter == aSplitter.get())
{
// nSize
if (bLower)
diff --git a/basctl/source/basicide/layout.hxx b/basctl/source/basicide/layout.hxx
index fac9bdc86b69..e25cb11461ea 100644
--- a/basctl/source/basicide/layout.hxx
+++ b/basctl/source/basicide/layout.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_BASCTL_SOURCE_BASICIDE_LAYOUT_HXX
#include <vcl/split.hxx>
+#include <vcl/vclptr.hxx>
class DockingWindow;
@@ -49,9 +50,11 @@ public:
virtual void GetState (SfxItemSet&, unsigned nWhich) = 0;
virtual void UpdateDebug (bool bBasicStopped ) = 0;
+ virtual ~Layout();
+ virtual void dispose() SAL_OVERRIDE;
+
protected:
Layout (vcl::Window* pParent);
- virtual ~Layout ();
void AddToLeft (DockingWindow* pWin, Size const& rSize) { aLeftSide.Add(pWin, rSize); }
void AddToBottom (DockingWindow* pWin, Size const& rSize) { aBottomSide.Add(pWin, rSize); }
@@ -67,7 +70,7 @@ protected:
private:
// the main child window (either ModulWindow or DialogWindow)
- BaseWindow* pChild;
+ VclPtr<BaseWindow> pChild;
// when this window has at first (nonempty) size
bool bFirstSize;
@@ -96,12 +99,12 @@ private:
// size (width or height)
long nSize;
// the main splitting line
- Splitter aSplitter;
+ VclPtr<Splitter> aSplitter;
// the dockable windows (and some data)
struct Item
{
// pointer to the dockable window
- DockingWindow* pWin;
+ VclPtr<DockingWindow> pWin;
// starting and ending position in the strip
// They may be different from the actual window position, because
// the window may fill the space of the adjacent currently
@@ -110,7 +113,7 @@ private:
long nStartPos, nEndPos;
// splitter line window before the window
// (the first one is always nullptr)
- boost::shared_ptr<Splitter> pSplit;
+ VclPtr<Splitter> pSplit;
};
std::vector<Item> vItems;
private:
diff --git a/basctl/source/basicide/linenumberwindow.cxx b/basctl/source/basicide/linenumberwindow.cxx
index 2ba7043207da..a2f01eea8795 100644
--- a/basctl/source/basicide/linenumberwindow.cxx
+++ b/basctl/source/basicide/linenumberwindow.cxx
@@ -26,7 +26,15 @@ LineNumberWindow::LineNumberWindow (vcl::Window* pParent, ModulWindow* pModulWin
}
LineNumberWindow::~LineNumberWindow()
-{ }
+{
+ disposeOnce();
+}
+
+void LineNumberWindow::dispose()
+{
+ m_pModulWindow.clear();
+ Window::dispose();
+}
void LineNumberWindow::Paint( const Rectangle& )
{
diff --git a/basctl/source/basicide/linenumberwindow.hxx b/basctl/source/basicide/linenumberwindow.hxx
index caa7f15350c0..65498937eda8 100644
--- a/basctl/source/basicide/linenumberwindow.hxx
+++ b/basctl/source/basicide/linenumberwindow.hxx
@@ -19,7 +19,7 @@ class ModulWindow;
class LineNumberWindow : public vcl::Window
{
private:
- ModulWindow* m_pModulWindow;
+ VclPtr<ModulWindow> m_pModulWindow;
int m_nWidth;
long m_nCurYOffset;
int m_nBaseWidth;
@@ -31,6 +31,7 @@ protected:
public:
LineNumberWindow (vcl::Window* pParent, ModulWindow* pModulWin);
virtual ~LineNumberWindow();
+ virtual void dispose() SAL_OVERRIDE;
void DoScroll( long nHorzScroll, long nVertScroll );
diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx
index be4c92593604..2960bfa34929 100644
--- a/basctl/source/basicide/macrodlg.cxx
+++ b/basctl/source/basicide/macrodlg.cxx
@@ -112,8 +112,31 @@ MacroChooser::MacroChooser( vcl::Window* pParnt, bool bCreateEntries )
MacroChooser::~MacroChooser()
{
+ disposeOnce();
+}
+
+void MacroChooser::dispose()
+{
if ( bForceStoreBasic )
+ {
SfxGetpApp()->SaveBasicAndDialogContainer();
+ bForceStoreBasic = false;
+ }
+ m_pMacroNameEdit.clear();
+ m_pMacroFromTxT.clear();
+ m_pMacrosSaveInTxt.clear();
+ m_pBasicBox.clear();
+ m_pMacrosInTxt.clear();
+ m_pMacroBox.clear();
+ m_pRunButton.clear();
+ m_pCloseButton.clear();
+ m_pAssignButton.clear();
+ m_pEditButton.clear();
+ m_pDelButton.clear();
+ m_pOrganizeButton.clear();
+ m_pNewLibButton.clear();
+ m_pNewModButton.clear();
+ SfxModalDialog::dispose();
}
void MacroChooser::StoreMacroDescription()
@@ -754,7 +777,7 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton )
StoreMacroDescription();
EntryDescriptor aDesc = m_pBasicBox->GetEntryDescriptor(m_pBasicBox->FirstSelected());
- boost::scoped_ptr<OrganizeDialog> pDlg(new OrganizeDialog( this, 0, aDesc ));
+ VclPtrInstance< OrganizeDialog > pDlg( this, 0, aDesc );
sal_uInt16 nRet = pDlg->Execute();
pDlg.reset();
diff --git a/basctl/source/basicide/macrodlg.hxx b/basctl/source/basicide/macrodlg.hxx
index 5cd80eb12540..c9c36cee13a6 100644
--- a/basctl/source/basicide/macrodlg.hxx
+++ b/basctl/source/basicide/macrodlg.hxx
@@ -45,22 +45,22 @@ public:
};
private:
- Edit* m_pMacroNameEdit;
- FixedText* m_pMacroFromTxT;
- FixedText* m_pMacrosSaveInTxt;
- TreeListBox* m_pBasicBox;
- FixedText* m_pMacrosInTxt;
+ VclPtr<Edit> m_pMacroNameEdit;
+ VclPtr<FixedText> m_pMacroFromTxT;
+ VclPtr<FixedText> m_pMacrosSaveInTxt;
+ VclPtr<TreeListBox> m_pBasicBox;
+ VclPtr<FixedText> m_pMacrosInTxt;
OUString m_aMacrosInTxtBaseStr;
- SvTreeListBox* m_pMacroBox;
+ VclPtr<SvTreeListBox> m_pMacroBox;
- PushButton* m_pRunButton;
- CloseButton* m_pCloseButton;
- PushButton* m_pAssignButton;
- PushButton* m_pEditButton;
- PushButton* m_pDelButton;
- PushButton* m_pOrganizeButton;
- PushButton* m_pNewLibButton;
- PushButton* m_pNewModButton;
+ VclPtr<PushButton> m_pRunButton;
+ VclPtr<CloseButton> m_pCloseButton;
+ VclPtr<PushButton> m_pAssignButton;
+ VclPtr<PushButton> m_pEditButton;
+ VclPtr<PushButton> m_pDelButton;
+ VclPtr<PushButton> m_pOrganizeButton;
+ VclPtr<PushButton> m_pNewLibButton;
+ VclPtr<PushButton> m_pNewModButton;
bool bNewDelIsDel;
bool bForceStoreBasic;
@@ -87,6 +87,7 @@ private:
public:
MacroChooser( vcl::Window* pParent, bool bCreateEntries = true );
virtual ~MacroChooser();
+ virtual void dispose() SAL_OVERRIDE;
SbMethod* GetMacro();
void DeleteMacro();
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 8793ca43aa89..7ac4766d3e14 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -161,15 +161,23 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeCheckBox(vcl::Window *
CheckBox::~CheckBox()
{
+ disposeOnce();
+}
+
+void CheckBox::dispose()
+{
delete pCheckButton;
+ pCheckButton = NULL;
// delete user data
SvTreeListEntry* pEntry = First();
while ( pEntry )
{
- delete static_cast<LibUserData*>(pEntry->GetUserData());
+ delete static_cast<LibUserData*>( pEntry->GetUserData() );
+ pEntry->SetUserData( NULL );
pEntry = Next( pEntry );
}
+ SvTabListBox::dispose();
}
void CheckBox::Init()
@@ -384,6 +392,18 @@ NewObjectDialog::NewObjectDialog(vcl::Window * pParent, ObjectMode::Mode eMode,
m_pOKButton->SetClickHdl(LINK(this, NewObjectDialog, OkButtonHandler));
}
+NewObjectDialog::~NewObjectDialog()
+{
+ disposeOnce();
+}
+
+void NewObjectDialog::dispose()
+{
+ m_pEdit.clear();
+ m_pOKButton.clear();
+ ModalDialog::dispose();
+}
+
// GotoLineDialog
GotoLineDialog::GotoLineDialog(vcl::Window * pParent )
: ModalDialog(pParent, "GotoLineDialog",
@@ -395,6 +415,18 @@ GotoLineDialog::GotoLineDialog(vcl::Window * pParent )
m_pOKButton->SetClickHdl(LINK(this, GotoLineDialog, OkButtonHandler));
}
+GotoLineDialog::~GotoLineDialog()
+{
+ disposeOnce();
+}
+
+void GotoLineDialog::dispose()
+{
+ m_pEdit.clear();
+ m_pOKButton.clear();
+ ModalDialog::dispose();
+}
+
sal_Int32 GotoLineDialog::GetLineNumber() const
{
return m_pEdit->GetText().toInt32();
@@ -429,6 +461,18 @@ ExportDialog::ExportDialog(vcl::Window * pParent)
m_pOKButton->SetClickHdl(LINK(this, ExportDialog, OkButtonHandler));
}
+ExportDialog::~ExportDialog()
+{
+ disposeOnce();
+}
+
+void ExportDialog::dispose()
+{
+ m_pExportAsPackageButton.clear();
+ m_pOKButton.clear();
+ ModalDialog::dispose();
+}
+
// LibPage
LibPage::LibPage(vcl::Window * pParent)
: TabPage(pParent, "LibPage",
@@ -476,12 +520,30 @@ LibPage::LibPage(vcl::Window * pParent)
LibPage::~LibPage()
{
- sal_uInt16 nCount = m_pBasicsBox->GetEntryCount();
- for ( sal_uInt16 i = 0; i < nCount; ++i )
+ disposeOnce();
+}
+
+void LibPage::dispose()
+{
+ if (m_pBasicsBox)
{
- DocumentEntry* pEntry = static_cast<DocumentEntry*>(m_pBasicsBox->GetEntryData( i ));
- delete pEntry;
+ sal_uInt16 nCount = m_pBasicsBox->GetEntryCount();
+ for ( sal_uInt16 i = 0; i < nCount; ++i )
+ {
+ DocumentEntry* pEntry = static_cast<DocumentEntry*>(m_pBasicsBox->GetEntryData( i ));
+ delete pEntry;
+ }
}
+ m_pBasicsBox.clear();
+ m_pLibBox.clear();
+ m_pEditButton.clear();
+ m_pPasswordButton.clear();
+ m_pNewLibButton.clear();
+ m_pInsertLibButton.clear();
+ m_pExportButton.clear();
+ m_pDelButton.clear();
+ pTabDlg.clear();
+ TabPage::dispose();
}
void LibPage::CheckButtons()
@@ -626,7 +688,7 @@ IMPL_LINK( LibPage, ButtonHdl, Button *, pButton )
bool const bProtected = xPasswd->isLibraryPasswordProtected( aLibName );
// change password dialog
- boost::scoped_ptr<SvxPasswordDialog> pDlg(new SvxPasswordDialog( this, true, !bProtected ));
+ VclPtrInstance< SvxPasswordDialog > pDlg( this, true, !bProtected );
pDlg->SetCheckPasswordHdl( LINK( this, LibPage, CheckPasswordHdl ) );
if ( pDlg->Execute() == RET_OK )
@@ -764,7 +826,7 @@ void LibPage::InsertLib()
if ( xModLibContImport.is() || xDlgLibContImport.is() )
{
- boost::scoped_ptr<LibDialog> pLibDlg;
+ VclPtr<LibDialog> pLibDlg;
Reference< script::XLibraryContainer > xModLibContImp( xModLibContImport, UNO_QUERY );
Reference< script::XLibraryContainer > xDlgLibContImp( xDlgLibContImport, UNO_QUERY );
@@ -776,7 +838,7 @@ void LibPage::InsertLib()
// library import dialog
if ( !pLibDlg )
{
- pLibDlg.reset(new LibDialog( this ));
+ pLibDlg.reset(VclPtr<LibDialog>::Create( this ));
pLibDlg->SetStorageName( aURLObj.getName() );
pLibDlg->GetLibBox().SetMode(ObjectMode::Library);
}
@@ -1066,12 +1128,12 @@ void LibPage::Export()
return;
}
- ExportDialog aNewDlg(this);
- if (aNewDlg.Execute() == RET_OK)
+ ScopedVclPtrInstance< ExportDialog > aNewDlg(this);
+ if (aNewDlg->Execute() == RET_OK)
{
try
{
- if (aNewDlg.isExportAsPackage())
+ if (aNewDlg->isExportAsPackage())
ExportAsPackage( aLibName );
else
ExportAsBasic( aLibName );
@@ -1442,13 +1504,13 @@ void createLibImpl( vcl::Window* pWin, const ScriptDocument& rDocument,
i++;
}
- NewObjectDialog aNewDlg(pWin, ObjectMode::Library);
- aNewDlg.SetObjectName(aLibName);
+ ScopedVclPtrInstance< NewObjectDialog > aNewDlg(pWin, ObjectMode::Library);
+ aNewDlg->SetObjectName(aLibName);
- if (aNewDlg.Execute())
+ if (aNewDlg->Execute())
{
- if (!aNewDlg.GetObjectName().isEmpty())
- aLibName = aNewDlg.GetObjectName();
+ if (!aNewDlg->GetObjectName().isEmpty())
+ aLibName = aNewDlg->GetObjectName();
if ( aLibName.getLength() > 30 )
{
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index ff181b230ec1..8abed4ee8893 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -62,9 +62,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeExtTreeListBox(vcl::Wi
return new ExtTreeListBox(pParent, nWinBits);
}
-ExtTreeListBox::~ExtTreeListBox ()
-{ }
-
bool ExtTreeListBox::EditingEntry( SvTreeListEntry* pEntry, Selection& )
{
bool bRet = false;
@@ -489,8 +486,19 @@ OrganizeDialog::OrganizeDialog(vcl::Window* pParent, sal_Int16 tabId,
OrganizeDialog::~OrganizeDialog()
{
- for ( sal_uInt16 i = 0; i < m_pTabCtrl->GetPageCount(); i++ )
- delete m_pTabCtrl->GetTabPage( m_pTabCtrl->GetPageId( i ) );
+ disposeOnce();
+}
+
+void OrganizeDialog::dispose()
+{
+ if (m_pTabCtrl)
+ {
+ for ( sal_uInt16 i = 0; i < m_pTabCtrl->GetPageCount(); i++ )
+ VclPtr<vcl::Window>(m_pTabCtrl->GetTabPage( m_pTabCtrl->GetPageId( i ) )).disposeAndClear();
+ }
+ m_pTabCtrl.clear();
+
+ TabDialog::dispose();
};
short OrganizeDialog::Execute()
@@ -510,25 +518,25 @@ IMPL_LINK( OrganizeDialog, ActivatePageHdl, TabControl *, pTabCtrl )
if ( !pTabCtrl->GetTabPage( nId ) )
{
OString sPageName(pTabCtrl->GetPageName(nId));
- TabPage* pNewTabPage = 0;
+ VclPtr<TabPage> pNewTabPage;
if (sPageName == "modules")
{
- ObjectPage* pObjectPage = new ObjectPage(pTabCtrl, "ModulePage", BROWSEMODE_MODULES);
- pNewTabPage = pObjectPage;
+ VclPtrInstance<ObjectPage> pObjectPage(pTabCtrl, "ModulePage", BROWSEMODE_MODULES);
+ pNewTabPage.reset(pObjectPage);
pObjectPage->SetTabDlg(this);
pObjectPage->SetCurrentEntry(m_aCurEntry);
}
else if (sPageName == "dialogs")
{
- ObjectPage* pObjectPage = new ObjectPage( pTabCtrl, "DialogPage", BROWSEMODE_DIALOGS );
- pNewTabPage = pObjectPage;
+ VclPtrInstance<ObjectPage> pObjectPage( pTabCtrl, "DialogPage", BROWSEMODE_DIALOGS );
+ pNewTabPage.reset(pObjectPage);
pObjectPage->SetTabDlg(this);
pObjectPage->SetCurrentEntry(m_aCurEntry);
}
else if (sPageName == "libraries")
{
- LibPage* pLibPage = new LibPage( pTabCtrl );
- pNewTabPage = pLibPage;
+ VclPtrInstance<LibPage> pLibPage( pTabCtrl );
+ pNewTabPage.reset(pLibPage);
pLibPage->SetTabDlg( this );
}
else
@@ -590,6 +598,22 @@ ObjectPage::ObjectPage(vcl::Window *pParent, const OString &rName, sal_uInt16 nM
CheckButtons();
}
+ObjectPage::~ObjectPage()
+{
+ disposeOnce();
+}
+
+void ObjectPage::dispose()
+{
+ m_pBasicBox.clear();
+ m_pEditButton.clear();
+ m_pNewModButton.clear();
+ m_pNewDlgButton.clear();
+ m_pDelButton.clear();
+ pTabDlg.clear();
+ TabPage::dispose();
+}
+
void ObjectPage::SetCurrentEntry (EntryDescriptor& rDesc)
{
m_pBasicBox->SetCurrentEntry( rDesc );
@@ -801,12 +825,12 @@ void ObjectPage::NewDialog()
{
aDocument.getOrCreateLibrary( E_DIALOGS, aLibName );
- NewObjectDialog aNewDlg(this, ObjectMode::Dialog, true);
- aNewDlg.SetObjectName( aDocument.createObjectName( E_DIALOGS, aLibName ) );
+ ScopedVclPtrInstance< NewObjectDialog > aNewDlg(this, ObjectMode::Dialog, true);
+ aNewDlg->SetObjectName( aDocument.createObjectName( E_DIALOGS, aLibName ) );
- if (aNewDlg.Execute() != 0)
+ if (aNewDlg->Execute() != 0)
{
- OUString aDlgName = aNewDlg.GetObjectName();
+ OUString aDlgName = aNewDlg->GetObjectName();
if (aDlgName.isEmpty())
aDlgName = aDocument.createObjectName( E_DIALOGS, aLibName);
@@ -919,6 +943,21 @@ LibDialog::LibDialog( vcl::Window* pParent )
m_pLibBox->set_width_request(m_pLibBox->approximate_char_width() * 32);
}
+LibDialog::~LibDialog()
+{
+ disposeOnce();
+}
+
+void LibDialog::dispose()
+{
+ m_pStorageFrame.clear();
+ m_pLibBox.clear();
+ m_pReferenceBox.clear();
+ m_pReplaceBox.clear();
+ ModalDialog::dispose();
+}
+
+
void LibDialog::SetStorageName( const OUString& rName )
{
OUString aName( IDE_RESSTR(RID_STR_FILENAME) );
@@ -944,13 +983,13 @@ SbModule* createModImpl( vcl::Window* pWin, const ScriptDocument& rDocument,
if ( aModName.isEmpty() )
aModName = rDocument.createObjectName( E_SCRIPTS, aLibName );
- NewObjectDialog aNewDlg(pWin, ObjectMode::Module, true);
- aNewDlg.SetObjectName( aModName );
+ ScopedVclPtrInstance< NewObjectDialog > aNewDlg(pWin, ObjectMode::Module, true);
+ aNewDlg->SetObjectName( aModName );
- if (aNewDlg.Execute() != 0)
+ if (aNewDlg->Execute() != 0)
{
- if (!aNewDlg.GetObjectName().isEmpty() )
- aModName = aNewDlg.GetObjectName();
+ if (!aNewDlg->GetObjectName().isEmpty() )
+ aModName = aNewDlg->GetObjectName();
try
{
diff --git a/basctl/source/basicide/moduldlg.hxx b/basctl/source/basicide/moduldlg.hxx
index a1c3f79e8e45..12907c0c2342 100644
--- a/basctl/source/basicide/moduldlg.hxx
+++ b/basctl/source/basicide/moduldlg.hxx
@@ -48,12 +48,14 @@ namespace ObjectMode
class NewObjectDialog : public ModalDialog
{
private:
- Edit* m_pEdit;
- OKButton* m_pOKButton;
+ VclPtr<Edit> m_pEdit;
+ VclPtr<OKButton> m_pOKButton;
DECL_LINK(OkButtonHandler, void *);
public:
NewObjectDialog (vcl::Window* pParent, ObjectMode::Mode, bool bCheckName = false);
+ virtual ~NewObjectDialog();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetObjectName() const { return m_pEdit->GetText(); }
void SetObjectName( const OUString& rName )
{
@@ -64,19 +66,21 @@ public:
class GotoLineDialog : public ModalDialog
{
- Edit* m_pEdit;
- OKButton* m_pOKButton;
+ VclPtr<Edit> m_pEdit;
+ VclPtr<OKButton> m_pOKButton;
DECL_LINK(OkButtonHandler, void *);
public:
GotoLineDialog(vcl::Window * pParent);
+ virtual ~GotoLineDialog();
+ virtual void dispose() SAL_OVERRIDE;
sal_Int32 GetLineNumber() const;
};
class ExportDialog : public ModalDialog
{
private:
- RadioButton* m_pExportAsPackageButton;
- OKButton* m_pOKButton;
+ VclPtr<RadioButton> m_pExportAsPackageButton;
+ VclPtr<OKButton> m_pOKButton;
bool mbExportAsPackage;
@@ -84,6 +88,8 @@ private:
public:
ExportDialog( vcl::Window * pParent );
+ virtual ~ExportDialog();
+ virtual void dispose() SAL_OVERRIDE;
bool isExportAsPackage () const { return mbExportAsPackage; }
};
@@ -107,7 +113,6 @@ protected:
public:
ExtTreeListBox(vcl::Window* pParent, WinBits nStyle);
- virtual ~ExtTreeListBox();
};
class CheckBox : public SvTabListBox
@@ -121,6 +126,7 @@ private:
public:
CheckBox(vcl::Window* pParent, WinBits nStyle);
virtual ~CheckBox();
+ virtual void dispose() SAL_OVERRIDE;
SvTreeListEntry* DoInsertEntry( const OUString& rStr, sal_uLong nPos = LISTBOX_APPEND );
SvTreeListEntry* FindEntry( const OUString& rName );
@@ -141,13 +147,15 @@ public:
class LibDialog: public ModalDialog
{
private:
- VclFrame* m_pStorageFrame;
- CheckBox* m_pLibBox;
- ::CheckBox* m_pReferenceBox;
- ::CheckBox* m_pReplaceBox;
+ VclPtr<VclFrame> m_pStorageFrame;
+ VclPtr<CheckBox> m_pLibBox;
+ VclPtr<::CheckBox> m_pReferenceBox;
+ VclPtr<::CheckBox> m_pReplaceBox;
public:
LibDialog( vcl::Window* pParent );
+ virtual ~LibDialog();
+ virtual void dispose() SAL_OVERRIDE;
void SetStorageName( const OUString& rName );
@@ -162,12 +170,13 @@ public:
class OrganizeDialog : public TabDialog
{
private:
- TabControl* m_pTabCtrl;
+ VclPtr<TabControl> m_pTabCtrl;
EntryDescriptor m_aCurEntry;
public:
OrganizeDialog( vcl::Window* pParent, sal_Int16 tabId, EntryDescriptor& rDesc );
virtual ~OrganizeDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
@@ -177,11 +186,11 @@ public:
class ObjectPage: public TabPage
{
protected:
- ExtTreeListBox* m_pBasicBox;
- PushButton* m_pEditButton;
- PushButton* m_pNewModButton;
- PushButton* m_pNewDlgButton;
- PushButton* m_pDelButton;
+ VclPtr<ExtTreeListBox> m_pBasicBox;
+ VclPtr<PushButton> m_pEditButton;
+ VclPtr<PushButton> m_pNewModButton;
+ VclPtr<PushButton> m_pNewDlgButton;
+ VclPtr<PushButton> m_pDelButton;
DECL_LINK( BasicBoxHighlightHdl, TreeListBox * );
DECL_LINK( ButtonHdl, Button * );
@@ -192,13 +201,15 @@ protected:
void NewDialog();
void EndTabDialog( sal_uInt16 nRet );
- TabDialog* pTabDlg;
+ VclPtr<TabDialog> pTabDlg;
virtual void ActivatePage() SAL_OVERRIDE;
virtual void DeactivatePage() SAL_OVERRIDE;
public:
ObjectPage(vcl::Window* pParent, const OString& rName, sal_uInt16 nMode);
+ virtual ~ObjectPage();
+ virtual void dispose() SAL_OVERRIDE;
void SetCurrentEntry( EntryDescriptor& rDesc );
void SetTabDlg( TabDialog* p ) { pTabDlg = p;}
@@ -208,14 +219,14 @@ public:
class LibPage: public TabPage
{
protected:
- ListBox* m_pBasicsBox;
- CheckBox* m_pLibBox;
- PushButton* m_pEditButton;
- PushButton* m_pPasswordButton;
- PushButton* m_pNewLibButton;
- PushButton* m_pInsertLibButton;
- PushButton* m_pExportButton;
- PushButton* m_pDelButton;
+ VclPtr<ListBox> m_pBasicsBox;
+ VclPtr<CheckBox> m_pLibBox;
+ VclPtr<PushButton> m_pEditButton;
+ VclPtr<PushButton> m_pPasswordButton;
+ VclPtr<PushButton> m_pNewLibButton;
+ VclPtr<PushButton> m_pInsertLibButton;
+ VclPtr<PushButton> m_pExportButton;
+ VclPtr<PushButton> m_pDelButton;
ScriptDocument m_aCurDocument;
LibraryLocation m_eCurLocation;
@@ -241,11 +252,12 @@ protected:
virtual void ActivatePage() SAL_OVERRIDE;
virtual void DeactivatePage() SAL_OVERRIDE;
- TabDialog* pTabDlg;
+ VclPtr<TabDialog> pTabDlg;
public:
LibPage( vcl::Window* pParent );
virtual ~LibPage();
+ virtual void dispose() SAL_OVERRIDE;
void SetTabDlg( TabDialog* p ) { pTabDlg = p;}
};
diff --git a/basctl/source/basicide/objdlg.cxx b/basctl/source/basicide/objdlg.cxx
index 7bc31392b8c9..d8b9538aff3d 100644
--- a/basctl/source/basicide/objdlg.cxx
+++ b/basctl/source/basicide/objdlg.cxx
@@ -30,27 +30,27 @@ namespace basctl
ObjectCatalog::ObjectCatalog (vcl::Window* pParent) :
DockingWindow(pParent),
- aTitle(this),
- aTree(this, IDEResId(RID_TLB_MACROS))
+ aTitle(VclPtr<FixedText>::Create(this)),
+ aTree(VclPtr<TreeListBox>::Create(this, IDEResId(RID_TLB_MACROS)))
{
SetHelpId("basctl:FloatingWindow:RID_BASICIDE_OBJCAT");
SetText(IDEResId(RID_BASICIDE_OBJCAT).toString());
// title
- aTitle.SetText(IDEResId(RID_BASICIDE_OBJCAT).toString());
- aTitle.SetStyle(WB_CENTER);
+ aTitle->SetText(IDEResId(RID_BASICIDE_OBJCAT).toString());
+ aTitle->SetStyle(WB_CENTER);
// tree list
- aTree.Hide();
- aTree.SetStyle(
+ aTree->Hide();
+ aTree->SetStyle(
WB_BORDER | WB_TABSTOP | WB_HSCROLL |
WB_HASLINES | WB_HASLINESATROOT |
WB_HASBUTTONS | WB_HASBUTTONSATROOT
);
- aTree.SetAccessibleName(IDEResId(RID_STR_TLB_MACROS).toString());
- aTree.SetHelpId(HID_BASICIDE_OBJECTCAT);
- aTree.ScanAllEntries();
- aTree.GrabFocus();
+ aTree->SetAccessibleName(IDEResId(RID_STR_TLB_MACROS).toString());
+ aTree->SetHelpId(HID_BASICIDE_OBJECTCAT);
+ aTree->ScanAllEntries();
+ aTree->GrabFocus();
{
// centered after AppWin:
@@ -67,9 +67,18 @@ ObjectCatalog::ObjectCatalog (vcl::Window* pParent) :
GetParent()->GetSystemWindow()->GetTaskPaneList()->AddWindow(this);
}
-ObjectCatalog::~ObjectCatalog ()
+ObjectCatalog::~ObjectCatalog()
{
- GetParent()->GetSystemWindow()->GetTaskPaneList()->RemoveWindow(this);
+ disposeOnce();
+}
+
+void ObjectCatalog::dispose()
+{
+ if (!IsDisposed())
+ GetParent()->GetSystemWindow()->GetTaskPaneList()->RemoveWindow(this);
+ aTitle.disposeAndClear();
+ aTree.disposeAndClear();
+ DockingWindow::dispose();
}
// Resize() -- called by Window
@@ -97,14 +106,14 @@ void ObjectCatalog::ArrangeWindows ()
// title
// (showing only if no title bar)
if (bFloating)
- aTitle.Hide();
+ aTitle->Hide();
else
{
Size aTitleSize = LogicToPixel(Size(3, 10), MAP_APPFONT);
aTitleSize.Width() = aSize.Width() - 2*aTitleSize.Width();
- aTitle.SetPosPixel(LogicToPixel(Point(3, 3), MAP_APPFONT));
- aTitle.SetSizePixel(aTitleSize);
- aTitle.Show();
+ aTitle->SetPosPixel(LogicToPixel(Point(3, 3), MAP_APPFONT));
+ aTitle->SetSizePixel(aTitleSize);
+ aTitle->Show();
}
// tree
@@ -116,11 +125,11 @@ void ObjectCatalog::ArrangeWindows ()
);
if (aTreeSize.Height() > 0)
{
- aTree.SetPosSizePixel(aTreePos, aTreeSize);
- aTree.Show();
+ aTree->SetPosSizePixel(aTreePos, aTreeSize);
+ aTree->Show();
}
else
- aTree.Hide();
+ aTree->Hide();
}
void ObjectCatalog::SetCurrentEntry (BaseWindow* pCurWin)
@@ -128,7 +137,7 @@ void ObjectCatalog::SetCurrentEntry (BaseWindow* pCurWin)
EntryDescriptor aDescriptor;
if (pCurWin)
aDescriptor = pCurWin->CreateEntryDescriptor();
- aTree.SetCurrentEntry(aDescriptor);
+ aTree->SetCurrentEntry(aDescriptor);
}
diff --git a/basctl/source/basicide/objdlg.hxx b/basctl/source/basicide/objdlg.hxx
index aca869793836..1ce7389044c4 100644
--- a/basctl/source/basicide/objdlg.hxx
+++ b/basctl/source/basicide/objdlg.hxx
@@ -37,15 +37,16 @@ class ObjectCatalog : public DockingWindow
public:
ObjectCatalog (vcl::Window* pParent);
virtual ~ObjectCatalog ();
+ virtual void dispose() SAL_OVERRIDE;
public:
- void UpdateEntries () { aTree.UpdateEntries(); }
+ void UpdateEntries () { aTree->UpdateEntries(); }
void SetCurrentEntry (BaseWindow* pCurWin);
private:
// title: "Object Catalog"
- FixedText aTitle;
+ VclPtr<FixedText> aTitle;
// the tree-list of the objects
- TreeListBox aTree;
+ VclPtr<TreeListBox> aTree;
private:
virtual void Resize () SAL_OVERRIDE; // Window
diff --git a/basctl/source/basicide/tbxctl.cxx b/basctl/source/basicide/tbxctl.cxx
index fac2961b8455..328ea08e3f27 100644
--- a/basctl/source/basicide/tbxctl.cxx
+++ b/basctl/source/basicide/tbxctl.cxx
@@ -141,7 +141,7 @@ void TbxControls::Select( sal_uInt16 nModifier )
|* rItemRect are the screen coordinates
|*
\************************************************************************/
-SfxPopupWindow* TbxControls::CreatePopupWindow()
+VclPtr<SfxPopupWindow> TbxControls::CreatePopupWindow()
{
if ( GetSlotId() == SID_CHOOSE_CONTROLS )
createAndPositionSubToolBar( aSubToolBarResName );
diff --git a/basctl/source/basicide/tbxctl.hxx b/basctl/source/basicide/tbxctl.hxx
index 7e8a5dcc409d..d9152a07211b 100644
--- a/basctl/source/basicide/tbxctl.hxx
+++ b/basctl/source/basicide/tbxctl.hxx
@@ -46,7 +46,7 @@ public:
virtual ~TbxControls() {}
virtual SfxPopupWindowType GetPopupWindowType() const SAL_OVERRIDE;
- virtual SfxPopupWindow* CreatePopupWindow() SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> CreatePopupWindow() SAL_OVERRIDE;
using SfxToolBoxControl::Select;
void Select( sal_uInt16 nModifier ) SAL_OVERRIDE;
diff --git a/basctl/source/dlged/managelang.cxx b/basctl/source/dlged/managelang.cxx
index fb513dc637db..eb4632366a23 100644
--- a/basctl/source/dlged/managelang.cxx
+++ b/basctl/source/dlged/managelang.cxx
@@ -75,7 +75,17 @@ ManageLanguageDialog::ManageLanguageDialog(vcl::Window* pParent, boost::shared_p
ManageLanguageDialog::~ManageLanguageDialog()
{
+ disposeOnce();
+}
+
+void ManageLanguageDialog::dispose()
+{
ClearLanguageBox();
+ m_pLanguageLB.clear();
+ m_pAddPB.clear();
+ m_pDeletePB.clear();
+ m_pMakeDefPB.clear();
+ ModalDialog::dispose();
}
void ManageLanguageDialog::Init()
@@ -136,11 +146,11 @@ void ManageLanguageDialog::ClearLanguageBox()
IMPL_LINK_NOARG(ManageLanguageDialog, AddHdl)
{
- SetDefaultLanguageDialog aDlg( this, m_xLocalizationMgr );
- if ( RET_OK == aDlg.Execute() )
+ ScopedVclPtrInstance< SetDefaultLanguageDialog > aDlg( this, m_xLocalizationMgr );
+ if ( RET_OK == aDlg->Execute() )
{
// add new locales
- Sequence< Locale > aLocaleSeq = aDlg.GetLocales();
+ Sequence< Locale > aLocaleSeq = aDlg->GetLocales();
m_xLocalizationMgr->handleAddLocales( aLocaleSeq );
// update listbox
ClearLanguageBox();
@@ -154,8 +164,8 @@ IMPL_LINK_NOARG(ManageLanguageDialog, AddHdl)
IMPL_LINK_NOARG(ManageLanguageDialog, DeleteHdl)
{
- MessageDialog aQBox(this, "DeleteLangDialog", "modules/BasicIDE/ui/deletelang.ui");
- if ( aQBox.Execute() == RET_OK )
+ ScopedVclPtrInstance< MessageDialog > aQBox(this, "DeleteLangDialog", "modules/BasicIDE/ui/deletelang.ui");
+ if ( aQBox->Execute() == RET_OK )
{
sal_uInt16 i, nCount = m_pLanguageLB->GetSelectEntryCount();
sal_uInt16 nPos = m_pLanguageLB->GetSelectEntryPos();
@@ -247,6 +257,22 @@ SetDefaultLanguageDialog::SetDefaultLanguageDialog(vcl::Window* pParent, boost::
FillLanguageBox();
}
+SetDefaultLanguageDialog::~SetDefaultLanguageDialog()
+{
+ disposeOnce();
+}
+
+void SetDefaultLanguageDialog::dispose()
+{
+ m_pLanguageFT.clear();
+ m_pLanguageLB.clear();
+ m_pCheckLangFT.clear();
+ m_pCheckLangLB.clear();
+ m_pDefinedFT.clear();
+ m_pAddedFT.clear();
+ ModalDialog::dispose();
+}
+
void SetDefaultLanguageDialog::FillLanguageBox()
{
// fill list with all languages
diff --git a/basctl/source/dlged/propbrw.cxx b/basctl/source/dlged/propbrw.cxx
index e38c26632a82..5f89f2627a40 100644
--- a/basctl/source/dlged/propbrw.cxx
+++ b/basctl/source/dlged/propbrw.cxx
@@ -190,8 +190,14 @@ void PropBrw::ImplReCreateController()
PropBrw::~PropBrw()
{
+ disposeOnce();
+}
+
+void PropBrw::dispose()
+{
if ( m_xBrowserController.is() )
ImplDestroyController();
+ DockingWindow::dispose();
}
diff --git a/basctl/source/inc/accessibledialogcontrolshape.hxx b/basctl/source/inc/accessibledialogcontrolshape.hxx
index 7192763c27dc..bc0d52b33eec 100644
--- a/basctl/source/inc/accessibledialogcontrolshape.hxx
+++ b/basctl/source/inc/accessibledialogcontrolshape.hxx
@@ -24,6 +24,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <comphelper/accessiblecomponenthelper.hxx>
#include <cppuhelper/implbase3.hxx>
+#include <vcl/vclptr.hxx>
namespace vcl { class Window; }
class VCLExternalSolarLock;
@@ -56,7 +57,7 @@ class AccessibleDialogControlShape : public AccessibleExtendedComponentHelper
private:
VCLExternalSolarLock* m_pExternalLock;
- DialogWindow* m_pDialogWindow;
+ VclPtr<DialogWindow> m_pDialogWindow;
DlgEdObj* m_pDlgEdObj;
bool m_bFocused;
bool m_bSelected;
diff --git a/basctl/source/inc/accessibledialogwindow.hxx b/basctl/source/inc/accessibledialogwindow.hxx
index c57b2590ae71..bd2739440160 100644
--- a/basctl/source/inc/accessibledialogwindow.hxx
+++ b/basctl/source/inc/accessibledialogwindow.hxx
@@ -26,6 +26,7 @@
#include <cppuhelper/implbase3.hxx>
#include <svl/lstner.hxx>
#include <tools/link.hxx>
+#include <vcl/vclptr.hxx>
class VCLExternalSolarLock;
class VclSimpleEvent;
@@ -80,7 +81,7 @@ private:
AccessibleChildren m_aAccessibleChildren;
VCLExternalSolarLock* m_pExternalLock;
- basctl::DialogWindow* m_pDialogWindow;
+ VclPtr<basctl::DialogWindow> m_pDialogWindow;
DlgEditor* m_pDlgEditor;
DlgEdModel* m_pDlgEdModel;
diff --git a/basctl/source/inc/baside3.hxx b/basctl/source/inc/baside3.hxx
index b73b9e571b6e..de17eb08403c 100644
--- a/basctl/source/inc/baside3.hxx
+++ b/basctl/source/inc/baside3.hxx
@@ -81,8 +81,7 @@ protected:
public:
TYPEINFO_OVERRIDE();
DialogWindow (DialogWindowLayout* pParent, ScriptDocument const& rDocument, const OUString& aLibName, const OUString& aName, com::sun::star::uno::Reference<com::sun::star::container::XNameContainer> const& xDialogModel);
- DialogWindow( DialogWindow* pCurView ); // never implemented
- virtual ~DialogWindow();
+ DialogWindow( DialogWindow* pCurView ); // never implemented
virtual void ExecuteCommand( SfxRequest& rReq ) SAL_OVERRIDE;
virtual void GetState( SfxItemSet& ) SAL_OVERRIDE;
@@ -129,6 +128,7 @@ class DialogWindowLayout : public Layout
public:
DialogWindowLayout (vcl::Window* pParent, ObjectCatalog&);
virtual ~DialogWindowLayout();
+ virtual void dispose() SAL_OVERRIDE;
public:
void ShowPropertyBrowser ();
void UpdatePropertyBrowser ();
@@ -146,12 +146,12 @@ protected:
private:
// child window
- DialogWindow* pChild;
+ VclPtr<DialogWindow> pChild;
// dockable windows:
// object catalog (owned by Shell)
ObjectCatalog& rObjectCatalog;
// property browser (created by this, deleted by toolkit)
- PropBrw* pPropertyBrowser;
+ VclPtr<PropBrw> pPropertyBrowser;
private:
void AddPropertyBrowser ();
diff --git a/basctl/source/inc/basidesh.hxx b/basctl/source/inc/basidesh.hxx
index a6e8ecc43e39..3ae9b5bac73b 100644
--- a/basctl/source/inc/basidesh.hxx
+++ b/basctl/source/inc/basidesh.hxx
@@ -56,7 +56,7 @@ class Shell :
public DocumentEventListener
{
public:
- typedef std::map<sal_uInt16, BaseWindow*> WindowTable;
+ typedef std::map<sal_uInt16, VclPtr<BaseWindow> > WindowTable;
typedef WindowTable::const_iterator WindowTableIt;
private:
@@ -64,26 +64,26 @@ private:
friend class LocalizationMgr;
friend bool implImportDialog( vcl::Window* pWin, const OUString& rCurPath, const ScriptDocument& rDocument, const OUString& aLibName ); // defined in baside3.cxx
- WindowTable aWindowTable;
+ WindowTable aWindowTable;
sal_uInt16 nCurKey;
- BaseWindow* pCurWin;
+ VclPtr<BaseWindow> pCurWin;
ScriptDocument m_aCurDocument;
OUString m_aCurLibName;
boost::shared_ptr<LocalizationMgr> m_pCurLocalizationMgr;
- ScrollBar aHScrollBar;
- ScrollBar aVScrollBar;
- ScrollBarBox aScrollBarBox;
- boost::scoped_ptr<TabBar> pTabBar; // basctl::TabBar
+ VclPtr<ScrollBar> aHScrollBar;
+ VclPtr<ScrollBar> aVScrollBar;
+ VclPtr<ScrollBarBox> aScrollBarBox;
+ VclPtr<TabBar> pTabBar; // basctl::TabBar
bool bTabBarSplitted;
bool bCreatingWindow;
// layout windows
- boost::scoped_ptr<ModulWindowLayout> pModulLayout;
- boost::scoped_ptr<DialogWindowLayout> pDialogLayout;
+ VclPtr<ModulWindowLayout> pModulLayout;
+ VclPtr<DialogWindowLayout> pDialogLayout;
// the active layout window
- Layout* pLayout;
+ VclPtr<Layout> pLayout;
// common object catalog window
- ObjectCatalog aObjectCatalog;
+ VclPtr<ObjectCatalog> aObjectCatalog;
bool m_bAppBasicModified;
DocumentEventNotifier m_aNotifier;
@@ -163,9 +163,9 @@ public:
OUString const& GetCurLibName() const { return m_aCurLibName; }
boost::shared_ptr<LocalizationMgr> GetCurLocalizationMgr() const { return m_pCurLocalizationMgr; }
- ScrollBar& GetHScrollBar() { return aHScrollBar; }
- ScrollBar& GetVScrollBar() { return aVScrollBar; }
- ScrollBarBox& GetScrollBarBox() { return aScrollBarBox; }
+ ScrollBar& GetHScrollBar() { return *aHScrollBar.get(); }
+ ScrollBar& GetVScrollBar() { return *aVScrollBar.get(); }
+ ScrollBarBox& GetScrollBarBox() { return *aScrollBarBox.get(); }
TabBar& GetTabBar() { return *pTabBar; }
WindowTable& GetWindowTable() { return aWindowTable; }
sal_uInt16 GetWindowId (BaseWindow const* pWin) const;
@@ -212,7 +212,7 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
GetCurrentDocument() const SAL_OVERRIDE;
- void UpdateObjectCatalog () { aObjectCatalog.UpdateEntries(); }
+ void UpdateObjectCatalog () { aObjectCatalog->UpdateEntries(); }
void RemoveWindow (BaseWindow* pWindow, bool bDestroy, bool bAllowChangeCurWindow = true);
};
diff --git a/basctl/source/inc/bastypes.hxx b/basctl/source/inc/bastypes.hxx
index c7e1e1d913a7..8b67fcc1270a 100644
--- a/basctl/source/inc/bastypes.hxx
+++ b/basctl/source/inc/bastypes.hxx
@@ -81,7 +81,8 @@ class DockingWindow : public ::DockingWindow
public:
DockingWindow (vcl::Window* pParent);
DockingWindow (Layout* pParent);
-public:
+ virtual ~DockingWindow();
+ virtual void dispose() SAL_OVERRIDE;
void ResizeIfDocking (Point const&, Size const&);
void ResizeIfDocking (Size const&);
Size GetDockingSize () const { return aDockingRect.GetSize(); }
@@ -103,7 +104,7 @@ private:
// the position and the size of the docking window
Rectangle aDockingRect;
// the parent layout window (only when docking)
- Layout* pLayout;
+ VclPtr<Layout> pLayout;
// > 0: shown, <= 0: hidden, ++ by Show() and -- by Hide()
int nShowCount;
@@ -149,8 +150,8 @@ class EntryDescriptor;
class BaseWindow : public vcl::Window
{
private:
- ScrollBar* pShellHScrollBar;
- ScrollBar* pShellVScrollBar;
+ VclPtr<ScrollBar> pShellHScrollBar;
+ VclPtr<ScrollBar> pShellVScrollBar;
DECL_LINK( ScrollHdl, ScrollBar * );
int nStatus;
@@ -169,6 +170,7 @@ public:
TYPEINFO();
BaseWindow( vcl::Window* pParent, const ScriptDocument& rDocument, const OUString& aLibName, const OUString& aName );
virtual ~BaseWindow();
+ virtual void dispose() SAL_OVERRIDE;
void Init();
virtual void DoInit();
diff --git a/basctl/source/inc/dlged.hxx b/basctl/source/inc/dlged.hxx
index 81e9f61ef57d..af9ad3c8e41d 100644
--- a/basctl/source/inc/dlged.hxx
+++ b/basctl/source/inc/dlged.hxx
@@ -30,6 +30,7 @@
#include <tools/gen.hxx>
#include <vcl/timer.hxx>
#include <vcl/idle.hxx>
+#include <vcl/vclptr.hxx>
#include <boost/scoped_ptr.hpp>
@@ -106,8 +107,8 @@ private:
static void Print( Printer* pPrinter, const OUString& rTitle );
private:
- ScrollBar* pHScroll;
- ScrollBar* pVScroll;
+ VclPtr<ScrollBar> pHScroll;
+ VclPtr<ScrollBar> pVScroll;
boost::scoped_ptr<DlgEdModel> pDlgEdModel; // never nullptr
DlgEdPage* pDlgEdPage; // never nullptr
boost::scoped_ptr<DlgEdView> pDlgEdView; // never nullptr
diff --git a/basctl/source/inc/managelang.hxx b/basctl/source/inc/managelang.hxx
index 8b07b27c0f80..f7b9335e5e24 100644
--- a/basctl/source/inc/managelang.hxx
+++ b/basctl/source/inc/managelang.hxx
@@ -52,10 +52,10 @@ extern bool localesAreEqual( const ::com::sun::star::lang::Locale& rLocaleLeft,
class ManageLanguageDialog : public ModalDialog
{
private:
- ListBox* m_pLanguageLB;
- PushButton* m_pAddPB;
- PushButton* m_pDeletePB;
- PushButton* m_pMakeDefPB;
+ VclPtr<ListBox> m_pLanguageLB;
+ VclPtr<PushButton> m_pAddPB;
+ VclPtr<PushButton> m_pDeletePB;
+ VclPtr<PushButton> m_pMakeDefPB;
boost::shared_ptr<LocalizationMgr> m_xLocalizationMgr;
@@ -74,17 +74,18 @@ private:
public:
ManageLanguageDialog( vcl::Window* pParent, boost::shared_ptr<LocalizationMgr> _pLMgr );
virtual ~ManageLanguageDialog();
+ virtual void dispose() SAL_OVERRIDE;
};
class SetDefaultLanguageDialog : public ModalDialog
{
private:
- FixedText* m_pLanguageFT;
- SvxLanguageBox* m_pLanguageLB;
- FixedText* m_pCheckLangFT;
- SvxCheckListBox* m_pCheckLangLB;
- FixedText* m_pDefinedFT;
- FixedText* m_pAddedFT;
+ VclPtr<FixedText> m_pLanguageFT;
+ VclPtr<SvxLanguageBox> m_pLanguageLB;
+ VclPtr<FixedText> m_pCheckLangFT;
+ VclPtr<SvxCheckListBox> m_pCheckLangLB;
+ VclPtr<FixedText> m_pDefinedFT;
+ VclPtr<FixedText> m_pAddedFT;
boost::shared_ptr<LocalizationMgr> m_xLocalizationMgr;
@@ -92,6 +93,8 @@ private:
public:
SetDefaultLanguageDialog(vcl::Window* pParent, boost::shared_ptr<LocalizationMgr> xLMgr);
+ virtual ~SetDefaultLanguageDialog();
+ virtual void dispose() SAL_OVERRIDE;
::com::sun::star::uno::Sequence< ::com::sun::star::lang::Locale > GetLocales() const;
};
diff --git a/basctl/source/inc/propbrw.hxx b/basctl/source/inc/propbrw.hxx
index 04ab22d5dccf..3262d36301d0 100644
--- a/basctl/source/inc/propbrw.hxx
+++ b/basctl/source/inc/propbrw.hxx
@@ -75,6 +75,7 @@ protected:
public:
explicit PropBrw (DialogWindowLayout&);
virtual ~PropBrw();
+ virtual void dispose() SAL_OVERRIDE;
using Window::Update;
// note: changing the Context document to an instance other than the one given in the ctor is not supported
// currently
diff --git a/basic/source/runtime/inputbox.cxx b/basic/source/runtime/inputbox.cxx
index c15127d45146..97208770c0a1 100644
--- a/basic/source/runtime/inputbox.cxx
+++ b/basic/source/runtime/inputbox.cxx
@@ -30,10 +30,10 @@
class SvRTLInputBox : public ModalDialog
{
- Edit aEdit;
- OKButton aOk;
- CancelButton aCancel;
- FixedText aPromptText;
+ VclPtr<Edit> aEdit;
+ VclPtr<OKButton> aOk;
+ VclPtr<CancelButton> aCancel;
+ VclPtr<FixedText> aPromptText;
OUString aText;
void PositionDialog( long nXTwips, long nYTwips, const Size& rDlgSize );
@@ -46,6 +46,8 @@ class SvRTLInputBox : public ModalDialog
public:
SvRTLInputBox( vcl::Window* pParent, const OUString& rPrompt, const OUString& rTitle,
const OUString& rDefault, long nXTwips = -1, long nYTwips = -1 );
+ virtual ~SvRTLInputBox() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE;
OUString GetText() const SAL_OVERRIDE { return aText; }
};
@@ -53,8 +55,8 @@ SvRTLInputBox::SvRTLInputBox( vcl::Window* pParent, const OUString& rPrompt,
const OUString& rTitle, const OUString& rDefault,
long nXTwips, long nYTwips ) :
ModalDialog( pParent,WB_3DLOOK | WB_MOVEABLE | WB_CLOSEABLE ),
- aEdit( this, WB_LEFT | WB_BORDER ),
- aOk( this ), aCancel( this ), aPromptText( this, WB_WORDBREAK )
+ aEdit( VclPtr<Edit>::Create(this, WB_LEFT | WB_BORDER) ),
+ aOk( new OKButton(this) ), aCancel( new CancelButton(this) ), aPromptText( VclPtr<FixedText>::Create(this, WB_WORDBREAK) )
{
SetMapMode( MapMode( MAP_APPFONT ) );
Size aDlgSizeApp( 280, 80 );
@@ -62,29 +64,38 @@ SvRTLInputBox::SvRTLInputBox( vcl::Window* pParent, const OUString& rPrompt,
InitButtons( aDlgSizeApp );
PositionEdit( aDlgSizeApp );
PositionPrompt( rPrompt, aDlgSizeApp );
- aOk.Show();
- aCancel.Show();
- aEdit.Show();
- aPromptText.Show();
+ aOk->Show();
+ aCancel->Show();
+ aEdit->Show();
+ aPromptText->Show();
SetText( rTitle );
vcl::Font aFont( GetFont());
Color aColor( GetBackground().GetColor() );
aFont.SetFillColor( aColor );
- aEdit.SetFont( aFont );
- aEdit.SetText( rDefault );
- aEdit.SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) );
+ aEdit->SetFont( aFont );
+ aEdit->SetText( rDefault );
+ aEdit->SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) );
+}
+
+void SvRTLInputBox::dispose()
+{
+ aEdit.disposeAndClear();
+ aOk.disposeAndClear();
+ aCancel.disposeAndClear();
+ aPromptText.disposeAndClear();
+ ModalDialog::dispose();
}
void SvRTLInputBox::InitButtons( const Size& rDlgSize )
{
- aOk.SetSizePixel( LogicToPixel( Size( 45, 15) ));
- aCancel.SetSizePixel( LogicToPixel( Size( 45, 15) ));
+ aOk->SetSizePixel( LogicToPixel( Size( 45, 15) ));
+ aCancel->SetSizePixel( LogicToPixel( Size( 45, 15) ));
Point aPos( rDlgSize.Width()-45-10, 5 );
- aOk.SetPosPixel( LogicToPixel( Point(aPos) ));
+ aOk->SetPosPixel( LogicToPixel( Point(aPos) ));
aPos.Y() += 16;
- aCancel.SetPosPixel( LogicToPixel( Point(aPos) ));
- aOk.SetClickHdl(LINK(this,SvRTLInputBox, OkHdl));
- aCancel.SetClickHdl(LINK(this,SvRTLInputBox,CancelHdl));
+ aCancel->SetPosPixel( LogicToPixel( Point(aPos) ));
+ aOk->SetClickHdl(LINK(this,SvRTLInputBox, OkHdl));
+ aCancel->SetClickHdl(LINK(this,SvRTLInputBox,CancelHdl));
}
void SvRTLInputBox::PositionDialog(long nXTwips, long nYTwips, const Size& rDlgSize)
@@ -99,8 +110,8 @@ void SvRTLInputBox::PositionDialog(long nXTwips, long nYTwips, const Size& rDlgS
void SvRTLInputBox::PositionEdit( const Size& rDlgSize )
{
- aEdit.SetPosPixel( LogicToPixel( Point( 5,rDlgSize.Height()-35)));
- aEdit.SetSizePixel( LogicToPixel( Size(rDlgSize.Width()-15,12)));
+ aEdit->SetPosPixel( LogicToPixel( Point( 5,rDlgSize.Height()-35)));
+ aEdit->SetSizePixel( LogicToPixel( Size(rDlgSize.Width()-15,12)));
}
@@ -109,12 +120,12 @@ void SvRTLInputBox::PositionPrompt(const OUString& rPrompt,const Size& rDlgSize)
if ( rPrompt.isEmpty() )
return;
OUString aText_(convertLineEnd(rPrompt, LINEEND_CR));
- aPromptText.SetPosPixel( LogicToPixel(Point(5,5)));
- aPromptText.SetText( aText_ );
+ aPromptText->SetPosPixel( LogicToPixel(Point(5,5)));
+ aPromptText->SetText( aText_ );
Size aSize( rDlgSize );
aSize.Width() -= 70;
aSize.Height() -= 50;
- aPromptText.SetSizePixel( LogicToPixel(aSize));
+ aPromptText->SetSizePixel( LogicToPixel(aSize));
}
@@ -122,7 +133,7 @@ IMPL_LINK_INLINE_START( SvRTLInputBox, OkHdl, Button *, pButton )
{
(void)pButton;
- aText = aEdit.GetText();
+ aText = aEdit->GetText();
EndDialog( 1 );
return 0;
}
@@ -172,8 +183,8 @@ RTLFUNC(InputBox)
nX = rPar.Get(4)->GetLong();
nY = rPar.Get(5)->GetLong();
}
- boost::scoped_ptr<SvRTLInputBox> pDlg(new SvRTLInputBox(Application::GetDefDialogParent(),
- rPrompt,aTitle,aDefault,nX,nY));
+ VclPtrInstance<SvRTLInputBox> pDlg(Application::GetDefDialogParent(),
+ rPrompt,aTitle,aDefault,nX,nY);
pDlg->Execute();
rPar.Get(0)->PutString( pDlg->GetText() );
}
diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx
index ae6d03e256fc..f4092002d4aa 100644
--- a/basic/source/runtime/iosys.cxx
+++ b/basic/source/runtime/iosys.cxx
@@ -66,25 +66,27 @@ using namespace com::sun::star::bridge;
class SbiInputDialog : public ModalDialog {
- Edit aInput;
- OKButton aOk;
- CancelButton aCancel;
+ VclPtr<Edit> aInput;
+ VclPtr<OKButton> aOk;
+ VclPtr<CancelButton> aCancel;
OUString aText;
DECL_LINK( Ok, vcl::Window * );
DECL_LINK( Cancel, vcl::Window * );
public:
SbiInputDialog( vcl::Window*, const OUString& );
+ virtual ~SbiInputDialog() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE;
const OUString& GetInput() { return aText; }
};
SbiInputDialog::SbiInputDialog( vcl::Window* pParent, const OUString& rPrompt )
:ModalDialog( pParent, WB_3DLOOK | WB_MOVEABLE | WB_CLOSEABLE ),
- aInput( this, WB_3DLOOK | WB_LEFT | WB_BORDER ),
- aOk( this ), aCancel( this )
+ aInput( VclPtr<Edit>::Create(this, WB_3DLOOK | WB_LEFT | WB_BORDER) ),
+ aOk( new OKButton(this) ), aCancel( VclPtr<CancelButton>::Create(this) )
{
SetText( rPrompt );
- aOk.SetClickHdl( LINK( this, SbiInputDialog, Ok ) );
- aCancel.SetClickHdl( LINK( this, SbiInputDialog, Cancel ) );
+ aOk->SetClickHdl( LINK( this, SbiInputDialog, Ok ) );
+ aCancel->SetClickHdl( LINK( this, SbiInputDialog, Cancel ) );
SetMapMode( MapMode( MAP_APPFONT ) );
Point aPt = LogicToPixel( Point( 50, 50 ) );
@@ -92,24 +94,32 @@ SbiInputDialog::SbiInputDialog( vcl::Window* pParent, const OUString& rPrompt )
SetPosSizePixel( aPt, aSz );
aPt = LogicToPixel( Point( 10, 10 ) );
aSz = LogicToPixel( Size( 120, 12 ) );
- aInput.SetPosSizePixel( aPt, aSz );
+ aInput->SetPosSizePixel( aPt, aSz );
aPt = LogicToPixel( Point( 15, 30 ) );
aSz = LogicToPixel( Size( 45, 15) );
- aOk.SetPosSizePixel( aPt, aSz );
+ aOk->SetPosSizePixel( aPt, aSz );
aPt = LogicToPixel( Point( 80, 30 ) );
aSz = LogicToPixel( Size( 45, 15) );
- aCancel.SetPosSizePixel( aPt, aSz );
+ aCancel->SetPosSizePixel( aPt, aSz );
- aInput.Show();
- aOk.Show();
- aCancel.Show();
+ aInput->Show();
+ aOk->Show();
+ aCancel->Show();
+}
+
+void SbiInputDialog::dispose()
+{
+ aInput.disposeAndClear();
+ aOk.disposeAndClear();
+ aCancel.disposeAndClear();
+ ModalDialog::dispose();
}
IMPL_LINK_INLINE_START( SbiInputDialog, Ok, vcl::Window *, pWindow )
{
(void)pWindow;
- aText = aInput.GetText();
+ aText = aInput->GetText();
EndDialog( 1 );
return 0;
}
@@ -956,10 +966,10 @@ void SbiIoSystem::CloseAll()
void SbiIoSystem::ReadCon(OString& rIn)
{
OUString aPromptStr(OStringToOUString(aPrompt, osl_getThreadTextEncoding()));
- SbiInputDialog aDlg( NULL, aPromptStr );
- if( aDlg.Execute() )
+ ScopedVclPtrInstance< SbiInputDialog > aDlg(nullptr, aPromptStr);
+ if( aDlg->Execute() )
{
- rIn = OUStringToOString(aDlg.GetInput(), osl_getThreadTextEncoding());
+ rIn = OUStringToOString(aDlg->GetInput(), osl_getThreadTextEncoding());
}
else
{
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 2cc26f78ea98..8b40e3643ef9 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -4611,7 +4611,7 @@ RTLFUNC(MsgBox)
}
nType &= (16+32+64);
- boost::scoped_ptr<MessBox> pBox;
+ VclPtr<MessBox> pBox;
SolarMutexGuard aSolarGuard;
@@ -4619,19 +4619,19 @@ RTLFUNC(MsgBox)
switch( nType )
{
case 16:
- pBox.reset(new ErrorBox( pParent, nWinBits, aMsg ));
+ pBox.reset(VclPtr<ErrorBox>::Create( pParent, nWinBits, aMsg ));
break;
case 32:
- pBox.reset(new QueryBox( pParent, nWinBits, aMsg ));
+ pBox.reset(VclPtr<QueryBox>::Create( pParent, nWinBits, aMsg ));
break;
case 48:
- pBox.reset(new WarningBox( pParent, nWinBits, aMsg ));
+ pBox.reset(VclPtr<WarningBox>::Create( pParent, nWinBits, aMsg ));
break;
case 64:
- pBox.reset(new InfoBox( pParent, nWinBits, aMsg ));
+ pBox.reset(VclPtr<InfoBox>::Create( pParent, nWinBits, aMsg ));
break;
default:
- pBox.reset(new MessBox( pParent, nWinBits, aTitle, aMsg ));
+ pBox.reset(VclPtr<MessBox>::Create( pParent, nWinBits, aTitle, aMsg ));
}
pBox->SetText( aTitle );
short nRet = pBox->Execute();
diff --git a/canvas/source/cairo/cairo_canvasfont.cxx b/canvas/source/cairo/cairo_canvasfont.cxx
index 9a2b8650ba54..bdfe3a193e73 100644
--- a/canvas/source/cairo/cairo_canvasfont.cxx
+++ b/canvas/source/cairo/cairo_canvasfont.cxx
@@ -63,7 +63,7 @@ namespace cairocanvas
// adjust to stretched/shrunk font
if( !::rtl::math::approxEqual( rFontMatrix.m00, rFontMatrix.m11) )
{
- OutputDevice* pOutDev( mpRefDevice->getOutputDevice() );
+ VclPtr<OutputDevice> pOutDev( mpRefDevice->getOutputDevice() );
if( pOutDev )
{
diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx
index 6157ea671020..7a918f4b38be 100644
--- a/canvas/source/cairo/cairo_canvashelper.cxx
+++ b/canvas/source/cairo/cairo_canvashelper.cxx
@@ -83,7 +83,7 @@ namespace cairocanvas
{
mpSurface.reset();
mpCairo.reset();
- mpVirtualDevice.reset();
+ mpVirtualDevice.disposeAndClear();
mpDevice = NULL;
mpSurfaceProvider = NULL;
}
@@ -105,7 +105,7 @@ namespace cairocanvas
void CanvasHelper::setSurface( const SurfaceSharedPtr& pSurface, bool bHasAlpha )
{
mbHaveAlpha = bHasAlpha;
- mpVirtualDevice.reset();
+ mpVirtualDevice.disposeAndClear();
mpSurface = pSurface;
mpCairo = pSurface->getCairo();
}
diff --git a/canvas/source/cairo/cairo_canvashelper.hxx b/canvas/source/cairo/cairo_canvashelper.hxx
index b67904d6ebf5..ed6f702a53aa 100644
--- a/canvas/source/cairo/cairo_canvashelper.hxx
+++ b/canvas/source/cairo/cairo_canvashelper.hxx
@@ -28,6 +28,8 @@
#include <basegfx/vector/b2dsize.hxx>
#include <com/sun/star/rendering/XLinePolyPolygon2D.hpp>
+#include <vcl/vclptr.hxx>
+#include <vcl/virdev.hxx>
#include <boost/utility.hpp>
#include <vcl/cairo.hxx>
@@ -269,7 +271,7 @@ namespace cairocanvas
private:
- boost::shared_ptr<VirtualDevice> mpVirtualDevice;
+ VclPtr<VirtualDevice> mpVirtualDevice;
void useStates( const ::com::sun::star::rendering::ViewState& viewState,
const ::com::sun::star::rendering::RenderState& renderState,
diff --git a/canvas/source/cairo/cairo_canvashelper_text.cxx b/canvas/source/cairo/cairo_canvashelper_text.cxx
index f3c4c05083c3..2a98ea7b6e09 100644
--- a/canvas/source/cairo/cairo_canvashelper_text.cxx
+++ b/canvas/source/cairo/cairo_canvashelper_text.cxx
@@ -175,7 +175,7 @@ namespace cairocanvas
class DeviceSettingsGuard
{
private:
- OutputDevice *mpVirtualDevice;
+ VclPtr<OutputDevice> mpVirtualDevice;
cairo_t *mpCairo;
bool mbMappingWasEnabled;
public:
@@ -272,7 +272,7 @@ namespace cairocanvas
cairo_fill(mpCairo.get());
#endif
::Point aOutpos;
- if( !setupTextOutput( *mpVirtualDevice, pOwner, aOutpos, viewState, renderState, xFont ) )
+ if( !setupTextOutput( *mpVirtualDevice.get(), pOwner, aOutpos, viewState, renderState, xFont ) )
return uno::Reference< rendering::XCachedPrimitive >(NULL); // no output necessary
// change text direction and layout mode
diff --git a/canvas/source/cairo/cairo_devicehelper.cxx b/canvas/source/cairo/cairo_devicehelper.cxx
index 9e7ba2e13ca5..684b61afcf2c 100644
--- a/canvas/source/cairo/cairo_devicehelper.cxx
+++ b/canvas/source/cairo/cairo_devicehelper.cxx
@@ -209,7 +209,7 @@ namespace cairocanvas
uno::Any DeviceHelper::getDeviceHandle() const
{
- return uno::makeAny( reinterpret_cast< sal_Int64 >(mpRefDevice) );
+ return uno::makeAny( reinterpret_cast< sal_Int64 >(mpRefDevice.get()) );
}
uno::Any DeviceHelper::getSurfaceHandle() const
diff --git a/canvas/source/cairo/cairo_devicehelper.hxx b/canvas/source/cairo/cairo_devicehelper.hxx
index 81f71810d61d..eafc5065e10b 100644
--- a/canvas/source/cairo/cairo_devicehelper.hxx
+++ b/canvas/source/cairo/cairo_devicehelper.hxx
@@ -116,7 +116,7 @@ namespace cairocanvas
*/
SurfaceProvider* mpSurfaceProvider;
- OutputDevice* mpRefDevice;
+ VclPtr<OutputDevice> mpRefDevice;
::cairo::SurfaceSharedPtr mpSurface;
};
}
diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx
index f5a197846e72..03d319473e7c 100644
--- a/canvas/source/cairo/cairo_textlayout.cxx
+++ b/canvas/source/cairo/cairo_textlayout.cxx
@@ -179,14 +179,14 @@ namespace cairocanvas
if( !pOutDev )
return geometry::RealRectangle2D();
- VirtualDevice aVDev( *pOutDev );
- aVDev.SetFont( mpFont->getVCLFont() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev( *pOutDev );
+ pVDev->SetFont( mpFont->getVCLFont() );
// need metrics for Y offset, the XCanvas always renders
// relative to baseline
- const ::FontMetric& aMetric( aVDev.GetFontMetric() );
+ const ::FontMetric& aMetric( pVDev->GetFontMetric() );
- setupLayoutMode( aVDev, mnTextDirection );
+ setupLayoutMode( *pVDev.get(), mnTextDirection );
const sal_Int32 nAboveBaseline( -aMetric.GetIntLeading() - aMetric.GetAscent() );
const sal_Int32 nBelowBaseline( aMetric.GetDescent() );
@@ -200,7 +200,7 @@ namespace cairocanvas
else
{
return geometry::RealRectangle2D( 0, nAboveBaseline,
- aVDev.GetTextWidth(
+ pVDev->GetTextWidth(
maText.Text,
::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
::canvas::tools::numeric_cast<sal_uInt16>(maText.Length) ),
diff --git a/canvas/source/directx/dx_9rm.cxx b/canvas/source/directx/dx_9rm.cxx
index b9ee8833a769..34e393897839 100644
--- a/canvas/source/directx/dx_9rm.cxx
+++ b/canvas/source/directx/dx_9rm.cxx
@@ -666,7 +666,8 @@ namespace dxcanvas
maVertexCache.reserve(1024);
mpWindow.reset(
- new SystemChildWindow(
+ VclPtr<SystemChildWindow>::Create(
+
const_cast<vcl::Window *>(&rWindow), 0) );
// system child window must not receive mouse events
diff --git a/canvas/source/directx/dx_devicehelper.cxx b/canvas/source/directx/dx_devicehelper.cxx
index cc824719c3d7..759bb0b70f17 100644
--- a/canvas/source/directx/dx_devicehelper.cxx
+++ b/canvas/source/directx/dx_devicehelper.cxx
@@ -52,6 +52,10 @@ namespace dxcanvas
{
}
+ DeviceHelper::~DeviceHelper()
+ {
+ }
+
void DeviceHelper::init( HDC hdc, OutputDevice* pOutDev,
rendering::XGraphicDevice& rDevice )
{
@@ -191,7 +195,7 @@ namespace dxcanvas
uno::Any DeviceHelper::getDeviceHandle() const
{
- return uno::makeAny( reinterpret_cast< sal_Int64 >(mpOutDev) );
+ return uno::makeAny( reinterpret_cast< sal_Int64 >(mpOutDev.get()) );
}
uno::Any DeviceHelper::getSurfaceHandle() const
diff --git a/canvas/source/directx/dx_devicehelper.hxx b/canvas/source/directx/dx_devicehelper.hxx
index bb455c3cc916..cdf1e943243e 100644
--- a/canvas/source/directx/dx_devicehelper.hxx
+++ b/canvas/source/directx/dx_devicehelper.hxx
@@ -28,7 +28,7 @@
#include "dx_bitmap.hxx"
#include <canvas/rendering/isurfaceproxymanager.hxx>
-
+#include <vcl/vclptr.hxx>
#include <boost/utility.hpp>
class OutputDevice;
@@ -40,6 +40,7 @@ namespace dxcanvas
{
public:
DeviceHelper();
+ ~DeviceHelper();
/** Init the device helper
@@ -105,7 +106,7 @@ namespace dxcanvas
*/
com::sun::star::rendering::XGraphicDevice* mpDevice;
HDC mnHDC;
- OutputDevice* mpOutDev;
+ VclPtr<OutputDevice> mpOutDev;
};
typedef ::rtl::Reference< com::sun::star::rendering::XGraphicDevice > DeviceRef;
diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx
index f6d641f8bb2b..501e7f83fe6b 100644
--- a/canvas/source/opengl/ogl_canvashelper.cxx
+++ b/canvas/source/opengl/ogl_canvashelper.cxx
@@ -725,8 +725,8 @@ namespace oglcanvas
if( mpDevice )
{
- VirtualDevice aVDev;
- aVDev.EnableOutput(false);
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
+ pVDev->EnableOutput(false);
CanvasFont* pFont=dynamic_cast<CanvasFont*>(xLayoutetText->getFont().get());
const rendering::StringContext& rTxt=xLayoutetText->getText();
@@ -749,7 +749,7 @@ namespace oglcanvas
// adjust to stretched font
if(!::rtl::math::approxEqual(rFontMatrix.m00, rFontMatrix.m11))
{
- const Size aSize = aVDev.GetFontMetric( aFont ).GetSize();
+ const Size aSize = pVDev->GetFontMetric( aFont ).GetSize();
const double fDividend( rFontMatrix.m10 + rFontMatrix.m11 );
double fStretch = (rFontMatrix.m00 + rFontMatrix.m01);
@@ -762,7 +762,7 @@ namespace oglcanvas
}
// set font
- aVDev.SetFont(aFont);
+ pVDev->SetFont(aFont);
mpRecordedActions->push_back( Action() );
Action& rAct=mpRecordedActions->back();
@@ -780,7 +780,7 @@ namespace oglcanvas
pDXArray[i] = basegfx::fround( aLogicalAdvancements[i] );
// get the glyphs
- aVDev.GetTextOutlines(rAct.maPolyPolys,
+ pVDev->GetTextOutlines(rAct.maPolyPolys,
rTxt.Text,
0,
rTxt.StartPosition,
@@ -792,7 +792,7 @@ namespace oglcanvas
else
{
// get the glyphs
- aVDev.GetTextOutlines(rAct.maPolyPolys,
+ pVDev->GetTextOutlines(rAct.maPolyPolys,
rTxt.Text,
0,
rTxt.StartPosition,
diff --git a/canvas/source/vcl/backbuffer.cxx b/canvas/source/vcl/backbuffer.cxx
index 73d6320fcba5..356caa9254e7 100644
--- a/canvas/source/vcl/backbuffer.cxx
+++ b/canvas/source/vcl/backbuffer.cxx
@@ -25,7 +25,7 @@ namespace vclcanvas
{
BackBuffer::BackBuffer( const OutputDevice& rRefDevice,
bool bMonochromeBuffer ) :
- maVDev( new VirtualDevice( rRefDevice,
+ maVDev( VclPtr<VirtualDevice>::Create( rRefDevice,
sal_uInt16(bMonochromeBuffer) ) )
{
if( !bMonochromeBuffer )
@@ -43,14 +43,20 @@ namespace vclcanvas
}
}
+ BackBuffer::~BackBuffer()
+ {
+ SolarMutexGuard aGuard;
+ maVDev.disposeAndClear();
+ }
+
OutputDevice& BackBuffer::getOutDev()
{
- return maVDev.get();
+ return *maVDev.get();
}
const OutputDevice& BackBuffer::getOutDev() const
{
- return maVDev.get();
+ return *maVDev.get();
}
void BackBuffer::setSize( const ::Size& rNewSize )
diff --git a/canvas/source/vcl/backbuffer.hxx b/canvas/source/vcl/backbuffer.hxx
index 0fea559876dd..0beeda2e0467 100644
--- a/canvas/source/vcl/backbuffer.hxx
+++ b/canvas/source/vcl/backbuffer.hxx
@@ -43,6 +43,7 @@ namespace vclcanvas
*/
BackBuffer( const OutputDevice& rRefDevice,
bool bMonochromeBuffer=false );
+ virtual ~BackBuffer();
virtual OutputDevice& getOutDev() SAL_OVERRIDE;
virtual const OutputDevice& getOutDev() const SAL_OVERRIDE;
@@ -50,7 +51,7 @@ namespace vclcanvas
void setSize( const ::Size& rNewSize );
private:
- ::canvas::vcltools::VCLObject<VirtualDevice> maVDev;
+ VclPtr< VirtualDevice > maVDev;
};
typedef ::boost::shared_ptr< BackBuffer > BackBufferSharedPtr;
diff --git a/canvas/source/vcl/bitmapbackbuffer.cxx b/canvas/source/vcl/bitmapbackbuffer.cxx
index d140ea002a10..bd01d71b5c54 100644
--- a/canvas/source/vcl/bitmapbackbuffer.cxx
+++ b/canvas/source/vcl/bitmapbackbuffer.cxx
@@ -45,8 +45,7 @@ namespace vclcanvas
// are supposed to be called with already locked solar mutex)
SolarMutexGuard aGuard;
- if( mpVDev )
- delete mpVDev;
+ mpVDev.disposeAndClear();
}
OutputDevice& BitmapBackBuffer::getOutDev()
@@ -113,8 +112,8 @@ namespace vclcanvas
// VDev not yet created, do it now. Create an alpha-VDev,
// if bitmap has transparency.
mpVDev = maBitmap->IsTransparent() ?
- new VirtualDevice( mrRefDevice, 0, 0 ) :
- new VirtualDevice( mrRefDevice );
+ VclPtr<VirtualDevice>::Create( mrRefDevice, 0, 0 ) :
+ VclPtr<VirtualDevice>::Create( mrRefDevice );
OSL_ENSURE( mpVDev,
"BitmapBackBuffer::createVDev(): Unable to create VirtualDevice" );
diff --git a/canvas/source/vcl/bitmapbackbuffer.hxx b/canvas/source/vcl/bitmapbackbuffer.hxx
index c3f2a27a7ba7..b51867994a68 100644
--- a/canvas/source/vcl/bitmapbackbuffer.hxx
+++ b/canvas/source/vcl/bitmapbackbuffer.hxx
@@ -66,7 +66,7 @@ namespace vclcanvas
void updateVDev() const;
::canvas::vcltools::VCLObject<BitmapEx> maBitmap;
- mutable VirtualDevice* mpVDev; // created only on demand
+ mutable VclPtr<VirtualDevice> mpVDev; // created only on demand
const OutputDevice& mrRefDevice;
diff --git a/canvas/source/vcl/canvasfont.cxx b/canvas/source/vcl/canvasfont.cxx
index 5477ea6bb257..6c4437da1205 100644
--- a/canvas/source/vcl/canvasfont.cxx
+++ b/canvas/source/vcl/canvasfont.cxx
@@ -121,9 +121,9 @@ namespace vclcanvas
SolarMutexGuard aGuard;
OutputDevice& rOutDev = mpOutDevProvider->getOutDev();
- VirtualDevice aVDev( rOutDev );
- aVDev.SetFont(getVCLFont());
- const ::FontMetric& aMetric( aVDev.GetFontMetric() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev( rOutDev );
+ pVDev->SetFont(getVCLFont());
+ const ::FontMetric& aMetric( pVDev->GetFontMetric() );
return rendering::FontMetrics(
aMetric.GetAscent(),
diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx
index f57e49812acc..b46746e2cf8b 100644
--- a/canvas/source/vcl/canvashelper_texturefill.cxx
+++ b/canvas/source/vcl/canvashelper_texturefill.cxx
@@ -1026,8 +1026,8 @@ namespace vclcanvas
// cannot do direct XOR, but have to
// prepare the filled polygon within a
// VDev
- VirtualDevice aVDev( rOutDev );
- aVDev.SetOutputSizePixel( aPolygonDeviceRect.GetSize() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev( rOutDev );
+ pVDev->SetOutputSizePixel( aPolygonDeviceRect.GetSize() );
// shift output to origin of VDev
const ::Point aOutPos( aPt - aPolygonDeviceRect.TopLeft() );
@@ -1036,8 +1036,8 @@ namespace vclcanvas
const vcl::Region aPolyClipRegion( aPolyPoly );
- aVDev.SetClipRegion( aPolyClipRegion );
- textureFill( aVDev,
+ pVDev->SetClipRegion( aPolyClipRegion );
+ textureFill( *pVDev.get(),
*pGrfObj,
aOutPos,
aIntegerNextTileX,
@@ -1051,12 +1051,12 @@ namespace vclcanvas
// target position.
const ::Point aEmptyPoint;
Bitmap aContentBmp(
- aVDev.GetBitmap( aEmptyPoint,
- aVDev.GetOutputSizePixel() ) );
+ pVDev->GetBitmap( aEmptyPoint,
+ pVDev->GetOutputSizePixel() ) );
sal_uInt8 nCol( static_cast< sal_uInt8 >(
::basegfx::fround( 255.0*( 1.0 - textures[0].Alpha ) ) ) );
- AlphaMask aAlpha( aVDev.GetOutputSizePixel(),
+ AlphaMask aAlpha( pVDev->GetOutputSizePixel(),
&nCol );
BitmapEx aOutputBmpEx( aContentBmp, aAlpha );
diff --git a/canvas/source/vcl/impltools.hxx b/canvas/source/vcl/impltools.hxx
index 059495523db0..c294efd89ae7 100644
--- a/canvas/source/vcl/impltools.hxx
+++ b/canvas/source/vcl/impltools.hxx
@@ -158,7 +158,7 @@ namespace vclcanvas
}
}
- OutputDevice* mpOutDev;
+ VclPtr<OutputDevice> mpOutDev;
const bool mbMappingWasEnabled;
const sal_uInt16 mnAntiAliasing;
};
diff --git a/canvas/source/vcl/spritecanvashelper.cxx b/canvas/source/vcl/spritecanvashelper.cxx
index 682950534135..51a234feca1c 100644
--- a/canvas/source/vcl/spritecanvashelper.cxx
+++ b/canvas/source/vcl/spritecanvashelper.cxx
@@ -189,6 +189,12 @@ namespace vclcanvas
#endif
}
+ SpriteCanvasHelper::~SpriteCanvasHelper()
+ {
+ SolarMutexGuard aGuard;
+ maVDev.disposeAndClear();
+ }
+
void SpriteCanvasHelper::init( const OutDevProviderSharedPtr& rOutDev,
SpriteCanvas& rOwningSpriteCanvas,
::canvas::SpriteRedrawManager& rManager,
@@ -318,7 +324,7 @@ namespace vclcanvas
mpRedrawManager->forEachSprite(
::boost::bind(
&spriteRedraw,
- ::boost::ref( maVDev.get() ),
+ ::boost::ref( *maVDev.get() ),
_1 ) );
// flush to screen
@@ -576,7 +582,7 @@ namespace vclcanvas
::std::for_each( rSortedUpdateSprites.begin(),
rSortedUpdateSprites.end(),
::boost::bind( &spriteRedrawStub2,
- ::boost::ref( maVDev.get() ),
+ ::boost::ref( *maVDev.get() ),
::vcl::unotools::b2DPointFromPoint(
aOutputPosition),
_1 ) );
diff --git a/canvas/source/vcl/spritecanvashelper.hxx b/canvas/source/vcl/spritecanvashelper.hxx
index dc165d460296..a6b3c0393c8a 100644
--- a/canvas/source/vcl/spritecanvashelper.hxx
+++ b/canvas/source/vcl/spritecanvashelper.hxx
@@ -23,6 +23,7 @@
#include <com/sun/star/rendering/XSpriteCanvas.hpp>
#include <com/sun/star/rendering/XIntegerBitmap.hpp>
+#include <vcl/vclptr.hxx>
#include <vcl/virdev.hxx>
#include <canvas/spriteredrawmanager.hxx>
@@ -40,6 +41,7 @@ namespace vclcanvas
{
public:
SpriteCanvasHelper();
+ ~SpriteCanvasHelper();
void init( const OutDevProviderSharedPtr& rOutDev,
SpriteCanvas& rOwningSpriteCanvas,
@@ -150,7 +152,7 @@ namespace vclcanvas
Typically, sprites will be composited in the background,
before pushing them to screen. This happens here.
*/
- ::canvas::vcltools::VCLObject< VirtualDevice > maVDev;
+ VclPtr< VirtualDevice > maVDev;
/// For the frame counter timings
::canvas::tools::ElapsedTime maLastUpdate;
diff --git a/canvas/source/vcl/textlayout.cxx b/canvas/source/vcl/textlayout.cxx
index d64f7dfa7fb7..6cf534220e26 100644
--- a/canvas/source/vcl/textlayout.cxx
+++ b/canvas/source/vcl/textlayout.cxx
@@ -104,10 +104,10 @@ namespace vclcanvas
SolarMutexGuard aGuard;
OutputDevice& rOutDev = mpOutDevProvider->getOutDev();
- VirtualDevice aVDev( rOutDev );
- aVDev.SetFont( mpFont->getVCLFont() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev( rOutDev );
+ pVDev->SetFont( mpFont->getVCLFont() );
- setupLayoutMode( aVDev, mnTextDirection );
+ setupLayoutMode( *pVDev.get(), mnTextDirection );
const rendering::ViewState aViewState(
geometry::AffineMatrix2D(1,0,0, 0,1,0),
@@ -124,7 +124,7 @@ namespace vclcanvas
uno::Sequence< uno::Reference< rendering::XPolyPolygon2D> > aOutlineSequence;
::basegfx::B2DPolyPolygonVector aOutlines;
- if (aVDev.GetTextOutlines(
+ if (pVDev->GetTextOutlines(
aOutlines,
maText.Text,
maText.StartPosition,
@@ -157,10 +157,10 @@ namespace vclcanvas
OutputDevice& rOutDev = mpOutDevProvider->getOutDev();
- VirtualDevice aVDev( rOutDev );
- aVDev.SetFont( mpFont->getVCLFont() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev( rOutDev );
+ pVDev->SetFont( mpFont->getVCLFont() );
- setupLayoutMode( aVDev, mnTextDirection );
+ setupLayoutMode( *pVDev.get(), mnTextDirection );
const rendering::ViewState aViewState(
geometry::AffineMatrix2D(1,0,0, 0,1,0),
@@ -177,7 +177,7 @@ namespace vclcanvas
MetricVector aMetricVector;
uno::Sequence<geometry::RealRectangle2D> aBoundingBoxes;
- if (aVDev.GetGlyphBoundRects(
+ if (pVDev->GetGlyphBoundRects(
Point(0,0),
maText.Text,
::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
@@ -237,14 +237,14 @@ namespace vclcanvas
OutputDevice& rOutDev = mpOutDevProvider->getOutDev();
- VirtualDevice aVDev( rOutDev );
- aVDev.SetFont( mpFont->getVCLFont() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev( rOutDev );
+ pVDev->SetFont( mpFont->getVCLFont() );
// need metrics for Y offset, the XCanvas always renders
// relative to baseline
- const ::FontMetric& aMetric( aVDev.GetFontMetric() );
+ const ::FontMetric& aMetric( pVDev->GetFontMetric() );
- setupLayoutMode( aVDev, mnTextDirection );
+ setupLayoutMode( *pVDev.get(), mnTextDirection );
const sal_Int32 nAboveBaseline( /*-aMetric.GetIntLeading()*/ - aMetric.GetAscent() );
const sal_Int32 nBelowBaseline( aMetric.GetDescent() );
@@ -258,7 +258,7 @@ namespace vclcanvas
else
{
return geometry::RealRectangle2D( 0, nAboveBaseline,
- aVDev.GetTextWidth(
+ pVDev->GetTextWidth(
maText.Text,
::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
::canvas::tools::numeric_cast<sal_uInt16>(maText.Length) ),
diff --git a/chart2/inc/ChartModel.hxx b/chart2/inc/ChartModel.hxx
index 9e71caa1cb23..d1f5e4f39fdc 100644
--- a/chart2/inc/ChartModel.hxx
+++ b/chart2/inc/ChartModel.hxx
@@ -618,7 +618,7 @@ private:
sal_Int32 mnStart;
sal_Int32 mnEnd;
bool bSet;
- OpenGLWindow* mpOpenGLWindow;
+ VclPtr<OpenGLWindow> mpOpenGLWindow;
};
} // namespace chart
diff --git a/chart2/source/controller/accessibility/AccessibleViewForwarder.hxx b/chart2/source/controller/accessibility/AccessibleViewForwarder.hxx
index e0b65406b31e..b2d55cb8784f 100644
--- a/chart2/source/controller/accessibility/AccessibleViewForwarder.hxx
+++ b/chart2/source/controller/accessibility/AccessibleViewForwarder.hxx
@@ -20,6 +20,7 @@
#define INCLUDED_CHART2_SOURCE_CONTROLLER_ACCESSIBILITY_ACCESSIBLEVIEWFORWARDER_HXX
#include <vcl/mapmod.hxx>
+#include <vcl/vclptr.hxx>
#include <svx/IAccessibleViewForwarder.hxx>
namespace vcl { class Window; }
@@ -48,7 +49,7 @@ private:
AccessibleViewForwarder& operator=( AccessibleViewForwarder& ) SAL_DELETED_FUNCTION;
AccessibleChartView* m_pAccChartView;
- vcl::Window* m_pWindow;
+ VclPtr<vcl::Window> m_pWindow;
MapMode m_aMapMode;
};
diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.hxx b/chart2/source/controller/dialogs/ChartTypeDialogController.hxx
index 14ce8e13b5da..7ea6c1c4b0c7 100644
--- a/chart2/source/controller/dialogs/ChartTypeDialogController.hxx
+++ b/chart2/source/controller/dialogs/ChartTypeDialogController.hxx
@@ -281,8 +281,8 @@ private:
DECL_LINK( ChangeLineCountHdl, void* );
private:
- FixedText* m_pFT_NumberOfLines;
- NumericField* m_pMF_NumberOfLines;
+ VclPtr<FixedText> m_pFT_NumberOfLines;
+ VclPtr<NumericField> m_pMF_NumberOfLines;
};
class BubbleChartDialogController : public ChartTypeDialogController
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx
index 62ab1a2b9a3d..7c7b8f30deec 100644
--- a/chart2/source/controller/dialogs/DataBrowser.cxx
+++ b/chart2/source/controller/dialogs/DataBrowser.cxx
@@ -102,7 +102,6 @@ class SeriesHeaderEdit : public Edit
{
public:
SeriesHeaderEdit( vcl::Window * pParent );
- virtual ~SeriesHeaderEdit();
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
void setStartColumn( sal_Int32 nStartColumn );
@@ -122,9 +121,6 @@ SeriesHeaderEdit::SeriesHeaderEdit( vcl::Window * pParent ) :
SetHelpId(HID_SCH_DATA_SERIES_LABEL);
}
-SeriesHeaderEdit::~SeriesHeaderEdit()
-{}
-
void SeriesHeaderEdit::setStartColumn( sal_Int32 nStartColumn )
{
m_nStartColumn = nStartColumn;
@@ -182,11 +178,11 @@ public:
bool HasFocus() const;
private:
- ::boost::shared_ptr< FixedImage > m_spSymbol;
- ::boost::shared_ptr< SeriesHeaderEdit > m_spSeriesName;
- ::boost::shared_ptr< FixedText > m_spColorBar;
- OutputDevice * m_pDevice;
- Link m_aChangeLink;
+ VclPtr< FixedImage > m_spSymbol;
+ VclPtr< SeriesHeaderEdit > m_spSeriesName;
+ VclPtr< FixedText > m_spColorBar;
+ VclPtr< OutputDevice> m_pDevice;
+ Link m_aChangeLink;
void notifyChanges();
DECL_LINK( SeriesNameChanged, void * );
@@ -204,9 +200,9 @@ private:
};
SeriesHeader::SeriesHeader( vcl::Window * pParent, vcl::Window *pColorParent ) :
- m_spSymbol( new FixedImage( pParent, WB_NOBORDER )),
- m_spSeriesName( new SeriesHeaderEdit( pParent )),
- m_spColorBar( new FixedText( pColorParent, WB_NOBORDER )),
+ m_spSymbol( VclPtr<FixedImage>::Create( pParent, WB_NOBORDER )),
+ m_spSeriesName( VclPtr<SeriesHeaderEdit>::Create( pParent )),
+ m_spColorBar( VclPtr<FixedText>::Create( pColorParent, WB_NOBORDER )),
m_pDevice( pParent ),
m_nStartCol( 0 ),
m_nEndCol( 0 ),
@@ -457,21 +453,29 @@ DataBrowser::DataBrowser( vcl::Window* pParent, WinBits nStyle, bool bLiveUpdate
m_bIsDirty( false ),
m_bLiveUpdate( bLiveUpdate ),
m_bDataValid( true ),
- m_aNumberEditField( & EditBrowseBox::GetDataWindow(), WB_NOBORDER ),
- m_aTextEditField( & EditBrowseBox::GetDataWindow(), WB_NOBORDER ),
- m_rNumberEditController( new ::svt::FormattedFieldCellController( & m_aNumberEditField )),
- m_rTextEditController( new ::svt::EditCellController( & m_aTextEditField ))
+ m_aNumberEditField( VclPtr<FormattedField>::Create( & EditBrowseBox::GetDataWindow(), WB_NOBORDER ) ),
+ m_aTextEditField( VclPtr<Edit>::Create( & EditBrowseBox::GetDataWindow(), WB_NOBORDER ) ),
+ m_rNumberEditController( new ::svt::FormattedFieldCellController( m_aNumberEditField.get() )),
+ m_rTextEditController( new ::svt::EditCellController( m_aTextEditField.get() ))
{
double fNan;
::rtl::math::setNan( & fNan );
- m_aNumberEditField.SetDefaultValue( fNan );
- m_aNumberEditField.TreatAsNumber( true );
+ m_aNumberEditField->SetDefaultValue( fNan );
+ m_aNumberEditField->TreatAsNumber( true );
RenewTable();
SetClean();
}
DataBrowser::~DataBrowser()
{
+ disposeOnce();
+}
+
+void DataBrowser::dispose()
+{
+ m_aNumberEditField.disposeAndClear();
+ m_aTextEditField.disposeAndClear();
+ ::svt::EditBrowseBox::dispose();
}
bool DataBrowser::MayInsertRow() const
@@ -762,9 +766,9 @@ void DataBrowser::ShowWarningBox()
bool DataBrowser::ShowQueryBox()
{
- QueryBox* pQueryBox = new QueryBox(this, WB_YES_NO, SCH_RESSTR(STR_DATA_EDITOR_INCORRECT_INPUT));
+ ScopedVclPtrInstance<QueryBox> pQueryBox(this, WB_YES_NO, SCH_RESSTR(STR_DATA_EDITOR_INCORRECT_INPUT));
- return ( pQueryBox->Execute() == RET_YES );
+ return pQueryBox->Execute() == RET_YES;
}
bool DataBrowser::IsDataValid()
@@ -777,7 +781,7 @@ bool DataBrowser::IsDataValid()
{
sal_uInt32 nDummy = 0;
double fDummy = 0.0;
- OUString aText( m_aNumberEditField.GetText());
+ OUString aText( m_aNumberEditField->GetText());
if( !aText.isEmpty() &&
m_spNumberFormatterWrapper.get() &&
@@ -821,7 +825,7 @@ void DataBrowser::SetDataFromModel(
Reference< util::XNumberFormatsSupplier >( m_xChartDoc, uno::UNO_QUERY )));
if( m_spNumberFormatterWrapper.get() )
- m_aNumberEditField.SetFormatter( m_spNumberFormatterWrapper->getSvNumberFormatter() );
+ m_aNumberEditField->SetFormatter( m_spNumberFormatterWrapper->getSvNumberFormatter() );
RenewTable();
@@ -1041,8 +1045,8 @@ bool DataBrowser::IsTabAllowed( bool bForward ) const
if( CellContainsNumbers( nRow, nCol ))
{
- m_aNumberEditField.UseInputStringForFormatting();
- m_aNumberEditField.SetFormatKey( GetNumberFormatKey( nRow, nCol ));
+ m_aNumberEditField->UseInputStringForFormatting();
+ m_aNumberEditField->SetFormatKey( GetNumberFormatKey( nRow, nCol ));
return m_rNumberEditController;
}
@@ -1055,19 +1059,19 @@ void DataBrowser::InitController(
if( rController == m_rTextEditController )
{
OUString aText( GetCellText( nRow, nCol ) );
- m_aTextEditField.SetText( aText );
- m_aTextEditField.SetSelection( Selection( 0, aText.getLength() ));
+ m_aTextEditField->SetText( aText );
+ m_aTextEditField->SetSelection( Selection( 0, aText.getLength() ));
}
else if( rController == m_rNumberEditController )
{
// treat invalid and empty text as Nan
- m_aNumberEditField.EnableNotANumber( true );
+ m_aNumberEditField->EnableNotANumber( true );
if( ::rtl::math::isNan( GetCellNumber( nRow, nCol )))
- m_aNumberEditField.SetTextValue( OUString());
+ m_aNumberEditField->SetTextValue( OUString());
else
- m_aNumberEditField.SetValue( GetCellNumber( nRow, nCol ) );
- OUString aText( m_aNumberEditField.GetText());
- m_aNumberEditField.SetSelection( Selection( 0, aText.getLength()));
+ m_aNumberEditField->SetValue( GetCellNumber( nRow, nCol ) );
+ OUString aText( m_aNumberEditField->GetText());
+ m_aNumberEditField->SetSelection( Selection( 0, aText.getLength()));
}
else
{
@@ -1125,7 +1129,7 @@ bool DataBrowser::SaveModified()
{
sal_uInt32 nDummy = 0;
double fDummy = 0.0;
- OUString aText( m_aNumberEditField.GetText());
+ OUString aText( m_aNumberEditField->GetText());
// an empty string is valid, if no numberformatter exists, all
// values are treated as valid
if( !aText.isEmpty() && pSvNumberFormatter &&
@@ -1135,14 +1139,14 @@ bool DataBrowser::SaveModified()
}
else
{
- double fData = m_aNumberEditField.GetValue();
+ double fData = m_aNumberEditField->GetValue();
bChangeValid = m_apDataBrowserModel->setCellNumber( nCol, nRow, fData );
}
}
break;
case DataBrowserModel::TEXTORDATE:
{
- OUString aText( m_aTextEditField.GetText() );
+ OUString aText( m_aTextEditField->GetText() );
double fDateValue = 0.0;
bChangeValid = false;
if( isDateString( aText, fDateValue ) )
@@ -1153,7 +1157,7 @@ bool DataBrowser::SaveModified()
break;
case DataBrowserModel::TEXT:
{
- OUString aText( m_aTextEditField.GetText());
+ OUString aText( m_aTextEditField->GetText());
bChangeValid = m_apDataBrowserModel->setCellText( nCol, nRow, aText );
}
break;
diff --git a/chart2/source/controller/dialogs/DataBrowser.hxx b/chart2/source/controller/dialogs/DataBrowser.hxx
index ee6030081f59..8a721c428067 100644
--- a/chart2/source/controller/dialogs/DataBrowser.hxx
+++ b/chart2/source/controller/dialogs/DataBrowser.hxx
@@ -69,6 +69,7 @@ protected:
public:
DataBrowser( vcl::Window* pParent, WinBits nStyle, bool bLiveUpdate );
virtual ~DataBrowser();
+ virtual void dispose() SAL_OVERRIDE;
/** GetCellText returns the text at the given position
@param nRow
@@ -164,8 +165,8 @@ private:
bool m_bLiveUpdate;
bool m_bDataValid;
- FormattedField m_aNumberEditField;
- Edit m_aTextEditField;
+ VclPtr<FormattedField> m_aNumberEditField;
+ VclPtr<Edit> m_aTextEditField;
/// note: m_aNumberEditField must precede this member!
::svt::CellControllerRef m_rNumberEditController;
diff --git a/chart2/source/controller/dialogs/TextDirectionListBox.cxx b/chart2/source/controller/dialogs/TextDirectionListBox.cxx
index 85c1def2c08d..c3f5e309a36b 100644
--- a/chart2/source/controller/dialogs/TextDirectionListBox.cxx
+++ b/chart2/source/controller/dialogs/TextDirectionListBox.cxx
@@ -47,10 +47,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeTextDirectionListBox(v
return new TextDirectionListBox(pParent);
}
-TextDirectionListBox::~TextDirectionListBox()
-{
-}
-
} //namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/dialogs/dlg_ChartType.cxx b/chart2/source/controller/dialogs/dlg_ChartType.cxx
index 30d03d140def..073d194a3afd 100644
--- a/chart2/source/controller/dialogs/dlg_ChartType.cxx
+++ b/chart2/source/controller/dialogs/dlg_ChartType.cxx
@@ -42,7 +42,8 @@ ChartTypeDialog::ChartTypeDialog( vcl::Window* pParent
, m_xChartModel(xChartModel)
, m_xCC( xContext )
{
- m_pChartTypeTabPage = new ChartTypeTabPage(
+ m_pChartTypeTabPage = VclPtr<ChartTypeTabPage>::Create(
+
get_content_area(),
uno::Reference<XChartDocument>::query(m_xChartModel),
m_xCC,
@@ -55,7 +56,13 @@ ChartTypeDialog::ChartTypeDialog( vcl::Window* pParent
ChartTypeDialog::~ChartTypeDialog()
{
- delete m_pChartTypeTabPage;
+ disposeOnce();
+}
+
+void ChartTypeDialog::dispose()
+{
+ m_pChartTypeTabPage.disposeAndClear();
+ ModalDialog::dispose();
}
} //namespace chart
diff --git a/chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx b/chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx
index 86f2b59faa6e..c2415b78b04e 100644
--- a/chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx
+++ b/chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx
@@ -79,9 +79,9 @@ void ChartTypeUnoDlg::implInitialize(const uno::Any& _rValue)
else
ChartTypeUnoDlg_BASE::implInitialize(_rValue);
}
-Dialog* ChartTypeUnoDlg::createDialog(vcl::Window* _pParent)
+VclPtr<Dialog> ChartTypeUnoDlg::createDialog(vcl::Window* _pParent)
{
- return new ChartTypeDialog( _pParent, m_xChartModel, m_aContext );
+ return VclPtr<ChartTypeDialog>::Create( _pParent, m_xChartModel, m_aContext );
}
uno::Reference<beans::XPropertySetInfo> SAL_CALL ChartTypeUnoDlg::getPropertySetInfo() throw(uno::RuntimeException, std::exception)
{
diff --git a/chart2/source/controller/dialogs/dlg_CreationWizard.cxx b/chart2/source/controller/dialogs/dlg_CreationWizard.cxx
index 9094da82cbf1..17da73233a6a 100644
--- a/chart2/source/controller/dialogs/dlg_CreationWizard.cxx
+++ b/chart2/source/controller/dialogs/dlg_CreationWizard.cxx
@@ -106,13 +106,9 @@ CreationWizard::CreationWizard( vcl::Window* pParent, const uno::Reference< fram
ActivatePage();
}
-CreationWizard::~CreationWizard()
+VclPtr<TabPage> CreationWizard::createPage(WizardState nState)
{
-}
-
-svt::OWizardPage* CreationWizard::createPage(WizardState nState)
-{
- svt::OWizardPage* pRet = 0;
+ VclPtr<svt::OWizardPage> pRet;
if(m_nOnePageOnlyIndex!=-1 && m_nOnePageOnlyIndex!=nState)
return pRet;
bool bDoLiveUpdate = m_nOnePageOnlyIndex == -1;
@@ -121,7 +117,7 @@ svt::OWizardPage* CreationWizard::createPage(WizardState nState)
case STATE_CHARTTYPE:
{
m_aTimerTriggeredControllerLock.startTimer();
- ChartTypeTabPage* pChartTypeTabPage = new ChartTypeTabPage(this,m_xChartModel,m_xCC,bDoLiveUpdate);
+ VclPtrInstance<ChartTypeTabPage> pChartTypeTabPage(this,m_xChartModel,m_xCC,bDoLiveUpdate);
pRet = pChartTypeTabPage;
m_pTemplateProvider = pChartTypeTabPage;
if (m_pDialogModel)
@@ -131,18 +127,18 @@ svt::OWizardPage* CreationWizard::createPage(WizardState nState)
case STATE_SIMPLE_RANGE:
{
m_aTimerTriggeredControllerLock.startTimer();
- pRet = new RangeChooserTabPage(this, *m_pDialogModel, m_pTemplateProvider, this);
+ pRet = VclPtr<RangeChooserTabPage>::Create(this, *m_pDialogModel, m_pTemplateProvider, this);
}
break;
case STATE_DATA_SERIES:
{
m_aTimerTriggeredControllerLock.startTimer();
- pRet = new DataSourceTabPage(this, *m_pDialogModel, m_pTemplateProvider, this);
+ pRet = VclPtr<DataSourceTabPage>::Create(this, *m_pDialogModel, m_pTemplateProvider, this);
}
break;
case STATE_OBJECTS:
{
- pRet = new TitlesAndObjectsTabPage(this,m_xChartModel,m_xCC);
+ pRet = VclPtr<TitlesAndObjectsTabPage>::Create(this,m_xChartModel,m_xCC);
m_aTimerTriggeredControllerLock.startTimer();
}
break;
diff --git a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
index 1672e8d0b6b4..34df8acaca78 100644
--- a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
+++ b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
@@ -54,11 +54,7 @@ CreationWizardUnoDlg::CreationWizardUnoDlg( const uno::Reference< uno::XComponen
CreationWizardUnoDlg::~CreationWizardUnoDlg()
{
SolarMutexGuard aSolarGuard;
- if( m_pDialog )
- {
- delete m_pDialog;
- m_pDialog = 0;
- }
+ m_pDialog.disposeAndClear();
}
// lang::XServiceInfo
OUString SAL_CALL CreationWizardUnoDlg::getImplementationName()
@@ -216,7 +212,7 @@ void CreationWizardUnoDlg::createDialogOnDemand()
uno::Reference< XComponent > xComp( this );
if( m_xChartModel.is() )
{
- m_pDialog = new CreationWizard( pParent, m_xChartModel, m_xCC );
+ m_pDialog = VclPtr<CreationWizard>::Create( pParent, m_xChartModel, m_xCC );
m_pDialog->AddEventListener( LINK( this, CreationWizardUnoDlg, DialogEventHdl ) );
}
}
@@ -272,11 +268,7 @@ void SAL_CALL CreationWizardUnoDlg::disposing()
m_xParentWindow.clear();
SolarMutexGuard aSolarGuard;
- if( m_pDialog )
- {
- delete m_pDialog;
- m_pDialog = 0;
- }
+ m_pDialog.disposeAndClear();
try
{
diff --git a/chart2/source/controller/dialogs/dlg_DataEditor.cxx b/chart2/source/controller/dialogs/dlg_DataEditor.cxx
index 502579f539af..4f4ce2f09230 100644
--- a/chart2/source/controller/dialogs/dlg_DataEditor.cxx
+++ b/chart2/source/controller/dialogs/dlg_DataEditor.cxx
@@ -48,7 +48,7 @@ DataEditor::DataEditor(vcl::Window* pParent,
, m_xChartDoc(xChartDoc)
, m_xContext(xContext)
{
- m_xBrwData.reset(new DataBrowser(get<vcl::Window>("datawindow"), WB_BORDER | WB_TABSTOP, true /* bLiveUpdate */));
+ m_xBrwData.reset(VclPtr<DataBrowser>::Create(get<vcl::Window>("datawindow"), WB_BORDER | WB_TABSTOP, true /* bLiveUpdate */));
m_xBrwData->set_hexpand(true);
m_xBrwData->set_vexpand(true);
m_xBrwData->set_expand(true);
@@ -95,12 +95,20 @@ DataEditor::DataEditor(vcl::Window* pParent,
DataEditor::~DataEditor()
{
+ disposeOnce();
+}
+
+void DataEditor::dispose()
+{
notifySystemWindow( this, m_pTbxData, ::comphelper::mem_fun( & TaskPaneList::RemoveWindow ));
SvtMiscOptions aMiscOptions;
aMiscOptions.RemoveListenerLink( LINK( this, DataEditor, MiscHdl ) );
OSL_TRACE( "DataEditor: DTOR" );
+ m_pTbxData.clear();
+ m_xBrwData.disposeAndClear();
+ ModalDialog::dispose();
}
// react on click (or keypress) on toolbar icon
diff --git a/chart2/source/controller/dialogs/dlg_DataSource.cxx b/chart2/source/controller/dialogs/dlg_DataSource.cxx
index bfa90c7647be..d0cb0739fdc7 100644
--- a/chart2/source/controller/dialogs/dlg_DataSource.cxx
+++ b/chart2/source/controller/dialogs/dlg_DataSource.cxx
@@ -133,7 +133,7 @@ DataSourceDialog::DataSourceDialog(vcl::Window * pParent,
, m_xContext(xContext)
, m_apDocTemplateProvider(new DocumentChartTypeTemplateProvider(xChartDocument))
, m_apDialogModel(new DialogModel(xChartDocument, xContext))
- , m_pTabControl(new DataSourceTabControl(get_content_area()))
+ , m_pTabControl(VclPtr<DataSourceTabControl>::Create(get_content_area()))
, m_pRangeChooserTabePage(0)
, m_pDataSourceTabPage(0)
, m_bRangeChooserTabIsValid(true)
@@ -143,9 +143,9 @@ DataSourceDialog::DataSourceDialog(vcl::Window * pParent,
m_pTabControl->Show();
- m_pRangeChooserTabePage = new RangeChooserTabPage( m_pTabControl, *(m_apDialogModel.get()),
+ m_pRangeChooserTabePage = VclPtr<RangeChooserTabPage>::Create( m_pTabControl, *(m_apDialogModel.get()),
m_apDocTemplateProvider.get(), this, true /* bHideDescription */ );
- m_pDataSourceTabPage = new DataSourceTabPage( m_pTabControl, *(m_apDialogModel.get()),
+ m_pDataSourceTabPage = VclPtr<DataSourceTabPage>::Create( m_pTabControl, *(m_apDialogModel.get()),
m_apDocTemplateProvider.get(), this, true /* bHideDescription */ );
m_pTabControl->InsertPage( TP_RANGECHOOSER, SCH_RESSTR(STR_PAGE_DATA_RANGE) );
@@ -159,11 +159,18 @@ DataSourceDialog::DataSourceDialog(vcl::Window * pParent,
DataSourceDialog::~DataSourceDialog()
{
- delete m_pRangeChooserTabePage;
- delete m_pDataSourceTabPage;
+ disposeOnce();
+}
- m_nLastPageId = m_pTabControl->GetCurPageId();
- delete m_pTabControl;
+void DataSourceDialog::dispose()
+{
+ m_pRangeChooserTabePage.disposeAndClear();
+ m_pDataSourceTabPage.disposeAndClear();
+ if (m_pTabControl)
+ m_nLastPageId = m_pTabControl->GetCurPageId();
+ m_pTabControl.disposeAndClear();
+ m_pBtnOK.clear();
+ TabDialog::dispose();
}
short DataSourceDialog::Execute()
diff --git a/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx b/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx
index 2af1b5fa2073..4ef50442f07c 100644
--- a/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx
+++ b/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx
@@ -83,8 +83,21 @@ SchAxisDlg::SchAxisDlg(vcl::Window* pWindow,
SchAxisDlg::~SchAxisDlg()
{
+ disposeOnce();
}
+void SchAxisDlg::dispose()
+{
+ m_pCbPrimaryX.clear();
+ m_pCbPrimaryY.clear();
+ m_pCbPrimaryZ.clear();
+ m_pCbSecondaryX.clear();
+ m_pCbSecondaryY.clear();
+ m_pCbSecondaryZ.clear();
+ ModalDialog::dispose();
+}
+
+
void SchAxisDlg::getResult( InsertAxisOrGridDialogData& rOutput )
{
rOutput.aExistenceList[0]=m_pCbPrimaryX->IsChecked();
@@ -100,10 +113,6 @@ SchGridDlg::SchGridDlg( vcl::Window* pParent, const InsertAxisOrGridDialogData&
{
}
-SchGridDlg::~SchGridDlg()
-{
-}
-
} //namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx b/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx
index 83c13095025f..17c15bcb7f2e 100644
--- a/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx
+++ b/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx
@@ -34,10 +34,6 @@ DataLabelsDialog::DataLabelsDialog(vcl::Window* pWindow, const SfxItemSet& rInAt
Reset();
}
-DataLabelsDialog::~DataLabelsDialog()
-{
-}
-
void DataLabelsDialog::Reset()
{
m_apDataLabelResources->Reset(m_rInAttrs);
diff --git a/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx b/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx
index 11f48f9dc9e2..5cf894f2313c 100644
--- a/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx
+++ b/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx
@@ -57,10 +57,6 @@ InsertErrorBarsDialog::InsertErrorBarsDialog(
m_apErrorBarResources->SetChartDocumentForRangeChoosing( xChartDocument );
}
-InsertErrorBarsDialog::~InsertErrorBarsDialog()
-{
-}
-
void InsertErrorBarsDialog::FillItemSet(SfxItemSet& rOutAttrs)
{
m_apErrorBarResources->FillItemSet(rOutAttrs);
diff --git a/chart2/source/controller/dialogs/dlg_NumberFormat.cxx b/chart2/source/controller/dialogs/dlg_NumberFormat.cxx
index a2ba7f3c0ca0..9d0e54ca4c42 100644
--- a/chart2/source/controller/dialogs/dlg_NumberFormat.cxx
+++ b/chart2/source/controller/dialogs/dlg_NumberFormat.cxx
@@ -44,10 +44,6 @@ NumberFormatDialog::NumberFormatDialog(vcl::Window* pParent, SfxItemSet& rSet)
}
}
-NumberFormatDialog::~NumberFormatDialog()
-{
-}
-
SfxItemSet NumberFormatDialog::CreateEmptyItemSetForNumberFormatDialog( SfxItemPool& rItemPool )
{
static const sal_uInt16 nWhichPairs[] =
diff --git a/chart2/source/controller/dialogs/dlg_NumberFormat.hxx b/chart2/source/controller/dialogs/dlg_NumberFormat.hxx
index a27ff0caf7f0..1aff53582645 100644
--- a/chart2/source/controller/dialogs/dlg_NumberFormat.hxx
+++ b/chart2/source/controller/dialogs/dlg_NumberFormat.hxx
@@ -30,8 +30,7 @@ namespace chart
class NumberFormatDialog : public SfxSingleTabDialog
{
public:
- NumberFormatDialog(vcl::Window* pParent, SfxItemSet& rSet);
- virtual ~NumberFormatDialog();
+ NumberFormatDialog(vcl::Window* pParent, SfxItemSet& rSet);
static SfxItemSet CreateEmptyItemSetForNumberFormatDialog( SfxItemPool& rItemPool );
};
diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
index 165b179521f5..92c6cb668f56 100644
--- a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
+++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
@@ -481,8 +481,16 @@ SchAttribTabDlg::SchAttribTabDlg(vcl::Window* pParent,
SchAttribTabDlg::~SchAttribTabDlg()
{
+ disposeOnce();
+}
+
+void SchAttribTabDlg::dispose()
+{
delete m_pSymbolShapeProperties;
+ m_pSymbolShapeProperties = NULL;
delete m_pAutoSymbolGraphic;
+ m_pAutoSymbolGraphic = NULL;
+ SfxTabDialog::dispose();
}
void SchAttribTabDlg::PageCreated(sal_uInt16 nId, SfxTabPage &rPage)
diff --git a/chart2/source/controller/dialogs/dlg_View3D.cxx b/chart2/source/controller/dialogs/dlg_View3D.cxx
index 0ff8d1b10a35..ec67eb829f59 100644
--- a/chart2/source/controller/dialogs/dlg_View3D.cxx
+++ b/chart2/source/controller/dialogs/dlg_View3D.cxx
@@ -49,9 +49,9 @@ View3DDialog::View3DDialog(vcl::Window* pParent, const uno::Reference< frame::XM
get(m_pTabControl, "tabcontrol");
uno::Reference< beans::XPropertySet > xSceneProperties( ChartModelHelper::findDiagram( xChartModel ), uno::UNO_QUERY );
- m_pGeometry = new ThreeD_SceneGeometry_TabPage(m_pTabControl,xSceneProperties,m_aControllerLocker);
- m_pAppearance = new ThreeD_SceneAppearance_TabPage(m_pTabControl,xChartModel,m_aControllerLocker);
- m_pIllumination = new ThreeD_SceneIllumination_TabPage(m_pTabControl,xSceneProperties,xChartModel,pColorTable);
+ m_pGeometry = VclPtr<ThreeD_SceneGeometry_TabPage>::Create(m_pTabControl,xSceneProperties,m_aControllerLocker);
+ m_pAppearance = VclPtr<ThreeD_SceneAppearance_TabPage>::Create(m_pTabControl,xChartModel,m_aControllerLocker);
+ m_pIllumination = VclPtr<ThreeD_SceneIllumination_TabPage>::Create(m_pTabControl,xSceneProperties,xChartModel,pColorTable);
m_pTabControl->InsertPage( TP_3D_SCENEGEOMETRY, SCH_RESSTR(STR_PAGE_PERSPECTIVE) );
m_pTabControl->InsertPage( TP_3D_SCENEAPPEARANCE, SCH_RESSTR(STR_PAGE_APPEARANCE) );
@@ -66,11 +66,18 @@ View3DDialog::View3DDialog(vcl::Window* pParent, const uno::Reference< frame::XM
View3DDialog::~View3DDialog()
{
- delete m_pGeometry;
- delete m_pAppearance;
- delete m_pIllumination;
+ disposeOnce();
+}
- m_nLastPageId = m_pTabControl->GetCurPageId();
+void View3DDialog::dispose()
+{
+ m_pGeometry.disposeAndClear();
+ m_pAppearance.disposeAndClear();
+ m_pIllumination.disposeAndClear();
+ if (m_pTabControl)
+ m_nLastPageId = m_pTabControl->GetCurPageId();
+ m_pTabControl.clear();
+ TabDialog::dispose();
}
short View3DDialog::Execute()
diff --git a/chart2/source/controller/dialogs/res_BarGeometry.hxx b/chart2/source/controller/dialogs/res_BarGeometry.hxx
index 60af3af3ccd8..7a9eeb8c17f8 100644
--- a/chart2/source/controller/dialogs/res_BarGeometry.hxx
+++ b/chart2/source/controller/dialogs/res_BarGeometry.hxx
@@ -41,8 +41,8 @@ public:
void SetSelectHdl( const Link& rLink );
private:
- FixedText* m_pFT_Geometry;
- ListBox* m_pLB_Geometry;
+ VclPtr<FixedText> m_pFT_Geometry;
+ VclPtr<ListBox> m_pLB_Geometry;
};
} //namespace chart
diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx b/chart2/source/controller/dialogs/res_DataLabel.cxx
index c0f2da11fccd..6f0d2b8ec022 100644
--- a/chart2/source/controller/dialogs/res_DataLabel.cxx
+++ b/chart2/source/controller/dialogs/res_DataLabel.cxx
@@ -205,12 +205,12 @@ IMPL_LINK( DataLabelResources, NumberFormatDialogHdl, PushButton *, pButton )
aNumberSet.Put( SfxUInt32Item( SID_ATTR_NUMBERFORMAT_VALUE, rnFormatKey ));
aNumberSet.Put( SfxBoolItem( SID_ATTR_NUMBERFORMAT_SOURCE, rUseSourceFormat ));
- NumberFormatDialog aDlg(m_pWindow, aNumberSet);
+ ScopedVclPtrInstance< NumberFormatDialog > aDlg(m_pWindow, aNumberSet);
if( bPercent )
- aDlg.SetText( m_pFT_NumberFormatForPercent->GetText());
- if( RET_OK == aDlg.Execute() )
+ aDlg->SetText( m_pFT_NumberFormatForPercent->GetText());
+ if( RET_OK == aDlg->Execute() )
{
- const SfxItemSet* pResult = aDlg.GetOutputItemSet();
+ const SfxItemSet* pResult = aDlg->GetOutputItemSet();
if( pResult )
{
bool bOldSource = rUseSourceFormat;
diff --git a/chart2/source/controller/dialogs/res_DataLabel.hxx b/chart2/source/controller/dialogs/res_DataLabel.hxx
index 9d6d0e01cd90..cfb4758cc29b 100644
--- a/chart2/source/controller/dialogs/res_DataLabel.hxx
+++ b/chart2/source/controller/dialogs/res_DataLabel.hxx
@@ -45,28 +45,28 @@ public:
void SetNumberFormatter( SvNumberFormatter* pFormatter );
private:
- CheckBox* m_pCBNumber;
- PushButton* m_pPB_NumberFormatForValue;
- CheckBox* m_pCBPercent;
- PushButton* m_pPB_NumberFormatForPercent;
- FixedText* m_pFT_NumberFormatForPercent;
- CheckBox* m_pCBCategory;
- CheckBox* m_pCBSymbol;
-
- VclHBox* m_pSeparatorResources;
- ListBox* m_pLB_Separator;
+ VclPtr<CheckBox> m_pCBNumber;
+ VclPtr<PushButton> m_pPB_NumberFormatForValue;
+ VclPtr<CheckBox> m_pCBPercent;
+ VclPtr<PushButton> m_pPB_NumberFormatForPercent;
+ VclPtr<FixedText> m_pFT_NumberFormatForPercent;
+ VclPtr<CheckBox> m_pCBCategory;
+ VclPtr<CheckBox> m_pCBSymbol;
+
+ VclPtr<VclHBox> m_pSeparatorResources;
+ VclPtr<ListBox> m_pLB_Separator;
OUString m_aEntryMap[NUMBER_SEPARATORS];
- VclHBox* m_pBxLabelPlacement;
- ListBox* m_pLB_LabelPlacement;
+ VclPtr<VclHBox> m_pBxLabelPlacement;
+ VclPtr<ListBox> m_pLB_LabelPlacement;
- VclHBox* m_pBxOrientation;
- svx::DialControl* m_pDC_Dial;
- FixedText* m_pFT_Dial;
- NumericField* m_pNF_Degrees;
+ VclPtr<VclHBox> m_pBxOrientation;
+ VclPtr<svx::DialControl> m_pDC_Dial;
+ VclPtr<FixedText> m_pFT_Dial;
+ VclPtr<NumericField> m_pNF_Degrees;
- VclHBox* m_pBxTextDirection;
- TextDirectionListBox* m_pLB_TextDirection;
+ VclPtr<VclHBox> m_pBxTextDirection;
+ VclPtr<TextDirectionListBox> m_pLB_TextDirection;
::std::map< sal_Int32, sal_uInt16 > m_aPlacementToListBoxMap;
::std::map< sal_uInt16, sal_Int32 > m_aListBoxToPlacementMap;
@@ -82,7 +82,7 @@ private:
bool m_bSourceFormatForValue;
bool m_bSourceFormatForPercent;
- vcl::Window* m_pWindow;
+ VclPtr<vcl::Window> m_pWindow;
SfxItemPool* m_pPool;
DECL_LINK(NumberFormatDialogHdl, PushButton * );
diff --git a/chart2/source/controller/dialogs/res_Trendline.hxx b/chart2/source/controller/dialogs/res_Trendline.hxx
index 0d4be04cdf4d..03c3ebe3bd87 100644
--- a/chart2/source/controller/dialogs/res_Trendline.hxx
+++ b/chart2/source/controller/dialogs/res_Trendline.hxx
@@ -46,29 +46,29 @@ public:
void SetNbPoints( sal_Int32 nNbPoints );
private:
- RadioButton* m_pRB_Linear;
- RadioButton* m_pRB_Logarithmic;
- RadioButton* m_pRB_Exponential;
- RadioButton* m_pRB_Power;
- RadioButton* m_pRB_Polynomial;
- RadioButton* m_pRB_MovingAverage;
-
- FixedImage* m_pFI_Linear;
- FixedImage* m_pFI_Logarithmic;
- FixedImage* m_pFI_Exponential;
- FixedImage* m_pFI_Power;
- FixedImage* m_pFI_Polynomial;
- FixedImage* m_pFI_MovingAverage;
-
- NumericField* m_pNF_Degree;
- NumericField* m_pNF_Period;
- Edit* m_pEE_Name;
- FormattedField* m_pFmtFld_ExtrapolateForward;
- FormattedField* m_pFmtFld_ExtrapolateBackward;
- CheckBox* m_pCB_SetIntercept;
- FormattedField* m_pFmtFld_InterceptValue;
- CheckBox* m_pCB_ShowEquation;
- CheckBox* m_pCB_ShowCorrelationCoeff;
+ VclPtr<RadioButton> m_pRB_Linear;
+ VclPtr<RadioButton> m_pRB_Logarithmic;
+ VclPtr<RadioButton> m_pRB_Exponential;
+ VclPtr<RadioButton> m_pRB_Power;
+ VclPtr<RadioButton> m_pRB_Polynomial;
+ VclPtr<RadioButton> m_pRB_MovingAverage;
+
+ VclPtr<FixedImage> m_pFI_Linear;
+ VclPtr<FixedImage> m_pFI_Logarithmic;
+ VclPtr<FixedImage> m_pFI_Exponential;
+ VclPtr<FixedImage> m_pFI_Power;
+ VclPtr<FixedImage> m_pFI_Polynomial;
+ VclPtr<FixedImage> m_pFI_MovingAverage;
+
+ VclPtr<NumericField> m_pNF_Degree;
+ VclPtr<NumericField> m_pNF_Period;
+ VclPtr<Edit> m_pEE_Name;
+ VclPtr<FormattedField> m_pFmtFld_ExtrapolateForward;
+ VclPtr<FormattedField> m_pFmtFld_ExtrapolateBackward;
+ VclPtr<CheckBox> m_pCB_SetIntercept;
+ VclPtr<FormattedField> m_pFmtFld_InterceptValue;
+ VclPtr<CheckBox> m_pCB_ShowEquation;
+ VclPtr<CheckBox> m_pCB_ShowCorrelationCoeff;
SvxChartRegress m_eTrendLineType;
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx
index 1515c6b9899d..7c866eed86b5 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx
@@ -121,7 +121,18 @@ ThreeD_SceneAppearance_TabPage::ThreeD_SceneAppearance_TabPage(
}
ThreeD_SceneAppearance_TabPage::~ThreeD_SceneAppearance_TabPage()
-{}
+{
+ disposeOnce();
+}
+
+void ThreeD_SceneAppearance_TabPage::dispose()
+{
+ m_pLB_Scheme.clear();
+ m_pCB_Shading.clear();
+ m_pCB_ObjectLines.clear();
+ m_pCB_RoundedEdge.clear();
+ TabPage::dispose();
+}
void ThreeD_SceneAppearance_TabPage::ActivatePage()
{
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx
index b674dff025dd..80720d031e87 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.hxx
@@ -39,6 +39,7 @@ public:
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & xChartModel,
ControllerLockHelper & rControllerLockHelper );
virtual ~ThreeD_SceneAppearance_TabPage();
+ virtual void dispose() SAL_OVERRIDE;
virtual void ActivatePage() SAL_OVERRIDE;
@@ -56,11 +57,11 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
m_xChartModel;
- ListBox* m_pLB_Scheme;
+ VclPtr<ListBox> m_pLB_Scheme;
- CheckBox* m_pCB_Shading;
- CheckBox* m_pCB_ObjectLines;
- CheckBox* m_pCB_RoundedEdge;
+ VclPtr<CheckBox> m_pCB_Shading;
+ VclPtr<CheckBox> m_pCB_ObjectLines;
+ VclPtr<CheckBox> m_pCB_RoundedEdge;
bool m_bUpdateOtherControls;
bool m_bCommitToModel;
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx
index d9f3ccac74e8..e3988f975ebf 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx
@@ -149,8 +149,22 @@ ThreeD_SceneGeometry_TabPage::ThreeD_SceneGeometry_TabPage( vcl::Window* pWindow
ThreeD_SceneGeometry_TabPage::~ThreeD_SceneGeometry_TabPage()
{
+ disposeOnce();
}
+void ThreeD_SceneGeometry_TabPage::dispose()
+{
+ m_pCbxRightAngledAxes.clear();
+ m_pMFXRotation.clear();
+ m_pMFYRotation.clear();
+ m_pFtZRotation.clear();
+ m_pMFZRotation.clear();
+ m_pCbxPerspective.clear();
+ m_pMFPerspective.clear();
+ TabPage::dispose();
+}
+
+
void ThreeD_SceneGeometry_TabPage::commitPendingChanges()
{
ControllerLockHelperGuard aGuard( m_rControllerLockHelper );
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.hxx b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.hxx
index 21bc08a7ccc1..cfd16ff23bd6 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.hxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.hxx
@@ -40,6 +40,7 @@ public:
::com::sun::star::beans::XPropertySet > & xSceneProperties,
ControllerLockHelper & rControllerLockHelper );
virtual ~ThreeD_SceneGeometry_TabPage();
+ virtual void dispose() SAL_OVERRIDE;
// has to be called in case the dialog was closed with OK
void commitPendingChanges();
@@ -64,17 +65,17 @@ private:
::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet > m_xSceneProperties;
- CheckBox* m_pCbxRightAngledAxes;
+ VclPtr<CheckBox> m_pCbxRightAngledAxes;
- MetricField* m_pMFXRotation;
+ VclPtr<MetricField> m_pMFXRotation;
- MetricField* m_pMFYRotation;
+ VclPtr<MetricField> m_pMFYRotation;
- FixedText* m_pFtZRotation;
- MetricField* m_pMFZRotation;
+ VclPtr<FixedText> m_pFtZRotation;
+ VclPtr<MetricField> m_pMFZRotation;
- CheckBox* m_pCbxPerspective;
- MetricField* m_pMFPerspective;
+ VclPtr<CheckBox> m_pCbxPerspective;
+ VclPtr<MetricField> m_pMFPerspective;
//to keep old values when switching to right angled axes
sal_Int64 m_nXRotation;
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
index 71d0d65f40f2..6f3805f7d8da 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
@@ -48,10 +48,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeLightButton(vcl::Windo
return new LightButton(pParent);
}
-LightButton::~LightButton()
-{
-}
-
void LightButton::switchLightOn(bool bOn)
{
if( m_bLightOn==bOn )
@@ -82,7 +78,7 @@ struct LightSource
struct LightSourceInfo
{
- LightButton* pButton;
+ VclPtr<LightButton> pButton;
LightSource aLightSource;
LightSourceInfo();
@@ -298,7 +294,27 @@ ThreeD_SceneIllumination_TabPage::ThreeD_SceneIllumination_TabPage( vcl::Window*
ThreeD_SceneIllumination_TabPage::~ThreeD_SceneIllumination_TabPage()
{
+ disposeOnce();
+}
+
+void ThreeD_SceneIllumination_TabPage::dispose()
+{
delete[] m_pLightSourceInfoList;
+ m_pLightSourceInfoList = NULL;
+ m_pBtn_Light1.clear();
+ m_pBtn_Light2.clear();
+ m_pBtn_Light3.clear();
+ m_pBtn_Light4.clear();
+ m_pBtn_Light5.clear();
+ m_pBtn_Light6.clear();
+ m_pBtn_Light7.clear();
+ m_pBtn_Light8.clear();
+ m_pLB_LightSource.clear();
+ m_pBtn_LightSource_Color.clear();
+ m_pLB_AmbientLight.clear();
+ m_pBtn_AmbientLight_Color.clear();
+ m_pCtl_Preview.clear();
+ TabPage::dispose();
}
IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, fillControlsFromModel)
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx
index 5e68d8bf08e0..b7f46f26e964 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx
@@ -37,7 +37,6 @@ class LightButton : public ImageButton
{
public:
LightButton( vcl::Window* pParent);
- virtual ~LightButton();
void switchLightOn(bool bOn);
bool isLightOn() const { return m_bLightOn;}
@@ -58,6 +57,7 @@ public:
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel,
const XColorListRef &pColorTable );
virtual ~ThreeD_SceneIllumination_TabPage();
+ virtual void dispose() SAL_OVERRIDE;
private:
DECL_LINK( ClickLightSourceButtonHdl, LightButton* );
@@ -74,22 +74,22 @@ private:
void applyLightSourceToModel( sal_uInt32 nLightNumber );
void applyLightSourcesToModel();
- LightButton* m_pBtn_Light1;
- LightButton* m_pBtn_Light2;
- LightButton* m_pBtn_Light3;
- LightButton* m_pBtn_Light4;
- LightButton* m_pBtn_Light5;
- LightButton* m_pBtn_Light6;
- LightButton* m_pBtn_Light7;
- LightButton* m_pBtn_Light8;
+ VclPtr<LightButton> m_pBtn_Light1;
+ VclPtr<LightButton> m_pBtn_Light2;
+ VclPtr<LightButton> m_pBtn_Light3;
+ VclPtr<LightButton> m_pBtn_Light4;
+ VclPtr<LightButton> m_pBtn_Light5;
+ VclPtr<LightButton> m_pBtn_Light6;
+ VclPtr<LightButton> m_pBtn_Light7;
+ VclPtr<LightButton> m_pBtn_Light8;
- ColorLB* m_pLB_LightSource;
- PushButton* m_pBtn_LightSource_Color;
+ VclPtr<ColorLB> m_pLB_LightSource;
+ VclPtr<PushButton> m_pBtn_LightSource_Color;
- ColorLB* m_pLB_AmbientLight;
- PushButton* m_pBtn_AmbientLight_Color;
+ VclPtr<ColorLB> m_pLB_AmbientLight;
+ VclPtr<PushButton> m_pBtn_AmbientLight_Color;
- SvxLightCtl3D* m_pCtl_Preview;
+ VclPtr<SvxLightCtl3D> m_pCtl_Preview;
LightSourceInfo* m_pLightSourceInfoList;
diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.cxx b/chart2/source/controller/dialogs/tp_AxisLabel.cxx
index 77a426f4bba3..c9f53c5f5008 100644
--- a/chart2/source/controller/dialogs/tp_AxisLabel.cxx
+++ b/chart2/source/controller/dialogs/tp_AxisLabel.cxx
@@ -71,11 +71,37 @@ SchAxisLabelTabPage::SchAxisLabelTabPage( vcl::Window* pParent, const SfxItemSet
}
SchAxisLabelTabPage::~SchAxisLabelTabPage()
-{delete m_pOrientHlp;}
+{
+ disposeOnce();
+}
+
+void SchAxisLabelTabPage::dispose()
+{
+ delete m_pOrientHlp;
+ m_pOrientHlp = NULL;
+ m_pCbShowDescription.clear();
+ m_pFlOrder.clear();
+ m_pRbSideBySide.clear();
+ m_pRbUpDown.clear();
+ m_pRbDownUp.clear();
+ m_pRbAuto.clear();
+ m_pFlTextFlow.clear();
+ m_pCbTextOverlap.clear();
+ m_pCbTextBreak.clear();
+ m_pFtABCD.clear();
+ m_pFlOrient.clear();
+ m_pCtrlDial.clear();
+ m_pFtRotate.clear();
+ m_pNfRotate.clear();
+ m_pCbStacked.clear();
+ m_pFtTextDirection.clear();
+ m_pLbTextDirection.clear();
+ SfxTabPage::dispose();
+}
-SfxTabPage* SchAxisLabelTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrs )
+VclPtr<SfxTabPage> SchAxisLabelTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrs )
{
- return new SchAxisLabelTabPage( pParent, *rAttrs );
+ return VclPtr<SchAxisLabelTabPage>::Create( pParent, *rAttrs );
}
bool SchAxisLabelTabPage::FillItemSet( SfxItemSet* rOutAttrs )
diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.hxx b/chart2/source/controller/dialogs/tp_AxisLabel.hxx
index 0aa09b53b823..ef591d0ea028 100644
--- a/chart2/source/controller/dialogs/tp_AxisLabel.hxx
+++ b/chart2/source/controller/dialogs/tp_AxisLabel.hxx
@@ -35,27 +35,27 @@ namespace chart
class SchAxisLabelTabPage : public SfxTabPage
{
private:
- CheckBox* m_pCbShowDescription;
+ VclPtr<CheckBox> m_pCbShowDescription;
- FixedText* m_pFlOrder;
- RadioButton* m_pRbSideBySide;
- RadioButton* m_pRbUpDown;
- RadioButton* m_pRbDownUp;
- RadioButton* m_pRbAuto;
+ VclPtr<FixedText> m_pFlOrder;
+ VclPtr<RadioButton> m_pRbSideBySide;
+ VclPtr<RadioButton> m_pRbUpDown;
+ VclPtr<RadioButton> m_pRbDownUp;
+ VclPtr<RadioButton> m_pRbAuto;
- FixedText* m_pFlTextFlow;
- CheckBox* m_pCbTextOverlap;
- CheckBox* m_pCbTextBreak;
- FixedText* m_pFtABCD;
- FixedText* m_pFlOrient;
- svx::DialControl* m_pCtrlDial;
- FixedText* m_pFtRotate;
- NumericField* m_pNfRotate;
- TriStateBox* m_pCbStacked;
+ VclPtr<FixedText> m_pFlTextFlow;
+ VclPtr<CheckBox> m_pCbTextOverlap;
+ VclPtr<CheckBox> m_pCbTextBreak;
+ VclPtr<FixedText> m_pFtABCD;
+ VclPtr<FixedText> m_pFlOrient;
+ VclPtr<svx::DialControl> m_pCtrlDial;
+ VclPtr<FixedText> m_pFtRotate;
+ VclPtr<NumericField> m_pNfRotate;
+ VclPtr<TriStateBox> m_pCbStacked;
svx::OrientationHelper* m_pOrientHlp;
- FixedText* m_pFtTextDirection;
- TextDirectionListBox* m_pLbTextDirection;
+ VclPtr<FixedText> m_pFtTextDirection;
+ VclPtr<TextDirectionListBox> m_pLbTextDirection;
bool m_bShowStaggeringControls;
@@ -70,8 +70,9 @@ private:
public:
SchAxisLabelTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
virtual ~SchAxisLabelTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rInAttrs );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rInAttrs );
virtual bool FillItemSet( SfxItemSet* rOutAttrs ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rInAttrs ) SAL_OVERRIDE;
diff --git a/chart2/source/controller/dialogs/tp_AxisPositions.cxx b/chart2/source/controller/dialogs/tp_AxisPositions.cxx
index c74605624733..83fa72fa21f1 100644
--- a/chart2/source/controller/dialogs/tp_AxisPositions.cxx
+++ b/chart2/source/controller/dialogs/tp_AxisPositions.cxx
@@ -84,9 +84,33 @@ AxisPositionsTabPage::AxisPositionsTabPage(vcl::Window* pWindow,const SfxItemSet
m_pLB_PlaceTicks->SetDropDownLineCount( m_pLB_PlaceTicks->GetEntryCount() );
}
-SfxTabPage* AxisPositionsTabPage::Create(vcl::Window* pWindow,const SfxItemSet* rOutAttrs)
+AxisPositionsTabPage::~AxisPositionsTabPage()
{
- return new AxisPositionsTabPage(pWindow, *rOutAttrs);
+ disposeOnce();
+}
+
+void AxisPositionsTabPage::dispose()
+{
+ m_pFL_AxisLine.clear();
+ m_pLB_CrossesAt.clear();
+ m_pED_CrossesAt.clear();
+ m_pED_CrossesAtCategory.clear();
+ m_pCB_AxisBetweenCategories.clear();
+ m_pFL_Labels.clear();
+ m_pLB_PlaceLabels.clear();
+ m_pED_LabelDistance.clear();
+ m_pCB_TicksInner.clear();
+ m_pCB_TicksOuter.clear();
+ m_pCB_MinorInner.clear();
+ m_pCB_MinorOuter.clear();
+ m_pBxPlaceTicks.clear();
+ m_pLB_PlaceTicks.clear();
+ SfxTabPage::dispose();
+}
+
+VclPtr<SfxTabPage> AxisPositionsTabPage::Create(vcl::Window* pWindow,const SfxItemSet* rOutAttrs)
+{
+ return VclPtr<AxisPositionsTabPage>::Create(pWindow, *rOutAttrs);
}
bool AxisPositionsTabPage::FillItemSet(SfxItemSet* rOutAttrs)
diff --git a/chart2/source/controller/dialogs/tp_AxisPositions.hxx b/chart2/source/controller/dialogs/tp_AxisPositions.hxx
index 61eb83c2dacd..a05ae58aeb49 100644
--- a/chart2/source/controller/dialogs/tp_AxisPositions.hxx
+++ b/chart2/source/controller/dialogs/tp_AxisPositions.hxx
@@ -33,8 +33,10 @@ class AxisPositionsTabPage : public SfxTabPage
{
public:
AxisPositionsTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ virtual ~AxisPositionsTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rInAttrs );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rInAttrs );
virtual bool FillItemSet( SfxItemSet* rOutAttrs ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rInAttrs ) SAL_OVERRIDE;
using TabPage::DeactivatePage;
@@ -52,30 +54,30 @@ private: //methods:
DECL_LINK( PlaceLabelsSelectHdl, void* );
private: //member:
- VclFrame* m_pFL_AxisLine;
- ListBox* m_pLB_CrossesAt;
- FormattedField* m_pED_CrossesAt;
- ComboBox* m_pED_CrossesAtCategory;
- CheckBox* m_pCB_AxisBetweenCategories;
+ VclPtr<VclFrame> m_pFL_AxisLine;
+ VclPtr<ListBox> m_pLB_CrossesAt;
+ VclPtr<FormattedField> m_pED_CrossesAt;
+ VclPtr<ComboBox> m_pED_CrossesAtCategory;
+ VclPtr<CheckBox> m_pCB_AxisBetweenCategories;
- VclFrame* m_pFL_Labels;
- ListBox* m_pLB_PlaceLabels;
- FormattedField* m_pED_LabelDistance;
+ VclPtr<VclFrame> m_pFL_Labels;
+ VclPtr<ListBox> m_pLB_PlaceLabels;
+ VclPtr<FormattedField> m_pED_LabelDistance;
- CheckBox* m_pCB_TicksInner;
- CheckBox* m_pCB_TicksOuter;
+ VclPtr<CheckBox> m_pCB_TicksInner;
+ VclPtr<CheckBox> m_pCB_TicksOuter;
- CheckBox* m_pCB_MinorInner;
- CheckBox* m_pCB_MinorOuter;
+ VclPtr<CheckBox> m_pCB_MinorInner;
+ VclPtr<CheckBox> m_pCB_MinorOuter;
- VclBox* m_pBxPlaceTicks;
- ListBox* m_pLB_PlaceTicks;
+ VclPtr<VclBox> m_pBxPlaceTicks;
+ VclPtr<ListBox> m_pLB_PlaceTicks;
// Not implemented
-// CheckBox* m_pCB_MajorGrid;
-// PushButton* m_pPB_MajorGrid;
-// CheckBox* m_pCB_MinorGrid;
-// PushButton* m_pPB_MinorGrid;
+// VclPtr<CheckBox> m_pCB_MajorGrid;
+// VclPtr<PushButton> m_pPB_MajorGrid;
+// VclPtr<CheckBox> m_pCB_MinorGrid;
+// VclPtr<PushButton> m_pPB_MinorGrid;
SvNumberFormatter* m_pNumFormatter;
diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx
index 1ae7a691756a..5a13c68988fa 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.cxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.cxx
@@ -56,8 +56,8 @@ private:
DECL_LINK( SelectSchemeHdl, void* );
private:
- CheckBox* m_pCB_3DLook;
- ListBox* m_pLB_Scheme;
+ VclPtr<CheckBox> m_pCB_3DLook;
+ VclPtr<ListBox> m_pLB_Scheme;
};
Dim3DLookResourceGroup::Dim3DLookResourceGroup(VclBuilderContainer* pWindow)
@@ -129,7 +129,7 @@ private:
DECL_LINK( SortByXValuesCheckHdl, void* );
private:
- CheckBox* m_pCB_XValueSorting;
+ VclPtr<CheckBox> m_pCB_XValueSorting;
};
SortByXValuesResourceGroup::SortByXValuesResourceGroup(VclBuilderContainer* pWindow )
@@ -176,10 +176,10 @@ private:
DECL_LINK( StackingEnableHdl, void* );
private:
- CheckBox* m_pCB_Stacked;
- RadioButton* m_pRB_Stack_Y;
- RadioButton* m_pRB_Stack_Y_Percent;
- RadioButton* m_pRB_Stack_Z;
+ VclPtr<CheckBox> m_pCB_Stacked;
+ VclPtr<RadioButton> m_pRB_Stack_Y;
+ VclPtr<RadioButton> m_pRB_Stack_Y_Percent;
+ VclPtr<RadioButton> m_pRB_Stack_Z;
bool m_bShowDeepStacking;
};
@@ -278,7 +278,7 @@ public:
private:
DECL_LINK( SettingChangedHdl, void* );
private:
- CheckBox* m_pCB_RoundedEdge;
+ VclPtr<CheckBox> m_pCB_RoundedEdge;
};
GL3DResourceGroup::GL3DResourceGroup( VclBuilderContainer* pWindow )
@@ -313,7 +313,8 @@ class SplinePropertiesDialog : public ModalDialog
{
public:
SplinePropertiesDialog( vcl::Window* pParent );
- virtual ~SplinePropertiesDialog();
+ virtual ~SplinePropertiesDialog() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE;
void fillControls( const ChartTypeParameter& rParameter );
void fillParameter( ChartTypeParameter& rParameter, bool bSmoothLines );
@@ -324,11 +325,11 @@ private:
DECL_LINK( SplineTypeListBoxHdl, void* );
private:
- ListBox* m_pLB_Spline_Type;
+ VclPtr<ListBox> m_pLB_Spline_Type;
- NumericField* m_pMF_SplineResolution;
- FixedText* m_pFT_SplineOrder;
- NumericField* m_pMF_SplineOrder;
+ VclPtr<NumericField> m_pMF_SplineResolution;
+ VclPtr<FixedText> m_pFT_SplineOrder;
+ VclPtr<NumericField> m_pMF_SplineOrder;
};
const sal_uInt16 CUBIC_SPLINE_POS = 0;
@@ -347,8 +348,13 @@ SplinePropertiesDialog::SplinePropertiesDialog( vcl::Window* pParent )
m_pLB_Spline_Type->SetSelectHdl( LINK (this, SplinePropertiesDialog, SplineTypeListBoxHdl ) );
}
-SplinePropertiesDialog::~SplinePropertiesDialog()
+void SplinePropertiesDialog::dispose()
{
+ m_pLB_Spline_Type.clear();
+ m_pMF_SplineResolution.clear();
+ m_pFT_SplineOrder.clear();
+ m_pMF_SplineOrder.clear();
+ ModalDialog::dispose();
}
void SplinePropertiesDialog::StateChanged( StateChangedType nType )
@@ -400,7 +406,8 @@ class SteppedPropertiesDialog : public ModalDialog
{
public:
SteppedPropertiesDialog( vcl::Window* pParent );
- virtual ~SteppedPropertiesDialog();
+ virtual ~SteppedPropertiesDialog() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE;
void fillControls( const ChartTypeParameter& rParameter );
void fillParameter( ChartTypeParameter& rParameter, bool bSteppedLines );
@@ -410,10 +417,10 @@ public:
private:
private:
- RadioButton* m_pRB_Start;
- RadioButton* m_pRB_End;
- RadioButton* m_pRB_CenterX;
- RadioButton* m_pRB_CenterY;
+ VclPtr<RadioButton> m_pRB_Start;
+ VclPtr<RadioButton> m_pRB_End;
+ VclPtr<RadioButton> m_pRB_CenterX;
+ VclPtr<RadioButton> m_pRB_CenterY;
};
SteppedPropertiesDialog::SteppedPropertiesDialog( vcl::Window* pParent )
@@ -427,8 +434,13 @@ SteppedPropertiesDialog::SteppedPropertiesDialog( vcl::Window* pParent )
SetText(SCH_RESSTR(STR_DLG_STEPPED_LINE_PROPERTIES));
}
-SteppedPropertiesDialog::~SteppedPropertiesDialog()
+void SteppedPropertiesDialog::dispose()
{
+ m_pRB_Start.clear();
+ m_pRB_End.clear();
+ m_pRB_CenterX.clear();
+ m_pRB_CenterY.clear();
+ ModalDialog::dispose();
}
void SteppedPropertiesDialog::StateChanged( StateChangedType nType )
@@ -490,11 +502,11 @@ private:
SteppedPropertiesDialog& getSteppedPropertiesDialog();
private:
- FixedText* m_pFT_LineType;
- ListBox* m_pLB_LineType;
- PushButton* m_pPB_DetailsDialog;
- boost::scoped_ptr< SplinePropertiesDialog > m_pSplinePropertiesDialog;
- boost::scoped_ptr< SteppedPropertiesDialog > m_pSteppedPropertiesDialog;
+ VclPtr<FixedText> m_pFT_LineType;
+ VclPtr<ListBox> m_pLB_LineType;
+ VclPtr<PushButton> m_pPB_DetailsDialog;
+ VclPtr< SplinePropertiesDialog > m_pSplinePropertiesDialog;
+ VclPtr< SteppedPropertiesDialog > m_pSteppedPropertiesDialog;
};
SplineResourceGroup::SplineResourceGroup(VclBuilderContainer* pWindow)
@@ -510,7 +522,7 @@ SplineResourceGroup::SplineResourceGroup(VclBuilderContainer* pWindow)
SplinePropertiesDialog& SplineResourceGroup::getSplinePropertiesDialog()
{
if( !m_pSplinePropertiesDialog.get() )
- m_pSplinePropertiesDialog.reset( new SplinePropertiesDialog( m_pPB_DetailsDialog->GetParentDialog() ) );
+ m_pSplinePropertiesDialog.reset( VclPtr<SplinePropertiesDialog>::Create( m_pPB_DetailsDialog->GetParentDialog() ) );
return *m_pSplinePropertiesDialog;
}
@@ -518,7 +530,7 @@ SteppedPropertiesDialog& SplineResourceGroup::getSteppedPropertiesDialog()
{
if( !m_pSteppedPropertiesDialog.get() )
{
- m_pSteppedPropertiesDialog.reset( new SteppedPropertiesDialog( m_pPB_DetailsDialog->GetParentDialog() ) );
+ m_pSteppedPropertiesDialog.reset( VclPtr<SteppedPropertiesDialog>::Create( m_pPB_DetailsDialog->GetParentDialog() ) );
}
return *m_pSteppedPropertiesDialog;
}
@@ -774,6 +786,11 @@ ChartTypeTabPage::ChartTypeTabPage(vcl::Window* pParent
ChartTypeTabPage::~ChartTypeTabPage()
{
+ disposeOnce();
+}
+
+void ChartTypeTabPage::dispose()
+{
//delete all dialog controller
::std::vector< ChartTypeDialogController* >::const_iterator aIter = m_aChartTypeDialogControllerList.begin();
const ::std::vector< ChartTypeDialogController* >::const_iterator aEnd = m_aChartTypeDialogControllerList.end();
@@ -785,12 +802,23 @@ ChartTypeTabPage::~ChartTypeTabPage()
//delete all resource helper
delete m_pDim3DLookResourceGroup;
+ m_pDim3DLookResourceGroup = NULL;
delete m_pStackingResourceGroup;
+ m_pStackingResourceGroup = NULL;
delete m_pSplineResourceGroup;
+ m_pSplineResourceGroup = NULL;
delete m_pGeometryResourceGroup;
+ m_pGeometryResourceGroup = NULL;
delete m_pSortByXValuesResourceGroup;
+ m_pSortByXValuesResourceGroup = NULL;
delete m_pGL3DResourceGroup;
+ m_pGL3DResourceGroup = NULL;
+ m_pFT_ChooseType.clear();
+ m_pMainTypeList.clear();
+ m_pSubTypeList.clear();
+ svt::OWizardPage::dispose();
}
+
ChartTypeParameter ChartTypeTabPage::getCurrentParamter() const
{
ChartTypeParameter aParameter;
diff --git a/chart2/source/controller/dialogs/tp_ChartType.hxx b/chart2/source/controller/dialogs/tp_ChartType.hxx
index 486ae1540805..4ed830b10535 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.hxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.hxx
@@ -55,6 +55,7 @@ public:
::com::sun::star::uno::XComponentContext >& xContext
, bool bDoLiveUpdate, bool bShowDescription = true );
virtual ~ChartTypeTabPage();
+ virtual void dispose() SAL_OVERRIDE;
virtual void initializePage() SAL_OVERRIDE;
virtual bool commitPage( ::svt::WizardTypes::CommitPageReason eReason ) SAL_OVERRIDE;
@@ -77,9 +78,9 @@ protected:
DECL_LINK( SelectSubTypeHdl, void* );
protected:
- FixedText* m_pFT_ChooseType;
- ListBox* m_pMainTypeList;
- ValueSet* m_pSubTypeList;
+ VclPtr<FixedText> m_pFT_ChooseType;
+ VclPtr<ListBox> m_pMainTypeList;
+ VclPtr<ValueSet> m_pSubTypeList;
Dim3DLookResourceGroup* m_pDim3DLookResourceGroup;
StackingResourceGroup* m_pStackingResourceGroup;
diff --git a/chart2/source/controller/dialogs/tp_DataLabel.cxx b/chart2/source/controller/dialogs/tp_DataLabel.cxx
index ef795fa2e2ca..432290d78201 100644
--- a/chart2/source/controller/dialogs/tp_DataLabel.cxx
+++ b/chart2/source/controller/dialogs/tp_DataLabel.cxx
@@ -34,13 +34,9 @@ DataLabelsTabPage::DataLabelsTabPage(vcl::Window* pWindow, const SfxItemSet& rIn
{
}
-DataLabelsTabPage::~DataLabelsTabPage()
+VclPtr<SfxTabPage> DataLabelsTabPage::Create(vcl::Window* pWindow, const SfxItemSet* rOutAttrs)
{
-}
-
-SfxTabPage* DataLabelsTabPage::Create(vcl::Window* pWindow, const SfxItemSet* rOutAttrs)
-{
- return new DataLabelsTabPage(pWindow, *rOutAttrs);
+ return VclPtr<DataLabelsTabPage>::Create(pWindow, *rOutAttrs);
}
bool DataLabelsTabPage::FillItemSet(SfxItemSet* rOutAttrs)
diff --git a/chart2/source/controller/dialogs/tp_DataLabel.hxx b/chart2/source/controller/dialogs/tp_DataLabel.hxx
index 1bad928af04d..0699b8a02d9d 100644
--- a/chart2/source/controller/dialogs/tp_DataLabel.hxx
+++ b/chart2/source/controller/dialogs/tp_DataLabel.hxx
@@ -34,9 +34,8 @@ class DataLabelsTabPage : public SfxTabPage
{
public:
DataLabelsTabPage(vcl::Window* pWindow, const SfxItemSet& rInAttrs);
- virtual ~DataLabelsTabPage();
- static SfxTabPage* Create(vcl::Window* pWindow, const SfxItemSet* rInAttrs);
+ static VclPtr<SfxTabPage> Create(vcl::Window* pWindow, const SfxItemSet* rInAttrs);
void SetNumberFormatter( SvNumberFormatter* pFormatter );
diff --git a/chart2/source/controller/dialogs/tp_DataSource.cxx b/chart2/source/controller/dialogs/tp_DataSource.cxx
index d265e8ab7859..c3149fea8fbe 100644
--- a/chart2/source/controller/dialogs/tp_DataSource.cxx
+++ b/chart2/source/controller/dialogs/tp_DataSource.cxx
@@ -274,7 +274,32 @@ DataSourceTabPage::DataSourceTabPage(
}
DataSourceTabPage::~DataSourceTabPage()
-{}
+{
+ disposeOnce();
+}
+
+void DataSourceTabPage::dispose()
+{
+ m_pFT_CAPTION.clear();
+ m_pFT_SERIES.clear();
+ m_pLB_SERIES.clear();
+ m_pBTN_ADD.clear();
+ m_pBTN_REMOVE.clear();
+ m_pBTN_UP.clear();
+ m_pBTN_DOWN.clear();
+ m_pFT_ROLE.clear();
+ m_pLB_ROLE.clear();
+ m_pFT_RANGE.clear();
+ m_pEDT_RANGE.clear();
+ m_pIMB_RANGE_MAIN.clear();
+ m_pFT_CATEGORIES.clear();
+ m_pFT_DATALABELS.clear();
+ m_pEDT_CATEGORIES.clear();
+ m_pIMB_RANGE_CAT.clear();
+ m_pCurrentRangeChoosingField.clear();
+ m_pParentDialog.clear();
+ ::svt::OWizardPage::dispose();
+}
void DataSourceTabPage::ActivatePage()
{
diff --git a/chart2/source/controller/dialogs/tp_DataSource.hxx b/chart2/source/controller/dialogs/tp_DataSource.hxx
index 1cc0439a1065..59b92bf840c3 100644
--- a/chart2/source/controller/dialogs/tp_DataSource.hxx
+++ b/chart2/source/controller/dialogs/tp_DataSource.hxx
@@ -59,6 +59,7 @@ public:
Dialog * pParentDialog,
bool bHideDescription = false );
virtual ~DataSourceTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void commitPage();
@@ -118,34 +119,34 @@ protected:
void fillRoleListBox();
private:
- FixedText* m_pFT_CAPTION;
- FixedText* m_pFT_SERIES;
- SvTreeListBox* m_pLB_SERIES;
- PushButton* m_pBTN_ADD;
- PushButton* m_pBTN_REMOVE;
- PushButton* m_pBTN_UP;
- PushButton* m_pBTN_DOWN;
-
- FixedText* m_pFT_ROLE;
- SvTabListBox* m_pLB_ROLE;
- FixedText* m_pFT_RANGE;
- Edit* m_pEDT_RANGE;
- PushButton* m_pIMB_RANGE_MAIN;
-
- FixedText* m_pFT_CATEGORIES;
- FixedText* m_pFT_DATALABELS;//used for xy charts
- Edit* m_pEDT_CATEGORIES;
- PushButton* m_pIMB_RANGE_CAT;
+ VclPtr<FixedText> m_pFT_CAPTION;
+ VclPtr<FixedText> m_pFT_SERIES;
+ VclPtr<SvTreeListBox> m_pLB_SERIES;
+ VclPtr<PushButton> m_pBTN_ADD;
+ VclPtr<PushButton> m_pBTN_REMOVE;
+ VclPtr<PushButton> m_pBTN_UP;
+ VclPtr<PushButton> m_pBTN_DOWN;
+
+ VclPtr<FixedText> m_pFT_ROLE;
+ VclPtr<SvTabListBox> m_pLB_ROLE;
+ VclPtr<FixedText> m_pFT_RANGE;
+ VclPtr<Edit> m_pEDT_RANGE;
+ VclPtr<PushButton> m_pIMB_RANGE_MAIN;
+
+ VclPtr<FixedText> m_pFT_CATEGORIES;
+ VclPtr<FixedText> m_pFT_DATALABELS;//used for xy charts
+ VclPtr<Edit> m_pEDT_CATEGORIES;
+ VclPtr<PushButton> m_pIMB_RANGE_CAT;
OUString m_aFixedTextRange;
ChartTypeTemplateProvider * m_pTemplateProvider;
DialogModel & m_rDialogModel;
- Edit * m_pCurrentRangeChoosingField;
+ VclPtr<Edit> m_pCurrentRangeChoosingField;
bool m_bIsDirty;
sal_Int32 m_nLastChartTypeGroupIndex;
- Dialog * m_pParentDialog;
+ VclPtr<Dialog> m_pParentDialog;
TabPageNotifiable * m_pTabPageNotifiable;
};
diff --git a/chart2/source/controller/dialogs/tp_ErrorBars.cxx b/chart2/source/controller/dialogs/tp_ErrorBars.cxx
index 4d58bb7f91a8..adac35ea9c87 100644
--- a/chart2/source/controller/dialogs/tp_ErrorBars.cxx
+++ b/chart2/source/controller/dialogs/tp_ErrorBars.cxx
@@ -41,10 +41,10 @@ ErrorBarsTabPage::ErrorBarsTabPage( vcl::Window* pParent, const SfxItemSet& rInA
{
}
-SfxTabPage* ErrorBarsTabPage::Create(
+VclPtr<SfxTabPage> ErrorBarsTabPage::Create(
vcl::Window* pParent, const SfxItemSet* rOutAttrs )
{
- return new ErrorBarsTabPage( pParent, *rOutAttrs );
+ return VclPtr<ErrorBarsTabPage>::Create( pParent, *rOutAttrs );
}
bool ErrorBarsTabPage::FillItemSet( SfxItemSet* rOutAttrs )
diff --git a/chart2/source/controller/dialogs/tp_ErrorBars.hxx b/chart2/source/controller/dialogs/tp_ErrorBars.hxx
index 6da7692d8c9f..4ac8bdbcd0bd 100644
--- a/chart2/source/controller/dialogs/tp_ErrorBars.hxx
+++ b/chart2/source/controller/dialogs/tp_ErrorBars.hxx
@@ -37,7 +37,7 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartDocument > & xChartDocument );
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rInAttrs );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rInAttrs );
virtual bool FillItemSet( SfxItemSet* rOutAttrs ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rInAttrs ) SAL_OVERRIDE;
diff --git a/chart2/source/controller/dialogs/tp_LegendPosition.cxx b/chart2/source/controller/dialogs/tp_LegendPosition.cxx
index 707324fb8610..1a264f5b6b4f 100644
--- a/chart2/source/controller/dialogs/tp_LegendPosition.cxx
+++ b/chart2/source/controller/dialogs/tp_LegendPosition.cxx
@@ -41,9 +41,21 @@ SchLegendPosTabPage::SchLegendPosTabPage(vcl::Window* pWindow, const SfxItemSet&
m_pLbTextDirection->SetDropDownLineCount(3);
}
-SfxTabPage* SchLegendPosTabPage::Create(vcl::Window* pWindow, const SfxItemSet* rOutAttrs)
+SchLegendPosTabPage::~SchLegendPosTabPage()
{
- return new SchLegendPosTabPage(pWindow, *rOutAttrs);
+ disposeOnce();
+}
+
+void SchLegendPosTabPage::dispose()
+{
+ m_pLbTextDirection.clear();
+ SfxTabPage::dispose();
+}
+
+
+VclPtr<SfxTabPage> SchLegendPosTabPage::Create(vcl::Window* pWindow, const SfxItemSet* rOutAttrs)
+{
+ return VclPtr<SchLegendPosTabPage>::Create(pWindow, *rOutAttrs);
}
bool SchLegendPosTabPage::FillItemSet(SfxItemSet* rOutAttrs)
diff --git a/chart2/source/controller/dialogs/tp_LegendPosition.hxx b/chart2/source/controller/dialogs/tp_LegendPosition.hxx
index 0d4f4acf0d07..13f46f21f9b7 100644
--- a/chart2/source/controller/dialogs/tp_LegendPosition.hxx
+++ b/chart2/source/controller/dialogs/tp_LegendPosition.hxx
@@ -33,12 +33,14 @@ class SchLegendPosTabPage : public SfxTabPage
private:
LegendPositionResources m_aLegendPositionResources;
- TextDirectionListBox* m_pLbTextDirection;
+ VclPtr<TextDirectionListBox> m_pLbTextDirection;
public:
SchLegendPosTabPage(vcl::Window* pParent, const SfxItemSet& rInAttrs);
+ virtual ~SchLegendPosTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rInAttrs);
+ static VclPtr<SfxTabPage> Create(vcl::Window* pParent, const SfxItemSet* rInAttrs);
virtual bool FillItemSet(SfxItemSet* rOutAttrs) SAL_OVERRIDE;
virtual void Reset(const SfxItemSet* rInAttrs) SAL_OVERRIDE;
};
diff --git a/chart2/source/controller/dialogs/tp_PointGeometry.cxx b/chart2/source/controller/dialogs/tp_PointGeometry.cxx
index 3abb60bbc5fb..5975806aa9f1 100644
--- a/chart2/source/controller/dialogs/tp_PointGeometry.cxx
+++ b/chart2/source/controller/dialogs/tp_PointGeometry.cxx
@@ -39,13 +39,20 @@ SchLayoutTabPage::SchLayoutTabPage(vcl::Window* pWindow,const SfxItemSet& rInAtt
SchLayoutTabPage::~SchLayoutTabPage()
{
+ disposeOnce();
+}
+
+void SchLayoutTabPage::dispose()
+{
delete m_pGeometryResources;
+ m_pGeometryResources = NULL;
+ SfxTabPage::dispose();
}
-SfxTabPage* SchLayoutTabPage::Create(vcl::Window* pWindow,
- const SfxItemSet* rOutAttrs)
+VclPtr<SfxTabPage> SchLayoutTabPage::Create(vcl::Window* pWindow,
+ const SfxItemSet* rOutAttrs)
{
- return new SchLayoutTabPage(pWindow, *rOutAttrs);
+ return VclPtr<SchLayoutTabPage>::Create(pWindow, *rOutAttrs);
}
bool SchLayoutTabPage::FillItemSet(SfxItemSet* rOutAttrs)
diff --git a/chart2/source/controller/dialogs/tp_PointGeometry.hxx b/chart2/source/controller/dialogs/tp_PointGeometry.hxx
index 635768fe1178..7283f5f6cb50 100644
--- a/chart2/source/controller/dialogs/tp_PointGeometry.hxx
+++ b/chart2/source/controller/dialogs/tp_PointGeometry.hxx
@@ -30,8 +30,9 @@ class SchLayoutTabPage : public SfxTabPage
public:
SchLayoutTabPage(vcl::Window* pParent, const SfxItemSet& rInAttrs);
virtual ~SchLayoutTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rInAttrs);
+ static VclPtr<SfxTabPage> Create(vcl::Window* pParent, const SfxItemSet* rInAttrs);
virtual bool FillItemSet(SfxItemSet* rOutAttrs) SAL_OVERRIDE;
virtual void Reset(const SfxItemSet* rInAttrs) SAL_OVERRIDE;
diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.cxx b/chart2/source/controller/dialogs/tp_PolarOptions.cxx
index dbd0c460df28..d01f02b97cb8 100644
--- a/chart2/source/controller/dialogs/tp_PolarOptions.cxx
+++ b/chart2/source/controller/dialogs/tp_PolarOptions.cxx
@@ -46,11 +46,23 @@ PolarOptionsTabPage::PolarOptionsTabPage( vcl::Window* pWindow,const SfxItemSet&
PolarOptionsTabPage::~PolarOptionsTabPage()
{
+ disposeOnce();
}
-SfxTabPage* PolarOptionsTabPage::Create( vcl::Window* pWindow,const SfxItemSet* rOutAttrs )
+void PolarOptionsTabPage::dispose()
{
- return new PolarOptionsTabPage( pWindow, *rOutAttrs );
+ m_pCB_Clockwise.clear();
+ m_pFL_StartingAngle.clear();
+ m_pAngleDial.clear();
+ m_pNF_StartingAngle.clear();
+ m_pFL_PlotOptions.clear();
+ m_pCB_IncludeHiddenCells.clear();
+ SfxTabPage::dispose();
+}
+
+VclPtr<SfxTabPage> PolarOptionsTabPage::Create( vcl::Window* pWindow,const SfxItemSet* rOutAttrs )
+{
+ return VclPtr<PolarOptionsTabPage>::Create( pWindow, *rOutAttrs );
}
bool PolarOptionsTabPage::FillItemSet( SfxItemSet* rOutAttrs )
diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.hxx b/chart2/source/controller/dialogs/tp_PolarOptions.hxx
index 7d0ea5034122..0b65cb745671 100644
--- a/chart2/source/controller/dialogs/tp_PolarOptions.hxx
+++ b/chart2/source/controller/dialogs/tp_PolarOptions.hxx
@@ -34,18 +34,19 @@ class PolarOptionsTabPage : public SfxTabPage
public:
PolarOptionsTabPage(vcl::Window* pParent, const SfxItemSet& rInAttrs );
virtual ~PolarOptionsTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rInAttrs);
+ static VclPtr<SfxTabPage> Create(vcl::Window* pParent, const SfxItemSet* rInAttrs);
virtual bool FillItemSet(SfxItemSet* rOutAttrs) SAL_OVERRIDE;
virtual void Reset(const SfxItemSet* rInAttrs) SAL_OVERRIDE;
private:
- CheckBox* m_pCB_Clockwise;
- VclFrame* m_pFL_StartingAngle;
- svx::DialControl* m_pAngleDial;
- NumericField* m_pNF_StartingAngle;
- VclFrame* m_pFL_PlotOptions;
- CheckBox* m_pCB_IncludeHiddenCells;
+ VclPtr<CheckBox> m_pCB_Clockwise;
+ VclPtr<VclFrame> m_pFL_StartingAngle;
+ VclPtr<svx::DialControl> m_pAngleDial;
+ VclPtr<NumericField> m_pNF_StartingAngle;
+ VclPtr<VclFrame> m_pFL_PlotOptions;
+ VclPtr<CheckBox> m_pCB_IncludeHiddenCells;
};
} //namespace chart
diff --git a/chart2/source/controller/dialogs/tp_RangeChooser.cxx b/chart2/source/controller/dialogs/tp_RangeChooser.cxx
index a5b498661fed..81189258c9ee 100644
--- a/chart2/source/controller/dialogs/tp_RangeChooser.cxx
+++ b/chart2/source/controller/dialogs/tp_RangeChooser.cxx
@@ -124,8 +124,28 @@ RangeChooserTabPage::RangeChooserTabPage( vcl::Window* pParent
RangeChooserTabPage::~RangeChooserTabPage()
{
+ disposeOnce();
}
+void RangeChooserTabPage::dispose()
+{
+ m_pFT_Caption.clear();
+ m_pFT_Range.clear();
+ m_pED_Range.clear();
+ m_pIB_Range.clear();
+ m_pRB_Rows.clear();
+ m_pRB_Columns.clear();
+ m_pCB_FirstRowAsLabel.clear();
+ m_pCB_FirstColumnAsLabel.clear();
+ m_pFTTitle.clear();
+ m_pCB_TimeBased.clear();
+ m_pEd_TimeStart.clear();
+ m_pEd_TimeEnd.clear();
+ m_pParentDialog.clear();
+ OWizardPage::dispose();
+}
+
+
void RangeChooserTabPage::ActivatePage()
{
OWizardPage::ActivatePage();
diff --git a/chart2/source/controller/dialogs/tp_RangeChooser.hxx b/chart2/source/controller/dialogs/tp_RangeChooser.hxx
index 3b88a46dd845..5bcda3593f8b 100644
--- a/chart2/source/controller/dialogs/tp_RangeChooser.hxx
+++ b/chart2/source/controller/dialogs/tp_RangeChooser.hxx
@@ -48,7 +48,8 @@ public:
, ChartTypeTemplateProvider* pTemplateProvider
, Dialog * pParentDialog
, bool bHideDescription = false );
-virtual ~RangeChooserTabPage();
+ virtual ~RangeChooserTabPage();
+ virtual void dispose() SAL_OVERRIDE;
//RangeSelectionListenerParent
virtual void listeningFinished( const OUString & rNewRange ) SAL_OVERRIDE;
@@ -76,21 +77,21 @@ protected: //methods
protected: //member
- FixedText* m_pFT_Caption;
- FixedText* m_pFT_Range;
- Edit* m_pED_Range;
- PushButton* m_pIB_Range;
+ VclPtr<FixedText> m_pFT_Caption;
+ VclPtr<FixedText> m_pFT_Range;
+ VclPtr<Edit> m_pED_Range;
+ VclPtr<PushButton> m_pIB_Range;
- RadioButton* m_pRB_Rows;
- RadioButton* m_pRB_Columns;
+ VclPtr<RadioButton> m_pRB_Rows;
+ VclPtr<RadioButton> m_pRB_Columns;
- CheckBox* m_pCB_FirstRowAsLabel;
- CheckBox* m_pCB_FirstColumnAsLabel;
- FixedText* m_pFTTitle;
+ VclPtr<CheckBox> m_pCB_FirstRowAsLabel;
+ VclPtr<CheckBox> m_pCB_FirstColumnAsLabel;
+ VclPtr<FixedText> m_pFTTitle;
- CheckBox* m_pCB_TimeBased;
- Edit* m_pEd_TimeStart;
- Edit* m_pEd_TimeEnd;
+ VclPtr<CheckBox> m_pCB_TimeBased;
+ VclPtr<Edit> m_pEd_TimeStart;
+ VclPtr<Edit> m_pEd_TimeEnd;
sal_Int32 m_nChangingControlCalls;
bool m_bIsDirty;
@@ -106,7 +107,7 @@ protected: //member
ChartTypeTemplateProvider* m_pTemplateProvider;
DialogModel & m_rDialogModel;
- Dialog * m_pParentDialog;
+ VclPtr<Dialog> m_pParentDialog;
TabPageNotifiable * m_pTabPageNotifiable;
};
diff --git a/chart2/source/controller/dialogs/tp_Scale.cxx b/chart2/source/controller/dialogs/tp_Scale.cxx
index 875c71f9c991..cca20e82289e 100644
--- a/chart2/source/controller/dialogs/tp_Scale.cxx
+++ b/chart2/source/controller/dialogs/tp_Scale.cxx
@@ -122,6 +122,41 @@ ScaleTabPage::ScaleTabPage(vcl::Window* pWindow,const SfxItemSet& rInAttrs) :
HideAllControls();
}
+ScaleTabPage::~ScaleTabPage()
+{
+ disposeOnce();
+}
+
+void ScaleTabPage::dispose()
+{
+ m_pCbxReverse.clear();
+ m_pCbxLogarithm.clear();
+ m_pBxType.clear();
+ m_pLB_AxisType.clear();
+ m_pBxMinMax.clear();
+ m_pFmtFldMin.clear();
+ m_pCbxAutoMin.clear();
+ m_pFmtFldMax.clear();
+ m_pCbxAutoMax.clear();
+ m_pBxResolution.clear();
+ m_pLB_TimeResolution.clear();
+ m_pCbx_AutoTimeResolution.clear();
+ m_pTxtMain.clear();
+ m_pFmtFldStepMain.clear();
+ m_pMt_MainDateStep.clear();
+ m_pLB_MainTimeUnit.clear();
+ m_pCbxAutoStepMain.clear();
+ m_pTxtHelpCount.clear();
+ m_pTxtHelp.clear();
+ m_pMtStepHelp.clear();
+ m_pLB_HelpTimeUnit.clear();
+ m_pCbxAutoStepHelp.clear();
+ m_pFmtFldOrigin.clear();
+ m_pCbxAutoOrigin.clear();
+ m_pBxOrigin.clear();
+ SfxTabPage::dispose();
+}
+
IMPL_LINK( ScaleTabPage, FmtFieldModifiedHdl, FormattedField*, pFmtFied )
{
if( pFmtFied )
@@ -236,9 +271,9 @@ IMPL_LINK_NOARG(ScaleTabPage, SelectAxisTypeHdl)
return 0;
}
-SfxTabPage* ScaleTabPage::Create(vcl::Window* pWindow,const SfxItemSet* rOutAttrs)
+VclPtr<SfxTabPage> ScaleTabPage::Create(vcl::Window* pWindow,const SfxItemSet* rOutAttrs)
{
- return new ScaleTabPage(pWindow, *rOutAttrs);
+ return VclPtr<ScaleTabPage>::Create(pWindow, *rOutAttrs);
}
bool ScaleTabPage::FillItemSet(SfxItemSet* rOutAttrs)
diff --git a/chart2/source/controller/dialogs/tp_Scale.hxx b/chart2/source/controller/dialogs/tp_Scale.hxx
index 3f0a99caa460..2f5a66c6c1dd 100644
--- a/chart2/source/controller/dialogs/tp_Scale.hxx
+++ b/chart2/source/controller/dialogs/tp_Scale.hxx
@@ -33,8 +33,10 @@ class ScaleTabPage : public SfxTabPage
{
public:
ScaleTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ virtual ~ScaleTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rInAttrs );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rInAttrs );
virtual bool FillItemSet( SfxItemSet* rOutAttrs ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rInAttrs ) SAL_OVERRIDE;
using TabPage::DeactivatePage;
@@ -48,38 +50,38 @@ public:
virtual void StateChanged( StateChangedType nType ) SAL_OVERRIDE;
private:
- CheckBox* m_pCbxReverse;
- CheckBox* m_pCbxLogarithm;
-
- VclBox* m_pBxType;
- ListBox* m_pLB_AxisType;
-
- VclGrid* m_pBxMinMax;
- FormattedField* m_pFmtFldMin;
- CheckBox* m_pCbxAutoMin;
-
- FormattedField* m_pFmtFldMax;
- CheckBox* m_pCbxAutoMax;
-
- VclBox* m_pBxResolution;
- ListBox* m_pLB_TimeResolution;
- CheckBox* m_pCbx_AutoTimeResolution;
-
- FixedText* m_pTxtMain;
- FormattedField* m_pFmtFldStepMain;
- MetricField* m_pMt_MainDateStep;
- ListBox* m_pLB_MainTimeUnit;
- CheckBox* m_pCbxAutoStepMain;
-
- FixedText* m_pTxtHelpCount;
- FixedText* m_pTxtHelp;
- MetricField* m_pMtStepHelp;
- ListBox* m_pLB_HelpTimeUnit;
- CheckBox* m_pCbxAutoStepHelp;
-
- FormattedField* m_pFmtFldOrigin;
- CheckBox* m_pCbxAutoOrigin;
- VclBox* m_pBxOrigin;
+ VclPtr<CheckBox> m_pCbxReverse;
+ VclPtr<CheckBox> m_pCbxLogarithm;
+
+ VclPtr<VclBox> m_pBxType;
+ VclPtr<ListBox> m_pLB_AxisType;
+
+ VclPtr<VclGrid> m_pBxMinMax;
+ VclPtr<FormattedField> m_pFmtFldMin;
+ VclPtr<CheckBox> m_pCbxAutoMin;
+
+ VclPtr<FormattedField> m_pFmtFldMax;
+ VclPtr<CheckBox> m_pCbxAutoMax;
+
+ VclPtr<VclBox> m_pBxResolution;
+ VclPtr<ListBox> m_pLB_TimeResolution;
+ VclPtr<CheckBox> m_pCbx_AutoTimeResolution;
+
+ VclPtr<FixedText> m_pTxtMain;
+ VclPtr<FormattedField> m_pFmtFldStepMain;
+ VclPtr<MetricField> m_pMt_MainDateStep;
+ VclPtr<ListBox> m_pLB_MainTimeUnit;
+ VclPtr<CheckBox> m_pCbxAutoStepMain;
+
+ VclPtr<FixedText> m_pTxtHelpCount;
+ VclPtr<FixedText> m_pTxtHelp;
+ VclPtr<MetricField> m_pMtStepHelp;
+ VclPtr<ListBox> m_pLB_HelpTimeUnit;
+ VclPtr<CheckBox> m_pCbxAutoStepHelp;
+
+ VclPtr<FormattedField> m_pFmtFldOrigin;
+ VclPtr<CheckBox> m_pCbxAutoOrigin;
+ VclPtr<VclBox> m_pBxOrigin;
double fMin;
double fMax;
diff --git a/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx b/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
index 826eec3b08c8..e6d372178752 100644
--- a/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
+++ b/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
@@ -65,6 +65,26 @@ SchOptionTabPage::SchOptionTabPage(vcl::Window* pWindow,const SfxItemSet& rInAtt
SchOptionTabPage::~SchOptionTabPage()
{
+ disposeOnce();
+}
+
+void SchOptionTabPage::dispose()
+{
+ m_pGrpAxis.clear();
+ m_pRbtAxis1.clear();
+ m_pRbtAxis2.clear();
+ m_pGrpBar.clear();
+ m_pMTGap.clear();
+ m_pMTOverlap.clear();
+ m_pCBConnect.clear();
+ m_pCBAxisSideBySide.clear();
+ m_pGrpPlotOptions.clear();
+ m_pGridPlotOptions.clear();
+ m_pRB_DontPaint.clear();
+ m_pRB_AssumeZero.clear();
+ m_pRB_ContinueLine.clear();
+ m_pCBIncludeHiddenCells.clear();
+ SfxTabPage::dispose();
}
IMPL_LINK_NOARG(SchOptionTabPage, EnableHdl)
@@ -77,9 +97,10 @@ IMPL_LINK_NOARG(SchOptionTabPage, EnableHdl)
return 0;
}
-SfxTabPage* SchOptionTabPage::Create(vcl::Window* pWindow,const SfxItemSet* rOutAttrs)
+VclPtr<SfxTabPage> SchOptionTabPage::Create(vcl::Window* pWindow,
+ const SfxItemSet* rOutAttrs)
{
- return new SchOptionTabPage(pWindow, *rOutAttrs);
+ return VclPtr<SchOptionTabPage>::Create(pWindow, *rOutAttrs);
}
bool SchOptionTabPage::FillItemSet(SfxItemSet* rOutAttrs)
diff --git a/chart2/source/controller/dialogs/tp_SeriesToAxis.hxx b/chart2/source/controller/dialogs/tp_SeriesToAxis.hxx
index ff81b28b59c5..1d0b2e3f1bdb 100644
--- a/chart2/source/controller/dialogs/tp_SeriesToAxis.hxx
+++ b/chart2/source/controller/dialogs/tp_SeriesToAxis.hxx
@@ -32,8 +32,9 @@ class SchOptionTabPage : public SfxTabPage
public:
SchOptionTabPage(vcl::Window* pParent, const SfxItemSet& rInAttrs);
virtual ~SchOptionTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rInAttrs);
+ static VclPtr<SfxTabPage> Create(vcl::Window* pParent, const SfxItemSet* rInAttrs);
virtual bool FillItemSet(SfxItemSet* rOutAttrs) SAL_OVERRIDE;
virtual void Reset(const SfxItemSet* rInAttrs) SAL_OVERRIDE;
@@ -43,23 +44,23 @@ private: //methods
void AdaptControlPositionsAndVisibility();
private: //member
- VclFrame* m_pGrpAxis;
- RadioButton* m_pRbtAxis1;
- RadioButton* m_pRbtAxis2;
-
- VclFrame* m_pGrpBar;
- MetricField* m_pMTGap;
- MetricField* m_pMTOverlap;
- CheckBox* m_pCBConnect;
- CheckBox* m_pCBAxisSideBySide;
-
- VclFrame* m_pGrpPlotOptions;
- VclGrid* m_pGridPlotOptions;
- RadioButton* m_pRB_DontPaint;
- RadioButton* m_pRB_AssumeZero;
- RadioButton* m_pRB_ContinueLine;
-
- CheckBox* m_pCBIncludeHiddenCells;
+ VclPtr<VclFrame> m_pGrpAxis;
+ VclPtr<RadioButton> m_pRbtAxis1;
+ VclPtr<RadioButton> m_pRbtAxis2;
+
+ VclPtr<VclFrame> m_pGrpBar;
+ VclPtr<MetricField> m_pMTGap;
+ VclPtr<MetricField> m_pMTOverlap;
+ VclPtr<CheckBox> m_pCBConnect;
+ VclPtr<CheckBox> m_pCBAxisSideBySide;
+
+ VclPtr<VclGrid> m_pGrpPlotOptions;
+ VclPtr<VclGrid> m_pGridPlotOptions;
+ VclPtr<RadioButton> m_pRB_DontPaint;
+ VclPtr<RadioButton> m_pRB_AssumeZero;
+ VclPtr<RadioButton> m_pRB_ContinueLine;
+
+ VclPtr<CheckBox> m_pCBIncludeHiddenCells;
DECL_LINK(EnableHdl, void * );
diff --git a/chart2/source/controller/dialogs/tp_TitleRotation.cxx b/chart2/source/controller/dialogs/tp_TitleRotation.cxx
index 32004557fdf8..25fa53dde0b8 100644
--- a/chart2/source/controller/dialogs/tp_TitleRotation.cxx
+++ b/chart2/source/controller/dialogs/tp_TitleRotation.cxx
@@ -57,19 +57,33 @@ SchAlignmentTabPage::SchAlignmentTabPage(vcl::Window* pWindow,
SchAlignmentTabPage::~SchAlignmentTabPage()
{
+ disposeOnce();
+}
+
+void SchAlignmentTabPage::dispose()
+{
delete m_pOrientHlp;
+ m_pOrientHlp = NULL;
+ m_pCtrlDial.clear();
+ m_pFtRotate.clear();
+ m_pNfRotate.clear();
+ m_pCbStacked.clear();
+ m_pFtTextDirection.clear();
+ m_pLbTextDirection.clear();
+ m_pFtABCD.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* SchAlignmentTabPage::Create(vcl::Window* pParent,
- const SfxItemSet* rInAttrs)
+VclPtr<SfxTabPage> SchAlignmentTabPage::Create(vcl::Window* pParent,
+ const SfxItemSet* rInAttrs)
{
- return new SchAlignmentTabPage(pParent, *rInAttrs);
+ return VclPtr<SchAlignmentTabPage>::Create(pParent, *rInAttrs);
}
-SfxTabPage* SchAlignmentTabPage::CreateWithoutRotation(vcl::Window* pParent,
- const SfxItemSet* rInAttrs)
+VclPtr<SfxTabPage> SchAlignmentTabPage::CreateWithoutRotation(vcl::Window* pParent,
+ const SfxItemSet* rInAttrs)
{
- return new SchAlignmentTabPage(pParent, *rInAttrs, false);
+ return VclPtr<SchAlignmentTabPage>::Create(pParent, *rInAttrs, false);
}
bool SchAlignmentTabPage::FillItemSet(SfxItemSet* rOutAttrs)
diff --git a/chart2/source/controller/dialogs/tp_TitleRotation.hxx b/chart2/source/controller/dialogs/tp_TitleRotation.hxx
index 0bd5c976b4e3..c7a20a2f90f7 100644
--- a/chart2/source/controller/dialogs/tp_TitleRotation.hxx
+++ b/chart2/source/controller/dialogs/tp_TitleRotation.hxx
@@ -31,21 +31,22 @@ namespace chart
class SchAlignmentTabPage : public SfxTabPage
{
private:
- svx::DialControl* m_pCtrlDial;
- FixedText* m_pFtRotate;
- NumericField* m_pNfRotate;
- TriStateBox* m_pCbStacked;
+ VclPtr<svx::DialControl> m_pCtrlDial;
+ VclPtr<FixedText> m_pFtRotate;
+ VclPtr<NumericField> m_pNfRotate;
+ VclPtr<TriStateBox> m_pCbStacked;
svx::OrientationHelper* m_pOrientHlp;
- FixedText* m_pFtTextDirection;
- TextDirectionListBox* m_pLbTextDirection;
- FixedText* m_pFtABCD;
+ VclPtr<FixedText> m_pFtTextDirection;
+ VclPtr<TextDirectionListBox> m_pLbTextDirection;
+ VclPtr<FixedText> m_pFtABCD;
public:
SchAlignmentTabPage(vcl::Window* pParent, const SfxItemSet& rInAttrs, bool bWithRotation = true);
virtual ~SchAlignmentTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rInAttrs);
- static SfxTabPage* CreateWithoutRotation(vcl::Window* pParent, const SfxItemSet* rInAttrs);
+ static VclPtr<SfxTabPage> Create(vcl::Window* pParent, const SfxItemSet* rInAttrs);
+ static VclPtr<SfxTabPage> CreateWithoutRotation(vcl::Window* pParent, const SfxItemSet* rInAttrs);
virtual bool FillItemSet(SfxItemSet* rOutAttrs) SAL_OVERRIDE;
virtual void Reset(const SfxItemSet* rInAttrs) SAL_OVERRIDE;
};
diff --git a/chart2/source/controller/dialogs/tp_Trendline.cxx b/chart2/source/controller/dialogs/tp_Trendline.cxx
index a998056f8edf..34939d4a0d15 100644
--- a/chart2/source/controller/dialogs/tp_Trendline.cxx
+++ b/chart2/source/controller/dialogs/tp_Trendline.cxx
@@ -31,14 +31,10 @@ TrendlineTabPage::TrendlineTabPage( vcl::Window* pParent, const SfxItemSet& rInA
{
}
-TrendlineTabPage::~TrendlineTabPage()
-{
-}
-
-SfxTabPage* TrendlineTabPage::Create(
+VclPtr<SfxTabPage> TrendlineTabPage::Create(
vcl::Window* pParent, const SfxItemSet* rOutAttrs )
{
- return new TrendlineTabPage( pParent, *rOutAttrs );
+ return VclPtr<TrendlineTabPage>::Create( pParent, *rOutAttrs );
}
bool TrendlineTabPage::FillItemSet( SfxItemSet* rOutAttrs )
diff --git a/chart2/source/controller/dialogs/tp_Trendline.hxx b/chart2/source/controller/dialogs/tp_Trendline.hxx
index a88c858c7b9a..bdd9848e6028 100644
--- a/chart2/source/controller/dialogs/tp_Trendline.hxx
+++ b/chart2/source/controller/dialogs/tp_Trendline.hxx
@@ -30,9 +30,8 @@ class TrendlineTabPage : public SfxTabPage
{
public:
TrendlineTabPage ( vcl::Window* pParent, const SfxItemSet& rInAttrs );
- virtual ~TrendlineTabPage ();
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rInAttrs );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rInAttrs );
virtual bool FillItemSet( SfxItemSet* rOutAttrs ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rInAttrs ) SAL_OVERRIDE;
diff --git a/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx b/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx
index 90088b0b66ae..8c40e6d43512 100644
--- a/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx
+++ b/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx
@@ -57,6 +57,19 @@ TitlesAndObjectsTabPage::TitlesAndObjectsTabPage( svt::OWizardMachine* pParent
m_pCB_Grid_Z->SetToggleHdl( LINK( this, TitlesAndObjectsTabPage, ChangeHdl ));
}
+TitlesAndObjectsTabPage::~TitlesAndObjectsTabPage()
+{
+ disposeOnce();
+}
+
+void TitlesAndObjectsTabPage::dispose()
+{
+ m_pCB_Grid_X.clear();
+ m_pCB_Grid_Y.clear();
+ m_pCB_Grid_Z.clear();
+ OWizardPage::dispose();
+}
+
void TitlesAndObjectsTabPage::initializePage()
{
m_bCommitToModel = false;
diff --git a/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.hxx b/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.hxx
index 26e2cb2aebae..520453ce0452 100644
--- a/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.hxx
+++ b/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.hxx
@@ -44,6 +44,8 @@ public:
::com::sun::star::chart2::XChartDocument >& xChartModel
, const ::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext >& xContext );
+ virtual ~TitlesAndObjectsTabPage();
+ virtual void dispose() SAL_OVERRIDE;
virtual void initializePage() SAL_OVERRIDE;
virtual bool commitPage( ::svt::WizardTypes::CommitPageReason eReason ) SAL_OVERRIDE;
@@ -57,9 +59,9 @@ protected:
boost::scoped_ptr< TitleResources > m_xTitleResources;
boost::scoped_ptr< LegendPositionResources > m_xLegendPositionResources;
- CheckBox* m_pCB_Grid_X;
- CheckBox* m_pCB_Grid_Y;
- CheckBox* m_pCB_Grid_Z;
+ VclPtr<CheckBox> m_pCB_Grid_X;
+ VclPtr<CheckBox> m_pCB_Grid_Y;
+ VclPtr<CheckBox> m_pCB_Grid_Z;
::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartDocument > m_xChartModel;
diff --git a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
index f304034e85c6..9f60c63bb405 100644
--- a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
+++ b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
@@ -143,14 +143,14 @@ Graphic ViewElementListProvider::GetSymbolGraphic( sal_Int32 nStandardSymbol, co
nStandardSymbol %= pSymbolList->GetObjCount();
SdrObject* pObj = pSymbolList->GetObj(nStandardSymbol);
- VirtualDevice aVDev;
- aVDev.SetMapMode(MapMode(MAP_100TH_MM));
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
+ pVDev->SetMapMode(MapMode(MAP_100TH_MM));
SdrModel* pModel = new SdrModel();
pModel->GetItemPool().FreezeIdRanges();
SdrPage* pPage = new SdrPage( *pModel, false );
pPage->SetSize(Size(1000,1000));
pModel->InsertPage( pPage, 0 );
- SdrView* pView = new SdrView( pModel, &aVDev );
+ SdrView* pView = new SdrView( pModel, pVDev );
pView->hideMarkHandles();
SdrPageView* pPageView = pView->ShowSdrPage(pPage);
diff --git a/chart2/source/controller/inc/TextDirectionListBox.hxx b/chart2/source/controller/inc/TextDirectionListBox.hxx
index bee03f2fb247..706043034916 100644
--- a/chart2/source/controller/inc/TextDirectionListBox.hxx
+++ b/chart2/source/controller/inc/TextDirectionListBox.hxx
@@ -32,7 +32,6 @@ class TextDirectionListBox : public svx::FrameDirectionListBox
public:
explicit TextDirectionListBox( vcl::Window* pParent,
vcl::Window* pWindow1 = 0, vcl::Window* pWindow2 = 0 );
- virtual ~TextDirectionListBox();
};
} //namespace chart
diff --git a/chart2/source/controller/inc/dlg_ChartType.hxx b/chart2/source/controller/inc/dlg_ChartType.hxx
index b67a06fd729b..d8fecf56782e 100644
--- a/chart2/source/controller/inc/dlg_ChartType.hxx
+++ b/chart2/source/controller/inc/dlg_ChartType.hxx
@@ -38,9 +38,10 @@ public:
, const ::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext >& xContext );
virtual ~ChartTypeDialog();
+ virtual void dispose() SAL_OVERRIDE;
private:
- ChartTypeTabPage* m_pChartTypeTabPage;
+ VclPtr<ChartTypeTabPage> m_pChartTypeTabPage;
::com::sun::star::uno::Reference<
::com::sun::star::frame::XModel > m_xChartModel;
diff --git a/chart2/source/controller/inc/dlg_ChartType_UNO.hxx b/chart2/source/controller/inc/dlg_ChartType_UNO.hxx
index 6bf4e0f2851a..524a87c4e32e 100644
--- a/chart2/source/controller/inc/dlg_ChartType_UNO.hxx
+++ b/chart2/source/controller/inc/dlg_ChartType_UNO.hxx
@@ -44,7 +44,7 @@ private:
// OGenericUnoDialog overridables
virtual void implInitialize(const com::sun::star::uno::Any& _rValue) SAL_OVERRIDE;
- virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
+ virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
// XTypeProvider
virtual com::sun::star::uno::Sequence<sal_Int8> SAL_CALL getImplementationId( ) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
diff --git a/chart2/source/controller/inc/dlg_CreationWizard.hxx b/chart2/source/controller/inc/dlg_CreationWizard.hxx
index 95d47fd4c5ae..152fc8485751 100644
--- a/chart2/source/controller/inc/dlg_CreationWizard.hxx
+++ b/chart2/source/controller/inc/dlg_CreationWizard.hxx
@@ -22,6 +22,7 @@
#include "TimerTriggeredControllerLock.hxx"
#include "TabPageNotifiable.hxx"
+#include "../dialogs/DialogModel.hxx"
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <svtools/roadmapwizard.hxx>
@@ -36,7 +37,6 @@ namespace chart
class RangeChooserTabPage;
class DataSourceTabPage;
class ChartTypeTemplateProvider;
-class DialogModel;
class CreationWizard : public svt::RoadmapWizard, public TabPageNotifiable
{
@@ -47,7 +47,6 @@ public:
, const ::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext >& xContext
, sal_Int32 nOnePageOnlyIndex=-1 );//if nOnePageOnlyIndex is an index of an exsisting page starting with 0, then only this page is displayed without next/previous and roadmap
- virtual ~CreationWizard();
bool isClosable() { /*@todo*/ return m_bIsClosable;}
@@ -66,7 +65,7 @@ private:
//no default constructor
CreationWizard();
- virtual svt::OWizardPage* createPage(WizardState nState) SAL_OVERRIDE;
+ virtual VclPtr<TabPage> createPage(WizardState nState) SAL_OVERRIDE;
::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartDocument > m_xChartModel;
diff --git a/chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx b/chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx
index ce4f638dd442..a71d86aaf3ac 100644
--- a/chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx
+++ b/chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx
@@ -119,7 +119,7 @@ private:
com::sun::star::uno::Reference<
com::sun::star::awt::XWindow > m_xParentWindow;
- CreationWizard* m_pDialog;
+ VclPtr<CreationWizard> m_pDialog;
bool m_bUnlockControllersOnExecute;
};
diff --git a/chart2/source/controller/inc/dlg_DataEditor.hxx b/chart2/source/controller/inc/dlg_DataEditor.hxx
index 76d67301894e..f37b16cfc956 100644
--- a/chart2/source/controller/inc/dlg_DataEditor.hxx
+++ b/chart2/source/controller/inc/dlg_DataEditor.hxx
@@ -48,6 +48,7 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext > & xContext );
virtual ~DataEditor();
+ virtual void dispose() SAL_OVERRIDE;
// Dialog
virtual bool Close() SAL_OVERRIDE;
@@ -65,8 +66,8 @@ private:
sal_uInt16 TBI_DATA_SWAP_ROW;
bool m_bReadOnly;
- boost::scoped_ptr<DataBrowser> m_xBrwData;
- ToolBox* m_pTbxData;
+ VclPtr<DataBrowser> m_xBrwData;
+ VclPtr<ToolBox> m_pTbxData;
::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartDocument > m_xChartDoc;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
diff --git a/chart2/source/controller/inc/dlg_DataSource.hxx b/chart2/source/controller/inc/dlg_DataSource.hxx
index 8b3529b9d9e1..bc3d22da9c8b 100644
--- a/chart2/source/controller/inc/dlg_DataSource.hxx
+++ b/chart2/source/controller/inc/dlg_DataSource.hxx
@@ -50,6 +50,7 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext > & xContext );
virtual ~DataSourceDialog();
+ virtual void dispose() SAL_OVERRIDE;
// from Dialog (base of TabDialog)
virtual short Execute() SAL_OVERRIDE;
@@ -67,11 +68,11 @@ protected:
::std::unique_ptr< DialogModel > m_apDialogModel;
private:
- DataSourceTabControl* m_pTabControl;
- OKButton* m_pBtnOK;
+ VclPtr<DataSourceTabControl> m_pTabControl;
+ VclPtr<OKButton> m_pBtnOK;
- RangeChooserTabPage * m_pRangeChooserTabePage;
- DataSourceTabPage * m_pDataSourceTabPage;
+ VclPtr<RangeChooserTabPage> m_pRangeChooserTabePage;
+ VclPtr<DataSourceTabPage> m_pDataSourceTabPage;
bool m_bRangeChooserTabIsValid;
bool m_bDataSourceTabIsValid;
diff --git a/chart2/source/controller/inc/dlg_InsertAxis_Grid.hxx b/chart2/source/controller/inc/dlg_InsertAxis_Grid.hxx
index bf3bf85750e7..1ec0829f4eac 100644
--- a/chart2/source/controller/inc/dlg_InsertAxis_Grid.hxx
+++ b/chart2/source/controller/inc/dlg_InsertAxis_Grid.hxx
@@ -43,16 +43,17 @@ struct InsertAxisOrGridDialogData
class SchAxisDlg : public ModalDialog
{
protected:
- CheckBox* m_pCbPrimaryX;
- CheckBox* m_pCbPrimaryY;
- CheckBox* m_pCbPrimaryZ;
- CheckBox* m_pCbSecondaryX;
- CheckBox* m_pCbSecondaryY;
- CheckBox* m_pCbSecondaryZ;
+ VclPtr<CheckBox> m_pCbPrimaryX;
+ VclPtr<CheckBox> m_pCbPrimaryY;
+ VclPtr<CheckBox> m_pCbPrimaryZ;
+ VclPtr<CheckBox> m_pCbSecondaryX;
+ VclPtr<CheckBox> m_pCbSecondaryY;
+ VclPtr<CheckBox> m_pCbSecondaryZ;
public:
SchAxisDlg(vcl::Window* pParent, const InsertAxisOrGridDialogData& rInput, bool bAxisDlg=true);
virtual ~SchAxisDlg();
+ virtual void dispose() SAL_OVERRIDE;
void getResult( InsertAxisOrGridDialogData& rOutput );
};
@@ -66,7 +67,6 @@ class SchGridDlg : public SchAxisDlg
{
public:
SchGridDlg( vcl::Window* pParent, const InsertAxisOrGridDialogData& rInput );
- virtual ~SchGridDlg();
};
} //namespace chart
diff --git a/chart2/source/controller/inc/dlg_InsertDataLabel.hxx b/chart2/source/controller/inc/dlg_InsertDataLabel.hxx
index 1cbed9f9a9c0..fd269c525d13 100644
--- a/chart2/source/controller/inc/dlg_InsertDataLabel.hxx
+++ b/chart2/source/controller/inc/dlg_InsertDataLabel.hxx
@@ -23,13 +23,13 @@
#include <vcl/button.hxx>
#include <svl/itemset.hxx>
#include <boost/scoped_ptr.hpp>
+#include "../dialogs/res_DataLabel.hxx"
class SvNumberFormatter;
namespace chart
{
-class DataLabelResources;
class DataLabelsDialog : public ModalDialog
{
private:
@@ -44,7 +44,6 @@ private:
public:
DataLabelsDialog(vcl::Window* pParent, const SfxItemSet& rInAttrs, SvNumberFormatter* pFormatter);
- virtual ~DataLabelsDialog();
void FillItemSet(SfxItemSet& rOutAttrs);
};
diff --git a/chart2/source/controller/inc/dlg_InsertErrorBars.hxx b/chart2/source/controller/inc/dlg_InsertErrorBars.hxx
index e981b718ec63..ae45a16941f5 100644
--- a/chart2/source/controller/inc/dlg_InsertErrorBars.hxx
+++ b/chart2/source/controller/inc/dlg_InsertErrorBars.hxx
@@ -36,7 +36,6 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartDocument > & xChartDocument,
ErrorBarResources::tErrorBarType eType );
- virtual ~InsertErrorBarsDialog();
void SetAxisMinorStepWidthForErrorBarDecimals( double fMinorStepWidth );
diff --git a/chart2/source/controller/inc/dlg_ObjectProperties.hxx b/chart2/source/controller/inc/dlg_ObjectProperties.hxx
index 19b1bf2539c2..8ad9fc95525d 100644
--- a/chart2/source/controller/inc/dlg_ObjectProperties.hxx
+++ b/chart2/source/controller/inc/dlg_ObjectProperties.hxx
@@ -132,6 +132,7 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
virtual ~SchAttribTabDlg();
+ virtual void dispose() SAL_OVERRIDE;
//pSymbolShapeProperties: Properties to be set on the symbollist shapes
//pAutoSymbolGraphic: Graphic to be shown if AutoSymbol gets selected
diff --git a/chart2/source/controller/inc/dlg_View3D.hxx b/chart2/source/controller/inc/dlg_View3D.hxx
index fdfb35463625..0ef93e8d1fea 100644
--- a/chart2/source/controller/inc/dlg_View3D.hxx
+++ b/chart2/source/controller/inc/dlg_View3D.hxx
@@ -41,16 +41,17 @@ public:
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & xChartModel,
const XColorListRef &pColorTable );
virtual ~View3DDialog();
+ virtual void dispose() SAL_OVERRIDE;
// from Dialog (base of TabDialog)
virtual short Execute() SAL_OVERRIDE;
private:
- TabControl* m_pTabControl;
+ VclPtr<TabControl> m_pTabControl;
- ThreeD_SceneGeometry_TabPage* m_pGeometry;
- ThreeD_SceneAppearance_TabPage* m_pAppearance;
- ThreeD_SceneIllumination_TabPage* m_pIllumination;
+ VclPtr<ThreeD_SceneGeometry_TabPage> m_pGeometry;
+ VclPtr<ThreeD_SceneAppearance_TabPage> m_pAppearance;
+ VclPtr<ThreeD_SceneIllumination_TabPage> m_pIllumination;
ControllerLockHelper m_aControllerLocker;
diff --git a/chart2/source/controller/inc/res_ErrorBar.hxx b/chart2/source/controller/inc/res_ErrorBar.hxx
index 0ad485c39990..85917809db48 100644
--- a/chart2/source/controller/inc/res_ErrorBar.hxx
+++ b/chart2/source/controller/inc/res_ErrorBar.hxx
@@ -67,36 +67,36 @@ public:
private:
// category
- RadioButton* m_pRbNone;
- RadioButton* m_pRbConst;
- RadioButton* m_pRbPercent;
- RadioButton* m_pRbFunction;
- RadioButton* m_pRbRange;
- ListBox* m_pLbFunction;
+ VclPtr<RadioButton> m_pRbNone;
+ VclPtr<RadioButton> m_pRbConst;
+ VclPtr<RadioButton> m_pRbPercent;
+ VclPtr<RadioButton> m_pRbFunction;
+ VclPtr<RadioButton> m_pRbRange;
+ VclPtr<ListBox> m_pLbFunction;
// parameters
- VclFrame* m_pFlParameters;
- VclBox* m_pBxPositive;
- MetricField* m_pMfPositive;
- Edit* m_pEdRangePositive;
- PushButton* m_pIbRangePositive;
- VclBox* m_pBxNegative;
- MetricField* m_pMfNegative;
- Edit* m_pEdRangeNegative;
- PushButton* m_pIbRangeNegative;
- CheckBox* m_pCbSyncPosNeg;
+ VclPtr<VclFrame> m_pFlParameters;
+ VclPtr<VclBox> m_pBxPositive;
+ VclPtr<MetricField> m_pMfPositive;
+ VclPtr<Edit> m_pEdRangePositive;
+ VclPtr<PushButton> m_pIbRangePositive;
+ VclPtr<VclBox> m_pBxNegative;
+ VclPtr<MetricField> m_pMfNegative;
+ VclPtr<Edit> m_pEdRangeNegative;
+ VclPtr<PushButton> m_pIbRangeNegative;
+ VclPtr<CheckBox> m_pCbSyncPosNeg;
// indicator
- RadioButton* m_pRbBoth;
- RadioButton* m_pRbPositive;
- RadioButton* m_pRbNegative;
- FixedImage* m_pFiBoth;
- FixedImage* m_pFiPositive;
- FixedImage* m_pFiNegative;
+ VclPtr<RadioButton> m_pRbBoth;
+ VclPtr<RadioButton> m_pRbPositive;
+ VclPtr<RadioButton> m_pRbNegative;
+ VclPtr<FixedImage> m_pFiBoth;
+ VclPtr<FixedImage> m_pFiPositive;
+ VclPtr<FixedImage> m_pFiNegative;
- FixedText* m_pUIStringPos;
- FixedText* m_pUIStringNeg;
- FixedText* m_pUIStringRbRange;
+ VclPtr<FixedText> m_pUIStringPos;
+ VclPtr<FixedText> m_pUIStringNeg;
+ VclPtr<FixedText> m_pUIStringRbRange;
SvxChartKindError m_eErrorKind;
SvxChartIndicate m_eIndicate;
@@ -116,9 +116,9 @@ private:
double m_fPlusValue;
double m_fMinusValue;
- Dialog * m_pParentDialog;
+ VclPtr<Dialog> m_pParentDialog;
boost::scoped_ptr< RangeSelectionHelper > m_apRangeSelectionHelper;
- Edit * m_pCurrentRangeChoosingField;
+ VclPtr<Edit> m_pCurrentRangeChoosingField;
bool m_bHasInternalDataProvider;
bool m_bEnableDataTableDialog;
diff --git a/chart2/source/controller/inc/res_LegendPosition.hxx b/chart2/source/controller/inc/res_LegendPosition.hxx
index c8292db200af..7801895a6308 100644
--- a/chart2/source/controller/inc/res_LegendPosition.hxx
+++ b/chart2/source/controller/inc/res_LegendPosition.hxx
@@ -60,12 +60,12 @@ private:
::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext> m_xCC;
- CheckBox* m_pCbxShow;
+ VclPtr<CheckBox> m_pCbxShow;
- RadioButton* m_pRbtLeft;
- RadioButton* m_pRbtRight;
- RadioButton* m_pRbtTop;
- RadioButton* m_pRbtBottom;
+ VclPtr<RadioButton> m_pRbtLeft;
+ VclPtr<RadioButton> m_pRbtRight;
+ VclPtr<RadioButton> m_pRbtTop;
+ VclPtr<RadioButton> m_pRbtBottom;
Link m_aChangeLink;
};
diff --git a/chart2/source/controller/inc/res_Titles.hxx b/chart2/source/controller/inc/res_Titles.hxx
index 1e4e8c67cd91..396c87af598f 100644
--- a/chart2/source/controller/inc/res_Titles.hxx
+++ b/chart2/source/controller/inc/res_Titles.hxx
@@ -40,22 +40,22 @@ public:
void ClearModifyFlag();
private:
- FixedText* m_pFT_Main;
- FixedText* m_pFT_Sub;
- Edit* m_pEd_Main;
- Edit* m_pEd_Sub;
+ VclPtr<FixedText> m_pFT_Main;
+ VclPtr<FixedText> m_pFT_Sub;
+ VclPtr<Edit> m_pEd_Main;
+ VclPtr<Edit> m_pEd_Sub;
- FixedText* m_pFT_XAxis;
- FixedText* m_pFT_YAxis;
- FixedText* m_pFT_ZAxis;
- Edit* m_pEd_XAxis;
- Edit* m_pEd_YAxis;
- Edit* m_pEd_ZAxis;
+ VclPtr<FixedText> m_pFT_XAxis;
+ VclPtr<FixedText> m_pFT_YAxis;
+ VclPtr<FixedText> m_pFT_ZAxis;
+ VclPtr<Edit> m_pEd_XAxis;
+ VclPtr<Edit> m_pEd_YAxis;
+ VclPtr<Edit> m_pEd_ZAxis;
- FixedText* m_pFT_SecondaryXAxis;
- FixedText* m_pFT_SecondaryYAxis;
- Edit* m_pEd_SecondaryXAxis;
- Edit* m_pEd_SecondaryYAxis;
+ VclPtr<FixedText> m_pFT_SecondaryXAxis;
+ VclPtr<FixedText> m_pFT_SecondaryYAxis;
+ VclPtr<Edit> m_pEd_SecondaryXAxis;
+ VclPtr<Edit> m_pEd_SecondaryYAxis;
};
} //namespace chart
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index fca17f15983c..40e6cacdfe8d 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -388,7 +388,7 @@ void SAL_CALL ChartController::attachFrame(
{
// calls to VCL
SolarMutexGuard aSolarGuard;
- m_pChartWindow = new ChartWindow(this,pParent,pParent?pParent->GetStyle():0);
+ m_pChartWindow = VclPtr<ChartWindow>::Create(this,pParent,pParent?pParent->GetStyle():0);
m_pChartWindow->SetBackground();//no Background
m_xViewWindow = uno::Reference< awt::XWindow >( m_pChartWindow->GetComponentInterface(), uno::UNO_QUERY );
m_pChartWindow->Show();
@@ -1271,8 +1271,8 @@ void ChartController::executeDispatch_ChartType()
SolarMutexGuard aSolarGuard;
//prepare and open dialog
- ChartTypeDialog aDlg( m_pChartWindow, getModel(), m_xCC );
- if( aDlg.Execute() == RET_OK )
+ ScopedVclPtrInstance< ChartTypeDialog > aDlg( m_pChartWindow, getModel(), m_xCC );
+ if( aDlg->Execute() == RET_OK )
{
impl_adaptDataSeriesAutoResize();
aUndoGuard.commit();
@@ -1292,8 +1292,8 @@ void ChartController::executeDispatch_SourceData()
if( xChartDoc.is())
{
SolarMutexGuard aSolarGuard;
- ::chart::DataSourceDialog aDlg( m_pChartWindow, xChartDoc, m_xCC );
- if( aDlg.Execute() == RET_OK )
+ ScopedVclPtrInstance< ::chart::DataSourceDialog > aDlg( m_pChartWindow, xChartDoc, m_xCC );
+ if( aDlg->Execute() == RET_OK )
{
impl_adaptDataSeriesAutoResize();
aUndoGuard.commit();
diff --git a/chart2/source/controller/main/ChartController.hxx b/chart2/source/controller/main/ChartController.hxx
index c447af4e1874..f5c73bff7459 100644
--- a/chart2/source/controller/main/ChartController.hxx
+++ b/chart2/source/controller/main/ChartController.hxx
@@ -508,7 +508,7 @@ private:
TheModelRef m_aModel;
//view
- ChartWindow* m_pChartWindow;
+ VclPtr<ChartWindow> m_pChartWindow;
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xViewWindow;
::com::sun::star::uno::Reference<
::com::sun::star::uno::XInterface > m_xChartView;
diff --git a/chart2/source/controller/main/ChartController_EditData.cxx b/chart2/source/controller/main/ChartController_EditData.cxx
index 9cba950495b9..6f6b9c1c5597 100644
--- a/chart2/source/controller/main/ChartController_EditData.cxx
+++ b/chart2/source/controller/main/ChartController_EditData.cxx
@@ -54,10 +54,9 @@ void ChartController::executeDispatch_EditData()
UndoLiveUpdateGuardWithData aUndoGuard = UndoLiveUpdateGuardWithData(
SCH_RESSTR( STR_ACTION_EDIT_CHART_DATA ),
m_xUndoManager );
- vcl::Window* pParent( NULL );
- DataEditor aDataEditorDialog( pParent, xChartDoc, m_xCC );
- if (aDataEditorDialog.Execute() == RET_OK)
- aDataEditorDialog.ApplyChangesToModel();
+ ScopedVclPtrInstance<DataEditor> aDataEditorDialog( nullptr, xChartDoc, m_xCC );
+ if (aDataEditorDialog->Execute() == RET_OK)
+ aDataEditorDialog->ApplyChangesToModel();
aUndoGuard.commit();
}
}
diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx
index 7c83ecc569fc..e194016abd17 100644
--- a/chart2/source/controller/main/ChartController_Insert.cxx
+++ b/chart2/source/controller/main/ChartController_Insert.cxx
@@ -109,14 +109,14 @@ void ChartController::executeDispatch_InsertAxes()
AxisHelper::getAxisOrGridPossibilities( aDialogInput.aPossibilityList, xDiagram, true );
SolarMutexGuard aGuard;
- SchAxisDlg aDlg( m_pChartWindow, aDialogInput );
- if( aDlg.Execute() == RET_OK )
+ ScopedVclPtrInstance<SchAxisDlg> aDlg( m_pChartWindow, aDialogInput );
+ if( aDlg->Execute() == RET_OK )
{
// lock controllers till end of block
ControllerLockGuardUNO aCLGuard( getModel() );
InsertAxisOrGridDialogData aDialogOutput;
- aDlg.getResult( aDialogOutput );
+ aDlg->getResult( aDialogOutput );
boost::scoped_ptr< ReferenceSizeProvider > mpRefSizeProvider(
impl_createReferenceSizeProvider());
bool bChanged = AxisHelper::changeVisibilityOfAxes( xDiagram
@@ -147,13 +147,13 @@ void ChartController::executeDispatch_InsertGrid()
AxisHelper::getAxisOrGridPossibilities( aDialogInput.aPossibilityList, xDiagram, false );
SolarMutexGuard aGuard;
- SchGridDlg aDlg( m_pChartWindow, aDialogInput );//aItemSet, b3D, bNet, bSecondaryX, bSecondaryY );
- if( aDlg.Execute() == RET_OK )
+ ScopedVclPtrInstance<SchGridDlg> aDlg(m_pChartWindow, aDialogInput);//aItemSet, b3D, bNet, bSecondaryX, bSecondaryY );
+ if( aDlg->Execute() == RET_OK )
{
// lock controllers till end of block
ControllerLockGuardUNO aCLGuard( getModel() );
InsertAxisOrGridDialogData aDialogOutput;
- aDlg.getResult( aDialogOutput );
+ aDlg->getResult( aDialogOutput );
bool bChanged = AxisHelper::changeVisibilityOfGrids( xDiagram
, aDialogInput.aExistenceList, aDialogOutput.aExistenceList, m_xCC );
if( bChanged )
@@ -179,13 +179,13 @@ void ChartController::executeDispatch_InsertTitles()
aDialogInput.readFromModel( getModel() );
SolarMutexGuard aGuard;
- SchTitleDlg aDlg( m_pChartWindow, aDialogInput );
- if( aDlg.Execute() == RET_OK )
+ ScopedVclPtrInstance< SchTitleDlg > aDlg( m_pChartWindow, aDialogInput );
+ if( aDlg->Execute() == RET_OK )
{
// lock controllers till end of block
ControllerLockGuardUNO aCLGuard( getModel() );
TitleDialogData aDialogOutput(impl_createReferenceSizeProvider());
- aDlg.getResult( aDialogOutput );
+ aDlg->getResult( aDialogOutput );
bool bChanged = aDialogOutput.writeDifferenceToModel( getModel(), m_xCC, &aDialogInput );
if( bChanged )
aUndoGuard.commit();
@@ -232,13 +232,13 @@ void ChartController::executeDispatch_OpenLegendDialog()
{
//prepare and open dialog
SolarMutexGuard aGuard;
- SchLegendDlg aDlg( m_pChartWindow, m_xCC );
- aDlg.init( getModel() );
- if( aDlg.Execute() == RET_OK )
+ ScopedVclPtrInstance< SchLegendDlg > aDlg( m_pChartWindow, m_xCC );
+ aDlg->init( getModel() );
+ if( aDlg->Execute() == RET_OK )
{
// lock controllers till end of block
ControllerLockGuardUNO aCLGuard( getModel() );
- bool bChanged = aDlg.writeToModel( getModel() );
+ bool bChanged = aDlg->writeToModel( getModel() );
if( bChanged )
aUndoGuard.commit();
}
@@ -292,12 +292,12 @@ void ChartController::executeDispatch_InsertMenu_DataLabels()
NumberFormatterWrapper aNumberFormatterWrapper( xNumberFormatsSupplier );
SvNumberFormatter* pNumberFormatter = aNumberFormatterWrapper.getSvNumberFormatter();
- DataLabelsDialog aDlg( m_pChartWindow, aItemSet, pNumberFormatter);
+ ScopedVclPtrInstance< DataLabelsDialog > aDlg( m_pChartWindow, aItemSet, pNumberFormatter);
- if( aDlg.Execute() == RET_OK )
+ if( aDlg->Execute() == RET_OK )
{
SfxItemSet aOutItemSet = aItemConverter.CreateEmptyItemSet();
- aDlg.FillItemSet( aOutItemSet );
+ aDlg->FillItemSet( aOutItemSet );
// lock controllers till end of block
ControllerLockGuardUNO aCLGuard( getModel() );
bool bChanged = aItemConverter.ApplyItemSet( aOutItemSet );//model should be changed now
@@ -397,14 +397,17 @@ void ChartController::executeDispatch_InsertTrendline()
aDialogParameter.init( getModel() );
ViewElementListProvider aViewElementListProvider( m_pDrawModelWrapper.get());
SolarMutexGuard aGuard;
- SchAttribTabDlg aDialog( m_pChartWindow, &aItemSet, &aDialogParameter, &aViewElementListProvider,
- uno::Reference< util::XNumberFormatsSupplier >( getModel(), uno::UNO_QUERY ));
+ ScopedVclPtrInstance<SchAttribTabDlg> aDialog(
+ m_pChartWindow, &aItemSet, &aDialogParameter,
+ &aViewElementListProvider,
+ uno::Reference< util::XNumberFormatsSupplier >(
+ getModel(), uno::UNO_QUERY ) );
// note: when a user pressed "OK" but didn't change any settings in the
// dialog, the SfxTabDialog returns "Cancel"
- if( aDialog.Execute() == RET_OK || aDialog.DialogWasClosedWithOK())
+ if( aDialog->Execute() == RET_OK || aDialog->DialogWasClosedWithOK())
{
- const SfxItemSet* pOutItemSet = aDialog.GetOutputItemSet();
+ const SfxItemSet* pOutItemSet = aDialog->GetOutputItemSet();
if( pOutItemSet )
{
ControllerLockGuardUNO aCLGuard( getModel() );
@@ -452,17 +455,20 @@ void ChartController::executeDispatch_InsertErrorBars( bool bYError )
aDialogParameter.init( getModel() );
ViewElementListProvider aViewElementListProvider( m_pDrawModelWrapper.get());
SolarMutexGuard aGuard;
- SchAttribTabDlg aDlg( m_pChartWindow, &aItemSet, &aDialogParameter, &aViewElementListProvider,
- uno::Reference< util::XNumberFormatsSupplier >( getModel(), uno::UNO_QUERY ));
- aDlg.SetAxisMinorStepWidthForErrorBarDecimals(
+ ScopedVclPtrInstance<SchAttribTabDlg> aDlg(
+ m_pChartWindow, &aItemSet, &aDialogParameter,
+ &aViewElementListProvider,
+ uno::Reference< util::XNumberFormatsSupplier >(
+ getModel(), uno::UNO_QUERY ) );
+ aDlg->SetAxisMinorStepWidthForErrorBarDecimals(
InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( getModel(),
m_xChartView, m_aSelection.getSelectedCID()));
// note: when a user pressed "OK" but didn't change any settings in the
// dialog, the SfxTabDialog returns "Cancel"
- if( aDlg.Execute() == RET_OK || aDlg.DialogWasClosedWithOK())
+ if( aDlg->Execute() == RET_OK || aDlg->DialogWasClosedWithOK())
{
- const SfxItemSet* pOutItemSet = aDlg.GetOutputItemSet();
+ const SfxItemSet* pOutItemSet = aDlg->GetOutputItemSet();
if( pOutItemSet )
{
ControllerLockGuardUNO aCLGuard( getModel() );
@@ -489,18 +495,18 @@ void ChartController::executeDispatch_InsertErrorBars( bool bYError )
//prepare and open dialog
SolarMutexGuard aGuard;
- InsertErrorBarsDialog aDlg(
+ ScopedVclPtrInstance<InsertErrorBarsDialog> aDlg(
m_pChartWindow, aItemSet,
uno::Reference< chart2::XChartDocument >( getModel(), uno::UNO_QUERY ),
bYError ? ErrorBarResources::ERROR_BAR_Y : ErrorBarResources::ERROR_BAR_X);
- aDlg.SetAxisMinorStepWidthForErrorBarDecimals(
+ aDlg->SetAxisMinorStepWidthForErrorBarDecimals(
InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( getModel(), m_xChartView, OUString() ) );
- if( aDlg.Execute() == RET_OK )
+ if( aDlg->Execute() == RET_OK )
{
SfxItemSet aOutItemSet = aItemConverter.CreateEmptyItemSet();
- aDlg.FillItemSet( aOutItemSet );
+ aDlg->FillItemSet( aOutItemSet );
// lock controllers till end of block
ControllerLockGuardUNO aCLGuard( getModel() );
diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx
index ca3dfa1c1d3b..4cc7a171d031 100644
--- a/chart2/source/controller/main/ChartController_Properties.cxx
+++ b/chart2/source/controller/main/ChartController_Properties.cxx
@@ -761,8 +761,11 @@ bool ChartController::executeDlg_ObjectProperties_withoutUndoGuard(
ViewElementListProvider aViewElementListProvider( m_pDrawModelWrapper.get() );
SolarMutexGuard aGuard;
- SchAttribTabDlg aDlg( m_pChartWindow, &aItemSet, &aDialogParameter, &aViewElementListProvider
- , uno::Reference< util::XNumberFormatsSupplier >( getModel(), uno::UNO_QUERY ) );
+ ScopedVclPtrInstance<SchAttribTabDlg> aDlg(
+ m_pChartWindow, &aItemSet, &aDialogParameter,
+ &aViewElementListProvider,
+ uno::Reference< util::XNumberFormatsSupplier >(
+ getModel(), uno::UNO_QUERY ) );
if(aDialogParameter.HasSymbolProperties())
{
@@ -782,18 +785,18 @@ bool ChartController::executeDlg_ObjectProperties_withoutUndoGuard(
sal_Int32 nStandardSymbol=0;//@todo get from somewhere
Graphic* pAutoSymbolGraphic = new Graphic( aViewElementListProvider.GetSymbolGraphic( nStandardSymbol, pSymbolShapeProperties ) );
// note: the dialog takes the ownership of pSymbolShapeProperties and pAutoSymbolGraphic
- aDlg.setSymbolInformation( pSymbolShapeProperties, pAutoSymbolGraphic );
+ aDlg->setSymbolInformation( pSymbolShapeProperties, pAutoSymbolGraphic );
}
if( aDialogParameter.HasStatisticProperties() )
{
- aDlg.SetAxisMinorStepWidthForErrorBarDecimals(
+ aDlg->SetAxisMinorStepWidthForErrorBarDecimals(
InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( getModel(), m_xChartView, rObjectCID ) );
}
//open the dialog
- if (aDlg.Execute() == RET_OK || (bSuccessOnUnchanged && aDlg.DialogWasClosedWithOK()))
+ if (aDlg->Execute() == RET_OK || (bSuccessOnUnchanged && aDlg->DialogWasClosedWithOK()))
{
- const SfxItemSet* pOutItemSet = aDlg.GetOutputItemSet();
+ const SfxItemSet* pOutItemSet = aDlg->GetOutputItemSet();
if(pOutItemSet)
{
ControllerLockGuardUNO aCLGuard( getModel());
@@ -822,8 +825,8 @@ void ChartController::executeDispatch_View3D()
//open dialog
SolarMutexGuard aSolarGuard;
- View3DDialog aDlg( m_pChartWindow, getModel(), m_pDrawModelWrapper->GetColorList() );
- if( aDlg.Execute() == RET_OK )
+ ScopedVclPtrInstance< View3DDialog > aDlg( m_pChartWindow, getModel(), m_pDrawModelWrapper->GetColorList() );
+ if( aDlg->Execute() == RET_OK )
aUndoGuard.commit();
}
catch(const uno::RuntimeException& e)
diff --git a/chart2/source/controller/main/ChartWindow.cxx b/chart2/source/controller/main/ChartWindow.cxx
index c46bab4e0b48..cd50dd3fb598 100644
--- a/chart2/source/controller/main/ChartWindow.cxx
+++ b/chart2/source/controller/main/ChartWindow.cxx
@@ -49,7 +49,7 @@ ChartWindow::ChartWindow( ChartController* pController, vcl::Window* pParent, Wi
: Window(pParent, nStyle)
, m_pWindowController( pController )
, m_bInPaint(false)
- , m_pOpenGLWindow(new OpenGLWindow(this))
+ , m_pOpenGLWindow(VclPtr<OpenGLWindow>::Create(this))
{
this->SetHelpId( HID_SCH_WIN_DOCUMENT );
this->SetMapMode( MapMode(MAP_100TH_MM) );
@@ -64,7 +64,7 @@ ChartWindow::ChartWindow( ChartController* pController, vcl::Window* pParent, Wi
{
m_pOpenGLWindow->Show();
uno::Reference< chart2::X3DChartWindowProvider > x3DWindowProvider(pController->getModel(), uno::UNO_QUERY_THROW);
- sal_uInt64 nWindowPtr = reinterpret_cast<sal_uInt64>(m_pOpenGLWindow);
+ sal_uInt64 nWindowPtr = reinterpret_cast<sal_uInt64>(m_pOpenGLWindow.get());
x3DWindowProvider->setWindow(nWindowPtr);
x3DWindowProvider->update();
}
@@ -72,13 +72,19 @@ ChartWindow::ChartWindow( ChartController* pController, vcl::Window* pParent, Wi
ChartWindow::~ChartWindow()
{
+ disposeOnce();
+}
+
+void ChartWindow::dispose()
+{
if (m_pWindowController && m_pWindowController->getModel().is())
{
uno::Reference< chart2::X3DChartWindowProvider > x3DWindowProvider(m_pWindowController->getModel(), uno::UNO_QUERY_THROW);
x3DWindowProvider->setWindow(0);
x3DWindowProvider->update();
}
- delete m_pOpenGLWindow;
+ m_pOpenGLWindow.disposeAndClear();
+ vcl::Window::dispose();
}
void ChartWindow::clear()
diff --git a/chart2/source/controller/main/ChartWindow.hxx b/chart2/source/controller/main/ChartWindow.hxx
index 2afa38a986d6..cd0afaa07d0a 100644
--- a/chart2/source/controller/main/ChartWindow.hxx
+++ b/chart2/source/controller/main/ChartWindow.hxx
@@ -37,6 +37,7 @@ class ChartWindow : public vcl::Window
public:
ChartWindow( ChartController* pController, vcl::Window* pParent, WinBits nStyle );
virtual ~ChartWindow();
+ virtual void dispose() SAL_OVERRIDE;
void clear();
@@ -67,7 +68,7 @@ public:
private:
ChartController* m_pWindowController;
bool m_bInPaint;
- OpenGLWindow* m_pOpenGLWindow;
+ VclPtr<OpenGLWindow> m_pOpenGLWindow;
void adjustHighContrastMode();
};
diff --git a/chart2/source/controller/main/ElementSelector.cxx b/chart2/source/controller/main/ElementSelector.cxx
index ba5d165fb831..732bf479bcae 100644
--- a/chart2/source/controller/main/ElementSelector.cxx
+++ b/chart2/source/controller/main/ElementSelector.cxx
@@ -57,10 +57,6 @@ SelectorListBox::SelectorListBox( vcl::Window* pParent, WinBits nStyle )
{
}
-SelectorListBox::~SelectorListBox()
-{
-}
-
void lcl_addObjectsToList( const ObjectHierarchy& rHierarchy, const ObjectHierarchy::tOID & rParent, std::vector< ListBoxEntryData >& rEntries
, const sal_Int32 nHierarchyDepth, const Reference< chart2::XChartDocument >& xChartDoc )
{
@@ -326,7 +322,7 @@ uno::Reference< awt::XWindow > SAL_CALL ElementSelectorToolbarController::create
vcl::Window* pParent = VCLUnoHelper::GetWindow( xParent );
if( pParent )
{
- m_apSelectorListBox.reset( new SelectorListBox( pParent, WB_DROPDOWN|WB_AUTOHSCROLL|WB_BORDER ) );
+ m_apSelectorListBox.reset( VclPtr<SelectorListBox>::Create( pParent, WB_DROPDOWN|WB_AUTOHSCROLL|WB_BORDER ) );
::Size aLogicalSize( 95, 160 );
::Size aPixelSize = m_apSelectorListBox->LogicToPixel( aLogicalSize, MAP_APPFONT );
m_apSelectorListBox->SetSizePixel( aPixelSize );
diff --git a/chart2/source/controller/main/ElementSelector.hxx b/chart2/source/controller/main/ElementSelector.hxx
index 5c3a19d0464d..aa9c182cf6b2 100644
--- a/chart2/source/controller/main/ElementSelector.hxx
+++ b/chart2/source/controller/main/ElementSelector.hxx
@@ -47,7 +47,6 @@ class SelectorListBox : public ListBox
{
public:
SelectorListBox( vcl::Window* pParent, WinBits nStyle );
- virtual ~SelectorListBox();
virtual void Select() SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -111,7 +110,7 @@ private:
private:
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext> m_xCC;
- boost::scoped_ptr< SelectorListBox > m_apSelectorListBox;
+ VclPtr< SelectorListBox > m_apSelectorListBox;
};
} //namespace chart
diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx
index 52b5f1f6d4e4..e0176be4eff4 100644
--- a/chart2/source/controller/main/ShapeController.cxx
+++ b/chart2/source/controller/main/ShapeController.cxx
@@ -252,7 +252,7 @@ void ShapeController::executeDispatch_FormatLine()
SolarMutexGuard aGuard;
if ( m_pChartController )
{
- vcl::Window* pParent = dynamic_cast< vcl::Window* >( m_pChartController->m_pChartWindow );
+ vcl::Window* pParent = dynamic_cast< vcl::Window* >( m_pChartController->m_pChartWindow.get() );
DrawModelWrapper* pDrawModelWrapper = m_pChartController->GetDrawModelWrapper();
DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
if ( pParent && pDrawModelWrapper && pDrawViewWrapper )
@@ -267,10 +267,10 @@ void ShapeController::executeDispatch_FormatLine()
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if ( pFact )
{
- ::boost::scoped_ptr< SfxAbstractTabDialog > pDlg(
+ boost::scoped_ptr< SfxAbstractTabDialog > pDlg(
pFact->CreateSvxLineTabDialog( pParent, &aAttr, &pDrawModelWrapper->getSdrModel(),
pSelectedObj, bHasMarked ) );
- if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
+ if ( pDlg->Execute() == RET_OK )
{
const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
if ( bHasMarked )
@@ -292,7 +292,7 @@ void ShapeController::executeDispatch_FormatArea()
SolarMutexGuard aGuard;
if ( m_pChartController )
{
- vcl::Window* pParent = dynamic_cast< vcl::Window* >( m_pChartController->m_pChartWindow );
+ vcl::Window* pParent = dynamic_cast< vcl::Window* >( m_pChartController->m_pChartWindow.get() );
DrawModelWrapper* pDrawModelWrapper = m_pChartController->GetDrawModelWrapper();
DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
if ( pParent && pDrawModelWrapper && pDrawViewWrapper )
@@ -335,7 +335,7 @@ void ShapeController::executeDispatch_TextAttributes()
SolarMutexGuard aGuard;
if ( m_pChartController )
{
- vcl::Window* pParent = dynamic_cast< vcl::Window* >( m_pChartController->m_pChartWindow );
+ vcl::Window* pParent = dynamic_cast< vcl::Window* >( m_pChartController->m_pChartWindow.get() );
DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
if ( pParent && pDrawViewWrapper )
{
@@ -372,7 +372,7 @@ void ShapeController::executeDispatch_TransformDialog()
SolarMutexGuard aGuard;
if ( m_pChartController )
{
- vcl::Window* pParent = dynamic_cast< vcl::Window* >( m_pChartController->m_pChartWindow );
+ vcl::Window* pParent = dynamic_cast< vcl::Window* >( m_pChartController->m_pChartWindow.get() );
DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
if ( pParent && pDrawViewWrapper )
{
@@ -541,7 +541,7 @@ void ShapeController::executeDispatch_FontDialog()
SolarMutexGuard aGuard;
if ( m_pChartController )
{
- vcl::Window* pParent = dynamic_cast< vcl::Window* >( m_pChartController->m_pChartWindow );
+ vcl::Window* pParent = dynamic_cast< vcl::Window* >( m_pChartController->m_pChartWindow.get() );
DrawModelWrapper* pDrawModelWrapper = m_pChartController->GetDrawModelWrapper();
DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
if ( pParent && pDrawModelWrapper && pDrawViewWrapper )
@@ -549,8 +549,8 @@ void ShapeController::executeDispatch_FontDialog()
SfxItemSet aAttr( pDrawViewWrapper->GetModel()->GetItemPool() );
pDrawViewWrapper->GetAttributes( aAttr );
ViewElementListProvider aViewElementListProvider( pDrawModelWrapper );
- ::boost::scoped_ptr< ShapeFontDialog > pDlg( new ShapeFontDialog( pParent, &aAttr, &aViewElementListProvider ) );
- if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
+ ScopedVclPtrInstance< ShapeFontDialog > pDlg( pParent, &aAttr, &aViewElementListProvider );
+ if ( pDlg->Execute() == RET_OK )
{
const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
pDrawViewWrapper->SetAttributes( *pOutAttr );
@@ -564,7 +564,7 @@ void ShapeController::executeDispatch_ParagraphDialog()
SolarMutexGuard aGuard;
if ( m_pChartController )
{
- vcl::Window* pParent = dynamic_cast< vcl::Window* >( m_pChartController->m_pChartWindow );
+ vcl::Window* pParent = dynamic_cast< vcl::Window* >( m_pChartController->m_pChartWindow.get() );
DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
if ( pParent && pDrawViewWrapper )
{
@@ -587,8 +587,8 @@ void ShapeController::executeDispatch_ParagraphDialog()
aNewAttr.Put( SvxWidowsItem( 0, SID_ATTR_PARA_WIDOWS) );
aNewAttr.Put( SvxOrphansItem( 0, SID_ATTR_PARA_ORPHANS) );
- ::boost::scoped_ptr< ShapeParagraphDialog > pDlg( new ShapeParagraphDialog( pParent, &aNewAttr ) );
- if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
+ ScopedVclPtrInstance< ShapeParagraphDialog > pDlg( pParent, &aNewAttr );
+ if ( pDlg->Execute() == RET_OK )
{
const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
pDrawViewWrapper->SetAttributes( *pOutAttr );
diff --git a/chart2/source/controller/main/ShapeToolbarController.cxx b/chart2/source/controller/main/ShapeToolbarController.cxx
index 46c7cda65740..999c9bacdd5c 100644
--- a/chart2/source/controller/main/ShapeToolbarController.cxx
+++ b/chart2/source/controller/main/ShapeToolbarController.cxx
@@ -105,7 +105,7 @@ void ShapeToolbarController::initialize( const Sequence< uno::Any >& rArguments
SolarMutexGuard aSolarMutexGuard;
::osl::MutexGuard aGuard( m_aMutex );
- ToolBox* pToolBox = static_cast< ToolBox* >( VCLUnoHelper::GetWindow( getParent() ) );
+ VclPtr< ToolBox > pToolBox = static_cast< ToolBox* >( VCLUnoHelper::GetWindow( getParent() ).get() );
if ( pToolBox )
{
const sal_uInt16 nCount = pToolBox->GetItemCount();
diff --git a/chart2/source/inc/chartview/DrawModelWrapper.hxx b/chart2/source/inc/chartview/DrawModelWrapper.hxx
index 986a6b993eb8..0e590a67891e 100644
--- a/chart2/source/inc/chartview/DrawModelWrapper.hxx
+++ b/chart2/source/inc/chartview/DrawModelWrapper.hxx
@@ -41,7 +41,7 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > m_xMainDrawPage;
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > m_xHiddenDrawPage;
- boost::scoped_ptr<OutputDevice> m_pRefDevice;
+ VclPtr<OutputDevice> m_pRefDevice;
//no default constructor
DrawModelWrapper();
diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index 09fef837f55f..ad79ed5a158f 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -1487,7 +1487,7 @@ IMPL_LINK_NOARG(GL3DBarChart, UpdateTimerHdl)
void GL3DBarChart::setOpenGLWindow(OpenGLWindow* pWindow)
{
- if (mpWindow != pWindow)
+ if (mpWindow.get() != pWindow)
{
mpWindow = pWindow;
Size aSize = mpWindow->GetSizePixel();
diff --git a/chart2/source/view/inc/GL3DBarChart.hxx b/chart2/source/view/inc/GL3DBarChart.hxx
index 9f8664d73fce..c714a5b50489 100644
--- a/chart2/source/view/inc/GL3DBarChart.hxx
+++ b/chart2/source/view/inc/GL3DBarChart.hxx
@@ -124,7 +124,7 @@ private:
boost::ptr_vector<opengl3D::Renderable3DObject> maShapes;
boost::scoped_ptr<opengl3D::OpenGL3DRenderer> mpRenderer;
- OpenGLWindow* mpWindow;
+ VclPtr<OpenGLWindow> mpWindow;
opengl3D::Camera* mpCamera;
bool mbValidContext;
diff --git a/chart2/source/view/main/3DChartObjects.cxx b/chart2/source/view/main/3DChartObjects.cxx
index 7bf6966ee258..b1354c588eed 100644
--- a/chart2/source/view/main/3DChartObjects.cxx
+++ b/chart2/source/view/main/3DChartObjects.cxx
@@ -76,26 +76,26 @@ const TextCacheItem& TextCache::getText(OUString const & rText, bool bIs3dText)
if(itr != maTextCache.end())
return *itr->second;
- VirtualDevice aDevice(*Application::GetDefaultDevice(), 0, 0);
+ ScopedVclPtrInstance< VirtualDevice > pDevice(*Application::GetDefaultDevice(), 0, 0);
vcl::Font aFont;
if(bIs3dText)
aFont = vcl::Font("Brillante St",Size(0,0));
else
- aFont = aDevice.GetFont();
+ aFont = pDevice->GetFont();
aFont.SetSize(Size(0, 96));
static bool bOldRender = getenv("OLDRENDER");
if (bOldRender)
aFont.SetColor(COL_BLACK);
else
aFont.SetColor(COL_GREEN); // RGB_COLORDATA(0xf0, 0xf0, 0xf0));
- aDevice.SetFont(aFont);
- aDevice.Erase();
+ pDevice->SetFont(aFont);
+ pDevice->Erase();
- aDevice.SetOutputSize(Size(aDevice.GetTextWidth(rText), aDevice.GetTextHeight()));
- aDevice.SetBackground(Wallpaper(COL_TRANSPARENT));
- aDevice.DrawText(Point(0,0), rText);
+ pDevice->SetOutputSize(Size(pDevice->GetTextWidth(rText), pDevice->GetTextHeight()));
+ pDevice->SetBackground(Wallpaper(COL_TRANSPARENT));
+ pDevice->DrawText(Point(0,0), rText);
- BitmapEx aText(aDevice.GetBitmapEx(Point(0,0), aDevice.GetOutputSize()));
+ BitmapEx aText(pDevice->GetBitmapEx(Point(0,0), pDevice->GetOutputSize()));
// TextCacheItem *pItem = new TextCacheItem(OpenGLHelper::ConvertBitmapExToRGBABuffer(aText), aText.GetSizePixel());
Bitmap aBitmap (aText.GetBitmap());
BitmapReadAccess *pAcc = aBitmap.AcquireReadAccess();
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index d9258e99bf7e..1ef10303457e 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -1090,7 +1090,7 @@ public:
private:
ChartView* mpView;
bool mbContextDestroyed;
- OpenGLWindow* mpWindow;
+ VclPtr<OpenGLWindow> mpWindow;
};
GL2DRenderer::GL2DRenderer(ChartView* pView):
diff --git a/chart2/source/view/main/DrawModelWrapper.cxx b/chart2/source/view/main/DrawModelWrapper.cxx
index d917ee16aadd..c9c1ba2930da 100644
--- a/chart2/source/view/main/DrawModelWrapper.cxx
+++ b/chart2/source/view/main/DrawModelWrapper.cxx
@@ -150,7 +150,8 @@ DrawModelWrapper::DrawModelWrapper( const uno::Reference<uno::XComponentContext>
OutputDevice* pDefaultDevice = rOutliner.GetRefDevice();
if( !pDefaultDevice )
pDefaultDevice = Application::GetDefaultDevice();
- m_pRefDevice.reset(new VirtualDevice(*pDefaultDevice));
+ m_pRefDevice.disposeAndClear();
+ m_pRefDevice = VclPtr<VirtualDevice>::Create(*pDefaultDevice);
MapMode aMapMode = m_pRefDevice->GetMapMode();
aMapMode.SetMapUnit(MAP_100TH_MM);
m_pRefDevice->SetMapMode(aMapMode);
@@ -176,6 +177,7 @@ DrawModelWrapper::~DrawModelWrapper()
}
SfxItemPool::Free(m_pChartItemPool);
}
+ m_pRefDevice.disposeAndClear();
}
uno::Reference< uno::XInterface > DrawModelWrapper
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index b6f6237aa3c8..7d81b5581228 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -836,19 +836,19 @@ DummyText::DummyText(const OUString& rText, const tNameSequence& rNames,
{
vcl::Font aFont;
std::for_each(maProperties.begin(), maProperties.end(), FontAttribSetter(aFont));
- VirtualDevice aDevice(*Application::GetDefaultDevice(), 0, 0);
- aDevice.Erase();
+ ScopedVclPtrInstance< VirtualDevice > pDevice(*Application::GetDefaultDevice(), 0, 0);
+ pDevice->Erase();
Rectangle aRect;
- aDevice.SetFont(aFont);
- aDevice.GetTextBoundRect(aRect, rText);
+ pDevice->SetFont(aFont);
+ pDevice->GetTextBoundRect(aRect, rText);
int screenWidth = (aRect.BottomRight().X());
int screenHeight = (aRect.BottomRight().Y());
- aDevice.SetOutputSizePixel(Size(screenWidth * 3, screenHeight));
- aDevice.SetBackground(Wallpaper(COL_TRANSPARENT));
- aDevice.DrawText(Point(0, 0), rText);
+ pDevice->SetOutputSizePixel(Size(screenWidth * 3, screenHeight));
+ pDevice->SetBackground(Wallpaper(COL_TRANSPARENT));
+ pDevice->DrawText(Point(0, 0), rText);
bmpWidth = aRect.Right() - aRect.Left();
bmpHeight = aRect.Bottom() - aRect.Top();
- maBitmap = BitmapEx(aDevice.GetBitmapEx(aRect.TopLeft(), Size(bmpWidth, bmpHeight)));
+ maBitmap = BitmapEx(pDevice->GetBitmapEx(aRect.TopLeft(), Size(bmpWidth, bmpHeight)));
rCache.insertBitmap(aKey, maBitmap);
}
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 19f6f933a677..1b64ef1d193e 100644
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -625,19 +625,19 @@ int OpenGLRender::RenderRectangleShape(bool bBorder, bool bFill)
int OpenGLRender::CreateTextTexture(::rtl::OUString const &textValue, vcl::Font aFont, long , awt::Point aPos, awt::Size aSize, long rotation)
{
- VirtualDevice aDevice(*Application::GetDefaultDevice(), 0, 0);
- aDevice.Erase();
+ ScopedVclPtrInstance< VirtualDevice > pDevice(*Application::GetDefaultDevice(), 0, 0);
+ pDevice->Erase();
Rectangle aRect;
- aDevice.SetFont(aFont);
- aDevice.GetTextBoundRect(aRect, textValue);
+ pDevice->SetFont(aFont);
+ pDevice->GetTextBoundRect(aRect, textValue);
int screenWidth = (aRect.BottomRight().X() + 3) & ~3;
int screenHeight = (aRect.BottomRight().Y() + 3) & ~3;
- aDevice.SetOutputSizePixel(Size(screenWidth * 3, screenHeight));
- aDevice.SetBackground(Wallpaper(COL_TRANSPARENT));
- aDevice.DrawText(Point(0, 0), textValue);
+ pDevice->SetOutputSizePixel(Size(screenWidth * 3, screenHeight));
+ pDevice->SetBackground(Wallpaper(COL_TRANSPARENT));
+ pDevice->DrawText(Point(0, 0), textValue);
int bmpWidth = (aRect.Right() - aRect.Left() + 3) & ~3;
int bmpHeight = (aRect.Bottom() - aRect.Top() + 3) & ~3;
- BitmapEx aBitmap = BitmapEx(aDevice.GetBitmapEx(aRect.TopLeft(), Size(bmpWidth, bmpHeight)));
+ BitmapEx aBitmap = BitmapEx(pDevice->GetBitmapEx(aRect.TopLeft(), Size(bmpWidth, bmpHeight)));
sal_Int32 nXPos = aPos.X;
sal_Int32 nYPos = aPos.Y;
diff --git a/compilerplugins/clang/vclwidgets.cxx b/compilerplugins/clang/vclwidgets.cxx
new file mode 100644
index 000000000000..e12e9572b385
--- /dev/null
+++ b/compilerplugins/clang/vclwidgets.cxx
@@ -0,0 +1,458 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <string>
+#include <iostream>
+
+#include "plugin.hxx"
+#include "compat.hxx"
+#include "clang/AST/CXXInheritance.h"
+
+// Final goal: Checker for VCL widget references. Makes sure that VCL Window subclasses are properly referenced counted and dispose()'ed.
+//
+// But at the moment it just finds subclasses of Window which are not heap-allocated
+//
+// TODO do I need to check for local and static variables, too ?
+// TODO when we have a dispose() method, verify that the dispose() methods releases all of the Window references
+// TODO when we have a dispose() method, verify that it calls the super-class dispose() method at some point.
+
+namespace {
+
+class VCLWidgets:
+ public RecursiveASTVisitor<VCLWidgets>, public loplugin::Plugin
+{
+public:
+ explicit VCLWidgets(InstantiationData const & data): Plugin(data) {}
+
+ virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }
+
+ bool VisitVarDecl(const VarDecl *);
+
+ bool VisitFieldDecl(const FieldDecl *);
+
+ bool VisitParmVarDecl(const ParmVarDecl *);
+
+ bool VisitFunctionDecl(const FunctionDecl *);
+
+ bool VisitCXXDestructorDecl(const CXXDestructorDecl *);
+
+ bool VisitCXXDeleteExpr(const CXXDeleteExpr *);
+
+private:
+ bool isDisposeCallingSuperclassDispose(const CXXMethodDecl* pMethodDecl);
+};
+
+static bool startsWith(const std::string& s, const char* other)
+{
+ return s.compare(0, strlen(other), other) == 0;
+}
+
+bool BaseCheckNotWindowSubclass(const CXXRecordDecl *BaseDefinition, void *) {
+ if (BaseDefinition && BaseDefinition->getQualifiedNameAsString() == "OutputDevice") {
+ return false;
+ }
+ return true;
+}
+
+bool isDerivedFromWindow(const CXXRecordDecl *decl) {
+ if (!decl)
+ return false;
+ if (decl->getQualifiedNameAsString() == "OutputDevice")
+ return true;
+ if (!decl->hasDefinition()) {
+ return false;
+ }
+ if (// not sure what hasAnyDependentBases() does,
+ // but it avoids classes we don't want, e.g. WeakAggComponentImplHelper1
+ !decl->hasAnyDependentBases() &&
+ !decl->forallBases(BaseCheckNotWindowSubclass, nullptr, true)) {
+ return true;
+ }
+ return false;
+}
+
+bool containsWindowSubclass(const Type* pType0);
+
+bool containsWindowSubclass(const QualType& qType) {
+ if (startsWith(qType.getAsString(), "VclPtr"))
+ return false;
+ if (startsWith(qType.getAsString(), "const VclPtr"))
+ return false;
+ if (startsWith(qType.getAsString(), "class VclPtr"))
+ return false;
+ if (startsWith(qType.getAsString(), "const class VclPtr"))
+ return false;
+ if (startsWith(qType.getAsString(), "ScopedVclPtr"))
+ return false;
+ if (startsWith(qType.getAsString(), "class ScopedVclPtr"))
+ return false;
+ if (startsWith(qType.getAsString(), "const class ScopedVclPtr"))
+ return false;
+ return containsWindowSubclass(qType.getTypePtr());
+}
+
+bool containsWindowSubclass(const Type* pType0) {
+ if (!pType0)
+ return false;
+ const Type* pType = pType0->getUnqualifiedDesugaredType();
+ if (!pType)
+ return false;
+ const CXXRecordDecl* pRecordDecl = pType->getAsCXXRecordDecl();
+ if (pRecordDecl) {
+ const ClassTemplateSpecializationDecl* pTemplate = dyn_cast<ClassTemplateSpecializationDecl>(pRecordDecl);
+ if (pTemplate) {
+ for(unsigned i=0; i<pTemplate->getTemplateArgs().size(); ++i) {
+ const TemplateArgument& rArg = pTemplate->getTemplateArgs()[i];
+ if (rArg.getKind() == TemplateArgument::ArgKind::Type &&
+ containsWindowSubclass(rArg.getAsType()))
+ {
+ return true;
+ }
+ }
+ }
+ }
+ if (pType->isPointerType()) {
+ QualType pointeeType = pType->getPointeeType();
+ return containsWindowSubclass(pointeeType);
+ } else if (pType->isArrayType()) {
+ const ArrayType* pArrayType = dyn_cast<ArrayType>(pType);
+ QualType elementType = pArrayType->getElementType();
+ return containsWindowSubclass(elementType);
+ } else {
+ return isDerivedFromWindow(pRecordDecl);
+ }
+}
+
+bool VCLWidgets::VisitCXXDestructorDecl(const CXXDestructorDecl* pCXXDestructorDecl)
+{
+ if (ignoreLocation(pCXXDestructorDecl)) {
+ return true;
+ }
+ if (!pCXXDestructorDecl->isThisDeclarationADefinition()) {
+ return true;
+ }
+ const CXXRecordDecl * pRecordDecl = pCXXDestructorDecl->getParent();
+ // ignore OutputDevice class
+ if (pRecordDecl->getQualifiedNameAsString() == "OutputDevice") {
+ return true;
+ }
+ // check if this class is derived from Window
+ if (!isDerivedFromWindow(pRecordDecl)) {
+ return true;
+ }
+ bool foundVclPtrField = false;
+ for(auto fieldDecl : pRecordDecl->fields()) {
+ const RecordType *pFieldRecordType = fieldDecl->getType()->getAs<RecordType>();
+ if (pFieldRecordType) {
+ const CXXRecordDecl *pFieldRecordTypeDecl = dyn_cast<CXXRecordDecl>(pFieldRecordType->getDecl());
+ if (startsWith(pFieldRecordTypeDecl->getQualifiedNameAsString(), "VclPtr")) {
+ foundVclPtrField = true;
+ break;
+ }
+ }
+ }
+ bool foundDispose = false;
+ for(auto methodDecl : pRecordDecl->methods()) {
+ if (methodDecl->isInstance() && methodDecl->param_size()==0 && methodDecl->getNameAsString() == "dispose") {
+ foundDispose = true;
+ break;
+ }
+ }
+ const CompoundStmt *pCompoundStatement = dyn_cast<CompoundStmt>(pCXXDestructorDecl->getBody());
+ // having an empty body and no dispose() method is fine
+ if (!foundVclPtrField && !foundDispose && pCompoundStatement && pCompoundStatement->size() == 0) {
+ return true;
+ }
+ if (foundVclPtrField && pCompoundStatement && pCompoundStatement->size() == 0) {
+ report(
+ DiagnosticsEngine::Warning,
+ "OutputDevice subclass with VclPtr field must call dispose() from it's destructor.",
+ pCXXDestructorDecl->getLocStart())
+ << pCXXDestructorDecl->getSourceRange();
+ return true;
+ }
+ // check that the destructor for a OutputDevice subclass does nothing except call into the dispose() method
+ bool ok = false;
+ if (pCompoundStatement && pCompoundStatement->size() == 1) {
+ const CXXMemberCallExpr *pCallExpr = dyn_cast<CXXMemberCallExpr>(*pCompoundStatement->body_begin());
+ if (pCallExpr) {
+ if( const FunctionDecl* func = pCallExpr->getDirectCallee()) {
+ if( func->getNumParams() == 0 && func->getIdentifier() != NULL
+ && ( func->getName() == "disposeOnce" )) {
+ ok = true;
+ }
+ }
+ }
+ }
+ if (!ok) {
+ SourceLocation spellingLocation = compiler.getSourceManager().getSpellingLoc(
+ pCXXDestructorDecl->getLocStart());
+ StringRef filename = compiler.getSourceManager().getFilename(spellingLocation);
+ if ( !(filename.startswith(SRCDIR "/vcl/source/window/window.cxx"))
+ && !(filename.startswith(SRCDIR "/vcl/source/gdi/virdev.cxx")) )
+ {
+ report(
+ DiagnosticsEngine::Warning,
+ "OutputDevice subclass should have nothing in it's destructor but a call to disposeOnce().",
+ pCXXDestructorDecl->getLocStart())
+ << pCXXDestructorDecl->getSourceRange();
+ }
+ }
+ return true;
+}
+
+
+bool VCLWidgets::VisitVarDecl(const VarDecl * pVarDecl) {
+ if (ignoreLocation(pVarDecl)) {
+ return true;
+ }
+ const RecordType *recordType = pVarDecl->getType()->getAs<RecordType>();
+ if (recordType == nullptr) {
+ return true;
+ }
+ const CXXRecordDecl *recordDecl = dyn_cast<CXXRecordDecl>(recordType->getDecl());
+ if (recordDecl == nullptr) {
+ return true;
+ }
+
+ // check if this field is derived from Window
+ if (isDerivedFromWindow(recordDecl)) {
+ report(
+ DiagnosticsEngine::Warning,
+ "OutputDevice subclass allocated on stack, should be allocated via VclPtr or via *.",
+ pVarDecl->getLocation())
+ << pVarDecl->getSourceRange();
+ }
+ if ( !startsWith(pVarDecl->getType().getAsString(), "std::vector<vcl::Window *>")
+ && !startsWith(pVarDecl->getType().getAsString(), "std::map<vcl::Window *, Size>")
+ && !startsWith(pVarDecl->getType().getAsString(), "std::map<vcl::Window *, class Size>")
+ && !startsWith(pVarDecl->getType().getAsString(), "::std::vector<class Button *>")
+ && !startsWith(pVarDecl->getType().getAsString(), "::std::vector<Button *>")
+ && !startsWith(pVarDecl->getType().getAsString(), "::std::mem_fun1_t<")
+ && !startsWith(pVarDecl->getType().getAsString(), "::comphelper::mem_fun1_t<")
+ && !startsWith(pVarDecl->getType().getAsString(), "::std::pair<formula::RefButton *, formula::RefEdit *>")
+ && !startsWith(pVarDecl->getType().getAsString(), "::std::pair<RefButton *, RefEdit *>")
+ && !startsWith(pVarDecl->getType().getAsString(), "std::list<SwSidebarWin *>")
+ && !startsWith(pVarDecl->getType().getAsString(), "::std::map<OTableWindow *, sal_Int32>")
+ && !startsWith(pVarDecl->getType().getAsString(), "::std::map<class OTableWindow *, sal_Int32>")
+ && !startsWith(pVarDecl->getType().getAsString(), "::std::multimap<sal_Int32, OTableWindow *>")
+ && !startsWith(pVarDecl->getType().getAsString(), "::std::multimap<sal_Int32, class OTableWindow *>")
+ && !startsWith(pVarDecl->getType().getAsString(), "::dbp::OMultiInstanceAutoRegistration< ::dbp::OUnoAutoPilot<")
+ && !startsWith(pVarDecl->getType().getAsString(), "SwSidebarWin_iterator")
+ && !startsWith(pVarDecl->getType().getAsString(), "functor_vector_type")
+ && !startsWith(pVarDecl->getType().getAsString(), "const functor_vector_type")
+ && containsWindowSubclass(pVarDecl->getType()))
+ {
+ report(
+ DiagnosticsEngine::Warning,
+ "OutputDevice subclass should be wrapped in VclPtr. " + pVarDecl->getType().getAsString(),
+ pVarDecl->getLocation())
+ << pVarDecl->getSourceRange();
+ }
+ return true;
+}
+
+bool VCLWidgets::VisitFieldDecl(const FieldDecl * fieldDecl) {
+ if (ignoreLocation(fieldDecl)) {
+ return true;
+ }
+ if (fieldDecl->isBitField()) {
+ return true;
+ }
+ const CXXRecordDecl *pParentRecordDecl = dyn_cast<CXXRecordDecl>(fieldDecl->getParent());
+ if (containsWindowSubclass(fieldDecl->getType())) {
+ // have to ignore this for now, nasty reverse dependency from tools->vcl
+ if (!(pParentRecordDecl != nullptr && pParentRecordDecl->getQualifiedNameAsString() == "ErrorContextImpl")) {
+ report(
+ DiagnosticsEngine::Warning,
+ "OutputDevice subclass declared as a pointer field, should be wrapped in VclPtr." + fieldDecl->getType().getAsString(),
+ fieldDecl->getLocation())
+ << fieldDecl->getSourceRange();
+ return true;
+ }
+ }
+ const RecordType *recordType = fieldDecl->getType()->getAs<RecordType>();
+ if (recordType == nullptr) {
+ return true;
+ }
+ const CXXRecordDecl *recordDecl = dyn_cast<CXXRecordDecl>(recordType->getDecl());
+ if (recordDecl == nullptr) {
+ return true;
+ }
+
+ // check if this field is derived from Window
+ if (isDerivedFromWindow(recordDecl)) {
+ report(
+ DiagnosticsEngine::Warning,
+ "OutputDevice subclass allocated as a class member, should be allocated via VclPtr.",
+ fieldDecl->getLocation())
+ << fieldDecl->getSourceRange();
+ }
+
+ // If this field is a VclPtr field, then the class MUST have a dispose method
+ if (pParentRecordDecl && isDerivedFromWindow(pParentRecordDecl)
+ && startsWith(recordDecl->getQualifiedNameAsString(), "VclPtr"))
+ {
+ bool foundDispose = false;
+ for(auto methodDecl : pParentRecordDecl->methods()) {
+ if (methodDecl->isInstance() && methodDecl->param_size()==0 && methodDecl->getNameAsString() == "dispose") {
+ foundDispose = true;
+ break;
+ }
+ }
+ if (!foundDispose) {
+ report(
+ DiagnosticsEngine::Warning,
+ "OutputDevice subclass with a VclPtr field MUST have a dispose() method.",
+ fieldDecl->getLocation())
+ << fieldDecl->getSourceRange();
+ }
+ if (!pParentRecordDecl->hasUserDeclaredDestructor()) {
+ report(
+ DiagnosticsEngine::Warning,
+ "OutputDevice subclass with a VclPtr field MUST have an explicit destructor.",
+ fieldDecl->getLocation())
+ << fieldDecl->getSourceRange();
+ }
+ }
+
+ return true;
+}
+
+bool VCLWidgets::VisitParmVarDecl(ParmVarDecl const * pvDecl)
+{
+ if (ignoreLocation(pvDecl)) {
+ return true;
+ }
+ // ignore the stuff in the VclPtr template class
+ const CXXMethodDecl *pMethodDecl = dyn_cast<CXXMethodDecl>(pvDecl->getDeclContext());
+ if (pMethodDecl
+ && pMethodDecl->getParent()->getQualifiedNameAsString().find("VclPtr") != std::string::npos) {
+ return true;
+ }
+ // we exclude this method in VclBuilder because it's so useful to have it like this
+ if (pMethodDecl
+ && pMethodDecl->getNameAsString() == "get"
+ && (pMethodDecl->getParent()->getQualifiedNameAsString() == "VclBuilder"
+ || pMethodDecl->getParent()->getQualifiedNameAsString() == "VclBuilderContainer"))
+ {
+ return true;
+ }
+ return true;
+}
+
+bool VCLWidgets::VisitFunctionDecl( const FunctionDecl* functionDecl )
+{
+ if (ignoreLocation(functionDecl)) {
+ return true;
+ }
+ // ignore the stuff in the VclPtr template class
+ const CXXMethodDecl *pMethodDecl = dyn_cast<CXXMethodDecl>(functionDecl);
+ if (pMethodDecl
+ && pMethodDecl->getParent()->getQualifiedNameAsString() == "VclPtr") {
+ return true;
+ }
+ // ignore the OutputDevice::dispose() method
+ if (pMethodDecl
+ && pMethodDecl->getParent()->getQualifiedNameAsString() == "OutputDevice") {
+ return true;
+ }
+ if (functionDecl->hasBody() && pMethodDecl && isDerivedFromWindow(pMethodDecl->getParent())) {
+ // check the last thing that the dispose() method does, is to call into the superclass dispose method
+ if (pMethodDecl->getNameAsString() == "dispose") {
+ if (!isDisposeCallingSuperclassDispose(pMethodDecl)) {
+ report(
+ DiagnosticsEngine::Warning,
+ "OutputDevice subclass dispose() method MUST call it's superclass dispose() as the last thing it does",
+ functionDecl->getLocStart())
+ << functionDecl->getSourceRange();
+ }
+ }
+ }
+
+ return true;
+}
+
+bool VCLWidgets::VisitCXXDeleteExpr(const CXXDeleteExpr *pCXXDeleteExpr)
+{
+ if (ignoreLocation(pCXXDeleteExpr)) {
+ return true;
+ }
+ const CXXRecordDecl *pPointee = pCXXDeleteExpr->getArgument()->getType()->getPointeeCXXRecordDecl();
+ if (pPointee && isDerivedFromWindow(pPointee)) {
+ SourceLocation spellingLocation = compiler.getSourceManager().getSpellingLoc(
+ pCXXDeleteExpr->getLocStart());
+ StringRef filename = compiler.getSourceManager().getFilename(spellingLocation);
+ if ( !(filename.startswith(SRCDIR "/include/vcl/outdev.hxx")))
+ {
+ report(
+ DiagnosticsEngine::Warning,
+ "calling delete on instance of OutputDevice subclass, must rather call disposeAndClear()",
+ pCXXDeleteExpr->getLocStart())
+ << pCXXDeleteExpr->getSourceRange();
+ }
+ }
+ const ImplicitCastExpr* pImplicitCastExpr = dyn_cast<ImplicitCastExpr>(pCXXDeleteExpr->getArgument());
+ if (!pImplicitCastExpr) {
+ return true;
+ }
+ if (pImplicitCastExpr->getCastKind() != CK_UserDefinedConversion) {
+ return true;
+ }
+ report(
+ DiagnosticsEngine::Warning,
+ "calling delete on instance of VclPtr, must rather call disposeAndClear()",
+ pCXXDeleteExpr->getLocStart())
+ << pCXXDeleteExpr->getSourceRange();
+ return true;
+}
+
+
+/**
+The AST looks like:
+`-CXXMemberCallExpr 0xb06d8b0 'void'
+ `-MemberExpr 0xb06d868 '<bound member function type>' ->dispose 0x9d34880
+ `-ImplicitCastExpr 0xb06d8d8 'class SfxTabPage *' <UncheckedDerivedToBase (SfxTabPage)>
+ `-CXXThisExpr 0xb06d850 'class SfxAcceleratorConfigPage *' this
+
+*/
+bool VCLWidgets::isDisposeCallingSuperclassDispose(const CXXMethodDecl* pMethodDecl)
+{
+ const CompoundStmt *pCompoundStatement = dyn_cast<CompoundStmt>(pMethodDecl->getBody());
+ if (!pCompoundStatement) return false;
+ if (pCompoundStatement->size() == 0) return false;
+ // find the last statement
+ const CXXMemberCallExpr *pCallExpr = dyn_cast<CXXMemberCallExpr>(*pCompoundStatement->body_rbegin());
+ if (!pCallExpr) return false;
+ const MemberExpr *pMemberExpr = dyn_cast<MemberExpr>(pCallExpr->getCallee());
+ if (!pMemberExpr) return false;
+ if (pMemberExpr->getMemberDecl()->getNameAsString() != "dispose") return false;
+ const CXXMethodDecl *pDirectCallee = dyn_cast<CXXMethodDecl>(pCallExpr->getDirectCallee());
+ if (!pDirectCallee) return false;
+/* Not working yet. Partially because sometimes the superclass does not a dispose() method, so it gets passed up the chain.
+ Need complex checking for that case.
+ if (pDirectCallee->getParent()->getTypeForDecl() != (*pMethodDecl->getParent()->bases_begin()).getType().getTypePtr()) {
+ report(
+ DiagnosticsEngine::Warning,
+ "dispose() method calling wrong baseclass, calling " + pDirectCallee->getParent()->getQualifiedNameAsString() +
+ " should be calling " + (*pMethodDecl->getParent()->bases_begin()).getType().getAsString(),
+ pCallExpr->getLocStart())
+ << pCallExpr->getSourceRange();
+ return false;
+ }*/
+ return true;
+}
+
+
+
+loplugin::Plugin::Registration< VCLWidgets > X("vclwidgets");
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/file/fcomp.cxx b/connectivity/source/drivers/file/fcomp.cxx
index a2f8c65a6d88..682e5d992971 100644
--- a/connectivity/source/drivers/file/fcomp.cxx
+++ b/connectivity/source/drivers/file/fcomp.cxx
@@ -61,7 +61,7 @@ void OPredicateCompiler::dispose()
{
Clean();
m_orgColumns = NULL;
-m_xIndexes.clear();
+ m_xIndexes.clear();
}
void OPredicateCompiler::start(OSQLParseNode* pSQLParseNode)
diff --git a/cppcanvas/qa/unit/test.cxx b/cppcanvas/qa/unit/test.cxx
index 02a361692f76..6b909e058a44 100644
--- a/cppcanvas/qa/unit/test.cxx
+++ b/cppcanvas/qa/unit/test.cxx
@@ -43,7 +43,7 @@ public:
void CanvasTest::testComposite()
{
#ifdef LINUX
- boost::scoped_ptr<vcl::Window> pWin(new WorkWindow( (vcl::Window *)NULL ));
+ VclPtrInstance<WorkWindow> pWin( nullptr, WB_STDWORK );
uno::Reference<rendering::XCanvas> xCanvas = pWin->GetCanvas ();
if( !xCanvas.is() )
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 9e93995ed2af..9aeabbaefde3 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -2908,16 +2908,16 @@ namespace cppcanvas
VectorOfOutDevStates aStateStack;
- VirtualDevice aVDev;
- aVDev.EnableOutput( false );
+ ScopedVclPtrInstance< VirtualDevice > aVDev;
+ aVDev->EnableOutput( false );
// Setup VDev for state tracking and mapping
// =========================================
- aVDev.SetMapMode( rMtf.GetPrefMapMode() );
+ aVDev->SetMapMode( rMtf.GetPrefMapMode() );
const Size aMtfSize( rMtf.GetPrefSize() );
- const Size aMtfSizePixPre( aVDev.LogicToPixel( aMtfSize,
+ const Size aMtfSizePixPre( aVDev->LogicToPixel( aMtfSize,
rMtf.GetPrefMapMode() ) );
// #i44110# correct null-sized output - there are shapes
@@ -2928,7 +2928,7 @@ namespace cppcanvas
sal_Int32 nCurrActions(0);
ActionFactoryParameters aParms(aStateStack,
rCanvas,
- aVDev,
+ *aVDev.get(),
rParams,
nCurrActions );
@@ -2942,7 +2942,7 @@ namespace cppcanvas
1.0 / aMtfSizePix.Height() );
tools::calcLogic2PixelAffineTransform( aStateStack.getState().mapModeTransform,
- aVDev );
+ *aVDev.get() );
ColorSharedPtr pColor( getCanvas()->createColor() );
diff --git a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx
index 8237a12216b4..a943e36a198c 100644
--- a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx
+++ b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx
@@ -242,10 +242,10 @@ namespace cppcanvas
// render our content into an appropriately sized
// VirtualDevice with alpha channel
- VirtualDevice aVDev(
+ ScopedVclPtrInstance<VirtualDevice> aVDev(
*::Application::GetDefaultDevice(), 0, 0 );
- aVDev.SetOutputSizePixel( aBitmapSizePixel );
- aVDev.SetMapMode();
+ aVDev->SetOutputSizePixel( aBitmapSizePixel );
+ aVDev->SetMapMode();
if( rSubset.mnSubsetBegin != 0 ||
rSubset.mnSubsetEnd != -1 )
@@ -334,7 +334,7 @@ namespace cppcanvas
}
}
- aVDev.DrawTransparent( aMtf,
+ aVDev->DrawTransparent( aMtf,
aEmptyPoint,
aOutputSizePixel,
*mpAlphaGradient );
@@ -342,7 +342,7 @@ namespace cppcanvas
else
{
// no subsetting - render whole mtf
- aVDev.DrawTransparent( *mpGroupMtf,
+ aVDev->DrawTransparent( *mpGroupMtf,
aEmptyPoint,
aOutputSizePixel,
*mpAlphaGradient );
@@ -352,7 +352,7 @@ namespace cppcanvas
// update buffered bitmap and transformation
BitmapSharedPtr aBmp( VCLFactory::createBitmap(
mpCanvas,
- aVDev.GetBitmapEx(
+ aVDev->GetBitmapEx(
aEmptyPoint,
aBitmapSizePixel ) ) );
mxBufferBitmap = aBmp->getUNOBitmap();
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index 05aa1343d5c8..40360a67a398 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -672,6 +672,17 @@ void SfxAccCfgTabListBox_Impl::InitEntry(SvTreeListEntry* pEntry,
SvTabListBox::InitEntry(pEntry, rText, rImage1, rImage2, eButtonKind);
}
+SfxAccCfgTabListBox_Impl::~SfxAccCfgTabListBox_Impl()
+{
+ disposeOnce();
+}
+
+void SfxAccCfgTabListBox_Impl::dispose()
+{
+ m_pAccelConfigPage.clear();
+ SvTabListBox::dispose();
+}
+
/** select the entry, which match the current key input ... excepting
keys, which are used for the dialog itself.
*/
@@ -800,6 +811,11 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage( vcl::Window* pParent, const
SfxAcceleratorConfigPage::~SfxAcceleratorConfigPage()
{
+ disposeOnce();
+}
+
+void SfxAcceleratorConfigPage::dispose()
+{
// free memory - remove all dynamic user data
SvTreeListEntry* pEntry = m_pEntriesBox->First();
while (pEntry)
@@ -823,6 +839,21 @@ SfxAcceleratorConfigPage::~SfxAcceleratorConfigPage()
m_pKeyBox->Clear();
delete m_pFileDlg;
+ m_pFileDlg = NULL;
+
+ m_pEntriesBox.clear();
+ m_pOfficeButton.clear();
+ m_pModuleButton.clear();
+ m_pChangeButton.clear();
+ m_pRemoveButton.clear();
+ m_pGroupLBox.clear();
+ m_pFunctionBox.clear();
+ m_pKeyBox.clear();
+ m_pLoadButton.clear();
+ m_pSaveButton.clear();
+ m_pResetButton.clear();
+
+ SfxTabPage::dispose();
}
void SfxAcceleratorConfigPage::InitAccCfg()
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index aa1cd010af66..96ed1acc96b5 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -735,24 +735,24 @@ ConvertToolbarEntry(
return aPropSeq;
}
-SfxTabPage *CreateSvxMenuConfigPage( vcl::Window *pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> CreateSvxMenuConfigPage( vcl::Window *pParent, const SfxItemSet* rSet )
{
- return new SvxMenuConfigPage( pParent, *rSet );
+ return VclPtr<SvxMenuConfigPage>::Create( pParent, *rSet );
}
-SfxTabPage *CreateKeyboardConfigPage( vcl::Window *pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> CreateKeyboardConfigPage( vcl::Window *pParent, const SfxItemSet* rSet )
{
- return new SfxAcceleratorConfigPage( pParent, *rSet );
+ return VclPtr<SfxAcceleratorConfigPage>::Create( pParent, *rSet );
}
-SfxTabPage *CreateSvxToolbarConfigPage( vcl::Window *pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> CreateSvxToolbarConfigPage( vcl::Window *pParent, const SfxItemSet* rSet )
{
- return new SvxToolbarConfigPage( pParent, *rSet );
+ return VclPtr<SvxToolbarConfigPage>::Create( pParent, *rSet );
}
-SfxTabPage *CreateSvxEventConfigPage( vcl::Window *pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> CreateSvxEventConfigPage( vcl::Window *pParent, const SfxItemSet* rSet )
{
- return new SvxEventConfigPage( pParent, *rSet, SvxEventConfigPage::EarlyInit() );
+ return VclPtr<SvxEventConfigPage>::Create( pParent, *rSet, SvxEventConfigPage::EarlyInit() );
}
namespace {
@@ -1397,7 +1397,13 @@ SvxMenuEntriesListBox::SvxMenuEntriesListBox(vcl::Window* pParent, SvxConfigPage
SvxMenuEntriesListBox::~SvxMenuEntriesListBox()
{
- // do nothing
+ disposeOnce();
+}
+
+void SvxMenuEntriesListBox::dispose()
+{
+ pPage.clear();
+ SvTreeListBox::dispose();
}
// drag and drop support
@@ -1547,6 +1553,32 @@ SvxConfigPage::SvxConfigPage(vcl::Window *pParent, const SfxItemSet& rSet)
m_pDescriptionField->EnableCursor( false );
}
+SvxConfigPage::~SvxConfigPage()
+{
+ disposeOnce();
+}
+
+void SvxConfigPage::dispose()
+{
+ m_pTopLevel.clear();
+ m_pTopLevelLabel.clear();
+ m_pTopLevelListBox.clear();
+ m_pNewTopLevelButton.clear();
+ m_pModifyTopLevelButton.clear();
+ m_pContents.clear();
+ m_pContentsLabel.clear();
+ m_pEntries.clear();
+ m_pContentsListBox.disposeAndClear();
+ m_pAddCommandsButton.clear();
+ m_pModifyCommandButton.clear();
+ m_pMoveUpButton.clear();
+ m_pMoveDownButton.clear();
+ m_pSaveInListBox.clear();
+ m_pDescriptionField.clear();
+ m_pSelectorDlg.disposeAndClear();
+ SfxTabPage::dispose();
+}
+
void SvxConfigPage::Reset( const SfxItemSet* )
{
// If we haven't initialised our XMultiServiceFactory reference
@@ -2174,7 +2206,7 @@ bool SvxConfigPage::MoveEntryData(
SvxMenuConfigPage::SvxMenuConfigPage(vcl::Window *pParent, const SfxItemSet& rSet)
: SvxConfigPage(pParent, rSet)
{
- m_pContentsListBox = new SvxMenuEntriesListBox(m_pEntries, this);
+ m_pContentsListBox = VclPtr<SvxMenuEntriesListBox>::Create(m_pEntries, this);
m_pContentsListBox->set_grid_left_attach(0);
m_pContentsListBox->set_grid_top_attach(0);
m_pContentsListBox->set_hexpand(true);
@@ -2211,6 +2243,11 @@ SvxMenuConfigPage::SvxMenuConfigPage(vcl::Window *pParent, const SfxItemSet& rSe
LINK( this, SvxMenuConfigPage, EntrySelectHdl ) );
}
+SvxMenuConfigPage::~SvxMenuConfigPage()
+{
+ disposeOnce();
+}
+
// Populates the Menu combo box
void SvxMenuConfigPage::Init()
{
@@ -2224,7 +2261,7 @@ void SvxMenuConfigPage::Init()
m_pTopLevelListBox->GetSelectHdl().Call(this);
}
-SvxMenuConfigPage::~SvxMenuConfigPage()
+void SvxMenuConfigPage::dispose()
{
for ( sal_uInt16 i = 0 ; i < m_pSaveInListBox->GetEntryCount(); ++i )
{
@@ -2233,9 +2270,11 @@ SvxMenuConfigPage::~SvxMenuConfigPage()
delete pData;
}
+ m_pSaveInListBox->Clear();
- delete m_pSelectorDlg;
- delete m_pContentsListBox;
+ m_pSelectorDlg.clear();
+ m_pContentsListBox.clear();
+ SvxConfigPage::dispose();
}
IMPL_LINK( SvxMenuConfigPage, SelectMenuEntry, Control *, pBox )
@@ -2354,9 +2393,9 @@ short SvxMenuConfigPage::QueryReset()
OUString label = replaceSaveInName( msg, saveInName );
- QueryBox qbox( this, WB_YES_NO, label );
+ ScopedVclPtrInstance<QueryBox> qbox( this, WB_YES_NO, label );
- return qbox.Execute();
+ return qbox->Execute();
}
IMPL_LINK( SvxMenuConfigPage, SelectMenu, ListBox *, pBox )
@@ -2404,7 +2443,7 @@ IMPL_LINK( SvxMenuConfigPage, MenuSelectHdl, MenuButton *, pButton )
OUString aNewName( stripHotKey( pMenuData->GetName() ) );
OUString aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );
- boost::scoped_ptr<SvxNameDialog> pNameDialog(new SvxNameDialog( this, aNewName, aDesc ));
+ VclPtrInstance< SvxNameDialog > pNameDialog( this, aNewName, aDesc );
pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_MENU );
pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_RENAME_MENU ) );
@@ -2421,8 +2460,8 @@ IMPL_LINK( SvxMenuConfigPage, MenuSelectHdl, MenuButton *, pButton )
{
SvxConfigEntry* pMenuData = GetTopLevelSelection();
- boost::scoped_ptr<SvxMainMenuOrganizerDialog> pDialog(
- new SvxMainMenuOrganizerDialog( this,
+ VclPtr<SvxMainMenuOrganizerDialog> pDialog(
+ VclPtr<SvxMainMenuOrganizerDialog>::Create( this,
GetSaveInData()->GetEntries(), pMenuData ));
if ( pDialog->Execute() == RET_OK )
@@ -2447,7 +2486,7 @@ IMPL_LINK( SvxMenuConfigPage, EntrySelectHdl, MenuButton *, pButton )
OUString aNewName;
OUString aDesc = CUI_RESSTR( RID_SVXSTR_SUBMENU_NAME );
- boost::scoped_ptr<SvxNameDialog> pNameDialog(new SvxNameDialog( this, aNewName, aDesc ));
+ VclPtrInstance< SvxNameDialog > pNameDialog( this, aNewName, aDesc );
pNameDialog->SetHelpId( HID_SVX_CONFIG_NAME_SUBMENU );
pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_ADD_SUBMENU ) );
@@ -2484,7 +2523,7 @@ IMPL_LINK( SvxMenuConfigPage, EntrySelectHdl, MenuButton *, pButton )
OUString aNewName( stripHotKey( pEntry->GetName() ) );
OUString aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );
- boost::scoped_ptr<SvxNameDialog> pNameDialog(new SvxNameDialog( this, aNewName, aDesc ));
+ VclPtrInstance< SvxNameDialog > pNameDialog( this, aNewName, aDesc );
pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_MENU_ITEM );
pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_RENAME_MENU ) );
@@ -2524,9 +2563,8 @@ IMPL_LINK( SvxMenuConfigPage, NewMenuHdl, Button *, pButton )
{
(void)pButton;
- boost::scoped_ptr<SvxMainMenuOrganizerDialog> pDialog(
- new SvxMainMenuOrganizerDialog( 0,
- GetSaveInData()->GetEntries(), NULL, true ));
+ VclPtrInstance<SvxMainMenuOrganizerDialog> pDialog(
+ nullptr, GetSaveInData()->GetEntries(), nullptr, true );
if ( pDialog->Execute() == RET_OK )
{
@@ -2542,10 +2580,10 @@ IMPL_LINK( SvxMenuConfigPage, AddCommandsHdl, Button *, pButton )
{
(void)pButton;
- if ( m_pSelectorDlg == NULL )
+ if ( m_pSelectorDlg == nullptr )
{
// Create Script Selector which also shows builtin commands
- m_pSelectorDlg = new SvxScriptSelectorDialog( this, true, m_xFrame );
+ m_pSelectorDlg = VclPtr<SvxScriptSelectorDialog>::Create( this, true, m_xFrame );
m_pSelectorDlg->SetAddHdl(
LINK( this, SvxMenuConfigPage, AddFunctionHdl ) );
@@ -2655,6 +2693,21 @@ SvxMainMenuOrganizerDialog::SvxMainMenuOrganizerDialog(
LINK( this, SvxMainMenuOrganizerDialog, MoveHdl) );
}
+SvxMainMenuOrganizerDialog::~SvxMainMenuOrganizerDialog()
+{
+ disposeOnce();
+}
+
+void SvxMainMenuOrganizerDialog::dispose()
+{
+ m_pMenuBox.clear();
+ m_pMenuNameEdit.clear();
+ m_pMenuListBox.clear();
+ m_pMoveUpButton.clear();
+ m_pMoveDownButton.clear();
+ ModalDialog::dispose();
+}
+
IMPL_LINK(SvxMainMenuOrganizerDialog, ModifyHdl, Edit*, pEdit)
{
(void)pEdit;
@@ -2675,10 +2728,6 @@ IMPL_LINK(SvxMainMenuOrganizerDialog, ModifyHdl, Edit*, pEdit)
return 0;
}
-SvxMainMenuOrganizerDialog::~SvxMainMenuOrganizerDialog()
-{
-}
-
IMPL_LINK( SvxMainMenuOrganizerDialog, SelectHdl, Control*, pCtrl )
{
(void)pCtrl;
@@ -2838,7 +2887,7 @@ SvxToolbarConfigPage::SvxToolbarConfigPage(vcl::Window *pParent, const SfxItemSe
{
SetHelpId( HID_SVX_CONFIG_TOOLBAR );
- m_pContentsListBox = new SvxToolbarEntriesListBox(m_pEntries, this);
+ m_pContentsListBox = VclPtr<SvxToolbarEntriesListBox>::Create(m_pEntries, this);
m_pContentsListBox->set_grid_left_attach(0);
m_pContentsListBox->set_grid_top_attach(0);
m_pContentsListBox->set_hexpand(true);
@@ -2916,6 +2965,11 @@ SvxToolbarConfigPage::SvxToolbarConfigPage(vcl::Window *pParent, const SfxItemSe
SvxToolbarConfigPage::~SvxToolbarConfigPage()
{
+ disposeOnce();
+}
+
+void SvxToolbarConfigPage::dispose()
+{
for ( sal_uInt16 i = 0 ; i < m_pSaveInListBox->GetEntryCount(); ++i )
{
ToolbarSaveInData* pData =
@@ -2923,14 +2977,11 @@ SvxToolbarConfigPage::~SvxToolbarConfigPage()
delete pData;
}
+ m_pSaveInListBox->Clear();
- if ( m_pSelectorDlg != NULL )
- {
- delete m_pSelectorDlg;
- }
-
-
- delete m_pContentsListBox;
+ m_pSelectorDlg.disposeAndClear();
+ m_pContentsListBox.disposeAndClear();
+ SvxConfigPage::dispose();
}
void SvxToolbarConfigPage::DeleteSelectedTopLevel()
@@ -2993,10 +3044,10 @@ bool SvxToolbarConfigPage::DeleteSelectedContent()
if ( m_pContentsListBox->GetEntryCount() == 0 &&
GetTopLevelSelection()->IsDeletable() )
{
- MessageDialog qbox(this,
+ ScopedVclPtrInstance<MessageDialog> qbox(this,
CUI_RES(RID_SXVSTR_CONFIRM_DELETE_TOOLBAR), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
- if ( qbox.Execute() == RET_YES )
+ if ( qbox->Execute() == RET_YES )
{
DeleteSelectedTopLevel();
}
@@ -3051,7 +3102,7 @@ IMPL_LINK( SvxToolbarConfigPage, ToolbarSelectHdl, MenuButton *, pButton )
OUString aNewName( stripHotKey( pToolbar->GetName() ) );
OUString aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );
- boost::scoped_ptr<SvxNameDialog> pNameDialog(new SvxNameDialog( this, aNewName, aDesc ));
+ VclPtrInstance< SvxNameDialog > pNameDialog( this, aNewName, aDesc );
pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_TOOLBAR );
pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_RENAME_TOOLBAR ) );
@@ -3073,10 +3124,10 @@ IMPL_LINK( SvxToolbarConfigPage, ToolbarSelectHdl, MenuButton *, pButton )
}
case ID_DEFAULT_STYLE:
{
- MessageDialog qbox(this,
+ ScopedVclPtrInstance<MessageDialog> qbox(this,
CUI_RES(RID_SVXSTR_CONFIRM_RESTORE_DEFAULT), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
- if ( qbox.Execute() == RET_YES )
+ if ( qbox->Execute() == RET_YES )
{
ToolbarSaveInData* pSaveInData_ =
static_cast<ToolbarSaveInData*>(GetSaveInData());
@@ -3137,7 +3188,7 @@ IMPL_LINK( SvxToolbarConfigPage, EntrySelectHdl, MenuButton *, pButton )
OUString aNewName( stripHotKey( pEntry->GetName() ) );
OUString aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );
- boost::scoped_ptr<SvxNameDialog> pNameDialog(new SvxNameDialog( this, aNewName, aDesc ));
+ VclPtrInstance< SvxNameDialog > pNameDialog( this, aNewName, aDesc );
pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_TOOLBAR_ITEM );
pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_RENAME_TOOLBAR ) );
@@ -3267,8 +3318,8 @@ IMPL_LINK( SvxToolbarConfigPage, EntrySelectHdl, MenuButton *, pButton )
}
}
- boost::scoped_ptr<SvxIconSelectorDialog> pIconDialog(
- new SvxIconSelectorDialog( 0,
+ VclPtr<SvxIconSelectorDialog> pIconDialog(
+ VclPtr<SvxIconSelectorDialog>::Create( nullptr,
GetSaveInData()->GetImageManager(),
GetSaveInData()->GetParentImageManager() ));
@@ -4304,9 +4355,9 @@ short SvxToolbarConfigPage::QueryReset()
OUString label = replaceSaveInName( msg, saveInName );
- QueryBox qbox( this, WB_YES_NO, label );
+ ScopedVclPtrInstance< QueryBox > qbox( this, WB_YES_NO, label );
- return qbox.Execute();
+ return qbox->Execute();
}
IMPL_LINK( SvxToolbarConfigPage, SelectToolbar, ListBox *, pBox )
@@ -4395,7 +4446,7 @@ IMPL_LINK( SvxToolbarConfigPage, NewToolbarHdl, Button *, pButton )
OUString aNewURL =
generateCustomURL( GetSaveInData()->GetEntries() );
- boost::scoped_ptr<SvxNewToolbarDialog> pNameDialog(new SvxNewToolbarDialog( 0, aNewName ));
+ VclPtrInstance< SvxNewToolbarDialog > pNameDialog( nullptr, aNewName );
sal_uInt16 nInsertPos;
for ( sal_uInt16 i = 0 ; i < m_pSaveInListBox->GetEntryCount(); ++i )
@@ -4450,10 +4501,10 @@ IMPL_LINK( SvxToolbarConfigPage, AddCommandsHdl, Button *, pButton )
{
(void)pButton;
- if ( m_pSelectorDlg == NULL )
+ if ( m_pSelectorDlg == nullptr )
{
// Create Script Selector which shows slot commands
- m_pSelectorDlg = new SvxScriptSelectorDialog( this, true, m_xFrame );
+ m_pSelectorDlg = VclPtr<SvxScriptSelectorDialog>::Create( this, true, m_xFrame );
// Position the Script Selector over the Add button so it is
// beside the menu contents list and does not obscure it
@@ -4522,7 +4573,16 @@ SvxToolbarEntriesListBox::SvxToolbarEntriesListBox(vcl::Window* pParent, SvxTool
SvxToolbarEntriesListBox::~SvxToolbarEntriesListBox()
{
+ disposeOnce();
+}
+
+void SvxToolbarEntriesListBox::dispose()
+{
delete m_pButtonData;
+ m_pButtonData = NULL;
+
+ pPage.clear();
+ SvxMenuEntriesListBox::dispose();
}
void SvxToolbarEntriesListBox::BuildCheckBoxButtonImages( SvLBoxButtonData* pData )
@@ -4532,28 +4592,28 @@ void SvxToolbarEntriesListBox::BuildCheckBoxButtonImages( SvLBoxButtonData* pDat
// in all color modes, like high contrast.
const AllSettings& rSettings = Application::GetSettings();
- VirtualDevice aDev;
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
Size aSize( 26, 20 );
- aDev.SetOutputSizePixel( aSize );
+ pVDev->SetOutputSizePixel( aSize );
- Image aImage = GetSizedImage( aDev, aSize,
+ Image aImage = GetSizedImage( *pVDev.get(), aSize,
CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_DEFAULT ));
// Fill button data struct with new images
pData->SetImage(SvBmp::UNCHECKED, aImage);
- pData->SetImage(SvBmp::CHECKED, GetSizedImage( aDev, aSize, CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_CHECKED )) );
- pData->SetImage(SvBmp::HICHECKED, GetSizedImage( aDev, aSize, CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_CHECKED | BUTTON_DRAW_PRESSED )) );
- pData->SetImage(SvBmp::HIUNCHECKED, GetSizedImage( aDev, aSize, CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_DEFAULT | BUTTON_DRAW_PRESSED)) );
- pData->SetImage(SvBmp::TRISTATE, GetSizedImage( aDev, aSize, Image() ) ); // Use tristate bitmaps to have no checkbox for separator entries
- pData->SetImage(SvBmp::HITRISTATE, GetSizedImage( aDev, aSize, Image() ) );
+ pData->SetImage(SvBmp::CHECKED, GetSizedImage( *pVDev.get(), aSize, CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_CHECKED )) );
+ pData->SetImage(SvBmp::HICHECKED, GetSizedImage( *pVDev.get(), aSize, CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_CHECKED | BUTTON_DRAW_PRESSED )) );
+ pData->SetImage(SvBmp::HIUNCHECKED, GetSizedImage( *pVDev.get(), aSize, CheckBox::GetCheckImage( rSettings, BUTTON_DRAW_DEFAULT | BUTTON_DRAW_PRESSED)) );
+ pData->SetImage(SvBmp::TRISTATE, GetSizedImage( *pVDev.get(), aSize, Image() ) ); // Use tristate bitmaps to have no checkbox for separator entries
+ pData->SetImage(SvBmp::HITRISTATE, GetSizedImage( *pVDev.get(), aSize, Image() ) );
// Get image size
m_aCheckBoxImageSizePixel = aImage.GetSizePixel();
}
Image SvxToolbarEntriesListBox::GetSizedImage(
- VirtualDevice& aDev, const Size& aNewSize, const Image& aImage )
+ VirtualDevice& rVDev, const Size& aNewSize, const Image& aImage )
{
// Create new checkbox images for treelistbox. They must have a
// decent width to have a clear column for the visibility checkbox.
@@ -4567,18 +4627,18 @@ Image SvxToolbarEntriesListBox::GetSizedImage(
sal_uInt16 nPosX = std::max( (sal_uInt16) (((( aNewSize.Width() - 2 ) - aImage.GetSizePixel().Width() ) / 2 ) - 1), (sal_uInt16) 0 );
sal_uInt16 nPosY = std::max( (sal_uInt16) (((( aNewSize.Height() - 2 ) - aImage.GetSizePixel().Height() ) / 2 ) + 1), (sal_uInt16) 0 );
Point aPos( nPosX > 0 ? nPosX : 0, nPosY > 0 ? nPosY : 0 );
- aDev.SetFillColor( aFillColor );
- aDev.SetLineColor( aFillColor );
- aDev.DrawRect( Rectangle( Point(), aNewSize ));
- aDev.DrawImage( aPos, aImage );
+ rVDev.SetFillColor( aFillColor );
+ rVDev.SetLineColor( aFillColor );
+ rVDev.DrawRect( Rectangle( Point(), aNewSize ));
+ rVDev.DrawImage( aPos, aImage );
// Draw separator line 2 pixels left from the right border
Color aLineColor = GetDisplayBackground().GetColor().IsDark() ? Color( COL_WHITE ) : Color( COL_BLACK );
- aDev.SetLineColor( aLineColor );
- aDev.DrawLine( Point( aNewSize.Width()-3, 0 ), Point( aNewSize.Width()-3, aNewSize.Height()-1 ));
+ rVDev.SetLineColor( aLineColor );
+ rVDev.DrawLine( Point( aNewSize.Width()-3, 0 ), Point( aNewSize.Width()-3, aNewSize.Height()-1 ));
// Create new image that uses the fillcolor as transparent
- return Image( aDev.GetBitmap( Point(), aNewSize ), aFillColor );
+ return Image( rVDev.GetBitmap( Point(), aNewSize ), aFillColor );
}
void SvxToolbarEntriesListBox::DataChanged( const DataChangedEvent& rDCEvt )
@@ -4673,7 +4733,7 @@ TriState SvxToolbarEntriesListBox::NotifyCopying(
if ( !m_bIsInternalDrag )
{
// if the target is NULL then add function to the start of the list
- static_cast<SvxToolbarConfigPage*>(pPage)->AddFunction( pTarget, pTarget == NULL );
+ static_cast<SvxToolbarConfigPage*>(pPage.get())->AddFunction( pTarget, pTarget == NULL );
// Instant Apply changes to UI
SvxConfigEntry* pToolbar = pPage->GetTopLevelSelection();
@@ -4705,6 +4765,20 @@ SvxNewToolbarDialog::SvxNewToolbarDialog(vcl::Window* pWindow, const OUString& r
m_pEdtName->SetModifyHdl(LINK(this, SvxNewToolbarDialog, ModifyHdl));
}
+SvxNewToolbarDialog::~SvxNewToolbarDialog()
+{
+ disposeOnce();
+}
+
+void SvxNewToolbarDialog::dispose()
+{
+ m_pEdtName.clear();
+ m_pBtnOK.clear();
+ m_pSaveInListBox.clear();
+ ModalDialog::dispose();
+}
+
+
IMPL_LINK(SvxNewToolbarDialog, ModifyHdl, Edit*, pEdit)
{
(void)pEdit;
@@ -4906,20 +4980,32 @@ SvxIconSelectorDialog::SvxIconSelectorDialog( vcl::Window *pWindow,
SvxIconSelectorDialog::~SvxIconSelectorDialog()
{
- sal_uInt16 nCount = pTbSymbol->GetItemCount();
+ disposeOnce();
+}
- for (sal_uInt16 n = 0; n < nCount; ++n )
+void SvxIconSelectorDialog::dispose()
+{
+ if (pTbSymbol)
{
- sal_uInt16 nId = pTbSymbol->GetItemId(n);
-
- uno::XInterface* xi = static_cast< uno::XInterface* >(
- pTbSymbol->GetItemData( nId ) );
+ sal_uInt16 nCount = pTbSymbol->GetItemCount();
- if ( xi != NULL )
+ for (sal_uInt16 n = 0; n < nCount; ++n )
{
+ sal_uInt16 nId = pTbSymbol->GetItemId(n);
+
+ uno::XInterface* xi = static_cast< uno::XInterface* >(
+ pTbSymbol->GetItemData( nId ) );
+
+ if ( xi != NULL )
xi->release();
}
}
+
+ pTbSymbol.clear();
+ pFtNote.clear();
+ pBtnImport.clear();
+ pBtnDelete.clear();
+ ModalDialog::dispose();
}
uno::Reference< graphic::XGraphic> SvxIconSelectorDialog::GetSelectedIcon()
@@ -5211,8 +5297,8 @@ void SvxIconSelectorDialog::ImportGraphics(
message += newLine;
}
- SvxIconChangeDialog aDialog(this, message);
- aDialog.Execute();
+ ScopedVclPtrInstance< SvxIconChangeDialog > aDialog(this, message);
+ aDialog->Execute();
}
}
@@ -5364,4 +5450,16 @@ SvxIconChangeDialog::SvxIconChangeDialog(
pLineEditDescription->SetText(aMessage);
}
+SvxIconChangeDialog::~SvxIconChangeDialog()
+{
+ disposeOnce();
+}
+
+void SvxIconChangeDialog::dispose()
+{
+ pFImageInfo.clear();
+ pLineEditDescription.clear();
+ ModalDialog::dispose();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index 53c954415098..875b71b57fe3 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -276,7 +276,13 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSfxConfigFunctionListB
SfxConfigFunctionListBox::~SfxConfigFunctionListBox()
{
+ disposeOnce();
+}
+
+void SfxConfigFunctionListBox::dispose()
+{
ClearAll();
+ SvTreeListBox::dispose();
}
void SfxConfigFunctionListBox::MouseMove( const MouseEvent& )
@@ -423,7 +429,14 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSfxConfigGroupListBox(
SfxConfigGroupListBox::~SfxConfigGroupListBox()
{
+ disposeOnce();
+}
+
+void SfxConfigGroupListBox::dispose()
+{
ClearAll();
+ pFunctionListBox.clear();
+ SvTreeListBox::dispose();
}
void SfxConfigGroupListBox::ClearAll()
diff --git a/cui/source/customize/eventdlg.cxx b/cui/source/customize/eventdlg.cxx
index e466d526a747..20e00dedd7a1 100644
--- a/cui/source/customize/eventdlg.cxx
+++ b/cui/source/customize/eventdlg.cxx
@@ -103,6 +103,11 @@ void SvxEventConfigPage::LateInit( const uno::Reference< frame::XFrame >& _rxFra
SvxEventConfigPage::~SvxEventConfigPage()
{
+ disposeOnce();
+}
+
+void SvxEventConfigPage::dispose()
+{
// need to delete the user data
SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox();
SvTreeListEntry* pE = rListBox.GetEntry( 0 );
@@ -113,6 +118,8 @@ SvxEventConfigPage::~SvxEventConfigPage()
pE->SetUserData((void*)0);
pE = SvTreeListBox::NextSibling( pE );
}
+ m_pSaveInListBox.clear();
+ _SvxMacroTabPage::dispose();
}
void SvxEventConfigPage::ImplInitDocument()
diff --git a/cui/source/customize/eventdlg.hxx b/cui/source/customize/eventdlg.hxx
index 06d5433fa67b..385df86d1bbb 100644
--- a/cui/source/customize/eventdlg.hxx
+++ b/cui/source/customize/eventdlg.hxx
@@ -29,7 +29,7 @@
class SvxEventConfigPage : public _SvxMacroTabPage
{
- ListBox* m_pSaveInListBox;
+ VclPtr<ListBox> m_pSaveInListBox;
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > m_xAppEvents;
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > m_xDocumentEvents;
@@ -48,6 +48,7 @@ public:
struct EarlyInit { };
SvxEventConfigPage( vcl::Window *pParent, const SfxItemSet& rSet, EarlyInit );
virtual ~SvxEventConfigPage();
+ virtual void dispose() SAL_OVERRIDE;
void LateInit( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame );
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx
index dec5a9fb3e6b..fc5194af6567 100644
--- a/cui/source/customize/macropg.cxx
+++ b/cui/source/customize/macropg.cxx
@@ -83,32 +83,32 @@ static long nTabs[] =
IMPL_LINK( MacroEventListBox, HeaderEndDrag_Impl, HeaderBar*, pBar )
{
- DBG_ASSERT( pBar == &maHeaderBar, "*MacroEventListBox::HeaderEndDrag_Impl: something is wrong here..." );
+ DBG_ASSERT( pBar == maHeaderBar.get(), "*MacroEventListBox::HeaderEndDrag_Impl: something is wrong here..." );
(void)pBar;
- if( !maHeaderBar.GetCurItemId() )
+ if( !maHeaderBar->GetCurItemId() )
return 0;
- if( !maHeaderBar.IsItemMode() )
+ if( !maHeaderBar->IsItemMode() )
{
Size aSz;
- sal_uInt16 _nTabs = maHeaderBar.GetItemCount();
- long nWidth = maHeaderBar.GetItemSize( ITEMID_EVENT );
- long nBarWidth = maHeaderBar.GetSizePixel().Width();
+ sal_uInt16 _nTabs = maHeaderBar->GetItemCount();
+ long nWidth = maHeaderBar->GetItemSize( ITEMID_EVENT );
+ long nBarWidth = maHeaderBar->GetSizePixel().Width();
if( nWidth < TAB_WIDTH_MIN )
- maHeaderBar.SetItemSize( ITEMID_EVENT, TAB_WIDTH_MIN );
+ maHeaderBar->SetItemSize( ITEMID_EVENT, TAB_WIDTH_MIN );
else if( ( nBarWidth - nWidth ) < TAB_WIDTH_MIN )
- maHeaderBar.SetItemSize( ITEMID_EVENT, nBarWidth - TAB_WIDTH_MIN );
+ maHeaderBar->SetItemSize( ITEMID_EVENT, nBarWidth - TAB_WIDTH_MIN );
{
long nTmpSz = 0;
for( sal_uInt16 i = 1 ; i < _nTabs ; ++i )
{
- long _nWidth = maHeaderBar.GetItemSize( i );
+ long _nWidth = maHeaderBar->GetItemSize( i );
aSz.Width() = _nWidth + nTmpSz;
nTmpSz += _nWidth;
- maListBox.SetTab( i, PixelToLogic( aSz, MapMode( MAP_APPFONT ) ).Width(), MAP_APPFONT );
+ maListBox->SetTab( i, PixelToLogic( aSz, MapMode( MAP_APPFONT ) ).Width(), MAP_APPFONT );
}
}
}
@@ -121,8 +121,8 @@ bool MacroEventListBox::Notify( NotifyEvent& rNEvt )
if( rNEvt.GetType() == MouseNotifyEvent::GETFOCUS )
{
- if ( rNEvt.GetWindow() != &maListBox )
- maListBox.GrabFocus();
+ if ( rNEvt.GetWindow() != maListBox.get() )
+ maListBox->GrabFocus();
}
return nRet;
@@ -130,13 +130,25 @@ bool MacroEventListBox::Notify( NotifyEvent& rNEvt )
MacroEventListBox::MacroEventListBox( vcl::Window* pParent, WinBits nStyle )
: Control( pParent, nStyle )
- , maHeaderBar( this, WB_BUTTONSTYLE | WB_BOTTOMBORDER )
- , maListBox( this, WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP )
+ , maHeaderBar( VclPtr<HeaderBar>::Create( this, WB_BUTTONSTYLE | WB_BOTTOMBORDER ) )
+ , maListBox( VclPtr<SvHeaderTabListBox>::Create( this, WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP ) )
{
- maListBox.SetHelpId( HID_MACRO_HEADERTABLISTBOX );
+ maListBox->SetHelpId( HID_MACRO_HEADERTABLISTBOX );
// enable the cell focus to show visible focus
- maListBox.EnableCellFocus();
+ maListBox->EnableCellFocus();
+}
+
+MacroEventListBox::~MacroEventListBox()
+{
+ disposeOnce();
+}
+
+void MacroEventListBox::dispose()
+{
+ maHeaderBar.disposeAndClear();
+ maListBox.disposeAndClear();
+ Control::dispose();
}
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeMacroEventListBox(vcl::Window *pParent, VclBuilder::stringmap &rMap)
@@ -161,15 +173,15 @@ void MacroEventListBox::Resize()
// calc pos and size of header bar
Point aPnt( 0, 0 );
- Size aSize( maHeaderBar.CalcWindowSizePixel() );
+ Size aSize( maHeaderBar->CalcWindowSizePixel() );
Size aCtrlSize( GetOutputSizePixel() );
aSize.Width() = aCtrlSize.Width();
- maHeaderBar.SetPosSizePixel( aPnt, aSize );
+ maHeaderBar->SetPosSizePixel( aPnt, aSize );
// calc pos and size of ListBox
aPnt.Y() += aSize.Height();
aSize.Height() = aCtrlSize.Height() - aSize.Height();
- maListBox.SetPosSizePixel( aPnt, aSize );
+ maListBox->SetPosSizePixel( aPnt, aSize );
}
void MacroEventListBox::ConnectElements()
@@ -177,21 +189,21 @@ void MacroEventListBox::ConnectElements()
Resize();
// set handler
- maHeaderBar.SetEndDragHdl( LINK( this, MacroEventListBox, HeaderEndDrag_Impl ) );
+ maHeaderBar->SetEndDragHdl( LINK( this, MacroEventListBox, HeaderEndDrag_Impl ) );
- maListBox.InitHeaderBar( &maHeaderBar );
+ maListBox->InitHeaderBar( maHeaderBar.get() );
}
void MacroEventListBox::Show( bool bVisible, sal_uInt16 nFlags )
{
- maListBox.Show( bVisible, nFlags );
- maHeaderBar.Show( bVisible, nFlags );
+ maListBox->Show( bVisible, nFlags );
+ maHeaderBar->Show( bVisible, nFlags );
}
void MacroEventListBox::Enable( bool bEnable, bool bChild )
{
- maListBox.Enable( bEnable, bChild );
- maHeaderBar.Enable( bEnable, bChild );
+ maListBox->Enable( bEnable, bChild );
+ maHeaderBar->Enable( bEnable, bChild );
}
// assign button ("Add Command") is enabled only if it is not read only
@@ -226,7 +238,13 @@ _SvxMacroTabPage::_SvxMacroTabPage(vcl::Window* pParent, const OString& rID,
_SvxMacroTabPage::~_SvxMacroTabPage()
{
+ disposeOnce();
+}
+
+void _SvxMacroTabPage::dispose()
+{
DELETEZ( mpImpl );
+ SfxTabPage::dispose();
}
void _SvxMacroTabPage::InitResources()
@@ -640,7 +658,7 @@ long _SvxMacroTabPage::GenericHandler_Impl( _SvxMacroTabPage* pThis, PushButton*
)
)
{
- boost::scoped_ptr<AssignComponentDialog> pAssignDlg(new AssignComponentDialog( pThis, sEventURL ));
+ VclPtrInstance< AssignComponentDialog > pAssignDlg( pThis, sEventURL );
short ret = pAssignDlg->Execute();
if( ret )
@@ -654,7 +672,7 @@ long _SvxMacroTabPage::GenericHandler_Impl( _SvxMacroTabPage* pThis, PushButton*
else if( bAssEnabled )
{
// assign pressed
- boost::scoped_ptr<SvxScriptSelectorDialog> pDlg(new SvxScriptSelectorDialog( pThis, false, pThis->GetFrame() ));
+ VclPtrInstance< SvxScriptSelectorDialog > pDlg( pThis, false, pThis->GetFrame() );
if( pDlg )
{
short ret = pDlg->Execute();
@@ -836,7 +854,7 @@ SvxMacroAssignDlg::SvxMacroAssignDlg( vcl::Window* pParent, const Reference< fra
const Reference< container::XNameReplace >& xNameReplace, sal_uInt16 nSelectedIndex )
: SvxMacroAssignSingleTabDialog(pParent, rSet)
{
- SetTabPage(new SvxMacroTabPage(get_content_area(), _rxDocumentFrame, rSet, xNameReplace, nSelectedIndex));
+ SetTabPage(VclPtr<SvxMacroTabPage>::Create(get_content_area(), _rxDocumentFrame, rSet, xNameReplace, nSelectedIndex));
}
@@ -872,9 +890,15 @@ AssignComponentDialog::AssignComponentDialog( vcl::Window * pParent, const OUStr
AssignComponentDialog::~AssignComponentDialog()
{
+ disposeOnce();
}
-
+void AssignComponentDialog::dispose()
+{
+ mpMethodEdit.clear();
+ mpOKButton.clear();
+ ModalDialog::dispose();
+}
IMPL_LINK( SvxMacroAssignSingleTabDialog, OKHdl_Impl, Button *, pButton )
{
diff --git a/cui/source/customize/macropg_impl.hxx b/cui/source/customize/macropg_impl.hxx
index dd7909275085..f80697fb5783 100644
--- a/cui/source/customize/macropg_impl.hxx
+++ b/cui/source/customize/macropg_impl.hxx
@@ -25,14 +25,14 @@ class _SvxMacroTabPage_Impl
public:
_SvxMacroTabPage_Impl( const SfxItemSet& rAttrSet );
- PushButton* pAssignPB;
- PushButton* pAssignComponentPB;
- PushButton* pDeletePB;
+ VclPtr<PushButton> pAssignPB;
+ VclPtr<PushButton> pAssignComponentPB;
+ VclPtr<PushButton> pDeletePB;
Image aMacroImg;
Image aComponentImg;
OUString sStrEvent;
OUString sAssignedMacro;
- MacroEventListBox* pEventLB;
+ VclPtr<MacroEventListBox> pEventLB;
bool bReadOnly;
bool bIDEDialogMode;
};
@@ -40,8 +40,8 @@ public:
class AssignComponentDialog : public ModalDialog
{
private:
- Edit* mpMethodEdit;
- OKButton* mpOKButton;
+ VclPtr<Edit> mpMethodEdit;
+ VclPtr<OKButton> mpOKButton;
OUString maURL;
@@ -50,6 +50,7 @@ private:
public:
AssignComponentDialog( vcl::Window * pParent, const OUString& rURL );
virtual ~AssignComponentDialog();
+ virtual void dispose() SAL_OVERRIDE;
OUString getURL() const
{ return maURL; }
diff --git a/cui/source/customize/selector.cxx b/cui/source/customize/selector.cxx
index ee962883068e..7477032f1567 100644
--- a/cui/source/customize/selector.cxx
+++ b/cui/source/customize/selector.cxx
@@ -99,7 +99,13 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvxConfigFunctionListB
SvxConfigFunctionListBox::~SvxConfigFunctionListBox()
{
+ disposeOnce();
+}
+
+void SvxConfigFunctionListBox::dispose()
+{
ClearAll();
+ SvTreeListBox::dispose();
}
SvTreeListEntry* SvxConfigFunctionListBox::GetLastSelectedEntry()
@@ -227,7 +233,14 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvxConfigGroupListBox(
SvxConfigGroupListBox::~SvxConfigGroupListBox()
{
+ disposeOnce();
+}
+
+void SvxConfigGroupListBox::dispose()
+{
ClearAll();
+ pFunctionListBox.clear();
+ SvTreeListBox::dispose();
}
void SvxConfigGroupListBox::ClearAll()
@@ -908,6 +921,18 @@ SvxScriptSelectorDialog::SvxScriptSelectorDialog(
SvxScriptSelectorDialog::~SvxScriptSelectorDialog()
{
+ disposeOnce();
+}
+
+void SvxScriptSelectorDialog::dispose()
+{
+ m_pDialogDescription.clear();
+ m_pCategories.clear();
+ m_pCommands.clear();
+ m_pOKButton.clear();
+ m_pCancelButton.clear();
+ m_pDescriptionText.clear();
+ ModelessDialog::dispose();
}
IMPL_LINK( SvxScriptSelectorDialog, SelectHdl, Control*, pCtrl )
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index c9462aaa3e8a..dc58061832d7 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -246,17 +246,43 @@ SpellDialog::SpellDialog(SpellDialogChildWindow* pChildWindow,
SpellDialog::~SpellDialog()
{
- // save possibly modified user-dictionaries
- Reference< XSearchableDictionaryList > xDicList( SvxGetDictionaryList() );
- if (xDicList.is())
- {
- SaveDictionaries( xDicList );
- }
-
- delete pImpl;
+ disposeOnce();
}
+void SpellDialog::dispose()
+{
+ if (pImpl)
+ {
+ // save possibly modified user-dictionaries
+ Reference< XSearchableDictionaryList > xDicList( SvxGetDictionaryList() );
+ if (xDicList.is())
+ SaveDictionaries( xDicList );
+ delete pImpl;
+ pImpl = NULL;
+ }
+ m_pLanguageFT.clear();
+ m_pLanguageLB.clear();
+ m_pExplainFT.clear();
+ m_pExplainLink.clear();
+ m_pNotInDictFT.clear();
+ m_pSentenceED.clear();
+ m_pSuggestionFT.clear();
+ m_pSuggestionLB.clear();
+ m_pIgnorePB.clear();
+ m_pIgnoreAllPB.clear();
+ m_pIgnoreRulePB.clear();
+ m_pAddToDictPB.clear();
+ m_pAddToDictMB.clear();
+ m_pChangePB.clear();
+ m_pChangeAllPB.clear();
+ m_pAutoCorrPB.clear();
+ m_pCheckGrammarCB.clear();
+ m_pOptionsPB.clear();
+ m_pUndoPB.clear();
+ m_pClosePB.clear();
+ SfxModelessDialog::dispose();
+}
void SpellDialog::Init_Impl()
{
@@ -497,10 +523,10 @@ void SpellDialog::StartSpellOptDlg_Impl()
};
SfxItemSet aSet( SfxGetpApp()->GetPool(), aSpellInfos);
aSet.Put(SfxSpellCheckItem( xSpell, SID_ATTR_SPELL ));
- boost::scoped_ptr<SfxSingleTabDialog> pDlg(
- new SfxSingleTabDialog(this, aSet, "SpellOptionsDialog", "cui/ui/spelloptionsdialog.ui"));
- SfxTabPage* pPage = SvxLinguTabPage::Create( pDlg->get_content_area(), &aSet );
- static_cast<SvxLinguTabPage*>(pPage)->HideGroups( GROUP_MODULES );
+ VclPtr<SfxSingleTabDialog> pDlg(
+ VclPtr<SfxSingleTabDialog>::Create(this, aSet, "SpellOptionsDialog", "cui/ui/spelloptionsdialog.ui"));
+ VclPtr<SfxTabPage> pPage = SvxLinguTabPage::Create( pDlg->get_content_area(), &aSet );
+ static_cast<SvxLinguTabPage*>(pPage.get())->HideGroups( GROUP_MODULES );
pDlg->SetTabPage( pPage );
if(RET_OK == pDlg->Execute())
{
@@ -1199,9 +1225,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSentenceEditWindow(vcl
}
-SentenceEditWindow_Impl::~SentenceEditWindow_Impl()
-{
-}
/*-------------------------------------------------------------------------
The selection before inputting a key may have a range or not
and it may be inside or outside of field or error attributes.
@@ -2032,9 +2055,9 @@ IMPL_LINK( SpellDialog, HandleHyperlink, FixedHyperlink*, pHyperlink )
uno::Any exc( ::cppu::getCaughtException() );
OUString msg( ::comphelper::anyToString( exc ) );
const SolarMutexGuard guard;
- MessageDialog aErrorBox(NULL, msg);
- aErrorBox.SetText(sTitle);
- aErrorBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(nullptr, msg);
+ aErrorBox->SetText(sTitle);
+ aErrorBox->Execute();
}
return 1;
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index f5761d3093ff..1250e098e6ad 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -98,6 +98,23 @@ AboutDialog::AboutDialog(vcl::Window* pParent)
get<PushButton>("close")->GrabFocus();
}
+AboutDialog::~AboutDialog()
+{
+ disposeOnce();
+}
+
+void AboutDialog::dispose()
+{
+ m_pVersion.clear();
+ m_pDescriptionText.clear();
+ m_pCopyrightText.clear();
+ m_pLogoImage.clear();
+ m_pLogoReplacement.clear();
+ m_pCreditsButton.clear();
+ m_pWebsiteButton.clear();
+ SfxModalDialog::dispose();
+}
+
IMPL_LINK( AboutDialog, HandleClick, PushButton*, pButton )
{
OUString sURL = "";
@@ -126,9 +143,9 @@ IMPL_LINK( AboutDialog, HandleClick, PushButton*, pButton )
Any exc( ::cppu::getCaughtException() );
OUString msg( ::comphelper::anyToString( exc ) );
const SolarMutexGuard guard;
- MessageDialog aErrorBox(NULL, msg);
- aErrorBox.SetText( GetText() );
- aErrorBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(nullptr, msg);
+ aErrorBox->SetText( GetText() );
+ aErrorBox->Execute();
}
return 1;
diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx
index d1015e844e97..539c1e5f777b 100644
--- a/cui/source/dialogs/colorpicker.cxx
+++ b/cui/source/dialogs/colorpicker.cxx
@@ -309,6 +309,7 @@ class ColorFieldControl : public Control
public:
ColorFieldControl( vcl::Window* pParent, const WinBits& nStyle );
virtual ~ColorFieldControl();
+ virtual void dispose() SAL_OVERRIDE;
virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
@@ -359,7 +360,14 @@ ColorFieldControl::ColorFieldControl( vcl::Window* pParent, const WinBits& nStyl
ColorFieldControl::~ColorFieldControl()
{
+ disposeOnce();
+}
+
+void ColorFieldControl::dispose()
+{
delete mpBitmap;
+ mpBitmap = NULL;
+ Control::dispose();
}
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeColorFieldControl(vcl::Window *pParent, VclBuilder::stringmap &rMap)
@@ -702,6 +710,7 @@ class ColorSliderControl : public Control
public:
ColorSliderControl( vcl::Window* pParent, const WinBits& nStyle );
virtual ~ColorSliderControl();
+ virtual void dispose() SAL_OVERRIDE;
virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
@@ -744,7 +753,14 @@ ColorSliderControl::ColorSliderControl( vcl::Window* pParent, const WinBits& nSt
ColorSliderControl::~ColorSliderControl()
{
+ disposeOnce();
+}
+
+void ColorSliderControl::dispose()
+{
delete mpBitmap;
+ mpBitmap = NULL;
+ Control::dispose();
}
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeColorSliderControl(vcl::Window *pParent, VclBuilder::stringmap &rMap)
@@ -957,6 +973,8 @@ class ColorPickerDialog : public ModalDialog
{
public:
ColorPickerDialog( vcl::Window* pParent, sal_Int32 nColor, sal_Int16 nMode );
+ virtual ~ColorPickerDialog() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE;
void update_color( sal_uInt16 n = UPDATE_ALL );
@@ -976,35 +994,35 @@ private:
double mdCyan, mdMagenta, mdYellow, mdKey;
private:
- ColorFieldControl* mpColorField;
- ColorSliderControl* mpColorSlider;
- ColorPreviewControl* mpColorPreview;
- ColorPreviewControl* mpColorPrevious;
+ VclPtr<ColorFieldControl> mpColorField;
+ VclPtr<ColorSliderControl> mpColorSlider;
+ VclPtr<ColorPreviewControl> mpColorPreview;
+ VclPtr<ColorPreviewControl> mpColorPrevious;
- FixedImage* mpFISliderLeft;
- FixedImage* mpFISliderRight;
+ VclPtr<FixedImage> mpFISliderLeft;
+ VclPtr<FixedImage> mpFISliderRight;
Image maSliderImage;
- RadioButton* mpRBRed;
- RadioButton* mpRBGreen;
- RadioButton* mpRBBlue;
- RadioButton* mpRBHue;
- RadioButton* mpRBSaturation;
- RadioButton* mpRBBrightness;
-
- MetricField* mpMFRed;
- MetricField* mpMFGreen;
- MetricField* mpMFBlue;
- HexColorControl* mpEDHex;
-
- MetricField* mpMFHue;
- MetricField* mpMFSaturation;
- MetricField* mpMFBrightness;
-
- MetricField* mpMFCyan;
- MetricField* mpMFMagenta;
- MetricField* mpMFYellow;
- MetricField* mpMFKey;
+ VclPtr<RadioButton> mpRBRed;
+ VclPtr<RadioButton> mpRBGreen;
+ VclPtr<RadioButton> mpRBBlue;
+ VclPtr<RadioButton> mpRBHue;
+ VclPtr<RadioButton> mpRBSaturation;
+ VclPtr<RadioButton> mpRBBrightness;
+
+ VclPtr<MetricField> mpMFRed;
+ VclPtr<MetricField> mpMFGreen;
+ VclPtr<MetricField> mpMFBlue;
+ VclPtr<HexColorControl> mpEDHex;
+
+ VclPtr<MetricField> mpMFHue;
+ VclPtr<MetricField> mpMFSaturation;
+ VclPtr<MetricField> mpMFBrightness;
+
+ VclPtr<MetricField> mpMFCyan;
+ VclPtr<MetricField> mpMFMagenta;
+ VclPtr<MetricField> mpMFYellow;
+ VclPtr<MetricField> mpMFKey;
};
ColorPickerDialog::ColorPickerDialog( vcl::Window* pParent, sal_Int32 nColor, sal_Int16 nMode )
@@ -1110,6 +1128,34 @@ ColorPickerDialog::ColorPickerDialog( vcl::Window* pParent, sal_Int32 nColor, sa
update_color();
}
+void ColorPickerDialog::dispose()
+{
+ mpColorField.clear();
+ mpColorSlider.clear();
+ mpColorPreview.clear();
+ mpColorPrevious.clear();
+ mpFISliderLeft.clear();
+ mpFISliderRight.clear();
+ mpRBRed.clear();
+ mpRBGreen.clear();
+ mpRBBlue.clear();
+ mpRBHue.clear();
+ mpRBSaturation.clear();
+ mpRBBrightness.clear();
+ mpMFRed.clear();
+ mpMFGreen.clear();
+ mpMFBlue.clear();
+ mpEDHex.clear();
+ mpMFHue.clear();
+ mpMFSaturation.clear();
+ mpMFBrightness.clear();
+ mpMFCyan.clear();
+ mpMFMagenta.clear();
+ mpMFYellow.clear();
+ mpMFKey.clear();
+ ModalDialog::dispose();
+}
+
static int toInt( double dValue, double dRange )
{
return static_cast< int >( std::floor((dValue * dRange) + 0.5 ) );
@@ -1495,10 +1541,10 @@ void SAL_CALL ColorPicker::setTitle( const OUString& sTitle ) throw (RuntimeExce
sal_Int16 SAL_CALL ColorPicker::execute( ) throw (RuntimeException, std::exception)
{
- ColorPickerDialog aDlg( VCLUnoHelper::GetWindow( mxParent ), mnColor, mnMode );
- sal_Int16 ret = aDlg.Execute();
+ ScopedVclPtrInstance< ColorPickerDialog > aDlg( VCLUnoHelper::GetWindow( mxParent ), mnColor, mnMode );
+ sal_Int16 ret = aDlg->Execute();
if( ret )
- mnColor = aDlg.GetColor();
+ mnColor = aDlg->GetColor();
return ret;
}
diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index 6764c45f15fa..a351d820c872 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -100,15 +100,25 @@ SvxCharacterMap::SvxCharacterMap( vcl::Window* pParent, bool bOne_, const SfxIte
CreateOutputItemSet( pSet ? *pSet->GetPool() : SfxGetpApp()->GetPool() );
}
-
-
SvxCharacterMap::~SvxCharacterMap()
{
+ disposeOnce();
}
-
-
-
+void SvxCharacterMap::dispose()
+{
+ m_pShowSet.clear();
+ m_pShowText.clear();
+ m_pOKBtn.clear();
+ m_pFontText.clear();
+ m_pFontLB.clear();
+ m_pSubsetText.clear();
+ m_pSubsetLB.clear();
+ m_pSymbolText.clear();
+ m_pShowChar.clear();
+ m_pCharCodeText.clear();
+ SfxModalDialog::dispose();
+}
void SvxCharacterMap::SetChar( sal_UCS4 c )
@@ -174,8 +184,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvxShowText(vcl::Windo
return new SvxShowText(pParent);
}
-
-
void SvxShowText::Paint( const Rectangle& )
{
Color aTextCol = GetTextColor();
@@ -298,9 +306,6 @@ void SvxShowText::SetText( const OUString& rText )
-SvxShowText::~SvxShowText()
-{}
-
// class SvxCharacterMap =================================================
void SvxCharacterMap::init()
diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx
index 6f3643d3a772..0e11f72b8ccd 100644
--- a/cui/source/dialogs/cuifmsearch.cxx
+++ b/cui/source/dialogs/cuifmsearch.cxx
@@ -160,18 +160,51 @@ FmSearchDialog::FmSearchDialog(vcl::Window* pParent, const OUString& sInitialTex
FmSearchDialog::~FmSearchDialog()
{
+ disposeOnce();
+}
+
+void FmSearchDialog::dispose()
+{
if (m_aDelayedPaint.IsActive())
m_aDelayedPaint.Stop();
SaveParams();
- if (m_pConfig)
- {
- delete m_pConfig;
- m_pConfig = NULL;
- }
+ delete m_pConfig;
+ m_pConfig = NULL;
delete m_pSearchEngine;
+ m_pSearchEngine = NULL;
+
+ m_prbSearchForText.clear();
+ m_prbSearchForNull.clear();
+ m_prbSearchForNotNull.clear();
+ m_pcmbSearchText.clear();
+ m_pftForm.clear();
+ m_plbForm.clear();
+ m_prbAllFields.clear();
+ m_prbSingleField.clear();
+ m_plbField.clear();
+ m_pftPosition.clear();
+ m_plbPosition.clear();
+ m_pcbUseFormat.clear();
+ m_pcbCase.clear();
+ m_pcbBackwards.clear();
+ m_pcbStartOver.clear();
+ m_pcbWildCard.clear();
+ m_pcbRegular.clear();
+ m_pcbApprox.clear();
+ m_ppbApproxSettings.clear();
+ m_pHalfFullFormsCJK.clear();
+ m_pSoundsLikeCJK.clear();
+ m_pSoundsLikeCJKSettings.clear();
+ m_pftRecord.clear();
+ m_pftHint.clear();
+ m_pbSearchAgain.clear();
+ m_pbClose.clear();
+ m_pPreSearchFocus.clear();
+
+ ModalDialog::dispose();
}
void FmSearchDialog::Init(const OUString& strVisibleFields, const OUString& sInitialText)
@@ -604,7 +637,7 @@ void FmSearchDialog::EnableSearchUI(bool bEnable)
m_pPreSearchFocus->GrabFocus();
if ( WINDOW_EDIT == m_pPreSearchFocus->GetType() )
{
- Edit* pEdit = static_cast< Edit* >( m_pPreSearchFocus );
+ Edit* pEdit = static_cast< Edit* >( m_pPreSearchFocus.get() );
pEdit->SetSelection( Selection( 0, pEdit->GetText().getLength() ) );
}
}
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index a6a9ef3a507e..549d21054447 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -215,6 +215,19 @@ SearchProgress::SearchProgress( vcl::Window* pParent, const INetURLObject& rStar
m_pBtnCancel->SetClickHdl( LINK( this, SearchProgress, ClickCancelBtn ) );
}
+SearchProgress::~SearchProgress()
+{
+ disposeOnce();
+}
+
+void SearchProgress::dispose()
+{
+ m_pFtSearchDir.clear();
+ m_pFtSearchType.clear();
+ m_pBtnCancel.clear();
+ parent_.clear();
+ ModalDialog::dispose();
+}
void SearchProgress::Terminate()
@@ -240,7 +253,7 @@ IMPL_LINK_NOARG(SearchProgress, CleanUpHdl)
EndDialog( RET_OK );
- delete this;
+ disposeOnce();
return 0L;
}
@@ -260,7 +273,7 @@ void SearchProgress::StartExecuteModal( const Link& rEndDialogHdl )
{
assert(!maSearchThread.is());
maSearchThread = new SearchThread(
- this, static_cast< TPGalleryThemeProperties * >(parent_), startUrl_);
+ this, static_cast< TPGalleryThemeProperties * >(parent_.get()), startUrl_);
maSearchThread->launch();
ModalDialog::StartExecuteModal( rEndDialogHdl );
}
@@ -345,6 +358,19 @@ TakeProgress::TakeProgress(vcl::Window* pWindow)
m_pBtnCancel->SetClickHdl( LINK( this, TakeProgress, ClickCancelBtn ) );
}
+TakeProgress::~TakeProgress()
+{
+ disposeOnce();
+}
+
+void TakeProgress::dispose()
+{
+ m_pFtTakeFile.clear();
+ m_pBtnCancel.clear();
+ window_.clear();
+ ModalDialog::dispose();
+}
+
void TakeProgress::Terminate()
{
if (maTakeThread.is())
@@ -405,7 +431,7 @@ IMPL_LINK_NOARG(TakeProgress, CleanUpHdl)
GetParent()->LeaveWait();
EndDialog( RET_OK );
- delete this;
+ disposeOnce();
return 0L;
}
@@ -425,7 +451,7 @@ void TakeProgress::StartExecuteModal( const Link& rEndDialogHdl )
{
assert(!maTakeThread.is());
maTakeThread = new TakeThread(
- this, static_cast< TPGalleryThemeProperties * >(window_), maTakenList);
+ this, static_cast< TPGalleryThemeProperties * >(window_.get()), maTakenList);
maTakeThread->launch();
ModalDialog::StartExecuteModal( rEndDialogHdl );
}
@@ -443,6 +469,18 @@ ActualizeProgress::ActualizeProgress(vcl::Window* pWindow, GalleryTheme* pThm)
m_pBtnCancel->SetClickHdl( LINK( this, ActualizeProgress, ClickCancelBtn ) );
}
+ActualizeProgress::~ActualizeProgress()
+{
+ disposeOnce();
+}
+
+void ActualizeProgress::dispose()
+{
+ m_pFtActualizeFile.clear();
+ m_pBtnCancel.clear();
+ ModalDialog::dispose();
+}
+
short ActualizeProgress::Execute()
{
short nRet;
@@ -511,6 +549,17 @@ TitleDialog::TitleDialog(vcl::Window* pParent, const OUString& rOldTitle)
m_pEdit->GrabFocus();
}
+TitleDialog::~TitleDialog()
+{
+ disposeOnce();
+}
+
+void TitleDialog::dispose()
+{
+ m_pEdit.clear();
+ ModalDialog::dispose();
+}
+
// - GalleryIdDialog -
@@ -532,7 +581,17 @@ GalleryIdDialog::GalleryIdDialog( vcl::Window* pParent, GalleryTheme* _pThm )
m_pBtnOk->SetClickHdl( LINK( this, GalleryIdDialog, ClickOkHdl ) );
}
+GalleryIdDialog::~GalleryIdDialog()
+{
+ disposeOnce();
+}
+void GalleryIdDialog::dispose()
+{
+ m_pBtnOk.clear();
+ m_pLbResName.clear();
+ ModalDialog::dispose();
+}
IMPL_LINK_NOARG(GalleryIdDialog, ClickOkHdl)
{
@@ -552,8 +611,8 @@ IMPL_LINK_NOARG(GalleryIdDialog, ClickOkHdl)
aStr += pInfo->GetThemeName();
aStr += ")";
- InfoBox aBox( this, aStr );
- aBox.Execute();
+ ScopedVclPtrInstance< InfoBox > aBox( this, aStr );
+ aBox->Execute();
m_pLbResName->GrabFocus();
bDifferentThemeExists = true;
}
@@ -616,6 +675,22 @@ TPGalleryThemeGeneral::TPGalleryThemeGeneral(vcl::Window* pParent, const SfxItem
get(m_pFtMSShowChangeDate, "modified");
}
+TPGalleryThemeGeneral::~TPGalleryThemeGeneral()
+{
+ disposeOnce();
+}
+
+void TPGalleryThemeGeneral::dispose()
+{
+ m_pFiMSImage.clear();
+ m_pEdtMSName.clear();
+ m_pFtMSShowType.clear();
+ m_pFtMSShowPath.clear();
+ m_pFtMSShowContent.clear();
+ m_pFtMSShowChangeDate.clear();
+ SfxTabPage::dispose();
+}
+
void TPGalleryThemeGeneral::SetXChgData( ExchangeData* _pData )
{
pData = _pData;
@@ -682,9 +757,9 @@ bool TPGalleryThemeGeneral::FillItemSet( SfxItemSet* /*rSet*/ )
-SfxTabPage* TPGalleryThemeGeneral::Create( vcl::Window* pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> TPGalleryThemeGeneral::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return new TPGalleryThemeGeneral( pParent, *rSet );
+ return VclPtr<TPGalleryThemeGeneral>::Create( pParent, *rSet );
}
// - TPGalleryThemeProperties -
@@ -756,23 +831,34 @@ void TPGalleryThemeProperties::StartSearchFiles( const OUString& _rFolderURL, sh
TPGalleryThemeProperties::~TPGalleryThemeProperties()
{
+ disposeOnce();
+}
+
+void TPGalleryThemeProperties::dispose()
+{
xMediaPlayer.clear();
xDialogListener.clear();
for ( size_t i = 0, n = aFilterEntryList.size(); i < n; ++i ) {
delete aFilterEntryList[ i ];
}
+ aFilterEntryList.clear();
+
+ m_pCbbFileType.clear();
+ m_pLbxFound.clear();
+ m_pBtnSearch.clear();
+ m_pBtnTake.clear();
+ m_pBtnTakeAll.clear();
+ m_pCbxPreview.clear();
+ m_pWndPreview.clear();
+ SfxTabPage::dispose();
}
-
-
-SfxTabPage* TPGalleryThemeProperties::Create( vcl::Window* pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> TPGalleryThemeProperties::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return new TPGalleryThemeProperties( pParent, *rSet );
+ return VclPtr<TPGalleryThemeProperties>::Create( pParent, *rSet );
}
-
-
OUString TPGalleryThemeProperties::addExtension( const OUString& _rDisplayText, const OUString& _rExtension )
{
OUString sAllFilter( "(*.*)" );
@@ -951,7 +1037,7 @@ IMPL_LINK_NOARG(TPGalleryThemeProperties, SelectFileTypeHdl)
void TPGalleryThemeProperties::SearchFiles()
{
- SearchProgress* pProgress = new SearchProgress( this, aURL );
+ SearchProgress* pProgress = VclPtr<SearchProgress>::Create( this, aURL );
aFoundList.clear();
m_pLbxFound->Clear();
@@ -1010,12 +1096,12 @@ void TPGalleryThemeProperties::TakeFiles()
{
if( m_pLbxFound->GetSelectEntryCount() || ( bTakeAll && bEntriesFound ) )
{
- TakeProgress* pTakeProgress = new TakeProgress( this );
+ VclPtrInstance<TakeProgress> pTakeProgress( this );
pTakeProgress->Update();
pTakeProgress->StartExecuteModal(
Link() /* no postprocessing needed, pTakeProgress
- will be deleted in TakeProgress::CleanupHdl */ );
+ will be disposed in TakeProgress::CleanupHdl */ );
}
}
diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx
index 9eb47497865e..9e84ce37c102 100644
--- a/cui/source/dialogs/cuigrfflt.cxx
+++ b/cui/source/dialogs/cuigrfflt.cxx
@@ -153,6 +153,16 @@ GraphicFilterDialog::GraphicFilterDialog(vcl::Window* pParent,
mpPreview->init(&rGraphic, maModifyHdl);
}
+GraphicFilterDialog::~GraphicFilterDialog()
+{
+ disposeOnce();
+}
+
+void GraphicFilterDialog::dispose()
+{
+ mpPreview.clear();
+ ModalDialog::dispose();
+}
IMPL_LINK_NOARG(GraphicFilterDialog, ImplPreviewTimeoutHdl)
@@ -204,7 +214,18 @@ GraphicFilterMosaic::GraphicFilterMosaic( vcl::Window* pParent, const Graphic& r
mpMtrWidth->GrabFocus();
}
+GraphicFilterMosaic::~GraphicFilterMosaic()
+{
+ disposeOnce();
+}
+void GraphicFilterMosaic::dispose()
+{
+ mpMtrWidth.clear();
+ mpMtrHeight.clear();
+ mpCbxEdges.clear();
+ GraphicFilterDialog::dispose();
+}
Graphic GraphicFilterMosaic::GetFilteredGraphic( const Graphic& rGraphic,
double fScaleX, double fScaleY )
@@ -257,6 +278,16 @@ GraphicFilterSmooth::GraphicFilterSmooth( vcl::Window* pParent, const Graphic& r
mpMtrRadius->GrabFocus();
}
+GraphicFilterSmooth::~GraphicFilterSmooth()
+{
+ disposeOnce();
+}
+
+void GraphicFilterSmooth::dispose()
+{
+ mpMtrRadius.clear();
+ GraphicFilterDialog::dispose();
+}
Graphic GraphicFilterSmooth::GetFilteredGraphic( const Graphic& rGraphic, double /*fScaleX*/, double /*fScaleY*/ )
@@ -305,6 +336,17 @@ GraphicFilterSolarize::GraphicFilterSolarize( vcl::Window* pParent, const Graphi
mpCbxInvert->SetToggleHdl( GetModifyHdl() );
}
+GraphicFilterSolarize::~GraphicFilterSolarize()
+{
+ disposeOnce();
+}
+
+void GraphicFilterSolarize::dispose()
+{
+ mpMtrThreshold.clear();
+ mpCbxInvert.clear();
+ GraphicFilterDialog::dispose();
+}
Graphic GraphicFilterSolarize::GetFilteredGraphic( const Graphic& rGraphic,
@@ -356,6 +398,16 @@ GraphicFilterSepia::GraphicFilterSepia( vcl::Window* pParent, const Graphic& rGr
mpMtrSepia->SetModifyHdl( GetModifyHdl() );
}
+GraphicFilterSepia::~GraphicFilterSepia()
+{
+ disposeOnce();
+}
+
+void GraphicFilterSepia::dispose()
+{
+ mpMtrSepia.clear();
+ GraphicFilterDialog::dispose();
+}
Graphic GraphicFilterSepia::GetFilteredGraphic( const Graphic& rGraphic,
@@ -399,6 +451,16 @@ GraphicFilterPoster::GraphicFilterPoster(vcl::Window* pParent, const Graphic& rG
mpNumPoster->SetModifyHdl( GetModifyHdl() );
}
+GraphicFilterPoster::~GraphicFilterPoster()
+{
+ disposeOnce();
+}
+
+void GraphicFilterPoster::dispose()
+{
+ mpNumPoster.clear();
+ GraphicFilterDialog::dispose();
+}
Graphic GraphicFilterPoster::GetFilteredGraphic( const Graphic& rGraphic,
@@ -462,6 +524,16 @@ GraphicFilterEmboss::GraphicFilterEmboss(vcl::Window* pParent,
mpCtlLight->GrabFocus();
}
+GraphicFilterEmboss::~GraphicFilterEmboss()
+{
+ disposeOnce();
+}
+
+void GraphicFilterEmboss::dispose()
+{
+ mpCtlLight.clear();
+ GraphicFilterDialog::dispose();
+}
Graphic GraphicFilterEmboss::GetFilteredGraphic( const Graphic& rGraphic,
diff --git a/cui/source/dialogs/cuihyperdlg.cxx b/cui/source/dialogs/cuihyperdlg.cxx
index 41dc5a1be98b..1270e09f92d4 100644
--- a/cui/source/dialogs/cuihyperdlg.cxx
+++ b/cui/source/dialogs/cuihyperdlg.cxx
@@ -93,7 +93,7 @@ SvxHpLinkDlg::SvxHpLinkDlg (vcl::Window* pParent, SfxBindings* pBindings)
// insert pages
Image aImage;
OUString aStrTitle;
- SvxIconChoiceCtrlEntry* pEntry = NULL;
+ SvxIconChoiceCtrlEntry *pEntry;
aStrTitle = CUI_RESSTR( RID_SVXSTR_HYPERDLG_HLINETTP );
aImage = Image( CUI_RES ( RID_SVXBMP_HLINETTP ) );
@@ -157,11 +157,19 @@ SvxHpLinkDlg::SvxHpLinkDlg (vcl::Window* pParent, SfxBindings* pBindings)
SvxHpLinkDlg::~SvxHpLinkDlg ()
{
+ disposeOnce();
+}
+
+void SvxHpLinkDlg::dispose()
+{
// delete config item, so the base class (IconChoiceDialog) can not load it on the next start
SvtViewOptions aViewOpt( E_TABDIALOG, OUString::number(SID_HYPERLINK_DIALOG) );
aViewOpt.Delete();
delete mpItemSet;
+ mpItemSet = NULL;
+
+ IconChoiceDialog::dispose();
}
/*************************************************************************
diff --git a/cui/source/dialogs/cuiimapwnd.cxx b/cui/source/dialogs/cuiimapwnd.cxx
index 118da3fc5c50..98e059a2109a 100644
--- a/cui/source/dialogs/cuiimapwnd.cxx
+++ b/cui/source/dialogs/cuiimapwnd.cxx
@@ -73,4 +73,19 @@ URLDlg::URLDlg( vcl::Window* pWindow, const OUString& rURL, const OUString& rAlt
m_pCbbTargets->SetText( rTarget );
}
+URLDlg::~URLDlg()
+{
+ disposeOnce();
+}
+
+void URLDlg::dispose()
+{
+ m_pEdtURL.clear();
+ m_pCbbTargets.clear();
+ m_pEdtName.clear();
+ m_pEdtAlternativeText.clear();
+ m_pEdtDescription.clear();
+ ModalDialog::dispose();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/dialogs/cuitbxform.cxx b/cui/source/dialogs/cuitbxform.cxx
index 46ae5b5e78d6..b54de7fe8e31 100644
--- a/cui/source/dialogs/cuitbxform.cxx
+++ b/cui/source/dialogs/cuitbxform.cxx
@@ -41,4 +41,15 @@ FmInputRecordNoDialog::FmInputRecordNoDialog(vcl::Window * pParent)
m_pRecordNo->SetDecimalDigits(0);
}
+FmInputRecordNoDialog::~FmInputRecordNoDialog()
+{
+ disposeOnce();
+}
+
+void FmInputRecordNoDialog::dispose()
+{
+ m_pRecordNo.clear();
+ ModalDialog::dispose();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/dialogs/dlgname.cxx b/cui/source/dialogs/dlgname.cxx
index 83ee94c07fce..7745404b4ae5 100644
--- a/cui/source/dialogs/dlgname.cxx
+++ b/cui/source/dialogs/dlgname.cxx
@@ -45,6 +45,19 @@ SvxNameDialog::SvxNameDialog( vcl::Window* pWindow, const OUString& rName, const
pEdtName->SetModifyHdl(LINK(this, SvxNameDialog, ModifyHdl));
}
+SvxNameDialog::~SvxNameDialog()
+{
+ disposeOnce();
+}
+
+void SvxNameDialog::dispose()
+{
+ pFtDescription.clear();
+ pEdtName.clear();
+ pBtnOK.clear();
+ ModalDialog::dispose();
+}
+
IMPL_LINK_NOARG(SvxNameDialog, ModifyHdl)
{
if(aCheckNameHdl.IsSet())
@@ -73,6 +86,19 @@ SvxObjectNameDialog::SvxObjectNameDialog(
pEdtName->SetModifyHdl(LINK(this, SvxObjectNameDialog, ModifyHdl));
}
+SvxObjectNameDialog::~SvxObjectNameDialog()
+{
+ disposeOnce();
+}
+
+void SvxObjectNameDialog::dispose()
+{
+ pEdtName.clear();
+ pBtnOK.clear();
+ ModalDialog::dispose();
+}
+
+
IMPL_LINK_NOARG(SvxObjectNameDialog, ModifyHdl)
{
if(aCheckNameHdl.IsSet())
@@ -105,6 +131,17 @@ SvxObjectTitleDescDialog::SvxObjectTitleDescDialog(
pEdtTitle->SetSelection(Selection(SELECTION_MIN, SELECTION_MAX));
}
+SvxObjectTitleDescDialog::~SvxObjectTitleDescDialog()
+{
+ disposeOnce();
+}
+
+void SvxObjectTitleDescDialog::dispose()
+{
+ pEdtTitle.clear();
+ pEdtDescription.clear();
+ ModalDialog::dispose();
+}
/*************************************************************************
@@ -138,7 +175,18 @@ SvxMessDialog::SvxMessDialog( vcl::Window* pWindow, const OUString& rText, const
SvxMessDialog::~SvxMessDialog()
{
+ disposeOnce();
+}
+
+void SvxMessDialog::dispose()
+{
delete pImage;
+ pImage = NULL;
+ pFtDescription.clear();
+ pBtn1.clear();
+ pBtn2.clear();
+ pFtImage.clear();
+ ModalDialog::dispose();
}
/*************************************************************************/
diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx
index ade585801826..5fea052f03df 100644
--- a/cui/source/dialogs/hangulhanjadlg.cxx
+++ b/cui/source/dialogs/hangulhanjadlg.cxx
@@ -338,7 +338,13 @@ namespace svx
SuggestionSet::~SuggestionSet()
{
+ disposeOnce();
+ }
+
+ void SuggestionSet::dispose()
+ {
ClearSet();
+ ValueSet::dispose();
}
void SuggestionSet::UserDraw( const UserDrawEvent& rUDEvt )
@@ -366,29 +372,37 @@ namespace svx
SuggestionDisplay::SuggestionDisplay( vcl::Window* pParent, WinBits nBits )
: Control( pParent, nBits )
, m_bDisplayListBox( true )
- , m_aValueSet( this )
- , m_aListBox( this,GetStyle() | WB_BORDER )
+ , m_aValueSet( VclPtr<SuggestionSet>::Create(this) )
+ , m_aListBox( VclPtr<ListBox>::Create(this,GetStyle() | WB_BORDER) )
, m_bInSelectionUpdate( false )
{
- m_aValueSet.SetSelectHdl( LINK( this, SuggestionDisplay, SelectSuggestionHdl ) );
- m_aListBox.SetSelectHdl( LINK( this, SuggestionDisplay, SelectSuggestionHdl ) );
+ m_aValueSet->SetSelectHdl( LINK( this, SuggestionDisplay, SelectSuggestionHdl ) );
+ m_aListBox->SetSelectHdl( LINK( this, SuggestionDisplay, SelectSuggestionHdl ) );
- m_aValueSet.SetLineCount( LINE_CNT );
- m_aValueSet.SetStyle( m_aValueSet.GetStyle() | WB_ITEMBORDER | WB_FLATVALUESET | WB_VSCROLL );
- m_aValueSet.SetBorderStyle( WindowBorderStyle::MONO );
+ m_aValueSet->SetLineCount( LINE_CNT );
+ m_aValueSet->SetStyle( m_aValueSet->GetStyle() | WB_ITEMBORDER | WB_FLATVALUESET | WB_VSCROLL );
+ m_aValueSet->SetBorderStyle( WindowBorderStyle::MONO );
OUString aOneCharacter("AU");
long nItemWidth = 2*GetTextWidth( aOneCharacter );
- m_aValueSet.SetItemWidth( nItemWidth );
+ m_aValueSet->SetItemWidth( nItemWidth );
Size aSize( approximate_char_width() * 48, GetTextHeight() * 5 );
- m_aValueSet.SetSizePixel( aSize );
- m_aListBox.SetSizePixel( aSize );
+ m_aValueSet->SetSizePixel( aSize );
+ m_aListBox->SetSizePixel( aSize );
implUpdateDisplay();
}
SuggestionDisplay::~SuggestionDisplay()
{
+ disposeOnce();
+ }
+
+ void SuggestionDisplay::dispose()
+ {
+ m_aValueSet.disposeAndClear();
+ m_aListBox.disposeAndClear();
+ Control::dispose();
}
void SuggestionDisplay::implUpdateDisplay()
@@ -396,8 +410,8 @@ namespace svx
bool bShowBox = IsVisible() && m_bDisplayListBox;
bool bShowSet = IsVisible() && !m_bDisplayListBox;
- m_aListBox.Show( bShowBox );
- m_aValueSet.Show( bShowSet );
+ m_aListBox->Show( bShowBox );
+ m_aValueSet->Show( bShowSet );
}
void SuggestionDisplay::StateChanged( StateChangedType nStateChange )
@@ -409,8 +423,8 @@ namespace svx
Control& SuggestionDisplay::implGetCurrentControl()
{
if( m_bDisplayListBox )
- return m_aListBox;
- return m_aValueSet;
+ return *m_aListBox.get();
+ return *m_aValueSet.get();
}
void SuggestionDisplay::KeyInput( const KeyEvent& rKEvt )
@@ -467,15 +481,15 @@ namespace svx
return 0L;
m_bInSelectionUpdate = true;
- if( pControl == &m_aListBox )
+ if( pControl == m_aListBox.get() )
{
- sal_uInt16 nPos = m_aListBox.GetSelectEntryPos();
- m_aValueSet.SelectItem( nPos+1 ); //itemid == pos+1 (id 0 has special meaning)
+ sal_uInt16 nPos = m_aListBox->GetSelectEntryPos();
+ m_aValueSet->SelectItem( nPos+1 ); //itemid == pos+1 (id 0 has special meaning)
}
else
{
- sal_uInt16 nPos = m_aValueSet.GetSelectItemId()-1; //itemid == pos+1 (id 0 has special meaning)
- m_aListBox.SelectEntryPos( nPos );
+ sal_uInt16 nPos = m_aValueSet->GetSelectItemId()-1; //itemid == pos+1 (id 0 has special meaning)
+ m_aListBox->SelectEntryPos( nPos );
}
m_bInSelectionUpdate = false;
m_aSelectLink.Call( this );
@@ -488,38 +502,38 @@ namespace svx
}
void SuggestionDisplay::Clear()
{
- m_aListBox.Clear();
- m_aValueSet.Clear();
+ m_aListBox->Clear();
+ m_aValueSet->Clear();
}
void SuggestionDisplay::InsertEntry( const OUString& rStr )
{
- sal_uInt16 nItemId = m_aListBox.InsertEntry( rStr ) + 1; //itemid == pos+1 (id 0 has special meaning)
- m_aValueSet.InsertItem( nItemId );
+ sal_uInt16 nItemId = m_aListBox->InsertEntry( rStr ) + 1; //itemid == pos+1 (id 0 has special meaning)
+ m_aValueSet->InsertItem( nItemId );
OUString* pItemData = new OUString( rStr );
- m_aValueSet.SetItemData( nItemId, pItemData );
+ m_aValueSet->SetItemData( nItemId, pItemData );
}
void SuggestionDisplay::SelectEntryPos( sal_uInt16 nPos )
{
- m_aListBox.SelectEntryPos( nPos );
- m_aValueSet.SelectItem( nPos+1 ); //itemid == pos+1 (id 0 has special meaning)
+ m_aListBox->SelectEntryPos( nPos );
+ m_aValueSet->SelectItem( nPos+1 ); //itemid == pos+1 (id 0 has special meaning)
}
sal_uInt16 SuggestionDisplay::GetEntryCount() const
{
- return m_aListBox.GetEntryCount();
+ return m_aListBox->GetEntryCount();
}
OUString SuggestionDisplay::GetEntry( sal_uInt16 nPos ) const
{
- return m_aListBox.GetEntry( nPos );
+ return m_aListBox->GetEntry( nPos );
}
OUString SuggestionDisplay::GetSelectEntry() const
{
- return m_aListBox.GetSelectEntry();
+ return m_aListBox->GetSelectEntry();
}
void SuggestionDisplay::SetHelpIds()
{
this->SetHelpId( HID_HANGULDLG_SUGGESTIONS );
- m_aValueSet.SetHelpId( HID_HANGULDLG_SUGGESTIONS_GRID );
- m_aListBox.SetHelpId( HID_HANGULDLG_SUGGESTIONS_LIST );
+ m_aValueSet->SetHelpId( HID_HANGULDLG_SUGGESTIONS_GRID );
+ m_aListBox->SetHelpId( HID_HANGULDLG_SUGGESTIONS_LIST );
}
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSuggestionDisplay( vcl::Window *pParent, VclBuilder::stringmap & )
@@ -591,11 +605,35 @@ namespace svx
m_pSuggestions->SetHelpIds();
}
-
- HangulHanjaConversionDialog::~HangulHanjaConversionDialog( )
+ HangulHanjaConversionDialog::~HangulHanjaConversionDialog()
{
+ disposeOnce();
}
+ void HangulHanjaConversionDialog::dispose()
+ {
+ m_pFind.clear();
+ m_pIgnore.clear();
+ m_pIgnoreAll.clear();
+ m_pReplace.clear();
+ m_pReplaceAll.clear();
+ m_pOptions.clear();
+ m_pSuggestions.clear();
+ m_pSimpleConversion.clear();
+ m_pHangulBracketed.clear();
+ m_pHanjaBracketed.clear();
+ m_pWordInput.clear();
+ m_pOriginalWord.clear();
+ m_pHanjaAbove.clear();
+ m_pHanjaBelow.clear();
+ m_pHangulAbove.clear();
+ m_pHangulBelow.clear();
+ m_pHangulOnly.clear();
+ m_pHanjaOnly.clear();
+ m_pReplaceByChar.clear();
+ m_pIgnoreNonPrimary.clear();
+ ModalDialog::dispose();
+ }
void HangulHanjaConversionDialog::FillSuggestions( const ::com::sun::star::uno::Sequence< OUString >& _rSuggestions )
{
@@ -723,8 +761,8 @@ namespace svx
IMPL_LINK_NOARG( HangulHanjaConversionDialog, OnOption )
{
- HangulHanjaOptionsDialog aOptDlg( this );
- aOptDlg.Execute();
+ ScopedVclPtrInstance< HangulHanjaOptionsDialog > aOptDlg(this);
+ aOptDlg->Execute();
m_aOptionsChangedLink.Call( this );
return 0L;
}
@@ -1003,9 +1041,9 @@ namespace svx
IMPL_LINK_NOARG(HangulHanjaOptionsDialog, NewDictHdl)
{
OUString aName;
- HangulHanjaNewDictDialog aNewDlg( this );
- aNewDlg.Execute();
- if( aNewDlg.GetName( aName ) )
+ ScopedVclPtrInstance< HangulHanjaNewDictDialog > aNewDlg(this);
+ aNewDlg->Execute();
+ if( aNewDlg->GetName( aName ) )
{
if( m_xConversionDictionaryList.is() )
{
@@ -1039,8 +1077,8 @@ namespace svx
DBG_ASSERT( pEntry, "+HangulHanjaEditDictDialog::EditDictHdl(): call of edit should not be possible with no selection!" );
if( pEntry )
{
- HangulHanjaEditDictDialog aEdDlg( this, m_aDictList, m_pDictsLB->GetSelectEntryPos() );
- aEdDlg.Execute();
+ ScopedVclPtrInstance< HangulHanjaEditDictDialog > aEdDlg(this, m_aDictList, m_pDictsLB->GetSelectEntryPos());
+ aEdDlg->Execute();
}
return 0L;
}
@@ -1125,17 +1163,34 @@ namespace svx
HangulHanjaOptionsDialog::~HangulHanjaOptionsDialog()
{
- SvTreeListEntry* pEntry = m_pDictsLB->First();
- while( pEntry )
+ disposeOnce();
+ }
+
+ void HangulHanjaOptionsDialog::dispose()
+ {
+ if (m_pDictsLB)
{
- OUString const * pDel = static_cast<OUString const *>(pEntry->GetUserData());
- if( pDel )
- delete pDel;
- pEntry = m_pDictsLB->Next( pEntry );
+ SvTreeListEntry* pEntry = m_pDictsLB->First();
+ while( pEntry )
+ {
+ delete static_cast<OUString const *>(pEntry->GetUserData());
+ pEntry->SetUserData( NULL );
+ pEntry = m_pDictsLB->Next( pEntry );
+ }
}
- if( m_pCheckButtonData )
- delete m_pCheckButtonData;
+ delete m_pCheckButtonData;
+ m_pCheckButtonData = NULL;
+
+ m_pDictsLB.clear();
+ m_pIgnorepostCB.clear();
+ m_pShowrecentlyfirstCB.clear();
+ m_pAutoreplaceuniqueCB.clear();
+ m_pNewPB.clear();
+ m_pEditPB.clear();
+ m_pDeletePB.clear();
+ m_pOkPB.clear();
+ ModalDialog::dispose();
}
void HangulHanjaOptionsDialog::AddDict( const OUString& _rName, bool _bChecked )
@@ -1182,6 +1237,18 @@ namespace svx
m_pDictNameED->SetModifyHdl( LINK( this, HangulHanjaNewDictDialog, ModifyHdl ) );
}
+ HangulHanjaNewDictDialog::~HangulHanjaNewDictDialog()
+ {
+ disposeOnce();
+ }
+
+ void HangulHanjaNewDictDialog::dispose()
+ {
+ m_pDictNameED.clear();
+ m_pOkBtn.clear();
+ ModalDialog::dispose();
+ }
+
bool HangulHanjaNewDictDialog::GetName( OUString& _rRetName ) const
{
if( m_bEntered )
@@ -1359,6 +1426,15 @@ namespace svx
SuggestionEdit::~SuggestionEdit()
{
+ disposeOnce();
+ }
+
+ void SuggestionEdit::dispose()
+ {
+ m_pPrev.clear();
+ m_pNext.clear();
+ m_pScrollBar.clear();
+ Edit::dispose();
}
bool SuggestionEdit::PreNotify( NotifyEvent& rNEvt )
@@ -1769,8 +1845,23 @@ namespace svx
HangulHanjaEditDictDialog::~HangulHanjaEditDictDialog()
{
- if( m_pSuggestions )
- delete m_pSuggestions;
+ disposeOnce();
+ }
+
+ void HangulHanjaEditDictDialog::dispose()
+ {
+ delete m_pSuggestions;
+ m_pSuggestions = NULL;
+ m_aBookLB.clear();
+ m_aOriginalLB.clear();
+ m_aEdit1.clear();
+ m_aEdit2.clear();
+ m_aEdit3.clear();
+ m_aEdit4.clear();
+ m_aScrollSB.clear();
+ m_aNewPB.clear();
+ m_aDeletePB.clear();
+ ModalDialog::dispose();
}
void HangulHanjaEditDictDialog::UpdateScrollbar()
diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index 4711a1f574ce..b0657eef30cf 100644
--- a/cui/source/dialogs/hldocntp.cxx
+++ b/cui/source/dialogs/hldocntp.cxx
@@ -129,12 +129,23 @@ SvxHyperlinkNewDocTp::SvxHyperlinkNewDocTp ( vcl::Window *pParent, IconChoiceDia
SvxHyperlinkNewDocTp::~SvxHyperlinkNewDocTp ()
{
- for ( sal_uInt16 n=0; n<m_pLbDocTypes->GetEntryCount(); n++ )
+ disposeOnce();
+}
+
+void SvxHyperlinkNewDocTp::dispose()
+{
+ if (m_pLbDocTypes)
{
- DocumentTypeData* pTypeData = static_cast<DocumentTypeData*>(
- m_pLbDocTypes->GetEntryData ( n ));
- delete pTypeData;
+ for ( sal_uInt16 n=0; n<m_pLbDocTypes->GetEntryCount(); n++ )
+ delete static_cast<DocumentTypeData*>(m_pLbDocTypes->GetEntryData ( n ));
+ m_pLbDocTypes = NULL;
}
+ m_pRbtEditNow.clear();
+ m_pRbtEditLater.clear();
+ m_pCbbPath.clear();
+ m_pBtCreate.clear();
+ m_pLbDocTypes.clear();
+ SvxHyperlinkTabPageBase::dispose();
}
/*************************************************************************
@@ -232,9 +243,9 @@ void SvxHyperlinkNewDocTp::GetCurentItemData ( OUString& rStrURL, OUString& aStr
|*
|************************************************************************/
-IconChoicePage* SvxHyperlinkNewDocTp::Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet )
+VclPtr<IconChoicePage> SvxHyperlinkNewDocTp::Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet )
{
- return new SvxHyperlinkNewDocTp( pWindow, pDlg, rItemSet );
+ return VclPtr<SvxHyperlinkNewDocTp>::Create( pWindow, pDlg, rItemSet );
}
/*************************************************************************
@@ -260,8 +271,8 @@ bool SvxHyperlinkNewDocTp::AskApply()
bool bRet = ImplGetURLObject( m_pCbbPath->GetText(), m_pCbbPath->GetBaseURL(), aINetURLObject );
if ( !bRet )
{
- WarningBox aWarning( this, WB_OK, CUI_RESSTR(RID_SVXSTR_HYPDLG_NOVALIDFILENAME) );
- aWarning.Execute();
+ ScopedVclPtrInstance< WarningBox > aWarning( this, WB_OK, CUI_RESSTR(RID_SVXSTR_HYPDLG_NOVALIDFILENAME) );
+ aWarning->Execute();
}
return bRet;
}
@@ -310,8 +321,8 @@ void SvxHyperlinkNewDocTp::DoApply ()
if( bOk )
{
- WarningBox aWarning( this, WB_YES_NO, CUI_RESSTR(RID_SVXSTR_HYPERDLG_QUERYOVERWRITE) );
- bCreate = aWarning.Execute() == RET_YES;
+ ScopedVclPtrInstance<WarningBox> aWarning( this, WB_YES_NO, CUI_RESSTR(RID_SVXSTR_HYPERDLG_QUERYOVERWRITE) );
+ bCreate = aWarning->Execute() == RET_YES;
}
}
diff --git a/cui/source/dialogs/hldoctp.cxx b/cui/source/dialogs/hldoctp.cxx
index 11fe8e63db34..fd9340d599b2 100644
--- a/cui/source/dialogs/hldoctp.cxx
+++ b/cui/source/dialogs/hldoctp.cxx
@@ -71,8 +71,19 @@ SvxHyperlinkDocTp::SvxHyperlinkDocTp ( vcl::Window *pParent, IconChoiceDialog* p
maTimer.SetTimeoutHdl ( LINK ( this, SvxHyperlinkDocTp, TimeoutHdl_Impl ) );
}
-SvxHyperlinkDocTp::~SvxHyperlinkDocTp ()
+SvxHyperlinkDocTp::~SvxHyperlinkDocTp()
{
+ disposeOnce();
+}
+
+void SvxHyperlinkDocTp::dispose()
+{
+ m_pCbbPath.clear();
+ m_pBtFileopen.clear();
+ m_pEdTarget.clear();
+ m_pFtFullURL.clear();
+ m_pBtBrowse.clear();
+ SvxHyperlinkTabPageBase::dispose();
}
/*************************************************************************
@@ -157,9 +168,9 @@ void SvxHyperlinkDocTp::GetCurentItemData ( OUString& rStrURL, OUString& aStrNam
|*
|************************************************************************/
-IconChoicePage* SvxHyperlinkDocTp::Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet )
+VclPtr<IconChoicePage> SvxHyperlinkDocTp::Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet )
{
- return new SvxHyperlinkDocTp( pWindow, pDlg, rItemSet );
+ return VclPtr<SvxHyperlinkDocTp>::Create( pWindow, pDlg, rItemSet );
}
/*************************************************************************
diff --git a/cui/source/dialogs/hlinettp.cxx b/cui/source/dialogs/hlinettp.cxx
index 3c7bfcc1c4a4..e6cb7c0a4b31 100644
--- a/cui/source/dialogs/hlinettp.cxx
+++ b/cui/source/dialogs/hlinettp.cxx
@@ -81,8 +81,23 @@ SvxHyperlinkInternetTp::SvxHyperlinkInternetTp ( vcl::Window *pParent,
maTimer.SetTimeoutHdl ( LINK ( this, SvxHyperlinkInternetTp, TimeoutHdl_Impl ) );
}
-SvxHyperlinkInternetTp::~SvxHyperlinkInternetTp ()
+SvxHyperlinkInternetTp::~SvxHyperlinkInternetTp()
{
+ disposeOnce();
+}
+
+void SvxHyperlinkInternetTp::dispose()
+{
+ m_pRbtLinktypInternet.clear();
+ m_pRbtLinktypFTP.clear();
+ m_pCbbTarget.clear();
+ m_pBtBrowse.clear();
+ m_pFtLogin.clear();
+ m_pEdLogin.clear();
+ m_pFtPassword.clear();
+ m_pEdPassword.clear();
+ m_pCbAnonymous.clear();
+ SvxHyperlinkTabPageBase::dispose();
}
/*************************************************************************
@@ -187,9 +202,9 @@ OUString SvxHyperlinkInternetTp::CreateAbsoluteURL() const
|*
|************************************************************************/
-IconChoicePage* SvxHyperlinkInternetTp::Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet )
+VclPtr<IconChoicePage> SvxHyperlinkInternetTp::Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet )
{
- return new SvxHyperlinkInternetTp( pWindow, pDlg, rItemSet );
+ return VclPtr<SvxHyperlinkInternetTp>::Create( pWindow, pDlg, rItemSet );
}
/*************************************************************************
@@ -401,7 +416,7 @@ IMPL_LINK_NOARG(SvxHyperlinkInternetTp, ClickBrowseHdl_Impl)
SfxBoolItem aBrowse( SID_BROWSE, true );
const SfxPoolItem *ppItems[] = { &aName, &aNewView, &aSilent, &aReadOnly, &aRefererItem, &aBrowse, NULL };
- static_cast<SvxHpLinkDlg*>(mpDialog)->GetBindings()->Execute( SID_OPENDOC, ppItems, 0, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD );
+ static_cast<SvxHpLinkDlg*>(mpDialog.get())->GetBindings()->Execute( SID_OPENDOC, ppItems, 0, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD );
return 0L;
}
diff --git a/cui/source/dialogs/hlmailtp.cxx b/cui/source/dialogs/hlmailtp.cxx
index 5c114ff317f0..10336197a848 100644
--- a/cui/source/dialogs/hlmailtp.cxx
+++ b/cui/source/dialogs/hlmailtp.cxx
@@ -66,8 +66,18 @@ SvxHyperlinkMailTp::SvxHyperlinkMailTp ( vcl::Window *pParent, IconChoiceDialog*
m_pBtAdrBook->Hide();
}
-SvxHyperlinkMailTp::~SvxHyperlinkMailTp ()
+SvxHyperlinkMailTp::~SvxHyperlinkMailTp()
{
+ disposeOnce();
+}
+
+void SvxHyperlinkMailTp::dispose()
+{
+ m_pCbbReceiver.clear();
+ m_pBtAdrBook.clear();
+ m_pFtSubject.clear();
+ m_pEdSubject.clear();
+ SvxHyperlinkTabPageBase::dispose();
}
/*************************************************************************
@@ -161,9 +171,9 @@ OUString SvxHyperlinkMailTp::CreateAbsoluteURL() const
|*
|************************************************************************/
-IconChoicePage* SvxHyperlinkMailTp::Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet )
+VclPtr<IconChoicePage> SvxHyperlinkMailTp::Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet )
{
- return new SvxHyperlinkMailTp( pWindow, pDlg, rItemSet );
+ return VclPtr<SvxHyperlinkMailTp>::Create( pWindow, pDlg, rItemSet );
}
/*************************************************************************
diff --git a/cui/source/dialogs/hlmarkwn.cxx b/cui/source/dialogs/hlmarkwn.cxx
index a2b83836abf2..80b8690d5713 100644
--- a/cui/source/dialogs/hlmarkwn.cxx
+++ b/cui/source/dialogs/hlmarkwn.cxx
@@ -72,6 +72,17 @@ SvxHlmarkTreeLBox::SvxHlmarkTreeLBox(vcl::Window* pParent, WinBits nStyle)
SetNodeDefaultImages();
}
+SvxHlmarkTreeLBox::~SvxHlmarkTreeLBox()
+{
+ disposeOnce();
+}
+
+void SvxHlmarkTreeLBox::dispose()
+{
+ mpParentWnd.clear();
+ SvTreeListBox::dispose();
+}
+
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvxHlmarkTreeLBox(vcl::Window *pParent, VclBuilder::stringmap &rMap)
{
WinBits nWinStyle = WB_TABSTOP;
@@ -150,7 +161,17 @@ SvxHlinkDlgMarkWnd::SvxHlinkDlgMarkWnd( SvxHyperlinkTabPageBase *pParent )
SvxHlinkDlgMarkWnd::~SvxHlinkDlgMarkWnd()
{
+ disposeOnce();
+}
+
+void SvxHlinkDlgMarkWnd::dispose()
+{
ClearTree();
+ mpBtApply.clear();
+ mpBtClose.clear();
+ mpLbTree.clear();
+ mpParent.clear();
+ ModalDialog::dispose();
}
/*************************************************************************
diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx
index 293b04069896..9260c684cfac 100644
--- a/cui/source/dialogs/hltpbase.cxx
+++ b/cui/source/dialogs/hltpbase.cxx
@@ -105,11 +105,25 @@ SvxHyperlinkTabPageBase::SvxHyperlinkTabPageBase ( vcl::Window *pParent,
mpMarkWnd = new SvxHlinkDlgMarkWnd ( this );
}
-SvxHyperlinkTabPageBase::~SvxHyperlinkTabPageBase ()
+SvxHyperlinkTabPageBase::~SvxHyperlinkTabPageBase()
+{
+ disposeOnce();
+}
+
+void SvxHyperlinkTabPageBase::dispose()
{
maTimer.Stop();
- delete mpMarkWnd;
+ mpMarkWnd.disposeAndClear();
+
+ mpCbbFrame.clear();
+ mpLbForm.clear();
+ mpEdIndication.clear();
+ mpEdText.clear();
+ mpBtScript.clear();
+ mpDialog.clear();
+
+ IconChoicePage::dispose();
}
void SvxHyperlinkTabPageBase::ActivatePage()
@@ -283,13 +297,13 @@ void SvxHyperlinkTabPageBase::SetInitFocus()
// Ask dialog whether the curretn doc is a HTML-doc
bool SvxHyperlinkTabPageBase::IsHTMLDoc() const
{
- return static_cast<SvxHpLinkDlg*>(mpDialog)->IsHTMLDoc();
+ return static_cast<SvxHpLinkDlg*>(mpDialog.get())->IsHTMLDoc();
}
// retrieve dispatcher
SfxDispatcher* SvxHyperlinkTabPageBase::GetDispatcher() const
{
- return static_cast<SvxHpLinkDlg*>(mpDialog)->GetDispatcher();
+ return static_cast<SvxHpLinkDlg*>(mpDialog.get())->GetDispatcher();
}
// Click on imagebutton : Script
@@ -319,10 +333,10 @@ IMPL_LINK_NOARG(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl)
bool bIsInputEnabled = GetParent()->IsInputEnabled();
if ( bIsInputEnabled )
GetParent()->EnableInput( false );
- SfxMacroAssignDlg aDlg( this, mxDocumentFrame, *pItemSet );
+ ScopedVclPtrInstance< SfxMacroAssignDlg > aDlg( this, mxDocumentFrame, *pItemSet );
// add events
- SfxMacroTabPage *pMacroPage = static_cast<SfxMacroTabPage*>( aDlg.GetTabPage() );
+ SfxMacroTabPage *pMacroPage = static_cast<SfxMacroTabPage*>( aDlg->GetTabPage() );
if ( pHyperlinkItem->GetMacroEvents() & HYPERDLG_EVENT_MOUSEOVER_OBJECT )
pMacroPage->AddEvent( OUString( CUI_RESSTR(RID_SVXSTR_HYPDLG_MACROACT1) ),
@@ -338,11 +352,11 @@ IMPL_LINK_NOARG(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl)
GetParent()->EnableInput( true );
// execute dlg
DisableClose( true );
- short nRet = aDlg.Execute();
+ short nRet = aDlg->Execute();
DisableClose( false );
if ( RET_OK == nRet )
{
- const SfxItemSet* pOutSet = aDlg.GetOutputItemSet();
+ const SfxItemSet* pOutSet = aDlg->GetOutputItemSet();
const SfxPoolItem* pItem;
if( SfxItemState::SET == pOutSet->GetItemState( SID_ATTR_MACROITEM, false, &pItem ))
{
diff --git a/cui/source/dialogs/hyphen.cxx b/cui/source/dialogs/hyphen.cxx
index c6c7bb19b71c..e124a435fefc 100644
--- a/cui/source/dialogs/hyphen.cxx
+++ b/cui/source/dialogs/hyphen.cxx
@@ -512,9 +512,22 @@ SvxHyphenWordDialog::SvxHyphenWordDialog(
Enable( false );
}
-
SvxHyphenWordDialog::~SvxHyphenWordDialog()
{
+ disposeOnce();
+}
+
+void SvxHyphenWordDialog::dispose()
+{
+ m_pWordEdit.clear();
+ m_pLeftBtn.clear();
+ m_pRightBtn.clear();
+ m_pOkBtn.clear();
+ m_pContBtn.clear();
+ m_pDelBtn.clear();
+ m_pHyphAll.clear();
+ m_pCloseBtn.clear();
+ SfxModalDialog::dispose();
}
diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index 1c999e3cde65..d1c8c3523e9d 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -52,9 +52,15 @@ IconChoicePage::IconChoicePage( vcl::Window *pParent, const OString& rID,
}
-
IconChoicePage::~IconChoicePage()
{
+ disposeOnce();
+}
+
+void IconChoicePage::dispose()
+{
+ pDialog.clear();
+ TabPage::dispose();
}
/**********************************************************************
@@ -150,8 +156,8 @@ void IconChoicePage::DataChanged( const DataChangedEvent& rDCEvt )
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvtIconChoiceCtrl(vcl::Window *pParent, VclBuilder::stringmap &)
{
return new SvtIconChoiceCtrl(pParent, WB_3DLOOK | WB_ICON | WB_BORDER |
- WB_NOCOLUMNHEADER | WB_HIGHLIGHTFRAME |
- WB_NODRAGSELECTION | WB_TABSTOP);
+ WB_NOCOLUMNHEADER | WB_HIGHLIGHTFRAME |
+ WB_NODRAGSELECTION | WB_TABSTOP);
}
IconChoiceDialog::IconChoiceDialog ( vcl::Window* pParent, const OUString& rID,
@@ -209,6 +215,11 @@ IconChoiceDialog::IconChoiceDialog ( vcl::Window* pParent, const OUString& rID,
IconChoiceDialog ::~IconChoiceDialog ()
{
+ disposeOnce();
+}
+
+void IconChoiceDialog::dispose()
+{
// save configuration at INI-Manager
// and remove pages
//SvtViewOptions aTabDlgOpt( E_TABDIALOG, rId );
@@ -231,22 +242,35 @@ IconChoiceDialog ::~IconChoiceDialog ()
if ( pData->bOnDemand )
delete &pData->pPage->GetItemSet();
- delete pData->pPage;
+ pData->pPage.disposeAndClear();
}
delete pData;
}
+ maPageList.clear();
- // remove Userdata from Icons
- for ( sal_uLong i=0; i < m_pIconCtrl->GetEntryCount(); i++)
+ if (m_pIconCtrl)
{
- SvxIconChoiceCtrlEntry* pEntry = m_pIconCtrl->GetEntry ( i );
- sal_uInt16* pUserData = static_cast<sal_uInt16*>(pEntry->GetUserData());
- delete pUserData;
+ // remove Userdata from Icons
+ for ( sal_uLong i=0; i < m_pIconCtrl->GetEntryCount(); i++)
+ {
+ SvxIconChoiceCtrlEntry* pEntry = m_pIconCtrl->GetEntry ( i );
+ delete static_cast<sal_uInt16*>(pEntry->GetUserData());
+ }
}
-
delete pRanges;
+ pRanges = NULL;
delete pOutSet;
+ pOutSet = NULL;
+
+ m_pIconCtrl.clear();
+ m_pOKBtn.clear();
+ m_pApplyBtn.clear();
+ m_pCancelBtn.clear();
+ m_pHelpBtn.clear();
+ m_pResetBtn.clear();
+ m_pTabContainer.clear();
+ ModalDialog::dispose();
}
/**********************************************************************
@@ -532,7 +556,7 @@ bool IconChoiceDialog::DeActivatePageImpl ()
for ( size_t i = 0, nCount = maPageList.size(); i < nCount; ++i )
{
IconChoicePageData* pObj = maPageList[ i ];
- if ( pObj->pPage != pPage )
+ if ( pObj->pPage.get() != pPage )
pObj->bRefresh = true;
else
pObj->bRefresh = false;
diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx
index fc9d8218c97d..0b24ea2a535c 100644
--- a/cui/source/dialogs/insdlg.cxx
+++ b/cui/source/dialogs/insdlg.cxx
@@ -191,6 +191,24 @@ SvInsertOleDlg::SvInsertOleDlg
RadioHdl( NULL );
}
+SvInsertOleDlg::~SvInsertOleDlg()
+{
+ disposeOnce();
+}
+
+void SvInsertOleDlg::dispose()
+{
+ m_pRbNewObject.clear();
+ m_pRbObjectFromfile.clear();
+ m_pObjectTypeFrame.clear();
+ m_pLbObjecttype.clear();
+ m_pFileFrame.clear();
+ m_pEdFilepath.clear();
+ m_pBtnFilepath.clear();
+ m_pCbFilelink.clear();
+ InsertObjectDialog_Impl::dispose();
+}
+
short SvInsertOleDlg::Execute()
{
short nRet = RET_OK;
@@ -395,10 +413,18 @@ SvInsertPlugInDialog::SvInsertPlugInDialog(vcl::Window* pParent,
SvInsertPlugInDialog::~SvInsertPlugInDialog()
{
- delete m_pURL;
+ disposeOnce();
}
-
+void SvInsertPlugInDialog::dispose()
+{
+ delete m_pURL;
+ m_pURL = NULL;
+ m_pEdFileurl.clear();
+ m_pBtnFileurl.clear();
+ m_pEdPluginsOptions.clear();
+ InsertObjectDialog_Impl::dispose();
+}
static void Plugin_ImplFillCommandSequence( const OUString& aCommands, uno::Sequence< beans::PropertyValue >& aCommandSequence )
{
@@ -489,6 +515,30 @@ SfxInsertFloatingFrameDialog::SfxInsertFloatingFrameDialog( vcl::Window *pParent
Init();
}
+SfxInsertFloatingFrameDialog::~SfxInsertFloatingFrameDialog()
+{
+ disposeOnce();
+}
+
+void SfxInsertFloatingFrameDialog::dispose()
+{
+ m_pEDName.clear();
+ m_pEDURL.clear();
+ m_pBTOpen.clear();
+ m_pRBScrollingOn.clear();
+ m_pRBScrollingOff.clear();
+ m_pRBScrollingAuto.clear();
+ m_pRBFrameBorderOn.clear();
+ m_pRBFrameBorderOff.clear();
+ m_pFTMarginWidth.clear();
+ m_pNMMarginWidth.clear();
+ m_pCBMarginWidthDefault.clear();
+ m_pFTMarginHeight.clear();
+ m_pNMMarginHeight.clear();
+ m_pCBMarginHeightDefault.clear();
+ InsertObjectDialog_Impl::dispose();
+}
+
void SfxInsertFloatingFrameDialog::Init()
{
get(m_pEDName, "edname");
diff --git a/cui/source/dialogs/insrc.cxx b/cui/source/dialogs/insrc.cxx
index ef1eecff6a99..13f18c3b5493 100644
--- a/cui/source/dialogs/insrc.cxx
+++ b/cui/source/dialogs/insrc.cxx
@@ -33,21 +33,29 @@ sal_uInt16 SvxInsRowColDlg::getInsertCount() const
}
SvxInsRowColDlg::SvxInsRowColDlg(vcl::Window* pParent, bool bCol, const OString& sHelpId )
- : ModalDialog(pParent, "InsertRowColumnDialog", "cui/ui/insertrowcolumn.ui")
+ : m_pDialog(VclPtr<ModalDialog>::Create(pParent, "InsertRowColumnDialog", "cui/ui/insertrowcolumn.ui"))
, aRow(CUI_RESSTR(RID_SVXSTR_ROW))
, aCol(CUI_RESSTR(RID_SVXSTR_COL))
, bColumn(bCol)
{
- get(m_pCountEdit, "insert_number");
- get(m_pBeforeBtn, "insert_before");
- get(m_pAfterBtn, "insert_after");
- SetText( bColumn ? aCol : aRow );
- SetHelpId( sHelpId );
+ m_pDialog->get(m_pCountEdit, "insert_number");
+ m_pDialog->get(m_pBeforeBtn, "insert_before");
+ m_pDialog->get(m_pAfterBtn, "insert_after");
+ m_pDialog->SetText( bColumn ? aCol : aRow );
+ m_pDialog->SetHelpId( sHelpId );
+}
+
+SvxInsRowColDlg::~SvxInsRowColDlg()
+{
+ m_pCountEdit.clear();
+ m_pBeforeBtn.clear();
+ m_pAfterBtn.clear();
+ m_pDialog.disposeAndClear();
}
short SvxInsRowColDlg::Execute()
{
- return ModalDialog::Execute();
+ return m_pDialog->Execute();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx
index 505df5a9b4a4..0995ae4c6ad5 100644
--- a/cui/source/dialogs/linkdlg.cxx
+++ b/cui/source/dialogs/linkdlg.cxx
@@ -145,6 +145,22 @@ SvBaseLinksDlg::SvBaseLinksDlg( vcl::Window * pParent, LinkManager* pMgr, bool b
SvBaseLinksDlg::~SvBaseLinksDlg()
{
+ disposeOnce();
+}
+
+void SvBaseLinksDlg::dispose()
+{
+ m_pTbLinks.clear();
+ m_pFtFullFileName.clear();
+ m_pFtFullSourceName.clear();
+ m_pFtFullTypeName.clear();
+ m_pRbAutomatic.clear();
+ m_pRbManual.clear();
+ m_pPbUpdateNow.clear();
+ m_pPbOpenSource.clear();
+ m_pPbChangeSource.clear();
+ m_pPbBreakLink.clear();
+ ModalDialog::dispose();
}
/*************************************************************************
@@ -428,9 +444,9 @@ IMPL_LINK( SvBaseLinksDlg, BreakLinkClickHdl, PushButton *, pPushButton )
if( !xLink.Is() )
return 0;
- QueryBox aBox( this, WB_YES_NO | WB_DEF_YES, Closelinkmsg() );
+ ScopedVclPtrInstance< QueryBox > aBox( this, WB_YES_NO | WB_DEF_YES, Closelinkmsg() );
- if( RET_YES == aBox.Execute() )
+ if( RET_YES == aBox->Execute() )
{
m_pTbLinks->GetModel()->Remove( m_pTbLinks->GetEntry( nPos ) );
@@ -459,9 +475,9 @@ IMPL_LINK( SvBaseLinksDlg, BreakLinkClickHdl, PushButton *, pPushButton )
}
else
{
- QueryBox aBox( this, WB_YES_NO | WB_DEF_YES, CloselinkmsgMulti() );
+ ScopedVclPtrInstance< QueryBox > aBox( this, WB_YES_NO | WB_DEF_YES, CloselinkmsgMulti() );
- if( RET_YES == aBox.Execute() )
+ if( RET_YES == aBox->Execute() )
{
SvBaseLinkMemberList aLinkList;
diff --git a/cui/source/dialogs/multipat.cxx b/cui/source/dialogs/multipat.cxx
index e4adae253e24..8cdc64439efa 100644
--- a/cui/source/dialogs/multipat.cxx
+++ b/cui/source/dialogs/multipat.cxx
@@ -186,7 +186,7 @@ SvxMultiPathDialog::SvxMultiPathDialog(vcl::Window* pParent)
Size aSize(LogicToPixel(Size(195, 77), MAP_APPFONT));
pRadioLBContainer->set_width_request(aSize.Width());
pRadioLBContainer->set_height_request(aSize.Height());
- m_pRadioLB = new svx::SvxRadioButtonListBox(*pRadioLBContainer, 0);
+ m_pRadioLB = VclPtr<svx::SvxRadioButtonListBox>::Create(*pRadioLBContainer, 0);
static long aStaticTabs[]= { 2, 0, 12 };
m_pRadioLB->SvSimpleTable::SetTabs( aStaticTabs );
@@ -224,21 +224,44 @@ SvxPathSelectDialog::SvxPathSelectDialog(vcl::Window* pParent)
SvxMultiPathDialog::~SvxMultiPathDialog()
{
- sal_uInt16 nPos = (sal_uInt16)m_pRadioLB->GetEntryCount();
- while ( nPos-- )
+ disposeOnce();
+}
+
+void SvxMultiPathDialog::dispose()
+{
+ if (m_pRadioLB)
{
- SvTreeListEntry* pEntry = m_pRadioLB->GetEntry( nPos );
- delete static_cast<OUString*>(pEntry->GetUserData());
+ sal_uInt16 nPos = (sal_uInt16)m_pRadioLB->GetEntryCount();
+ while ( nPos-- )
+ {
+ SvTreeListEntry* pEntry = m_pRadioLB->GetEntry( nPos );
+ delete static_cast<OUString*>(pEntry->GetUserData());
+ }
}
- delete m_pRadioLB;
+ m_pRadioLB.disposeAndClear();
+ m_pAddBtn.clear();
+ m_pDelBtn.clear();
+ ModalDialog::dispose();
}
SvxPathSelectDialog::~SvxPathSelectDialog()
{
- sal_uInt16 nPos = m_pPathLB->GetEntryCount();
- while ( nPos-- )
- delete static_cast<OUString*>(m_pPathLB->GetEntryData(nPos));
+ disposeOnce();
+}
+
+void SvxPathSelectDialog::dispose()
+{
+ if (m_pPathLB)
+ {
+ sal_uInt16 nPos = m_pPathLB->GetEntryCount();
+ while ( nPos-- )
+ delete static_cast<OUString*>(m_pPathLB->GetEntryData(nPos));
+ }
+ m_pPathLB.clear();
+ m_pAddBtn.clear();
+ m_pDelBtn.clear();
+ ModalDialog::dispose();
}
OUString SvxMultiPathDialog::GetPath() const
diff --git a/cui/source/dialogs/newtabledlg.cxx b/cui/source/dialogs/newtabledlg.cxx
index ae6a0e757fa2..a83e11ac991f 100644
--- a/cui/source/dialogs/newtabledlg.cxx
+++ b/cui/source/dialogs/newtabledlg.cxx
@@ -22,15 +22,22 @@
#include "newtabledlg.hxx"
SvxNewTableDialog::SvxNewTableDialog( vcl::Window* pParent )
-: ModalDialog( pParent, "NewTableDialog", "cui/ui/newtabledialog.ui" )
+ : m_pDialog( VclPtr<ModalDialog>::Create( pParent, "NewTableDialog", "cui/ui/newtabledialog.ui" ) )
{
- get(mpNumRows, "rows");
- get(mpNumColumns, "columns");
+ m_pDialog->get(mpNumRows, "rows");
+ m_pDialog->get(mpNumColumns, "columns");
+}
+
+SvxNewTableDialog::~SvxNewTableDialog()
+{
+ mpNumColumns.clear();
+ mpNumRows.clear();
+ m_pDialog.disposeAndClear();
}
short SvxNewTableDialog::Execute()
{
- return ModalDialog::Execute();
+ return m_pDialog->Execute();
}
sal_Int32 SvxNewTableDialog::getRows() const
diff --git a/cui/source/dialogs/passwdomdlg.cxx b/cui/source/dialogs/passwdomdlg.cxx
index bca8cd9c211e..1b47dda9aa79 100644
--- a/cui/source/dialogs/passwdomdlg.cxx
+++ b/cui/source/dialogs/passwdomdlg.cxx
@@ -31,15 +31,15 @@
struct PasswordToOpenModifyDialog_Impl
{
- PasswordToOpenModifyDialog * m_pParent;
+ VclPtr<PasswordToOpenModifyDialog> m_pParent;
- Edit* m_pPasswdToOpenED;
- Edit* m_pReenterPasswdToOpenED;
- VclExpander* m_pOptionsExpander;
- OKButton* m_pOk;
- CheckBox* m_pOpenReadonlyCB;
- Edit* m_pPasswdToModifyED;
- Edit* m_pReenterPasswdToModifyED;
+ VclPtr<Edit> m_pPasswdToOpenED;
+ VclPtr<Edit> m_pReenterPasswdToOpenED;
+ VclPtr<VclExpander> m_pOptionsExpander;
+ VclPtr<OKButton> m_pOk;
+ VclPtr<CheckBox> m_pOpenReadonlyCB;
+ VclPtr<Edit> m_pPasswdToModifyED;
+ VclPtr<Edit> m_pReenterPasswdToModifyED;
OUString m_aOneMismatch;
OUString m_aTwoMismatch;
@@ -101,9 +101,9 @@ IMPL_LINK( PasswordToOpenModifyDialog_Impl, OkBtnClickHdl, OKButton *, EMPTYARG
m_pPasswdToModifyED->GetText().isEmpty();
if (bInvalidState)
{
- MessageDialog aErrorBox(m_pParent,
+ ScopedVclPtrInstance<MessageDialog> aErrorBox(m_pParent,
m_bIsPasswordToModify? m_aInvalidStateForOkButton : m_aInvalidStateForOkButton_v2);
- aErrorBox.Execute();
+ aErrorBox->Execute();
}
else // check for mismatched passwords...
{
@@ -112,8 +112,8 @@ IMPL_LINK( PasswordToOpenModifyDialog_Impl, OkBtnClickHdl, OKButton *, EMPTYARG
const int nMismatch = (bToOpenMatch? 0 : 1) + (bToModifyMatch? 0 : 1);
if (nMismatch > 0)
{
- MessageDialog aErrorBox(m_pParent, nMismatch == 1 ? m_aOneMismatch : m_aTwoMismatch);
- aErrorBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(m_pParent, nMismatch == 1 ? m_aOneMismatch : m_aTwoMismatch);
+ aErrorBox->Execute();
Edit* pEdit = !bToOpenMatch ? m_pPasswdToOpenED : m_pPasswdToModifyED;
Edit* pRepeatEdit = !bToOpenMatch? m_pReenterPasswdToOpenED : m_pReenterPasswdToModifyED;
@@ -153,6 +153,12 @@ PasswordToOpenModifyDialog::PasswordToOpenModifyDialog(
PasswordToOpenModifyDialog::~PasswordToOpenModifyDialog()
{
+ disposeOnce();
+}
+
+void PasswordToOpenModifyDialog::dispose()
+{
+ SfxModalDialog::dispose();
}
diff --git a/cui/source/dialogs/pastedlg.cxx b/cui/source/dialogs/pastedlg.cxx
index a7478f5c23df..ff6263a2587e 100644
--- a/cui/source/dialogs/pastedlg.cxx
+++ b/cui/source/dialogs/pastedlg.cxx
@@ -52,6 +52,19 @@ SvPasteObjectDialog::SvPasteObjectDialog( vcl::Window* pParent )
ObjectLB().SetDoubleClickHdl( LINK( this, SvPasteObjectDialog, DoubleClickHdl ) );
}
+SvPasteObjectDialog::~SvPasteObjectDialog()
+{
+ disposeOnce();
+}
+
+void SvPasteObjectDialog::dispose()
+{
+ m_pFtObjectSource.clear();
+ m_pLbInsertList.clear();
+ m_pOKButton.clear();
+ ModalDialog::dispose();
+}
+
void SvPasteObjectDialog::SelectObject()
{
if (m_pLbInsertList->GetEntryCount())
@@ -79,10 +92,6 @@ IMPL_LINK_INLINE_START( SvPasteObjectDialog, DoubleClickHdl, ListBox *, pListBox
}
IMPL_LINK_INLINE_END( SvPasteObjectDialog, DoubleClickHdl, ListBox *, pListBox )
-SvPasteObjectDialog::~SvPasteObjectDialog()
-{
-}
-
/*************************************************************************
|* SvPasteObjectDialog::Insert()
*************************************************************************/
diff --git a/cui/source/dialogs/postdlg.cxx b/cui/source/dialogs/postdlg.cxx
index b740fd9e91bb..c1e43e1939c4 100644
--- a/cui/source/dialogs/postdlg.cxx
+++ b/cui/source/dialogs/postdlg.cxx
@@ -124,8 +124,21 @@ SvxPostItDialog::SvxPostItDialog(vcl::Window* pParent, const SfxItemSet& rCoreSe
SvxPostItDialog::~SvxPostItDialog()
{
+ disposeOnce();
+}
+
+void SvxPostItDialog::dispose()
+{
delete pOutSet;
pOutSet = 0;
+ m_pLastEditFT.clear();
+ m_pEditED.clear();
+ m_pInsertAuthor.clear();
+ m_pAuthorBtn.clear();
+ m_pOKBtn.clear();
+ m_pPrevBtn.clear();
+ m_pNextBtn.clear();
+ SfxModalDialog::dispose();
}
diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index 2e4a87157ec5..98a97d0e8656 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -96,12 +96,18 @@ SFTreeListBox::SFTreeListBox(vcl::Window* pParent)
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSFTreeListBox(vcl::Window *pParent, VclBuilder::stringmap &)
{
- return new SFTreeListBox(pParent);
+ return VclPtr<SFTreeListBox>::Create(pParent);
}
SFTreeListBox::~SFTreeListBox()
{
+ disposeOnce();
+}
+
+void SFTreeListBox::dispose()
+{
deleteAllTree();
+ SvTreeListBox::dispose();
}
void SFTreeListBox::delUserData( SvTreeListEntry* pEntry )
@@ -437,6 +443,17 @@ CuiInputDialog::CuiInputDialog(vcl::Window * pParent, sal_uInt16 nMode )
}
}
+CuiInputDialog::~CuiInputDialog()
+{
+ disposeOnce();
+}
+
+void CuiInputDialog::dispose()
+{
+ m_pEdit.clear();
+ ModalDialog::dispose();
+}
+
// ScriptOrgDialog ------------------------------------------------------------
@@ -487,8 +504,21 @@ SvxScriptOrgDialog::SvxScriptOrgDialog( vcl::Window* pParent, const OUString& la
SvxScriptOrgDialog::~SvxScriptOrgDialog()
{
+ disposeOnce();
+}
+
+void SvxScriptOrgDialog::dispose()
+{
// clear the SelectHdl so that it isn't called during the dtor
m_pScriptsBox->SetSelectHdl( Link() );
+ m_pScriptsBox.clear();
+ m_pRunButton.clear();
+ m_pCloseButton.clear();
+ m_pCreateButton.clear();
+ m_pEditButton.clear();
+ m_pRenameButton.clear();
+ m_pDelButton.clear();
+ SfxModalDialog::dispose();
};
short SvxScriptOrgDialog::Execute()
@@ -876,7 +906,7 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry )
}
}
- boost::scoped_ptr< CuiInputDialog > xNewDlg( new CuiInputDialog( static_cast<vcl::Window*>(this), nMode ) );
+ ScopedVclPtrInstance< CuiInputDialog > xNewDlg( static_cast<vcl::Window*>(this), nMode );
xNewDlg->SetObjectName( aNewName );
do
@@ -892,9 +922,9 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry )
bValid = false;
OUString aError( m_createErrStr );
aError += m_createDupStr;
- MessageDialog aErrorBox(static_cast<vcl::Window*>(this), aError);
- aErrorBox.SetText( m_createErrTitleStr );
- aErrorBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(static_cast<vcl::Window*>(this), aError);
+ aErrorBox->SetText( m_createErrTitleStr );
+ aErrorBox->Execute();
xNewDlg->SetObjectName( aNewName );
break;
}
@@ -974,9 +1004,9 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry )
{
//ISSUE L10N & message from exception?
OUString aError( m_createErrStr );
- MessageDialog aErrorBox(static_cast<vcl::Window*>(this), aError);
- aErrorBox.SetText( m_createErrTitleStr );
- aErrorBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(static_cast<vcl::Window*>(this), aError);
+ aErrorBox->SetText( m_createErrTitleStr );
+ aErrorBox->Execute();
}
}
@@ -999,7 +1029,7 @@ void SvxScriptOrgDialog::renameEntry( SvTreeListEntry* pEntry )
}
sal_uInt16 nMode = INPUTMODE_RENAME;
- boost::scoped_ptr< CuiInputDialog > xNewDlg( new CuiInputDialog( static_cast<vcl::Window*>(this), nMode ) );
+ ScopedVclPtrInstance< CuiInputDialog > xNewDlg( static_cast<vcl::Window*>(this), nMode );
xNewDlg->SetObjectName( aNewName );
bool bValid;
@@ -1050,9 +1080,9 @@ void SvxScriptOrgDialog::renameEntry( SvTreeListEntry* pEntry )
{
//ISSUE L10N & message from exception?
OUString aError( m_renameErrStr );
- MessageDialog aErrorBox(static_cast<vcl::Window*>(this), aError);
- aErrorBox.SetText( m_renameErrTitleStr );
- aErrorBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(static_cast<vcl::Window*>(this), aError);
+ aErrorBox->SetText( m_renameErrTitleStr );
+ aErrorBox->Execute();
}
}
void SvxScriptOrgDialog::deleteEntry( SvTreeListEntry* pEntry )
@@ -1061,9 +1091,9 @@ void SvxScriptOrgDialog::deleteEntry( SvTreeListEntry* pEntry )
Reference< browse::XBrowseNode > node = getBrowseNode( pEntry );
// ISSUE L10N string & can we centre list?
OUString aQuery = m_delQueryStr + getListOfChildren( node, 0 );
- MessageDialog aQueryBox(static_cast<vcl::Window*>(this), aQuery, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
- aQueryBox.SetText( m_delQueryTitleStr );
- if ( aQueryBox.Execute() == RET_NO )
+ VclPtrInstance< MessageDialog > aQueryBox(static_cast<vcl::Window*>(this), aQuery, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ aQueryBox->SetText( m_delQueryTitleStr );
+ if ( aQueryBox->Execute() == RET_NO )
{
return;
}
@@ -1096,9 +1126,9 @@ void SvxScriptOrgDialog::deleteEntry( SvTreeListEntry* pEntry )
else
{
//ISSUE L10N & message from exception?
- MessageDialog aErrorBox(static_cast<vcl::Window*>(this), m_delErrStr);
- aErrorBox.SetText( m_delErrTitleStr );
- aErrorBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(static_cast<vcl::Window*>(this), m_delErrStr);
+ aErrorBox->SetText( m_delErrTitleStr );
+ aErrorBox->Execute();
}
}
@@ -1468,11 +1498,10 @@ IMPL_LINK( SvxScriptErrorDialog, ShowDialog, OUString*, pMessage )
message = OUString( CUI_RES( RID_SVXSTR_ERROR_TITLE ) );
}
- MessageDialog* pBox = new MessageDialog(NULL, message, VCL_MESSAGE_WARNING);
+ ScopedVclPtrInstance<MessageDialog> pBox( nullptr, message, VCL_MESSAGE_WARNING );
pBox->SetText( CUI_RES( RID_SVXSTR_ERROR_TITLE ) );
pBox->Execute();
- delete pBox;
delete pMessage;
return 0;
diff --git a/cui/source/dialogs/showcols.cxx b/cui/source/dialogs/showcols.cxx
index 94e286ecd92d..4c86ac4da191 100644
--- a/cui/source/dialogs/showcols.cxx
+++ b/cui/source/dialogs/showcols.cxx
@@ -39,6 +39,17 @@ FmShowColsDialog::FmShowColsDialog(vcl::Window* pParent)
m_pOK->SetClickHdl( LINK( this, FmShowColsDialog, OnClickedOk ) );
}
+FmShowColsDialog::~FmShowColsDialog()
+{
+ disposeOnce();
+}
+
+void FmShowColsDialog::dispose()
+{
+ m_pList.clear();
+ m_pOK.clear();
+ ModalDialog::dispose();
+}
IMPL_LINK_NOARG(FmShowColsDialog, OnClickedOk)
{
diff --git a/cui/source/dialogs/splitcelldlg.cxx b/cui/source/dialogs/splitcelldlg.cxx
index e3b6d18c58a3..69bfd0ec0051 100644
--- a/cui/source/dialogs/splitcelldlg.cxx
+++ b/cui/source/dialogs/splitcelldlg.cxx
@@ -24,16 +24,27 @@
#include "splitcelldlg.hxx"
#include "cuires.hrc"
+namespace {
+ class NoApplyDialog : public SvxStandardDialog
+ {
+ public:
+ NoApplyDialog(vcl::Window *pParent, const OUString &rId, const OUString &rXML) :
+ SvxStandardDialog(pParent, rId, rXML) { }
+ protected:
+ virtual void Apply() SAL_OVERRIDE {}
+ };
+}
+
SvxSplitTableDlg::SvxSplitTableDlg( vcl::Window *pParent, bool bIsTableVertical,
long nMaxVertical, long nMaxHorizontal )
- : SvxStandardDialog(pParent, "SplitCellsDialog", "cui/ui/splitcellsdialog.ui")
+ : m_pDialog(VclPtr<NoApplyDialog>::Create(pParent, "SplitCellsDialog", "cui/ui/splitcellsdialog.ui"))
, mnMaxVertical(nMaxVertical)
, mnMaxHorizontal(nMaxHorizontal)
{
- get(m_pCountEdit, "countnf");
- get(m_pHorzBox, "hori");
- get(m_pVertBox, "vert");
- get(m_pPropCB, "prop");
+ m_pDialog->get(m_pCountEdit, "countnf");
+ m_pDialog->get(m_pHorzBox, "hori");
+ m_pDialog->get(m_pVertBox, "vert");
+ m_pDialog->get(m_pPropCB, "prop");
m_pHorzBox->SetClickHdl( LINK( this, SvxSplitTableDlg, ClickHdl ));
m_pPropCB->SetClickHdl( LINK( this, SvxSplitTableDlg, ClickHdl ));
m_pVertBox->SetClickHdl( LINK( this, SvxSplitTableDlg, ClickHdl ));
@@ -55,6 +66,11 @@ SvxSplitTableDlg::SvxSplitTableDlg( vcl::Window *pParent, bool bIsTableVertical,
SvxSplitTableDlg::~SvxSplitTableDlg()
{
+ m_pCountEdit.clear();
+ m_pHorzBox.clear();
+ m_pVertBox.clear();
+ m_pPropCB.clear();
+ m_pDialog.disposeAndClear();
}
IMPL_LINK( SvxSplitTableDlg, ClickHdl, Button *, pButton )
@@ -83,11 +99,7 @@ long SvxSplitTableDlg::GetCount() const
short SvxSplitTableDlg::Execute()
{
- return SvxStandardDialog::Execute();
-}
-
-void SvxSplitTableDlg::Apply()
-{
+ return m_pDialog->Execute();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/dialogs/srchxtra.cxx b/cui/source/dialogs/srchxtra.cxx
index 39fbcd2cc99a..44976012dad2 100644
--- a/cui/source/dialogs/srchxtra.cxx
+++ b/cui/source/dialogs/srchxtra.cxx
@@ -64,7 +64,14 @@ SvxSearchFormatDialog::SvxSearchFormatDialog(vcl::Window* pParent, const SfxItem
SvxSearchFormatDialog::~SvxSearchFormatDialog()
{
+ disposeOnce();
+}
+
+void SvxSearchFormatDialog::dispose()
+{
delete m_pFontList;
+ m_pFontList = NULL;
+ SfxTabDialog::dispose();
}
void SvxSearchFormatDialog::PageCreated( sal_uInt16 nId, SfxTabPage& rPage )
@@ -171,6 +178,17 @@ SvxSearchAttributeDialog::SvxSearchAttributeDialog(vcl::Window* pParent,
m_pAttrLB->SelectEntryPos( 0 );
}
+SvxSearchAttributeDialog::~SvxSearchAttributeDialog()
+{
+ disposeOnce();
+}
+
+void SvxSearchAttributeDialog::dispose()
+{
+ m_pAttrLB.clear();
+ m_pOKBtn.clear();
+ ModalDialog::dispose();
+}
IMPL_LINK_NOARG(SvxSearchAttributeDialog, OKHdl)
@@ -241,4 +259,18 @@ SvxSearchSimilarityDialog::SvxSearchSimilarityDialog
m_pRelaxBox->Check( bRelax );
}
+SvxSearchSimilarityDialog::~SvxSearchSimilarityDialog()
+{
+ disposeOnce();
+}
+
+void SvxSearchSimilarityDialog::dispose()
+{
+ m_pOtherFld.clear();
+ m_pLongerFld.clear();
+ m_pShorterFld.clear();
+ m_pRelaxBox.clear();
+ ModalDialog::dispose();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx
index 5ad4a5dae338..953bbc7b0e69 100644
--- a/cui/source/dialogs/thesdlg.cxx
+++ b/cui/source/dialogs/thesdlg.cxx
@@ -66,6 +66,17 @@ LookUpComboBox::LookUpComboBox(vcl::Window *pParent)
EnableAutocomplete( false );
}
+LookUpComboBox::~LookUpComboBox()
+{
+ disposeOnce();
+}
+
+void LookUpComboBox::dispose()
+{
+ m_pDialog.clear();
+ ComboBox::dispose();
+}
+
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeLookUpComboBox(vcl::Window *pParent, VclBuilder::stringmap &)
{
return new LookUpComboBox(pParent);
@@ -76,10 +87,6 @@ void LookUpComboBox::init(SvxThesaurusDialog *pDialog)
m_pDialog = pDialog;
}
-LookUpComboBox::~LookUpComboBox()
-{
-}
-
void LookUpComboBox::Modify()
{
m_aModifyIdle.Start();
@@ -100,13 +107,21 @@ ReplaceEdit::ReplaceEdit(vcl::Window *pParent)
{
}
-extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeReplaceEdit(vcl::Window *pParent, VclBuilder::stringmap &)
+ReplaceEdit::~ReplaceEdit()
{
- return new ReplaceEdit(pParent);
+ disposeOnce();
}
-ReplaceEdit::~ReplaceEdit()
+void ReplaceEdit::dispose()
{
+ m_pBtn.clear();
+ Edit::dispose();
+}
+
+
+extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeReplaceEdit(vcl::Window *pParent, VclBuilder::stringmap &)
+{
+ return new ReplaceEdit(pParent);
}
void ReplaceEdit::Modify()
@@ -178,7 +193,14 @@ void ThesaurusAlternativesCtrl::init(SvxThesaurusDialog *pDialog)
ThesaurusAlternativesCtrl::~ThesaurusAlternativesCtrl()
{
+ disposeOnce();
+}
+
+void ThesaurusAlternativesCtrl::dispose()
+{
ClearExtraData();
+ m_pDialog.clear();
+ SvxCheckListBox::dispose();
}
void ThesaurusAlternativesCtrl::ClearExtraData()
@@ -516,14 +538,25 @@ SvxThesaurusDialog::SvxThesaurusDialog(
Enable( false );
}
-IMPL_LINK( SvxThesaurusDialog, ReplaceBtnHdl_Impl, Button *, EMPTYARG /*pBtn*/ )
+SvxThesaurusDialog::~SvxThesaurusDialog()
{
- EndDialog(RET_OK);
- return 0;
+ disposeOnce();
}
-SvxThesaurusDialog::~SvxThesaurusDialog()
+void SvxThesaurusDialog::dispose()
+{
+ m_pLeftBtn.clear();
+ m_pWordCB.clear();
+ m_pAlternativesCT.clear();
+ m_pReplaceEdit.clear();
+ m_pLangLB.clear();
+ SvxStandardDialog::dispose();
+}
+
+IMPL_LINK( SvxThesaurusDialog, ReplaceBtnHdl_Impl, Button *, EMPTYARG /*pBtn*/ )
{
+ EndDialog(RET_OK);
+ return 0;
}
void SvxThesaurusDialog::SetWindowTitle( LanguageType nLanguage )
diff --git a/cui/source/dialogs/zoom.cxx b/cui/source/dialogs/zoom.cxx
index 32dea8c5ab77..5b2dff90d8d0 100644
--- a/cui/source/dialogs/zoom.cxx
+++ b/cui/source/dialogs/zoom.cxx
@@ -289,7 +289,28 @@ SvxZoomDialog::SvxZoomDialog( vcl::Window* pParent, const SfxItemSet& rCoreSet )
}
SvxZoomDialog::~SvxZoomDialog()
-{}
+{
+ disposeOnce();
+}
+
+void SvxZoomDialog::dispose()
+{
+ mpOutSet.reset();
+ m_pOptimalBtn.clear();
+ m_pWholePageBtn.clear();
+ m_pPageWidthBtn.clear();
+ m_p100Btn.clear();
+ m_pUserBtn.clear();
+ m_pUserEdit.clear();
+ m_pViewFrame.clear();
+ m_pAutomaticBtn.clear();
+ m_pSingleBtn.clear();
+ m_pColumnsBtn.clear();
+ m_pColumnsEdit.clear();
+ m_pBookModeChk.clear();
+ m_pOKBtn.clear();
+ SfxModalDialog::dispose();
+}
IMPL_LINK(SvxZoomDialog, UserHdl, RadioButton *, pButton)
{
diff --git a/cui/source/factory/cuiexp.cxx b/cui/source/factory/cuiexp.cxx
index 8bb9d51ef1f6..754d8b47a092 100644
--- a/cui/source/factory/cuiexp.cxx
+++ b/cui/source/factory/cuiexp.cxx
@@ -17,6 +17,35 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include "sfx2/basedlgs.hxx"
+#include "cuigaldlg.hxx"
+#include "hlmarkwn.hxx"
+#include "srchxtra.hxx"
+#include "cuisrchdlg.hxx"
+#include "transfrm.hxx"
+#include "labdlg.hxx"
+#include "cuitbxform.hxx"
+#include "optdict.hxx"
+#include "dlgname.hxx"
+#include "cuiimapwnd.hxx"
+#include "multipat.hxx"
+#include "cuifmsearch.hxx"
+#include "cuigrfflt.hxx"
+#include "cuitabarea.hxx"
+#include "insdlg.hxx"
+#include "pastedlg.hxx"
+#include "linkdlg.hxx"
+#include "postdlg.hxx"
+#include "passwdomdlg.hxx"
+#include "cuihyperdlg.hxx"
+#include "selector.hxx"
+#include "SpellDialog.hxx"
+#include "zoom.hxx"
+#include "showcols.hxx"
+#include "hyphen.hxx"
+#include "thesdlg.hxx"
+#include "hangulhanjadlg.hxx"
+#include "dstribut.hxx"
#include "dlgfact.hxx"
#include "sal/types.h"
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index f2f368ad4dc1..6158d9abceba 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -105,10 +105,11 @@ IMPL_ABSTDLG_BASE(AbstractFmShowColsDialog_Impl);
IMPL_ABSTDLG_BASE(AbstractHyphenWordDialog_Impl)
IMPL_ABSTDLG_BASE(AbstractThesaurusDialog_Impl)
-AbstractSvxZoomDialog_Impl::~AbstractSvxZoomDialog_Impl() \
+AbstractSvxZoomDialog_Impl::~AbstractSvxZoomDialog_Impl()
{
- delete pDlg;
+ pDlg.disposeAndClear();
}
+
short AbstractSvxZoomDialog_Impl::Execute()
{
return pDlg->Execute();
@@ -154,7 +155,7 @@ IMPL_ABSTDLG_BASE(AbstractPasswordToOpenModifyDialog_Impl);
// virtual
VclAbstractDialog2_Impl::~VclAbstractDialog2_Impl()
{
- delete m_pDlg;
+ m_pDlg.disposeAndClear();
}
// virtual
@@ -970,12 +971,12 @@ bool AbstractPasswordToOpenModifyDialog_Impl::IsRecommendToOpenReadonly() const
// Create dialogs with simplest interface
VclAbstractDialog* AbstractDialogFactory_Impl::CreateVclDialog( vcl::Window* pParent, sal_uInt32 nResId )
{
- Dialog* pDlg=NULL;
+ VclPtr<Dialog> pDlg;
switch ( nResId )
{
case RID_DEFAULTABOUT:
{
- pDlg = new AboutDialog(pParent);
+ pDlg = VclPtr<AboutDialog>::Create(pParent);
break;
}
case SID_OPTIONS_TREEDIALOG :
@@ -986,7 +987,7 @@ VclAbstractDialog* AbstractDialogFactory_Impl::CreateVclDialog( vcl::Window* pPa
if (nResId == SID_OPTIONS_TREEDIALOG)
bActivateLastSelection = true;
Reference< frame::XFrame > xFrame;
- OfaTreeOptionsDialog* pOptDlg = new OfaTreeOptionsDialog( pParent, xFrame, bActivateLastSelection );
+ VclPtrInstance<OfaTreeOptionsDialog> pOptDlg( pParent, xFrame, bActivateLastSelection );
if (nResId == SID_OPTIONS_DATABASES)
{
pOptDlg->ActivatePage(SID_SB_DBREGISTEROPTIONS);
@@ -996,7 +997,7 @@ VclAbstractDialog* AbstractDialogFactory_Impl::CreateVclDialog( vcl::Window* pPa
//open the tab page "tools/options/languages"
pOptDlg->ActivatePage(OFA_TP_LANGUAGES_FOR_SET_DOCUMENT_LANGUAGE);
}
- pDlg = pOptDlg;
+ pDlg.reset(pOptDlg);
}
break;
default:
@@ -1018,17 +1019,17 @@ VclAbstractDialog* AbstractDialogFactory_Impl::CreateFrameDialog(
vcl::Window* pParent, const Reference< frame::XFrame >& rxFrame,
sal_uInt32 nResId, const OUString& rParameter )
{
- Dialog* pDlg = NULL;
+ VclPtr<Dialog> pDlg;
if ( SID_OPTIONS_TREEDIALOG == nResId || SID_OPTIONS_DATABASES == nResId )
{
// only activate last page if we dont want to activate a special page
bool bActivateLastSelection = ( nResId != SID_OPTIONS_DATABASES && rParameter.isEmpty() );
- OfaTreeOptionsDialog* pOptDlg = new OfaTreeOptionsDialog( pParent, rxFrame, bActivateLastSelection );
+ VclPtrInstance<OfaTreeOptionsDialog> pOptDlg( pParent, rxFrame, bActivateLastSelection );
if ( nResId == SID_OPTIONS_DATABASES )
pOptDlg->ActivatePage(SID_SB_DBREGISTEROPTIONS);
else if ( !rParameter.isEmpty() )
pOptDlg->ActivatePage( rParameter );
- pDlg = pOptDlg;
+ pDlg.reset(pOptDlg);
}
if ( pDlg )
@@ -1049,10 +1050,10 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateTabDialog( sal_uInt32 nR
switch ( nResId )
{
case RID_OFA_AUTOCORR_DLG :
- pDlg = new OfaAutoCorrDlg( pParent, pAttrSet );
+ pDlg = VclPtr<OfaAutoCorrDlg>::Create( pParent, pAttrSet );
break;
case RID_SVXDLG_CUSTOMIZE :
- pDlg = new SvxConfigDialog( pParent, pAttrSet );
+ pDlg = VclPtr<SvxConfigDialog>::Create( pParent, pAttrSet );
break;
default:
break;
@@ -1070,17 +1071,17 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateTabDialog( sal_uInt32 nR
bool /*bEditFmt*/,
const OUString * )
{
- SfxTabDialog* pDlg=NULL;
+ VclPtr<SfxTabDialog> pDlg;
switch ( nResId )
{
case RID_OFA_AUTOCORR_DLG :
- pDlg = new OfaAutoCorrDlg( pParent, pAttrSet );
+ pDlg = VclPtr<OfaAutoCorrDlg>::Create( pParent, pAttrSet );
break;
case RID_SVXDLG_CUSTOMIZE :
{
- SvxConfigDialog* pDlg1 = new SvxConfigDialog( pParent, pAttrSet );
+ VclPtrInstance<SvxConfigDialog> pDlg1( pParent, pAttrSet );
pDlg1->SetFrame(xViewFrame);
- pDlg = (SfxTabDialog*)pDlg1;
+ pDlg.reset(pDlg1);
}
break;
default:
@@ -1098,7 +1099,7 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateTextTabDialog( vcl::Wind
SdrView* pView,
SdrModel* )
{
- SfxTabDialog* pDlg = new SvxTextTabDialog( pParent, pAttrSet, pView );
+ VclPtrInstance<SvxTextTabDialog> pDlg( pParent, pAttrSet, pView );
return new CuiAbstractTabDialog_Impl( pDlg );
}
@@ -1107,7 +1108,7 @@ AbstractSvxCaptionDialog* AbstractDialogFactory_Impl::CreateCaptionDialog(
const SdrView* pView,
sal_uInt16 nAnchorTypes )
{
- SvxCaptionTabDialog* pDlg = new SvxCaptionTabDialog( pParent, pView, nAnchorTypes );
+ VclPtrInstance<SvxCaptionTabDialog> pDlg( pParent, pView, nAnchorTypes );
return new AbstractSvxCaptionDialog_Impl( pDlg );
}
@@ -1116,14 +1117,14 @@ AbstractSvxDistributeDialog* AbstractDialogFactory_Impl::CreateSvxDistributeD
SvxDistributeHorizontal eHor ,
SvxDistributeVertical eVer)
{
- SvxDistributeDialog* pDlg = new SvxDistributeDialog( pParent, rAttr, eHor, eVer);
+ VclPtrInstance<SvxDistributeDialog> pDlg( pParent, rAttr, eHor, eVer);
return new AbstractSvxDistributeDialog_Impl( pDlg );
}
AbstractHangulHanjaConversionDialog* AbstractDialogFactory_Impl::CreateHangulHanjaConversionDialog(vcl::Window* pParent,
editeng::HangulHanjaConversion::ConversionDirection _ePrimaryDirection )
{
- HangulHanjaConversionDialog* pDlg = new HangulHanjaConversionDialog( pParent, _ePrimaryDirection);
+ VclPtrInstance<HangulHanjaConversionDialog> pDlg( pParent, _ePrimaryDirection);
return new AbstractHangulHanjaConversionDialog_Impl( pDlg );
}
@@ -1131,7 +1132,7 @@ AbstractThesaurusDialog* AbstractDialogFactory_Impl::CreateThesaurusDialog( vcl:
css::uno::Reference< css::linguistic2::XThesaurus > xThesaurus,
const OUString &rWord, sal_Int16 nLanguage )
{
- SvxThesaurusDialog* pDlg = new SvxThesaurusDialog( pParent, xThesaurus, rWord, nLanguage );
+ VclPtrInstance<SvxThesaurusDialog> pDlg( pParent, xThesaurus, rWord, nLanguage );
return new AbstractThesaurusDialog_Impl( pDlg );
}
@@ -1140,19 +1141,19 @@ AbstractHyphenWordDialog* AbstractDialogFactory_Impl::CreateHyphenWordDialog( vc
::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XHyphenator > &xHyphen,
SvxSpellWrapper* pWrapper )
{
- SvxHyphenWordDialog* pDlg = new SvxHyphenWordDialog( rWord, nLang, pParent, xHyphen, pWrapper );
+ VclPtrInstance<SvxHyphenWordDialog> pDlg( rWord, nLang, pParent, xHyphen, pWrapper );
return new AbstractHyphenWordDialog_Impl( pDlg );
}
AbstractFmShowColsDialog * AbstractDialogFactory_Impl::CreateFmShowColsDialog( vcl::Window* pParent )
{
- FmShowColsDialog* pDlg = new FmShowColsDialog( pParent);
+ VclPtrInstance<FmShowColsDialog> pDlg( pParent);
return new AbstractFmShowColsDialog_Impl( pDlg );
}
AbstractSvxZoomDialog * AbstractDialogFactory_Impl::CreateSvxZoomDialog( vcl::Window* pParent,
const SfxItemSet& rCoreSet)
{
- SvxZoomDialog* pDlg = new SvxZoomDialog( pParent, rCoreSet);
+ VclPtrInstance<SvxZoomDialog> pDlg( pParent, rCoreSet);
return new AbstractSvxZoomDialog_Impl( pDlg );
}
@@ -1161,26 +1162,26 @@ AbstractSpellDialog * AbstractDialogFactory_Impl::CreateSvxSpellDialog(
SfxBindings* pBindings,
svx::SpellDialogChildWindow* pSpellChildWindow )
{
- svx::SpellDialog* pDlg = new svx::SpellDialog(pSpellChildWindow, pParent, pBindings);
+ VclPtrInstance<svx::SpellDialog> pDlg(pSpellChildWindow, pParent, pBindings);
return new AbstractSpellDialog_Impl(pDlg);
}
VclAbstractRefreshableDialog * AbstractDialogFactory_Impl::CreateActualizeProgressDialog( vcl::Window* pParent, GalleryTheme* pThm )
{
- Dialog* pDlg = new ActualizeProgress( pParent, pThm);
+ VclPtrInstance<ActualizeProgress> pDlg(pParent, pThm);
return new VclAbstractRefreshableDialog_Impl( pDlg );
}
AbstractSearchProgress * AbstractDialogFactory_Impl::CreateSearchProgressDialog( vcl::Window* pParent,
const INetURLObject& rStartURL )
{
- SearchProgress* pDlg = new SearchProgress( pParent, rStartURL);
+ SearchProgress* pDlg = VclPtr<SearchProgress>::Create( pParent, rStartURL);
return new AbstractSearchProgress_Impl( pDlg );
}
AbstractTakeProgress * AbstractDialogFactory_Impl::CreateTakeProgressDialog( vcl::Window* pParent )
{
- TakeProgress* pDlg = new TakeProgress( pParent );
+ VclPtrInstance<TakeProgress> pDlg( pParent );
return new AbstractTakeProgress_Impl( pDlg );
}
@@ -1195,7 +1196,7 @@ AbstractScriptSelectorDialog*
AbstractDialogFactory_Impl::CreateScriptSelectorDialog(
vcl::Window* pParent, bool bShowSlots, const Reference< frame::XFrame >& _rxFrame )
{
- SvxScriptSelectorDialog* pDlg = new SvxScriptSelectorDialog(pParent, bShowSlots, _rxFrame);
+ VclPtrInstance<SvxScriptSelectorDialog> pDlg(pParent, bShowSlots, _rxFrame);
return new AbstractScriptSelectorDialog_Impl(pDlg);
}
@@ -1216,21 +1217,21 @@ void AbstractScriptSelectorDialog_Impl::SetRunLabel()
VclAbstractDialog * AbstractDialogFactory_Impl::CreateSvxScriptOrgDialog( vcl::Window* pParent,
const OUString& rLanguage)
{
- Dialog* pDlg = new SvxScriptOrgDialog( pParent, rLanguage);
+ VclPtrInstance<SvxScriptOrgDialog> pDlg( pParent, rLanguage);
return new CuiVclAbstractDialog_Impl( pDlg );
}
AbstractTitleDialog * AbstractDialogFactory_Impl::CreateTitleDialog( vcl::Window* pParent,
const OUString& rOldText)
{
- TitleDialog* pDlg = new TitleDialog( pParent, rOldText);
+ VclPtrInstance<TitleDialog> pDlg( pParent, rOldText);
return new AbstractTitleDialog_Impl( pDlg );
}
AbstractGalleryIdDialog * AbstractDialogFactory_Impl::CreateGalleryIdDialog( vcl::Window* pParent,
GalleryTheme* pThm )
{
- GalleryIdDialog* pDlg = new GalleryIdDialog( pParent, pThm);
+ VclPtrInstance<GalleryIdDialog> pDlg( pParent, pThm);
return new AbstractGalleryIdDialog_Impl( pDlg );
}
@@ -1238,7 +1239,7 @@ VclAbstractDialog2 * AbstractDialogFactory_Impl::CreateGalleryThemePropertiesDia
ExchangeData* pData,
SfxItemSet* pItemSet)
{
- Dialog* pDlg = new GalleryThemeProperties( pParent, pData, pItemSet);
+ VclPtrInstance<GalleryThemeProperties> pDlg( pParent, pData, pItemSet);
return new VclAbstractDialog2_Impl( pDlg );
}
@@ -1247,7 +1248,8 @@ AbstractURLDlg * AbstractDialogFactory_Impl::CreateURLDialog( vcl::Window* pPare
const OUString& rTarget, const OUString& rName,
TargetList& rTargetList )
{
- URLDlg* pDlg = new URLDlg( pParent, rURL, rAltText, rDescription, rTarget, rName, rTargetList);
+ VclPtrInstance<URLDlg> pDlg( pParent, rURL, rAltText, rDescription,
+ rTarget, rName, rTargetList);
return new AbstractURLDlg_Impl( pDlg );
}
@@ -1257,7 +1259,7 @@ AbstractSvxHlinkDlgMarkWnd* AbstractDialogFactory_Impl::CreateSvxHlinkDlgMarkWnd
switch ( nResId )
{
case RID_SVXFLOAT_HYPERLINK_MARKWND :
- pDlg = new SvxHlinkDlgMarkWnd( pParent );
+ pDlg = VclPtr<SvxHlinkDlgMarkWnd>::Create ( pParent );
break;
default:
break;
@@ -1271,7 +1273,7 @@ AbstractSvxHlinkDlgMarkWnd* AbstractDialogFactory_Impl::CreateSvxHlinkDlgMarkWnd
SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateTabItemDialog(vcl::Window* pParent,
const SfxItemSet& rSet)
{
- SfxTabDialog* pDlg = new SvxSearchFormatDialog(pParent, rSet);
+ VclPtrInstance<SvxSearchFormatDialog> pDlg(pParent, rSet);
return new CuiAbstractTabDialog_Impl(pDlg);
}
@@ -1279,7 +1281,7 @@ VclAbstractDialog* AbstractDialogFactory_Impl::CreateSvxSearchAttributeDial
SearchAttrItemList& rLst,
const sal_uInt16* pWhRanges )
{
- Dialog* pDlg = new SvxSearchAttributeDialog( pParent, rLst, pWhRanges);
+ VclPtrInstance<SvxSearchAttributeDialog> pDlg( pParent, rLst, pWhRanges);
return new CuiVclAbstractDialog_Impl( pDlg );
}
@@ -1289,7 +1291,7 @@ AbstractSvxSearchSimilarityDialog * AbstractDialogFactory_Impl::CreateSvxSearchS
sal_uInt16 nShorter,
sal_uInt16 nLonger)
{
- SvxSearchSimilarityDialog* pDlg = new SvxSearchSimilarityDialog( pParent, bRelax, nOther, nShorter, nLonger );
+ VclPtrInstance<SvxSearchSimilarityDialog> pDlg( pParent, bRelax, nOther, nShorter, nLonger );
return new AbstractSvxSearchSimilarityDialog_Impl( pDlg );
}
@@ -1300,7 +1302,7 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateSvxBorderBackgroundDlg(
bool bEnableSelector,
bool bEnableDrawingLayerFillStyles)
{
- SfxTabDialog* pDlg = new SvxBorderBackgroundDlg(
+ VclPtrInstance<SvxBorderBackgroundDlg> pDlg(
pParent,
rCoreSet,
bEnableSelector,
@@ -1314,7 +1316,7 @@ AbstractSvxTransformTabDialog* AbstractDialogFactory_Impl::CreateSvxTransformTab
const SdrView* pView,
sal_uInt16 nAnchorTypes )
{
- SvxTransformTabDialog* pDlg = new SvxTransformTabDialog( pParent, pAttr,pView, nAnchorTypes);
+ VclPtrInstance<SvxTransformTabDialog> pDlg( pParent, pAttr,pView, nAnchorTypes);
return new AbstractSvxTransformTabDialog_Impl( pDlg );
}
@@ -1325,19 +1327,19 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateSchTransformTabDialog( v
bool bSizeTabPage
)
{
- SfxTabDialog* pDlg=NULL;
+ VclPtr<SfxTabDialog> pDlg;
switch ( nResId )
{
case RID_SCH_TransformTabDLG_SVXPAGE_ANGLE :
{
- pDlg = new SvxTransformTabDialog( pParent, pAttr,pSdrView, bSizeTabPage ? SVX_OBJ_NOPROTECT : SVX_OBJ_NOPROTECT|SVX_OBJ_NORESIZE);
+ pDlg.reset( VclPtr<SvxTransformTabDialog>::Create( pParent, pAttr,pSdrView, bSizeTabPage ? SVX_OBJ_NOPROTECT : SVX_OBJ_NOPROTECT|SVX_OBJ_NORESIZE) );
pDlg->RemoveTabPage( "RID_SVXPAGE_ANGLE" );
pDlg->RemoveTabPage( "RID_SVXPAGE_SLANT" );
}
break;
case RID_SCH_TransformTabDLG_SVXPAGE_SLANT:
{
- pDlg = new SvxTransformTabDialog( pParent, pAttr,pSdrView, bSizeTabPage ? SVX_OBJ_NOPROTECT : SVX_OBJ_NOPROTECT|SVX_OBJ_NORESIZE);
+ pDlg.reset(VclPtr<SvxTransformTabDialog>::Create ( pParent, pAttr,pSdrView, bSizeTabPage ? SVX_OBJ_NOPROTECT : SVX_OBJ_NOPROTECT|SVX_OBJ_NORESIZE ) );
pDlg->RemoveTabPage( "RID_SVXPAGE_SLANT" );
}
break;
@@ -1354,20 +1356,20 @@ AbstractSvxJSearchOptionsDialog * AbstractDialogFactory_Impl::CreateSvxJSearchOp
const SfxItemSet& rOptionsSet,
sal_Int32 nInitialFlags)
{
- SvxJSearchOptionsDialog* pDlg = new SvxJSearchOptionsDialog( pParent, rOptionsSet, nInitialFlags );
+ VclPtrInstance<SvxJSearchOptionsDialog> pDlg( pParent, rOptionsSet, nInitialFlags );
return new AbstractSvxJSearchOptionsDialog_Impl( pDlg );
}
AbstractFmInputRecordNoDialog * AbstractDialogFactory_Impl::CreateFmInputRecordNoDialog( vcl::Window* pParent )
{
- FmInputRecordNoDialog* pDlg = new FmInputRecordNoDialog( pParent );
+ VclPtrInstance<FmInputRecordNoDialog> pDlg( pParent );
return new AbstractFmInputRecordNoDialog_Impl( pDlg );
}
AbstractSvxNewDictionaryDialog * AbstractDialogFactory_Impl::CreateSvxNewDictionaryDialog( vcl::Window* pParent,
::Reference< ::com::sun::star::linguistic2::XSpellChecker1 > &xSpl )
{
- SvxNewDictionaryDialog* pDlg = new SvxNewDictionaryDialog( pParent, xSpl );
+ VclPtrInstance<SvxNewDictionaryDialog> pDlg( pParent, xSpl );
return new AbstractSvxNewDictionaryDialog_Impl( pDlg );
}
@@ -1380,7 +1382,7 @@ VclAbstractDialog* AbstractDialogFactory_Impl::CreateSvxEditDictionaryDialo
switch ( nResId )
{
case RID_SFXDLG_EDITDICT :
- pDlg = new SvxEditDictionaryDialog( pParent, rName, xSpl );
+ pDlg = VclPtr<SvxEditDictionaryDialog>::Create( pParent, rName, xSpl );
break;
default:
break;
@@ -1394,36 +1396,36 @@ VclAbstractDialog* AbstractDialogFactory_Impl::CreateSvxEditDictionaryDialo
AbstractSvxNameDialog * AbstractDialogFactory_Impl::CreateSvxNameDialog( vcl::Window* pParent,
const OUString& rName, const OUString& rDesc )
{
- SvxNameDialog* pDlg = new SvxNameDialog( pParent, rName, rDesc );
+ VclPtrInstance<SvxNameDialog> pDlg( pParent, rName, rDesc );
return new AbstractSvxNameDialog_Impl( pDlg );
}
AbstractSvxObjectNameDialog* AbstractDialogFactory_Impl::CreateSvxObjectNameDialog(vcl::Window* pParent, const OUString& rName )
{
- return new AbstractSvxObjectNameDialog_Impl(new SvxObjectNameDialog(pParent, rName));
+ return new AbstractSvxObjectNameDialog_Impl(VclPtr<SvxObjectNameDialog>::Create(pParent, rName));
}
AbstractSvxObjectTitleDescDialog* AbstractDialogFactory_Impl::CreateSvxObjectTitleDescDialog(vcl::Window* pParent, const OUString& rTitle, const OUString& rDescription)
{
- return new AbstractSvxObjectTitleDescDialog_Impl(new SvxObjectTitleDescDialog(pParent, rTitle, rDescription));
+ return new AbstractSvxObjectTitleDescDialog_Impl(VclPtr<SvxObjectTitleDescDialog>::Create(pParent, rTitle, rDescription));
}
AbstractSvxMessDialog * AbstractDialogFactory_Impl::CreateSvxMessDialog( vcl::Window* pParent, sal_uInt32,
const OUString& rText, const OUString& rDesc, Image* pImg )
{
- SvxMessDialog* pDlg = new SvxMessDialog( pParent, rText, rDesc, pImg );
+ VclPtrInstance<SvxMessDialog> pDlg( pParent, rText, rDesc, pImg );
return new AbstractSvxMessDialog_Impl( pDlg );
}
AbstractSvxMultiPathDialog * AbstractDialogFactory_Impl::CreateSvxMultiPathDialog(vcl::Window* pParent)
{
- SvxMultiPathDialog* pDlg = new SvxMultiPathDialog(pParent);
+ VclPtrInstance<SvxMultiPathDialog> pDlg(pParent);
return new AbstractSvxMultiPathDialog_Impl( pDlg );
}
AbstractSvxMultiPathDialog * AbstractDialogFactory_Impl::CreateSvxPathSelectDialog(vcl::Window* pParent)
{
- SvxPathSelectDialog* pDlg = new SvxPathSelectDialog(pParent);
+ VclPtrInstance<SvxPathSelectDialog> pDlg(pParent);
return new AbstractSvxPathSelectDialog_Impl( pDlg );
}
@@ -1435,7 +1437,7 @@ AbstractSvxHpLinkDlg * AbstractDialogFactory_Impl::CreateSvxHpLinkDlg (vcl::Wind
switch ( nResId )
{
case SID_HYPERLINK_DIALOG :
- pDlg = new SvxHpLinkDlg( pParent, pBindings );
+ pDlg = VclPtr<SvxHpLinkDlg>::Create( pParent, pBindings );
break;
default:
break;
@@ -1452,7 +1454,8 @@ AbstractFmSearchDialog* AbstractDialogFactory_Impl::CreateFmSearchDialog(vcl::W
sal_Int16 nInitialContext,
const Link& lnkContextSupplier)
{
- FmSearchDialog* pDlg = new FmSearchDialog( pParent, strInitialText, _rContexts, nInitialContext, lnkContextSupplier );
+ VclPtrInstance<FmSearchDialog> pDlg( pParent, strInitialText, _rContexts,
+ nInitialContext, lnkContextSupplier );
return new AbstractFmSearchDialog_Impl( pDlg );
}
@@ -1460,7 +1463,7 @@ AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterEmb
const Graphic& rGraphic,
RECT_POINT eLightSource)
{
- GraphicFilterDialog* pDlg = new GraphicFilterEmboss( pParent, rGraphic, eLightSource );
+ VclPtrInstance<GraphicFilterEmboss> pDlg( pParent, rGraphic, eLightSource );
return new AbstractGraphicFilterDialog_Impl( pDlg );
}
@@ -1468,7 +1471,7 @@ AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterPos
const Graphic& rGraphic,
sal_uInt16 nCount)
{
- GraphicFilterDialog* pDlg = new GraphicFilterPoster( pParent, rGraphic, nCount );
+ VclPtrInstance<GraphicFilterPoster> pDlg( pParent, rGraphic, nCount );
return new AbstractGraphicFilterDialog_Impl( pDlg );
}
@@ -1476,21 +1479,21 @@ AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterSep
const Graphic& rGraphic,
sal_uInt16 nCount)
{
- GraphicFilterDialog* pDlg = new GraphicFilterSepia( pParent, rGraphic, nCount );
+ VclPtrInstance<GraphicFilterSepia> pDlg( pParent, rGraphic, nCount );
return new AbstractGraphicFilterDialog_Impl( pDlg );
}
AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterSmooth(vcl::Window* pParent,
const Graphic& rGraphic, double nRadius)
{
- GraphicFilterDialog* pDlg = new GraphicFilterSmooth( pParent, rGraphic, nRadius );
+ VclPtrInstance<GraphicFilterSmooth> pDlg( pParent, rGraphic, nRadius );
return new AbstractGraphicFilterDialog_Impl( pDlg );
}
AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterSolarize (vcl::Window* pParent,
const Graphic& rGraphic, sal_uInt8 nGreyThreshold, bool bInvert)
{
- GraphicFilterDialog* pDlg = new GraphicFilterSolarize( pParent, rGraphic, nGreyThreshold, bInvert );
+ VclPtrInstance<GraphicFilterSolarize> pDlg( pParent, rGraphic, nGreyThreshold, bInvert );
return new AbstractGraphicFilterDialog_Impl( pDlg );
}
@@ -1498,7 +1501,7 @@ AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterMos
const Graphic& rGraphic, sal_uInt16 nTileWidth, sal_uInt16 nTileHeight,
bool bEnhanceEdges)
{
- GraphicFilterDialog* pDlg = new GraphicFilterMosaic(pParent, rGraphic, nTileWidth, nTileHeight, bEnhanceEdges);
+ VclPtrInstance<GraphicFilterMosaic> pDlg(pParent, rGraphic, nTileWidth, nTileHeight, bEnhanceEdges);
return new AbstractGraphicFilterDialog_Impl( pDlg );
}
@@ -1507,7 +1510,7 @@ AbstractSvxAreaTabDialog* AbstractDialogFactory_Impl::CreateSvxAreaTabDialog( vc
SdrModel* pModel,
bool bShadow)
{
- SvxAreaTabDialog* pDlg = new SvxAreaTabDialog( pParent, pAttr, pModel, bShadow );
+ VclPtrInstance<SvxAreaTabDialog> pDlg( pParent, pAttr, pModel, bShadow );
return new AbstractSvxAreaTabDialog_Impl( pDlg );
}
@@ -1516,7 +1519,7 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateSvxLineTabDialog( vcl::W
const SdrObject* pObj ,
bool bHasObj)
{
- SfxTabDialog* pDlg = new SvxLineTabDialog( pParent, pAttr, pModel,pObj,bHasObj );
+ VclPtrInstance<SvxLineTabDialog> pDlg( pParent, pAttr, pModel,pObj,bHasObj );
return new CuiAbstractTabDialog_Impl( pDlg );
}
@@ -1530,10 +1533,10 @@ SfxAbstractDialog* AbstractDialogFactory_Impl::CreateSfxDialog( vcl::Window* pPa
switch ( nResId )
{
case SID_EVENTCONFIG :
- pDlg = new SfxMacroAssignDlg( pParent, _rxDocumentFrame, rAttr );
+ pDlg = VclPtr<SfxMacroAssignDlg>::Create( pParent, _rxDocumentFrame, rAttr );
break;
case RID_SVXDLG_CHARMAP :
- pDlg = new SvxCharacterMap( pParent, true, &rAttr );
+ pDlg = VclPtr<SvxCharacterMap>::Create( pParent, true, &rAttr );
break;
default:
break;
@@ -1555,13 +1558,13 @@ SfxAbstractDialog* AbstractDialogFactory_Impl::CreateSfxDialog( vcl::Window* pPa
switch ( nResId )
{
case RID_SVXPAGE_MEASURE :
- pDlg = new SvxMeasureDialog( pParent, rAttr, pView );
+ pDlg = VclPtr<SvxMeasureDialog>::Create( pParent, rAttr, pView );
break;
case RID_SVXPAGE_CONNECTION :
- pDlg = new SvxConnectionDialog( pParent, rAttr, pView );
+ pDlg = VclPtr<SvxConnectionDialog>::Create( pParent, rAttr, pView );
break;
case RID_SFXPAGE_DBREGISTER :
- pDlg = new DatabaseRegistrationDialog( pParent, rAttr );
+ pDlg = VclPtr<DatabaseRegistrationDialog>::Create( pParent, rAttr );
break;
default:
break;
@@ -1577,7 +1580,7 @@ AbstractSvxPostItDialog* AbstractDialogFactory_Impl::CreateSvxPostItDialog( vcl:
const SfxItemSet& rCoreSet,
bool bPrevNext )
{
- SvxPostItDialog* pDlg = new SvxPostItDialog( pParent, rCoreSet, bPrevNext );
+ VclPtrInstance<SvxPostItDialog> pDlg( pParent, rCoreSet, bPrevNext );
return new AbstractSvxPostItDialog_Impl( pDlg );
}
@@ -1589,7 +1592,7 @@ public:
:m_aItems( SfxGetpApp()->GetPool(), SID_ATTR_MACROITEM, SID_ATTR_MACROITEM )
{
m_aItems.Put( SfxBoolItem( SID_ATTR_MACROITEM, _bUnoDialogMode ) );
- m_pDialog.reset( new SvxMacroAssignDlg( _pParent, _rxDocumentFrame, m_aItems, _rxEvents, _nInitiallySelectedEvent ) );
+ m_pDialog.reset( VclPtr<SvxMacroAssignDlg>::Create( _pParent, _rxDocumentFrame, m_aItems, _rxEvents, _nInitiallySelectedEvent ) );
}
virtual short Execute() SAL_OVERRIDE;
@@ -1597,7 +1600,7 @@ public:
private:
SfxItemSet m_aItems;
- ::std::unique_ptr< SvxMacroAssignDlg > m_pDialog;
+ VclPtr< SvxMacroAssignDlg > m_pDialog;
};
short SvxMacroAssignDialog::Execute()
@@ -1765,11 +1768,11 @@ SfxAbstractInsertObjectDialog* AbstractDialogFactory_Impl::CreateInsertObjectDia
{
InsertObjectDialog_Impl* pDlg=0;
if ( rCommand == ".uno:InsertObject" )
- pDlg = new SvInsertOleDlg( pParent, xStor, pList );
+ pDlg = VclPtr<SvInsertOleDlg>::Create( pParent, xStor, pList );
else if ( rCommand == ".uno:InsertPlugin" )
- pDlg = new SvInsertPlugInDialog( pParent, xStor );
+ pDlg = VclPtr<SvInsertPlugInDialog>::Create( pParent, xStor );
else if ( rCommand == ".uno:InsertObjectFloatingFrame" )
- pDlg = new SfxInsertFloatingFrameDialog( pParent, xStor );
+ pDlg = VclPtr<SfxInsertFloatingFrameDialog>::Create( pParent, xStor );
if ( pDlg )
{
@@ -1784,7 +1787,7 @@ VclAbstractDialog* AbstractDialogFactory_Impl::CreateEditObjectDialog( vcl::Wind
{
if ( rCommand == ".uno:InsertObjectFloatingFrame" )
{
- InsertObjectDialog_Impl* pDlg = new SfxInsertFloatingFrameDialog( pParent, xObj );
+ VclPtrInstance<SfxInsertFloatingFrameDialog> pDlg( pParent, xObj );
pDlg->SetHelpId( OUStringToOString( rCommand, RTL_TEXTENCODING_UTF8 ) );
return new CuiVclAbstractDialog_Impl( pDlg );
}
@@ -1795,12 +1798,12 @@ VclAbstractDialog* AbstractDialogFactory_Impl::CreateEditObjectDialog( vcl::Wind
SfxAbstractPasteDialog* AbstractDialogFactory_Impl::CreatePasteDialog( vcl::Window* pParent )
{
- return new AbstractPasteDialog_Impl( new SvPasteObjectDialog( pParent ) );
+ return new AbstractPasteDialog_Impl( VclPtr<SvPasteObjectDialog>::Create( pParent ) );
}
SfxAbstractLinksDialog* AbstractDialogFactory_Impl::CreateLinksDialog( vcl::Window* pParent, sfx2::LinkManager* pMgr, bool bHTML, sfx2::SvBaseLink* p)
{
- SvBaseLinksDlg* pLinkDlg = new SvBaseLinksDlg( pParent, pMgr, bHTML );
+ VclPtrInstance<SvBaseLinksDlg> pLinkDlg( pParent, pMgr, bHTML );
if ( p )
pLinkDlg->SetActLink(p);
return new AbstractLinksDialog_Impl( pLinkDlg );
@@ -1808,7 +1811,7 @@ SfxAbstractLinksDialog* AbstractDialogFactory_Impl::CreateLinksDialog( vcl::Wind
SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateSvxFormatCellsDialog( vcl::Window* pParent, const SfxItemSet* pAttr, SdrModel* pModel, const SdrObject* /*pObj*/ )
{
- return new CuiAbstractTabDialog_Impl( new SvxFormatCellsDialog( pParent, pAttr, pModel ) );
+ return new CuiAbstractTabDialog_Impl( VclPtr<SvxFormatCellsDialog>::Create( pParent, pAttr, pModel ) );
}
SvxAbstractSplittTableDialog* AbstractDialogFactory_Impl::CreateSvxSplittTableDialog( vcl::Window* pParent, bool bIsTableVertical, long nMaxVertical, long nMaxHorizontal )
@@ -1824,7 +1827,7 @@ SvxAbstractNewTableDialog* AbstractDialogFactory_Impl::CreateSvxNewTableDialog(
VclAbstractDialog* AbstractDialogFactory_Impl::CreateOptionsDialog(
vcl::Window* pParent, const OUString& rExtensionId, const OUString& /*rApplicationContext*/ )
{
- return new CuiVclAbstractDialog_Impl( new OfaTreeOptionsDialog( pParent, rExtensionId ) );
+ return new CuiVclAbstractDialog_Impl( VclPtr<OfaTreeOptionsDialog>::Create( pParent, rExtensionId ) );
}
SvxAbstractInsRowColDlg* AbstractDialogFactory_Impl::CreateSvxInsRowColDlg( vcl::Window* pParent, bool bCol, const OString& sHelpId )
@@ -1836,7 +1839,7 @@ AbstractPasswordToOpenModifyDialog * AbstractDialogFactory_Impl::CreatePasswordT
vcl::Window * pParent,
sal_uInt16 nMinPasswdLen, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify )
{
- PasswordToOpenModifyDialog * pDlg = new PasswordToOpenModifyDialog( pParent, nMinPasswdLen, nMaxPasswdLen, bIsPasswordToModify );
+ VclPtrInstance<PasswordToOpenModifyDialog> pDlg( pParent, nMinPasswdLen, nMaxPasswdLen, bIsPasswordToModify );
return new AbstractPasswordToOpenModifyDialog_Impl( pDlg );
}
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index ffb15778c5e1..808a80c96fa5 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -61,7 +61,7 @@ class HangulHanjaConversionDialog;
using namespace svx;
#define DECL_ABSTDLG_BASE(Class,DialogClass) \
- DialogClass* pDlg; \
+ VclPtr<DialogClass> pDlg; \
public: \
Class( DialogClass* p) \
: pDlg(p) \
@@ -72,16 +72,16 @@ public: \
#define IMPL_ABSTDLG_BASE(Class) \
Class::~Class() \
{ \
- delete pDlg; \
+ pDlg.disposeAndClear(); \
} \
-short Class::Execute() \
+short Class::Execute() \
{ \
return pDlg->Execute(); \
}
class VclAbstractDialog2_Impl : public VclAbstractDialog2
{
- Dialog* m_pDlg;
+ ScopedVclPtr<Dialog> m_pDlg;
Link m_aEndDlgHdl;
public:
VclAbstractDialog2_Impl( Dialog* p ) : m_pDlg( p ) {}
diff --git a/cui/source/factory/init.cxx b/cui/source/factory/init.cxx
index eb24820e3351..cdf2ed91d22b 100644
--- a/cui/source/factory/init.cxx
+++ b/cui/source/factory/init.cxx
@@ -28,7 +28,7 @@ extern "C"
SAL_DLLPUBLIC_EXPORT bool GetSpecialCharsForEdit(vcl::Window* i_pParent, const vcl::Font& i_rFont, OUString& o_rResult)
{
bool bRet = false;
- boost::scoped_ptr<SvxCharacterMap> aDlg(new SvxCharacterMap( i_pParent ));
+ VclPtrInstance< SvxCharacterMap > aDlg( i_pParent );
aDlg->DisableFontSelection();
aDlg->SetCharFont(i_rFont);
if ( aDlg->Execute() == RET_OK )
diff --git a/cui/source/inc/ControlFocusHelper.hxx b/cui/source/inc/ControlFocusHelper.hxx
index b984838fa09c..6530f3cf6740 100644
--- a/cui/source/inc/ControlFocusHelper.hxx
+++ b/cui/source/inc/ControlFocusHelper.hxx
@@ -26,11 +26,13 @@
class SvxControlFocusHelper : public Control
{
private:
- Control* m_pFocusCtrl;
+ VclPtr<Control> m_pFocusCtrl;
public:
SvxControlFocusHelper( vcl::Window* pParent, const ResId& rId ) :
Control( pParent, rId ), m_pFocusCtrl( NULL ) {}
+ virtual ~SvxControlFocusHelper();
+ virtual void dispose() SAL_OVERRIDE;
void SetFocusControl( Control* pCtrl ) { m_pFocusCtrl = pCtrl; }
diff --git a/cui/source/inc/SpellDialog.hxx b/cui/source/inc/SpellDialog.hxx
index 7b8646fee38b..411df36dd123 100644
--- a/cui/source/inc/SpellDialog.hxx
+++ b/cui/source/inc/SpellDialog.hxx
@@ -76,7 +76,6 @@ protected:
public:
SentenceEditWindow_Impl(vcl::Window* pParent, WinBits nBits);
- virtual ~SentenceEditWindow_Impl();
void SetModifyHdl(const Link& rLink) SAL_OVERRIDE { m_aModifyLink = rLink;}
@@ -125,33 +124,33 @@ class SpellDialog : public SfxModelessDialog
friend class SentenceEditWindow_Impl;
private:
- FixedText* m_pLanguageFT;
- SvxLanguageBox* m_pLanguageLB;
+ VclPtr<FixedText> m_pLanguageFT;
+ VclPtr<SvxLanguageBox> m_pLanguageLB;
- FixedText* m_pExplainFT;
- FixedHyperlink* m_pExplainLink;
+ VclPtr<FixedText> m_pExplainFT;
+ VclPtr<FixedHyperlink> m_pExplainLink;
- FixedText* m_pNotInDictFT;
- SentenceEditWindow_Impl* m_pSentenceED;
+ VclPtr<FixedText> m_pNotInDictFT;
+ VclPtr<SentenceEditWindow_Impl> m_pSentenceED;
- FixedText* m_pSuggestionFT;
- ListBox* m_pSuggestionLB;
+ VclPtr<FixedText> m_pSuggestionFT;
+ VclPtr<ListBox> m_pSuggestionLB;
- PushButton* m_pIgnorePB;
- PushButton* m_pIgnoreAllPB;
- PushButton* m_pIgnoreRulePB;
- PushButton* m_pAddToDictPB;
- MenuButton* m_pAddToDictMB;
+ VclPtr<PushButton> m_pIgnorePB;
+ VclPtr<PushButton> m_pIgnoreAllPB;
+ VclPtr<PushButton> m_pIgnoreRulePB;
+ VclPtr<PushButton> m_pAddToDictPB;
+ VclPtr<MenuButton> m_pAddToDictMB;
- PushButton* m_pChangePB;
- PushButton* m_pChangeAllPB;
- PushButton* m_pAutoCorrPB;
+ VclPtr<PushButton> m_pChangePB;
+ VclPtr<PushButton> m_pChangeAllPB;
+ VclPtr<PushButton> m_pAutoCorrPB;
- CheckBox* m_pCheckGrammarCB;
+ VclPtr<CheckBox> m_pCheckGrammarCB;
- PushButton* m_pOptionsPB;
- PushButton* m_pUndoPB;
- CloseButton* m_pClosePB;
+ VclPtr<PushButton> m_pOptionsPB;
+ VclPtr<PushButton> m_pUndoPB;
+ VclPtr<CloseButton> m_pClosePB;
OUString m_sResumeST;
OUString m_sIgnoreOnceST;
@@ -220,6 +219,7 @@ public:
vcl::Window * pParent,
SfxBindings* pBindings);
virtual ~SpellDialog();
+ virtual void dispose() SAL_OVERRIDE;
void SetLanguage( sal_uInt16 nLang );
virtual bool Close() SAL_OVERRIDE;
diff --git a/cui/source/inc/about.hxx b/cui/source/inc/about.hxx
index 132ab541702e..82cfac00ee18 100644
--- a/cui/source/inc/about.hxx
+++ b/cui/source/inc/about.hxx
@@ -34,13 +34,13 @@ private:
BitmapEx aBackgroundBitmap;
BitmapEx aLogoBitmap;
- VclMultiLineEdit* m_pVersion;
- FixedText* m_pDescriptionText;
- FixedText* m_pCopyrightText;
- FixedImage* m_pLogoImage;
- FixedText* m_pLogoReplacement;
- PushButton* m_pCreditsButton;
- PushButton* m_pWebsiteButton;
+ VclPtr<VclMultiLineEdit> m_pVersion;
+ VclPtr<FixedText> m_pDescriptionText;
+ VclPtr<FixedText> m_pCopyrightText;
+ VclPtr<FixedImage> m_pLogoImage;
+ VclPtr<FixedText> m_pLogoReplacement;
+ VclPtr<PushButton> m_pCreditsButton;
+ VclPtr<PushButton> m_pWebsiteButton;
OUString m_aVersionTextStr;
OUString m_aVendorTextStr;
@@ -66,6 +66,8 @@ protected:
public:
AboutDialog(vcl::Window* pParent);
+ virtual ~AboutDialog();
+ virtual void dispose() SAL_OVERRIDE;
DECL_LINK( HandleClick, PushButton* );
};
diff --git a/cui/source/inc/acccfg.hxx b/cui/source/inc/acccfg.hxx
index 88d096f8425f..6c487cabc80f 100644
--- a/cui/source/inc/acccfg.hxx
+++ b/cui/source/inc/acccfg.hxx
@@ -53,7 +53,7 @@ class SfxStringItem;
class SfxAccCfgTabListBox_Impl : public SvTabListBox
{
- SfxAcceleratorConfigPage* m_pAccelConfigPage;
+ VclPtr<SfxAcceleratorConfigPage> m_pAccelConfigPage;
void KeyInput( const KeyEvent &rKEvt ) SAL_OVERRIDE;
@@ -67,6 +67,8 @@ public:
, m_pAccelConfigPage(NULL)
{
}
+ virtual ~SfxAccCfgTabListBox_Impl();
+ virtual void dispose() SAL_OVERRIDE;
void SetAccelConfigPage(SfxAcceleratorConfigPage* pAccelConfigPage)
{
@@ -118,17 +120,17 @@ private:
const SfxStringItem* m_pFontItem;
sfx2::FileDialogHelper* m_pFileDlg;
- SfxAccCfgTabListBox_Impl* m_pEntriesBox;
- RadioButton* m_pOfficeButton;
- RadioButton* m_pModuleButton;
- PushButton* m_pChangeButton;
- PushButton* m_pRemoveButton;
- SfxConfigGroupListBox* m_pGroupLBox;
- SfxConfigFunctionListBox* m_pFunctionBox;
- SvTreeListBox* m_pKeyBox;
- PushButton* m_pLoadButton;
- PushButton* m_pSaveButton;
- PushButton* m_pResetButton;
+ VclPtr<SfxAccCfgTabListBox_Impl> m_pEntriesBox;
+ VclPtr<RadioButton> m_pOfficeButton;
+ VclPtr<RadioButton> m_pModuleButton;
+ VclPtr<PushButton> m_pChangeButton;
+ VclPtr<PushButton> m_pRemoveButton;
+ VclPtr<SfxConfigGroupListBox> m_pGroupLBox;
+ VclPtr<SfxConfigFunctionListBox> m_pFunctionBox;
+ VclPtr<SvTreeListBox> m_pKeyBox;
+ VclPtr<PushButton> m_pLoadButton;
+ VclPtr<PushButton> m_pSaveButton;
+ VclPtr<PushButton> m_pResetButton;
OUString aLoadAccelConfigStr;
OUString aSaveAccelConfigStr;
OUString aFilterAllStr;
@@ -172,6 +174,7 @@ private:
public:
SfxAcceleratorConfigPage( vcl::Window *pParent, const SfxItemSet& rItemSet );
virtual ~SfxAcceleratorConfigPage();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* ) SAL_OVERRIDE;
diff --git a/cui/source/inc/align.hxx b/cui/source/inc/align.hxx
index b6d9e46baa9b..b0f5e0aa7b5f 100644
--- a/cui/source/inc/align.hxx
+++ b/cui/source/inc/align.hxx
@@ -58,8 +58,9 @@ class AlignmentTabPage : public SfxTabPage
public:
virtual ~AlignmentTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
static const sal_uInt16* GetRanges() { return s_pRanges; }
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -78,36 +79,36 @@ private:
DECL_LINK( UpdateEnableHdl, void* );
private:
- ListBox* m_pLbHorAlign;
- FixedText* m_pFtIndent;
- MetricField* m_pEdIndent;
- FixedText* m_pFtVerAlign;
- ListBox* m_pLbVerAlign;
-
- DialControl* m_pCtrlDial;
- FixedText* m_pFtRotate;
- NumericField* m_pNfRotate;
- FixedText* m_pFtRefEdge;
- ValueSet* m_pVsRefEdge;
- TriStateBox* m_pCbStacked;
- TriStateBox* m_pCbAsianMode;
+ VclPtr<ListBox> m_pLbHorAlign;
+ VclPtr<FixedText> m_pFtIndent;
+ VclPtr<MetricField> m_pEdIndent;
+ VclPtr<FixedText> m_pFtVerAlign;
+ VclPtr<ListBox> m_pLbVerAlign;
+
+ VclPtr<DialControl> m_pCtrlDial;
+ VclPtr<FixedText> m_pFtRotate;
+ VclPtr<NumericField> m_pNfRotate;
+ VclPtr<FixedText> m_pFtRefEdge;
+ VclPtr<ValueSet> m_pVsRefEdge;
+ VclPtr<TriStateBox> m_pCbStacked;
+ VclPtr<TriStateBox> m_pCbAsianMode;
OrientationHelper* m_pOrientHlp;
- VclHBox* m_pBoxDirection;
- TriStateBox* m_pBtnWrap;
- TriStateBox* m_pBtnHyphen;
- TriStateBox* m_pBtnShrink;
- FrameDirListBox* m_pLbFrameDir;
+ VclPtr<VclHBox> m_pBoxDirection;
+ VclPtr<TriStateBox> m_pBtnWrap;
+ VclPtr<TriStateBox> m_pBtnHyphen;
+ VclPtr<TriStateBox> m_pBtnShrink;
+ VclPtr<FrameDirListBox> m_pLbFrameDir;
// hidden labels/string
- FixedText* m_pFtBotLock;
- FixedText* m_pFtTopLock;
- FixedText* m_pFtCelLock;
- FixedText* m_pFtABCD;
-
- VclContainer* m_pAlignmentFrame;
- VclContainer* m_pOrientFrame;
- VclContainer* m_pPropertiesFrame;
+ VclPtr<FixedText> m_pFtBotLock;
+ VclPtr<FixedText> m_pFtTopLock;
+ VclPtr<FixedText> m_pFtCelLock;
+ VclPtr<FixedText> m_pFtABCD;
+
+ VclPtr<VclContainer> m_pAlignmentFrame;
+ VclPtr<VclContainer> m_pOrientFrame;
+ VclPtr<VclContainer> m_pPropertiesFrame;
};
diff --git a/cui/source/inc/autocdlg.hxx b/cui/source/inc/autocdlg.hxx
index 8d6d1bc16f58..d56700e45e7a 100644
--- a/cui/source/inc/autocdlg.hxx
+++ b/cui/source/inc/autocdlg.hxx
@@ -43,8 +43,8 @@ namespace editeng { class SortedAutoCompleteStrings; }
class OfaAutoCorrDlg : public SfxTabDialog
{
- VclContainer* m_pLanguageBox;
- SvxLanguageBox* m_pLanguageLB;
+ VclPtr<VclContainer> m_pLanguageBox;
+ VclPtr<SvxLanguageBox> m_pLanguageLB;
sal_uInt16 m_nReplacePageId;
sal_uInt16 m_nExceptionsPageId;
@@ -53,6 +53,8 @@ class OfaAutoCorrDlg : public SfxTabDialog
public:
OfaAutoCorrDlg(vcl::Window* pParent, const SfxItemSet *pSet);
+ virtual ~OfaAutoCorrDlg();
+ virtual void dispose() SAL_OVERRIDE;
void EnableLanguage(bool bEnable);
};
@@ -94,7 +96,7 @@ class OfaAutocorrOptionsPage : public SfxTabPage
using TabPage::ActivatePage;
private:
- SvxCheckListBox *m_pCheckLB;
+ VclPtr<SvxCheckListBox> m_pCheckLB;
OUString m_sInput;
OUString m_sDoubleCaps;
@@ -107,8 +109,10 @@ private:
public:
OfaAutocorrOptionsPage(vcl::Window* pParent, const SfxItemSet& rSet);
+ virtual ~OfaAutocorrOptionsPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet);
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -123,8 +127,8 @@ class OfaSwAutoFmtOptionsPage : public SfxTabPage
{
using TabPage::ActivatePage;
- OfaACorrCheckListBox* m_pCheckLB;
- PushButton* m_pEditPB;
+ VclPtr<OfaACorrCheckListBox> m_pCheckLB;
+ VclPtr<PushButton> m_pEditPB;
OUString sDeleteEmptyPara;
OUString sUseReplaceTbl;
@@ -163,9 +167,10 @@ class OfaSwAutoFmtOptionsPage : public SfxTabPage
OfaSwAutoFmtOptionsPage( vcl::Window* pParent,
const SfxItemSet& rSet );
virtual ~OfaSwAutoFmtOptionsPage();
+ virtual void dispose() SAL_OVERRIDE;
- public:
- static SfxTabPage* Create( vcl::Window* pParent,
+public:
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet);
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -224,12 +229,12 @@ private:
StringChangeTable aChangesTable;
- CheckBox* m_pTextOnlyCB;
- AutoCorrEdit* m_pShortED;
- AutoCorrEdit* m_pReplaceED;
- SvTabListBox* m_pReplaceTLB;
- PushButton* m_pNewReplacePB;
- PushButton* m_pDeleteReplacePB;
+ VclPtr<CheckBox> m_pTextOnlyCB;
+ VclPtr<AutoCorrEdit> m_pShortED;
+ VclPtr<AutoCorrEdit> m_pReplaceED;
+ VclPtr<SvTabListBox> m_pReplaceTLB;
+ VclPtr<PushButton> m_pNewReplacePB;
+ VclPtr<PushButton> m_pDeleteReplacePB;
OUString sModify;
OUString sNew;
@@ -257,8 +262,9 @@ private:
public:
OfaAutocorrReplacePage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~OfaAutocorrReplacePage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet);
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet);
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -289,17 +295,17 @@ class OfaAutocorrExceptPage : public SfxTabPage
using TabPage::DeactivatePage;
private:
- AutoCorrEdit* m_pAbbrevED;
- ListBox* m_pAbbrevLB;
- PushButton* m_pNewAbbrevPB;
- PushButton* m_pDelAbbrevPB;
- CheckBox* m_pAutoAbbrevCB;
-
- AutoCorrEdit* m_pDoubleCapsED;
- ListBox* m_pDoubleCapsLB;
- PushButton* m_pNewDoublePB;
- PushButton* m_pDelDoublePB;
- CheckBox* m_pAutoCapsCB;
+ VclPtr<AutoCorrEdit> m_pAbbrevED;
+ VclPtr<ListBox> m_pAbbrevLB;
+ VclPtr<PushButton> m_pNewAbbrevPB;
+ VclPtr<PushButton> m_pDelAbbrevPB;
+ VclPtr<CheckBox> m_pAutoAbbrevCB;
+
+ VclPtr<AutoCorrEdit> m_pDoubleCapsED;
+ VclPtr<ListBox> m_pDoubleCapsLB;
+ VclPtr<PushButton> m_pNewDoublePB;
+ VclPtr<PushButton> m_pDelDoublePB;
+ VclPtr<CheckBox> m_pAutoCapsCB;
StringsTable aStringsTable;
CollatorWrapper* pCompareClass;
@@ -315,8 +321,9 @@ private:
public:
OfaAutocorrExceptPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~OfaAutocorrExceptPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet);
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -335,29 +342,29 @@ class OfaQuoteTabPage : public SfxTabPage
private:
/// For anything but writer
- SvxCheckListBox* m_pCheckLB;
+ VclPtr<SvxCheckListBox> m_pCheckLB;
/// Just for writer
- OfaACorrCheckListBox* m_pSwCheckLB;
+ VclPtr<OfaACorrCheckListBox> m_pSwCheckLB;
OUString sNonBrkSpace;
OUString sOrdinal;
SvLBoxButtonData* pCheckButtonData;
- CheckBox* m_pSingleTypoCB;
- PushButton* m_pSglStartQuotePB;
- FixedText* m_pSglStartExFT;
- PushButton* m_pSglEndQuotePB;
- FixedText* m_pSglEndExFT;
- PushButton* m_pSglStandardPB;
+ VclPtr<CheckBox> m_pSingleTypoCB;
+ VclPtr<PushButton> m_pSglStartQuotePB;
+ VclPtr<FixedText> m_pSglStartExFT;
+ VclPtr<PushButton> m_pSglEndQuotePB;
+ VclPtr<FixedText> m_pSglEndExFT;
+ VclPtr<PushButton> m_pSglStandardPB;
- CheckBox* m_pDoubleTypoCB;
- PushButton* m_pDblStartQuotePB;
- FixedText* m_pDblStartExFT;
- PushButton* m_pDblEndQuotePB;
- FixedText* m_pDblEndExFT;
- PushButton* m_pDblStandardPB;
+ VclPtr<CheckBox> m_pDoubleTypoCB;
+ VclPtr<PushButton> m_pDblStartQuotePB;
+ VclPtr<FixedText> m_pDblStartExFT;
+ VclPtr<PushButton> m_pDblEndQuotePB;
+ VclPtr<FixedText> m_pDblEndExFT;
+ VclPtr<PushButton> m_pDblStandardPB;
OUString m_sStartQuoteDlg;
OUString m_sEndQuoteDlg;
@@ -381,8 +388,9 @@ private:
OfaQuoteTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
public:
virtual ~OfaQuoteTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet);
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -397,31 +405,33 @@ class OfaAutoCompleteTabPage : public SfxTabPage
public:
class AutoCompleteMultiListBox : public MultiListBox
{
- OfaAutoCompleteTabPage* m_pPage;
+ VclPtr<OfaAutoCompleteTabPage> m_pPage;
public:
AutoCompleteMultiListBox(vcl::Window *pParent, WinBits nBits)
: MultiListBox(pParent, nBits)
, m_pPage(NULL)
{
}
+ virtual ~AutoCompleteMultiListBox();
+ virtual void dispose() SAL_OVERRIDE;
void SetPage(OfaAutoCompleteTabPage *pPage) { m_pPage = pPage; }
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
};
private:
using TabPage::ActivatePage;
- CheckBox* m_pCBActiv; ///<Enable word completion
- CheckBox* m_pCBAppendSpace;///<Append space
- CheckBox* m_pCBAsTip; ///<Show as tip
-
- CheckBox* m_pCBCollect;///<Collect words
- CheckBox* m_pCBRemoveList;///<...save the list for later use...
-
- ListBox* m_pDCBExpandKey;
- NumericField* m_pNFMinWordlen;
- NumericField* m_pNFMaxEntries;
- AutoCompleteMultiListBox* m_pLBEntries;
- PushButton* m_pPBEntries;
+ VclPtr<CheckBox> m_pCBActiv; ///<Enable word completion
+ VclPtr<CheckBox> m_pCBAppendSpace;///<Append space
+ VclPtr<CheckBox> m_pCBAsTip; ///<Show as tip
+
+ VclPtr<CheckBox> m_pCBCollect;///<Collect words
+ VclPtr<CheckBox> m_pCBRemoveList;///<...save the list for later use...
+
+ VclPtr<ListBox> m_pDCBExpandKey;
+ VclPtr<NumericField> m_pNFMinWordlen;
+ VclPtr<NumericField> m_pNFMaxEntries;
+ VclPtr<AutoCompleteMultiListBox> m_pLBEntries;
+ VclPtr<PushButton> m_pPBEntries;
editeng::SortedAutoCompleteStrings* m_pAutoCompleteList;
sal_uInt16 m_nAutoCmpltListCnt;
@@ -430,9 +440,9 @@ private:
OfaAutoCompleteTabPage( vcl::Window* pParent,
const SfxItemSet& rSet );
public:
- virtual ~OfaAutoCompleteTabPage();
-
- static SfxTabPage* Create( vcl::Window* pParent,
+ virtual ~OfaAutoCompleteTabPage();
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet);
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -456,12 +466,9 @@ class OfaSmartTagOptionsTabPage : public SfxTabPage
private:
// controls
- CheckBox* m_pMainCB;
- SvxCheckListBox* m_pSmartTagTypesLB;
- PushButton* m_pPropertiesPB;
-
- /// construction via Create()
- OfaSmartTagOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
+ VclPtr<CheckBox> m_pMainCB;
+ VclPtr<SvxCheckListBox> m_pSmartTagTypesLB;
+ VclPtr<PushButton> m_pPropertiesPB;
/** Inserts items into m_aSmartTagTypesLB
@@ -496,10 +503,12 @@ private:
DECL_LINK(SelectHdl, void *);
public:
-
+ /// construction via Create()
+ OfaSmartTagOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~OfaSmartTagOptionsTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet);
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet);
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
diff --git a/cui/source/inc/backgrnd.hxx b/cui/source/inc/backgrnd.hxx
index 0686c81ceb3a..70d01e9b87ff 100644
--- a/cui/source/inc/backgrnd.hxx
+++ b/cui/source/inc/backgrnd.hxx
@@ -47,7 +47,7 @@ class SvxBackgroundTabPage : public SvxTabPage
using TabPage::DeactivatePage;
static const sal_uInt16 pPageRanges[];
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
// returns the area of the which-values
static const sal_uInt16* GetRanges() { return pPageRanges; }
@@ -71,40 +71,41 @@ protected:
private:
SvxBackgroundTabPage( vcl::Window* pParent, const SfxItemSet& rCoreSet );
virtual ~SvxBackgroundTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- VclContainer* m_pAsGrid;
- FixedText* m_pSelectTxt;
- ListBox* m_pLbSelect;
- FixedText* m_pTblDesc;
- ListBox* m_pTblLBox;
- ListBox* m_pParaLBox;
+ VclPtr<VclContainer> m_pAsGrid;
+ VclPtr<FixedText> m_pSelectTxt;
+ VclPtr<ListBox> m_pLbSelect;
+ VclPtr<FixedText> m_pTblDesc;
+ VclPtr<ListBox> m_pTblLBox;
+ VclPtr<ListBox> m_pParaLBox;
- VclFrame* m_pBackGroundColorFrame;
- SvxColorValueSet* m_pBackgroundColorSet;
- BackgroundPreviewImpl* m_pPreviewWin1;
+ VclPtr<VclFrame> m_pBackGroundColorFrame;
+ VclPtr<SvxColorValueSet> m_pBackgroundColorSet;
+ VclPtr<BackgroundPreviewImpl> m_pPreviewWin1;
- FixedText* m_pColTransFT;///<color transparency
- MetricField* m_pColTransMF;
- CheckBox* m_pBtnPreview;
+ VclPtr<FixedText> m_pColTransFT;///<color transparency
+ VclPtr<MetricField> m_pColTransMF;
+ VclPtr<CheckBox> m_pBtnPreview;
// Background Bitmap ----------------------------------
- VclContainer* m_pBitmapContainer;
- VclContainer* m_pFileFrame;
- PushButton* m_pBtnBrowse;
- CheckBox* m_pBtnLink;
- FixedText* m_pFtUnlinked;
- FixedText* m_pFtFile;
-
- VclContainer* m_pTypeFrame;
- RadioButton* m_pBtnPosition;
- RadioButton* m_pBtnArea;
- RadioButton* m_pBtnTile;
- SvxRectCtl* m_pWndPosition;
-
- VclContainer* m_pGraphTransFrame;///<transparency of graphics
- MetricField* m_pGraphTransMF;
-
- BackgroundPreviewImpl* m_pPreviewWin2;
+ VclPtr<VclContainer> m_pBitmapContainer;
+ VclPtr<VclContainer> m_pFileFrame;
+ VclPtr<PushButton> m_pBtnBrowse;
+ VclPtr<CheckBox> m_pBtnLink;
+ VclPtr<FixedText> m_pFtUnlinked;
+ VclPtr<FixedText> m_pFtFile;
+
+ VclPtr<VclContainer> m_pTypeFrame;
+ VclPtr<RadioButton> m_pBtnPosition;
+ VclPtr<RadioButton> m_pBtnArea;
+ VclPtr<RadioButton> m_pBtnTile;
+ VclPtr<SvxRectCtl> m_pWndPosition;
+
+ VclPtr<VclContainer> m_pGraphTransFrame;///<transparency of graphics
+ VclPtr<MetricField> m_pGraphTransMF;
+
+ VclPtr<BackgroundPreviewImpl> m_pPreviewWin2;
// DDListBox for Writer -------------------------------
diff --git a/cui/source/inc/border.hxx b/cui/source/inc/border.hxx
index 9e2ed6622c9d..8f129977a546 100644
--- a/cui/source/inc/border.hxx
+++ b/cui/source/inc/border.hxx
@@ -45,7 +45,9 @@ class SvxBorderTabPage : public SfxTabPage
static const sal_uInt16 pRanges[];
public:
- static SfxTabPage* Create( vcl::Window* pParent,
+ virtual ~SvxBorderTabPage();
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet);
static const sal_uInt16* GetRanges() { return pRanges; }
@@ -61,40 +63,39 @@ protected:
private:
SvxBorderTabPage( vcl::Window* pParent, const SfxItemSet& rCoreAttrs );
- virtual ~SvxBorderTabPage();
// Controls
- ValueSet* m_pWndPresets;
- FixedText* m_pUserDefFT;
- svx::FrameSelector* m_pFrameSel;
-
- LineListBox* m_pLbLineStyle;
- ColorListBox* m_pLbLineColor;
- MetricField* m_pLineWidthMF;
-
- VclContainer* m_pSpacingFrame;
- FixedText* m_pLeftFT;
- MetricField* m_pLeftMF;
- FixedText* m_pRightFT;
- MetricField* m_pRightMF;
- FixedText* m_pTopFT;
- MetricField* m_pTopMF;
- FixedText* m_pBottomFT;
- MetricField* m_pBottomMF;
- CheckBox* m_pSynchronizeCB;
-
- VclContainer* m_pShadowFrame;
- ValueSet* m_pWndShadows;
- FixedText* m_pFtShadowSize;
- MetricField* m_pEdShadowSize;
- FixedText* m_pFtShadowColor;
- ColorListBox* m_pLbShadowColor;
-
-
- VclContainer* m_pPropertiesFrame;///< properties - "Merge with next paragraph" in Writer
- CheckBox* m_pMergeWithNextCB;
+ VclPtr<ValueSet> m_pWndPresets;
+ VclPtr<FixedText> m_pUserDefFT;
+ VclPtr<svx::FrameSelector> m_pFrameSel;
+
+ VclPtr<LineListBox> m_pLbLineStyle;
+ VclPtr<ColorListBox> m_pLbLineColor;
+ VclPtr<MetricField> m_pLineWidthMF;
+
+ VclPtr<VclContainer> m_pSpacingFrame;
+ VclPtr<FixedText> m_pLeftFT;
+ VclPtr<MetricField> m_pLeftMF;
+ VclPtr<FixedText> m_pRightFT;
+ VclPtr<MetricField> m_pRightMF;
+ VclPtr<FixedText> m_pTopFT;
+ VclPtr<MetricField> m_pTopMF;
+ VclPtr<FixedText> m_pBottomFT;
+ VclPtr<MetricField> m_pBottomMF;
+ VclPtr<CheckBox> m_pSynchronizeCB;
+
+ VclPtr<VclContainer> m_pShadowFrame;
+ VclPtr<ValueSet> m_pWndShadows;
+ VclPtr<FixedText> m_pFtShadowSize;
+ VclPtr<MetricField> m_pEdShadowSize;
+ VclPtr<FixedText> m_pFtShadowColor;
+ VclPtr<ColorListBox> m_pLbShadowColor;
+
+
+ VclPtr<VclContainer> m_pPropertiesFrame;///< properties - "Merge with next paragraph" in Writer
+ VclPtr<CheckBox> m_pMergeWithNextCB;
// #i29550#
- CheckBox* m_pMergeAdjacentBordersCB;
+ VclPtr<CheckBox> m_pMergeAdjacentBordersCB;
ImageList aShadowImgLstH;
ImageList aShadowImgLst;
@@ -114,8 +115,8 @@ private:
std::set<sal_Int16> maUsedBorderStyles;
// Handler
- DECL_LINK( SelStyleHdl_Impl, ListBox* pLb );
- DECL_LINK( SelColHdl_Impl, ListBox* pLb );
+ DECL_LINK( SelStyleHdl_Impl, ListBox* );
+ DECL_LINK( SelColHdl_Impl, ListBox* );
DECL_LINK( SelPreHdl_Impl, void* );
DECL_LINK( SelSdwHdl_Impl, void* );
DECL_LINK( LinesChanged_Impl, void* );
diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx
index 58505ff614e2..759b1406d3e6 100644
--- a/cui/source/inc/cfg.hxx
+++ b/cui/source/inc/cfg.hxx
@@ -315,7 +315,7 @@ public:
class SvxMenuEntriesListBox : public SvTreeListBox
{
private:
- SvxConfigPage* pPage;
+ VclPtr<SvxConfigPage> pPage;
protected:
bool m_bIsInternalDrag;
@@ -323,6 +323,7 @@ protected:
public:
SvxMenuEntriesListBox(vcl::Window*, SvxConfigPage*);
virtual ~SvxMenuEntriesListBox();
+ virtual void dispose() SAL_OVERRIDE;
virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) SAL_OVERRIDE;
@@ -359,30 +360,30 @@ protected:
// the top section of the tab page where top level menus and toolbars
// are displayed in a listbox
- VclFrame* m_pTopLevel;
- FixedText* m_pTopLevelLabel;
- ListBox* m_pTopLevelListBox;
- PushButton* m_pNewTopLevelButton;
- MenuButton* m_pModifyTopLevelButton;
+ VclPtr<VclFrame> m_pTopLevel;
+ VclPtr<FixedText> m_pTopLevelLabel;
+ VclPtr<ListBox> m_pTopLevelListBox;
+ VclPtr<PushButton> m_pNewTopLevelButton;
+ VclPtr<MenuButton> m_pModifyTopLevelButton;
// the contents section where the contents of the selected
// menu or toolbar are displayed
- VclFrame* m_pContents;
- FixedText* m_pContentsLabel;
- VclContainer* m_pEntries;
- SvTreeListBox* m_pContentsListBox;
+ VclPtr<VclFrame> m_pContents;
+ VclPtr<FixedText> m_pContentsLabel;
+ VclPtr<VclContainer> m_pEntries;
+ VclPtr<SvTreeListBox> m_pContentsListBox;
- PushButton* m_pAddCommandsButton;
- MenuButton* m_pModifyCommandButton;
+ VclPtr<PushButton> m_pAddCommandsButton;
+ VclPtr<MenuButton> m_pModifyCommandButton;
- PushButton* m_pMoveUpButton;
- PushButton* m_pMoveDownButton;
+ VclPtr<PushButton> m_pMoveUpButton;
+ VclPtr<PushButton> m_pMoveDownButton;
- ListBox* m_pSaveInListBox;
+ VclPtr<ListBox> m_pSaveInListBox;
- VclMultiLineEdit* m_pDescriptionField;
+ VclPtr<VclMultiLineEdit> m_pDescriptionField;
- SvxScriptSelectorDialog* m_pSelectorDlg;
+ VclPtr<SvxScriptSelectorDialog> m_pSelectorDlg;
/// the ResourceURL to select when opening the dialog
OUString m_aURLToSelect;
@@ -410,7 +411,7 @@ protected:
SvTreeListEntry* pTarget = NULL,
bool bFront = false );
- void AddSubMenusToUI( const OUString& rBaseTitle,
+ void AddSubMenusToUI( const OUString& rBaseTitle,
SvxConfigEntry* pParentData );
SvTreeListEntry* InsertEntryIntoUI ( SvxConfigEntry* pNewEntryData,
@@ -423,6 +424,9 @@ protected:
public:
+ virtual ~SvxConfigPage();
+ virtual void dispose() SAL_OVERRIDE;
+
static bool CanConfig( const OUString& rModuleId );
SaveInData* GetSaveInData() { return pCurrentSaveInData; }
@@ -483,6 +487,7 @@ private:
public:
SvxMenuConfigPage( vcl::Window *pParent, const SfxItemSet& rItemSet );
virtual ~SvxMenuConfigPage();
+ virtual void dispose() SAL_OVERRIDE;
SaveInData* CreateSaveInData(
const ::com::sun::star::uno::Reference <
@@ -495,11 +500,11 @@ public:
class SvxMainMenuOrganizerDialog : public ModalDialog
{
- VclContainer* m_pMenuBox;
- Edit* m_pMenuNameEdit;
- SvTreeListBox* m_pMenuListBox;
- PushButton* m_pMoveUpButton;
- PushButton* m_pMoveDownButton;
+ VclPtr<VclContainer> m_pMenuBox;
+ VclPtr<Edit> m_pMenuNameEdit;
+ VclPtr<SvTreeListBox> m_pMenuListBox;
+ VclPtr<PushButton> m_pMoveUpButton;
+ VclPtr<PushButton> m_pMoveDownButton;
SvxEntries* mpEntries;
SvTreeListEntry* pNewMenuEntry;
@@ -515,8 +520,8 @@ public:
SvxMainMenuOrganizerDialog (
vcl::Window*, SvxEntries*,
SvxConfigEntry*, bool bCreateMenu = false );
-
- virtual ~SvxMainMenuOrganizerDialog ();
+ virtual ~SvxMainMenuOrganizerDialog();
+ virtual void dispose() SAL_OVERRIDE;
SvxEntries* GetEntries() { return mpEntries;}
void SetEntries( SvxEntries* );
@@ -528,7 +533,7 @@ class SvxToolbarEntriesListBox : public SvxMenuEntriesListBox
Size m_aCheckBoxImageSizePixel;
Link m_aChangedListener;
SvLBoxButtonData* m_pButtonData;
- SvxConfigPage* pPage;
+ VclPtr<SvxConfigPage> pPage;
void ChangeVisibility( SvTreeListEntry* pEntry );
@@ -544,6 +549,7 @@ public:
SvxToolbarEntriesListBox(vcl::Window* pParent, SvxToolbarConfigPage* pPg);
virtual ~SvxToolbarEntriesListBox();
+ virtual void dispose() SAL_OVERRIDE;
void SetChangedListener( const Link& aChangedListener )
{ m_aChangedListener = aChangedListener; }
@@ -584,6 +590,7 @@ private:
public:
SvxToolbarConfigPage( vcl::Window *pParent, const SfxItemSet& rItemSet );
virtual ~SvxToolbarConfigPage();
+ virtual void dispose() SAL_OVERRIDE;
SvTreeListEntry* AddFunction( SvTreeListEntry* pTarget = NULL,
bool bFront = false,
@@ -662,8 +669,8 @@ public:
class SvxNewToolbarDialog : public ModalDialog
{
private:
- Edit* m_pEdtName;
- OKButton* m_pBtnOK;
+ VclPtr<Edit> m_pEdtName;
+ VclPtr<OKButton> m_pBtnOK;
Link aCheckNameHdl;
@@ -671,8 +678,10 @@ private:
public:
SvxNewToolbarDialog(vcl::Window* pWindow, const OUString& rName);
+ virtual ~SvxNewToolbarDialog();
+ virtual void dispose() SAL_OVERRIDE;
- ListBox* m_pSaveInListBox;
+ VclPtr<ListBox> m_pSaveInListBox;
OUString GetName()
{
@@ -702,10 +711,10 @@ struct SvxIconSelectorToolBoxItem
class SvxIconSelectorDialog : public ModalDialog
{
private:
- ToolBox* pTbSymbol;
- FixedText* pFtNote;
- PushButton* pBtnImport;
- PushButton* pBtnDelete;
+ VclPtr<ToolBox> pTbSymbol;
+ VclPtr<FixedText> pFtNote;
+ VclPtr<PushButton> pBtnImport;
+ VclPtr<PushButton> pBtnDelete;
Size aTbSize;
sal_uInt16 m_nNextId;
@@ -741,6 +750,7 @@ public:
);
virtual ~SvxIconSelectorDialog();
+ virtual void dispose() SAL_OVERRIDE;
::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >
GetSelectedIcon();
@@ -769,10 +779,12 @@ public:
class SvxIconChangeDialog : public ModalDialog
{
private:
- FixedImage* pFImageInfo;
- VclMultiLineEdit* pLineEditDescription;
+ VclPtr<FixedImage> pFImageInfo;
+ VclPtr<VclMultiLineEdit> pLineEditDescription;
public:
SvxIconChangeDialog(vcl::Window *pWindow, const OUString& aMessage);
+ virtual ~SvxIconChangeDialog();
+ virtual void dispose() SAL_OVERRIDE;
};
#endif // INCLUDED_CUI_SOURCE_INC_CFG_HXX
diff --git a/cui/source/inc/cfgutil.hxx b/cui/source/inc/cfgutil.hxx
index 3e445ce0e853..984e8e9e4c80 100644
--- a/cui/source/inc/cfgutil.hxx
+++ b/cui/source/inc/cfgutil.hxx
@@ -113,6 +113,7 @@ class SfxConfigFunctionListBox : public SvTreeListBox
public:
SfxConfigFunctionListBox(vcl::Window*, WinBits nStyle);
virtual ~SfxConfigFunctionListBox();
+ virtual void dispose() SAL_OVERRIDE;
void ClearAll();
using Window::GetHelpText;
@@ -127,7 +128,7 @@ struct SvxConfigGroupBoxResource_Impl;
class SfxConfigGroupListBox : public SvTreeListBox
{
SvxConfigGroupBoxResource_Impl* pImp;
- SfxConfigFunctionListBox* pFunctionListBox;
+ VclPtr<SfxConfigFunctionListBox> pFunctionListBox;
SfxGroupInfoArr_Impl aArr;
OUString m_sModuleLongName;
@@ -162,6 +163,7 @@ protected:
public:
SfxConfigGroupListBox(vcl::Window* pParent, WinBits nStyle);
virtual ~SfxConfigGroupListBox();
+ virtual void dispose() SAL_OVERRIDE;
void ClearAll();
void Init(const css::uno::Reference< css::uno::XComponentContext >& xContext,
diff --git a/cui/source/inc/chardlg.hxx b/cui/source/inc/chardlg.hxx
index 9a471ff3e048..fad03f168fe4 100644
--- a/cui/source/inc/chardlg.hxx
+++ b/cui/source/inc/chardlg.hxx
@@ -47,14 +47,12 @@ class FontList;
class SvxCharBasePage : public SfxTabPage
{
protected:
- SvxFontPrevWindow* m_pPreviewWin;
+ VclPtr<SvxFontPrevWindow> m_pPreviewWin;
bool m_bPreviewBackgroundToCharacter;
SvxCharBasePage(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription, const SfxItemSet& rItemset);
- virtual ~SvxCharBasePage();
-
void SetPrevFontWidthScale( const SfxItemSet& rSet );
void SetPrevFontEscapement( sal_uInt8 nProp, sal_uInt8 nEscProp, short nEsc );
@@ -63,6 +61,9 @@ protected:
inline SvxFont& GetPreviewCTLFont();
public:
+ virtual ~SvxCharBasePage();
+ virtual void dispose() SAL_OVERRIDE;
+
using SfxTabPage::ActivatePage;
using SfxTabPage::DeactivatePage;
@@ -79,38 +80,38 @@ class SvxCharNamePage : public SvxCharBasePage
private:
static const sal_uInt16 pNameRanges[];
- VclContainer* m_pWestFrame;
- FixedText* m_pWestFontNameFT;
- FontNameBox* m_pWestFontNameLB;
- FixedText* m_pWestFontStyleFT;
- FontStyleBox* m_pWestFontStyleLB;
- FixedText* m_pWestFontSizeFT;
- FontSizeBox* m_pWestFontSizeLB;
- FixedText* m_pWestFontLanguageFT;
- SvxLanguageComboBox* m_pWestFontLanguageLB;
- FixedText* m_pWestFontTypeFT;
-
- VclContainer* m_pEastFrame;
- FixedText* m_pEastFontNameFT;
- FontNameBox* m_pEastFontNameLB;
- FixedText* m_pEastFontStyleFT;
- FontStyleBox* m_pEastFontStyleLB;
- FixedText* m_pEastFontSizeFT;
- FontSizeBox* m_pEastFontSizeLB;
- FixedText* m_pEastFontLanguageFT;
- SvxLanguageBox* m_pEastFontLanguageLB;
- FixedText* m_pEastFontTypeFT;
-
- VclContainer* m_pCTLFrame;
- FixedText* m_pCTLFontNameFT;
- FontNameBox* m_pCTLFontNameLB;
- FixedText* m_pCTLFontStyleFT;
- FontStyleBox* m_pCTLFontStyleLB;
- FixedText* m_pCTLFontSizeFT;
- FontSizeBox* m_pCTLFontSizeLB;
- FixedText* m_pCTLFontLanguageFT;
- SvxLanguageBox* m_pCTLFontLanguageLB;
- FixedText* m_pCTLFontTypeFT;
+ VclPtr<VclContainer> m_pWestFrame;
+ VclPtr<FixedText> m_pWestFontNameFT;
+ VclPtr<FontNameBox> m_pWestFontNameLB;
+ VclPtr<FixedText> m_pWestFontStyleFT;
+ VclPtr<FontStyleBox> m_pWestFontStyleLB;
+ VclPtr<FixedText> m_pWestFontSizeFT;
+ VclPtr<FontSizeBox> m_pWestFontSizeLB;
+ VclPtr<FixedText> m_pWestFontLanguageFT;
+ VclPtr<SvxLanguageComboBox> m_pWestFontLanguageLB;
+ VclPtr<FixedText> m_pWestFontTypeFT;
+
+ VclPtr<VclContainer> m_pEastFrame;
+ VclPtr<FixedText> m_pEastFontNameFT;
+ VclPtr<FontNameBox> m_pEastFontNameLB;
+ VclPtr<FixedText> m_pEastFontStyleFT;
+ VclPtr<FontStyleBox> m_pEastFontStyleLB;
+ VclPtr<FixedText> m_pEastFontSizeFT;
+ VclPtr<FontSizeBox> m_pEastFontSizeLB;
+ VclPtr<FixedText> m_pEastFontLanguageFT;
+ VclPtr<SvxLanguageBox> m_pEastFontLanguageLB;
+ VclPtr<FixedText> m_pEastFontTypeFT;
+
+ VclPtr<VclContainer> m_pCTLFrame;
+ VclPtr<FixedText> m_pCTLFontNameFT;
+ VclPtr<FontNameBox> m_pCTLFontNameLB;
+ VclPtr<FixedText> m_pCTLFontStyleFT;
+ VclPtr<FontStyleBox> m_pCTLFontStyleLB;
+ VclPtr<FixedText> m_pCTLFontSizeFT;
+ VclPtr<FontSizeBox> m_pCTLFontSizeLB;
+ VclPtr<FixedText> m_pCTLFontLanguageFT;
+ VclPtr<SvxLanguageBox> m_pCTLFontLanguageLB;
+ VclPtr<FixedText> m_pCTLFontTypeFT;
SvxCharNamePage_Impl* m_pImpl;
@@ -152,8 +153,9 @@ public:
public:
virtual ~SvxCharNamePage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
static const sal_uInt16* GetRanges() { return pNameRanges; }
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -176,44 +178,43 @@ class SvxCharEffectsPage : public SvxCharBasePage
private:
static const sal_uInt16 pEffectsRanges[];
- FixedText* m_pFontColorFT;
- ColorListBox* m_pFontColorLB;
+ VclPtr<FixedText> m_pFontColorFT;
+ VclPtr<ColorListBox> m_pFontColorLB;
- FixedText* m_pEffectsFT;
- ListBox* m_pEffectsLB;
+ VclPtr<FixedText> m_pEffectsFT;
+ VclPtr<ListBox> m_pEffectsLB;
- FixedText* m_pReliefFT;
- ListBox* m_pReliefLB;
+ VclPtr<FixedText> m_pReliefFT;
+ VclPtr<ListBox> m_pReliefLB;
- TriStateBox* m_pOutlineBtn;
- TriStateBox* m_pShadowBtn;
- TriStateBox* m_pBlinkingBtn;
- TriStateBox* m_pHiddenBtn;
+ VclPtr<TriStateBox> m_pOutlineBtn;
+ VclPtr<TriStateBox> m_pShadowBtn;
+ VclPtr<TriStateBox> m_pBlinkingBtn;
+ VclPtr<TriStateBox> m_pHiddenBtn;
- ListBox* m_pOverlineLB;
- FixedText* m_pOverlineColorFT;
- ColorListBox* m_pOverlineColorLB;
+ VclPtr<ListBox> m_pOverlineLB;
+ VclPtr<FixedText> m_pOverlineColorFT;
+ VclPtr<ColorListBox> m_pOverlineColorLB;
- ListBox* m_pStrikeoutLB;
+ VclPtr<ListBox> m_pStrikeoutLB;
- ListBox* m_pUnderlineLB;
- FixedText* m_pUnderlineColorFT;
- ColorListBox* m_pUnderlineColorLB;
+ VclPtr<ListBox> m_pUnderlineLB;
+ VclPtr<FixedText> m_pUnderlineColorFT;
+ VclPtr<ColorListBox> m_pUnderlineColorLB;
- CheckBox* m_pIndividualWordsBtn;
+ VclPtr<CheckBox> m_pIndividualWordsBtn;
- FixedText* m_pEmphasisFT;
- ListBox* m_pEmphasisLB;
+ VclPtr<FixedText> m_pEmphasisFT;
+ VclPtr<ListBox> m_pEmphasisLB;
- FixedText* m_pPositionFT;
- ListBox* m_pPositionLB;
+ VclPtr<FixedText> m_pPositionFT;
+ VclPtr<ListBox> m_pPositionLB;
sal_uInt16 m_nHtmlMode;
OUString m_aTransparentColorName;
SvxCharEffectsPage( vcl::Window* pParent, const SfxItemSet& rSet );
- virtual ~SvxCharEffectsPage();
void Initialize();
void UpdatePreview_Impl();
@@ -228,12 +229,14 @@ private:
DECL_LINK( ColorBoxSelectHdl_Impl, ColorListBox* );
public:
- using SfxTabPage::DeactivatePage;
+ virtual ~SvxCharEffectsPage();
+ virtual void dispose() SAL_OVERRIDE;
+ using SfxTabPage::DeactivatePage;
virtual sfxpg DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE;
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
static const sal_uInt16* GetRanges() { return pEffectsRanges; }
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -254,30 +257,30 @@ class SvxCharPositionPage : public SvxCharBasePage
static const sal_uInt16 pPositionRanges[];
private:
- RadioButton* m_pHighPosBtn;
- RadioButton* m_pNormalPosBtn;
- RadioButton* m_pLowPosBtn;
- FixedText* m_pHighLowFT;
- MetricField* m_pHighLowMF;
- CheckBox* m_pHighLowRB;
- FixedText* m_pFontSizeFT;
- MetricField* m_pFontSizeMF;
-
- VclContainer* m_pRotationContainer;
-
- FixedText* m_pScalingFT;
- FixedText* m_pScalingAndRotationFT;
- RadioButton* m_p0degRB;
- RadioButton* m_p90degRB;
- RadioButton* m_p270degRB;
- CheckBox* m_pFitToLineCB;
-
- MetricField* m_pScaleWidthMF;
-
- ListBox* m_pKerningLB;
- FixedText* m_pKerningFT;
- MetricField* m_pKerningMF;
- CheckBox* m_pPairKerningBtn;
+ VclPtr<RadioButton> m_pHighPosBtn;
+ VclPtr<RadioButton> m_pNormalPosBtn;
+ VclPtr<RadioButton> m_pLowPosBtn;
+ VclPtr<FixedText> m_pHighLowFT;
+ VclPtr<MetricField> m_pHighLowMF;
+ VclPtr<CheckBox> m_pHighLowRB;
+ VclPtr<FixedText> m_pFontSizeFT;
+ VclPtr<MetricField> m_pFontSizeMF;
+
+ VclPtr<VclContainer> m_pRotationContainer;
+
+ VclPtr<FixedText> m_pScalingFT;
+ VclPtr<FixedText> m_pScalingAndRotationFT;
+ VclPtr<RadioButton> m_p0degRB;
+ VclPtr<RadioButton> m_p90degRB;
+ VclPtr<RadioButton> m_p270degRB;
+ VclPtr<CheckBox> m_pFitToLineCB;
+
+ VclPtr<MetricField> m_pScaleWidthMF;
+
+ VclPtr<ListBox> m_pKerningLB;
+ VclPtr<FixedText> m_pKerningFT;
+ VclPtr<MetricField> m_pKerningMF;
+ VclPtr<CheckBox> m_pPairKerningBtn;
short m_nSuperEsc;
short m_nSubEsc;
@@ -289,7 +292,6 @@ private:
sal_uInt8 m_nSubProp;
SvxCharPositionPage( vcl::Window* pParent, const SfxItemSet& rSet );
- virtual ~SvxCharPositionPage();
void Initialize();
void UpdatePreview_Impl( sal_uInt8 nProp, sal_uInt8 nEscProp, short nEsc );
@@ -307,6 +309,9 @@ private:
DECL_LINK(ScaleWidthModifyHdl_Impl, void *);
public:
+ virtual ~SvxCharPositionPage();
+ virtual void dispose() SAL_OVERRIDE;
+
using SfxTabPage::ActivatePage;
using SfxTabPage::DeactivatePage;
@@ -314,7 +319,7 @@ public:
virtual void ActivatePage( const SfxItemSet& rSet ) SAL_OVERRIDE;
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
static const sal_uInt16* GetRanges() { return pPositionRanges; }
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -331,16 +336,15 @@ class SvxCharTwoLinesPage : public SvxCharBasePage
{
private:
static const sal_uInt16 pTwoLinesRanges[];
- CheckBox* m_pTwoLinesBtn;
- VclContainer* m_pEnclosingFrame;
- ListBox* m_pStartBracketLB;
- ListBox* m_pEndBracketLB;
+ VclPtr<CheckBox> m_pTwoLinesBtn;
+ VclPtr<VclContainer> m_pEnclosingFrame;
+ VclPtr<ListBox> m_pStartBracketLB;
+ VclPtr<ListBox> m_pEndBracketLB;
sal_uInt16 m_nStartBracketPosition;
sal_uInt16 m_nEndBracketPosition;
SvxCharTwoLinesPage(vcl::Window* pParent, const SfxItemSet& rSet);
- virtual ~SvxCharTwoLinesPage();
void UpdatePreview_Impl();
void Initialize();
@@ -351,14 +355,16 @@ private:
DECL_LINK( CharacterMapHdl_Impl, ListBox* );
public:
+ virtual ~SvxCharTwoLinesPage();
+ virtual void dispose() SAL_OVERRIDE;
+
using SfxTabPage::ActivatePage;
using SfxTabPage::DeactivatePage;
virtual void ActivatePage( const SfxItemSet& rSet ) SAL_OVERRIDE;
virtual sfxpg DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE;
-public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
static const sal_uInt16* GetRanges() { return pTwoLinesRanges; }
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
diff --git a/cui/source/inc/connect.hxx b/cui/source/inc/connect.hxx
index a85dabdb8a5f..875ff89baf9b 100644
--- a/cui/source/inc/connect.hxx
+++ b/cui/source/inc/connect.hxx
@@ -34,21 +34,21 @@ class SvxConnectionPage : public SfxTabPage
{
private:
static const sal_uInt16 pRanges[];
- ListBox* m_pLbType;
+ VclPtr<ListBox> m_pLbType;
- FixedText* m_pFtLine1;
- MetricField* m_pMtrFldLine1;
- FixedText* m_pFtLine2;
- MetricField* m_pMtrFldLine2;
- FixedText* m_pFtLine3;
- MetricField* m_pMtrFldLine3;
+ VclPtr<FixedText> m_pFtLine1;
+ VclPtr<MetricField> m_pMtrFldLine1;
+ VclPtr<FixedText> m_pFtLine2;
+ VclPtr<MetricField> m_pMtrFldLine2;
+ VclPtr<FixedText> m_pFtLine3;
+ VclPtr<MetricField> m_pMtrFldLine3;
- MetricField* m_pMtrFldHorz1;
- MetricField* m_pMtrFldVert1;
- MetricField* m_pMtrFldHorz2;
- MetricField* m_pMtrFldVert2;
+ VclPtr<MetricField> m_pMtrFldHorz1;
+ VclPtr<MetricField> m_pMtrFldVert1;
+ VclPtr<MetricField> m_pMtrFldHorz2;
+ VclPtr<MetricField> m_pMtrFldVert2;
- SvxXConnectionPreview* m_pCtlPreview;
+ VclPtr<SvxXConnectionPreview> m_pCtlPreview;
const SfxItemSet& rOutAttrs;
SfxItemSet aAttrSet;
@@ -63,8 +63,9 @@ public:
SvxConnectionPage( vcl::Window* pWindow, const SfxItemSet& rInAttrs );
virtual ~SvxConnectionPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
static const sal_uInt16* GetRanges() { return pRanges; }
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
@@ -82,7 +83,6 @@ class SvxConnectionDialog : public SfxSingleTabDialog
public:
SvxConnectionDialog( vcl::Window* pParent, const SfxItemSet& rAttr,
const SdrView* pView );
- virtual ~SvxConnectionDialog();
};
#endif // INCLUDED_CUI_SOURCE_INC_CONNECT_HXX
diff --git a/cui/source/inc/cuicharmap.hxx b/cui/source/inc/cuicharmap.hxx
index a2e30e516502..596d3231443e 100644
--- a/cui/source/inc/cuicharmap.hxx
+++ b/cui/source/inc/cuicharmap.hxx
@@ -41,7 +41,6 @@ class SvxShowText : public Control
public:
SvxShowText( vcl::Window* pParent,
bool bCenter = false );
- virtual ~SvxShowText();
void SetFont( const vcl::Font& rFont );
void SetText( const OUString& rText ) SAL_OVERRIDE;
@@ -68,16 +67,16 @@ private:
void init();
- SvxShowCharSet* m_pShowSet;
- Edit* m_pShowText;
- PushButton* m_pOKBtn;
- FixedText* m_pFontText;
- ListBox* m_pFontLB;
- FixedText* m_pSubsetText;
- ListBox* m_pSubsetLB;
- FixedText* m_pSymbolText;
- SvxShowText* m_pShowChar;
- FixedText* m_pCharCodeText;
+ VclPtr<SvxShowCharSet> m_pShowSet;
+ VclPtr<Edit> m_pShowText;
+ VclPtr<PushButton> m_pOKBtn;
+ VclPtr<FixedText> m_pFontText;
+ VclPtr<ListBox> m_pFontLB;
+ VclPtr<FixedText> m_pSubsetText;
+ VclPtr<ListBox> m_pSubsetLB;
+ VclPtr<FixedText> m_pSymbolText;
+ VclPtr<SvxShowText> m_pShowChar;
+ VclPtr<FixedText> m_pCharCodeText;
vcl::Font aFont;
bool bOne;
const SubsetMap* pSubsetMap;
@@ -94,7 +93,8 @@ private:
public:
SvxCharacterMap( vcl::Window* pParent, bool bOne=true, const SfxItemSet* pSet=0 );
- virtual ~SvxCharacterMap();
+ virtual ~SvxCharacterMap();
+ virtual void dispose() SAL_OVERRIDE;
void DisableFontSelection();
diff --git a/cui/source/inc/cuifmsearch.hxx b/cui/source/inc/cuifmsearch.hxx
index d163b3d44b6f..d56c9d5ee2a4 100644
--- a/cui/source/inc/cuifmsearch.hxx
+++ b/cui/source/inc/cuifmsearch.hxx
@@ -47,36 +47,36 @@ class FmSearchDialog : public ModalDialog
friend class FmSearchEngine;
// my all Controls
- RadioButton *m_prbSearchForText;
- RadioButton *m_prbSearchForNull;
- RadioButton *m_prbSearchForNotNull;
- ComboBox *m_pcmbSearchText;
- FixedText *m_pftForm;
- ListBox *m_plbForm;
- RadioButton *m_prbAllFields;
- RadioButton *m_prbSingleField;
- ListBox *m_plbField;
- FixedText *m_pftPosition;
- ListBox *m_plbPosition;
- CheckBox *m_pcbUseFormat;
- CheckBox *m_pcbCase;
- CheckBox *m_pcbBackwards;
- CheckBox *m_pcbStartOver;
- CheckBox *m_pcbWildCard;
- CheckBox *m_pcbRegular;
- CheckBox *m_pcbApprox;
- PushButton *m_ppbApproxSettings;
- CheckBox *m_pHalfFullFormsCJK;
- CheckBox *m_pSoundsLikeCJK;
- PushButton *m_pSoundsLikeCJKSettings;
- FixedText *m_pftRecord;
- FixedText *m_pftHint;
- PushButton *m_pbSearchAgain;
- CancelButton *m_pbClose;
+ VclPtr<RadioButton> m_prbSearchForText;
+ VclPtr<RadioButton> m_prbSearchForNull;
+ VclPtr<RadioButton> m_prbSearchForNotNull;
+ VclPtr<ComboBox> m_pcmbSearchText;
+ VclPtr<FixedText> m_pftForm;
+ VclPtr<ListBox> m_plbForm;
+ VclPtr<RadioButton> m_prbAllFields;
+ VclPtr<RadioButton> m_prbSingleField;
+ VclPtr<ListBox> m_plbField;
+ VclPtr<FixedText> m_pftPosition;
+ VclPtr<ListBox> m_plbPosition;
+ VclPtr<CheckBox> m_pcbUseFormat;
+ VclPtr<CheckBox> m_pcbCase;
+ VclPtr<CheckBox> m_pcbBackwards;
+ VclPtr<CheckBox> m_pcbStartOver;
+ VclPtr<CheckBox> m_pcbWildCard;
+ VclPtr<CheckBox> m_pcbRegular;
+ VclPtr<CheckBox> m_pcbApprox;
+ VclPtr<PushButton> m_ppbApproxSettings;
+ VclPtr<CheckBox> m_pHalfFullFormsCJK;
+ VclPtr<CheckBox> m_pSoundsLikeCJK;
+ VclPtr<PushButton> m_pSoundsLikeCJKSettings;
+ VclPtr<FixedText> m_pftRecord;
+ VclPtr<FixedText> m_pftHint;
+ VclPtr<PushButton> m_pbSearchAgain;
+ VclPtr<CancelButton> m_pbClose;
OUString m_sSearch;
OUString m_sCancel;
- vcl::Window* m_pPreSearchFocus;
+ VclPtr<vcl::Window> m_pPreSearchFocus;
Link m_lnkFoundHandler; ///< Handler for "found"
Link m_lnkCanceledNotFoundHdl; ///< Handler for Positioning the Cursors
@@ -111,6 +111,7 @@ public:
const Link& lnkContextSupplier);
virtual ~FmSearchDialog();
+ virtual void dispose() SAL_OVERRIDE;
/** The found-handler gets in the 'found'-case a pointer on a FmFoundRecordInformation-structure
(which is only valid in the handler; so if one needs to memorize the data, don't copy the pointer but
diff --git a/cui/source/inc/cuigaldlg.hxx b/cui/source/inc/cuigaldlg.hxx
index a57904afd53a..a1855b1a1fdd 100644
--- a/cui/source/inc/cuigaldlg.hxx
+++ b/cui/source/inc/cuigaldlg.hxx
@@ -60,8 +60,8 @@ class SearchThread: public salhelper::Thread
{
private:
- SearchProgress* mpProgress;
- TPGalleryThemeProperties* mpBrowser;
+ VclPtr<SearchProgress> mpProgress;
+ VclPtr<TPGalleryThemeProperties> mpBrowser;
INetURLObject maStartURL;
void ImplSearch( const INetURLObject& rStartURL,
@@ -81,10 +81,10 @@ public:
class SearchProgress : public ModalDialog
{
private:
- FixedText* m_pFtSearchDir;
- FixedText* m_pFtSearchType;
- CancelButton* m_pBtnCancel;
- vcl::Window * parent_;
+ VclPtr<FixedText> m_pFtSearchDir;
+ VclPtr<FixedText> m_pFtSearchType;
+ VclPtr<CancelButton> m_pBtnCancel;
+ VclPtr<vcl::Window> parent_;
INetURLObject startUrl_;
rtl::Reference< SearchThread > maSearchThread;
@@ -93,7 +93,8 @@ private:
public:
SearchProgress( vcl::Window* pParent, const INetURLObject& rStartURL );
- virtual ~SearchProgress() {};
+ virtual ~SearchProgress();
+ virtual void dispose() SAL_OVERRIDE;
DECL_LINK( CleanUpHdl, void* );
@@ -107,8 +108,8 @@ class TakeThread: public salhelper::Thread
{
private:
- TakeProgress* mpProgress;
- TPGalleryThemeProperties* mpBrowser;
+ VclPtr<TakeProgress> mpProgress;
+ VclPtr<TPGalleryThemeProperties> mpBrowser;
TokenList_impl& mrTakenList;
virtual ~TakeThread();
@@ -126,9 +127,9 @@ public:
class TakeProgress : public ModalDialog
{
private:
- FixedText* m_pFtTakeFile;
- CancelButton* m_pBtnCancel;
- vcl::Window * window_;
+ VclPtr<FixedText> m_pFtTakeFile;
+ VclPtr<CancelButton> m_pBtnCancel;
+ VclPtr<vcl::Window> window_;
rtl::Reference< TakeThread > maTakeThread;
TokenList_impl maTakenList;
@@ -138,6 +139,8 @@ private:
public:
TakeProgress( vcl::Window* pWindow );
+ virtual ~TakeProgress();
+ virtual void dispose() SAL_OVERRIDE;
DECL_LINK( CleanUpHdl, void* );
@@ -149,8 +152,8 @@ public:
class ActualizeProgress : public ModalDialog
{
private:
- FixedText* m_pFtActualizeFile;
- CancelButton* m_pBtnCancel;
+ VclPtr<FixedText> m_pFtActualizeFile;
+ VclPtr<CancelButton> m_pBtnCancel;
Idle* pIdle;
GalleryTheme* pTheme;
GalleryProgress aStatusProgress;
@@ -161,7 +164,8 @@ private:
public:
ActualizeProgress( vcl::Window* pWindow, GalleryTheme* pThm );
- virtual ~ActualizeProgress() {};
+ virtual ~ActualizeProgress();
+ virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
};
@@ -169,23 +173,27 @@ public:
class TitleDialog : public ModalDialog
{
private:
- Edit* m_pEdit;
+ VclPtr<Edit> m_pEdit;
public:
TitleDialog(vcl::Window* pParent, const OUString& rOldText);
+ virtual ~TitleDialog();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetTitle() const { return m_pEdit->GetText(); }
};
class GalleryIdDialog : public ModalDialog
{
private:
- OKButton* m_pBtnOk;
- ListBox* m_pLbResName;
+ VclPtr<OKButton> m_pBtnOk;
+ VclPtr<ListBox> m_pLbResName;
GalleryTheme* pThm;
DECL_LINK( ClickOkHdl, void* );
DECL_LINK( ClickResNameHdl, void* );
public:
GalleryIdDialog( vcl::Window* pParent, GalleryTheme* pThm );
+ virtual ~GalleryIdDialog();
+ virtual void dispose() SAL_OVERRIDE;
sal_uLong GetId() const { return m_pLbResName->GetSelectEntryPos(); }
};
@@ -206,12 +214,12 @@ class TPGalleryThemeGeneral : public SfxTabPage
{
private:
- FixedImage* m_pFiMSImage;
- Edit* m_pEdtMSName;
- FixedText* m_pFtMSShowType;
- FixedText* m_pFtMSShowPath;
- FixedText* m_pFtMSShowContent;
- FixedText* m_pFtMSShowChangeDate;
+ VclPtr<FixedImage> m_pFiMSImage;
+ VclPtr<Edit> m_pEdtMSName;
+ VclPtr<FixedText> m_pFtMSShowType;
+ VclPtr<FixedText> m_pFtMSShowPath;
+ VclPtr<FixedText> m_pFtMSShowContent;
+ VclPtr<FixedText> m_pFtMSShowChangeDate;
ExchangeData* pData;
virtual void Reset( const SfxItemSet* ) SAL_OVERRIDE {}
@@ -221,12 +229,13 @@ private:
public:
TPGalleryThemeGeneral( vcl::Window* pParent, const SfxItemSet& rSet );
- virtual ~TPGalleryThemeGeneral() {}
+ virtual ~TPGalleryThemeGeneral();
+ virtual void dispose() SAL_OVERRIDE;
void SetXChgData( ExchangeData* pData );
const ExchangeData* GetXChgData() const { return pData; }
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
};
typedef ::std::vector< FilterEntry* > FilterEntryList_impl;
@@ -237,13 +246,13 @@ class TPGalleryThemeProperties : public SfxTabPage
friend class TakeProgress;
friend class TakeThread;
- ComboBox* m_pCbbFileType;
- ListBox* m_pLbxFound;
- PushButton* m_pBtnSearch;
- PushButton* m_pBtnTake;
- PushButton* m_pBtnTakeAll;
- CheckBox* m_pCbxPreview;
- GalleryPreview* m_pWndPreview;
+ VclPtr<ComboBox> m_pCbbFileType;
+ VclPtr<ListBox> m_pLbxFound;
+ VclPtr<PushButton> m_pBtnSearch;
+ VclPtr<PushButton> m_pBtnTake;
+ VclPtr<PushButton> m_pBtnTakeAll;
+ VclPtr<CheckBox> m_pCbxPreview;
+ VclPtr<GalleryPreview> m_pWndPreview;
ExchangeData* pData;
StringList aFoundList;
@@ -287,13 +296,14 @@ class TPGalleryThemeProperties : public SfxTabPage
public:
TPGalleryThemeProperties( vcl::Window* pWindow, const SfxItemSet& rSet );
virtual ~TPGalleryThemeProperties();
+ virtual void dispose() SAL_OVERRIDE;
void SetXChgData( ExchangeData* pData );
const ExchangeData* GetXChgData() const { return pData; }
void StartSearchFiles( const OUString& _rFolderURL, short _nDlgResult );
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
};
#endif // INCLUDED_CUI_SOURCE_INC_CUIGALDLG_HXX
diff --git a/cui/source/inc/cuigrfflt.hxx b/cui/source/inc/cuigrfflt.hxx
index 1fb139375fd7..f43685d65fd2 100644
--- a/cui/source/inc/cuigrfflt.hxx
+++ b/cui/source/inc/cuigrfflt.hxx
@@ -77,7 +77,7 @@ private:
DECL_LINK( ImplModifyHdl, void* p );
protected:
- GraphicPreviewWindow* mpPreview;
+ VclPtr<GraphicPreviewWindow> mpPreview;
const Link& GetModifyHdl() const { return maModifyHdl; }
const Size& GetGraphicSizePixel() const { return maSizePixel; }
@@ -85,6 +85,8 @@ protected:
public:
GraphicFilterDialog(vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription, const Graphic& rGraphic);
+ virtual ~GraphicFilterDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) = 0;
};
@@ -97,11 +99,13 @@ public:
class GraphicFilterSmooth : public GraphicFilterDialog
{
private:
- NumericField* mpMtrRadius;
+ VclPtr<NumericField> mpMtrRadius;
public:
GraphicFilterSmooth( vcl::Window* pParent, const Graphic& rGraphic, double nRadius);
+ virtual ~GraphicFilterSmooth();
+ virtual void dispose() SAL_OVERRIDE;
virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) SAL_OVERRIDE;
double GetRadius() const { return mpMtrRadius->GetValue() / 10.0; }
@@ -114,14 +118,16 @@ public:
class GraphicFilterMosaic : public GraphicFilterDialog
{
private:
- MetricField* mpMtrWidth;
- MetricField* mpMtrHeight;
- CheckBox* mpCbxEdges;
+ VclPtr<MetricField> mpMtrWidth;
+ VclPtr<MetricField> mpMtrHeight;
+ VclPtr<CheckBox> mpCbxEdges;
public:
GraphicFilterMosaic(vcl::Window* pParent, const Graphic& rGraphic,
sal_uInt16 nTileWidth, sal_uInt16 nTileHeight, bool bEnhanceEdges);
+ virtual ~GraphicFilterMosaic();
+ virtual void dispose() SAL_OVERRIDE;
virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) SAL_OVERRIDE;
long GetTileWidth() const { return static_cast<long>(mpMtrWidth->GetValue()); }
@@ -136,13 +142,15 @@ public:
class GraphicFilterSolarize : public GraphicFilterDialog
{
private:
- MetricField* mpMtrThreshold;
- CheckBox* mpCbxInvert;
+ VclPtr<MetricField> mpMtrThreshold;
+ VclPtr<CheckBox> mpCbxInvert;
public:
GraphicFilterSolarize( vcl::Window* pParent, const Graphic& rGraphic,
sal_uInt8 nGreyThreshold, bool bInvert );
+ virtual ~GraphicFilterSolarize();
+ virtual void dispose() SAL_OVERRIDE;
virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) SAL_OVERRIDE;
sal_uInt8 GetGreyThreshold() const { return( (sal_uInt8) FRound( mpMtrThreshold->GetValue() * 2.55 ) ); }
@@ -156,10 +164,12 @@ public:
class GraphicFilterSepia : public GraphicFilterDialog
{
private:
- MetricField* mpMtrSepia;
+ VclPtr<MetricField> mpMtrSepia;
public:
GraphicFilterSepia( vcl::Window* pParent, const Graphic& rGraphic,
sal_uInt16 nSepiaPercent );
+ virtual ~GraphicFilterSepia();
+ virtual void dispose() SAL_OVERRIDE;
virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) SAL_OVERRIDE;
sal_uInt16 GetSepiaPercent() const
{
@@ -174,10 +184,12 @@ public:
class GraphicFilterPoster : public GraphicFilterDialog
{
private:
- NumericField* mpNumPoster;
+ VclPtr<NumericField> mpNumPoster;
public:
GraphicFilterPoster( vcl::Window* pParent, const Graphic& rGraphic,
sal_uInt16 nPosterColorCount );
+ virtual ~GraphicFilterPoster();
+ virtual void dispose() SAL_OVERRIDE;
virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) SAL_OVERRIDE;
sal_uInt16 GetPosterColorCount() const { return( (sal_uInt16) mpNumPoster->GetValue() ); }
@@ -203,10 +215,12 @@ public:
class GraphicFilterEmboss : public GraphicFilterDialog
{
private:
- EmbossControl* mpCtlLight;
+ VclPtr<EmbossControl> mpCtlLight;
public:
GraphicFilterEmboss( vcl::Window* pParent, const Graphic& rGraphic,
RECT_POINT eLightSource );
+ virtual ~GraphicFilterEmboss();
+ virtual void dispose() SAL_OVERRIDE;
virtual Graphic GetFilteredGraphic( const Graphic& rGraphic, double fScaleX, double fScaleY ) SAL_OVERRIDE;
RECT_POINT GetLightSource() const { return mpCtlLight->GetActualRP(); }
diff --git a/cui/source/inc/cuihyperdlg.hxx b/cui/source/inc/cuihyperdlg.hxx
index 8ef2930ae952..b85633738ddf 100644
--- a/cui/source/inc/cuihyperdlg.hxx
+++ b/cui/source/inc/cuihyperdlg.hxx
@@ -38,7 +38,7 @@ class SvxHpLinkDlg;
class SvxHlinkCtrl : public SfxControllerItem
{
private :
- SvxHpLinkDlg *pParent;
+ VclPtr<SvxHpLinkDlg> pParent;
SfxStatusForwarder aRdOnlyForwarder;
@@ -80,6 +80,7 @@ protected:
public:
SvxHpLinkDlg (vcl::Window* pParent, SfxBindings* pBindings );
virtual ~SvxHpLinkDlg ();
+ virtual void dispose() SAL_OVERRIDE;
virtual void PageCreated( sal_uInt16 nId, IconChoicePage& rPage ) SAL_OVERRIDE;
diff --git a/cui/source/inc/cuiimapwnd.hxx b/cui/source/inc/cuiimapwnd.hxx
index 3266a2a3449c..87c7e546cc6a 100644
--- a/cui/source/inc/cuiimapwnd.hxx
+++ b/cui/source/inc/cuiimapwnd.hxx
@@ -33,11 +33,11 @@
class URLDlg : public ModalDialog
{
- Edit* m_pEdtURL;
- ComboBox* m_pCbbTargets;
- Edit* m_pEdtName;
- Edit* m_pEdtAlternativeText;
- VclMultiLineEdit* m_pEdtDescription;
+ VclPtr<Edit> m_pEdtURL;
+ VclPtr<ComboBox> m_pCbbTargets;
+ VclPtr<Edit> m_pEdtName;
+ VclPtr<Edit> m_pEdtAlternativeText;
+ VclPtr<VclMultiLineEdit> m_pEdtDescription;
public:
@@ -45,6 +45,8 @@ public:
const OUString& rURL, const OUString& rAlternativeText, const OUString& rDescription,
const OUString& rTarget, const OUString& rName,
TargetList& rTargetList );
+ virtual ~URLDlg();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetURL() const { return m_pEdtURL->GetText(); }
OUString GetAltText() const { return m_pEdtAlternativeText->GetText(); }
diff --git a/cui/source/inc/cuioptgenrl.hxx b/cui/source/inc/cuioptgenrl.hxx
index e6906f1c3244..8e911729fe5f 100644
--- a/cui/source/inc/cuioptgenrl.hxx
+++ b/cui/source/inc/cuioptgenrl.hxx
@@ -40,7 +40,7 @@ class SvxGeneralTabPage : public SfxTabPage
using TabPage::DeactivatePage;
private:
// the "Use data for document properties" checkbox
- CheckBox* m_pUseDataCB;
+ VclPtr<CheckBox> m_pUseDataCB;
// rows
struct Row;
std::vector<boost::shared_ptr<Row> > vRows;
@@ -64,9 +64,10 @@ protected:
public:
SvxGeneralTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
- virtual ~SvxGeneralTabPage ();
+ virtual ~SvxGeneralTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
diff --git a/cui/source/inc/cuisrchdlg.hxx b/cui/source/inc/cuisrchdlg.hxx
index 3dc19f0a1c97..be75242a8238 100644
--- a/cui/source/inc/cuisrchdlg.hxx
+++ b/cui/source/inc/cuisrchdlg.hxx
@@ -36,8 +36,8 @@ class SvxJSearchOptionsPage;
class SvxJSearchOptionsDialog : public SfxSingleTabDialog
{
- sal_Int32 nInitialTlFlags;
- SvxJSearchOptionsPage *pPage;
+ sal_Int32 nInitialTlFlags;
+ VclPtr<SvxJSearchOptionsPage> pPage;
SvxJSearchOptionsDialog( const SvxJSearchOptionsDialog & ) SAL_DELETED_FUNCTION;
SvxJSearchOptionsDialog & operator == ( const SvxJSearchOptionsDialog & ) SAL_DELETED_FUNCTION;
@@ -45,6 +45,8 @@ class SvxJSearchOptionsDialog : public SfxSingleTabDialog
public:
SvxJSearchOptionsDialog(vcl::Window *pParent,
const SfxItemSet& rOptionsSet, sal_Int32 nInitialFlags);
+ virtual ~SvxJSearchOptionsDialog();
+ virtual void dispose() SAL_OVERRIDE;
// Window
virtual void Activate() SAL_OVERRIDE;
diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index 3fe91da9f651..baa67bc85d4c 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -76,7 +76,6 @@ protected:
public:
SvxAreaTabDialog( vcl::Window* pParent, const SfxItemSet* pAttr, SdrModel* pModel, bool bShadow );
- virtual ~SvxAreaTabDialog();
void SetNewColorList( XColorListRef pColTab )
{ mpNewColorList = pColTab; }
@@ -116,29 +115,29 @@ class SvxTransparenceTabPage : public SvxTabPage
sal_uInt16 nDlgType;
// main selection
- RadioButton* m_pRbtTransOff;
- RadioButton* m_pRbtTransLinear;
- RadioButton* m_pRbtTransGradient;
+ VclPtr<RadioButton> m_pRbtTransOff;
+ VclPtr<RadioButton> m_pRbtTransLinear;
+ VclPtr<RadioButton> m_pRbtTransGradient;
/// linear transparency
- MetricField* m_pMtrTransparent;
+ VclPtr<MetricField> m_pMtrTransparent;
// gradient transparency
- VclGrid* m_pGridGradient;
- ListBox* m_pLbTrgrGradientType;
- FixedText* m_pFtTrgrCenterX;
- MetricField* m_pMtrTrgrCenterX;
- FixedText* m_pFtTrgrCenterY;
- MetricField* m_pMtrTrgrCenterY;
- FixedText* m_pFtTrgrAngle;
- MetricField* m_pMtrTrgrAngle;
- MetricField* m_pMtrTrgrBorder;
- MetricField* m_pMtrTrgrStartValue;
- MetricField* m_pMtrTrgrEndValue;
+ VclPtr<VclGrid> m_pGridGradient;
+ VclPtr<ListBox> m_pLbTrgrGradientType;
+ VclPtr<FixedText> m_pFtTrgrCenterX;
+ VclPtr<MetricField> m_pMtrTrgrCenterX;
+ VclPtr<FixedText> m_pFtTrgrCenterY;
+ VclPtr<MetricField> m_pMtrTrgrCenterY;
+ VclPtr<FixedText> m_pFtTrgrAngle;
+ VclPtr<MetricField> m_pMtrTrgrAngle;
+ VclPtr<MetricField> m_pMtrTrgrBorder;
+ VclPtr<MetricField> m_pMtrTrgrStartValue;
+ VclPtr<MetricField> m_pMtrTrgrEndValue;
// preview
- SvxXRectPreview* m_pCtlBitmapPreview;
- SvxXRectPreview* m_pCtlXRectPreview;
+ VclPtr<SvxXRectPreview> m_pCtlBitmapPreview;
+ VclPtr<SvxXRectPreview> m_pCtlXRectPreview;
bool bBitmap;
XOutdevItemPool* pXPool;
@@ -161,8 +160,10 @@ class SvxTransparenceTabPage : public SvxTabPage
public:
SvxTransparenceTabPage(vcl::Window* pParent, const SfxItemSet& rInAttrs);
+ virtual ~SvxTransparenceTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create(vcl::Window*, const SfxItemSet*);
+ static VclPtr<SfxTabPage> Create(vcl::Window*, const SfxItemSet*);
static const sal_uInt16* GetRanges() { return pTransparenceRanges; }
virtual bool FillItemSet(SfxItemSet*) SAL_OVERRIDE;
@@ -184,48 +185,48 @@ class SvxAreaTabPage : public SvxTabPage
using TabPage::DeactivatePage;
static const sal_uInt16 pAreaRanges[];
private:
- ListBox* m_pTypeLB;
-
- VclBox* m_pFillLB;
- ColorLB* m_pLbColor;
- GradientLB* m_pLbGradient;
- HatchingLB* m_pLbHatching;
- BitmapLB* m_pLbBitmap;
- SvxXRectPreview* m_pCtlBitmapPreview;
-
- TriStateBox* m_pTsbStepCount;
- VclFrame* m_pFlStepCount;
- NumericField* m_pNumFldStepCount;
-
- VclFrame* m_pFlHatchBckgrd;
- CheckBox* m_pCbxHatchBckgrd;
- ColorLB* m_pLbHatchBckgrdColor;
-
- VclBox* m_pBxBitmap;
-
- VclFrame* m_pFlSize;
- TriStateBox* m_pTsbOriginal;
- TriStateBox* m_pTsbScale;
- VclGrid* m_pGridX_Y;
- FixedText* m_pFtXSize;
- MetricField* m_pMtrFldXSize;
- FixedText* m_pFtYSize;
- MetricField* m_pMtrFldYSize;
-
- VclFrame* m_pFlPosition;
- SvxRectCtl* m_pCtlPosition;
- VclGrid* m_pGridOffset;
- MetricField* m_pMtrFldXOffset;
- MetricField* m_pMtrFldYOffset;
- VclBox* m_pBxTile;
- TriStateBox* m_pTsbTile;
- TriStateBox* m_pTsbStretch;
- VclFrame* m_pFlOffset;
- RadioButton* m_pRbtRow;
- RadioButton* m_pRbtColumn;
- MetricField* m_pMtrFldOffset;
-
- SvxXRectPreview* m_pCtlXRectPreview;
+ VclPtr<ListBox> m_pTypeLB;
+
+ VclPtr<VclBox> m_pFillLB;
+ VclPtr<ColorLB> m_pLbColor;
+ VclPtr<GradientLB> m_pLbGradient;
+ VclPtr<HatchingLB> m_pLbHatching;
+ VclPtr<BitmapLB> m_pLbBitmap;
+ VclPtr<SvxXRectPreview> m_pCtlBitmapPreview;
+
+ VclPtr<TriStateBox> m_pTsbStepCount;
+ VclPtr<VclFrame> m_pFlStepCount;
+ VclPtr<NumericField> m_pNumFldStepCount;
+
+ VclPtr<VclFrame> m_pFlHatchBckgrd;
+ VclPtr<CheckBox> m_pCbxHatchBckgrd;
+ VclPtr<ColorLB> m_pLbHatchBckgrdColor;
+
+ VclPtr<VclBox> m_pBxBitmap;
+
+ VclPtr<VclFrame> m_pFlSize;
+ VclPtr<TriStateBox> m_pTsbOriginal;
+ VclPtr<TriStateBox> m_pTsbScale;
+ VclPtr<VclGrid> m_pGridX_Y;
+ VclPtr<FixedText> m_pFtXSize;
+ VclPtr<MetricField> m_pMtrFldXSize;
+ VclPtr<FixedText> m_pFtYSize;
+ VclPtr<MetricField> m_pMtrFldYSize;
+
+ VclPtr<VclFrame> m_pFlPosition;
+ VclPtr<SvxRectCtl> m_pCtlPosition;
+ VclPtr<VclGrid> m_pGridOffset;
+ VclPtr<MetricField> m_pMtrFldXOffset;
+ VclPtr<MetricField> m_pMtrFldYOffset;
+ VclPtr<VclBox> m_pBxTile;
+ VclPtr<TriStateBox> m_pTsbTile;
+ VclPtr<TriStateBox> m_pTsbStretch;
+ VclPtr<VclFrame> m_pFlOffset;
+ VclPtr<RadioButton> m_pRbtRow;
+ VclPtr<RadioButton> m_pRbtColumn;
+ VclPtr<MetricField> m_pMtrFldOffset;
+
+ VclPtr<SvxXRectPreview> m_pCtlXRectPreview;
const SfxItemSet& rOutAttrs;
RECT_POINT eRP;
@@ -265,7 +266,7 @@ private:
bool mbDirectGraphicSet;
Graphic maDirectGraphic;
OUString maDirectName;
- PushButton* m_pBtnImport;
+ VclPtr<PushButton> m_pBtnImport;
DECL_LINK(SelectDialogTypeHdl_Impl, void *);
DECL_LINK( ModifyColorHdl_Impl, void * );
@@ -289,10 +290,12 @@ private:
public:
SvxAreaTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ virtual ~SvxAreaTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void Construct();
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
static const sal_uInt16* GetRanges() { return pAreaRanges; }
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
@@ -327,13 +330,13 @@ class SvxShadowTabPage : public SvxTabPage
static const sal_uInt16 pShadowRanges[];
private:
- TriStateBox* m_pTsbShowShadow;
- VclGrid* m_pGridShadow;
- SvxRectCtl* m_pCtlPosition;
- MetricField* m_pMtrDistance;
- ColorLB* m_pLbShadowColor;
- MetricField* m_pMtrTransparent;
- SvxXShadowPreview* m_pCtlXRectPreview;
+ VclPtr<TriStateBox> m_pTsbShowShadow;
+ VclPtr<VclGrid> m_pGridShadow;
+ VclPtr<SvxRectCtl> m_pCtlPosition;
+ VclPtr<MetricField> m_pMtrDistance;
+ VclPtr<ColorLB> m_pLbShadowColor;
+ VclPtr<MetricField> m_pMtrTransparent;
+ VclPtr<SvxXShadowPreview> m_pCtlXRectPreview;
const SfxItemSet& rOutAttrs;
RECT_POINT eRP;
@@ -356,9 +359,11 @@ private:
public:
SvxShadowTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ virtual ~SvxShadowTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void Construct();
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
static const sal_uInt16* GetRanges() { return pShadowRanges; }
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
@@ -384,25 +389,25 @@ class SvxGradientTabPage : public SfxTabPage
using TabPage::DeactivatePage;
private:
- ListBox* m_pLbGradientType;
- FixedText* m_pFtCenterX;
- MetricField* m_pMtrCenterX;
- FixedText* m_pFtCenterY;
- MetricField* m_pMtrCenterY;
- FixedText* m_pFtAngle;
- MetricField* m_pMtrAngle;
- MetricField* m_pMtrBorder;
- ColorLB* m_pLbColorFrom;
- MetricField* m_pMtrColorFrom;
- ColorLB* m_pLbColorTo;
- MetricField* m_pMtrColorTo;
- GradientLB* m_pLbGradients;
- SvxXRectPreview* m_pCtlPreview;
- PushButton* m_pBtnAdd;
- PushButton* m_pBtnModify;
- PushButton* m_pBtnDelete;
- PushButton* m_pBtnLoad;
- PushButton* m_pBtnSave;
+ VclPtr<ListBox> m_pLbGradientType;
+ VclPtr<FixedText> m_pFtCenterX;
+ VclPtr<MetricField> m_pMtrCenterX;
+ VclPtr<FixedText> m_pFtCenterY;
+ VclPtr<MetricField> m_pMtrCenterY;
+ VclPtr<FixedText> m_pFtAngle;
+ VclPtr<MetricField> m_pMtrAngle;
+ VclPtr<MetricField> m_pMtrBorder;
+ VclPtr<ColorLB> m_pLbColorFrom;
+ VclPtr<MetricField> m_pMtrColorFrom;
+ VclPtr<ColorLB> m_pLbColorTo;
+ VclPtr<MetricField> m_pMtrColorTo;
+ VclPtr<GradientLB> m_pLbGradients;
+ VclPtr<SvxXRectPreview> m_pCtlPreview;
+ VclPtr<PushButton> m_pBtnAdd;
+ VclPtr<PushButton> m_pBtnModify;
+ VclPtr<PushButton> m_pBtnDelete;
+ VclPtr<PushButton> m_pBtnLoad;
+ VclPtr<PushButton> m_pBtnSave;
const SfxItemSet& rOutAttrs;
@@ -435,10 +440,12 @@ private:
public:
SvxGradientTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ virtual ~SvxGradientTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void Construct();
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet * ) SAL_OVERRIDE;
@@ -466,18 +473,18 @@ class SvxHatchTabPage : public SvxTabPage
using TabPage::DeactivatePage;
private:
- MetricField* m_pMtrDistance;
- MetricField* m_pMtrAngle;
- SvxRectCtl* m_pCtlAngle;
- ListBox* m_pLbLineType;
- ColorLB* m_pLbLineColor;
- HatchingLB* m_pLbHatchings;
- SvxXRectPreview* m_pCtlPreview;
- PushButton* m_pBtnAdd;
- PushButton* m_pBtnModify;
- PushButton* m_pBtnDelete;
- PushButton* m_pBtnLoad;
- PushButton* m_pBtnSave;
+ VclPtr<MetricField> m_pMtrDistance;
+ VclPtr<MetricField> m_pMtrAngle;
+ VclPtr<SvxRectCtl> m_pCtlAngle;
+ VclPtr<ListBox> m_pLbLineType;
+ VclPtr<ColorLB> m_pLbLineColor;
+ VclPtr<HatchingLB> m_pLbHatchings;
+ VclPtr<SvxXRectPreview> m_pCtlPreview;
+ VclPtr<PushButton> m_pBtnAdd;
+ VclPtr<PushButton> m_pBtnModify;
+ VclPtr<PushButton> m_pBtnDelete;
+ VclPtr<PushButton> m_pBtnLoad;
+ VclPtr<PushButton> m_pBtnSave;
const SfxItemSet& rOutAttrs;
@@ -511,10 +518,12 @@ private:
public:
SvxHatchTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ virtual ~SvxHatchTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void Construct();
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet * ) SAL_OVERRIDE;
@@ -546,19 +555,19 @@ class SvxBitmapTabPage : public SvxTabPage
using TabPage::DeactivatePage;
private:
- VclBox* m_pBxPixelEditor;
- SvxPixelCtl* m_pCtlPixel;
- ColorLB* m_pLbColor;
- ColorLB* m_pLbBackgroundColor;
- FixedText* m_pLbBitmapsHidden;
- BitmapLB* m_pLbBitmaps;
- SvxXRectPreview* m_pCtlPreview;
- PushButton* m_pBtnAdd;
- PushButton* m_pBtnModify;
- PushButton* m_pBtnImport;
- PushButton* m_pBtnDelete;
- PushButton* m_pBtnLoad;
- PushButton* m_pBtnSave;
+ VclPtr<VclBox> m_pBxPixelEditor;
+ VclPtr<SvxPixelCtl> m_pCtlPixel;
+ VclPtr<ColorLB> m_pLbColor;
+ VclPtr<ColorLB> m_pLbBackgroundColor;
+ VclPtr<FixedText> m_pLbBitmapsHidden;
+ VclPtr<BitmapLB> m_pLbBitmaps;
+ VclPtr<SvxXRectPreview> m_pCtlPreview;
+ VclPtr<PushButton> m_pBtnAdd;
+ VclPtr<PushButton> m_pBtnModify;
+ VclPtr<PushButton> m_pBtnImport;
+ VclPtr<PushButton> m_pBtnDelete;
+ VclPtr<PushButton> m_pBtnLoad;
+ VclPtr<PushButton> m_pBtnSave;
SvxBitmapCtl* m_pBitmapCtl;
@@ -597,10 +606,11 @@ private:
public:
SvxBitmapTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
virtual ~SvxBitmapTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void Construct();
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet * ) SAL_OVERRIDE;
@@ -642,11 +652,11 @@ class SvxColorTabPage : public SfxTabPage
private:
XPropertyListType meType;
- Window *mpTopDlg;
- CheckBox *m_pBoxEmbed;
- PushButton *m_pBtnLoad;
- PushButton *m_pBtnSave;
- FixedText *m_pTableName;
+ VclPtr<Window> mpTopDlg;
+ VclPtr<CheckBox> m_pBoxEmbed;
+ VclPtr<PushButton> m_pBtnLoad;
+ VclPtr<PushButton> m_pBtnSave;
+ VclPtr<FixedText> m_pTableName;
DECL_LINK( EmbedToggleHdl_Impl, void * );
DECL_LINK( ClickLoadHdl_Impl, void * );
@@ -660,31 +670,31 @@ private:
void EnableSave( bool bCanSave );
SvxColorTabPageShadow *pShadow;
- Edit* m_pEdtName;
- ColorLB* m_pLbColor;
+ VclPtr<Edit> m_pEdtName;
+ VclPtr<ColorLB> m_pLbColor;
- SvxColorValueSet* m_pValSetColorList;
+ VclPtr<SvxColorValueSet> m_pValSetColorList;
- SvxXRectPreview* m_pCtlPreviewOld;
- SvxXRectPreview* m_pCtlPreviewNew;
+ VclPtr<SvxXRectPreview> m_pCtlPreviewOld;
+ VclPtr<SvxXRectPreview> m_pCtlPreviewNew;
- ListBox* m_pLbColorModel;
+ VclPtr<ListBox> m_pLbColorModel;
- VclContainer* m_pRGB;
- NumericField* m_pR;
- NumericField* m_pG;
- NumericField* m_pB;
+ VclPtr<VclContainer> m_pRGB;
+ VclPtr<NumericField> m_pR;
+ VclPtr<NumericField> m_pG;
+ VclPtr<NumericField> m_pB;
- VclContainer* m_pCMYK;
- MetricField* m_pC;
- MetricField* m_pY;
- MetricField* m_pM;
- MetricField* m_pK;
+ VclPtr<VclContainer> m_pCMYK;
+ VclPtr<MetricField> m_pC;
+ VclPtr<MetricField> m_pY;
+ VclPtr<MetricField> m_pM;
+ VclPtr<MetricField> m_pK;
- PushButton* m_pBtnAdd;
- PushButton* m_pBtnModify;
- PushButton* m_pBtnWorkOn;
- PushButton* m_pBtnDelete;
+ VclPtr<PushButton> m_pBtnAdd;
+ VclPtr<PushButton> m_pBtnModify;
+ VclPtr<PushButton> m_pBtnWorkOn;
+ VclPtr<PushButton> m_pBtnDelete;
const SfxItemSet& rOutAttrs;
@@ -731,10 +741,11 @@ private:
public:
SvxColorTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
virtual ~SvxColorTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void Construct();
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet * ) SAL_OVERRIDE;
diff --git a/cui/source/inc/cuitabline.hxx b/cui/source/inc/cuitabline.hxx
index 31550706538a..3bb1f2b414ea 100644
--- a/cui/source/inc/cuitabline.hxx
+++ b/cui/source/inc/cuitabline.hxx
@@ -64,7 +64,6 @@ public:
SvxLineTabDialog( vcl::Window* pParent, const SfxItemSet* pAttr,
SdrModel* pModel, const SdrObject* pObj = NULL,
bool bHasObj = true );
- virtual ~SvxLineTabDialog();
void SetNewDashList( XDashListRef pInLst)
{ pNewDashList = pInLst; }
@@ -92,34 +91,34 @@ class SvxLineTabPage : public SvxTabPage
using TabPage::DeactivatePage;
static const sal_uInt16 pLineRanges[];
private:
- VclBox* m_pBoxColor;
- LineLB* m_pLbLineStyle;
- ColorLB* m_pLbColor;
- VclBox* m_pBoxWidth;
- MetricField* m_pMtrLineWidth;
- VclBox* m_pBoxTransparency;
- MetricField* m_pMtrTransparent;
-
- VclFrame* m_pFlLineEnds;
- VclBox* m_pBoxArrowStyles;
- LineEndLB* m_pLbStartStyle;
- VclBox* m_pBoxStart;
- MetricField* m_pMtrStartWidth;
- TriStateBox* m_pTsbCenterStart;
- VclBox* m_pBoxEnd;
- LineEndLB* m_pLbEndStyle;
- MetricField* m_pMtrEndWidth;
- TriStateBox* m_pTsbCenterEnd;
- CheckBox* m_pCbxSynchronize;
- SvxXLinePreview* m_pCtlPreview;
+ VclPtr<VclBox> m_pBoxColor;
+ VclPtr<LineLB> m_pLbLineStyle;
+ VclPtr<ColorLB> m_pLbColor;
+ VclPtr<VclBox> m_pBoxWidth;
+ VclPtr<MetricField> m_pMtrLineWidth;
+ VclPtr<VclBox> m_pBoxTransparency;
+ VclPtr<MetricField> m_pMtrTransparent;
+
+ VclPtr<VclFrame> m_pFlLineEnds;
+ VclPtr<VclBox> m_pBoxArrowStyles;
+ VclPtr<LineEndLB> m_pLbStartStyle;
+ VclPtr<VclBox> m_pBoxStart;
+ VclPtr<MetricField> m_pMtrStartWidth;
+ VclPtr<TriStateBox> m_pTsbCenterStart;
+ VclPtr<VclBox> m_pBoxEnd;
+ VclPtr<LineEndLB> m_pLbEndStyle;
+ VclPtr<MetricField> m_pMtrEndWidth;
+ VclPtr<TriStateBox> m_pTsbCenterEnd;
+ VclPtr<CheckBox> m_pCbxSynchronize;
+ VclPtr<SvxXLinePreview> m_pCtlPreview;
// #116827#
- VclFrame* m_pFLEdgeStyle;
- VclGrid* m_pGridEdgeCaps;
- ListBox* m_pLBEdgeStyle;
+ VclPtr<VclFrame> m_pFLEdgeStyle;
+ VclPtr<VclGrid> m_pGridEdgeCaps;
+ VclPtr<ListBox> m_pLBEdgeStyle;
// LineCaps
- ListBox* m_pLBCapStyle;
+ VclPtr<ListBox> m_pLBCapStyle;
//#58425# symbols on a line (e. g. StarChart) ->
/** a list of symbols to be shown in menu. Symbol at position SID_ATTR_SYMBOLTYPE is to be shown in preview.
@@ -132,12 +131,12 @@ private:
long nSymbolType;
/// attributes for the shown symbols; only necessary if not equal to line properties
SfxItemSet* pSymbolAttr;
- VclFrame* m_pFlSymbol;
- VclGrid* m_pGridIconSize;
- MenuButton* m_pSymbolMB;
- MetricField* m_pSymbolWidthMF;
- MetricField* m_pSymbolHeightMF;
- CheckBox* m_pSymbolRatioCB;
+ VclPtr<VclFrame> m_pFlSymbol;
+ VclPtr<VclGrid> m_pGridIconSize;
+ VclPtr<MenuButton> m_pSymbolMB;
+ VclPtr<MetricField> m_pSymbolWidthMF;
+ VclPtr<MetricField> m_pSymbolHeightMF;
+ VclPtr<CheckBox> m_pSymbolRatioCB;
std::vector<OUString> aGrfNames;
SvxBmpItemInfoList aGrfBrushItems;
bool bLastWidthModified;
@@ -205,10 +204,11 @@ public:
SvxLineTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
virtual ~SvxLineTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void Construct();
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
static const sal_uInt16* GetRanges() { return pLineRanges; }
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
@@ -246,21 +246,21 @@ class SvxLineDefTabPage : public SfxTabPage
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
private:
- LineLB* m_pLbLineStyles;
- ListBox* m_pLbType1;
- ListBox* m_pLbType2;
- NumericField* m_pNumFldNumber1;
- NumericField* m_pNumFldNumber2;
- MetricField* m_pMtrLength1;
- MetricField* m_pMtrLength2;
- MetricField* m_pMtrDistance;
- CheckBox* m_pCbxSynchronize;
- PushButton* m_pBtnAdd;
- PushButton* m_pBtnModify;
- PushButton* m_pBtnDelete;
- PushButton* m_pBtnLoad;
- PushButton* m_pBtnSave;
- SvxXLinePreview* m_pCtlPreview;
+ VclPtr<LineLB> m_pLbLineStyles;
+ VclPtr<ListBox> m_pLbType1;
+ VclPtr<ListBox> m_pLbType2;
+ VclPtr<NumericField> m_pNumFldNumber1;
+ VclPtr<NumericField> m_pNumFldNumber2;
+ VclPtr<MetricField> m_pMtrLength1;
+ VclPtr<MetricField> m_pMtrLength2;
+ VclPtr<MetricField> m_pMtrDistance;
+ VclPtr<CheckBox> m_pCbxSynchronize;
+ VclPtr<PushButton> m_pBtnAdd;
+ VclPtr<PushButton> m_pBtnModify;
+ VclPtr<PushButton> m_pBtnDelete;
+ VclPtr<PushButton> m_pBtnLoad;
+ VclPtr<PushButton> m_pBtnSave;
+ VclPtr<SvxXLinePreview> m_pCtlPreview;
const SfxItemSet& rOutAttrs;
XDash aDash;
@@ -303,10 +303,12 @@ private:
public:
SvxLineDefTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ virtual ~SvxLineDefTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void Construct();
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet * ) SAL_OVERRIDE;
@@ -333,14 +335,14 @@ class SvxLineEndDefTabPage : public SfxTabPage
using TabPage::DeactivatePage;
private:
- Edit* m_pEdtName;
- LineEndLB* m_pLbLineEnds;
- PushButton* m_pBtnAdd;
- PushButton* m_pBtnModify;
- PushButton* m_pBtnDelete;
- PushButton* m_pBtnLoad;
- PushButton* m_pBtnSave;
- SvxXLinePreview* m_pCtlPreview;
+ VclPtr<Edit> m_pEdtName;
+ VclPtr<LineEndLB> m_pLbLineEnds;
+ VclPtr<PushButton> m_pBtnAdd;
+ VclPtr<PushButton> m_pBtnModify;
+ VclPtr<PushButton> m_pBtnDelete;
+ VclPtr<PushButton> m_pBtnLoad;
+ VclPtr<PushButton> m_pBtnSave;
+ VclPtr<SvxXLinePreview> m_pCtlPreview;
const SfxItemSet& rOutAttrs;
const SdrObject* pPolyObj;
@@ -373,10 +375,11 @@ private:
public:
SvxLineEndDefTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
virtual ~SvxLineEndDefTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void Construct();
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet * ) SAL_OVERRIDE;
diff --git a/cui/source/inc/cuitbxform.hxx b/cui/source/inc/cuitbxform.hxx
index 1f2b34d616db..4ee17070a5f5 100644
--- a/cui/source/inc/cuitbxform.hxx
+++ b/cui/source/inc/cuitbxform.hxx
@@ -29,10 +29,12 @@
class FmInputRecordNoDialog : public ModalDialog
{
public:
- NumericField* m_pRecordNo;
+ VclPtr<NumericField> m_pRecordNo;
public:
FmInputRecordNoDialog(vcl::Window * pParent);
+ virtual ~FmInputRecordNoDialog();
+ virtual void dispose() SAL_OVERRIDE;
void SetValue(long dNew) { m_pRecordNo->SetValue(dNew); }
long GetValue() const { return static_cast<long>(m_pRecordNo->GetValue()); }
diff --git a/cui/source/inc/dbregister.hxx b/cui/source/inc/dbregister.hxx
index f35f2adb57c8..cf0142120532 100644
--- a/cui/source/inc/dbregister.hxx
+++ b/cui/source/inc/dbregister.hxx
@@ -46,12 +46,12 @@ namespace svx
OUString aTypeText;
OUString aPathText;
- SvSimpleTableContainer* m_pPathCtrl;
- PushButton* m_pNew;
- PushButton* m_pEdit;
- PushButton* m_pDelete;
+ VclPtr<SvSimpleTableContainer> m_pPathCtrl;
+ VclPtr<PushButton> m_pNew;
+ VclPtr<PushButton> m_pEdit;
+ VclPtr<PushButton> m_pDelete;
- ::svx::OptHeaderTabListBox* pPathBox;
+ VclPtr<::svx::OptHeaderTabListBox> pPathBox;
SvTreeListEntry* m_pCurEntry;
sal_uLong m_nOldCount;
bool m_bModified;
@@ -91,8 +91,9 @@ namespace svx
public:
DbRegistrationOptionsPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~DbRegistrationOptionsPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
static const sal_uInt16* GetRanges();
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -129,7 +130,6 @@ namespace svx
{
public:
DatabaseRegistrationDialog( vcl::Window* pParent, const SfxItemSet& rAttr );
- virtual ~DatabaseRegistrationDialog();
virtual short Execute() SAL_OVERRIDE;
};
diff --git a/cui/source/inc/dlgname.hxx b/cui/source/inc/dlgname.hxx
index e6d9ea26c9fd..8615477f6618 100644
--- a/cui/source/inc/dlgname.hxx
+++ b/cui/source/inc/dlgname.hxx
@@ -30,9 +30,9 @@
class SvxNameDialog : public ModalDialog
{
private:
- FixedText* pFtDescription;
- Edit* pEdtName;
- OKButton* pBtnOK;
+ VclPtr<FixedText> pFtDescription;
+ VclPtr<Edit> pEdtName;
+ VclPtr<OKButton> pBtnOK;
Link aCheckNameHdl;
@@ -40,6 +40,8 @@ private:
public:
SvxNameDialog( vcl::Window* pWindow, const OUString& rName, const OUString& rDesc );
+ virtual ~SvxNameDialog();
+ virtual void dispose() SAL_OVERRIDE;
void GetName( OUString& rName ){rName = pEdtName->GetText();}
@@ -75,10 +77,10 @@ class SvxObjectNameDialog : public ModalDialog
{
private:
// name
- Edit* pEdtName;
+ VclPtr<Edit> pEdtName;
// buttons
- OKButton* pBtnOK;
+ VclPtr<OKButton> pBtnOK;
// callback link for name uniqueness
Link aCheckNameHdl;
@@ -88,6 +90,8 @@ private:
public:
// constructor
SvxObjectNameDialog(vcl::Window* pWindow, const OUString& rName);
+ virtual ~SvxObjectNameDialog();
+ virtual void dispose() SAL_OVERRIDE;
// data access
void GetName(OUString& rName) {rName = pEdtName->GetText(); }
@@ -110,15 +114,16 @@ class SvxObjectTitleDescDialog : public ModalDialog
{
private:
// title
- Edit* pEdtTitle;
+ VclPtr<Edit> pEdtTitle;
// description
- VclMultiLineEdit* pEdtDescription;
+ VclPtr<VclMultiLineEdit> pEdtDescription;
public:
// constructor
SvxObjectTitleDescDialog(vcl::Window* pWindow, const OUString& rTitle, const OUString& rDesc);
-
+ virtual ~SvxObjectTitleDescDialog();
+ virtual void dispose() SAL_OVERRIDE;
// data access
void GetTitle(OUString& rTitle) {rTitle = pEdtTitle->GetText(); }
void GetDescription(OUString& rDescription) {rDescription = pEdtDescription->GetText(); }
@@ -128,10 +133,10 @@ public:
class SvxMessDialog : public ModalDialog
{
private:
- FixedText* pFtDescription;
- PushButton* pBtn1;
- PushButton* pBtn2;
- FixedImage* pFtImage;
+ VclPtr<FixedText> pFtDescription;
+ VclPtr<PushButton> pBtn1;
+ VclPtr<PushButton> pBtn2;
+ VclPtr<FixedImage> pFtImage;
Image* pImage;
DECL_LINK(Button1Hdl, void *);
@@ -140,6 +145,7 @@ private:
public:
SvxMessDialog( vcl::Window* pWindow, const OUString& rText, const OUString& rDesc, Image* pImg = NULL );
virtual ~SvxMessDialog();
+ virtual void dispose() SAL_OVERRIDE;
void SetButtonText( sal_uInt16 nBtnId, const OUString& rNewTxt );
};
diff --git a/cui/source/inc/dstribut.hxx b/cui/source/inc/dstribut.hxx
index e0be5f3dd87e..46e18129968f 100644
--- a/cui/source/inc/dstribut.hxx
+++ b/cui/source/inc/dstribut.hxx
@@ -29,23 +29,25 @@ class SvxDistributePage : public SvxTabPage
SvxDistributeHorizontal m_eDistributeHor;
SvxDistributeVertical m_eDistributeVer;
- RadioButton* m_pBtnHorNone;
- RadioButton* m_pBtnHorLeft;
- RadioButton* m_pBtnHorCenter;
- RadioButton* m_pBtnHorDistance;
- RadioButton* m_pBtnHorRight;
- RadioButton* m_pBtnVerNone;
- RadioButton* m_pBtnVerTop;
- RadioButton* m_pBtnVerCenter;
- RadioButton* m_pBtnVerDistance;
- RadioButton* m_pBtnVerBottom;
+ VclPtr<RadioButton> m_pBtnHorNone;
+ VclPtr<RadioButton> m_pBtnHorLeft;
+ VclPtr<RadioButton> m_pBtnHorCenter;
+ VclPtr<RadioButton> m_pBtnHorDistance;
+ VclPtr<RadioButton> m_pBtnHorRight;
+ VclPtr<RadioButton> m_pBtnVerNone;
+ VclPtr<RadioButton> m_pBtnVerTop;
+ VclPtr<RadioButton> m_pBtnVerCenter;
+ VclPtr<RadioButton> m_pBtnVerDistance;
+ VclPtr<RadioButton> m_pBtnVerBottom;
public:
SvxDistributePage(vcl::Window* pWindow, const SfxItemSet& rInAttrs,
SvxDistributeHorizontal eHor = SvxDistributeHorizontalNone,
SvxDistributeVertical eVer = SvxDistributeVerticalNone);
+ virtual ~SvxDistributePage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create(vcl::Window*, const SfxItemSet&,
+ static VclPtr<SfxTabPage> Create(vcl::Window*, const SfxItemSet&,
SvxDistributeHorizontal eHor, SvxDistributeVertical eVer);
virtual bool FillItemSet(SfxItemSet*) SAL_OVERRIDE;
virtual void Reset(const SfxItemSet*) SAL_OVERRIDE;
@@ -57,12 +59,14 @@ public:
class SvxDistributeDialog : public SfxSingleTabDialog
{
- SvxDistributePage* mpPage;
+ VclPtr<SvxDistributePage> mpPage;
public:
SvxDistributeDialog(vcl::Window* pParent, const SfxItemSet& rAttr,
SvxDistributeHorizontal eHor = SvxDistributeHorizontalNone,
SvxDistributeVertical eVer = SvxDistributeVerticalNone);
+ virtual ~SvxDistributeDialog();
+ virtual void dispose() SAL_OVERRIDE;
SvxDistributeHorizontal GetDistributeHor() const { return mpPage->GetDistributeHor(); }
SvxDistributeVertical GetDistributeVer() const { return mpPage->GetDistributeVer(); }
diff --git a/cui/source/inc/grfpage.hxx b/cui/source/inc/grfpage.hxx
index 18769aee67b2..4ce44f8ec257 100644
--- a/cui/source/inc/grfpage.hxx
+++ b/cui/source/inc/grfpage.hxx
@@ -56,28 +56,28 @@ class SvxGrfCropPage : public SfxTabPage
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
- VclContainer* m_pCropFrame;
- RadioButton* m_pZoomConstRB;
- RadioButton* m_pSizeConstRB;
- MetricField* m_pLeftMF;
- MetricField* m_pRightMF;
- MetricField* m_pTopMF;
- MetricField* m_pBottomMF;
-
- VclContainer* m_pScaleFrame;
- MetricField* m_pWidthZoomMF;
- MetricField* m_pHeightZoomMF;
-
- VclContainer* m_pSizeFrame;
- MetricField* m_pWidthMF;
- MetricField* m_pHeightMF;
-
- VclContainer* m_pOrigSizeGrid;
- FixedText* m_pOrigSizeFT;
- PushButton* m_pOrigSizePB;
+ VclPtr<VclContainer> m_pCropFrame;
+ VclPtr<RadioButton> m_pZoomConstRB;
+ VclPtr<RadioButton> m_pSizeConstRB;
+ VclPtr<MetricField> m_pLeftMF;
+ VclPtr<MetricField> m_pRightMF;
+ VclPtr<MetricField> m_pTopMF;
+ VclPtr<MetricField> m_pBottomMF;
+
+ VclPtr<VclContainer> m_pScaleFrame;
+ VclPtr<MetricField> m_pWidthZoomMF;
+ VclPtr<MetricField> m_pHeightZoomMF;
+
+ VclPtr<VclContainer> m_pSizeFrame;
+ VclPtr<MetricField> m_pWidthMF;
+ VclPtr<MetricField> m_pHeightMF;
+
+ VclPtr<VclContainer> m_pOrigSizeGrid;
+ VclPtr<FixedText> m_pOrigSizeFT;
+ VclPtr<PushButton> m_pOrigSizePB;
// Example
- SvxCropExample* m_pExampleWN;
+ VclPtr<SvxCropExample> m_pExampleWN;
Timer aTimer;
@@ -85,7 +85,7 @@ class SvxGrfCropPage : public SfxTabPage
Size aOrigSize;
Size aOrigPixelSize;
Size aPageSize;
- const MetricField* pLastCropField;
+ VclPtr<MetricField> pLastCropField;
long nOldWidth;
long nOldHeight;
bool bReset;
@@ -95,6 +95,7 @@ class SvxGrfCropPage : public SfxTabPage
SvxGrfCropPage( vcl::Window *pParent, const SfxItemSet &rSet );
virtual ~SvxGrfCropPage();
+ virtual void dispose() SAL_OVERRIDE;
DECL_LINK( ZoomHdl, MetricField * );
DECL_LINK( SizeHdl, MetricField * );
@@ -111,7 +112,7 @@ class SvxGrfCropPage : public SfxTabPage
Size GetGrfOrigSize( const Graphic& ) const;
public:
- static SfxTabPage *Create( vcl::Window *pParent, const SfxItemSet *rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window *pParent, const SfxItemSet *rSet );
virtual bool FillItemSet( SfxItemSet *rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet *rSet ) SAL_OVERRIDE;
diff --git a/cui/source/inc/hangulhanjadlg.hxx b/cui/source/inc/hangulhanjadlg.hxx
index cb228daebc1e..2aa203c85319 100644
--- a/cui/source/inc/hangulhanjadlg.hxx
+++ b/cui/source/inc/hangulhanjadlg.hxx
@@ -43,6 +43,7 @@ namespace svx
public:
SuggestionSet( vcl::Window* pParent );
virtual ~SuggestionSet();
+ virtual void dispose() SAL_OVERRIDE;
virtual void UserDraw( const UserDrawEvent& rUDEvt ) SAL_OVERRIDE;
void ClearSet();
@@ -53,6 +54,7 @@ namespace svx
public:
SuggestionDisplay( vcl::Window* pParent, WinBits nBits );
virtual ~SuggestionDisplay();
+ virtual void dispose() SAL_OVERRIDE;
void DisplayListBox( bool bDisplayListBox );
@@ -87,8 +89,8 @@ namespace svx
private:
bool m_bDisplayListBox;//otherwise ValueSet
- SuggestionSet m_aValueSet;
- ListBox m_aListBox;
+ VclPtr<SuggestionSet> m_aValueSet;
+ VclPtr<ListBox> m_aListBox;
Link m_aSelectLink;
bool m_bInSelectionUpdate;
@@ -102,27 +104,27 @@ namespace svx
{
private:
- PushButton* m_pFind;
- PushButton* m_pIgnore;
- PushButton* m_pIgnoreAll;
- PushButton* m_pReplace;
- PushButton* m_pReplaceAll;
- PushButton* m_pOptions;
- SuggestionDisplay* m_pSuggestions;
- RadioButton* m_pSimpleConversion;
- RadioButton* m_pHangulBracketed;
- RadioButton* m_pHanjaBracketed;
- Edit* m_pWordInput;
- FixedText* m_pOriginalWord;
- RubyRadioButton* m_pHanjaAbove;
- RubyRadioButton* m_pHanjaBelow;
- RubyRadioButton* m_pHangulAbove;
- RubyRadioButton* m_pHangulBelow;
- CheckBox* m_pHangulOnly;
- CheckBox* m_pHanjaOnly;
- CheckBox* m_pReplaceByChar;
-
- CheckBox* m_pIgnoreNonPrimary;
+ VclPtr<PushButton> m_pFind;
+ VclPtr<PushButton> m_pIgnore;
+ VclPtr<PushButton> m_pIgnoreAll;
+ VclPtr<PushButton> m_pReplace;
+ VclPtr<PushButton> m_pReplaceAll;
+ VclPtr<PushButton> m_pOptions;
+ VclPtr<SuggestionDisplay> m_pSuggestions;
+ VclPtr<RadioButton> m_pSimpleConversion;
+ VclPtr<RadioButton> m_pHangulBracketed;
+ VclPtr<RadioButton> m_pHanjaBracketed;
+ VclPtr<Edit> m_pWordInput;
+ VclPtr<FixedText> m_pOriginalWord;
+ VclPtr<RubyRadioButton> m_pHanjaAbove;
+ VclPtr<RubyRadioButton> m_pHanjaBelow;
+ VclPtr<RubyRadioButton> m_pHangulAbove;
+ VclPtr<RubyRadioButton> m_pHangulBelow;
+ VclPtr<CheckBox> m_pHangulOnly;
+ VclPtr<CheckBox> m_pHanjaOnly;
+ VclPtr<CheckBox> m_pReplaceByChar;
+
+ VclPtr<CheckBox> m_pIgnoreNonPrimary;
/** are we working for a document? This is normally true, but in case
the user uses the "find" functionality, we switch to working
with what the user entered, which then does not have any relation to
@@ -136,7 +138,8 @@ namespace svx
HangulHanjaConversionDialog(
vcl::Window* _pParent,
editeng::HangulHanjaConversion::ConversionDirection _ePrimaryDirection );
- virtual ~HangulHanjaConversionDialog( );
+ virtual ~HangulHanjaConversionDialog();
+ virtual void dispose() SAL_OVERRIDE;
public:
void SetOptionsChangedHdl( const Link& _rHdl );
@@ -195,14 +198,14 @@ namespace svx
class HangulHanjaOptionsDialog : public ModalDialog
{
private:
- SvxCheckListBox* m_pDictsLB;
- CheckBox* m_pIgnorepostCB;
- CheckBox* m_pShowrecentlyfirstCB;
- CheckBox* m_pAutoreplaceuniqueCB;
- PushButton* m_pNewPB;
- PushButton* m_pEditPB;
- PushButton* m_pDeletePB;
- OKButton* m_pOkPB;
+ VclPtr<SvxCheckListBox> m_pDictsLB;
+ VclPtr<CheckBox> m_pIgnorepostCB;
+ VclPtr<CheckBox> m_pShowrecentlyfirstCB;
+ VclPtr<CheckBox> m_pAutoreplaceuniqueCB;
+ VclPtr<PushButton> m_pNewPB;
+ VclPtr<PushButton> m_pEditPB;
+ VclPtr<PushButton> m_pDeletePB;
+ VclPtr<OKButton> m_pOkPB;
SvLBoxButtonData* m_pCheckButtonData;
@@ -222,6 +225,7 @@ namespace svx
public:
HangulHanjaOptionsDialog( vcl::Window* _pParent );
virtual ~HangulHanjaOptionsDialog();
+ virtual void dispose() SAL_OVERRIDE;
void AddDict( const OUString& _rName, bool _bChecked );
};
@@ -230,8 +234,8 @@ namespace svx
class HangulHanjaNewDictDialog : public ModalDialog
{
private:
- Edit* m_pDictNameED;
- OKButton* m_pOkBtn;
+ VclPtr<Edit> m_pDictNameED;
+ VclPtr<OKButton> m_pOkBtn;
bool m_bEntered;
@@ -239,6 +243,8 @@ namespace svx
DECL_LINK( ModifyHdl, void* );
public:
HangulHanjaNewDictDialog( vcl::Window* _pParent );
+ virtual ~HangulHanjaNewDictDialog();
+ virtual void dispose() SAL_OVERRIDE;
bool GetName( OUString& _rRetName ) const;
};
@@ -249,15 +255,16 @@ namespace svx
class SuggestionEdit : public Edit
{
private:
- SuggestionEdit* m_pPrev;
- SuggestionEdit* m_pNext;
- ScrollBar* m_pScrollBar;
+ VclPtr<SuggestionEdit> m_pPrev;
+ VclPtr<SuggestionEdit> m_pNext;
+ VclPtr<ScrollBar> m_pScrollBar;
bool ShouldScroll( bool _bUp ) const;
void DoJump( bool _bUp );
public:
SuggestionEdit( vcl::Window* pParent, WinBits nBits );
virtual ~SuggestionEdit();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
void init( ScrollBar* pScrollBar, SuggestionEdit* pPrev, SuggestionEdit* pNext);
};
@@ -273,15 +280,15 @@ namespace svx
OUString m_aOriginal;
SuggestionList* m_pSuggestions;
- ListBox* m_aBookLB;
- ComboBox* m_aOriginalLB;
- SuggestionEdit* m_aEdit1;
- SuggestionEdit* m_aEdit2;
- SuggestionEdit* m_aEdit3;
- SuggestionEdit* m_aEdit4;
- ScrollBar* m_aScrollSB;
- PushButton* m_aNewPB;
- PushButton* m_aDeletePB;
+ VclPtr<ListBox> m_aBookLB;
+ VclPtr<ComboBox> m_aOriginalLB;
+ VclPtr<SuggestionEdit> m_aEdit1;
+ VclPtr<SuggestionEdit> m_aEdit2;
+ VclPtr<SuggestionEdit> m_aEdit3;
+ VclPtr<SuggestionEdit> m_aEdit4;
+ VclPtr<ScrollBar> m_aScrollSB;
+ VclPtr<PushButton> m_aNewPB;
+ VclPtr<PushButton> m_aDeletePB;
sal_uInt16 m_nTopPos;
bool m_bModifiedSuggestions;
@@ -312,6 +319,7 @@ namespace svx
public:
HangulHanjaEditDictDialog( vcl::Window* _pParent, HHDictList& _rDictList, sal_uInt32 _nSelDict );
virtual ~HangulHanjaEditDictDialog();
+ virtual void dispose() SAL_OVERRIDE;
void UpdateScrollbar();
};
diff --git a/cui/source/inc/headertablistbox.hxx b/cui/source/inc/headertablistbox.hxx
index d368d4dc27c9..f63eba3c73c1 100644
--- a/cui/source/inc/headertablistbox.hxx
+++ b/cui/source/inc/headertablistbox.hxx
@@ -27,25 +27,27 @@
class MacroEventListBox : public Control
{
private:
- HeaderBar maHeaderBar;
- SvHeaderTabListBox maListBox;
+ VclPtr<HeaderBar> maHeaderBar;
+ VclPtr<SvHeaderTabListBox> maListBox;
protected:
DECL_LINK( HeaderEndDrag_Impl, HeaderBar* );
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
public:
MacroEventListBox( vcl::Window* pParent, WinBits nStyle );
+ virtual ~MacroEventListBox();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
virtual Size GetOptimalSize() const SAL_OVERRIDE;
SvHeaderTabListBox& GetListBox()
{
- return maListBox;
+ return *maListBox.get();
}
HeaderBar& GetHeaderBar()
{
- return maHeaderBar;
+ return *maHeaderBar.get();
}
void ConnectElements();/**< should be called after all manipulations on elements are done
diff --git a/cui/source/inc/hldocntp.hxx b/cui/source/inc/hldocntp.hxx
index 98731d7e6172..e72b13387e0e 100644
--- a/cui/source/inc/hldocntp.hxx
+++ b/cui/source/inc/hldocntp.hxx
@@ -30,11 +30,11 @@
class SvxHyperlinkNewDocTp : public SvxHyperlinkTabPageBase
{
private:
- RadioButton *m_pRbtEditNow;
- RadioButton *m_pRbtEditLater;
- SvxHyperURLBox *m_pCbbPath;
- PushButton *m_pBtCreate;
- ListBox *m_pLbDocTypes;
+ VclPtr<RadioButton> m_pRbtEditNow;
+ VclPtr<RadioButton> m_pRbtEditLater;
+ VclPtr<SvxHyperURLBox> m_pCbbPath;
+ VclPtr<PushButton> m_pBtCreate;
+ VclPtr<ListBox> m_pLbDocTypes;
bool ImplGetURLObject( const OUString& rPath, const OUString& rBase, INetURLObject& aURLObject ) const;
void FillDocumentList ();
@@ -52,8 +52,9 @@ protected:
public:
SvxHyperlinkNewDocTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet);
virtual ~SvxHyperlinkNewDocTp ();
+ virtual void dispose() SAL_OVERRIDE;
- static IconChoicePage* Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet );
+ static VclPtr<IconChoicePage> Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet );
virtual bool AskApply () SAL_OVERRIDE;
virtual void DoApply () SAL_OVERRIDE;
diff --git a/cui/source/inc/hldoctp.hxx b/cui/source/inc/hldoctp.hxx
index 1b7e3525840d..457cf1e0ea28 100644
--- a/cui/source/inc/hldoctp.hxx
+++ b/cui/source/inc/hldoctp.hxx
@@ -30,12 +30,12 @@
class SvxHyperlinkDocTp : public SvxHyperlinkTabPageBase
{
private:
- SvxHyperURLBox *m_pCbbPath;
- PushButton *m_pBtFileopen;
+ VclPtr<SvxHyperURLBox> m_pCbbPath;
+ VclPtr<PushButton> m_pBtFileopen;
- Edit *m_pEdTarget;
- FixedText *m_pFtFullURL;
- PushButton *m_pBtBrowse;
+ VclPtr<Edit> m_pEdTarget;
+ VclPtr<FixedText> m_pFtFullURL;
+ VclPtr<PushButton> m_pBtBrowse;
OUString maStrURL;
@@ -67,9 +67,10 @@ protected:
public:
SvxHyperlinkDocTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet);
- virtual ~SvxHyperlinkDocTp ();
+ virtual ~SvxHyperlinkDocTp();
+ virtual void dispose() SAL_OVERRIDE;
- static IconChoicePage* Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet );
+ static VclPtr<IconChoicePage> Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet );
virtual void SetMarkStr ( const OUString& aStrMark ) SAL_OVERRIDE;
diff --git a/cui/source/inc/hlinettp.hxx b/cui/source/inc/hlinettp.hxx
index e11b74456b32..99f60cdca909 100644
--- a/cui/source/inc/hlinettp.hxx
+++ b/cui/source/inc/hlinettp.hxx
@@ -32,15 +32,15 @@
class SvxHyperlinkInternetTp : public SvxHyperlinkTabPageBase
{
private:
- RadioButton *m_pRbtLinktypInternet;
- RadioButton *m_pRbtLinktypFTP;
- SvxHyperURLBox *m_pCbbTarget;
- PushButton *m_pBtBrowse;
- FixedText *m_pFtLogin;
- Edit *m_pEdLogin;
- FixedText *m_pFtPassword;
- Edit *m_pEdPassword;
- CheckBox *m_pCbAnonymous;
+ VclPtr<RadioButton > m_pRbtLinktypInternet;
+ VclPtr<RadioButton> m_pRbtLinktypFTP;
+ VclPtr<SvxHyperURLBox> m_pCbbTarget;
+ VclPtr<PushButton> m_pBtBrowse;
+ VclPtr<FixedText> m_pFtLogin;
+ VclPtr<Edit> m_pEdLogin;
+ VclPtr<FixedText> m_pFtPassword;
+ VclPtr<Edit> m_pEdPassword;
+ VclPtr<CheckBox> m_pCbAnonymous;
OUString maStrOldUser;
OUString maStrOldPassword;
@@ -78,9 +78,10 @@ protected:
public:
SvxHyperlinkInternetTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet);
- virtual ~SvxHyperlinkInternetTp ();
+ virtual ~SvxHyperlinkInternetTp();
+ virtual void dispose() SAL_OVERRIDE;
- static IconChoicePage* Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet );
+ static VclPtr<IconChoicePage> Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet );
virtual void SetMarkStr ( const OUString& aStrMark ) SAL_OVERRIDE;
diff --git a/cui/source/inc/hlmailtp.hxx b/cui/source/inc/hlmailtp.hxx
index 6f847976e16b..705a9a3a8fda 100644
--- a/cui/source/inc/hlmailtp.hxx
+++ b/cui/source/inc/hlmailtp.hxx
@@ -30,10 +30,10 @@
class SvxHyperlinkMailTp : public SvxHyperlinkTabPageBase
{
private:
- SvxHyperURLBox *m_pCbbReceiver;
- PushButton *m_pBtAdrBook;
- FixedText *m_pFtSubject;
- Edit *m_pEdSubject;
+ VclPtr<SvxHyperURLBox> m_pCbbReceiver;
+ VclPtr<PushButton> m_pBtAdrBook;
+ VclPtr<FixedText> m_pFtSubject;
+ VclPtr<Edit> m_pEdSubject;
DECL_LINK (ClickAdrBookHdl_Impl , void * ); ///< Button : Address book
DECL_LINK (ModifiedReceiverHdl_Impl, void * ); ///< Combobox "receiver" modified
@@ -51,9 +51,10 @@ protected:
public:
SvxHyperlinkMailTp ( vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet);
- virtual ~SvxHyperlinkMailTp ();
+ virtual ~SvxHyperlinkMailTp();
+ virtual void dispose() SAL_OVERRIDE;
- static IconChoicePage* Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet );
+ static VclPtr<IconChoicePage> Create( vcl::Window* pWindow, IconChoiceDialog* pDlg, const SfxItemSet& rItemSet );
virtual void SetInitFocus() SAL_OVERRIDE;
};
diff --git a/cui/source/inc/hlmarkwn.hxx b/cui/source/inc/hlmarkwn.hxx
index 2108beb587b4..9591a2a0f640 100644
--- a/cui/source/inc/hlmarkwn.hxx
+++ b/cui/source/inc/hlmarkwn.hxx
@@ -39,10 +39,12 @@ class SvxHlinkDlgMarkWnd;
class SvxHlmarkTreeLBox : public SvTreeListBox
{
private:
- SvxHlinkDlgMarkWnd* mpParentWnd;
+ VclPtr<SvxHlinkDlgMarkWnd> mpParentWnd;
public:
SvxHlmarkTreeLBox(vcl::Window* pParent, WinBits nStyle);
+ virtual ~SvxHlmarkTreeLBox();
+ virtual void dispose() SAL_OVERRIDE;
void SetParentWnd(SvxHlinkDlgMarkWnd* pParent)
{
@@ -62,13 +64,13 @@ class SvxHlinkDlgMarkWnd : public ModalDialog //FloatingWindow
private:
friend class SvxHlmarkTreeLBox;
- PushButton* mpBtApply;
- PushButton* mpBtClose;
- SvxHlmarkTreeLBox* mpLbTree;
+ VclPtr<PushButton> mpBtApply;
+ VclPtr<PushButton> mpBtClose;
+ VclPtr<SvxHlmarkTreeLBox> mpLbTree;
bool mbUserMoved;
- SvxHyperlinkTabPageBase* mpParent;
+ VclPtr<SvxHyperlinkTabPageBase> mpParent;
OUString maStrLastURL;
@@ -90,6 +92,7 @@ protected:
public:
SvxHlinkDlgMarkWnd (SvxHyperlinkTabPageBase *pParent);
virtual ~SvxHlinkDlgMarkWnd();
+ virtual void dispose() SAL_OVERRIDE;
bool MoveTo ( Point aNewPos );
void RefreshTree(const OUString& aStrURL);
diff --git a/cui/source/inc/hltpbase.hxx b/cui/source/inc/hltpbase.hxx
index f1df0e407056..d155d6e42de7 100644
--- a/cui/source/inc/hltpbase.hxx
+++ b/cui/source/inc/hltpbase.hxx
@@ -67,11 +67,11 @@ public:
class SvxHyperlinkTabPageBase : public IconChoicePage
{
private:
- ComboBox *mpCbbFrame;
- ListBox *mpLbForm;
- Edit *mpEdIndication;
- Edit *mpEdText;
- PushButton *mpBtScript;
+ VclPtr<ComboBox> mpCbbFrame;
+ VclPtr<ListBox> mpLbForm;
+ VclPtr<Edit> mpEdIndication;
+ VclPtr<Edit> mpEdText;
+ VclPtr<PushButton> mpBtScript;
bool mbIsCloseDisabled;
@@ -79,7 +79,7 @@ private:
mxDocumentFrame;
protected:
- vcl::Window* mpDialog;
+ VclPtr<vcl::Window> mpDialog;
bool mbStdControlsInit;
@@ -87,7 +87,7 @@ protected:
Timer maTimer;
- SvxHlinkDlgMarkWnd* mpMarkWnd;
+ VclPtr<SvxHlinkDlgMarkWnd> mpMarkWnd;
void InitStdControls ();
void FillStandardDlgFields ( const SvxHyperlinkItem* pHyperlinkItem );
@@ -118,6 +118,7 @@ public:
const SfxItemSet& rItemSet
);
virtual ~SvxHyperlinkTabPageBase ();
+ virtual void dispose() SAL_OVERRIDE;
void SetDocumentFrame(
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxDocumentFrame )
diff --git a/cui/source/inc/hyphen.hxx b/cui/source/inc/hyphen.hxx
index 4d0b7ba7c489..3bf97672b99b 100644
--- a/cui/source/inc/hyphen.hxx
+++ b/cui/source/inc/hyphen.hxx
@@ -42,14 +42,14 @@ protected:
class SvxHyphenWordDialog : public SfxModalDialog
{
- HyphenEdit* m_pWordEdit;
- PushButton* m_pLeftBtn;
- PushButton* m_pRightBtn;
- PushButton* m_pOkBtn;
- PushButton* m_pContBtn;
- PushButton* m_pDelBtn;
- PushButton* m_pHyphAll;
- CloseButton* m_pCloseBtn;
+ VclPtr<HyphenEdit> m_pWordEdit;
+ VclPtr<PushButton> m_pLeftBtn;
+ VclPtr<PushButton> m_pRightBtn;
+ VclPtr<PushButton> m_pOkBtn;
+ VclPtr<PushButton> m_pContBtn;
+ VclPtr<PushButton> m_pDelBtn;
+ VclPtr<PushButton> m_pHyphAll;
+ VclPtr<CloseButton> m_pCloseBtn;
OUString aLabel;
SvxSpellWrapper* pHyphWrapper;
css::uno::Reference< css::linguistic2::XHyphenator > xHyphenator;
@@ -86,6 +86,7 @@ public:
css::uno::Reference< css::linguistic2::XHyphenator > &xHyphen,
SvxSpellWrapper* pWrapper );
virtual ~SvxHyphenWordDialog();
+ virtual void dispose() SAL_OVERRIDE;
void SetWindowTitle( LanguageType nLang );
void SelLeft();
diff --git a/cui/source/inc/iconcdlg.hxx b/cui/source/inc/iconcdlg.hxx
index 8831eb65f3d0..74b686d17ca5 100644
--- a/cui/source/inc/iconcdlg.hxx
+++ b/cui/source/inc/iconcdlg.hxx
@@ -40,8 +40,8 @@ class IconChoiceDialog;
class IconChoicePage;
// Create-Function
-typedef IconChoicePage* (*CreatePage)(vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet &rAttrSet);
-typedef const sal_uInt16* (*GetPageRanges)(); // gives international Which-value
+typedef VclPtr<IconChoicePage> (*CreatePage)(vcl::Window *pParent, IconChoiceDialog* pDlg, const SfxItemSet &rAttrSet);
+typedef const sal_uInt16* (*GetPageRanges)(); // gives international Which-value
/// Data-structure for pages in dialog
struct IconChoicePageData
@@ -49,7 +49,7 @@ struct IconChoicePageData
sal_uInt16 nId;
CreatePage fnCreatePage; ///< pointer to the factory
GetPageRanges fnGetRanges; ///< pointer to the ranges-function
- IconChoicePage* pPage; ///< the TabPage itself
+ VclPtr<IconChoicePage> pPage; ///< the TabPage itself
bool bOnDemand; ///< Flag: ItemSet onDemand
bool bRefresh; ///< Flag: page has to be newly initialized
@@ -73,7 +73,7 @@ private :
const SfxItemSet* pSet;
OUString aUserString;
bool bHasExchangeSupport;
- IconChoiceDialog* pDialog;
+ VclPtr<IconChoiceDialog> pDialog;
void SetDialog( IconChoiceDialog* pNew ) { pDialog = pNew; }
IconChoiceDialog* GetDialog() const { return pDialog; }
@@ -85,11 +85,12 @@ private :
protected :
IconChoicePage( vcl::Window *pParent, const OString& rID, const OUString& rUIXMLDescription, const SfxItemSet &rAttrSet );
- sal_uInt16 GetSlot( sal_uInt16 nWhich ) const { return pSet->GetPool()->GetSlotId( nWhich ); }
- sal_uInt16 GetWhich( sal_uInt16 nSlot ) const { return pSet->GetPool()->GetWhich( nSlot ); }
+ sal_uInt16 GetSlot( sal_uInt16 nWhich ) const { return pSet->GetPool()->GetSlotId( nWhich ); }
+ sal_uInt16 GetWhich( sal_uInt16 nSlot ) const { return pSet->GetPool()->GetWhich( nSlot ); }
public :
- virtual ~IconChoicePage();
+ virtual ~IconChoicePage();
+ virtual void dispose() SAL_OVERRIDE;
const SfxItemSet& GetItemSet() const { return *pSet; }
@@ -125,18 +126,18 @@ private :
::std::vector< IconChoicePageData* > maPageList;
- SvtIconChoiceCtrl *m_pIconCtrl;
+ VclPtr<SvtIconChoiceCtrl> m_pIconCtrl;
sal_uInt16 mnCurrentPageId;
// Buttons
- OKButton *m_pOKBtn;
- PushButton *m_pApplyBtn;
- CancelButton *m_pCancelBtn;
- HelpButton *m_pHelpBtn;
- PushButton *m_pResetBtn;
+ VclPtr<OKButton> m_pOKBtn;
+ VclPtr<PushButton> m_pApplyBtn;
+ VclPtr<CancelButton> m_pCancelBtn;
+ VclPtr<HelpButton> m_pHelpBtn;
+ VclPtr<PushButton> m_pResetBtn;
- VclVBox *m_pTabContainer;
+ VclPtr<VclVBox> m_pTabContainer;
const SfxItemSet* pSet;
SfxItemSet* pOutSet;
SfxItemSet* pExampleSet;
@@ -167,7 +168,7 @@ protected :
SfxItemSet* CreateInputItemSet( sal_uInt16 nId );
inline SfxItemSet* GetInputSetImpl() { return const_cast<SfxItemSet*>(pSet); }
inline IconChoicePage* GetTabPage( sal_uInt16 nPageId )
- { return ( GetPageData (nPageId)->pPage?GetPageData (nPageId)->pPage:NULL); }
+ { return ( GetPageData (nPageId)->pPage?GetPageData (nPageId)->pPage.get():NULL); }
void RefreshInputSet();
void ActivatePageImpl ();
@@ -182,6 +183,7 @@ public :
IconChoiceDialog ( vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription,
const SfxItemSet * pItemSet = 0 );
virtual ~IconChoiceDialog ();
+ virtual void dispose() SAL_OVERRIDE;
// interface
SvxIconChoiceCtrlEntry* AddTabPage(
diff --git a/cui/source/inc/insdlg.hxx b/cui/source/inc/insdlg.hxx
index 5807c240b826..eda64bad3349 100644
--- a/cui/source/inc/insdlg.hxx
+++ b/cui/source/inc/insdlg.hxx
@@ -56,14 +56,14 @@ public:
class SvInsertOleDlg : public InsertObjectDialog_Impl
{
- RadioButton* m_pRbNewObject;
- RadioButton* m_pRbObjectFromfile;
- VclFrame* m_pObjectTypeFrame;
- ListBox* m_pLbObjecttype;
- VclFrame* m_pFileFrame;
- Edit* m_pEdFilepath;
- PushButton* m_pBtnFilepath;
- CheckBox* m_pCbFilelink;
+ VclPtr<RadioButton> m_pRbNewObject;
+ VclPtr<RadioButton> m_pRbObjectFromfile;
+ VclPtr<VclFrame> m_pObjectTypeFrame;
+ VclPtr<ListBox> m_pLbObjecttype;
+ VclPtr<VclFrame> m_pFileFrame;
+ VclPtr<Edit> m_pEdFilepath;
+ VclPtr<PushButton> m_pBtnFilepath;
+ VclPtr<CheckBox> m_pCbFilelink;
const SvObjectServerList* m_pServers;
::com::sun::star::uno::Sequence< sal_Int8 > m_aIconMetaFile;
@@ -86,6 +86,8 @@ public:
SvInsertOleDlg( vcl::Window* pParent,
const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage,
const SvObjectServerList* pServers = NULL );
+ virtual ~SvInsertOleDlg();
+ virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
/// get replacement for the iconified embedded object and the mediatype of the replacement
@@ -95,9 +97,9 @@ public:
class SvInsertPlugInDialog : public InsertObjectDialog_Impl
{
private:
- Edit* m_pEdFileurl;
- PushButton* m_pBtnFileurl;
- VclMultiLineEdit* m_pEdPluginsOptions;
+ VclPtr<Edit> m_pEdFileurl;
+ VclPtr<PushButton> m_pBtnFileurl;
+ VclPtr<VclMultiLineEdit> m_pEdPluginsOptions;
INetURLObject* m_pURL;
OUString m_aCommands;
@@ -109,29 +111,30 @@ public:
SvInsertPlugInDialog(vcl::Window* pParent,
const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage);
virtual ~SvInsertPlugInDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
};
class SfxInsertFloatingFrameDialog : public InsertObjectDialog_Impl
{
private:
- Edit* m_pEDName;
- Edit* m_pEDURL;
- PushButton* m_pBTOpen;
+ VclPtr<Edit> m_pEDName;
+ VclPtr<Edit> m_pEDURL;
+ VclPtr<PushButton> m_pBTOpen;
- RadioButton* m_pRBScrollingOn;
- RadioButton* m_pRBScrollingOff;
- RadioButton* m_pRBScrollingAuto;
+ VclPtr<RadioButton> m_pRBScrollingOn;
+ VclPtr<RadioButton> m_pRBScrollingOff;
+ VclPtr<RadioButton> m_pRBScrollingAuto;
- RadioButton* m_pRBFrameBorderOn;
- RadioButton* m_pRBFrameBorderOff;
+ VclPtr<RadioButton> m_pRBFrameBorderOn;
+ VclPtr<RadioButton> m_pRBFrameBorderOff;
- FixedText* m_pFTMarginWidth;
- NumericField* m_pNMMarginWidth;
- CheckBox* m_pCBMarginWidthDefault;
- FixedText* m_pFTMarginHeight;
- NumericField* m_pNMMarginHeight;
- CheckBox* m_pCBMarginHeightDefault;
+ VclPtr<FixedText> m_pFTMarginWidth;
+ VclPtr<NumericField> m_pNMMarginWidth;
+ VclPtr<CheckBox> m_pCBMarginWidthDefault;
+ VclPtr<FixedText> m_pFTMarginHeight;
+ VclPtr<NumericField> m_pNMMarginHeight;
+ VclPtr<CheckBox> m_pCBMarginHeightDefault;
DECL_STATIC_LINK(SfxInsertFloatingFrameDialog, OpenHdl, PushButton* );
DECL_STATIC_LINK(SfxInsertFloatingFrameDialog, CheckHdl, CheckBox* );
@@ -143,6 +146,8 @@ public:
const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage );
SfxInsertFloatingFrameDialog( vcl::Window* pParent,
const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >& xObj );
+ virtual ~SfxInsertFloatingFrameDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
};
diff --git a/cui/source/inc/insrc.hxx b/cui/source/inc/insrc.hxx
index a6e215e2ee49..0e66966be946 100644
--- a/cui/source/inc/insrc.hxx
+++ b/cui/source/inc/insrc.hxx
@@ -29,20 +29,22 @@
#include <vcl/group.hxx>
#include <vcl/button.hxx>
-class SvxInsRowColDlg : public SvxAbstractInsRowColDlg, public ModalDialog
+class SvxInsRowColDlg : public SvxAbstractInsRowColDlg
{
- NumericField* m_pCountEdit;
+ VclPtr<ModalDialog> m_pDialog;
+ VclPtr<NumericField> m_pCountEdit;
- RadioButton* m_pBeforeBtn;
- RadioButton* m_pAfterBtn;
+ VclPtr<RadioButton> m_pBeforeBtn;
+ VclPtr<RadioButton> m_pAfterBtn;
OUString aRow;
OUString aCol;
- bool bColumn;
+ bool bColumn;
public:
SvxInsRowColDlg( vcl::Window* pParent, bool bCol, const OString& sHelpId );
+ virtual ~SvxInsRowColDlg();
virtual short Execute() SAL_OVERRIDE;
diff --git a/cui/source/inc/labdlg.hxx b/cui/source/inc/labdlg.hxx
index 446499f28887..610c63b2f2f9 100644
--- a/cui/source/inc/labdlg.hxx
+++ b/cui/source/inc/labdlg.hxx
@@ -34,16 +34,16 @@ class SvxCaptionTabPage : public SfxTabPage
{
private:
static const sal_uInt16 pCaptionRanges[];
- ValueSet* m_pCT_CAPTTYPE;
- MetricField* m_pMF_ABSTAND;
- ListBox* m_pLB_ANSATZ;
- FixedText* m_pFT_UM;
- MetricField* m_pMF_ANSATZ;
- FixedText* m_pFT_ANSATZ_REL;
- ListBox* m_pLB_ANSATZ_REL;
- FixedText* m_pFT_LAENGE;
- MetricField* m_pMF_LAENGE;
- CheckBox* m_pCB_LAENGE;
+ VclPtr<ValueSet> m_pCT_CAPTTYPE;
+ VclPtr<MetricField> m_pMF_ABSTAND;
+ VclPtr<ListBox> m_pLB_ANSATZ;
+ VclPtr<FixedText> m_pFT_UM;
+ VclPtr<MetricField> m_pMF_ANSATZ;
+ VclPtr<FixedText> m_pFT_ANSATZ_REL;
+ VclPtr<ListBox> m_pLB_ANSATZ_REL;
+ VclPtr<FixedText> m_pFT_LAENGE;
+ VclPtr<MetricField> m_pMF_LAENGE;
+ VclPtr<CheckBox> m_pCB_LAENGE;
Image m_aBmpCapTypes[CAPTYPE_BITMAPS_COUNT];
@@ -75,8 +75,10 @@ private:
public:
SvxCaptionTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ virtual ~SvxCaptionTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
static const sal_uInt16* GetRanges() { return pCaptionRanges; }
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
diff --git a/cui/source/inc/linkdlg.hxx b/cui/source/inc/linkdlg.hxx
index 89491007d919..7e953fcd747e 100644
--- a/cui/source/inc/linkdlg.hxx
+++ b/cui/source/inc/linkdlg.hxx
@@ -44,16 +44,16 @@ class SvBaseLinksDlg : public ModalDialog
{
using Window::SetType;
- SvTabListBox *m_pTbLinks;
- FixedText *m_pFtFullFileName;
- FixedText *m_pFtFullSourceName;
- FixedText *m_pFtFullTypeName;
- RadioButton *m_pRbAutomatic;
- RadioButton *m_pRbManual;
- PushButton *m_pPbUpdateNow;
- PushButton *m_pPbOpenSource;
- PushButton *m_pPbChangeSource;
- PushButton *m_pPbBreakLink;
+ VclPtr<SvTabListBox> m_pTbLinks;
+ VclPtr<FixedText> m_pFtFullFileName;
+ VclPtr<FixedText> m_pFtFullSourceName;
+ VclPtr<FixedText> m_pFtFullTypeName;
+ VclPtr<RadioButton> m_pRbAutomatic;
+ VclPtr<RadioButton> m_pRbManual;
+ VclPtr<PushButton> m_pPbUpdateNow;
+ VclPtr<PushButton> m_pPbOpenSource;
+ VclPtr<PushButton> m_pPbChangeSource;
+ VclPtr<PushButton> m_pPbBreakLink;
OUString aStrAutolink;
OUString aStrManuallink;
OUString aStrBrokenlink;
@@ -96,6 +96,7 @@ class SvBaseLinksDlg : public ModalDialog
public:
SvBaseLinksDlg( vcl::Window * pParent, sfx2::LinkManager*, bool bHtml = false );
virtual ~SvBaseLinksDlg();
+ virtual void dispose() SAL_OVERRIDE;
void SetActLink( sfx2::SvBaseLink * pLink );
};
diff --git a/cui/source/inc/macroass.hxx b/cui/source/inc/macroass.hxx
index c0e4fd66492b..696c8bf55711 100644
--- a/cui/source/inc/macroass.hxx
+++ b/cui/source/inc/macroass.hxx
@@ -57,6 +57,7 @@ protected:
public:
virtual ~_SfxMacroTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void AddEvent( const OUString & rEventName, sal_uInt16 nEventId );
@@ -96,7 +97,7 @@ public:
);
// --------- inherit from the base -------------
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
};
class SfxMacroAssignDlg : public SfxSingleTabDialog
diff --git a/cui/source/inc/macropg.hxx b/cui/source/inc/macropg.hxx
index c1cded175f5e..befe9e3607f9 100644
--- a/cui/source/inc/macropg.hxx
+++ b/cui/source/inc/macropg.hxx
@@ -82,6 +82,7 @@ protected:
public:
virtual ~_SvxMacroTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void InitResources();
void InitAndSetHandler( ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > xAppEvents, ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > xDocEvents, ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifiable > xModifiable );
diff --git a/cui/source/inc/measure.hxx b/cui/source/inc/measure.hxx
index aadc276d3641..28dbdfdc7c28 100644
--- a/cui/source/inc/measure.hxx
+++ b/cui/source/inc/measure.hxx
@@ -33,23 +33,23 @@ class SvxMeasurePage : public SvxTabPage
private:
static const sal_uInt16 pRanges[];
- MetricField* m_pMtrFldLineDist;
- MetricField* m_pMtrFldHelplineOverhang;
- MetricField* m_pMtrFldHelplineDist;
- MetricField* m_pMtrFldHelpline1Len;
- MetricField* m_pMtrFldHelpline2Len;
- TriStateBox* m_pTsbBelowRefEdge;
- MetricField* m_pMtrFldDecimalPlaces;
-
- SvxRectCtl* m_pCtlPosition;
- TriStateBox* m_pTsbAutoPosV;
- TriStateBox* m_pTsbAutoPosH;
- TriStateBox* m_pTsbShowUnit;
- ListBox* m_pLbUnit;
- TriStateBox* m_pTsbParallel;
- FixedText* m_pFtAutomatic;
-
- SvxXMeasurePreview* m_pCtlPreview;
+ VclPtr<MetricField> m_pMtrFldLineDist;
+ VclPtr<MetricField> m_pMtrFldHelplineOverhang;
+ VclPtr<MetricField> m_pMtrFldHelplineDist;
+ VclPtr<MetricField> m_pMtrFldHelpline1Len;
+ VclPtr<MetricField> m_pMtrFldHelpline2Len;
+ VclPtr<TriStateBox> m_pTsbBelowRefEdge;
+ VclPtr<MetricField> m_pMtrFldDecimalPlaces;
+
+ VclPtr<SvxRectCtl> m_pCtlPosition;
+ VclPtr<TriStateBox> m_pTsbAutoPosV;
+ VclPtr<TriStateBox> m_pTsbAutoPosH;
+ VclPtr<TriStateBox> m_pTsbShowUnit;
+ VclPtr<ListBox> m_pLbUnit;
+ VclPtr<TriStateBox> m_pTsbParallel;
+ VclPtr<FixedText> m_pFtAutomatic;
+
+ VclPtr<SvxXMeasurePreview> m_pCtlPreview;
const SfxItemSet& rOutAttrs;
SfxItemSet aAttrSet;
@@ -67,8 +67,9 @@ public:
SvxMeasurePage( vcl::Window* pWindow, const SfxItemSet& rInAttrs );
virtual ~SvxMeasurePage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
static const sal_uInt16* GetRanges() { return pRanges; }
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
diff --git a/cui/source/inc/multipat.hxx b/cui/source/inc/multipat.hxx
index 0508ff40aba1..ecc1395f6cad 100644
--- a/cui/source/inc/multipat.hxx
+++ b/cui/source/inc/multipat.hxx
@@ -39,9 +39,9 @@
class SvxMultiPathDialog : public ModalDialog
{
private:
- svx::SvxRadioButtonListBox* m_pRadioLB;
- PushButton* m_pAddBtn;
- PushButton* m_pDelBtn;
+ VclPtr<svx::SvxRadioButtonListBox> m_pRadioLB;
+ VclPtr<PushButton> m_pAddBtn;
+ VclPtr<PushButton> m_pDelBtn;
DECL_LINK(AddHdl_Impl, void *);
DECL_LINK(DelHdl_Impl, void *);
@@ -51,6 +51,7 @@ private:
public:
SvxMultiPathDialog(vcl::Window* pParent);
virtual ~SvxMultiPathDialog();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetPath() const;
void SetPath( const OUString& rPath );
@@ -59,9 +60,9 @@ public:
class SvxPathSelectDialog : public ModalDialog
{
private:
- ListBox* m_pPathLB;
- PushButton* m_pAddBtn;
- PushButton* m_pDelBtn;
+ VclPtr<ListBox> m_pPathLB;
+ VclPtr<PushButton> m_pAddBtn;
+ VclPtr<PushButton> m_pDelBtn;
DECL_LINK(AddHdl_Impl, void *);
DECL_LINK(DelHdl_Impl, void *);
@@ -70,6 +71,7 @@ private:
public:
SvxPathSelectDialog(vcl::Window* pParent);
virtual ~SvxPathSelectDialog();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetPath() const;
void SetPath( const OUString& rPath );
diff --git a/cui/source/inc/newtabledlg.hxx b/cui/source/inc/newtabledlg.hxx
index 109d62f1509e..394d04265344 100644
--- a/cui/source/inc/newtabledlg.hxx
+++ b/cui/source/inc/newtabledlg.hxx
@@ -26,14 +26,16 @@
#include <svx/stddlg.hxx>
#include <svx/svxdlg.hxx>
-class SvxNewTableDialog : public SvxAbstractNewTableDialog, public ModalDialog
+class SvxNewTableDialog : public SvxAbstractNewTableDialog
{
private:
- NumericField* mpNumColumns;
- NumericField* mpNumRows;
+ VclPtr<ModalDialog> m_pDialog;
+ VclPtr<NumericField> mpNumColumns;
+ VclPtr<NumericField> mpNumRows;
public:
SvxNewTableDialog( vcl::Window* pWindow );
+ virtual ~SvxNewTableDialog();
virtual short Execute() SAL_OVERRIDE;
diff --git a/cui/source/inc/numfmt.hxx b/cui/source/inc/numfmt.hxx
index 9a6172a5a753..e2fa378794a2 100644
--- a/cui/source/inc/numfmt.hxx
+++ b/cui/source/inc/numfmt.hxx
@@ -70,8 +70,9 @@ class SvxNumberFormatTabPage : public SfxTabPage
public:
virtual ~SvxNumberFormatTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet );
// Returns area information.
static const sal_uInt16* GetRanges() { return pRanges; }
@@ -91,31 +92,31 @@ public:
private:
SvxNumberFormatTabPage( vcl::Window* pParent,
const SfxItemSet& rCoreAttrs );
- FixedText* m_pFtCategory;
- ListBox* m_pLbCategory;
- FixedText* m_pFtFormat;
- ListBox* m_pLbCurrency;
- SvxFontListBox* m_pLbFormat;
- FixedText* m_pFtLanguage;
- SvxLanguageBox* m_pLbLanguage;
- CheckBox* m_pCbSourceFormat;
- SvxNumberPreview* m_pWndPreview;
- FixedText* m_pFtOptions;
- FixedText* m_pFtDecimals;
- NumericField* m_pEdDecimals;
- CheckBox* m_pBtnNegRed;
- FixedText* m_pFtLeadZeroes;
- NumericField* m_pEdLeadZeroes;
- CheckBox* m_pBtnThousand;
-
- VclContainer* m_pFormatCodeFrame;
- Edit* m_pEdFormat;
- PushButton* m_pIbAdd;
- PushButton* m_pIbInfo;
- PushButton* m_pIbRemove;
-
- FixedText* m_pFtComment;
- Edit* m_pEdComment;
+ VclPtr<FixedText> m_pFtCategory;
+ VclPtr<ListBox> m_pLbCategory;
+ VclPtr<FixedText> m_pFtFormat;
+ VclPtr<ListBox> m_pLbCurrency;
+ VclPtr<SvxFontListBox> m_pLbFormat;
+ VclPtr<FixedText> m_pFtLanguage;
+ VclPtr<SvxLanguageBox> m_pLbLanguage;
+ VclPtr<CheckBox> m_pCbSourceFormat;
+ VclPtr<SvxNumberPreview> m_pWndPreview;
+ VclPtr<FixedText> m_pFtOptions;
+ VclPtr<FixedText> m_pFtDecimals;
+ VclPtr<NumericField> m_pEdDecimals;
+ VclPtr<CheckBox> m_pBtnNegRed;
+ VclPtr<FixedText> m_pFtLeadZeroes;
+ VclPtr<NumericField> m_pEdLeadZeroes;
+ VclPtr<CheckBox> m_pBtnThousand;
+
+ VclPtr<VclContainer> m_pFormatCodeFrame;
+ VclPtr<Edit> m_pEdFormat;
+ VclPtr<PushButton> m_pIbAdd;
+ VclPtr<PushButton> m_pIbInfo;
+ VclPtr<PushButton> m_pIbRemove;
+
+ VclPtr<FixedText> m_pFtComment;
+ VclPtr<Edit> m_pEdComment;
Timer aResetWinTimer;
@@ -130,7 +131,7 @@ private:
OUString sAutomaticEntry;
- vcl::Window* pLastActivWindow;
+ VclPtr<vcl::Window> pLastActivWindow;
void Init_Impl();
void FillCurrencyBox();
@@ -145,11 +146,11 @@ private:
void ChangePreviewText( sal_uInt16 nPos );
void AddAutomaticLanguage_Impl(LanguageType eAutoLang, bool bSelect);
// Handler
- DECL_LINK( LostFocusHdl_Impl, Edit* pEd );
- DECL_LINK( DoubleClickHdl_Impl, SvxFontListBox* pLb );
+ DECL_LINK( LostFocusHdl_Impl, Edit* );
+ DECL_LINK( DoubleClickHdl_Impl, SvxFontListBox* );
DECL_LINK( SelFormatHdl_Impl, void * );
- DECL_LINK( ClickHdl_Impl, PushButton* pIB );
- DECL_LINK( EditHdl_Impl, Edit* pEdFormat );
+ DECL_LINK( ClickHdl_Impl, PushButton* );
+ DECL_LINK( EditHdl_Impl, Edit* );
DECL_LINK( OptHdl_Impl, void * );
DECL_LINK(TimeHdl_Impl, void *);
};
diff --git a/cui/source/inc/numpages.hxx b/cui/source/inc/numpages.hxx
index 739249fbde20..108f9e3bea39 100644
--- a/cui/source/inc/numpages.hxx
+++ b/cui/source/inc/numpages.hxx
@@ -90,7 +90,7 @@ class SvxSingleNumPickTabPage : public SfxTabPage
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
- SvxNumValueSet* m_pExamplesVS;
+ VclPtr<SvxNumValueSet> m_pExamplesVS;
SvxNumSettingsArr_Impl aNumSettingsArr;
SvxNumRule* pActNum;
SvxNumRule* pSaveNum;
@@ -101,16 +101,17 @@ class SvxSingleNumPickTabPage : public SfxTabPage
OUString sNumCharFmtName;
sal_uInt16 nNumItemId;
- protected:
+protected:
DECL_LINK(NumSelectHdl_Impl, void *);
DECL_LINK(DoubleClickHdl_Impl, void *);
- public:
+public:
SvxSingleNumPickTabPage(vcl::Window* pParent,
const SfxItemSet& rSet);
- virtual ~SvxSingleNumPickTabPage();
+ virtual ~SvxSingleNumPickTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet);
virtual void ActivatePage(const SfxItemSet& rSet) SAL_OVERRIDE;
@@ -129,7 +130,7 @@ class SvxBulletPickTabPage : public SfxTabPage
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
- SvxNumValueSet* m_pExamplesVS;
+ VclPtr<SvxNumValueSet> m_pExamplesVS;
SvxNumRule* pActNum;
SvxNumRule* pSaveNum;
sal_uInt16 nActNumLvl;
@@ -138,15 +139,16 @@ class SvxBulletPickTabPage : public SfxTabPage
sal_uInt16 nNumItemId;
OUString sBulletCharFmtName;
- protected:
+protected:
DECL_LINK(NumSelectHdl_Impl, void *);
DECL_LINK(DoubleClickHdl_Impl, void *);
- public:
+public:
SvxBulletPickTabPage(vcl::Window* pParent,
const SfxItemSet& rSet);
- virtual ~SvxBulletPickTabPage();
+ virtual ~SvxBulletPickTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet);
virtual void ActivatePage(const SfxItemSet& rSet) SAL_OVERRIDE;
@@ -166,7 +168,7 @@ class SvxNumPickTabPage : public SfxTabPage
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
- SvxNumValueSet* m_pExamplesVS;
+ VclPtr<SvxNumValueSet> m_pExamplesVS;
OUString sNumCharFmtName;
OUString sBulletCharFmtName;
@@ -180,16 +182,17 @@ class SvxNumPickTabPage : public SfxTabPage
bool bPreset : 1;
- protected:
+protected:
DECL_LINK(NumSelectHdl_Impl, void *);
DECL_LINK(DoubleClickHdl_Impl, void *);
- public:
- SvxNumPickTabPage(vcl::Window* pParent,
+public:
+ SvxNumPickTabPage(vcl::Window* pParent,
const SfxItemSet& rSet);
- virtual ~SvxNumPickTabPage();
+ virtual ~SvxNumPickTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet);
virtual void ActivatePage(const SfxItemSet& rSet) SAL_OVERRIDE;
@@ -210,8 +213,8 @@ class SvxBitmapPickTabPage : public SfxTabPage
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
- FixedText* m_pErrorText;
- SvxBmpNumValueSet* m_pExamplesVS;
+ VclPtr<FixedText> m_pErrorText;
+ VclPtr<SvxBmpNumValueSet> m_pExamplesVS;
std::vector<OUString> aGrfNames;
OUString sNumCharFmtName;
@@ -224,17 +227,18 @@ class SvxBitmapPickTabPage : public SfxTabPage
bool bModified : 1;
bool bPreset : 1;
- protected:
+protected:
DECL_LINK(NumSelectHdl_Impl, void *);
DECL_LINK(DoubleClickHdl_Impl, void *);
DECL_LINK(LinkBmpHdl_Impl, void *);
- public:
+public:
SvxBitmapPickTabPage(vcl::Window* pParent,
const SfxItemSet& rSet);
virtual ~SvxBitmapPickTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet);
virtual void ActivatePage(const SfxItemSet& rSet) SAL_OVERRIDE;
@@ -251,44 +255,44 @@ class SvxNumOptionsTabPage : public SfxTabPage
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
- ListBox* m_pLevelLB;
-
- ListBox* m_pFmtLB;
-
- FixedText* m_pSeparatorFT;
- FixedText* m_pPrefixFT;
- Edit* m_pPrefixED;
- FixedText* m_pSuffixFT;
- Edit* m_pSuffixED;
- FixedText* m_pCharFmtFT;
- ListBox* m_pCharFmtLB;
- FixedText* m_pBulColorFT;
- ColorListBox* m_pBulColLB;
- FixedText* m_pBulRelSizeFT;
- MetricField* m_pBulRelSizeMF;
- FixedText* m_pAllLevelFT;
- NumericField* m_pAllLevelNF;
- FixedText* m_pStartFT;
- NumericField* m_pStartED;
- FixedText* m_pBulletFT;
- PushButton* m_pBulletPB;
- FixedText* m_pAlignFT;
- ListBox* m_pAlignLB;
- FixedText* m_pBitmapFT;
- MenuButton* m_pBitmapMB;
+ VclPtr<ListBox> m_pLevelLB;
+
+ VclPtr<ListBox> m_pFmtLB;
+
+ VclPtr<FixedText> m_pSeparatorFT;
+ VclPtr<FixedText> m_pPrefixFT;
+ VclPtr<Edit> m_pPrefixED;
+ VclPtr<FixedText> m_pSuffixFT;
+ VclPtr<Edit> m_pSuffixED;
+ VclPtr<FixedText> m_pCharFmtFT;
+ VclPtr<ListBox> m_pCharFmtLB;
+ VclPtr<FixedText> m_pBulColorFT;
+ VclPtr<ColorListBox> m_pBulColLB;
+ VclPtr<FixedText> m_pBulRelSizeFT;
+ VclPtr<MetricField> m_pBulRelSizeMF;
+ VclPtr<FixedText> m_pAllLevelFT;
+ VclPtr<NumericField> m_pAllLevelNF;
+ VclPtr<FixedText> m_pStartFT;
+ VclPtr<NumericField> m_pStartED;
+ VclPtr<FixedText> m_pBulletFT;
+ VclPtr<PushButton> m_pBulletPB;
+ VclPtr<FixedText> m_pAlignFT;
+ VclPtr<ListBox> m_pAlignLB;
+ VclPtr<FixedText> m_pBitmapFT;
+ VclPtr<MenuButton> m_pBitmapMB;
sal_uInt16 m_nGalleryId;
- FixedText* m_pWidthFT;
- MetricField* m_pWidthMF;
- FixedText* m_pHeightFT;
- MetricField* m_pHeightMF;
- CheckBox* m_pRatioCB;
- FixedText* m_pOrientFT;
- ListBox* m_pOrientLB;
+ VclPtr<FixedText> m_pWidthFT;
+ VclPtr<MetricField> m_pWidthMF;
+ VclPtr<FixedText> m_pHeightFT;
+ VclPtr<MetricField> m_pHeightMF;
+ VclPtr<CheckBox> m_pRatioCB;
+ VclPtr<FixedText> m_pOrientFT;
+ VclPtr<ListBox> m_pOrientLB;
- VclContainer* m_pAllLevelsFrame;
- CheckBox* m_pSameLevelCB;
+ VclPtr<VclContainer> m_pAllLevelsFrame;
+ VclPtr<CheckBox> m_pSameLevelCB;
- SvxNumberingPreview* m_pPreviewWIN;
+ VclPtr<SvxNumberingPreview> m_pPreviewWIN;
OUString m_sNumCharFmtName;
OUString m_sBulletCharFmtName;
@@ -341,12 +345,13 @@ class SvxNumOptionsTabPage : public SfxTabPage
DECL_STATIC_LINK( SvxNumOptionsTabPage, GraphicArrivedHdl_Impl, SvxBrushItem* );
- public:
+public:
SvxNumOptionsTabPage(vcl::Window* pParent,
const SfxItemSet& rSet);
virtual ~SvxNumOptionsTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet);
virtual void ActivatePage(const SfxItemSet& rSet) SAL_OVERRIDE;
@@ -385,36 +390,36 @@ class SvxNumPositionTabPage : public SfxTabPage
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
- ListBox* m_pLevelLB;
+ VclPtr<ListBox> m_pLevelLB;
// former set of controls shown for numbering rules containing list level
// attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_WIDTH_AND_POSITION
- FixedText* m_pDistBorderFT;
- MetricField* m_pDistBorderMF;
- CheckBox* m_pRelativeCB;
- FixedText* m_pIndentFT;
- MetricField* m_pIndentMF;
- FixedText* m_pDistNumFT;
- MetricField* m_pDistNumMF;
- FixedText* m_pAlignFT;
- ListBox* m_pAlignLB;
+ VclPtr<FixedText> m_pDistBorderFT;
+ VclPtr<MetricField> m_pDistBorderMF;
+ VclPtr<CheckBox> m_pRelativeCB;
+ VclPtr<FixedText> m_pIndentFT;
+ VclPtr<MetricField> m_pIndentMF;
+ VclPtr<FixedText> m_pDistNumFT;
+ VclPtr<MetricField> m_pDistNumMF;
+ VclPtr<FixedText> m_pAlignFT;
+ VclPtr<ListBox> m_pAlignLB;
// new set of controls shown for numbering rules containing list level
// attributes in SvxNumberFormat::SvxNumPositionAndSpaceMode == LABEL_ALIGNMENT
- FixedText* m_pLabelFollowedByFT;
- ListBox* m_pLabelFollowedByLB;
- FixedText* m_pListtabFT;
- MetricField* m_pListtabMF;
- FixedText* m_pAlign2FT;
- ListBox* m_pAlign2LB;
- FixedText* m_pAlignedAtFT;
- MetricField* m_pAlignedAtMF;
- FixedText* m_pIndentAtFT;
- MetricField* m_pIndentAtMF;
+ VclPtr<FixedText> m_pLabelFollowedByFT;
+ VclPtr<ListBox> m_pLabelFollowedByLB;
+ VclPtr<FixedText> m_pListtabFT;
+ VclPtr<MetricField> m_pListtabMF;
+ VclPtr<FixedText> m_pAlign2FT;
+ VclPtr<ListBox> m_pAlign2LB;
+ VclPtr<FixedText> m_pAlignedAtFT;
+ VclPtr<MetricField> m_pAlignedAtMF;
+ VclPtr<FixedText> m_pIndentAtFT;
+ VclPtr<MetricField> m_pIndentAtMF;
- PushButton* m_pStandardPB;
+ VclPtr<PushButton> m_pStandardPB;
- SvxNumberingPreview* m_pPreviewWIN;
+ VclPtr<SvxNumberingPreview> m_pPreviewWIN;
SvxNumRule* pActNum;
SvxNumRule* pSaveNum;
@@ -448,13 +453,14 @@ public:
SvxNumPositionTabPage(vcl::Window* pParent,
const SfxItemSet& rSet);
virtual ~SvxNumPositionTabPage();
+ virtual void dispose() SAL_OVERRIDE;
virtual void ActivatePage(const SfxItemSet& rSet) SAL_OVERRIDE;
virtual sfxpg DeactivatePage(SfxItemSet *pSet) SAL_OVERRIDE;
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet);
void SetMetric(FieldUnit eSet);
diff --git a/cui/source/inc/optasian.hxx b/cui/source/inc/optasian.hxx
index d2d182420783..39d18ef48976 100644
--- a/cui/source/inc/optasian.hxx
+++ b/cui/source/inc/optasian.hxx
@@ -29,22 +29,22 @@
struct SvxAsianLayoutPage_Impl;
class SvxAsianLayoutPage : public SfxTabPage
{
- RadioButton* m_pCharKerningRB;
- RadioButton* m_pCharPunctKerningRB;
+ VclPtr<RadioButton> m_pCharKerningRB;
+ VclPtr<RadioButton> m_pCharPunctKerningRB;
- RadioButton* m_pNoCompressionRB;
- RadioButton* m_pPunctCompressionRB;
- RadioButton* m_pPunctKanaCompressionRB;
+ VclPtr<RadioButton> m_pNoCompressionRB;
+ VclPtr<RadioButton> m_pPunctCompressionRB;
+ VclPtr<RadioButton> m_pPunctKanaCompressionRB;
- FixedText* m_pLanguageFT;
- SvxLanguageBox* m_pLanguageLB;
- CheckBox* m_pStandardCB;
+ VclPtr<FixedText> m_pLanguageFT;
+ VclPtr<SvxLanguageBox> m_pLanguageLB;
+ VclPtr<CheckBox> m_pStandardCB;
- FixedText* m_pStartFT;
- Edit* m_pStartED;
- FixedText* m_pEndFT;
- Edit* m_pEndED;
- FixedText* m_pHintFT;
+ VclPtr<FixedText> m_pStartFT;
+ VclPtr<Edit> m_pStartED;
+ VclPtr<FixedText> m_pEndFT;
+ VclPtr<Edit> m_pEndED;
+ VclPtr<FixedText> m_pHintFT;
SvxAsianLayoutPage_Impl* pImpl;
@@ -52,12 +52,12 @@ class SvxAsianLayoutPage : public SfxTabPage
DECL_LINK(ChangeStandardHdl, CheckBox*);
DECL_LINK(ModifyHdl, Edit*);
- SvxAsianLayoutPage( vcl::Window* pParent, const SfxItemSet& rSet );
public:
-
+ SvxAsianLayoutPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxAsianLayoutPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
static const sal_uInt16* GetRanges();
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
diff --git a/cui/source/inc/optdict.hxx b/cui/source/inc/optdict.hxx
index e26a4b37f253..3bdffc3f0edd 100644
--- a/cui/source/inc/optdict.hxx
+++ b/cui/source/inc/optdict.hxx
@@ -50,10 +50,10 @@ namespace linguistic2{
class SvxNewDictionaryDialog : public ModalDialog
{
private:
- Edit* pNameEdit;
- SvxLanguageBox* pLanguageLB;
- CheckBox* pExceptBtn;
- OKButton* pOKBtn;
+ VclPtr<Edit> pNameEdit;
+ VclPtr<SvxLanguageBox> pLanguageLB;
+ VclPtr<CheckBox> pExceptBtn;
+ VclPtr<OKButton> pOKBtn;
::com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XSpellChecker1 > xSpell;
::com::sun::star::uno::Reference<
@@ -66,6 +66,8 @@ public:
SvxNewDictionaryDialog( vcl::Window* pParent,
::com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XSpellChecker1 > &xSpl );
+ virtual ~SvxNewDictionaryDialog();
+ virtual void dispose() SAL_OVERRIDE;
::com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XDictionary >
@@ -100,16 +102,16 @@ class SvxEditDictionaryDialog : public ModalDialog
{
private:
- ListBox* pAllDictsLB;
- FixedText* pLangFT;
- SvxLanguageBox* pLangLB;
+ VclPtr<ListBox> pAllDictsLB;
+ VclPtr<FixedText> pLangFT;
+ VclPtr<SvxLanguageBox> pLangLB;
- SvxDictEdit* pWordED;
- FixedText* pReplaceFT;
- SvxDictEdit* pReplaceED;
- SvTabListBox* pWordsLB;
- PushButton* pNewReplacePB;
- PushButton* pDeletePB;
+ VclPtr<SvxDictEdit> pWordED;
+ VclPtr<FixedText> pReplaceFT;
+ VclPtr<SvxDictEdit> pReplaceED;
+ VclPtr<SvTabListBox> pWordsLB;
+ VclPtr<PushButton> pNewReplacePB;
+ VclPtr<PushButton> pDeletePB;
OUString sModify;
OUString sNew;
@@ -153,6 +155,7 @@ public:
::com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XSpellChecker1> &xSpl );
virtual ~SvxEditDictionaryDialog();
+ virtual void dispose() SAL_OVERRIDE;
sal_uInt16 GetSelectedDict() {return pAllDictsLB->GetSelectEntryPos();}
};
diff --git a/cui/source/inc/optlingu.hxx b/cui/source/inc/optlingu.hxx
index 8529393a14a0..f99e3bb7ba46 100644
--- a/cui/source/inc/optlingu.hxx
+++ b/cui/source/inc/optlingu.hxx
@@ -52,15 +52,15 @@ class SvxLinguData_Impl;
class SvxEditModulesDlg : public ModalDialog
{
- SvxLanguageBox* m_pLanguageLB;
+ VclPtr<SvxLanguageBox> m_pLanguageLB;
- SvxCheckListBox* m_pModulesCLB;
- PushButton* m_pPrioUpPB;
- PushButton* m_pPrioDownPB;
- PushButton* m_pBackPB;
- FixedHyperlink* m_pMoreDictsLink;
+ VclPtr<SvxCheckListBox> m_pModulesCLB;
+ VclPtr<PushButton> m_pPrioUpPB;
+ VclPtr<PushButton> m_pPrioDownPB;
+ VclPtr<PushButton> m_pBackPB;
+ VclPtr<FixedHyperlink> m_pMoreDictsLink;
- CloseButton* m_pClosePB;
+ VclPtr<CloseButton> m_pClosePB;
OUString sSpell;
OUString sHyph;
@@ -86,6 +86,7 @@ class SvxEditModulesDlg : public ModalDialog
public:
SvxEditModulesDlg(vcl::Window* pParent, SvxLinguData_Impl& rData);
virtual ~SvxEditModulesDlg();
+ virtual void dispose() SAL_OVERRIDE;
};
// class SvxLinguTabPage -------------------------------------------------
@@ -93,17 +94,17 @@ public:
class SvxLinguTabPage : public SfxTabPage
{
private:
- FixedText* m_pLinguModulesFT;
- SvxCheckListBox* m_pLinguModulesCLB;
- PushButton* m_pLinguModulesEditPB;
- FixedText* m_pLinguDicsFT;
- SvxCheckListBox* m_pLinguDicsCLB;
- PushButton* m_pLinguDicsNewPB;
- PushButton* m_pLinguDicsEditPB;
- PushButton* m_pLinguDicsDelPB;
- SvxCheckListBox* m_pLinguOptionsCLB;
- PushButton* m_pLinguOptionsEditPB;
- FixedHyperlink* m_pMoreDictsLink;
+ VclPtr<FixedText> m_pLinguModulesFT;
+ VclPtr<SvxCheckListBox> m_pLinguModulesCLB;
+ VclPtr<PushButton> m_pLinguModulesEditPB;
+ VclPtr<FixedText> m_pLinguDicsFT;
+ VclPtr<SvxCheckListBox> m_pLinguDicsCLB;
+ VclPtr<PushButton> m_pLinguDicsNewPB;
+ VclPtr<PushButton> m_pLinguDicsEditPB;
+ VclPtr<PushButton> m_pLinguDicsDelPB;
+ VclPtr<SvxCheckListBox> m_pLinguOptionsCLB;
+ VclPtr<PushButton> m_pLinguOptionsEditPB;
+ VclPtr<FixedHyperlink> m_pMoreDictsLink;
OUString sCapitalWords;
OUString sWordsWithDigits;
@@ -147,7 +148,8 @@ private:
public:
virtual ~SvxLinguTabPage();
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
diff --git a/cui/source/inc/optpath.hxx b/cui/source/inc/optpath.hxx
index 8db65294ce6d..df078cec88b8 100644
--- a/cui/source/inc/optpath.hxx
+++ b/cui/source/inc/optpath.hxx
@@ -42,11 +42,11 @@ class SvxPathTabPage;
class SvxPathTabPage : public SfxTabPage
{
private:
- SvSimpleTableContainer* m_pPathCtrl;
- PushButton* m_pStandardBtn;
- PushButton* m_pPathBtn;
+ VclPtr<SvSimpleTableContainer> m_pPathCtrl;
+ VclPtr<PushButton> m_pStandardBtn;
+ VclPtr<PushButton> m_pPathBtn;
- ::svx::OptHeaderTabListBox* pPathBox;
+ VclPtr<::svx::OptHeaderTabListBox> pPathBox;
OptPath_Impl* pImpl;
::com::sun::star::uno::Reference< ::svt::DialogClosedListener > xDialogListener;
@@ -71,8 +71,9 @@ private:
public:
SvxPathTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxPathTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
static const sal_uInt16* GetRanges();
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
diff --git a/cui/source/inc/page.hxx b/cui/source/inc/page.hxx
index 90dadaea13e8..f68bf339bab7 100644
--- a/cui/source/inc/page.hxx
+++ b/cui/source/inc/page.hxx
@@ -75,53 +75,53 @@ class SvxPageDescPage : public SfxTabPage
static const sal_uInt16 pRanges[];
private:
// paper format
- ListBox* m_pPaperSizeBox;
+ VclPtr<ListBox> m_pPaperSizeBox;
- MetricField* m_pPaperWidthEdit;
- MetricField* m_pPaperHeightEdit;
+ VclPtr<MetricField> m_pPaperWidthEdit;
+ VclPtr<MetricField> m_pPaperHeightEdit;
- FixedText* m_pOrientationFT;
- RadioButton* m_pPortraitBtn;
- RadioButton* m_pLandscapeBtn;
+ VclPtr<FixedText> m_pOrientationFT;
+ VclPtr<RadioButton> m_pPortraitBtn;
+ VclPtr<RadioButton> m_pLandscapeBtn;
- SvxPageWindow* m_pBspWin;
+ VclPtr<SvxPageWindow> m_pBspWin;
- FixedText* m_pTextFlowLbl;
- svx::FrameDirectionListBox* m_pTextFlowBox;
+ VclPtr<FixedText> m_pTextFlowLbl;
+ VclPtr<svx::FrameDirectionListBox> m_pTextFlowBox;
- ListBox* m_pPaperTrayBox;
+ VclPtr<ListBox> m_pPaperTrayBox;
// Margins
- FixedText* m_pLeftMarginLbl;
- MetricField* m_pLeftMarginEdit;
- FixedText* m_pRightMarginLbl;
- MetricField* m_pRightMarginEdit;
- MetricField* m_pTopMarginEdit;
- MetricField* m_pBottomMarginEdit;
+ VclPtr<FixedText> m_pLeftMarginLbl;
+ VclPtr<MetricField> m_pLeftMarginEdit;
+ VclPtr<FixedText> m_pRightMarginLbl;
+ VclPtr<MetricField> m_pRightMarginEdit;
+ VclPtr<MetricField> m_pTopMarginEdit;
+ VclPtr<MetricField> m_pBottomMarginEdit;
// layout settings
- FixedText* m_pPageText;
- ListBox* m_pLayoutBox;
- ListBox* m_pNumberFormatBox;
+ VclPtr<FixedText> m_pPageText;
+ VclPtr<ListBox> m_pLayoutBox;
+ VclPtr<ListBox> m_pNumberFormatBox;
//Extras Calc
- FixedText* m_pTblAlignFT;
- CheckBox* m_pHorzBox;
- CheckBox* m_pVertBox;
+ VclPtr<FixedText> m_pTblAlignFT;
+ VclPtr<CheckBox> m_pHorzBox;
+ VclPtr<CheckBox> m_pVertBox;
// Impress and Draw
- CheckBox* m_pAdaptBox;
+ VclPtr<CheckBox> m_pAdaptBox;
//Register Writer
- CheckBox* m_pRegisterCB;
- FixedText* m_pRegisterFT;
- ListBox* m_pRegisterLB;
+ VclPtr<CheckBox> m_pRegisterCB;
+ VclPtr<FixedText> m_pRegisterFT;
+ VclPtr<ListBox> m_pRegisterLB;
OUString sStandardRegister;
- FixedText* m_pInsideLbl;
- FixedText* m_pOutsideLbl;
- FixedText* m_pPrintRangeQueryText;
+ VclPtr<FixedText> m_pInsideLbl;
+ VclPtr<FixedText> m_pOutsideLbl;
+ VclPtr<FixedText> m_pPrintRangeQueryText;
long nFirstLeftMargin;
long nFirstRightMargin;
@@ -140,7 +140,7 @@ private:
//UUUU SvxPage_Impl* pImpl;
MarginPosition m_nPos;
- Printer* mpDefPrinter;
+ VclPtr<Printer> mpDefPrinter;
bool mbDelPrinter : 1;
@@ -188,7 +188,7 @@ protected:
virtual sfxpg DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE;
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
// returns the range of the Which values
static const sal_uInt16* GetRanges() { return pRanges; }
@@ -197,6 +197,7 @@ public:
virtual void FillUserData() SAL_OVERRIDE;
virtual ~SvxPageDescPage();
+ virtual void dispose() SAL_OVERRIDE;
void SetMode( SvxModeType eMType ) { eMode = eMType; }
void SetPaperFormatRanges( Paper eStart, Paper eEnd )
diff --git a/cui/source/inc/paragrph.hxx b/cui/source/inc/paragrph.hxx
index e0ca89f29da9..80b2536aed21 100644
--- a/cui/source/inc/paragrph.hxx
+++ b/cui/source/inc/paragrph.hxx
@@ -52,32 +52,32 @@ private:
SvxStdParagraphTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
// indention
- SvxRelativeField* m_pLeftIndent;
+ VclPtr<SvxRelativeField> m_pLeftIndent;
- FixedText* m_pRightLabel;
- SvxRelativeField* m_pRightIndent;
+ VclPtr<FixedText> m_pRightLabel;
+ VclPtr<SvxRelativeField> m_pRightIndent;
- FixedText* m_pFLineLabel;
- SvxRelativeField* m_pFLineIndent;
- CheckBox* m_pAutoCB;
+ VclPtr<FixedText> m_pFLineLabel;
+ VclPtr<SvxRelativeField> m_pFLineIndent;
+ VclPtr<CheckBox> m_pAutoCB;
// distance
- SvxRelativeField* m_pTopDist;
- SvxRelativeField* m_pBottomDist;
- CheckBox* m_pContextualCB;
+ VclPtr<SvxRelativeField> m_pTopDist;
+ VclPtr<SvxRelativeField> m_pBottomDist;
+ VclPtr<CheckBox> m_pContextualCB;
// line spacing
- ListBox* m_pLineDist;
- FixedText* m_pLineDistAtLabel;
- MetricField* m_pLineDistAtPercentBox;
- MetricField* m_pLineDistAtMetricBox;
- FixedText* m_pAbsDist;
+ VclPtr<ListBox> m_pLineDist;
+ VclPtr<FixedText> m_pLineDistAtLabel;
+ VclPtr<MetricField> m_pLineDistAtPercentBox;
+ VclPtr<MetricField> m_pLineDistAtMetricBox;
+ VclPtr<FixedText> m_pAbsDist;
OUString sAbsDist;
- SvxParaPrevWindow* m_pExampleWin;
+ VclPtr<SvxParaPrevWindow> m_pExampleWin;
// only writer
- VclFrame* m_pRegisterFL;
- CheckBox* m_pRegisterCB;
+ VclPtr<VclFrame> m_pRegisterFL;
+ VclPtr<CheckBox> m_pRegisterCB;
long nAbst;
long nWidth;
@@ -98,9 +98,12 @@ protected:
public:
+ virtual ~SvxStdParagraphTabPage();
+ virtual void dispose() SAL_OVERRIDE;
+
DECL_LINK(ELRLoseFocusHdl, void *);
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
static const sal_uInt16* GetRanges() { return pStdRanges; }
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -115,8 +118,6 @@ public:
void EnableAbsLineDist(long nMinTwip);
void EnableNegativeMode();
virtual void PageCreated(const SfxAllItemSet& aSet) SAL_OVERRIDE;
-
- virtual ~SvxStdParagraphTabPage();
};
// class SvxParaAlignTabPage ------------------------------------------------
@@ -127,27 +128,27 @@ class SvxParaAlignTabPage : public SfxTabPage
static const sal_uInt16 pAlignRanges[];
// alignment
- RadioButton* m_pLeft;
- RadioButton* m_pRight;
- RadioButton* m_pCenter;
- RadioButton* m_pJustify;
- FixedText* m_pLeftBottom;
- FixedText* m_pRightTop;
+ VclPtr<RadioButton> m_pLeft;
+ VclPtr<RadioButton> m_pRight;
+ VclPtr<RadioButton> m_pCenter;
+ VclPtr<RadioButton> m_pJustify;
+ VclPtr<FixedText> m_pLeftBottom;
+ VclPtr<FixedText> m_pRightTop;
- FixedText* m_pLastLineFT;
- ListBox* m_pLastLineLB;
- CheckBox* m_pExpandCB;
+ VclPtr<FixedText> m_pLastLineFT;
+ VclPtr<ListBox> m_pLastLineLB;
+ VclPtr<CheckBox> m_pExpandCB;
- CheckBox* m_pSnapToGridCB;
+ VclPtr<CheckBox> m_pSnapToGridCB;
//preview
- SvxParaPrevWindow* m_pExampleWin;
+ VclPtr<SvxParaPrevWindow> m_pExampleWin;
//vertical alignment
- VclFrame* m_pVertAlignFL;
- ListBox* m_pVertAlignLB;
+ VclPtr<VclFrame> m_pVertAlignFL;
+ VclPtr<ListBox> m_pVertAlignLB;
- VclFrame* m_pPropertiesFL;
- svx::FrameDirectionListBox* m_pTextDirectionLB;
+ VclPtr<VclFrame> m_pPropertiesFL;
+ VclPtr<svx::FrameDirectionListBox> m_pTextDirectionLB;
DECL_LINK(AlignHdl_Impl, void *);
DECL_LINK(LastLineHdl_Impl, void *);
@@ -156,13 +157,15 @@ class SvxParaAlignTabPage : public SfxTabPage
void UpdateExample_Impl( bool bAll = false );
SvxParaAlignTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
- virtual ~SvxParaAlignTabPage();
protected:
virtual sfxpg DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE;
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ virtual ~SvxParaAlignTabPage();
+ virtual void dispose() SAL_OVERRIDE;
+
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
static const sal_uInt16* GetRanges() { return pAlignRanges; }
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -192,9 +195,10 @@ class SvxExtParagraphTabPage: public SfxTabPage
static const sal_uInt16 pExtRanges[];
public:
- virtual ~SvxExtParagraphTabPage();
+ virtual ~SvxExtParagraphTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rSet );
static const sal_uInt16* GetRanges() { return pExtRanges; }
@@ -210,37 +214,37 @@ private:
SvxExtParagraphTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
// hyphenation
- TriStateBox* m_pHyphenBox;
- FixedText* m_pBeforeText;
- NumericField* m_pExtHyphenBeforeBox;
- FixedText* m_pAfterText;
- NumericField* m_pExtHyphenAfterBox;
- FixedText* m_pMaxHyphenLabel;
- NumericField* m_pMaxHyphenEdit;
+ VclPtr<TriStateBox> m_pHyphenBox;
+ VclPtr<FixedText> m_pBeforeText;
+ VclPtr<NumericField> m_pExtHyphenBeforeBox;
+ VclPtr<FixedText> m_pAfterText;
+ VclPtr<NumericField> m_pExtHyphenAfterBox;
+ VclPtr<FixedText> m_pMaxHyphenLabel;
+ VclPtr<NumericField> m_pMaxHyphenEdit;
// pagebreak
- TriStateBox* m_pPageBreakBox;
- FixedText* m_pBreakTypeFT;
- ListBox* m_pBreakTypeLB;
- FixedText* m_pBreakPositionFT;
- ListBox* m_pBreakPositionLB;
- TriStateBox* m_pApplyCollBtn;
- ListBox* m_pApplyCollBox;
- FixedText* m_pPagenumText;
- NumericField* m_pPagenumEdit;
+ VclPtr<TriStateBox> m_pPageBreakBox;
+ VclPtr<FixedText> m_pBreakTypeFT;
+ VclPtr<ListBox> m_pBreakTypeLB;
+ VclPtr<FixedText> m_pBreakPositionFT;
+ VclPtr<ListBox> m_pBreakPositionLB;
+ VclPtr<TriStateBox> m_pApplyCollBtn;
+ VclPtr<ListBox> m_pApplyCollBox;
+ VclPtr<FixedText> m_pPagenumText;
+ VclPtr<NumericField> m_pPagenumEdit;
// paragraph division
- TriStateBox* m_pKeepTogetherBox;
- TriStateBox* m_pKeepParaBox;
+ VclPtr<TriStateBox> m_pKeepTogetherBox;
+ VclPtr<TriStateBox> m_pKeepParaBox;
// orphan/widow
- TriStateBox* m_pOrphanBox;
- NumericField* m_pOrphanRowNo;
- FixedText* m_pOrphanRowLabel;
+ VclPtr<TriStateBox> m_pOrphanBox;
+ VclPtr<NumericField> m_pOrphanRowNo;
+ VclPtr<FixedText> m_pOrphanRowLabel;
- TriStateBox* m_pWidowBox;
- NumericField* m_pWidowRowNo;
- FixedText* m_pWidowRowLabel;
+ VclPtr<TriStateBox> m_pWidowBox;
+ VclPtr<NumericField> m_pWidowRowNo;
+ VclPtr<FixedText> m_pWidowRowLabel;
bool bPageBreak;
bool bHtmlMode;
@@ -262,9 +266,9 @@ private:
class SvxAsianTabPage : public SfxTabPage
{
- CheckBox* m_pForbiddenRulesCB;
- CheckBox* m_pHangingPunctCB;
- CheckBox* m_pScriptSpaceCB;
+ VclPtr<CheckBox> m_pForbiddenRulesCB;
+ VclPtr<CheckBox> m_pHangingPunctCB;
+ VclPtr<CheckBox> m_pScriptSpaceCB;
SvxAsianTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
@@ -272,9 +276,9 @@ class SvxAsianTabPage : public SfxTabPage
public:
virtual ~SvxAsianTabPage();
+ virtual void dispose() SAL_OVERRIDE;
-
- static SfxTabPage* Create( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rSet );
static const sal_uInt16* GetRanges();
diff --git a/cui/source/inc/passwdomdlg.hxx b/cui/source/inc/passwdomdlg.hxx
index 9dd7aca1e11b..59fd9e479a78 100644
--- a/cui/source/inc/passwdomdlg.hxx
+++ b/cui/source/inc/passwdomdlg.hxx
@@ -40,6 +40,7 @@ public:
sal_uInt16 nMaxPasswdLen /* 0 -> no max len enforced */,
bool bIsPasswordToModify );
virtual ~PasswordToOpenModifyDialog();
+ virtual void dispose() SAL_OVERRIDE;
// AbstractPasswordToOpenModifyDialog
OUString GetPasswordToOpen() const;
diff --git a/cui/source/inc/pastedlg.hxx b/cui/source/inc/pastedlg.hxx
index 52332ac398ed..c634dc715a6b 100644
--- a/cui/source/inc/pastedlg.hxx
+++ b/cui/source/inc/pastedlg.hxx
@@ -39,9 +39,9 @@ class TransferableDataHelper;
class SvPasteObjectDialog : public ModalDialog
{
- FixedText* m_pFtObjectSource;
- ListBox* m_pLbInsertList;
- OKButton* m_pOKButton;
+ VclPtr<FixedText> m_pFtObjectSource;
+ VclPtr<ListBox> m_pLbInsertList;
+ VclPtr<OKButton> m_pOKButton;
::std::map< SotClipboardFormatId, OUString > aSupplementMap;
SvGlobalName aObjClassName;
OUString aObjName;
@@ -55,7 +55,8 @@ class SvPasteObjectDialog : public ModalDialog
public:
SvPasteObjectDialog( vcl::Window* pParent );
- virtual ~SvPasteObjectDialog();
+ virtual ~SvPasteObjectDialog();
+ virtual void dispose() SAL_OVERRIDE;
void Insert( SotClipboardFormatId nFormat, const OUString & rFormatName );
void SetObjName( const SvGlobalName & rClass, const OUString & rObjName );
diff --git a/cui/source/inc/postdlg.hxx b/cui/source/inc/postdlg.hxx
index 624649689e6a..170e00692379 100644
--- a/cui/source/inc/postdlg.hxx
+++ b/cui/source/inc/postdlg.hxx
@@ -46,6 +46,7 @@ public:
SvxPostItDialog(vcl::Window* pParent, const SfxItemSet& rCoreSet,
bool bPrevNext = false);
virtual ~SvxPostItDialog();
+ virtual void dispose() SAL_OVERRIDE;
static const sal_uInt16* GetRanges();
const SfxItemSet* GetOutputItemSet() const { return pOutSet; }
@@ -87,17 +88,17 @@ public:
}
private:
- FixedText* m_pLastEditFT;
+ VclPtr<FixedText> m_pLastEditFT;
- VclMultiLineEdit* m_pEditED;
+ VclPtr<VclMultiLineEdit> m_pEditED;
- VclContainer* m_pInsertAuthor;
- PushButton* m_pAuthorBtn;
+ VclPtr<VclContainer> m_pInsertAuthor;
+ VclPtr<PushButton> m_pAuthorBtn;
- OKButton* m_pOKBtn;
+ VclPtr<OKButton> m_pOKBtn;
- PushButton* m_pPrevBtn;
- PushButton* m_pNextBtn;
+ VclPtr<PushButton> m_pPrevBtn;
+ VclPtr<PushButton> m_pNextBtn;
const SfxItemSet& rSet;
SfxItemSet* pOutSet;
diff --git a/cui/source/inc/radiobtnbox.hxx b/cui/source/inc/radiobtnbox.hxx
index 1688bcd43905..7c31f340be54 100644
--- a/cui/source/inc/radiobtnbox.hxx
+++ b/cui/source/inc/radiobtnbox.hxx
@@ -39,7 +39,6 @@ protected:
public:
SvxRadioButtonListBox(SvSimpleTableContainer& rParent, WinBits nBits);
- virtual ~SvxRadioButtonListBox();
void HandleEntryChecked( SvTreeListEntry* _pEntry );
diff --git a/cui/source/inc/scriptdlg.hxx b/cui/source/inc/scriptdlg.hxx
index 8778123ed582..d3847dc6de62 100644
--- a/cui/source/inc/scriptdlg.hxx
+++ b/cui/source/inc/scriptdlg.hxx
@@ -77,6 +77,7 @@ public:
::com::sun::star::uno::Reference< com::sun::star::frame::XModel>& model );
SFTreeListBox(vcl::Window* pParent);
virtual ~SFTreeListBox();
+ virtual void dispose() SAL_OVERRIDE;
SvTreeListEntry * insertEntry(OUString const & rText, sal_uInt16 nBitmap,
SvTreeListEntry * pParent,
@@ -94,9 +95,11 @@ public:
class CuiInputDialog : public ModalDialog
{
private:
- Edit* m_pEdit;
+ VclPtr<Edit> m_pEdit;
public:
CuiInputDialog(vcl::Window * pParent, sal_uInt16 nMode);
+ virtual ~CuiInputDialog();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetObjectName() const { return m_pEdit->GetText(); }
void SetObjectName(const OUString& rName)
@@ -131,14 +134,14 @@ public:
class SvxScriptOrgDialog : public SfxModalDialog
{
protected:
- SFTreeListBox* m_pScriptsBox;
+ VclPtr<SFTreeListBox> m_pScriptsBox;
- PushButton* m_pRunButton;
- CloseButton* m_pCloseButton;
- PushButton* m_pCreateButton;
- PushButton* m_pEditButton;
- PushButton* m_pRenameButton;
- PushButton* m_pDelButton;
+ VclPtr<PushButton> m_pRunButton;
+ VclPtr<CloseButton> m_pCloseButton;
+ VclPtr<PushButton> m_pCreateButton;
+ VclPtr<PushButton> m_pEditButton;
+ VclPtr<PushButton> m_pRenameButton;
+ VclPtr<PushButton> m_pDelButton;
OUString m_sLanguage;
static Selection_hash m_lastSelection;
@@ -175,6 +178,7 @@ public:
// to specify the language or provider
SvxScriptOrgDialog( vcl::Window* pParent, const OUString& language );
virtual ~SvxScriptOrgDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
diff --git a/cui/source/inc/selector.hxx b/cui/source/inc/selector.hxx
index b22b85e30f30..c1ac1e3f6b62 100644
--- a/cui/source/inc/selector.hxx
+++ b/cui/source/inc/selector.hxx
@@ -102,6 +102,7 @@ friend class SvxConfigGroupListBox;
public:
SvxConfigFunctionListBox(vcl::Window* pParent, WinBits nStyle);
virtual ~SvxConfigFunctionListBox();
+ virtual void dispose() SAL_OVERRIDE;
void ClearAll();
OUString GetHelpText( SvTreeListEntry *pEntry );
using Window::GetHelpText;
@@ -122,7 +123,7 @@ class SvxConfigGroupListBox : public SvTreeListBox
SvxGroupInfoArr_Impl aArr;
bool m_bShowSlots;
- SvxConfigFunctionListBox* pFunctionListBox;
+ VclPtr<SvxConfigFunctionListBox> pFunctionListBox;
ImageProvider* m_pImageProvider;
::com::sun::star::uno::Reference
@@ -162,6 +163,7 @@ protected:
public:
SvxConfigGroupListBox(vcl::Window* pParent, WinBits nStyle);
virtual ~SvxConfigGroupListBox();
+ virtual void dispose() SAL_OVERRIDE;
void Init(bool bShowSlots, const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame >& xFrame);
@@ -179,12 +181,12 @@ public:
class SvxScriptSelectorDialog : public ModelessDialog
{
- FixedText* m_pDialogDescription;
- SvxConfigGroupListBox* m_pCategories;
- SvxConfigFunctionListBox* m_pCommands;
- PushButton* m_pOKButton;
- PushButton* m_pCancelButton;
- VclMultiLineEdit* m_pDescriptionText;
+ VclPtr<FixedText> m_pDialogDescription;
+ VclPtr<SvxConfigGroupListBox> m_pCategories;
+ VclPtr<SvxConfigFunctionListBox> m_pCommands;
+ VclPtr<PushButton> m_pOKButton;
+ VclPtr<PushButton> m_pCancelButton;
+ VclPtr<VclMultiLineEdit> m_pDescriptionText;
OUString m_sDefaultDesc;
bool m_bShowSlots;
Link m_aAddHdl;
@@ -203,8 +205,8 @@ public:
const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame >& xFrame = 0
);
-
- virtual ~SvxScriptSelectorDialog ( );
+ virtual ~SvxScriptSelectorDialog();
+ virtual void dispose() SAL_OVERRIDE;
void SetAddHdl( const Link& rLink ) { m_aAddHdl = rLink; }
const Link& GetAddHdl() const { return m_aAddHdl; }
diff --git a/cui/source/inc/showcols.hxx b/cui/source/inc/showcols.hxx
index dceddb7e3a00..d7494d72896b 100644
--- a/cui/source/inc/showcols.hxx
+++ b/cui/source/inc/showcols.hxx
@@ -35,13 +35,15 @@
class FmShowColsDialog : public ModalDialog
{
- ListBox* m_pList;
- OKButton* m_pOK;
+ VclPtr<ListBox> m_pList;
+ VclPtr<OKButton> m_pOK;
::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > m_xColumns;
public:
FmShowColsDialog(vcl::Window* pParent);
+ virtual ~FmShowColsDialog();
+ virtual void dispose() SAL_OVERRIDE;
void SetColumns(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer>& xCols);
diff --git a/cui/source/inc/splitcelldlg.hxx b/cui/source/inc/splitcelldlg.hxx
index 212559f32968..9d727d1583f1 100644
--- a/cui/source/inc/splitcelldlg.hxx
+++ b/cui/source/inc/splitcelldlg.hxx
@@ -26,17 +26,16 @@
#include <svx/stddlg.hxx>
#include <svx/svxdlg.hxx>
-class SvxSplitTableDlg : public SvxAbstractSplittTableDialog, public SvxStandardDialog
+class SvxSplitTableDlg : public SvxAbstractSplittTableDialog
{
- NumericField* m_pCountEdit;
- RadioButton* m_pHorzBox;
- RadioButton* m_pVertBox;
- CheckBox* m_pPropCB;
+ VclPtr<SvxStandardDialog> m_pDialog;
+ VclPtr<NumericField> m_pCountEdit;
+ VclPtr<RadioButton> m_pHorzBox;
+ VclPtr<RadioButton> m_pVertBox;
+ VclPtr<CheckBox> m_pPropCB;
long mnMaxVertical;
long mnMaxHorizontal;
-protected:
- virtual void Apply() SAL_OVERRIDE;
public:
SvxSplitTableDlg(vcl::Window *pParent, bool bIsTableVertical, long nMaxVertical, long nMaxHorizontal );
diff --git a/cui/source/inc/srchxtra.hxx b/cui/source/inc/srchxtra.hxx
index 0965484c9c45..f1c6aefde1a9 100644
--- a/cui/source/inc/srchxtra.hxx
+++ b/cui/source/inc/srchxtra.hxx
@@ -31,6 +31,7 @@ class SvxSearchFormatDialog : public SfxTabDialog
public:
SvxSearchFormatDialog( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxSearchFormatDialog();
+ virtual void dispose() SAL_OVERRIDE;
protected:
virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) SAL_OVERRIDE;
@@ -50,10 +51,12 @@ class SvxSearchAttributeDialog : public ModalDialog
public:
SvxSearchAttributeDialog( vcl::Window* pParent, SearchAttrItemList& rLst,
const sal_uInt16* pWhRanges );
+ virtual ~SvxSearchAttributeDialog();
+ virtual void dispose() SAL_OVERRIDE;
private:
- SvxCheckListBox* m_pAttrLB;
- OKButton* m_pOKBtn;
+ VclPtr<SvxCheckListBox> m_pAttrLB;
+ VclPtr<OKButton> m_pOKBtn;
SearchAttrItemList& rList;
@@ -65,10 +68,10 @@ private:
class SvxSearchSimilarityDialog : public ModalDialog
{
private:
- NumericField* m_pOtherFld;
- NumericField* m_pLongerFld;
- NumericField* m_pShorterFld;
- CheckBox* m_pRelaxBox;
+ VclPtr<NumericField> m_pOtherFld;
+ VclPtr<NumericField> m_pLongerFld;
+ VclPtr<NumericField> m_pShorterFld;
+ VclPtr<CheckBox> m_pRelaxBox;
public:
SvxSearchSimilarityDialog( vcl::Window* pParent,
@@ -76,6 +79,8 @@ public:
sal_uInt16 nOther,
sal_uInt16 nShorter,
sal_uInt16 nLonger );
+ virtual ~SvxSearchSimilarityDialog();
+ virtual void dispose() SAL_OVERRIDE;
sal_uInt16 GetOther() { return (sal_uInt16)m_pOtherFld->GetValue(); }
sal_uInt16 GetShorter() { return (sal_uInt16)m_pShorterFld->GetValue(); }
diff --git a/cui/source/inc/swpossizetabpage.hxx b/cui/source/inc/swpossizetabpage.hxx
index d293468214e7..e1db4048acc7 100644
--- a/cui/source/inc/swpossizetabpage.hxx
+++ b/cui/source/inc/swpossizetabpage.hxx
@@ -34,39 +34,39 @@ class SvxSwPosSizeTabPage : public SfxTabPage
{
using TabPage::DeactivatePage;
- MetricField* m_pWidthMF;
- MetricField* m_pHeightMF;
- CheckBox* m_pKeepRatioCB;
+ VclPtr<MetricField> m_pWidthMF;
+ VclPtr<MetricField> m_pHeightMF;
+ VclPtr<CheckBox> m_pKeepRatioCB;
- RadioButton* m_pToPageRB;
- RadioButton* m_pToParaRB;
- RadioButton* m_pToCharRB;
- RadioButton* m_pAsCharRB;
- RadioButton* m_pToFrameRB;
+ VclPtr<RadioButton> m_pToPageRB;
+ VclPtr<RadioButton> m_pToParaRB;
+ VclPtr<RadioButton> m_pToCharRB;
+ VclPtr<RadioButton> m_pAsCharRB;
+ VclPtr<RadioButton> m_pToFrameRB;
- TriStateBox* m_pPositionCB;
- TriStateBox* m_pSizeCB;
+ VclPtr<TriStateBox> m_pPositionCB;
+ VclPtr<TriStateBox> m_pSizeCB;
- VclContainer* m_pPosFrame;
- FixedText* m_pHoriFT;
- ListBox* m_pHoriLB;
- FixedText* m_pHoriByFT;
- MetricField* m_pHoriByMF;
- FixedText* m_pHoriToFT;
- ListBox* m_pHoriToLB;
+ VclPtr<VclContainer> m_pPosFrame;
+ VclPtr<FixedText> m_pHoriFT;
+ VclPtr<ListBox> m_pHoriLB;
+ VclPtr<FixedText> m_pHoriByFT;
+ VclPtr<MetricField> m_pHoriByMF;
+ VclPtr<FixedText> m_pHoriToFT;
+ VclPtr<ListBox> m_pHoriToLB;
- CheckBox* m_pHoriMirrorCB;
+ VclPtr<CheckBox> m_pHoriMirrorCB;
- FixedText* m_pVertFT;
- ListBox* m_pVertLB;
- FixedText* m_pVertByFT;
- MetricField* m_pVertByMF;
- FixedText* m_pVertToFT;
- ListBox* m_pVertToLB;
+ VclPtr<FixedText> m_pVertFT;
+ VclPtr<ListBox> m_pVertLB;
+ VclPtr<FixedText> m_pVertByFT;
+ VclPtr<MetricField> m_pVertByMF;
+ VclPtr<FixedText> m_pVertToFT;
+ VclPtr<ListBox> m_pVertToLB;
- CheckBox* m_pFollowCB;
+ VclPtr<CheckBox> m_pFollowCB;
- SvxSwFrameExample* m_pExampleWN;
+ VclPtr<SvxSwFrameExample> m_pExampleWN;
Link m_aValidateLink;
@@ -124,8 +124,9 @@ class SvxSwPosSizeTabPage : public SfxTabPage
public:
SvxSwPosSizeTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
virtual ~SvxSwPosSizeTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
static const sal_uInt16* GetRanges();
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
diff --git a/cui/source/inc/tabstpge.hxx b/cui/source/inc/tabstpge.hxx
index 39c761a5b15e..05903afd03a4 100644
--- a/cui/source/inc/tabstpge.hxx
+++ b/cui/source/inc/tabstpge.hxx
@@ -50,8 +50,8 @@ class SvxTabulatorTabPage : public SfxTabPage
public:
virtual ~SvxTabulatorTabPage();
-
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
static const sal_uInt16* GetRanges() { return pRanges; }
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -66,34 +66,34 @@ private:
SvxTabulatorTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
// tabulators and positions
- MetricBox* m_pTabBox;
+ VclPtr<MetricBox> m_pTabBox;
// TabType
- RadioButton* m_pLeftTab;
- RadioButton* m_pRightTab;
- RadioButton* m_pCenterTab;
- RadioButton* m_pDezTab;
-
- TabWin_Impl* m_pLeftWin;
- TabWin_Impl* m_pRightWin;
- TabWin_Impl* m_pCenterWin;
- TabWin_Impl* m_pDezWin;
-
- FixedText* m_pDezCharLabel;
- Edit* m_pDezChar;
-
- RadioButton* m_pNoFillChar;
- RadioButton* m_pFillPoints;
- RadioButton* m_pFillDashLine ;
- RadioButton* m_pFillSolidLine;
- RadioButton* m_pFillSpecial;
- Edit* m_pFillChar;
-
- PushButton* m_pNewBtn;
- PushButton* m_pDelAllBtn;
- PushButton* m_pDelBtn;
-
- VclContainer* m_pTypeFrame;
- VclContainer* m_pFillFrame;
+ VclPtr<RadioButton> m_pLeftTab;
+ VclPtr<RadioButton> m_pRightTab;
+ VclPtr<RadioButton> m_pCenterTab;
+ VclPtr<RadioButton> m_pDezTab;
+
+ VclPtr<TabWin_Impl> m_pLeftWin;
+ VclPtr<TabWin_Impl> m_pRightWin;
+ VclPtr<TabWin_Impl> m_pCenterWin;
+ VclPtr<TabWin_Impl> m_pDezWin;
+
+ VclPtr<FixedText> m_pDezCharLabel;
+ VclPtr<Edit> m_pDezChar;
+
+ VclPtr<RadioButton> m_pNoFillChar;
+ VclPtr<RadioButton> m_pFillPoints;
+ VclPtr<RadioButton> m_pFillDashLine ;
+ VclPtr<RadioButton> m_pFillSolidLine;
+ VclPtr<RadioButton> m_pFillSpecial;
+ VclPtr<Edit> m_pFillChar;
+
+ VclPtr<PushButton> m_pNewBtn;
+ VclPtr<PushButton> m_pDelAllBtn;
+ VclPtr<PushButton> m_pDelBtn;
+
+ VclPtr<VclContainer> m_pTypeFrame;
+ VclPtr<VclContainer> m_pFillFrame;
// local variables, internal functions
SvxTabStop aAktTab;
diff --git a/cui/source/inc/textanim.hxx b/cui/source/inc/textanim.hxx
index 2f1031d3d572..875b4d2a087f 100644
--- a/cui/source/inc/textanim.hxx
+++ b/cui/source/inc/textanim.hxx
@@ -37,27 +37,28 @@ class SdrView;
class SvxTextAnimationPage : public SfxTabPage
{
private:
- static const sal_uInt16 pRanges[];
- ListBox* m_pLbEffect;
- VclBox* m_pBoxDirection;
- PushButton* m_pBtnUp;
- PushButton* m_pBtnLeft;
- PushButton* m_pBtnRight;
- PushButton* m_pBtnDown;
+ static const sal_uInt16 pRanges[];
- VclFrame* m_pFlProperties;
- TriStateBox* m_pTsbStartInside;
- TriStateBox* m_pTsbStopInside;
+ VclPtr<ListBox> m_pLbEffect;
+ VclPtr<VclBox> m_pBoxDirection;
+ VclPtr<PushButton> m_pBtnUp;
+ VclPtr<PushButton> m_pBtnLeft;
+ VclPtr<PushButton> m_pBtnRight;
+ VclPtr<PushButton> m_pBtnDown;
- VclBox* m_pBoxCount;
- TriStateBox* m_pTsbEndless;
- NumericField* m_pNumFldCount;
+ VclPtr<VclFrame> m_pFlProperties;
+ VclPtr<TriStateBox> m_pTsbStartInside;
+ VclPtr<TriStateBox> m_pTsbStopInside;
- TriStateBox* m_pTsbPixel;
- MetricField* m_pMtrFldAmount;
+ VclPtr<VclBox> m_pBoxCount;
+ VclPtr<TriStateBox> m_pTsbEndless;
+ VclPtr<NumericField> m_pNumFldCount;
- TriStateBox* m_pTsbAuto;
- MetricField* m_pMtrFldDelay;
+ VclPtr<TriStateBox> m_pTsbPixel;
+ VclPtr<MetricField> m_pMtrFldAmount;
+
+ VclPtr<TriStateBox> m_pTsbAuto;
+ VclPtr<MetricField> m_pMtrFldDelay;
const SfxItemSet& rOutAttrs;
SdrTextAniKind eAniKind;
@@ -76,8 +77,9 @@ private:
public:
SvxTextAnimationPage( vcl::Window* pWindow, const SfxItemSet& rInAttrs );
virtual ~SvxTextAnimationPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
static const sal_uInt16* GetRanges() { return pRanges; }
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
@@ -104,7 +106,6 @@ public:
SvxTextTabDialog( vcl::Window* pParent, const SfxItemSet* pAttr,
const SdrView* pView );
- virtual ~SvxTextTabDialog() {};
};
diff --git a/cui/source/inc/textattr.hxx b/cui/source/inc/textattr.hxx
index 6c309a329b92..881f3fd4837c 100644
--- a/cui/source/inc/textattr.hxx
+++ b/cui/source/inc/textattr.hxx
@@ -38,22 +38,23 @@ class SvxTextAttrPage : public SvxTabPage
{
private:
static const sal_uInt16 pRanges[];
- TriStateBox* m_pTsbAutoGrowWidth;
- TriStateBox* m_pTsbAutoGrowHeight;
- TriStateBox* m_pTsbFitToSize;
- TriStateBox* m_pTsbContour;
- TriStateBox* m_pTsbWordWrapText;
- TriStateBox* m_pTsbAutoGrowSize;
-
- VclFrame* m_pFlDistance;
- MetricField* m_pMtrFldLeft;
- MetricField* m_pMtrFldRight;
- MetricField* m_pMtrFldTop;
- MetricField* m_pMtrFldBottom;
-
- VclFrame* m_pFlPosition;
- SvxRectCtl* m_pCtlPosition;
- TriStateBox* m_pTsbFullWidth;
+
+ VclPtr<TriStateBox> m_pTsbAutoGrowWidth;
+ VclPtr<TriStateBox> m_pTsbAutoGrowHeight;
+ VclPtr<TriStateBox> m_pTsbFitToSize;
+ VclPtr<TriStateBox> m_pTsbContour;
+ VclPtr<TriStateBox> m_pTsbWordWrapText;
+ VclPtr<TriStateBox> m_pTsbAutoGrowSize;
+
+ VclPtr<VclFrame> m_pFlDistance;
+ VclPtr<MetricField> m_pMtrFldLeft;
+ VclPtr<MetricField> m_pMtrFldRight;
+ VclPtr<MetricField> m_pMtrFldTop;
+ VclPtr<MetricField> m_pMtrFldBottom;
+
+ VclPtr<VclFrame> m_pFlPosition;
+ VclPtr<SvxRectCtl> m_pCtlPosition;
+ VclPtr<TriStateBox> m_pTsbFullWidth;
const SfxItemSet& rOutAttrs;
const SdrView* pView;
@@ -77,8 +78,9 @@ public:
SvxTextAttrPage( vcl::Window* pWindow, const SfxItemSet& rInAttrs );
virtual ~SvxTextAttrPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
static const sal_uInt16* GetRanges() { return pRanges; }
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
diff --git a/cui/source/inc/thesdlg.hxx b/cui/source/inc/thesdlg.hxx
index a2dcc8580118..661788124c3f 100644
--- a/cui/source/inc/thesdlg.hxx
+++ b/cui/source/inc/thesdlg.hxx
@@ -35,7 +35,7 @@ class SvxThesaurusDialog;
class LookUpComboBox : public ComboBox
{
Idle m_aModifyIdle;
- SvxThesaurusDialog* m_pDialog;
+ VclPtr<SvxThesaurusDialog> m_pDialog;
LookUpComboBox( const LookUpComboBox & ) SAL_DELETED_FUNCTION;
LookUpComboBox& operator = ( const LookUpComboBox & ) SAL_DELETED_FUNCTION;
@@ -43,6 +43,7 @@ class LookUpComboBox : public ComboBox
public:
LookUpComboBox(vcl::Window *pParent);
virtual ~LookUpComboBox();
+ virtual void dispose() SAL_OVERRIDE;
DECL_LINK( ModifyTimer_Hdl, Timer * );
@@ -72,7 +73,7 @@ public:
class ThesaurusAlternativesCtrl
: public SvxCheckListBox
{
- SvxThesaurusDialog* m_pDialog;
+ VclPtr<SvxThesaurusDialog> m_pDialog;
typedef std::map< const SvTreeListEntry *, AlternativesExtraData > UserDataMap_t;
UserDataMap_t m_aUserData;
@@ -85,7 +86,7 @@ public:
void init(SvxThesaurusDialog *pDialog);
virtual ~ThesaurusAlternativesCtrl();
-
+ virtual void dispose() SAL_OVERRIDE;
SvTreeListEntry * AddEntry( sal_Int32 nVal, const OUString &rText, bool bIsHeader );
@@ -99,7 +100,7 @@ public:
class ReplaceEdit : public Edit
{
- Button * m_pBtn;
+ VclPtr<Button> m_pBtn;
ReplaceEdit( const ReplaceEdit & ) SAL_DELETED_FUNCTION;
ReplaceEdit & operator = ( const ReplaceEdit & ) SAL_DELETED_FUNCTION;
@@ -107,6 +108,7 @@ class ReplaceEdit : public Edit
public:
ReplaceEdit(vcl::Window *pParent);
virtual ~ReplaceEdit();
+ virtual void dispose() SAL_OVERRIDE;
void init(Button *pBtn) { m_pBtn = pBtn; }
@@ -118,11 +120,11 @@ public:
class SvxThesaurusDialog : public SvxStandardDialog
{
- PushButton* m_pLeftBtn;
- LookUpComboBox* m_pWordCB;
- ThesaurusAlternativesCtrl* m_pAlternativesCT;
- ReplaceEdit* m_pReplaceEdit;
- ListBox* m_pLangLB;
+ VclPtr<PushButton> m_pLeftBtn;
+ VclPtr<LookUpComboBox> m_pWordCB;
+ VclPtr<ThesaurusAlternativesCtrl> m_pAlternativesCT;
+ VclPtr<ReplaceEdit> m_pReplaceEdit;
+ VclPtr<ListBox> m_pLangLB;
OUString m_aErrStr;
@@ -133,6 +135,9 @@ class SvxThesaurusDialog : public SvxStandardDialog
bool m_bWordFound;
public:
+ virtual ~SvxThesaurusDialog();
+ virtual void dispose() SAL_OVERRIDE;
+
bool WordFound() const { return m_bWordFound; }
OUString getErrStr() const { return m_aErrStr; }
@@ -159,7 +164,6 @@ public:
SvxThesaurusDialog( vcl::Window* pParent,
css::uno::Reference< css::linguistic2::XThesaurus > xThesaurus,
const OUString &rWord, LanguageType nLanguage );
- virtual ~SvxThesaurusDialog();
void SetWindowTitle( LanguageType nLanguage );
OUString GetWord();
diff --git a/cui/source/inc/transfrm.hxx b/cui/source/inc/transfrm.hxx
index ccc70d1b349b..52489521102e 100644
--- a/cui/source/inc/transfrm.hxx
+++ b/cui/source/inc/transfrm.hxx
@@ -62,7 +62,6 @@ public:
SvxTransformTabDialog( vcl::Window* pParent, const SfxItemSet* pAttr,
const SdrView* pView,
sal_uInt16 nAnchorTypes = 0);
- virtual ~SvxTransformTabDialog();
//link for the Writer to validate positions
void SetValidateFramePosLink( const Link& rLink );
@@ -82,29 +81,29 @@ class SvxPositionSizeTabPage : public SvxTabPage
private:
// position
- VclFrame* m_pFlPosition;
- MetricField* m_pMtrPosX;
- MetricField* m_pMtrPosY;
- SvxRectCtl* m_pCtlPos;
+ VclPtr<VclFrame> m_pFlPosition;
+ VclPtr<MetricField> m_pMtrPosX;
+ VclPtr<MetricField> m_pMtrPosY;
+ VclPtr<SvxRectCtl> m_pCtlPos;
// size
- VclFrame* m_pFlSize;
- FixedText* m_pFtWidth;
- MetricField* m_pMtrWidth;
- FixedText* m_pFtHeight;
- MetricField* m_pMtrHeight;
- CheckBox* m_pCbxScale;
- SvxRectCtl* m_pCtlSize;
+ VclPtr<VclFrame> m_pFlSize;
+ VclPtr<FixedText> m_pFtWidth;
+ VclPtr<MetricField> m_pMtrWidth;
+ VclPtr<FixedText> m_pFtHeight;
+ VclPtr<MetricField> m_pMtrHeight;
+ VclPtr<CheckBox> m_pCbxScale;
+ VclPtr<SvxRectCtl> m_pCtlSize;
// protect
- VclFrame* m_pFlProtect;
- TriStateBox* m_pTsbPosProtect;
- TriStateBox* m_pTsbSizeProtect;
+ VclPtr<VclFrame> m_pFlProtect;
+ VclPtr<TriStateBox> m_pTsbPosProtect;
+ VclPtr<TriStateBox> m_pTsbSizeProtect;
// adjust
- VclFrame* m_pFlAdjust;
- TriStateBox* m_pTsbAutoGrowWidth;
- TriStateBox* m_pTsbAutoGrowHeight;
+ VclPtr<VclFrame> m_pFlAdjust;
+ VclPtr<TriStateBox> m_pTsbAutoGrowWidth;
+ VclPtr<TriStateBox> m_pTsbAutoGrowHeight;
private:
const SfxItemSet& mrOutAttrs;
@@ -147,8 +146,10 @@ private:
public:
SvxPositionSizeTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ virtual ~SvxPositionSizeTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
static const sal_uInt16* GetRanges() { return pPosSizeRanges; }
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
@@ -182,14 +183,14 @@ class SvxAngleTabPage : public SvxTabPage
static const sal_uInt16 pAngleRanges[];
private:
- VclFrame* m_pFlPosition;
- MetricField* m_pMtrPosX;
- MetricField* m_pMtrPosY;
- SvxRectCtl* m_pCtlRect;
+ VclPtr<VclFrame> m_pFlPosition;
+ VclPtr<MetricField> m_pMtrPosX;
+ VclPtr<MetricField> m_pMtrPosY;
+ VclPtr<SvxRectCtl> m_pCtlRect;
- VclFrame* m_pFlAngle;
- NumericField* m_pNfAngle;
- svx::DialControl* m_pCtlAngle;
+ VclPtr<VclFrame> m_pFlAngle;
+ VclPtr<NumericField> m_pNfAngle;
+ VclPtr<svx::DialControl> m_pCtlAngle;
const SfxItemSet& rOutAttrs;
const SdrView* pView;
@@ -203,8 +204,10 @@ private:
public:
SvxAngleTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ virtual ~SvxAngleTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
static const sal_uInt16* GetRanges() { return pAngleRanges; }
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
@@ -231,10 +234,10 @@ class SvxSlantTabPage : public SvxTabPage
static const sal_uInt16 pSlantRanges[];
private:
- VclFrame* m_pFlRadius;
- MetricField* m_pMtrRadius;
- VclFrame* m_pFlAngle;
- MetricField* m_pMtrAngle;
+ VclPtr<VclFrame> m_pFlRadius;
+ VclPtr<MetricField> m_pMtrRadius;
+ VclPtr<VclFrame> m_pFlAngle;
+ VclPtr<MetricField> m_pMtrAngle;
const SfxItemSet& rOutAttrs;
@@ -248,8 +251,10 @@ private:
public:
SvxSlantTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ virtual ~SvxSlantTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
static const sal_uInt16* GetRanges() { return pSlantRanges; }
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
diff --git a/cui/source/inc/treeopt.hxx b/cui/source/inc/treeopt.hxx
index 2fa0d064ef9c..78b63bd68761 100644
--- a/cui/source/inc/treeopt.hxx
+++ b/cui/source/inc/treeopt.hxx
@@ -146,18 +146,18 @@ private:
SvTreeListEntry* pCurrentPageEntry;
bool hasTreePendingLayout() const;
- OKButton* pOkPB;
- PushButton* pBackPB;
+ VclPtr<OKButton> pOkPB;
+ VclPtr<PushButton> pBackPB;
- SvTreeListBox* pTreeLB;
- VclBox* pTabBox;
+ VclPtr<SvTreeListBox> pTreeLB;
+ VclPtr<VclBox> pTabBox;
OUString sTitle;
OUString sNotLoadedError;
// for the ColorTabPage
SfxItemSet* pColorPageItemSet;
- SvxColorTabPage *mpColorPage;
+ VclPtr<SvxColorTabPage> mpColorPage;
bool bForgetSelection;
bool bIsFromExtensionManager;
@@ -200,6 +200,7 @@ public:
bool bActivateLastSelection = true );
OfaTreeOptionsDialog( vcl::Window* pParent, const OUString& rExtensionId );
virtual ~OfaTreeOptionsDialog();
+ virtual void dispose() SAL_OVERRIDE;
OptionsPageInfo* AddTabPage( sal_uInt16 nId, const OUString& rPageName, sal_uInt16 nGroup );
sal_uInt16 AddGroup( const OUString& rGroupName, SfxShell* pCreateShell,
@@ -277,6 +278,7 @@ public:
com::sun::star::awt::XContainerWindowProvider >& rProvider );
virtual ~ExtensionsTabPage();
+ virtual void dispose() SAL_OVERRIDE;
virtual void ActivatePage() SAL_OVERRIDE;
virtual void DeactivatePage() SAL_OVERRIDE;
diff --git a/cui/source/inc/zoom.hxx b/cui/source/inc/zoom.hxx
index 3cccaceb49e8..882be467f95d 100644
--- a/cui/source/inc/zoom.hxx
+++ b/cui/source/inc/zoom.hxx
@@ -27,21 +27,21 @@
class SvxZoomDialog : public SfxModalDialog
{
private:
- RadioButton* m_pOptimalBtn;
- RadioButton* m_pWholePageBtn;
- RadioButton* m_pPageWidthBtn;
- RadioButton* m_p100Btn;
- RadioButton* m_pUserBtn;
- MetricField* m_pUserEdit;
+ VclPtr<RadioButton> m_pOptimalBtn;
+ VclPtr<RadioButton> m_pWholePageBtn;
+ VclPtr<RadioButton> m_pPageWidthBtn;
+ VclPtr<RadioButton> m_p100Btn;
+ VclPtr<RadioButton> m_pUserBtn;
+ VclPtr<MetricField> m_pUserEdit;
- VclContainer* m_pViewFrame;
- RadioButton* m_pAutomaticBtn;
- RadioButton* m_pSingleBtn;
- RadioButton* m_pColumnsBtn;
- NumericField* m_pColumnsEdit;
- CheckBox* m_pBookModeChk;
+ VclPtr<VclContainer> m_pViewFrame;
+ VclPtr<RadioButton> m_pAutomaticBtn;
+ VclPtr<RadioButton> m_pSingleBtn;
+ VclPtr<RadioButton> m_pColumnsBtn;
+ VclPtr<NumericField> m_pColumnsEdit;
+ VclPtr<CheckBox> m_pBookModeChk;
- OKButton* m_pOKBtn;
+ VclPtr<OKButton> m_pOKBtn;
const SfxItemSet& mrSet;
std::unique_ptr<SfxItemSet> mpOutSet;
@@ -57,6 +57,7 @@ private:
public:
SvxZoomDialog(vcl::Window* pParent, const SfxItemSet& rCoreSet);
virtual ~SvxZoomDialog();
+ virtual void dispose() SAL_OVERRIDE;
const SfxItemSet* GetOutputItemSet() const;
diff --git a/cui/source/options/certpath.cxx b/cui/source/options/certpath.cxx
index bfe416952d7d..10c2ebc1bf90 100644
--- a/cui/source/options/certpath.cxx
+++ b/cui/source/options/certpath.cxx
@@ -35,7 +35,7 @@ CertPathDialog::CertPathDialog(vcl::Window* pParent)
m_pCertPathListContainer->set_width_request(aSize.Width());
m_pCertPathListContainer->set_height_request(aSize.Height());
m_pCertPathList =
- new svx::SvxRadioButtonListBox(*m_pCertPathListContainer, 0);
+ VclPtr<svx::SvxRadioButtonListBox>::Create(*m_pCertPathListContainer, 0);
m_sAddDialogText = get<FixedText>("certdir")->GetText();
m_sManual = get<FixedText>("manual")->GetText();
@@ -144,6 +144,11 @@ OUString CertPathDialog::getDirectory() const
CertPathDialog::~CertPathDialog()
{
+ disposeOnce();
+}
+
+void CertPathDialog::dispose()
+{
SvTreeListEntry* pEntry = m_pCertPathList->First();
while (pEntry)
{
@@ -151,7 +156,11 @@ CertPathDialog::~CertPathDialog()
delete pCertPath;
pEntry = m_pCertPathList->Next( pEntry );
}
- delete m_pCertPathList;
+ m_pCertPathList.disposeAndClear();
+ m_pCertPathListContainer.clear();
+ m_pAddBtn.clear();
+ m_pOKBtn.clear();
+ ModalDialog::dispose();
}
IMPL_LINK( CertPathDialog, CheckHdl_Impl, SvSimpleTable *, pList )
diff --git a/cui/source/options/certpath.hxx b/cui/source/options/certpath.hxx
index bdc083c987d8..29a3e1aa45fb 100644
--- a/cui/source/options/certpath.hxx
+++ b/cui/source/options/certpath.hxx
@@ -19,10 +19,10 @@
class CertPathDialog : public ModalDialog
{
private:
- SvSimpleTableContainer* m_pCertPathListContainer;
- svx::SvxRadioButtonListBox* m_pCertPathList;
- PushButton* m_pAddBtn;
- OKButton* m_pOKBtn;
+ VclPtr<SvSimpleTableContainer> m_pCertPathListContainer;
+ VclPtr<svx::SvxRadioButtonListBox> m_pCertPathList;
+ VclPtr<PushButton> m_pAddBtn;
+ VclPtr<OKButton> m_pOKBtn;
OUString m_sAddDialogText;
OUString m_sManual;
@@ -35,6 +35,7 @@ private:
public:
CertPathDialog(vcl::Window* pParent);
virtual ~CertPathDialog();
+ virtual void dispose() SAL_OVERRIDE;
OUString getDirectory() const;
};
diff --git a/cui/source/options/connpooloptions.cxx b/cui/source/options/connpooloptions.cxx
index 058f9a69c917..b162898bc97c 100644
--- a/cui/source/options/connpooloptions.cxx
+++ b/cui/source/options/connpooloptions.cxx
@@ -326,12 +326,28 @@ namespace offapp
m_pDriverList->SetRowChangeHandler( LINK(this, ConnectionPoolOptionsPage, OnDriverRowChanged) );
}
+ ConnectionPoolOptionsPage::~ConnectionPoolOptionsPage()
+ {
+ disposeOnce();
+ }
- SfxTabPage* ConnectionPoolOptionsPage::Create(vcl::Window* _pParent, const SfxItemSet* _rAttrSet)
+ void ConnectionPoolOptionsPage::dispose()
{
- return new ConnectionPoolOptionsPage(_pParent, *_rAttrSet);
+ m_pEnablePooling.clear();
+ m_pDriversLabel.clear();
+ m_pDriverList.clear();
+ m_pDriverLabel.clear();
+ m_pDriver.clear();
+ m_pDriverPoolingEnabled.clear();
+ m_pTimeoutLabel.clear();
+ m_pTimeout.clear();
+ SfxTabPage::dispose();
}
+ VclPtr<SfxTabPage> ConnectionPoolOptionsPage::Create(vcl::Window* _pParent, const SfxItemSet* _rAttrSet)
+ {
+ return VclPtr<ConnectionPoolOptionsPage>::Create(_pParent, *_rAttrSet);
+ }
void ConnectionPoolOptionsPage::implInitControls(const SfxItemSet& _rSet, bool /*_bFromReset*/)
{
diff --git a/cui/source/options/connpooloptions.hxx b/cui/source/options/connpooloptions.hxx
index 868c42702a16..d8e4c2556df8 100644
--- a/cui/source/options/connpooloptions.hxx
+++ b/cui/source/options/connpooloptions.hxx
@@ -38,20 +38,20 @@ namespace offapp
using TabPage::ActivatePage;
protected:
- CheckBox* m_pEnablePooling;
- FixedText* m_pDriversLabel;
- DriverListControl* m_pDriverList;
- FixedText* m_pDriverLabel;
- FixedText* m_pDriver;
- CheckBox* m_pDriverPoolingEnabled;
- FixedText* m_pTimeoutLabel;
- NumericField* m_pTimeout;
-
- protected:
- ConnectionPoolOptionsPage(vcl::Window* _pParent, const SfxItemSet& _rAttrSet);
+ VclPtr<CheckBox> m_pEnablePooling;
+ VclPtr<FixedText> m_pDriversLabel;
+ VclPtr<DriverListControl> m_pDriverList;
+ VclPtr<FixedText> m_pDriverLabel;
+ VclPtr<FixedText> m_pDriver;
+ VclPtr<CheckBox> m_pDriverPoolingEnabled;
+ VclPtr<FixedText> m_pTimeoutLabel;
+ VclPtr<NumericField> m_pTimeout;
public:
- static SfxTabPage* Create(vcl::Window* _pParent, const SfxItemSet* _rAttrSet);
+ ConnectionPoolOptionsPage(vcl::Window* _pParent, const SfxItemSet& _rAttrSet);
+ virtual ~ConnectionPoolOptionsPage();
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create(vcl::Window* _pParent, const SfxItemSet* _rAttrSet);
protected:
virtual bool Notify( NotifyEvent& _rNEvt ) SAL_OVERRIDE;
diff --git a/cui/source/options/cuisrchdlg.cxx b/cui/source/options/cuisrchdlg.cxx
index a7041604683b..bff4d1a74c8e 100644
--- a/cui/source/options/cuisrchdlg.cxx
+++ b/cui/source/options/cuisrchdlg.cxx
@@ -54,12 +54,24 @@ SvxJSearchOptionsDialog::SvxJSearchOptionsDialog(vcl::Window *pParent,
{
// pPage will be implicitly destroyed by the
// SfxSingleTabDialog destructor
- pPage = static_cast<SvxJSearchOptionsPage *>(
- SvxJSearchOptionsPage::Create(get_content_area(), &rOptionsSet ));
+ pPage.reset( static_cast<SvxJSearchOptionsPage *>(
+ SvxJSearchOptionsPage::Create(
+ get_content_area(), &rOptionsSet ).get() ) );
SetTabPage( pPage ); //! implicitly calls pPage->Reset(...)!
pPage->EnableSaveOptions(false);
}
+SvxJSearchOptionsDialog::~SvxJSearchOptionsDialog()
+{
+ disposeOnce();
+}
+
+void SvxJSearchOptionsDialog::dispose()
+{
+ pPage.clear();
+ SfxSingleTabDialog::dispose();
+}
+
void SvxJSearchOptionsDialog::Activate()
{
pPage->SetTransliterationFlags( nInitialTlFlags );
diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx
index c99defce27d0..5d834e297cdf 100644
--- a/cui/source/options/dbregister.cxx
+++ b/cui/source/options/dbregister.cxx
@@ -78,15 +78,11 @@ DatabaseRegistrationDialog::DatabaseRegistrationDialog( vcl::Window* pParent, co
: RegistrationItemSetHolder(rInAttrs)
, SfxSingleTabDialog(pParent, getRegistrationItems())
{
- SfxTabPage* page = DbRegistrationOptionsPage::Create(get_content_area(), &getRegistrationItems());
+ VclPtr<SfxTabPage> page = DbRegistrationOptionsPage::Create(get_content_area(), &getRegistrationItems());
SetTabPage(page);
SetText(page->get<VclFrame>("frame1")->get_label());
}
-DatabaseRegistrationDialog::~DatabaseRegistrationDialog()
-{
-}
-
short DatabaseRegistrationDialog::Execute()
{
short result = SfxSingleTabDialog::Execute();
@@ -167,17 +163,27 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage( vcl::Window* pParent, cons
DbRegistrationOptionsPage::~DbRegistrationOptionsPage()
{
+ disposeOnce();
+}
+
+void DbRegistrationOptionsPage::dispose()
+{
for ( sal_uInt16 i = 0; i < pPathBox->GetEntryCount(); ++i )
delete static_cast< DatabaseRegistration* >( pPathBox->GetEntry(i)->GetUserData() );
- delete pPathBox;
+ pPathBox.disposeAndClear();
+ m_pPathCtrl.clear();
+ m_pNew.clear();
+ m_pEdit.clear();
+ m_pDelete.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* DbRegistrationOptionsPage::Create( vcl::Window* pParent,
+VclPtr<SfxTabPage> DbRegistrationOptionsPage::Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet )
{
- return ( new DbRegistrationOptionsPage( pParent, *rAttrSet ) );
+ return VclPtr<DbRegistrationOptionsPage>::Create( pParent, *rAttrSet );
}
@@ -272,8 +278,8 @@ IMPL_LINK_NOARG(DbRegistrationOptionsPage, DeleteHdl)
SvTreeListEntry* pEntry = pPathBox->FirstSelected();
if ( pEntry )
{
- MessageDialog aQuery(this, CUI_RES(RID_SVXSTR_QUERY_DELETE_CONFIRM), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
- if ( aQuery.Execute() == RET_YES )
+ ScopedVclPtrInstance< MessageDialog > aQuery(this, CUI_RES(RID_SVXSTR_QUERY_DELETE_CONFIRM), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ if ( aQuery->Execute() == RET_YES )
pPathBox->GetModel()->Remove(pEntry);
}
return 0;
@@ -408,15 +414,15 @@ void DbRegistrationOptionsPage::insertNewEntry( const OUString& _sName,const OUS
void DbRegistrationOptionsPage::openLinkDialog(const OUString& _sOldName,const OUString& _sOldLocation,SvTreeListEntry* _pEntry)
{
- ODocumentLinkDialog aDlg(this,_pEntry == NULL);
+ ScopedVclPtrInstance< ODocumentLinkDialog > aDlg(this,_pEntry == nullptr);
- aDlg.setLink(_sOldName,_sOldLocation);
- aDlg.setNameValidator(LINK( this, DbRegistrationOptionsPage, NameValidator ) );
+ aDlg->setLink(_sOldName,_sOldLocation);
+ aDlg->setNameValidator(LINK( this, DbRegistrationOptionsPage, NameValidator ) );
- if ( aDlg.Execute() == RET_OK )
+ if ( aDlg->Execute() == RET_OK )
{
OUString sNewName,sNewLocation;
- aDlg.getLink(sNewName,sNewLocation);
+ aDlg->getLink(sNewName,sNewLocation);
if ( _pEntry == NULL || sNewName != _sOldName || sNewLocation != _sOldLocation )
{
if ( _pEntry )
diff --git a/cui/source/options/doclinkdialog.cxx b/cui/source/options/doclinkdialog.cxx
index ffeeb84e33a3..52e03509b068 100644
--- a/cui/source/options/doclinkdialog.cxx
+++ b/cui/source/options/doclinkdialog.cxx
@@ -70,6 +70,20 @@ namespace svx
m_pURL->SetDropDownLineCount( 5 );
}
+ ODocumentLinkDialog::~ODocumentLinkDialog()
+ {
+ disposeOnce();
+ }
+
+ void ODocumentLinkDialog::dispose()
+ {
+ m_pURL.clear();
+ m_pBrowseFile.clear();
+ m_pName.clear();
+ m_pOK.clear();
+ ModalDialog::dispose();
+ }
+
void ODocumentLinkDialog::setLink( const OUString& _rName, const OUString& _rURL )
{
@@ -116,8 +130,8 @@ namespace svx
{
OUString sMsg = CUI_RES(STR_LINKEDDOC_DOESNOTEXIST);
sMsg = sMsg.replaceFirst("$file$", m_pURL->GetText());
- MessageDialog aError(this, sMsg);
- aError.Execute();
+ ScopedVclPtrInstance< MessageDialog > aError(this, sMsg);
+ aError->Execute();
return 0L;
} // if (!bFileExists)
INetURLObject aURL( sURL );
@@ -125,8 +139,8 @@ namespace svx
{
OUString sMsg = CUI_RES(STR_LINKEDDOC_NO_SYSTEM_FILE);
sMsg = sMsg.replaceFirst("$file$", m_pURL->GetText());
- MessageDialog aError(this, sMsg);
- aError.Execute();
+ ScopedVclPtrInstance< MessageDialog > aError(this, sMsg);
+ aError->Execute();
return 0L;
}
@@ -137,8 +151,8 @@ namespace svx
{
OUString sMsg = CUI_RES(STR_NAME_CONFLICT);
sMsg = sMsg.replaceFirst("$file$", sCurrentText);
- MessageDialog aError(this, sMsg, VCL_MESSAGE_INFO);
- aError.Execute();
+ ScopedVclPtrInstance< MessageDialog > aError(this, sMsg, VCL_MESSAGE_INFO);
+ aError->Execute();
m_pName->SetSelection(Selection(0,sCurrentText.getLength()));
m_pName->GrabFocus();
diff --git a/cui/source/options/doclinkdialog.hxx b/cui/source/options/doclinkdialog.hxx
index 0584734b761d..55493e9e9974 100644
--- a/cui/source/options/doclinkdialog.hxx
+++ b/cui/source/options/doclinkdialog.hxx
@@ -40,10 +40,10 @@ namespace svx
class ODocumentLinkDialog : public ModalDialog
{
protected:
- ::svt::OFileURLControl* m_pURL;
- PushButton* m_pBrowseFile;
- Edit* m_pName;
- OKButton* m_pOK;
+ VclPtr<::svt::OFileURLControl> m_pURL;
+ VclPtr<PushButton> m_pBrowseFile;
+ VclPtr<Edit> m_pName;
+ VclPtr<OKButton> m_pOK;
bool m_bCreatingNew;
@@ -51,6 +51,8 @@ namespace svx
public:
ODocumentLinkDialog( vcl::Window* _pParent, bool _bCreateNew );
+ virtual ~ODocumentLinkDialog();
+ virtual void dispose() SAL_OVERRIDE;
// name validation has to be done by an external instance
// the validator link gets a pointer to a String, and should return 0 if the string is not
diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx
index 955cac735640..4276de7311b7 100644
--- a/cui/source/options/fontsubs.cxx
+++ b/cui/source/options/fontsubs.cxx
@@ -62,7 +62,7 @@ SvxFontSubstTabPage::SvxFontSubstTabPage( vcl::Window* pParent,
pCheckLBContainer->set_width_request(aControlSize.Width());
pCheckLBContainer->set_height_request(aControlSize.Height());
- m_pCheckLB = new SvxFontSubstCheckListBox(*pCheckLBContainer, 0);
+ m_pCheckLB = VclPtr<SvxFontSubstCheckListBox>::Create(*pCheckLBContainer, 0);
m_pCheckLB->SetHelpId(HID_OFA_FONT_SUBST_CLB);
m_pCheckLB->SetStyle(m_pCheckLB->GetStyle()|WB_HSCROLL|WB_VSCROLL);
@@ -138,15 +138,32 @@ SvTreeListEntry* SvxFontSubstTabPage::CreateEntry(OUString& rFont1, OUString& rF
SvxFontSubstTabPage::~SvxFontSubstTabPage()
{
+ disposeOnce();
+}
+
+void SvxFontSubstTabPage::dispose()
+{
delete pCheckButtonData;
+ pCheckButtonData = NULL;
delete pConfig;
- delete m_pCheckLB;
+ pConfig = NULL;
+ m_pCheckLB.disposeAndClear();
+ m_pUseTableCB.clear();
+ m_pReplacements.clear();
+ m_pFont1CB.clear();
+ m_pFont2CB.clear();
+ m_pApply.clear();
+ m_pDelete.clear();
+ m_pFontNameLB.clear();
+ m_pNonPropFontsOnlyCB.clear();
+ m_pFontHeightLB.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* SvxFontSubstTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet)
+VclPtr<SfxTabPage> SvxFontSubstTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet)
{
- return new SvxFontSubstTabPage(pParent, *rAttrSet);
+ return VclPtr<SvxFontSubstTabPage>::Create(pParent, *rAttrSet);
}
bool SvxFontSubstTabPage::FillItemSet( SfxItemSet* )
diff --git a/cui/source/options/fontsubs.hxx b/cui/source/options/fontsubs.hxx
index d73e2b0f9926..27847da31464 100644
--- a/cui/source/options/fontsubs.hxx
+++ b/cui/source/options/fontsubs.hxx
@@ -63,18 +63,18 @@ class SvxFontSubstCheckListBox : public SvSimpleTable
class SvtFontSubstConfig;
class SvxFontSubstTabPage : public SfxTabPage
{
- CheckBox* m_pUseTableCB;
- VclContainer* m_pReplacements;
- FontNameBox* m_pFont1CB;
- FontNameBox* m_pFont2CB;
- PushButton* m_pApply;
- PushButton* m_pDelete;
+ VclPtr<CheckBox> m_pUseTableCB;
+ VclPtr<VclContainer> m_pReplacements;
+ VclPtr<FontNameBox> m_pFont1CB;
+ VclPtr<FontNameBox> m_pFont2CB;
+ VclPtr<PushButton> m_pApply;
+ VclPtr<PushButton> m_pDelete;
- SvxFontSubstCheckListBox* m_pCheckLB;
+ VclPtr<SvxFontSubstCheckListBox> m_pCheckLB;
- ListBox* m_pFontNameLB;
- CheckBox* m_pNonPropFontsOnlyCB;
- ListBox* m_pFontHeightLB;
+ VclPtr<ListBox> m_pFontNameLB;
+ VclPtr<CheckBox> m_pNonPropFontsOnlyCB;
+ VclPtr<ListBox> m_pFontHeightLB;
OUString m_sAutomatic;
@@ -91,11 +91,12 @@ class SvxFontSubstTabPage : public SfxTabPage
void CheckEnable();
- SvxFontSubstTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxFontSubstTabPage();
+ virtual void dispose() SAL_OVERRIDE;
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet);
+ SvxFontSubstTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet);
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
};
diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index c5ef749ec20f..851753d932c8 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -130,7 +130,7 @@ CuiAboutConfigTabPage::CuiAboutConfigTabPage( vcl::Window* pParent/*, const SfxI
m_pSearchBtn( get<PushButton>("searchButton") ),
m_pSearchEdit( get<Edit>("searchEntry") ),
m_vectorOfModified(),
- m_pPrefBox( new SvSimpleTable(*m_pPrefCtrl, WB_SCROLL | WB_HSCROLL | WB_VSCROLL ) )
+ m_pPrefBox( VclPtr<SvSimpleTable>::Create(*m_pPrefCtrl, WB_SCROLL | WB_HSCROLL | WB_VSCROLL ) )
{
Size aControlSize(LogicToPixel(Size(385, 230), MAP_APPFONT));
m_pPrefCtrl->set_width_request(aControlSize.Width());
@@ -164,6 +164,21 @@ CuiAboutConfigTabPage::CuiAboutConfigTabPage( vcl::Window* pParent/*, const SfxI
m_pPrefBox->SetAlternatingRowColors( true );
}
+CuiAboutConfigTabPage::~CuiAboutConfigTabPage()
+{
+ disposeOnce();
+}
+
+void CuiAboutConfigTabPage::dispose()
+{
+ m_pPrefCtrl.clear();
+ m_pResetBtn.clear();
+ m_pEditBtn.clear();
+ m_pSearchBtn.clear();
+ m_pSearchEdit.clear();
+ ModelessDialog::dispose();
+}
+
void CuiAboutConfigTabPage::InsertEntry(const OUString& rProp, const OUString& rStatus, const OUString& rType, const OUString& rValue)
{
SvTreeListEntry* pEntry = new SvTreeListEntry;
@@ -477,6 +492,17 @@ CuiAboutConfigValueDialog::CuiAboutConfigValueDialog( vcl::Window* pWindow,
}
+CuiAboutConfigValueDialog::~CuiAboutConfigValueDialog()
+{
+ disposeOnce();
+}
+
+void CuiAboutConfigValueDialog::dispose()
+{
+ m_pEDValue.clear();
+ ModalDialog::dispose();
+}
+
IMPL_LINK_NOARG( CuiAboutConfigTabPage, ResetBtnHdl_Impl )
{
Reset();
@@ -538,7 +564,7 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl )
else if( sPropertyType == "hyper" )
limit = HYPER_LEN_LIMIT;
- CuiAboutConfigValueDialog* pValueDialog = new CuiAboutConfigValueDialog(0, sDialogValue, limit);
+ VclPtrInstance<CuiAboutConfigValueDialog> pValueDialog(nullptr, sDialogValue, limit);
if( pValueDialog->Execute() == RET_OK )
{
diff --git a/cui/source/options/optaboutconfig.hxx b/cui/source/options/optaboutconfig.hxx
index dc19e4ae6539..b9ead63ef7e5 100644
--- a/cui/source/options/optaboutconfig.hxx
+++ b/cui/source/options/optaboutconfig.hxx
@@ -43,14 +43,14 @@ public:
class CuiAboutConfigTabPage : public ModelessDialog
{
private:
- SvSimpleTableContainer* m_pPrefCtrl;
- PushButton* m_pResetBtn;
- PushButton* m_pEditBtn;
- PushButton* m_pSearchBtn;
- Edit* m_pSearchEdit;
+ VclPtr<SvSimpleTableContainer> m_pPrefCtrl;
+ VclPtr<PushButton> m_pResetBtn;
+ VclPtr<PushButton> m_pEditBtn;
+ VclPtr<PushButton> m_pSearchBtn;
+ VclPtr<Edit> m_pSearchEdit;
std::vector< boost::shared_ptr< Prop_Impl > > m_vectorOfModified;
- boost::scoped_ptr< SvSimpleTable > m_pPrefBox;
+ VclPtr< SvSimpleTable > m_pPrefBox;
//for search
::com::sun::star::util::SearchOptions m_options;
@@ -65,6 +65,8 @@ private:
public:
CuiAboutConfigTabPage(vcl::Window* pParent);
+ virtual ~CuiAboutConfigTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void InsertEntry(const OUString& rProp, const OUString& rStatus, const OUString& rType, const OUString& rValue);
void Reset();
void FillItems(const com::sun::star::uno::Reference<com::sun::star::container::XNameAccess>& xNameAccess);
@@ -75,10 +77,12 @@ public:
class CuiAboutConfigValueDialog : public ModalDialog
{
private:
- CuiCustomMultilineEdit* m_pEDValue;
+ VclPtr<CuiCustomMultilineEdit> m_pEDValue;
public:
CuiAboutConfigValueDialog( vcl::Window* pWindow, const OUString& rValue , int limit = 0);
+ virtual ~CuiAboutConfigValueDialog();
+ virtual void dispose() SAL_OVERRIDE;
OUString getValue()
{
diff --git a/cui/source/options/optaccessibility.cxx b/cui/source/options/optaccessibility.cxx
index cccc1b428087..d781ed26dd54 100644
--- a/cui/source/options/optaccessibility.cxx
+++ b/cui/source/options/optaccessibility.cxx
@@ -58,12 +58,28 @@ SvxAccessibilityOptionsTabPage::SvxAccessibilityOptionsTabPage(vcl::Window* pPar
SvxAccessibilityOptionsTabPage::~SvxAccessibilityOptionsTabPage()
{
+ disposeOnce();
+}
+
+void SvxAccessibilityOptionsTabPage::dispose()
+{
delete m_pImpl;
+ m_pImpl = NULL;
+ m_pAccessibilityTool.clear();
+ m_pTextSelectionInReadonly.clear();
+ m_pAnimatedGraphics.clear();
+ m_pAnimatedTexts.clear();
+ m_pTipHelpCB.clear();
+ m_pTipHelpNF.clear();
+ m_pAutoDetectHC.clear();
+ m_pAutomaticFontColor.clear();
+ m_pPagePreviews.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* SvxAccessibilityOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> SvxAccessibilityOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return new SvxAccessibilityOptionsTabPage(pParent, *rAttrSet);
+ return VclPtr<SvxAccessibilityOptionsTabPage>::Create(pParent, *rAttrSet);
}
bool SvxAccessibilityOptionsTabPage::FillItemSet( SfxItemSet* )
diff --git a/cui/source/options/optaccessibility.hxx b/cui/source/options/optaccessibility.hxx
index c63c37dac682..16e4c3a97bd3 100644
--- a/cui/source/options/optaccessibility.hxx
+++ b/cui/source/options/optaccessibility.hxx
@@ -25,27 +25,27 @@
struct SvxAccessibilityOptionsTabPage_Impl;
class SvxAccessibilityOptionsTabPage : public SfxTabPage
{
- CheckBox* m_pAccessibilityTool;
- CheckBox* m_pTextSelectionInReadonly;
- CheckBox* m_pAnimatedGraphics;
- CheckBox* m_pAnimatedTexts;
- CheckBox* m_pTipHelpCB;
- NumericField* m_pTipHelpNF;
- CheckBox* m_pAutoDetectHC;
- CheckBox* m_pAutomaticFontColor;
- CheckBox* m_pPagePreviews;
+ VclPtr<CheckBox> m_pAccessibilityTool;
+ VclPtr<CheckBox> m_pTextSelectionInReadonly;
+ VclPtr<CheckBox> m_pAnimatedGraphics;
+ VclPtr<CheckBox> m_pAnimatedTexts;
+ VclPtr<CheckBox> m_pTipHelpCB;
+ VclPtr<NumericField> m_pTipHelpNF;
+ VclPtr<CheckBox> m_pAutoDetectHC;
+ VclPtr<CheckBox> m_pAutomaticFontColor;
+ VclPtr<CheckBox> m_pPagePreviews;
DECL_LINK(TipHelpHdl, CheckBox*);
void EnableTipHelp(bool bCheck);
SvxAccessibilityOptionsTabPage_Impl* m_pImpl;
- SvxAccessibilityOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
public:
-
+ SvxAccessibilityOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxAccessibilityOptionsTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
};
diff --git a/cui/source/options/optasian.cxx b/cui/source/options/optasian.cxx
index d944b5f891e3..c16711f621a4 100644
--- a/cui/source/options/optasian.cxx
+++ b/cui/source/options/optasian.cxx
@@ -151,12 +151,32 @@ SvxAsianLayoutPage::SvxAsianLayoutPage( vcl::Window* pParent, const SfxItemSet&
SvxAsianLayoutPage::~SvxAsianLayoutPage()
{
+ disposeOnce();
+}
+
+void SvxAsianLayoutPage::dispose()
+{
delete pImpl;
+ pImpl = NULL;
+ m_pCharKerningRB.clear();
+ m_pCharPunctKerningRB.clear();
+ m_pNoCompressionRB.clear();
+ m_pPunctCompressionRB.clear();
+ m_pPunctKanaCompressionRB.clear();
+ m_pLanguageFT.clear();
+ m_pLanguageLB.clear();
+ m_pStandardCB.clear();
+ m_pStartFT.clear();
+ m_pStartED.clear();
+ m_pEndFT.clear();
+ m_pEndED.clear();
+ m_pHintFT.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* SvxAsianLayoutPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> SvxAsianLayoutPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return new SvxAsianLayoutPage(pParent, *rAttrSet);
+ return VclPtr<SvxAsianLayoutPage>::Create(pParent, *rAttrSet);
}
bool SvxAsianLayoutPage::FillItemSet( SfxItemSet* )
diff --git a/cui/source/options/optbasic.cxx b/cui/source/options/optbasic.cxx
index 2c5498e97934..913b8a230f0f 100644
--- a/cui/source/options/optbasic.cxx
+++ b/cui/source/options/optbasic.cxx
@@ -47,6 +47,18 @@ SvxBasicIDEOptionsPage::SvxBasicIDEOptionsPage( vcl::Window* pParent, const SfxI
SvxBasicIDEOptionsPage::~SvxBasicIDEOptionsPage()
{
+ disposeOnce();
+}
+
+void SvxBasicIDEOptionsPage::dispose()
+{
+ pCodeCompleteChk.clear();
+ pAutocloseProcChk.clear();
+ pAutocloseParenChk.clear();
+ pAutocloseQuotesChk.clear();
+ pAutoCorrectChk.clear();
+ pUseExtendedTypesChk.clear();
+ SfxTabPage::dispose();
}
void SvxBasicIDEOptionsPage::LoadConfig()
@@ -136,9 +148,9 @@ void SvxBasicIDEOptionsPage::Reset( const SfxItemSet* /*rSet*/ )
pUseExtendedTypesChk->SaveValue();
}
-SfxTabPage* SvxBasicIDEOptionsPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> SvxBasicIDEOptionsPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return ( new SvxBasicIDEOptionsPage( pParent, *rAttrSet ) );
+ return VclPtr<SvxBasicIDEOptionsPage>::Create( pParent, *rAttrSet );
}
void SvxBasicIDEOptionsPage::FillUserData()
diff --git a/cui/source/options/optbasic.hxx b/cui/source/options/optbasic.hxx
index 5b1959d9f5a6..dc617b1fea3a 100644
--- a/cui/source/options/optbasic.hxx
+++ b/cui/source/options/optbasic.hxx
@@ -27,20 +27,21 @@
class SvxBasicIDEOptionsPage: public SfxTabPage
{
private:
- CheckBox* pCodeCompleteChk;
- CheckBox* pAutocloseProcChk;
- CheckBox* pAutocloseParenChk;
- CheckBox* pAutocloseQuotesChk;
- CheckBox* pAutoCorrectChk;
- CheckBox* pUseExtendedTypesChk;
+ VclPtr<CheckBox> pCodeCompleteChk;
+ VclPtr<CheckBox> pAutocloseProcChk;
+ VclPtr<CheckBox> pAutocloseParenChk;
+ VclPtr<CheckBox> pAutocloseQuotesChk;
+ VclPtr<CheckBox> pAutoCorrectChk;
+ VclPtr<CheckBox> pUseExtendedTypesChk;
void LoadConfig();
public:
SvxBasicIDEOptionsPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxBasicIDEOptionsPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void FillUserData() SAL_OVERRIDE;
diff --git a/cui/source/options/optchart.cxx b/cui/source/options/optchart.cxx
index 55d002d70e51..f9e3c0e22d40 100644
--- a/cui/source/options/optchart.cxx
+++ b/cui/source/options/optchart.cxx
@@ -83,12 +83,28 @@ SvxDefaultColorOptPage::SvxDefaultColorOptPage(vcl::Window* pParent, const SfxIt
SvxDefaultColorOptPage::~SvxDefaultColorOptPage()
{
+ disposeOnce();
+}
+
+void SvxDefaultColorOptPage::dispose()
+{
// save changes
- pChartOptions->SetDefaultColors( pColorConfig->GetColorList() );
- pChartOptions->Commit();
+ if (pChartOptions)
+ {
+ pChartOptions->SetDefaultColors( pColorConfig->GetColorList() );
+ pChartOptions->Commit();
- delete pColorConfig;
- delete pChartOptions;
+ delete pColorConfig;
+ pColorConfig = NULL;
+ delete pChartOptions;
+ pChartOptions = NULL;
+ }
+ m_pLbChartColors.clear();
+ m_pValSetColorBox.clear();
+ m_pPBDefault.clear();
+ m_pPBAdd.clear();
+ m_pPBRemove.clear();
+ SfxTabPage::dispose();
}
void SvxDefaultColorOptPage::Construct()
@@ -103,9 +119,9 @@ void SvxDefaultColorOptPage::Construct()
}
-SfxTabPage* SvxDefaultColorOptPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrs )
+VclPtr<SfxTabPage> SvxDefaultColorOptPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrs )
{
- return new SvxDefaultColorOptPage( pParent, *rAttrs );
+ return VclPtr<SvxDefaultColorOptPage>::Create( pParent, *rAttrs );
}
bool SvxDefaultColorOptPage::FillItemSet( SfxItemSet* rOutAttrs )
@@ -215,9 +231,9 @@ IMPL_LINK( SvxDefaultColorOptPage, RemoveChartColor, PushButton*, pButton )
{
OSL_ENSURE(pColorConfig->GetColorList().size() > 1, "don't delete the last chart color");
- MessageDialog aQuery(pButton, "QueryDeleteChartColorDialog",
- "cui/ui/querydeletechartcolordialog.ui");
- if (RET_YES == aQuery.Execute())
+ ScopedVclPtrInstance<MessageDialog> aQuery(pButton, "QueryDeleteChartColorDialog",
+ "cui/ui/querydeletechartcolordialog.ui");
+ if (RET_YES == aQuery->Execute())
{
pColorConfig->GetColorList().remove( nIndex );
diff --git a/cui/source/options/optchart.hxx b/cui/source/options/optchart.hxx
index 0f210e1ccd15..506b9c87f1a0 100644
--- a/cui/source/options/optchart.hxx
+++ b/cui/source/options/optchart.hxx
@@ -33,11 +33,11 @@ class SvxDefaultColorOptPage : public SfxTabPage
{
private:
- ColorLB* m_pLbChartColors;
- ValueSet* m_pValSetColorBox;
- PushButton* m_pPBDefault;
- PushButton* m_pPBAdd;
- PushButton* m_pPBRemove;
+ VclPtr<ColorLB> m_pLbChartColors;
+ VclPtr<ValueSet> m_pValSetColorBox;
+ VclPtr<PushButton> m_pPBDefault;
+ VclPtr<PushButton> m_pPBAdd;
+ VclPtr<PushButton> m_pPBRemove;
SvxChartOptions* pChartOptions;
SvxChartColorTableItem* pColorConfig;
@@ -55,10 +55,11 @@ private:
public:
SvxDefaultColorOptPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
virtual ~SvxDefaultColorOptPage();
+ virtual void dispose() SAL_OVERRIDE;
void Construct();
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rInAttrs );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rInAttrs );
virtual bool FillItemSet( SfxItemSet* rOutAttrs ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rInAttrs ) SAL_OVERRIDE;
};
diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index e71e31b02df2..a8e8c8e9bed8 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -174,7 +174,8 @@ class ColorConfigWindow_Impl
{
public:
ColorConfigWindow_Impl(vcl::Window* pParent);
- virtual ~ColorConfigWindow_Impl();
+ virtual ~ColorConfigWindow_Impl() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE;
public:
void SetLinks (Link const&, Link const&, Link const&);
@@ -192,8 +193,7 @@ private:
class Chapter
{
// text
- bool m_bOwnsWidget;
- FixedText *m_pText;
+ VclPtr<FixedText> m_pText;
public:
Chapter(FixedText *pText, bool bShow);
Chapter(vcl::Window *pGrid, unsigned nYPos, const OUString& sDisplayName);
@@ -234,11 +234,11 @@ private:
private:
bool m_bOwnsWidgets;
// checkbox (CheckBox) or simple text (FixedText)
- Control* m_pText;
+ VclPtr<Control> m_pText;
// color list box
- ColorListBox* m_pColorList;
+ VclPtr<ColorListBox> m_pColorList;
// color preview box
- vcl::Window* m_pPreview;
+ VclPtr<vcl::Window> m_pPreview;
// default color
Color m_aDefaultColor;
private:
@@ -255,9 +255,9 @@ private:
private:
- VclGrid *m_pGrid;
- ScrollBar *m_pVScroll;
- HeaderBar *m_pHeaderHB;
+ VclPtr<VclGrid> m_pGrid;
+ VclPtr<ScrollBar> m_pVScroll;
+ VclPtr<HeaderBar> m_pHeaderHB;
// initialization
void CreateEntries();
@@ -282,8 +282,7 @@ private:
// eGroup: which group is this?
// rResMgr: resource manager
ColorConfigWindow_Impl::Chapter::Chapter(FixedText* pText, bool bShow)
- : m_bOwnsWidget(false)
- , m_pText(pText)
+ : m_pText(pText)
{
if (!bShow)
Hide();
@@ -292,9 +291,8 @@ ColorConfigWindow_Impl::Chapter::Chapter(FixedText* pText, bool bShow)
// ctor for extended groups
ColorConfigWindow_Impl::Chapter::Chapter(vcl::Window *pGrid,
unsigned nYPos, const OUString& rDisplayName)
- : m_bOwnsWidget(true)
{
- m_pText = new FixedText(pGrid, WB_LEFT|WB_VCENTER|WB_3DLOOK);
+ m_pText = VclPtr<FixedText>::Create(pGrid, WB_LEFT|WB_VCENTER|WB_3DLOOK);
m_pText->set_font_attribute("weight", "bold");
m_pText->set_grid_width(3);
m_pText->set_grid_left_attach(0);
@@ -304,8 +302,8 @@ ColorConfigWindow_Impl::Chapter::Chapter(vcl::Window *pGrid,
ColorConfigWindow_Impl::Chapter::~Chapter()
{
- if (m_bOwnsWidget)
- delete m_pText;
+ // FIXME: we had an horrible m_bOwnsWidget const
+ m_pText.disposeAndClear();
}
void ColorConfigWindow_Impl::Chapter::Show(Wallpaper const& rBackWall)
@@ -348,19 +346,19 @@ ColorConfigWindow_Impl::Entry::Entry( vcl::Window *pGrid, unsigned nYPos,
: m_bOwnsWidgets(true)
, m_aDefaultColor(rColorEntry.getDefaultColor())
{
- m_pText = new FixedText(pGrid, WB_LEFT|WB_VCENTER|WB_3DLOOK);
+ m_pText = VclPtr<FixedText>::Create(pGrid, WB_LEFT|WB_VCENTER|WB_3DLOOK);
m_pText->set_grid_left_attach(0);
m_pText->set_grid_top_attach(nYPos);
m_pText->set_margin_left(6 + nCheckBoxLabelOffset);
m_pText->SetText(rColorEntry.getDisplayName());
WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP|WB_DROPDOWN;
- m_pColorList = new ColorListBox(pGrid, nWinBits);
+ m_pColorList = VclPtr<ColorListBox>::Create(pGrid, nWinBits);
m_pColorList->EnableAutoSize(true);
m_pColorList->set_grid_left_attach(1);
m_pColorList->set_grid_top_attach(nYPos);
- m_pPreview = new vcl::Window(pGrid, WB_BORDER);
+ m_pPreview = VclPtr<vcl::Window>::Create(pGrid, WB_BORDER);
m_pPreview->set_grid_left_attach(2);
m_pPreview->set_grid_top_attach(nYPos);
m_pPreview->set_margin_right(6);
@@ -372,9 +370,9 @@ ColorConfigWindow_Impl::Entry::~Entry()
{
if (m_bOwnsWidgets)
{
- delete m_pText;
- delete m_pColorList;
- delete m_pPreview;
+ m_pText.disposeAndClear();
+ m_pColorList.disposeAndClear();
+ m_pPreview.disposeAndClear();
}
}
@@ -416,7 +414,7 @@ void ColorConfigWindow_Impl::Entry::SetLinks(
{
m_pColorList->SetSelectHdl(aColorLink);
m_pColorList->SetGetFocusHdl(aGetFocusLink);
- if (CheckBox* pCheckBox = dynamic_cast<CheckBox*>(m_pText))
+ if (CheckBox* pCheckBox = dynamic_cast<CheckBox*>(m_pText.get()))
{
pCheckBox->SetClickHdl(aCheckLink);
pCheckBox->SetGetFocusHdl(aGetFocusLink);
@@ -439,7 +437,7 @@ void ColorConfigWindow_Impl::Entry::Update (
m_pColorList->SelectEntry(aColor);
}
m_pPreview->SetBackground(Wallpaper(aColor));
- if (CheckBox* pCheckBox = dynamic_cast<CheckBox*>(m_pText))
+ if (CheckBox* pCheckBox = dynamic_cast<CheckBox*>(m_pText.get()))
pCheckBox->Check(rValue.bIsVisible);
}
@@ -509,6 +507,15 @@ ColorConfigWindow_Impl::ColorConfigWindow_Impl(vcl::Window* pParent)
SetAppearance();
}
+void ColorConfigWindow_Impl::dispose()
+{
+ disposeBuilder();
+ m_pGrid.clear();
+ m_pVScroll.clear();
+ m_pHeaderHB.clear();
+ VclContainer::dispose();
+}
+
Size ColorConfigWindow_Impl::calculateRequisition() const
{
return getLayoutRequisition(*m_pGrid);
@@ -546,12 +553,12 @@ void ColorConfigWindow_Impl::CreateEntries()
long nCheckBoxLabelOffset = 0;
{
OUString sSampleText("X");
- CheckBox aCheckBox(this);
- FixedText aFixedText(this);
- aCheckBox.SetText(sSampleText);
- aFixedText.SetText(sSampleText);
- Size aCheckSize(aCheckBox.CalcMinimumSize(0x7fffffff));
- Size aFixedSize(aFixedText.CalcMinimumSize(0x7fffffff));
+ ScopedVclPtrInstance< CheckBox > aCheckBox(this);
+ ScopedVclPtrInstance< FixedText > aFixedText(this);
+ aCheckBox->SetText(sSampleText);
+ aFixedText->SetText(sSampleText);
+ Size aCheckSize(aCheckBox->CalcMinimumSize(0x7fffffff));
+ Size aFixedSize(aFixedText->CalcMinimumSize(0x7fffffff));
nCheckBoxLabelOffset = aCheckSize.Width() - aFixedSize.Width();
}
@@ -621,13 +628,13 @@ void ColorConfigWindow_Impl::SetAppearance ()
OSL_ENSURE( vEntries.size() >= sizeof vEntryInfo / sizeof vEntryInfo[0], "wrong number of helpIDs for color listboxes" );
// creating a sample color listbox with the color entries
- ColorListBox aSampleColorList(this);
+ ScopedVclPtrInstance< ColorListBox > aSampleColorList(this);
{
XColorListRef const xColorTable = XColorList::CreateStdColorList();
for (sal_Int32 i = 0; i != xColorTable->Count(); ++i)
{
XColorEntry& rEntry = *xColorTable->GetColor(i);
- aSampleColorList.InsertEntry(rEntry.GetColor(), rEntry.GetName());
+ aSampleColorList->InsertEntry(rEntry.GetColor(), rEntry.GetName());
}
}
@@ -635,13 +642,10 @@ void ColorConfigWindow_Impl::SetAppearance ()
for (size_t i = 0; i != vEntries.size(); ++i)
{
// appearance
- vEntries[i]->SetAppearance(aTransparentWall, aSampleColorList);
+ vEntries[i]->SetAppearance(aTransparentWall, *aSampleColorList.get());
}
}
-ColorConfigWindow_Impl::~ColorConfigWindow_Impl ()
-{ }
-
void ColorConfigWindow_Impl::AdjustHeaderBar()
{
// horizontal positions
@@ -823,10 +827,10 @@ void ColorConfigWindow_Impl::Command( const CommandEvent& rCEvt )
class ColorConfigCtrl_Impl : public VclVBox
{
- HeaderBar* m_pHeaderHB;
- VclHBox* m_pBody;
- ColorConfigWindow_Impl* m_pScrollWindow;
- ScrollBar* m_pVScroll;
+ VclPtr<HeaderBar> m_pHeaderHB;
+ VclPtr<VclHBox> m_pBody;
+ VclPtr<ColorConfigWindow_Impl> m_pScrollWindow;
+ VclPtr<ScrollBar> m_pVScroll;
EditableColorConfig* pColorConfig;
EditableExtendedColorConfig* pExtColorConfig;
@@ -842,6 +846,7 @@ class ColorConfigCtrl_Impl : public VclVBox
public:
ColorConfigCtrl_Impl(vcl::Window* pParent);
virtual ~ColorConfigCtrl_Impl();
+ virtual void dispose() SAL_OVERRIDE;
void InitHeaderBar(const OUString &rOn, const OUString &rUIElems,
const OUString &rColorSetting, const OUString &rPreview);
@@ -864,11 +869,11 @@ ColorConfigCtrl_Impl::ColorConfigCtrl_Impl(vcl::Window* pParent)
, pColorConfig(0)
, pExtColorConfig(0)
{
- m_pHeaderHB = new HeaderBar(this, WB_BUTTONSTYLE | WB_BOTTOMBORDER);
+ m_pHeaderHB = VclPtr<HeaderBar>::Create(this, WB_BUTTONSTYLE | WB_BOTTOMBORDER);
- m_pBody = new VclHBox(this);
- m_pScrollWindow = new ColorConfigWindow_Impl(m_pBody);
- m_pVScroll = new ScrollBar(m_pBody, WB_VERT);
+ m_pBody = VclPtr<VclHBox>::Create(this);
+ m_pScrollWindow = VclPtr<ColorConfigWindow_Impl>::Create(m_pBody);
+ m_pVScroll = VclPtr<ScrollBar>::Create(m_pBody, WB_VERT);
m_pScrollWindow->Init(m_pVScroll, m_pHeaderHB);
m_pBody->set_hexpand(true);
@@ -910,10 +915,16 @@ void ColorConfigCtrl_Impl::InitHeaderBar(const OUString &rOn, const OUString &rU
ColorConfigCtrl_Impl::~ColorConfigCtrl_Impl()
{
- delete m_pVScroll;
- delete m_pScrollWindow;
- delete m_pBody;
- delete m_pHeaderHB;
+ disposeOnce();
+}
+
+void ColorConfigCtrl_Impl::dispose()
+{
+ m_pVScroll.disposeAndClear();
+ m_pScrollWindow.disposeAndClear();
+ m_pBody.disposeAndClear();
+ m_pHeaderHB.disposeAndClear();
+ VclVBox::dispose();
}
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeColorConfigCtrl(vcl::Window *pParent, VclBuilder::stringmap &)
@@ -1056,28 +1067,44 @@ SvxColorOptionsTabPage::SvxColorOptionsTabPage(
SvxColorOptionsTabPage::~SvxColorOptionsTabPage()
{
- //when the dialog is cancelled but the color scheme ListBox has been changed these
- //changes need to be undone
- if(!bFillItemSetCalled && m_pColorSchemeLB->IsValueChangedFromSaved())
+ disposeOnce();
+}
+
+void SvxColorOptionsTabPage::dispose()
+{
+ if (pColorConfig)
{
- OUString sOldScheme = m_pColorSchemeLB->GetEntry(m_pColorSchemeLB->GetSavedValue());
- if(!sOldScheme.isEmpty())
+ //when the dialog is cancelled but the color scheme ListBox has been changed these
+ //changes need to be undone
+ if(!bFillItemSetCalled && m_pColorSchemeLB->IsValueChangedFromSaved())
{
- pColorConfig->SetCurrentSchemeName(sOldScheme);
- pExtColorConfig->SetCurrentSchemeName(sOldScheme);
+ OUString sOldScheme = m_pColorSchemeLB->GetEntry(m_pColorSchemeLB->GetSavedValue());
+ if(!sOldScheme.isEmpty())
+ {
+ pColorConfig->SetCurrentSchemeName(sOldScheme);
+ pExtColorConfig->SetCurrentSchemeName(sOldScheme);
+ }
}
+ pColorConfig->ClearModified();
+ pColorConfig->EnableBroadcast();
+ delete pColorConfig;
+ pColorConfig = NULL;
+
+ pExtColorConfig->ClearModified();
+ pExtColorConfig->EnableBroadcast();
+ delete pExtColorConfig;
+ pExtColorConfig = NULL;
}
- pColorConfig->ClearModified();
- pColorConfig->EnableBroadcast();
- delete pColorConfig;
- pExtColorConfig->ClearModified();
- pExtColorConfig->EnableBroadcast();
- delete pExtColorConfig;
+ m_pColorSchemeLB.clear();
+ m_pSaveSchemePB.clear();
+ m_pDeleteSchemePB.clear();
+ m_pColorConfigCT.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* SvxColorOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> SvxColorOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return ( new SvxColorOptionsTabPage( pParent, *rAttrSet ) );
+ return VclPtr<SvxColorOptionsTabPage>::Create( pParent, *rAttrSet );
}
bool SvxColorOptionsTabPage::FillItemSet( SfxItemSet* )
@@ -1178,9 +1205,9 @@ IMPL_LINK(SvxColorOptionsTabPage, SaveDeleteHdl_Impl, PushButton*, pButton )
else
{
DBG_ASSERT(m_pColorSchemeLB->GetEntryCount() > 1, "don't delete the last scheme");
- MessageDialog aQuery(pButton, CUI_RES(RID_SVXSTR_COLOR_CONFIG_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
- aQuery.SetText(CUI_RES(RID_SVXSTR_COLOR_CONFIG_DELETE_TITLE));
- if(RET_YES == aQuery.Execute())
+ ScopedVclPtrInstance< MessageDialog > aQuery(pButton, CUI_RES(RID_SVXSTR_COLOR_CONFIG_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ aQuery->SetText(CUI_RES(RID_SVXSTR_COLOR_CONFIG_DELETE_TITLE));
+ if(RET_YES == aQuery->Execute())
{
OUString sDeleteScheme(m_pColorSchemeLB->GetSelectEntry());
m_pColorSchemeLB->RemoveEntry(m_pColorSchemeLB->GetSelectEntryPos());
diff --git a/cui/source/options/optcolor.hxx b/cui/source/options/optcolor.hxx
index 494874831f6c..c16c2973ee0f 100644
--- a/cui/source/options/optcolor.hxx
+++ b/cui/source/options/optcolor.hxx
@@ -31,10 +31,10 @@ class SvxColorOptionsTabPage : public SfxTabPage
{
using SfxTabPage::DeactivatePage;
- ListBox* m_pColorSchemeLB;
- PushButton* m_pSaveSchemePB;
- PushButton* m_pDeleteSchemePB;
- ColorConfigCtrl_Impl* m_pColorConfigCT;
+ VclPtr<ListBox> m_pColorSchemeLB;
+ VclPtr<PushButton> m_pSaveSchemePB;
+ VclPtr<PushButton> m_pDeleteSchemePB;
+ VclPtr<ColorConfigCtrl_Impl> m_pColorConfigCT;
bool bFillItemSetCalled;
@@ -49,8 +49,9 @@ class SvxColorOptionsTabPage : public SfxTabPage
public:
SvxColorOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxColorOptionsTabPage( );
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
diff --git a/cui/source/options/optctl.cxx b/cui/source/options/optctl.cxx
index 45430195bc94..652bba938bf9 100644
--- a/cui/source/options/optctl.cxx
+++ b/cui/source/options/optctl.cxx
@@ -59,11 +59,23 @@ SvxCTLOptionsPage::SvxCTLOptionsPage( vcl::Window* pParent, const SfxItemSet& rS
SvxCTLOptionsPage::~SvxCTLOptionsPage()
{
+ disposeOnce();
}
-SfxTabPage* SvxCTLOptionsPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+void SvxCTLOptionsPage::dispose()
{
- return new SvxCTLOptionsPage( pParent, *rAttrSet );
+ m_pSequenceCheckingCB.clear();
+ m_pRestrictedCB.clear();
+ m_pTypeReplaceCB.clear();
+ m_pMovementLogicalRB.clear();
+ m_pMovementVisualRB.clear();
+ m_pNumeralsLB.clear();
+ SfxTabPage::dispose();
+}
+
+VclPtr<SfxTabPage> SvxCTLOptionsPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+{
+ return VclPtr<SvxCTLOptionsPage>::Create( pParent, *rAttrSet );
}
bool SvxCTLOptionsPage::FillItemSet( SfxItemSet* )
diff --git a/cui/source/options/optctl.hxx b/cui/source/options/optctl.hxx
index 3ab62ad2c09d..ac2544d47c27 100644
--- a/cui/source/options/optctl.hxx
+++ b/cui/source/options/optctl.hxx
@@ -30,24 +30,22 @@ class SvxCTLOptionsPage : public SfxTabPage
{
private:
- CheckBox* m_pSequenceCheckingCB;
- CheckBox* m_pRestrictedCB;
- CheckBox* m_pTypeReplaceCB;
+ VclPtr<CheckBox> m_pSequenceCheckingCB;
+ VclPtr<CheckBox> m_pRestrictedCB;
+ VclPtr<CheckBox> m_pTypeReplaceCB;
- RadioButton* m_pMovementLogicalRB;
- RadioButton* m_pMovementVisualRB;
+ VclPtr<RadioButton> m_pMovementLogicalRB;
+ VclPtr<RadioButton> m_pMovementVisualRB;
- ListBox* m_pNumeralsLB;
+ VclPtr<ListBox> m_pNumeralsLB;
DECL_LINK( SequenceCheckingCB_Hdl, void* );
- SvxCTLOptionsPage( vcl::Window* pParent, const SfxItemSet& rSet );
-
public:
-
+ SvxCTLOptionsPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxCTLOptionsPage();
-
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
};
diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx
index d7d0c7297b2c..4d154e26f0f0 100644
--- a/cui/source/options/optdict.cxx
+++ b/cui/source/options/optdict.cxx
@@ -117,6 +117,19 @@ SvxNewDictionaryDialog::SvxNewDictionaryDialog( vcl::Window* pParent,
pLanguageLB->SelectEntryPos(0);
}
+SvxNewDictionaryDialog::~SvxNewDictionaryDialog()
+{
+ disposeOnce();
+}
+
+void SvxNewDictionaryDialog::dispose()
+{
+ pNameEdit.clear();
+ pLanguageLB.clear();
+ pExceptBtn.clear();
+ pOKBtn.clear();
+ ModalDialog::dispose();
+}
IMPL_LINK_NOARG(SvxNewDictionaryDialog, OKHdl_Impl)
@@ -212,8 +225,7 @@ IMPL_LINK_NOARG_INLINE_END(SvxNewDictionaryDialog, ModifyHdl_Impl)
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvxDictEdit(vcl::Window *pParent, VclBuilder::stringmap&)
{
WinBits nWinStyle = WB_LEFT|WB_VCENTER|WB_BORDER|WB_3DLOOK;
- SvxDictEdit *pEdit = new SvxDictEdit(pParent, nWinStyle);
- return pEdit;
+ return new SvxDictEdit(pParent, nWinStyle);
};
SvxEditDictionaryDialog::SvxEditDictionaryDialog(
@@ -331,10 +343,23 @@ SvxEditDictionaryDialog::SvxEditDictionaryDialog(
}
}
-
-
SvxEditDictionaryDialog::~SvxEditDictionaryDialog()
{
+ disposeOnce();
+}
+
+void SvxEditDictionaryDialog::dispose()
+{
+ pAllDictsLB.clear();
+ pLangFT.clear();
+ pLangLB.clear();
+ pWordED.clear();
+ pReplaceFT.clear();
+ pReplaceED.clear();
+ pWordsLB.clear();
+ pNewReplacePB.clear();
+ pDeletePB.clear();
+ ModalDialog::dispose();
}
@@ -451,12 +476,12 @@ IMPL_LINK_NOARG(SvxEditDictionaryDialog, SelectLangHdl_Impl)
if ( nLang != nOldLang )
{
- MessageDialog aBox(this, CUI_RES( RID_SVXSTR_CONFIRM_SET_LANGUAGE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
- OUString sTxt(aBox.get_primary_text());
+ ScopedVclPtrInstance< MessageDialog > aBox(this, CUI_RES( RID_SVXSTR_CONFIRM_SET_LANGUAGE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ OUString sTxt(aBox->get_primary_text());
sTxt = sTxt.replaceFirst( "%1", pAllDictsLB->GetSelectEntry() );
- aBox.set_primary_text(sTxt);
+ aBox->set_primary_text(sTxt);
- if ( aBox.Execute() == RET_YES )
+ if ( aBox->Execute() == RET_YES )
{
xDic->setLocale( LanguageTag::convertToLocale( nLang ) );
bool bNegativ = xDic->getDictionaryType() == DictionaryType_NEGATIVE;
diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx
index f3f1df5d2013..cd6858228f3c 100644
--- a/cui/source/options/optfltr.cxx
+++ b/cui/source/options/optfltr.cxx
@@ -56,8 +56,23 @@ OfaMSFilterTabPage::OfaMSFilterTabPage(vcl::Window* pParent, const SfxItemSet& r
OfaMSFilterTabPage::~OfaMSFilterTabPage()
{
+ disposeOnce();
}
+void OfaMSFilterTabPage::dispose()
+{
+ aWBasicCodeCB.clear();
+ aWBasicWbctblCB.clear();
+ aWBasicStgCB.clear();
+ aEBasicCodeCB.clear();
+ aEBasicExectblCB.clear();
+ aEBasicStgCB.clear();
+ aPBasicCodeCB.clear();
+ aPBasicStgCB.clear();
+ SfxTabPage::dispose();
+}
+
+
IMPL_LINK_NOARG(OfaMSFilterTabPage, LoadWordBasicCheckHdl_Impl)
{
aWBasicWbctblCB->Enable( aWBasicCodeCB->IsChecked() );
@@ -70,10 +85,10 @@ IMPL_LINK_NOARG(OfaMSFilterTabPage, LoadExcelBasicCheckHdl_Impl)
return 0;
}
-SfxTabPage* OfaMSFilterTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> OfaMSFilterTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet )
{
- return new OfaMSFilterTabPage( pParent, *rAttrSet );
+ return VclPtr<OfaMSFilterTabPage>::Create( pParent, *rAttrSet );
}
bool OfaMSFilterTabPage::FillItemSet( SfxItemSet* )
@@ -149,7 +164,7 @@ OfaMSFilterTabPage2::OfaMSFilterTabPage2( vcl::Window* pParent, const SfxItemSet
m_pCheckLBContainer->set_width_request(aControlSize.Width());
m_pCheckLBContainer->set_height_request(aControlSize.Height());
- m_pCheckLB = new MSFltrSimpleTable(*m_pCheckLBContainer);
+ m_pCheckLB = VclPtr<MSFltrSimpleTable>::Create(*m_pCheckLBContainer);
static long aStaticTabs[] = { 3, 0, 20, 40 };
m_pCheckLB->SvSimpleTable::SetTabs( aStaticTabs );
@@ -163,14 +178,25 @@ OfaMSFilterTabPage2::OfaMSFilterTabPage2( vcl::Window* pParent, const SfxItemSet
OfaMSFilterTabPage2::~OfaMSFilterTabPage2()
{
+ disposeOnce();
+}
+
+void OfaMSFilterTabPage2::dispose()
+{
delete pCheckButtonData;
- delete m_pCheckLB;
+ pCheckButtonData = NULL;
+ m_pCheckLB.clear();
+ m_pCheckLBContainer.clear();
+ aHighlightingRB.clear();
+ aShadingRB.clear();
+
+ SfxTabPage::dispose();
}
-SfxTabPage* OfaMSFilterTabPage2::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> OfaMSFilterTabPage2::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet )
{
- return new OfaMSFilterTabPage2( pParent, *rAttrSet );
+ return VclPtr<OfaMSFilterTabPage2>::Create( pParent, *rAttrSet );
}
bool OfaMSFilterTabPage2::FillItemSet( SfxItemSet* )
diff --git a/cui/source/options/optfltr.hxx b/cui/source/options/optfltr.hxx
index 38d280b52a46..221c705f3ae1 100644
--- a/cui/source/options/optfltr.hxx
+++ b/cui/source/options/optfltr.hxx
@@ -27,23 +27,24 @@
class OfaMSFilterTabPage : public SfxTabPage
{
- CheckBox* aWBasicCodeCB;
- CheckBox* aWBasicWbctblCB;
- CheckBox* aWBasicStgCB;
- CheckBox* aEBasicCodeCB;
- CheckBox* aEBasicExectblCB;
- CheckBox* aEBasicStgCB;
- CheckBox* aPBasicCodeCB;
- CheckBox* aPBasicStgCB;
+ VclPtr<CheckBox> aWBasicCodeCB;
+ VclPtr<CheckBox> aWBasicWbctblCB;
+ VclPtr<CheckBox> aWBasicStgCB;
+ VclPtr<CheckBox> aEBasicCodeCB;
+ VclPtr<CheckBox> aEBasicExectblCB;
+ VclPtr<CheckBox> aEBasicStgCB;
+ VclPtr<CheckBox> aPBasicCodeCB;
+ VclPtr<CheckBox> aPBasicStgCB;
- OfaMSFilterTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
- virtual ~OfaMSFilterTabPage();
DECL_LINK(LoadWordBasicCheckHdl_Impl, void *);
DECL_LINK(LoadExcelBasicCheckHdl_Impl, void *);
public:
+ OfaMSFilterTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
+ virtual ~OfaMSFilterTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -73,8 +74,8 @@ class OfaMSFilterTabPage2 : public SfxTabPage
}
};
- SvSimpleTableContainer* m_pCheckLBContainer;
- MSFltrSimpleTable* m_pCheckLB;
+ VclPtr<SvSimpleTableContainer> m_pCheckLBContainer;
+ VclPtr<MSFltrSimpleTable> m_pCheckLB;
OUString sHeader1, sHeader2;
OUString sChgToFromMath,
sChgToFromWriter,
@@ -83,11 +84,11 @@ class OfaMSFilterTabPage2 : public SfxTabPage
sChgToFromSmartArt;
SvLBoxButtonData* pCheckButtonData;
- RadioButton* aHighlightingRB;
- RadioButton* aShadingRB;
+ VclPtr<RadioButton> aHighlightingRB;
+ VclPtr<RadioButton> aShadingRB;
- OfaMSFilterTabPage2( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~OfaMSFilterTabPage2();
+ virtual void dispose() SAL_OVERRIDE;
void InsertEntry( const OUString& _rTxt, sal_IntPtr _nType );
void InsertEntry( const OUString& _rTxt, sal_IntPtr _nType,
@@ -95,8 +96,8 @@ class OfaMSFilterTabPage2 : public SfxTabPage
SvTreeListEntry* GetEntry4Type( sal_IntPtr _nType ) const;
public:
-
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ OfaMSFilterTabPage2( vcl::Window* pParent, const SfxItemSet& rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 2ee207c85976..0a9b466a792c 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -309,11 +309,28 @@ OfaMiscTabPage::OfaMiscTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
OfaMiscTabPage::~OfaMiscTabPage()
{
+ disposeOnce();
}
-SfxTabPage* OfaMiscTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+void OfaMiscTabPage::dispose()
{
- return new OfaMiscTabPage( pParent, *rAttrSet );
+ m_pToolTipsCB.clear();
+ m_pExtHelpCB.clear();
+ m_pFileDlgROImage.clear();
+ m_pFileDlgCB.clear();
+ m_pPrintDlgCB.clear();
+ m_pDocStatusCB.clear();
+ m_pSaveAlwaysCB.clear();
+ m_pYearFrame.clear();
+ m_pYearValueField.clear();
+ m_pToYearFT.clear();
+ m_pCollectUsageInfo.clear();
+ SfxTabPage::dispose();
+}
+
+VclPtr<SfxTabPage> OfaMiscTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+{
+ return VclPtr<OfaMiscTabPage>::Create( pParent, *rAttrSet );
}
bool OfaMiscTabPage::FillItemSet( SfxItemSet* rSet )
@@ -686,9 +703,35 @@ OfaViewTabPage::OfaViewTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
OfaViewTabPage::~OfaViewTabPage()
{
+ disposeOnce();
+}
+
+void OfaViewTabPage::dispose()
+{
delete mpDrawinglayerOpt;
+ mpDrawinglayerOpt = NULL;
delete pCanvasSettings;
+ pCanvasSettings = NULL;
delete pAppearanceCfg;
+ pAppearanceCfg = NULL;
+ m_pWindowSizeMF.clear();
+ m_pIconSizeLB.clear();
+ m_pIconStyleLB.clear();
+ m_pFontAntiAliasing.clear();
+ m_pAAPointLimitLabel.clear();
+ m_pAAPointLimit.clear();
+ m_pMenuIconsLB.clear();
+ m_pFontShowCB.clear();
+ m_pFontHistoryCB.clear();
+ m_pUseHardwareAccell.clear();
+ m_pUseAntiAliase.clear();
+ m_pUseOpenGL.clear();
+ m_pForceOpenGL.clear();
+ m_pMousePosLB.clear();
+ m_pMouseMiddleLB.clear();
+ m_pSelectionCB.clear();
+ m_pSelectionMF.clear();
+ SfxTabPage::dispose();
}
#if defined( UNX )
@@ -714,9 +757,9 @@ IMPL_LINK( OfaViewTabPage, OnSelectionToggled, void*, NOTINTERESTEDIN )
return 0;
}
-SfxTabPage* OfaViewTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> OfaViewTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return new OfaViewTabPage(pParent, *rAttrSet);
+ return VclPtr<OfaViewTabPage>::Create(pParent, *rAttrSet);
}
bool OfaViewTabPage::FillItemSet( SfxItemSet* )
@@ -1205,12 +1248,35 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(vcl::Window* pParent, const SfxItemSet&
OfaLanguagesTabPage::~OfaLanguagesTabPage()
{
+ disposeOnce();
+}
+
+void OfaLanguagesTabPage::dispose()
+{
delete pLangConfig;
+ pLangConfig = NULL;
+ m_pUserInterfaceLB.clear();
+ m_pLocaleSettingFT.clear();
+ m_pLocaleSettingLB.clear();
+ m_pDecimalSeparatorCB.clear();
+ m_pCurrencyFT.clear();
+ m_pCurrencyLB.clear();
+ m_pDatePatternsFT.clear();
+ m_pDatePatternsED.clear();
+ m_pWesternLanguageLB.clear();
+ m_pWesternLanguageFT.clear();
+ m_pAsianLanguageLB.clear();
+ m_pComplexLanguageLB.clear();
+ m_pCurrentDocCB.clear();
+ m_pAsianSupportCB.clear();
+ m_pCTLSupportCB.clear();
+ m_pIgnoreLanguageChangeCB.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* OfaLanguagesTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> OfaLanguagesTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return new OfaLanguagesTabPage(pParent, *rAttrSet);
+ return VclPtr<OfaLanguagesTabPage>::Create(pParent, *rAttrSet);
}
static void lcl_UpdateAndDelete(SfxVoidItem* pInvalidItems[], SfxBoolItem* pBoolItems[], sal_uInt16 nCount)
@@ -1290,8 +1356,8 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet )
xProp->setPropertyValue(sUserLocaleKey, makeAny(aLangString));
Reference< XChangesBatch >(xProp, UNO_QUERY_THROW)->commitChanges();
// display info
- MessageDialog aBox(this, CUI_RES(RID_SVXSTR_LANGUAGE_RESTART), VCL_MESSAGE_INFO);
- aBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aBox(this, CUI_RES(RID_SVXSTR_LANGUAGE_RESTART), VCL_MESSAGE_INFO);
+ aBox->Execute();
// tell quickstarter to stop being a veto listener
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index f4b4ee73cd86..8dc2397ffe4a 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -44,24 +44,24 @@ class OfaMiscTabPage : public SfxTabPage
{
using TabPage::DeactivatePage;
private:
- CheckBox* m_pToolTipsCB;
- CheckBox* m_pExtHelpCB;
+ VclPtr<CheckBox> m_pToolTipsCB;
+ VclPtr<CheckBox> m_pExtHelpCB;
- FixedImage* m_pFileDlgROImage;
- CheckBox* m_pFileDlgCB;
+ VclPtr<FixedImage> m_pFileDlgROImage;
+ VclPtr<CheckBox> m_pFileDlgCB;
- CheckBox* m_pPrintDlgCB;
+ VclPtr<CheckBox> m_pPrintDlgCB;
- CheckBox* m_pDocStatusCB;
- CheckBox* m_pSaveAlwaysCB;
+ VclPtr<CheckBox> m_pDocStatusCB;
+ VclPtr<CheckBox> m_pSaveAlwaysCB;
- VclContainer* m_pYearFrame;
- NumericField* m_pYearValueField;
- FixedText* m_pToYearFT;
+ VclPtr<VclContainer> m_pYearFrame;
+ VclPtr<NumericField> m_pYearValueField;
+ VclPtr<FixedText> m_pToYearFT;
OUString m_aStrDateInfo;
- CheckBox* m_pCollectUsageInfo;
+ VclPtr<CheckBox> m_pCollectUsageInfo;
DECL_LINK( TwoFigureHdl, NumericField* );
DECL_LINK( TwoFigureConfigHdl, NumericField* );
@@ -75,8 +75,9 @@ protected:
public:
OfaMiscTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~OfaMiscTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -88,30 +89,30 @@ class SvtTabAppearanceCfg;
class OfaViewTabPage : public SfxTabPage
{
private:
- MetricField* m_pWindowSizeMF;
- ListBox* m_pIconSizeLB;
- ListBox* m_pIconStyleLB;
+ VclPtr<MetricField> m_pWindowSizeMF;
+ VclPtr<ListBox> m_pIconSizeLB;
+ VclPtr<ListBox> m_pIconStyleLB;
- CheckBox* m_pFontAntiAliasing;
- FixedText* m_pAAPointLimitLabel;
- MetricField* m_pAAPointLimit;
+ VclPtr<CheckBox> m_pFontAntiAliasing;
+ VclPtr<FixedText> m_pAAPointLimitLabel;
+ VclPtr<MetricField> m_pAAPointLimit;
- ListBox* m_pMenuIconsLB;
+ VclPtr<ListBox> m_pMenuIconsLB;
- CheckBox* m_pFontShowCB;
- CheckBox* m_pFontHistoryCB;
+ VclPtr<CheckBox> m_pFontShowCB;
+ VclPtr<CheckBox> m_pFontHistoryCB;
- CheckBox* m_pUseHardwareAccell;
- CheckBox* m_pUseAntiAliase;
- CheckBox* m_pUseOpenGL;
- CheckBox* m_pForceOpenGL;
+ VclPtr<CheckBox> m_pUseHardwareAccell;
+ VclPtr<CheckBox> m_pUseAntiAliase;
+ VclPtr<CheckBox> m_pUseOpenGL;
+ VclPtr<CheckBox> m_pForceOpenGL;
- ListBox* m_pMousePosLB;
- ListBox* m_pMouseMiddleLB;
+ VclPtr<ListBox> m_pMousePosLB;
+ VclPtr<ListBox> m_pMouseMiddleLB;
// #i97672#
- CheckBox* m_pSelectionCB;
- MetricField* m_pSelectionMF;
+ VclPtr<CheckBox> m_pSelectionCB;
+ VclPtr<MetricField> m_pSelectionMF;
sal_uInt16 nSizeLB_InitialSelection;
sal_uInt16 nStyleLB_InitialSelection;
@@ -132,8 +133,9 @@ private:
public:
OfaViewTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~OfaViewTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -142,23 +144,23 @@ public:
struct LanguageConfig_Impl;
class OfaLanguagesTabPage : public SfxTabPage
{
- ListBox* m_pUserInterfaceLB;
- FixedText* m_pLocaleSettingFT;
- SvxLanguageBox* m_pLocaleSettingLB;
- CheckBox* m_pDecimalSeparatorCB;
- FixedText* m_pCurrencyFT;
- ListBox* m_pCurrencyLB;
- FixedText* m_pDatePatternsFT;
- Edit* m_pDatePatternsED;
-
- SvxLanguageBox* m_pWesternLanguageLB;
- FixedText* m_pWesternLanguageFT;
- SvxLanguageBox* m_pAsianLanguageLB;
- SvxLanguageBox* m_pComplexLanguageLB;
- CheckBox* m_pCurrentDocCB;
- CheckBox* m_pAsianSupportCB;
- CheckBox* m_pCTLSupportCB;
- CheckBox* m_pIgnoreLanguageChangeCB;
+ VclPtr<ListBox> m_pUserInterfaceLB;
+ VclPtr<FixedText> m_pLocaleSettingFT;
+ VclPtr<SvxLanguageBox> m_pLocaleSettingLB;
+ VclPtr<CheckBox> m_pDecimalSeparatorCB;
+ VclPtr<FixedText> m_pCurrencyFT;
+ VclPtr<ListBox> m_pCurrencyLB;
+ VclPtr<FixedText> m_pDatePatternsFT;
+ VclPtr<Edit> m_pDatePatternsED;
+
+ VclPtr<SvxLanguageBox> m_pWesternLanguageLB;
+ VclPtr<FixedText> m_pWesternLanguageFT;
+ VclPtr<SvxLanguageBox> m_pAsianLanguageLB;
+ VclPtr<SvxLanguageBox> m_pComplexLanguageLB;
+ VclPtr<CheckBox> m_pCurrentDocCB;
+ VclPtr<CheckBox> m_pAsianSupportCB;
+ VclPtr<CheckBox> m_pCTLSupportCB;
+ VclPtr<CheckBox> m_pIgnoreLanguageChangeCB;
bool m_bOldAsian;
bool m_bOldCtl;
@@ -176,8 +178,9 @@ class OfaLanguagesTabPage : public SfxTabPage
public:
OfaLanguagesTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~OfaLanguagesTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
diff --git a/cui/source/options/optgenrl.cxx b/cui/source/options/optgenrl.cxx
index 9cb1c1b82ef1..f102d9e50eb8 100644
--- a/cui/source/options/optgenrl.cxx
+++ b/cui/source/options/optgenrl.cxx
@@ -166,7 +166,7 @@ struct SvxGeneralTabPage::Row
// which row is it?
RowType eRow;
// row label
- FixedText* pLabel;
+ VclPtr<FixedText> pLabel;
// first and last field in the row (last is exclusive)
unsigned nFirstField, nLastField;
@@ -191,7 +191,7 @@ struct SvxGeneralTabPage::Field
// which field is this? (in vFieldInfo[] above)
unsigned iField;
// edit box
- Edit *pEdit;
+ VclPtr<Edit> pEdit;
public:
Field (Edit *pEdit_, unsigned iField_)
@@ -219,11 +219,16 @@ SvxGeneralTabPage::SvxGeneralTabPage(vcl::Window* pParent, const SfxItemSet& rCo
SetLinks();
}
+SvxGeneralTabPage::~SvxGeneralTabPage()
+{
+ disposeOnce();
+}
-
-SvxGeneralTabPage::~SvxGeneralTabPage ()
-{ }
-
+void SvxGeneralTabPage::dispose()
+{
+ m_pUseDataCB.clear();
+ SfxTabPage::dispose();
+}
// Initializes the titles and the edit boxes,
@@ -296,9 +301,9 @@ void SvxGeneralTabPage::SetLinks ()
-SfxTabPage* SvxGeneralTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> SvxGeneralTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return ( new SvxGeneralTabPage( pParent, *rAttrSet ) );
+ return VclPtr<SvxGeneralTabPage>::Create( pParent, *rAttrSet );
}
diff --git a/cui/source/options/opthtml.cxx b/cui/source/options/opthtml.cxx
index b95873784cd0..8298bd6c6e6b 100644
--- a/cui/source/options/opthtml.cxx
+++ b/cui/source/options/opthtml.cxx
@@ -86,12 +86,34 @@ SfxTabPage( pParent, "OptHtmlPage" , "cui/ui/opthtmlpage.ui", &rSet )
OfaHtmlTabPage::~OfaHtmlTabPage()
{
+ disposeOnce();
}
-SfxTabPage* OfaHtmlTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet )
+void OfaHtmlTabPage::dispose()
{
- return new OfaHtmlTabPage(pParent, *rAttrSet);
+ aSize1NF.clear();
+ aSize2NF.clear();
+ aSize3NF.clear();
+ aSize4NF.clear();
+ aSize5NF.clear();
+ aSize6NF.clear();
+ aSize7NF.clear();
+ aNumbersEnglishUSCB.clear();
+ aUnknownTagCB.clear();
+ aIgnoreFontNamesCB.clear();
+ aExportLB.clear();
+ aStarBasicCB.clear();
+ aStarBasicWarningCB.clear();
+ aPrintExtensionCB.clear();
+ aSaveGrfLocalCB.clear();
+ aCharSetLB.clear();
+ SfxTabPage::dispose();
+}
+
+VclPtr<SfxTabPage> OfaHtmlTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet )
+{
+ return VclPtr<OfaHtmlTabPage>::Create(pParent, *rAttrSet);
}
bool OfaHtmlTabPage::FillItemSet( SfxItemSet* )
diff --git a/cui/source/options/opthtml.hxx b/cui/source/options/opthtml.hxx
index c79e2393e831..6977795feb65 100644
--- a/cui/source/options/opthtml.hxx
+++ b/cui/source/options/opthtml.hxx
@@ -30,34 +30,35 @@
class OfaHtmlTabPage : public SfxTabPage
{
- NumericField* aSize1NF;
- NumericField* aSize2NF;
- NumericField* aSize3NF;
- NumericField* aSize4NF;
- NumericField* aSize5NF;
- NumericField* aSize6NF;
- NumericField* aSize7NF;
+ VclPtr<NumericField> aSize1NF;
+ VclPtr<NumericField> aSize2NF;
+ VclPtr<NumericField> aSize3NF;
+ VclPtr<NumericField> aSize4NF;
+ VclPtr<NumericField> aSize5NF;
+ VclPtr<NumericField> aSize6NF;
+ VclPtr<NumericField> aSize7NF;
- CheckBox* aNumbersEnglishUSCB;
- CheckBox* aUnknownTagCB;
- CheckBox* aIgnoreFontNamesCB;
+ VclPtr<CheckBox> aNumbersEnglishUSCB;
+ VclPtr<CheckBox> aUnknownTagCB;
+ VclPtr<CheckBox> aIgnoreFontNamesCB;
- ListBox* aExportLB;
- CheckBox* aStarBasicCB;
- CheckBox* aStarBasicWarningCB;
- CheckBox* aPrintExtensionCB;
- CheckBox* aSaveGrfLocalCB;
- SvxTextEncodingBox* aCharSetLB;
+ VclPtr<ListBox> aExportLB;
+ VclPtr<CheckBox> aStarBasicCB;
+ VclPtr<CheckBox> aStarBasicWarningCB;
+ VclPtr<CheckBox> aPrintExtensionCB;
+ VclPtr<CheckBox> aSaveGrfLocalCB;
+ VclPtr<SvxTextEncodingBox> aCharSetLB;
DECL_LINK(ExportHdl_Impl, ListBox*);
DECL_LINK(CheckBoxHdl_Impl, CheckBox*);
- OfaHtmlTabPage(vcl::Window* pParent, const SfxItemSet& rSet);
- virtual ~OfaHtmlTabPage();
public:
+ virtual ~OfaHtmlTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet );
+ OfaHtmlTabPage(vcl::Window* pParent, const SfxItemSet& rSet);
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index 17e97d2853e3..48e2626a31ec 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -217,11 +217,33 @@ SvxProxyTabPage::SvxProxyTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
SvxProxyTabPage::~SvxProxyTabPage()
{
+ disposeOnce();
}
-SfxTabPage* SvxProxyTabPage::Create(vcl::Window* pParent, const SfxItemSet* rAttrSet )
+void SvxProxyTabPage::dispose()
{
- return new SvxProxyTabPage(pParent, *rAttrSet);
+ m_pProxyModeLB.clear();
+ m_pHttpProxyFT.clear();
+ m_pHttpProxyED.clear();
+ m_pHttpPortFT.clear();
+ m_pHttpPortED.clear();
+ m_pHttpsProxyFT.clear();
+ m_pHttpsProxyED.clear();
+ m_pHttpsPortFT.clear();
+ m_pHttpsPortED.clear();
+ m_pFtpProxyFT.clear();
+ m_pFtpProxyED.clear();
+ m_pFtpPortFT.clear();
+ m_pFtpPortED.clear();
+ m_pNoProxyForFT.clear();
+ m_pNoProxyForED.clear();
+ m_pNoProxyDescFT.clear();
+ SfxTabPage::dispose();
+}
+
+VclPtr<SfxTabPage> SvxProxyTabPage::Create(vcl::Window* pParent, const SfxItemSet* rAttrSet )
+{
+ return VclPtr<SvxProxyTabPage>::Create(pParent, *rAttrSet);
}
void SvxProxyTabPage::ReadConfigData_Impl()
@@ -626,16 +648,35 @@ SvxSecurityTabPage::SvxSecurityTabPage(vcl::Window* pParent, const SfxItemSet& r
SvxSecurityTabPage::~SvxSecurityTabPage()
{
- delete mpCertPathDlg;
+ disposeOnce();
+}
+void SvxSecurityTabPage::dispose()
+{
delete mpSecOptions;
- delete mpSecOptDlg;
+ mpSecOptions = NULL;
+ mpCertPathDlg.disposeAndClear();
+ mpSecOptDlg.clear();
+ m_pSecurityOptionsPB.clear();
+ m_pSavePasswordsCB.clear();
+ m_pShowConnectionsPB.clear();
+ m_pMasterPasswordCB.clear();
+ m_pMasterPasswordFT.clear();
+ m_pMasterPasswordPB.clear();
+ m_pMacroSecFrame.clear();
+ m_pMacroSecPB.clear();
+ m_pCertFrame.clear();
+ m_pCertPathPB.clear();
+ m_pTSAURLsFrame.clear();
+ m_pTSAURLsPB.clear();
+
+ SfxTabPage::dispose();
}
IMPL_LINK_NOARG(SvxSecurityTabPage, SecurityOptionsHdl)
{
if ( !mpSecOptDlg )
- mpSecOptDlg = new svx::SecurityOptionsDialog( this, mpSecOptions );
+ mpSecOptDlg = VclPtr<svx::SecurityOptionsDialog>::Create( this, mpSecOptions );
mpSecOptDlg->Execute();
return 0;
}
@@ -667,8 +708,8 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, SavePasswordHdl)
}
else
{
- QueryBox aQuery( this, WB_YES_NO|WB_DEF_NO, m_sPasswordStoringDeactivateStr );
- sal_uInt16 nRet = aQuery.Execute();
+ ScopedVclPtrInstance< QueryBox > aQuery( this, WB_YES_NO|WB_DEF_NO, m_sPasswordStoringDeactivateStr );
+ sal_uInt16 nRet = aQuery->Execute();
if( RET_YES == nRet )
{
@@ -764,8 +805,8 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, ShowPasswordsHdl)
if ( xMasterPasswd->isPersistentStoringAllowed() && xMasterPasswd->authorizateWithMasterPassword( Reference< task::XInteractionHandler>() ) )
{
- svx::WebConnectionInfoDialog aDlg( this );
- aDlg.Execute();
+ ScopedVclPtrInstance< svx::WebConnectionInfoDialog > aDlg(this);
+ aDlg->Execute();
}
}
catch (const Exception&)
@@ -776,15 +817,15 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, ShowPasswordsHdl)
IMPL_LINK_NOARG(SvxSecurityTabPage, CertPathPBHdl)
{
if (!mpCertPathDlg)
- mpCertPathDlg = new CertPathDialog(this);
+ mpCertPathDlg = VclPtr<CertPathDialog>::Create(this);
OUString sOrig = mpCertPathDlg->getDirectory();
short nRet = mpCertPathDlg->Execute();
if (nRet == RET_OK && sOrig != mpCertPathDlg->getDirectory())
{
- MessageDialog aWarnBox(this, CUI_RES(RID_SVXSTR_OPTIONS_RESTART), VCL_MESSAGE_INFO);
- aWarnBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aWarnBox(this, CUI_RES(RID_SVXSTR_OPTIONS_RESTART), VCL_MESSAGE_INFO);
+ aWarnBox->Execute();
}
return 0;
@@ -795,12 +836,10 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, TSAURLsPBHdl)
// Unlike the mpCertPathDlg, we *don't* keep the same dialog object around between
// invocations. Seems clearer to my little brain that way.
- TSAURLsDialog* pTSAURLsDlg = new TSAURLsDialog(this);
+ ScopedVclPtrInstance<TSAURLsDialog> pTSAURLsDlg(this);
pTSAURLsDlg->Execute();
- delete pTSAURLsDlg;
-
return 0;
}
@@ -875,9 +914,9 @@ void SvxSecurityTabPage::InitControls()
}
}
-SfxTabPage* SvxSecurityTabPage::Create(vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> SvxSecurityTabPage::Create(vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return new SvxSecurityTabPage(pParent, *rAttrSet);
+ return VclPtr<SfxTabPage>(new SvxSecurityTabPage(pParent, *rAttrSet), SAL_NO_ACQUIRE);
}
void SvxSecurityTabPage::ActivatePage( const SfxItemSet& )
@@ -972,14 +1011,28 @@ SvxEMailTabPage::SvxEMailTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
SvxEMailTabPage::~SvxEMailTabPage()
{
+ disposeOnce();
+}
+
+void SvxEMailTabPage::dispose()
+{
delete pImpl;
+ pImpl = NULL;
+ m_pMailContainer.clear();
+ m_pMailerURLFI.clear();
+ m_pMailerURLED.clear();
+ m_pMailerURLPB.clear();
+ m_pSuppressHiddenContainer.clear();
+ m_pSuppressHiddenFI.clear();
+ m_pSuppressHidden.clear();
+ SfxTabPage::dispose();
}
/* -------------------------------------------------------------------------*/
-SfxTabPage* SvxEMailTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> SvxEMailTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return new SvxEMailTabPage(pParent, *rAttrSet);
+ return VclPtr<SvxEMailTabPage>::Create(pParent, *rAttrSet);
}
/* -------------------------------------------------------------------------*/
diff --git a/cui/source/options/optinet2.hxx b/cui/source/options/optinet2.hxx
index 2d137ba7bc33..d1b4362794ea 100644
--- a/cui/source/options/optinet2.hxx
+++ b/cui/source/options/optinet2.hxx
@@ -58,26 +58,26 @@ class SvxProxyTabPage : public SfxTabPage
{
private:
- ListBox* m_pProxyModeLB;
+ VclPtr<ListBox> m_pProxyModeLB;
- FixedText* m_pHttpProxyFT;
- SvxNoSpaceEdit* m_pHttpProxyED;
- FixedText* m_pHttpPortFT;
- SvxNoSpaceEdit* m_pHttpPortED;
+ VclPtr<FixedText> m_pHttpProxyFT;
+ VclPtr<SvxNoSpaceEdit> m_pHttpProxyED;
+ VclPtr<FixedText> m_pHttpPortFT;
+ VclPtr<SvxNoSpaceEdit> m_pHttpPortED;
- FixedText* m_pHttpsProxyFT;
- SvxNoSpaceEdit* m_pHttpsProxyED;
- FixedText* m_pHttpsPortFT;
- SvxNoSpaceEdit* m_pHttpsPortED;
+ VclPtr<FixedText> m_pHttpsProxyFT;
+ VclPtr<SvxNoSpaceEdit> m_pHttpsProxyED;
+ VclPtr<FixedText> m_pHttpsPortFT;
+ VclPtr<SvxNoSpaceEdit> m_pHttpsPortED;
- FixedText* m_pFtpProxyFT;
- SvxNoSpaceEdit* m_pFtpProxyED;
- FixedText* m_pFtpPortFT;
- SvxNoSpaceEdit* m_pFtpPortED;
+ VclPtr<FixedText> m_pFtpProxyFT;
+ VclPtr<SvxNoSpaceEdit> m_pFtpProxyED;
+ VclPtr<FixedText> m_pFtpPortFT;
+ VclPtr<SvxNoSpaceEdit> m_pFtpPortED;
- FixedText* m_pNoProxyForFT;
- Edit* m_pNoProxyForED;
- FixedText* m_pNoProxyDescFT;
+ VclPtr<FixedText> m_pNoProxyForFT;
+ VclPtr<Edit> m_pNoProxyForED;
+ VclPtr<FixedText> m_pNoProxyDescFT;
const OUString aProxyModePN;
const OUString aHttpProxyPN;
@@ -98,11 +98,11 @@ private:
DECL_LINK( ProxyHdl_Impl, ListBox * );
DECL_LINK( LoseFocusHdl_Impl, Edit * );
+public:
SvxProxyTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxProxyTabPage();
-
-public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
};
@@ -130,28 +130,28 @@ class SvxSecurityTabPage : public SfxTabPage
using TabPage::DeactivatePage;
private:
- PushButton* m_pSecurityOptionsPB;
+ VclPtr<PushButton> m_pSecurityOptionsPB;
- CheckBox* m_pSavePasswordsCB;
- PushButton* m_pShowConnectionsPB;
+ VclPtr<CheckBox> m_pSavePasswordsCB;
+ VclPtr<PushButton> m_pShowConnectionsPB;
- CheckBox* m_pMasterPasswordCB;
- FixedText* m_pMasterPasswordFT;
- PushButton* m_pMasterPasswordPB;
+ VclPtr<CheckBox> m_pMasterPasswordCB;
+ VclPtr<FixedText> m_pMasterPasswordFT;
+ VclPtr<PushButton> m_pMasterPasswordPB;
- VclContainer* m_pMacroSecFrame;
- PushButton* m_pMacroSecPB;
+ VclPtr<VclContainer> m_pMacroSecFrame;
+ VclPtr<PushButton> m_pMacroSecPB;
- VclContainer* m_pCertFrame;
- PushButton* m_pCertPathPB;
+ VclPtr<VclContainer> m_pCertFrame;
+ VclPtr<PushButton> m_pCertPathPB;
- VclContainer* m_pTSAURLsFrame;
- PushButton* m_pTSAURLsPB;
+ VclPtr<VclContainer> m_pTSAURLsFrame;
+ VclPtr<PushButton> m_pTSAURLsPB;
SvtSecurityOptions* mpSecOptions;
- svx::SecurityOptionsDialog* mpSecOptDlg;
+ VclPtr<svx::SecurityOptionsDialog> mpSecOptDlg;
- CertPathDialog* mpCertPathDlg;
+ VclPtr<CertPathDialog> mpCertPathDlg;
OUString m_sPasswordStoringDeactivateStr;
@@ -168,13 +168,14 @@ private:
SvxSecurityTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxSecurityTabPage();
+ virtual void dispose() SAL_OVERRIDE;
protected:
virtual void ActivatePage( const SfxItemSet& rSet ) SAL_OVERRIDE;
virtual sfxpg DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE;
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
};
@@ -182,13 +183,13 @@ public:
struct SvxEMailTabPage_Impl;
class SvxEMailTabPage : public SfxTabPage
{
- VclContainer* m_pMailContainer;
- FixedImage* m_pMailerURLFI;
- Edit* m_pMailerURLED;
- PushButton* m_pMailerURLPB;
- VclContainer* m_pSuppressHiddenContainer;
- FixedImage* m_pSuppressHiddenFI;
- CheckBox* m_pSuppressHidden;
+ VclPtr<VclContainer> m_pMailContainer;
+ VclPtr<FixedImage> m_pMailerURLFI;
+ VclPtr<Edit> m_pMailerURLED;
+ VclPtr<PushButton> m_pMailerURLPB;
+ VclPtr<VclContainer> m_pSuppressHiddenContainer;
+ VclPtr<FixedImage> m_pSuppressHiddenFI;
+ VclPtr<CheckBox> m_pSuppressHidden;
OUString m_sDefaultFilterName;
@@ -199,8 +200,9 @@ class SvxEMailTabPage : public SfxTabPage
public:
SvxEMailTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxEMailTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 3ad13eb797ba..95471d1121c5 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -161,7 +161,7 @@ SvxJavaOptionsPage::SvxJavaOptionsPage( vcl::Window* pParent, const SfxItemSet&
aControlSize = LogicToPixel(aControlSize, MAP_APPFONT);
pJavaListContainer->set_width_request(aControlSize.Width());
pJavaListContainer->set_height_request(aControlSize.Height());
- m_pJavaList = new SvxJavaListBox(*pJavaListContainer, m_sAccessibilityText);
+ m_pJavaList = VclPtr<SvxJavaListBox>::Create(*pJavaListContainer, m_sAccessibilityText);
long aStaticTabs[]= { 4, 0, 0, 0, 0 };
@@ -202,9 +202,14 @@ SvxJavaOptionsPage::SvxJavaOptionsPage( vcl::Window* pParent, const SfxItemSet&
SvxJavaOptionsPage::~SvxJavaOptionsPage()
{
- delete m_pJavaList;
- delete m_pParamDlg;
- delete m_pPathDlg;
+ disposeOnce();
+}
+
+void SvxJavaOptionsPage::dispose()
+{
+ m_pJavaList.disposeAndClear();
+ m_pParamDlg.disposeAndClear();
+ m_pPathDlg.disposeAndClear();
ClearJavaInfo();
#if HAVE_FEATURE_JAVA
std::vector< JavaInfo* >::iterator pIter;
@@ -213,9 +218,20 @@ SvxJavaOptionsPage::~SvxJavaOptionsPage()
JavaInfo* pInfo = *pIter;
jfw_freeJavaInfo( pInfo );
}
+ m_aAddedInfos.clear();
jfw_unlock();
#endif
+ m_pJavaEnableCB.clear();
+ m_pJavaBox.clear();
+ m_pJavaPathText.clear();
+ m_pAddBtn.clear();
+ m_pParameterBtn.clear();
+ m_pClassPathBtn.clear();
+ m_pExpertConfigBtn.clear();
+ m_pExperimentalCB.clear();
+ m_pMacroCB.clear();
+ SfxTabPage::dispose();
}
@@ -290,7 +306,7 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, ParameterHdl_Impl)
Sequence< OUString > aParameterList;
if ( !m_pParamDlg )
{
- m_pParamDlg = new SvxJavaParameterDlg( this );
+ m_pParamDlg = VclPtr<SvxJavaParameterDlg>::Create( this );
javaFrameworkError eErr = jfw_getVMParameters( &m_parParameters, &m_nParamSize );
if ( JFW_E_NONE == eErr && m_parParameters && m_nParamSize > 0 )
{
@@ -320,8 +336,8 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, ParameterHdl_Impl)
(void)eErr;
if ( bRunning )
{
- MessageDialog aWarnBox( this, CUI_RES( RID_SVXSTR_OPTIONS_RESTART ), VCL_MESSAGE_INFO );
- aWarnBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aWarnBox( this, CUI_RES( RID_SVXSTR_OPTIONS_RESTART ), VCL_MESSAGE_INFO );
+ aWarnBox->Execute();
}
}
}
@@ -340,7 +356,7 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, ClassPathHdl_Impl)
if ( !m_pPathDlg )
{
- m_pPathDlg = new SvxJavaClassPathDlg( this );
+ m_pPathDlg = VclPtr<SvxJavaClassPathDlg>::Create( this );
javaFrameworkError eErr = jfw_getUserClassPath( &m_pClassPath );
if ( JFW_E_NONE == eErr && m_pClassPath )
{
@@ -365,8 +381,8 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, ClassPathHdl_Impl)
(void)eErr;
if ( bRunning )
{
- MessageDialog aWarnBox( this, CUI_RES( RID_SVXSTR_OPTIONS_RESTART ), VCL_MESSAGE_INFO );
- aWarnBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aWarnBox( this, CUI_RES( RID_SVXSTR_OPTIONS_RESTART ), VCL_MESSAGE_INFO );
+ aWarnBox->Execute();
}
}
}
@@ -421,7 +437,7 @@ IMPL_LINK( SvxJavaOptionsPage, DialogClosedHdl, DialogClosedEvent*, pEvt )
IMPL_LINK_NOARG( SvxJavaOptionsPage, ExpertConfigHdl_Impl )
{
- CuiAboutConfigTabPage* m_pExpertConfigDlg = new CuiAboutConfigTabPage(this);
+ ScopedVclPtrInstance< CuiAboutConfigTabPage > m_pExpertConfigDlg(this);
m_pExpertConfigDlg->Reset();//initialize and reset function
if( RET_OK == m_pExpertConfigDlg->Execute() )
@@ -429,7 +445,7 @@ IMPL_LINK_NOARG( SvxJavaOptionsPage, ExpertConfigHdl_Impl )
m_pExpertConfigDlg->FillItemSet();//save changes if there are any
}
- delete m_pExpertConfigDlg;
+ m_pExpertConfigDlg.disposeAndClear();
return 0;
}
@@ -614,13 +630,13 @@ void SvxJavaOptionsPage::AddFolder( const OUString& _rFolder )
}
else if ( JFW_E_NOT_RECOGNIZED == eErr )
{
- MessageDialog aErrBox( this, CUI_RES( RID_SVXSTR_JRE_NOT_RECOGNIZED ) );
- aErrBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrBox( this, CUI_RES( RID_SVXSTR_JRE_NOT_RECOGNIZED ) );
+ aErrBox->Execute();
}
else if ( JFW_E_FAILED_VERSION == eErr )
{
- MessageDialog aErrBox( this, CUI_RES( RID_SVXSTR_JRE_FAILED_VERSION ) );
- aErrBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrBox( this, CUI_RES( RID_SVXSTR_JRE_FAILED_VERSION ) );
+ aErrBox->Execute();
}
if ( bStartAgain )
@@ -635,9 +651,9 @@ void SvxJavaOptionsPage::AddFolder( const OUString& _rFolder )
-SfxTabPage* SvxJavaOptionsPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> SvxJavaOptionsPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return ( new SvxJavaOptionsPage( pParent, *rAttrSet ) );
+ return VclPtr<SvxJavaOptionsPage>::Create( pParent, *rAttrSet );
}
@@ -805,12 +821,19 @@ SvxJavaParameterDlg::SvxJavaParameterDlg( vcl::Window* pParent ) :
EnableRemoveButton();
}
-
-
SvxJavaParameterDlg::~SvxJavaParameterDlg()
{
+ disposeOnce();
}
+void SvxJavaParameterDlg::dispose()
+{
+ m_pParameterEdit.clear();
+ m_pAssignBtn.clear();
+ m_pAssignedList.clear();
+ m_pRemoveBtn.clear();
+ ModalDialog::dispose();
+}
IMPL_LINK_NOARG(SvxJavaParameterDlg, ModifyHdl_Impl)
@@ -939,12 +962,24 @@ SvxJavaClassPathDlg::SvxJavaClassPathDlg(vcl::Window* pParent)
SvxJavaClassPathDlg::~SvxJavaClassPathDlg()
{
- sal_Int32 i, nCount = m_pPathList->GetEntryCount();
- for ( i = 0; i < nCount; ++i )
- delete static_cast< OUString* >( m_pPathList->GetEntryData(i) );
+ disposeOnce();
}
-
+void SvxJavaClassPathDlg::dispose()
+{
+ if (m_pPathList)
+ {
+ sal_Int32 i, nCount = m_pPathList->GetEntryCount();
+ for ( i = 0; i < nCount; ++i )
+ delete static_cast< OUString* >( m_pPathList->GetEntryData(i) );
+ m_pPathList = NULL;
+ }
+ m_pPathList.clear();
+ m_pAddArchiveBtn.clear();
+ m_pAddPathBtn.clear();
+ m_pRemoveBtn.clear();
+ ModalDialog::dispose();
+}
IMPL_LINK_NOARG(SvxJavaClassPathDlg, AddArchiveHdl_Impl)
{
diff --git a/cui/source/options/optjava.hxx b/cui/source/options/optjava.hxx
index 4b45f37265ea..ffe299b7c628 100644
--- a/cui/source/options/optjava.hxx
+++ b/cui/source/options/optjava.hxx
@@ -51,17 +51,17 @@ class SvxJavaListBox;
class SvxJavaOptionsPage : public SfxTabPage
{
private:
- CheckBox* m_pJavaEnableCB;
- VclContainer* m_pJavaBox;
- SvxJavaListBox* m_pJavaList;
- FixedText* m_pJavaPathText;
- PushButton* m_pAddBtn;
- PushButton* m_pParameterBtn;
- PushButton* m_pClassPathBtn;
- PushButton* m_pExpertConfigBtn;
-
- SvxJavaParameterDlg* m_pParamDlg;
- SvxJavaClassPathDlg* m_pPathDlg;
+ VclPtr<CheckBox> m_pJavaEnableCB;
+ VclPtr<VclContainer> m_pJavaBox;
+ VclPtr<SvxJavaListBox> m_pJavaList;
+ VclPtr<FixedText> m_pJavaPathText;
+ VclPtr<PushButton> m_pAddBtn;
+ VclPtr<PushButton> m_pParameterBtn;
+ VclPtr<PushButton> m_pClassPathBtn;
+ VclPtr<PushButton> m_pExpertConfigBtn;
+
+ VclPtr<SvxJavaParameterDlg> m_pParamDlg;
+ VclPtr<SvxJavaClassPathDlg> m_pPathDlg;
#if HAVE_FEATURE_JAVA
JavaInfo** m_parJavaInfo;
@@ -75,8 +75,8 @@ private:
OUString m_sAddDialogText;
Idle m_aResetIdle;
- CheckBox* m_pExperimentalCB;
- CheckBox* m_pMacroCB;
+ VclPtr<CheckBox> m_pExperimentalCB;
+ VclPtr<CheckBox> m_pMacroCB;
::std::vector< JavaInfo* >
m_aAddedInfos;
@@ -107,8 +107,9 @@ private:
public:
SvxJavaOptionsPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxJavaOptionsPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -120,11 +121,11 @@ public:
class SvxJavaParameterDlg : public ModalDialog
{
private:
- Edit* m_pParameterEdit;
- PushButton* m_pAssignBtn;
+ VclPtr<Edit> m_pParameterEdit;
+ VclPtr<PushButton> m_pAssignBtn;
- ListBox* m_pAssignedList;
- PushButton* m_pRemoveBtn;
+ VclPtr<ListBox> m_pAssignedList;
+ VclPtr<PushButton> m_pRemoveBtn;
DECL_LINK(ModifyHdl_Impl, void *);
DECL_LINK(AssignHdl_Impl, void *);
@@ -141,6 +142,7 @@ private:
public:
SvxJavaParameterDlg( vcl::Window* pParent );
virtual ~SvxJavaParameterDlg();
+ virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
@@ -153,10 +155,10 @@ public:
class SvxJavaClassPathDlg : public ModalDialog
{
private:
- ListBox* m_pPathList;
- PushButton* m_pAddArchiveBtn;
- PushButton* m_pAddPathBtn;
- PushButton* m_pRemoveBtn;
+ VclPtr<ListBox> m_pPathList;
+ VclPtr<PushButton> m_pAddArchiveBtn;
+ VclPtr<PushButton> m_pAddPathBtn;
+ VclPtr<PushButton> m_pRemoveBtn;
OUString m_sOldPath;
@@ -173,6 +175,7 @@ private:
public:
SvxJavaClassPathDlg( vcl::Window* pParent );
virtual ~SvxJavaClassPathDlg();
+ virtual void dispose() SAL_OVERRIDE;
inline const OUString& GetOldPath() const { return m_sOldPath; }
inline void SetFocus() { m_pPathList->GrabFocus(); }
diff --git a/cui/source/options/optjsearch.cxx b/cui/source/options/optjsearch.cxx
index 96bc0146811f..2bd5401acac5 100644
--- a/cui/source/options/optjsearch.cxx
+++ b/cui/source/options/optjsearch.cxx
@@ -55,15 +55,38 @@ SvxJSearchOptionsPage::SvxJSearchOptionsPage( vcl::Window* pParent, const SfxIte
nTransliterationFlags = 0x00000000;
}
-
SvxJSearchOptionsPage::~SvxJSearchOptionsPage()
{
+ disposeOnce();
}
+void SvxJSearchOptionsPage::dispose()
+{
+ m_pMatchCase.clear();
+ m_pMatchFullHalfWidth.clear();
+ m_pMatchHiraganaKatakana.clear();
+ m_pMatchContractions.clear();
+ m_pMatchMinusDashChoon.clear();
+ m_pMatchRepeatCharMarks.clear();
+ m_pMatchVariantFormKanji.clear();
+ m_pMatchOldKanaForms.clear();
+ m_pMatchDiziDuzu.clear();
+ m_pMatchBavaHafa.clear();
+ m_pMatchTsithichiDhizi.clear();
+ m_pMatchHyuiyuByuvyu.clear();
+ m_pMatchSesheZeje.clear();
+ m_pMatchIaiya.clear();
+ m_pMatchKiku.clear();
+ m_pMatchProlongedSoundMark.clear();
+ m_pIgnorePunctuation.clear();
+ m_pIgnoreWhitespace.clear();
+ m_pIgnoreMiddleDot.clear();
+ SfxTabPage::dispose();
+}
-SfxTabPage* SvxJSearchOptionsPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> SvxJSearchOptionsPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return new SvxJSearchOptionsPage( pParent, *rSet );
+ return VclPtr<SvxJSearchOptionsPage>::Create( pParent, *rSet );
}
diff --git a/cui/source/options/optjsearch.hxx b/cui/source/options/optjsearch.hxx
index bb5ac7a4606e..26fed46c9c3a 100644
--- a/cui/source/options/optjsearch.hxx
+++ b/cui/source/options/optjsearch.hxx
@@ -32,39 +32,37 @@ class SfxItemSet;
class SvxJSearchOptionsPage : public SfxTabPage
{
private:
- CheckBox* m_pMatchCase;
- CheckBox* m_pMatchFullHalfWidth;
- CheckBox* m_pMatchHiraganaKatakana;
- CheckBox* m_pMatchContractions;
- CheckBox* m_pMatchMinusDashChoon;
- CheckBox* m_pMatchRepeatCharMarks;
- CheckBox* m_pMatchVariantFormKanji;
- CheckBox* m_pMatchOldKanaForms;
- CheckBox* m_pMatchDiziDuzu;
- CheckBox* m_pMatchBavaHafa;
- CheckBox* m_pMatchTsithichiDhizi;
- CheckBox* m_pMatchHyuiyuByuvyu;
- CheckBox* m_pMatchSesheZeje;
- CheckBox* m_pMatchIaiya;
- CheckBox* m_pMatchKiku;
- CheckBox* m_pMatchProlongedSoundMark;
-
- CheckBox* m_pIgnorePunctuation;
- CheckBox* m_pIgnoreWhitespace;
- CheckBox* m_pIgnoreMiddleDot;
+ VclPtr<CheckBox> m_pMatchCase;
+ VclPtr<CheckBox> m_pMatchFullHalfWidth;
+ VclPtr<CheckBox> m_pMatchHiraganaKatakana;
+ VclPtr<CheckBox> m_pMatchContractions;
+ VclPtr<CheckBox> m_pMatchMinusDashChoon;
+ VclPtr<CheckBox> m_pMatchRepeatCharMarks;
+ VclPtr<CheckBox> m_pMatchVariantFormKanji;
+ VclPtr<CheckBox> m_pMatchOldKanaForms;
+ VclPtr<CheckBox> m_pMatchDiziDuzu;
+ VclPtr<CheckBox> m_pMatchBavaHafa;
+ VclPtr<CheckBox> m_pMatchTsithichiDhizi;
+ VclPtr<CheckBox> m_pMatchHyuiyuByuvyu;
+ VclPtr<CheckBox> m_pMatchSesheZeje;
+ VclPtr<CheckBox> m_pMatchIaiya;
+ VclPtr<CheckBox> m_pMatchKiku;
+ VclPtr<CheckBox> m_pMatchProlongedSoundMark;
+
+ VclPtr<CheckBox> m_pIgnorePunctuation;
+ VclPtr<CheckBox> m_pIgnoreWhitespace;
+ VclPtr<CheckBox> m_pIgnoreMiddleDot;
sal_Int32 nTransliterationFlags;
bool bSaveOptions;
sal_Int32 GetTransliterationFlags_Impl();
-protected:
- SvxJSearchOptionsPage( vcl::Window* pParent, const SfxItemSet& rSet );
-
public:
- virtual ~SvxJSearchOptionsPage();
-
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ SvxJSearchOptionsPage( vcl::Window* pParent, const SfxItemSet& rSet );
+ virtual ~SvxJSearchOptionsPage();
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 1b72de3e8c23..54d4fe51598f 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -329,10 +329,10 @@ static inline OUString lcl_GetPropertyName( EID_OPTIONS eEntryId )
class OptionsBreakSet : public ModalDialog
{
- VclFrame* m_pBeforeFrame;
- VclFrame* m_pAfterFrame;
- VclFrame* m_pMinimalFrame;
- NumericField* m_pBreakNF;
+ VclPtr<VclFrame> m_pBeforeFrame;
+ VclPtr<VclFrame> m_pAfterFrame;
+ VclPtr<VclFrame> m_pMinimalFrame;
+ VclPtr<NumericField> m_pBreakNF;
public:
OptionsBreakSet(vcl::Window* pParent, sal_uInt16 nRID)
@@ -364,6 +364,15 @@ public:
get(m_pBreakNF, "wordlength");
}
}
+ virtual ~OptionsBreakSet() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE
+ {
+ m_pBeforeFrame.clear();
+ m_pAfterFrame.clear();
+ m_pMinimalFrame.clear();
+ m_pBreakNF.clear();
+ ModalDialog::dispose();
+ }
NumericField& GetNumericFld()
{
@@ -1122,14 +1131,32 @@ SvxLinguTabPage::SvxLinguTabPage( vcl::Window* pParent, const SfxItemSet& rSet )
SvxLinguTabPage::~SvxLinguTabPage()
{
- if (pLinguData)
- delete pLinguData;
+ disposeOnce();
+}
+
+void SvxLinguTabPage::dispose()
+{
+ delete pLinguData;
+ pLinguData = NULL;
+ m_pLinguModulesFT.clear();
+ m_pLinguModulesCLB.clear();
+ m_pLinguModulesEditPB.clear();
+ m_pLinguDicsFT.clear();
+ m_pLinguDicsCLB.clear();
+ m_pLinguDicsNewPB.clear();
+ m_pLinguDicsEditPB.clear();
+ m_pLinguDicsDelPB.clear();
+ m_pLinguOptionsCLB.clear();
+ m_pLinguOptionsEditPB.clear();
+ m_pMoreDictsLink.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* SvxLinguTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> SvxLinguTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet )
{
- return ( new SvxLinguTabPage( pParent, *rAttrSet ) );
+ return VclPtr<SfxTabPage>( new SvxLinguTabPage( pParent, *rAttrSet ),
+ SAL_NO_ACQUIRE );
}
@@ -1570,8 +1597,8 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, PushButton *, pBtn )
pLinguData = new SvxLinguData_Impl;
SvxLinguData_Impl aOldLinguData( *pLinguData );
- SvxEditModulesDlg aDlg( this, *pLinguData );
- if (aDlg.Execute() != RET_OK)
+ ScopedVclPtrInstance< SvxEditModulesDlg > aDlg( this, *pLinguData );
+ if (aDlg->Execute() != RET_OK)
*pLinguData = aOldLinguData;
// evaluate new status of 'bConfigured' flag
@@ -1647,9 +1674,9 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, PushButton *, pBtn )
}
else if (m_pLinguDicsDelPB == pBtn)
{
- MessageDialog aQuery(this, "QueryDeleteDictionaryDialog",
- "cui/ui/querydeletedictionarydialog.ui");
- if (RET_NO == aQuery.Execute())
+ ScopedVclPtrInstance<MessageDialog> aQuery(this, "QueryDeleteDictionaryDialog",
+ "cui/ui/querydeletedictionarydialog.ui");
+ if (RET_NO == aQuery->Execute())
return 0;
SvTreeListEntry *pEntry = m_pLinguDicsCLB->GetCurEntry();
@@ -1719,11 +1746,11 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, PushButton *, pBtn )
if(aData.HasNumericValue())
{
sal_uInt16 nRID = aData.GetEntryId();
- OptionsBreakSet aDlg( this, nRID );
- aDlg.GetNumericFld().SetValue( aData.GetNumericValue() );
- if (RET_OK == aDlg.Execute() )
+ ScopedVclPtrInstance< OptionsBreakSet > aDlg(this, nRID);
+ aDlg->GetNumericFld().SetValue( aData.GetNumericValue() );
+ if (RET_OK == aDlg->Execute() )
{
- long nVal = static_cast<long>(aDlg.GetNumericFld().GetValue());
+ long nVal = static_cast<long>(aDlg->GetNumericFld().GetValue());
if (-1 != nVal && aData.GetNumericValue() != nVal)
{
aData.SetNumericValue( (sal_uInt8)nVal ); //! sets IsModified !
@@ -1892,9 +1919,22 @@ SvxEditModulesDlg::SvxEditModulesDlg(vcl::Window* pParent, SvxLinguData_Impl& rD
SvxEditModulesDlg::~SvxEditModulesDlg()
{
- delete pDefaultLinguData;
+ disposeOnce();
}
+void SvxEditModulesDlg::dispose()
+{
+ delete pDefaultLinguData;
+ pDefaultLinguData = NULL;
+ m_pLanguageLB.clear();
+ m_pModulesCLB.clear();
+ m_pPrioUpPB.clear();
+ m_pPrioDownPB.clear();
+ m_pBackPB.clear();
+ m_pMoreDictsLink.clear();
+ m_pClosePB.clear();
+ ModalDialog::dispose();
+}
SvTreeListEntry* SvxEditModulesDlg::CreateEntry( OUString& rTxt, sal_uInt16 nCol )
{
diff --git a/cui/source/options/optmemory.cxx b/cui/source/options/optmemory.cxx
index a8bac7001b03..730df834fee1 100644
--- a/cui/source/options/optmemory.cxx
+++ b/cui/source/options/optmemory.cxx
@@ -141,15 +141,26 @@ OfaMemoryOptionsPage::OfaMemoryOptionsPage(vcl::Window* pParent, const SfxItemSe
m_pNfGraphicCache->SetModifyHdl( LINK( this, OfaMemoryOptionsPage, GraphicCacheConfigHdl ) );
}
-
-
OfaMemoryOptionsPage::~OfaMemoryOptionsPage()
{
+ disposeOnce();
+}
+
+void OfaMemoryOptionsPage::dispose()
+{
+ m_pUndoEdit.clear();
+ m_pNfGraphicCache.clear();
+ m_pNfGraphicObjectCache.clear();
+ m_pTfGraphicObjectTime.clear();
+ m_pNfOLECache.clear();
+ m_pQuickStarterFrame.clear();
+ m_pQuickLaunchCB.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* OfaMemoryOptionsPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> OfaMemoryOptionsPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return new OfaMemoryOptionsPage( pParent, *rAttrSet );
+ return VclPtr<OfaMemoryOptionsPage>::Create( pParent, *rAttrSet );
}
bool OfaMemoryOptionsPage::FillItemSet( SfxItemSet* rSet )
diff --git a/cui/source/options/optmemory.hxx b/cui/source/options/optmemory.hxx
index 1ba1a1ec4b95..a9c823b2d640 100644
--- a/cui/source/options/optmemory.hxx
+++ b/cui/source/options/optmemory.hxx
@@ -32,16 +32,16 @@ class OfaMemoryOptionsPage : public SfxTabPage
{
using SfxTabPage::DeactivatePage;
private:
- NumericField* m_pUndoEdit;
+ VclPtr<NumericField> m_pUndoEdit;
- NumericField* m_pNfGraphicCache;
- NumericField* m_pNfGraphicObjectCache;
- TimeField* m_pTfGraphicObjectTime;
+ VclPtr<NumericField> m_pNfGraphicCache;
+ VclPtr<NumericField> m_pNfGraphicObjectCache;
+ VclPtr<TimeField> m_pTfGraphicObjectTime;
- NumericField* m_pNfOLECache;
+ VclPtr<NumericField> m_pNfOLECache;
- VclContainer* m_pQuickStarterFrame;
- CheckBox* m_pQuickLaunchCB;
+ VclPtr<VclContainer> m_pQuickStarterFrame;
+ VclPtr<CheckBox> m_pQuickLaunchCB;
DECL_LINK(GraphicCacheConfigHdl, void *);
@@ -58,8 +58,9 @@ protected:
public:
OfaMemoryOptionsPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~OfaMemoryOptionsPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
diff --git a/cui/source/options/optopencl.cxx b/cui/source/options/optopencl.cxx
index e6703b08738d..465bb4acf437 100644
--- a/cui/source/options/optopencl.cxx
+++ b/cui/source/options/optopencl.cxx
@@ -72,8 +72,8 @@ SvxOpenCLTabPage::SvxOpenCLTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
mpWhiteListDelete->SetClickHdl(LINK(this, SvxOpenCLTabPage, WhiteListDeleteHdl));
WinBits nBits = WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP;
- mpBlackList = new SvSimpleTable( *mpBlackListTable, nBits );
- mpWhiteList = new SvSimpleTable( *mpWhiteListTable, nBits );
+ mpBlackList = VclPtr<SvSimpleTable>::Create( *mpBlackListTable, nBits );
+ mpWhiteList = VclPtr<SvSimpleTable>::Create( *mpWhiteListTable, nBits );
HeaderBar &rBlBar = mpBlackList->GetTheHeaderBar();
HeaderBar &rWiBar = mpWhiteList->GetTheHeaderBar();
@@ -104,17 +104,41 @@ SvxOpenCLTabPage::SvxOpenCLTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
SvxOpenCLTabPage::~SvxOpenCLTabPage()
{
- for ( sal_uInt16 i = 0; i < mpBlackList->GetEntryCount(); ++i )
+ disposeOnce();
+}
+
+void SvxOpenCLTabPage::dispose()
+{
+ for ( sal_uInt16 i = 0; i < mpBlackList->GetEntryCount(); ++i )
delete static_cast<OpenCLConfig::ImplMatcher*>(mpBlackList->GetEntry(i)->GetUserData());
for ( sal_uInt16 i = 0; i < mpWhiteList->GetEntryCount(); ++i )
delete static_cast<OpenCLConfig::ImplMatcher*>(mpWhiteList->GetEntry(i)->GetUserData());
- delete mpBlackList;
- delete mpWhiteList;
+ mpBlackList.disposeAndClear();
+ mpWhiteList.disposeAndClear();
+
+ mpUseOpenCL.clear();
+ mpBlackListFrame.clear();
+ mpBlackListTable.clear();
+ mpBlackListEdit.clear();
+ mpBlackListAdd.clear();
+ mpBlackListDelete.clear();
+ mpOS.clear();
+ mpOSVersion.clear();
+ mpDevice.clear();
+ mpVendor.clear();
+ mpDrvVersion.clear();
+ mpWhiteListFrame.clear();
+ mpWhiteListTable.clear();
+ mpWhiteListEdit.clear();
+ mpWhiteListAdd.clear();
+ mpWhiteListDelete.clear();
+
+ SfxTabPage::dispose();
}
-SfxTabPage* SvxOpenCLTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> SvxOpenCLTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return new SvxOpenCLTabPage(pParent, *rAttrSet);
+ return VclPtr<SvxOpenCLTabPage>::Create(pParent, *rAttrSet);
}
bool SvxOpenCLTabPage::FillItemSet( SfxItemSet* )
@@ -189,16 +213,27 @@ class ListEntryDialog : public ModalDialog
public:
OpenCLConfig::ImplMatcher maEntry;
- ListBox* mpOS;
- Edit* mpOSVersion;
- Edit* mpPlatformVendor;
- Edit* mpDevice;
- Edit* mpDriverVersion;
+ VclPtr<ListBox> mpOS;
+ VclPtr<Edit> mpOSVersion;
+ VclPtr<Edit> mpPlatformVendor;
+ VclPtr<Edit> mpDevice;
+ VclPtr<Edit> mpDriverVersion;
DECL_LINK(OSSelectHdl, ListBox*);
DECL_LINK(EditModifiedHdl, Edit*);
ListEntryDialog(vcl::Window* pParent, const OpenCLConfig::ImplMatcher& rEntry, const OString& rTag);
+ virtual ~ListEntryDialog() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE
+ {
+ mpOS.clear();
+ mpOSVersion.clear();
+ mpPlatformVendor.clear();
+ mpDevice.clear();
+ mpDriverVersion.clear();
+ ModalDialog::dispose();
+ }
+
};
ListEntryDialog::ListEntryDialog(vcl::Window* pParent, const OpenCLConfig::ImplMatcher& rEntry, const OString& rTag)
@@ -268,10 +303,10 @@ IMPL_LINK(ListEntryDialog, EditModifiedHdl, Edit*, pEdit)
void openListDialog(SvxOpenCLTabPage* pTabPage, OpenCLConfig::ImplMatcher& rEntry, const OString& rTag)
{
- ListEntryDialog aDlg(pTabPage, rEntry, rTag);
+ ScopedVclPtrInstance< ListEntryDialog > aDlg(pTabPage, rEntry, rTag);
- if (aDlg.Execute() == RET_OK)
- rEntry = aDlg.maEntry;
+ if (aDlg->Execute() == RET_OK)
+ rEntry = aDlg->maEntry;
}
const OpenCLConfig::ImplMatcher& findCurrentEntry(OpenCLConfig::ImplMatcherSet& rSet, SvSimpleTable* pListBox)
diff --git a/cui/source/options/optopencl.hxx b/cui/source/options/optopencl.hxx
index dc28ba32a2c1..09eb097609fd 100644
--- a/cui/source/options/optopencl.hxx
+++ b/cui/source/options/optopencl.hxx
@@ -31,26 +31,26 @@ class SvxOpenCLTabPage : public SfxTabPage
private:
OpenCLConfig maConfig;
- CheckBox* mpUseOpenCL;
-
- VclFrame* mpBlackListFrame;
- SvSimpleTable* mpBlackList;
- SvSimpleTableContainer* mpBlackListTable;
- PushButton* mpBlackListEdit;
- PushButton* mpBlackListAdd;
- PushButton* mpBlackListDelete;
- FixedText* mpOS;
- FixedText* mpOSVersion;
- FixedText* mpDevice;
- FixedText* mpVendor;
- FixedText* mpDrvVersion;
-
- VclFrame* mpWhiteListFrame;
- SvSimpleTable* mpWhiteList;
- SvSimpleTableContainer* mpWhiteListTable;
- PushButton* mpWhiteListEdit;
- PushButton* mpWhiteListAdd;
- PushButton* mpWhiteListDelete;
+ VclPtr<CheckBox> mpUseOpenCL;
+
+ VclPtr<VclFrame> mpBlackListFrame;
+ VclPtr<SvSimpleTable> mpBlackList;
+ VclPtr<SvSimpleTableContainer> mpBlackListTable;
+ VclPtr<PushButton> mpBlackListEdit;
+ VclPtr<PushButton> mpBlackListAdd;
+ VclPtr<PushButton> mpBlackListDelete;
+ VclPtr<FixedText> mpOS;
+ VclPtr<FixedText> mpOSVersion;
+ VclPtr<FixedText> mpDevice;
+ VclPtr<FixedText> mpVendor;
+ VclPtr<FixedText> mpDrvVersion;
+
+ VclPtr<VclFrame> mpWhiteListFrame;
+ VclPtr<SvSimpleTable> mpWhiteList;
+ VclPtr<SvSimpleTableContainer> mpWhiteListTable;
+ VclPtr<PushButton> mpWhiteListEdit;
+ VclPtr<PushButton> mpWhiteListAdd;
+ VclPtr<PushButton> mpWhiteListDelete;
DECL_LINK(BlackListEditHdl, void*);
DECL_LINK(BlackListAddHdl, void*);
@@ -71,8 +71,9 @@ private:
public:
SvxOpenCLTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxOpenCLTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx
index 53363402f7d6..468f56eeed0e 100644
--- a/cui/source/options/optpath.cxx
+++ b/cui/source/options/optpath.cxx
@@ -214,7 +214,7 @@ SvxPathTabPage::SvxPathTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
m_pPathCtrl->set_width_request(aControlSize.Width());
m_pPathCtrl->set_height_request(aControlSize.Height());
WinBits nBits = WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP;
- pPathBox = new svx::OptHeaderTabListBox( *m_pPathCtrl, nBits );
+ pPathBox = VclPtr<svx::OptHeaderTabListBox>::Create( *m_pPathCtrl, nBits );
HeaderBar &rBar = pPathBox->GetTheHeaderBar();
rBar.SetSelectHdl( LINK( this, SvxPathTabPage, HeaderSelect_Impl ) );
@@ -247,21 +247,30 @@ SvxPathTabPage::SvxPathTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
SvxPathTabPage::~SvxPathTabPage()
{
- for ( sal_uInt16 i = 0; i < pPathBox->GetEntryCount(); ++i )
- delete static_cast<PathUserData_Impl*>(pPathBox->GetEntry(i)->GetUserData());
- delete pPathBox;
- delete pImpl;
+ disposeOnce();
}
-
-
-SfxTabPage* SvxPathTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet )
+void SvxPathTabPage::dispose()
{
- return ( new SvxPathTabPage( pParent, *rAttrSet ) );
+ if ( pPathBox )
+ {
+ for ( sal_uInt16 i = 0; i < pPathBox->GetEntryCount(); ++i )
+ delete static_cast<PathUserData_Impl*>(pPathBox->GetEntry(i)->GetUserData());
+ pPathBox.disposeAndClear();
+ }
+ delete pImpl;
+ pImpl = NULL;
+ m_pPathCtrl.clear();
+ m_pStandardBtn.clear();
+ m_pPathBtn.clear();
+ SfxTabPage::dispose();
}
-
+VclPtr<SfxTabPage> SvxPathTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet )
+{
+ return VclPtr<SvxPathTabPage>::Create( pParent, *rAttrSet );
+}
bool SvxPathTabPage::FillItemSet( SfxItemSet* )
{
diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index 1bc7861c0905..a57f3e0dca35 100644
--- a/cui/source/options/optsave.cxx
+++ b/cui/source/options/optsave.cxx
@@ -199,17 +199,38 @@ SfxSaveTabPage::SfxSaveTabPage( vcl::Window* pParent, const SfxItemSet& rCoreSet
SfxSaveTabPage::~SfxSaveTabPage()
{
- delete pImpl;
+ disposeOnce();
}
-
-
-SfxTabPage* SfxSaveTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet )
+void SvxSaveTabPage::dispose()
{
- return ( new SfxSaveTabPage( pParent, *rAttrSet ) );
+ delete pImpl;
+ pImpl = NULL;
+ aLoadUserSettingsCB.clear();
+ aLoadDocPrinterCB.clear();
+ aDocInfoCB.clear();
+ aBackupCB.clear();
+ aAutoSaveCB.clear();
+ aAutoSaveEdit.clear();
+ aMinuteFT.clear();
+ aUserAutoSaveCB.clear();
+ aRelativeFsysCB.clear();
+ aRelativeInetCB.clear();
+ aODFVersionLB.clear();
+ aWarnAlienFormatCB.clear();
+ aDocTypeLB.clear();
+ aSaveAsFT.clear();
+ aSaveAsLB.clear();
+ aODFWarningFI.clear();
+ aODFWarningFT.clear();
+ SfxTabPage::dispose();
}
+VclPtr<SfxTabPage> SfxSaveTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet )
+{
+ return VclPtr<SfxSaveTabPage>::Create( pParent, *rAttrSet );
+}
void SfxSaveTabPage::DetectHiddenControls()
{
diff --git a/cui/source/options/optsave.hxx b/cui/source/options/optsave.hxx
index b5fe40ad204e..f64dc0a82495 100644
--- a/cui/source/options/optsave.hxx
+++ b/cui/source/options/optsave.hxx
@@ -42,25 +42,25 @@ struct SvxSaveTabPage_Impl;
class SvxSaveTabPage : public SfxTabPage
{
private:
- CheckBox* aLoadUserSettingsCB;
- CheckBox* aLoadDocPrinterCB;
-
- CheckBox* aDocInfoCB;
- CheckBox* aBackupCB;
- CheckBox* aAutoSaveCB;
- NumericField* aAutoSaveEdit;
- FixedText* aMinuteFT;
- CheckBox* aUserAutoSaveCB;
- CheckBox* aRelativeFsysCB;
- CheckBox* aRelativeInetCB;
-
- ListBox* aODFVersionLB;
- CheckBox* aWarnAlienFormatCB;
- ListBox* aDocTypeLB;
- FixedText* aSaveAsFT;
- ListBox* aSaveAsLB;
- FixedImage* aODFWarningFI;
- FixedText* aODFWarningFT;
+ VclPtr<CheckBox> aLoadUserSettingsCB;
+ VclPtr<CheckBox> aLoadDocPrinterCB;
+
+ VclPtr<CheckBox> aDocInfoCB;
+ VclPtr<CheckBox> aBackupCB;
+ VclPtr<CheckBox> aAutoSaveCB;
+ VclPtr<NumericField> aAutoSaveEdit;
+ VclPtr<FixedText> aMinuteFT;
+ VclPtr<CheckBox> aUserAutoSaveCB;
+ VclPtr<CheckBox> aRelativeFsysCB;
+ VclPtr<CheckBox> aRelativeInetCB;
+
+ VclPtr<ListBox> aODFVersionLB;
+ VclPtr<CheckBox> aWarnAlienFormatCB;
+ VclPtr<ListBox> aDocTypeLB;
+ VclPtr<FixedText> aSaveAsFT;
+ VclPtr<ListBox> aSaveAsLB;
+ VclPtr<FixedImage> aODFWarningFI;
+ VclPtr<FixedText> aODFWarningFT;
SvxSaveTabPage_Impl* pImpl;
@@ -73,8 +73,9 @@ private:
public:
SvxSaveTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxSaveTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
diff --git a/cui/source/options/optupdt.cxx b/cui/source/options/optupdt.cxx
index e44e76006484..5f66f5bbbd43 100644
--- a/cui/source/options/optupdt.cxx
+++ b/cui/source/options/optupdt.cxx
@@ -82,10 +82,24 @@ SvxOnlineUpdateTabPage::SvxOnlineUpdateTabPage(vcl::Window* pParent, const SfxIt
UpdateLastCheckedText();
}
-
-
SvxOnlineUpdateTabPage::~SvxOnlineUpdateTabPage()
{
+ disposeOnce();
+}
+
+void SvxOnlineUpdateTabPage::dispose()
+{
+ m_pAutoCheckCheckBox.clear();
+ m_pEveryDayButton.clear();
+ m_pEveryWeekButton.clear();
+ m_pEveryMonthButton.clear();
+ m_pCheckNowButton.clear();
+ m_pAutoDownloadCheckBox.clear();
+ m_pDestPathLabel.clear();
+ m_pDestPath.clear();
+ m_pChangePathButton.clear();
+ m_pLastChecked.clear();
+ SfxTabPage::dispose();
}
@@ -146,17 +160,12 @@ void SvxOnlineUpdateTabPage::UpdateLastCheckedText()
m_pLastChecked->SetText( aText );
}
-
-
-SfxTabPage*
+VclPtr<SfxTabPage>
SvxOnlineUpdateTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return new SvxOnlineUpdateTabPage( pParent, *rAttrSet );
+ return VclPtr<SvxOnlineUpdateTabPage>::Create( pParent, *rAttrSet );
}
-
-
-
bool SvxOnlineUpdateTabPage::FillItemSet( SfxItemSet* )
{
bool bModified = false;
diff --git a/cui/source/options/optupdt.hxx b/cui/source/options/optupdt.hxx
index 54bb2a3791f8..ec749adc16c8 100644
--- a/cui/source/options/optupdt.hxx
+++ b/cui/source/options/optupdt.hxx
@@ -29,16 +29,16 @@
class SvxOnlineUpdateTabPage : public SfxTabPage
{
private:
- CheckBox* m_pAutoCheckCheckBox;
- RadioButton* m_pEveryDayButton;
- RadioButton* m_pEveryWeekButton;
- RadioButton* m_pEveryMonthButton;
- PushButton* m_pCheckNowButton;
- CheckBox* m_pAutoDownloadCheckBox;
- FixedText* m_pDestPathLabel;
- FixedText* m_pDestPath;
- PushButton* m_pChangePathButton;
- FixedText* m_pLastChecked;
+ VclPtr<CheckBox> m_pAutoCheckCheckBox;
+ VclPtr<RadioButton> m_pEveryDayButton;
+ VclPtr<RadioButton> m_pEveryWeekButton;
+ VclPtr<RadioButton> m_pEveryMonthButton;
+ VclPtr<PushButton> m_pCheckNowButton;
+ VclPtr<CheckBox> m_pAutoDownloadCheckBox;
+ VclPtr<FixedText> m_pDestPathLabel;
+ VclPtr<FixedText> m_pDestPath;
+ VclPtr<PushButton> m_pChangePathButton;
+ VclPtr<FixedText> m_pLastChecked;
OUString m_aNeverChecked;
OUString m_aLastCheckedTemplate;
@@ -53,8 +53,9 @@ private:
public:
SvxOnlineUpdateTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SvxOnlineUpdateTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx
index ddea9fed3c17..f19cfb4589d9 100644
--- a/cui/source/options/personalization.cxx
+++ b/cui/source/options/personalization.cxx
@@ -92,6 +92,25 @@ SelectPersonaDialog::SelectPersonaDialog( vcl::Window *pParent )
}
}
+SelectPersonaDialog::~SelectPersonaDialog()
+{
+ disposeOnce();
+}
+
+void SelectPersonaDialog::dispose()
+{
+ m_pEdit.clear();
+ m_pSearchButton.clear();
+ m_pProgressLabel.clear();
+ for (VclPtr<PushButton> vp : m_vResultList)
+ vp.clear();
+ for (VclPtr<PushButton> vp : m_vSearchSuggestions)
+ vp.clear();
+ m_pOkButton.clear();
+ m_pCancelButton.clear();
+ ModalDialog::dispose();
+}
+
OUString SelectPersonaDialog::GetSelectedPersona() const
{
if( !m_aSelectedPersona.isEmpty( ) )
@@ -293,11 +312,27 @@ SvxPersonalizationTabPage::SvxPersonalizationTabPage( vcl::Window *pParent, cons
SvxPersonalizationTabPage::~SvxPersonalizationTabPage()
{
+ disposeOnce();
}
-SfxTabPage* SvxPersonalizationTabPage::Create( vcl::Window *pParent, const SfxItemSet *rSet )
+void SvxPersonalizationTabPage::dispose()
+{
+ m_pNoPersona.clear();
+ m_pDefaultPersona.clear();
+ m_pOwnPersona.clear();
+ m_pSelectPersona.clear();
+ for (int i=0; i<3; ++i)
+ m_vDefaultPersonaImages[i].clear();
+ m_pExtensionPersonaPreview.clear();
+ m_pPersonaList.clear();
+ m_pExtensionLabel.clear();
+ SfxTabPage::dispose();
+}
+
+
+VclPtr<SfxTabPage> SvxPersonalizationTabPage::Create( vcl::Window *pParent, const SfxItemSet *rSet )
{
- return new SvxPersonalizationTabPage( pParent, *rSet );
+ return VclPtr<SvxPersonalizationTabPage>::Create( pParent, *rSet );
}
bool SvxPersonalizationTabPage::FillItemSet( SfxItemSet * )
@@ -441,11 +476,11 @@ void SvxPersonalizationTabPage::LoadExtensionThemes()
IMPL_LINK( SvxPersonalizationTabPage, SelectPersona, PushButton*, /*pButton*/ )
{
- SelectPersonaDialog aDialog( NULL );
+ ScopedVclPtrInstance< SelectPersonaDialog > aDialog(nullptr);
- if ( aDialog.Execute() == RET_OK )
+ if ( aDialog->Execute() == RET_OK )
{
- OUString aPersonaSetting( aDialog.GetAppliedPersonaSetting() );
+ OUString aPersonaSetting( aDialog->GetAppliedPersonaSetting() );
if ( !aPersonaSetting.isEmpty() )
{
SetPersonaSettings( aPersonaSetting );
diff --git a/cui/source/options/personalization.hxx b/cui/source/options/personalization.hxx
index 95da0717c932..0ec920db2704 100644
--- a/cui/source/options/personalization.hxx
+++ b/cui/source/options/personalization.hxx
@@ -25,15 +25,15 @@ class SvxPersonalizationTabPage : public SfxTabPage
using SfxTabPage::DeactivatePage;
private:
- RadioButton *m_pNoPersona; ///< Just the default look, without any bitmap
- RadioButton *m_pDefaultPersona; ///< Use the built-in bitmap
- RadioButton *m_pOwnPersona; ///< Use the user-defined bitmap
- PushButton *m_pSelectPersona; ///< Let the user select in the 'own' case
- PushButton *m_vDefaultPersonaImages[3]; ///< Buttons to show the default persona images
- PushButton *m_pExtensionPersonaPreview; ///< Buttons to show the last 3 personas installed via extensions
- ListBox* m_pPersonaList; ///< The ListBox to show the list of installed personas
+ VclPtr<RadioButton> m_pNoPersona; ///< Just the default look, without any bitmap
+ VclPtr<RadioButton> m_pDefaultPersona; ///< Use the built-in bitmap
+ VclPtr<RadioButton> m_pOwnPersona; ///< Use the user-defined bitmap
+ VclPtr<PushButton> m_pSelectPersona; ///< Let the user select in the 'own' case
+ VclPtr<PushButton> m_vDefaultPersonaImages[3]; ///< Buttons to show the default persona images
+ VclPtr<PushButton> m_pExtensionPersonaPreview; ///< Buttons to show the last 3 personas installed via extensions
+ VclPtr<ListBox> m_pPersonaList; ///< The ListBox to show the list of installed personas
OUString m_aPersonaSettings; ///< Header and footer images + color to be set in the settings.
- FixedText *m_pExtensionLabel; ///< The "select persona installed via extensions" label
+ VclPtr<FixedText> m_pExtensionLabel; ///< The "select persona installed via extensions" label
std::vector<OUString> m_vDefaultPersonaSettings;
std::vector<OUString> m_vExtensionPersonaSettings;
@@ -42,8 +42,9 @@ public:
::rtl::Reference< SearchAndParseThread > m_rApplyThread;
SvxPersonalizationTabPage( vcl::Window *pParent, const SfxItemSet &rSet );
virtual ~SvxPersonalizationTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window *pParent, const SfxItemSet *rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window *pParent, const SfxItemSet *rSet );
/// Apply the settings ([OK] button).
virtual bool FillItemSet( SfxItemSet *rSet ) SAL_OVERRIDE;
@@ -78,13 +79,13 @@ https://addons.mozilla.org/firefox/themes ...
class SelectPersonaDialog : public ModalDialog
{
private:
- Edit *m_pEdit; ///< The input line for the search term
- PushButton *m_pSearchButton; ///< The search button
- FixedText *m_pProgressLabel; ///< The label for showing progress of search
- PushButton *m_vResultList[9]; ///< List of buttons to show search results
- PushButton *m_vSearchSuggestions[5]; ///< List of buttons for the search suggestions
- PushButton *m_pOkButton; ///< The OK button
- PushButton *m_pCancelButton; ///< The Cancel button
+ VclPtr<Edit> m_pEdit; ///< The input line for the search term
+ VclPtr<PushButton> m_pSearchButton; ///< The search button
+ VclPtr<FixedText> m_pProgressLabel; ///< The label for showing progress of search
+ VclPtr<PushButton> m_vResultList[9]; ///< List of buttons to show search results
+ VclPtr<PushButton> m_vSearchSuggestions[5]; ///< List of buttons for the search suggestions
+ VclPtr<PushButton> m_pOkButton; ///< The OK button
+ VclPtr<PushButton> m_pCancelButton; ///< The Cancel button
std::vector<OUString> m_vPersonaSettings;
OUString m_aSelectedPersona;
@@ -92,6 +93,8 @@ private:
public:
SelectPersonaDialog( vcl::Window *pParent );
+ virtual ~SelectPersonaDialog();
+ virtual void dispose() SAL_OVERRIDE;
::rtl::Reference< SearchAndParseThread > m_rSearchThread;
OUString GetSelectedPersona() const;
@@ -114,7 +117,7 @@ class SearchAndParseThread: public salhelper::Thread
{
private:
- SelectPersonaDialog *m_pPersonaDialog;
+ VclPtr<SelectPersonaDialog> m_pPersonaDialog;
OUString m_aURL;
bool m_bExecute;
diff --git a/cui/source/options/radiobtnbox.cxx b/cui/source/options/radiobtnbox.cxx
index 7830cbe024f2..500617bedf28 100644
--- a/cui/source/options/radiobtnbox.cxx
+++ b/cui/source/options/radiobtnbox.cxx
@@ -33,10 +33,6 @@ SvxRadioButtonListBox::SvxRadioButtonListBox(SvSimpleTableContainer& rParent, Wi
EnableCheckButton( new SvLBoxButtonData( this, true ) );
}
-SvxRadioButtonListBox::~SvxRadioButtonListBox()
-{
-}
-
void SvxRadioButtonListBox::SetTabs()
{
SvSimpleTable::SetTabs();
diff --git a/cui/source/options/securityoptions.cxx b/cui/source/options/securityoptions.cxx
index b046f218bbb6..aea7fd280645 100644
--- a/cui/source/options/securityoptions.cxx
+++ b/cui/source/options/securityoptions.cxx
@@ -74,8 +74,21 @@ SecurityOptionsDialog::SecurityOptionsDialog(vcl::Window* pParent, SvtSecurityOp
SecurityOptionsDialog::~SecurityOptionsDialog()
{
+ disposeOnce();
}
+void SecurityOptionsDialog::dispose()
+{
+ m_pSaveOrSendDocsCB.clear();
+ m_pSignDocsCB.clear();
+ m_pPrintDocsCB.clear();
+ m_pCreatePdfCB.clear();
+ m_pRemovePersInfoCB.clear();
+ m_pRecommPasswdCB.clear();
+ m_pCtrlHyperlinkCB.clear();
+ m_pBlockUntrustedRefererLinksCB.clear();
+ ModalDialog::dispose();
+}
} // namespace svx
diff --git a/cui/source/options/securityoptions.hxx b/cui/source/options/securityoptions.hxx
index 614e3f72dfa3..216e372e945f 100644
--- a/cui/source/options/securityoptions.hxx
+++ b/cui/source/options/securityoptions.hxx
@@ -37,19 +37,20 @@ namespace svx
class SecurityOptionsDialog : public ModalDialog
{
private:
- CheckBox* m_pSaveOrSendDocsCB;
- CheckBox* m_pSignDocsCB;
- CheckBox* m_pPrintDocsCB;
- CheckBox* m_pCreatePdfCB;
+ VclPtr<CheckBox> m_pSaveOrSendDocsCB;
+ VclPtr<CheckBox> m_pSignDocsCB;
+ VclPtr<CheckBox> m_pPrintDocsCB;
+ VclPtr<CheckBox> m_pCreatePdfCB;
- CheckBox* m_pRemovePersInfoCB;
- CheckBox* m_pRecommPasswdCB;
- CheckBox* m_pCtrlHyperlinkCB;
- CheckBox* m_pBlockUntrustedRefererLinksCB;
+ VclPtr<CheckBox> m_pRemovePersInfoCB;
+ VclPtr<CheckBox> m_pRecommPasswdCB;
+ VclPtr<CheckBox> m_pCtrlHyperlinkCB;
+ VclPtr<CheckBox> m_pBlockUntrustedRefererLinksCB;
public:
SecurityOptionsDialog( vcl::Window* pParent, SvtSecurityOptions* pOptions );
virtual ~SecurityOptionsDialog();
+ virtual void dispose() SAL_OVERRIDE;
bool IsSaveOrSendDocsChecked() const { return m_pSaveOrSendDocsCB->IsChecked(); }
bool IsSignDocsChecked() const { return m_pSignDocsCB->IsChecked(); }
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 42154b213a2f..2267d16775ad 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -291,7 +291,7 @@ void MailMergeCfg_Impl::Notify( const com::sun::star::uno::Sequence< OUString >&
}
//typedef SfxTabPage* (*FNCreateTabPage)( vcl::Window *pParent, const SfxItemSet &rAttrSet );
-SfxTabPage* CreateGeneralTabPage( sal_uInt16 nId, vcl::Window* pParent, const SfxItemSet& rSet )
+VclPtr<SfxTabPage> CreateGeneralTabPage( sal_uInt16 nId, vcl::Window* pParent, const SfxItemSet& rSet )
{
CreateTabPage fnCreate = 0;
switch(nId)
@@ -332,7 +332,7 @@ SfxTabPage* CreateGeneralTabPage( sal_uInt16 nId, vcl::Window* pParent, const Sf
#endif
}
- SfxTabPage* pRet = fnCreate ? (*fnCreate)( pParent, &rSet ) : NULL;
+ VclPtr<SfxTabPage> pRet = fnCreate ? (*fnCreate)( pParent, &rSet ) : nullptr;
return pRet;
}
@@ -465,11 +465,11 @@ static bool lcl_isOptionHidden( sal_uInt16 _nPageId, const SvtOptionsDialogOptio
struct OptionsPageInfo
{
- SfxTabPage* m_pPage;
+ ScopedVclPtr<SfxTabPage> m_pPage;
sal_uInt16 m_nPageId;
OUString m_sPageURL;
OUString m_sEventHdl;
- ExtensionsTabPage* m_pExtPage;
+ VclPtr<ExtensionsTabPage> m_pExtPage;
OptionsPageInfo( sal_uInt16 nId ) : m_pPage( NULL ), m_nPageId( nId ), m_pExtPage( NULL ) {}
};
@@ -483,7 +483,7 @@ struct OptionsGroupInfo
sal_uInt16 m_nDialogId; // Id of the former dialog
bool m_bLoadError; // load fails?
OUString m_sPageURL;
- ExtensionsTabPage* m_pExtPage;
+ VclPtr<ExtensionsTabPage> m_pExtPage;
OptionsGroupInfo( SfxShell* pSh, SfxModule* pMod, sal_uInt16 nId ) :
m_pInItemSet( NULL ), m_pOutItemSet( NULL ), m_pShell( pSh ),
@@ -552,8 +552,13 @@ OfaTreeOptionsDialog::OfaTreeOptionsDialog( vcl::Window* pParent, const OUString
OfaTreeOptionsDialog::~OfaTreeOptionsDialog()
{
+ disposeOnce();
+}
+
+void OfaTreeOptionsDialog::dispose()
+{
pCurrentPageEntry = NULL;
- SvTreeListEntry* pEntry = pTreeLB->First();
+ SvTreeListEntry* pEntry = pTreeLB ? pTreeLB->First() : NULL;
// first children
while(pEntry)
{
@@ -570,7 +575,7 @@ OfaTreeOptionsDialog::~OfaTreeOptionsDialog()
SvtViewOptions aTabPageOpt( E_TABPAGE, OUString::number( pPageInfo->m_nPageId) );
SetViewOptUserItem( aTabPageOpt, aPageData );
}
- delete pPageInfo->m_pPage;
+ pPageInfo->m_pPage.disposeAndClear();
}
if (pPageInfo->m_nPageId == RID_SFXPAGE_LINGU)
@@ -583,7 +588,7 @@ OfaTreeOptionsDialog::~OfaTreeOptionsDialog()
}
}
- delete pPageInfo->m_pExtPage;
+ pPageInfo->m_pExtPage.disposeAndClear();
delete pPageInfo;
}
@@ -591,20 +596,27 @@ OfaTreeOptionsDialog::~OfaTreeOptionsDialog()
}
// and parents
- pEntry = pTreeLB->First();
+ pEntry = pTreeLB ? pTreeLB->First() : NULL;
while(pEntry)
{
if(!pTreeLB->GetParent(pEntry))
{
OptionsGroupInfo* pGroupInfo = static_cast<OptionsGroupInfo*>(pEntry->GetUserData());
- if ( pGroupInfo && pGroupInfo->m_pExtPage )
- delete pGroupInfo->m_pExtPage;
+ if ( pGroupInfo )
+ pGroupInfo->m_pExtPage.disposeAndClear();
delete pGroupInfo;
}
pEntry = pTreeLB->Next(pEntry);
}
delete pColorPageItemSet;
+ pColorPageItemSet = NULL;
deleteGroupNames();
+ pOkPB.clear();
+ pBackPB.clear();
+ pTreeLB.clear();
+ pTabBox.clear();
+ mpColorPage.clear();
+ SfxModalDialog::dispose();
}
OptionsPageInfo* OfaTreeOptionsDialog::AddTabPage(
@@ -1038,17 +1050,17 @@ void OfaTreeOptionsDialog::SelectHdl_Impl()
if(pPageInfo->m_nPageId == RID_SVXPAGE_COLOR)
{
- pPageInfo->m_pPage = ::CreateGeneralTabPage(
- pPageInfo->m_nPageId, pTabBox, *pColorPageItemSet );
- mpColorPage = static_cast<SvxColorTabPage*>(pPageInfo->m_pPage);
+ pPageInfo->m_pPage.reset( ::CreateGeneralTabPage(
+ pPageInfo->m_nPageId, pTabBox, *pColorPageItemSet ) );
+ mpColorPage = static_cast<SvxColorTabPage*>(pPageInfo->m_pPage.get());
mpColorPage->SetupForViewFrame( SfxViewFrame::Current() );
}
else
{
- pPageInfo->m_pPage = ::CreateGeneralTabPage(pPageInfo->m_nPageId, pTabBox, *pGroupInfo->m_pInItemSet );
+ pPageInfo->m_pPage.reset( ::CreateGeneralTabPage(pPageInfo->m_nPageId, pTabBox, *pGroupInfo->m_pInItemSet ) );
if(!pPageInfo->m_pPage && pGroupInfo->m_pModule)
- pPageInfo->m_pPage = pGroupInfo->m_pModule->CreateTabPage(pPageInfo->m_nPageId, pTabBox, *pGroupInfo->m_pInItemSet);
+ pPageInfo->m_pPage.reset( pGroupInfo->m_pModule->CreateTabPage(pPageInfo->m_nPageId, pTabBox, *pGroupInfo->m_pInItemSet) );
}
@@ -1076,7 +1088,8 @@ void OfaTreeOptionsDialog::SelectHdl_Impl()
m_xContainerWinProvider = awt::ContainerWindowProvider::create( ::comphelper::getProcessComponentContext() );
}
- pPageInfo->m_pExtPage = new ExtensionsTabPage(
+ pPageInfo->m_pExtPage = VclPtr<ExtensionsTabPage>::Create(
+
pTabBox, 0, pPageInfo->m_sPageURL, pPageInfo->m_sEventHdl, m_xContainerWinProvider );
}
@@ -2156,6 +2169,11 @@ ExtensionsTabPage::ExtensionsTabPage(
ExtensionsTabPage::~ExtensionsTabPage()
{
+ disposeOnce();
+}
+
+void ExtensionsTabPage::dispose()
+{
Hide();
DeactivatePage();
@@ -2174,6 +2192,7 @@ ExtensionsTabPage::~ExtensionsTabPage()
}
m_xPage.clear();
}
+ TabPage::dispose();
}
diff --git a/cui/source/options/tsaurls.cxx b/cui/source/options/tsaurls.cxx
index 9db380135ed7..142ea656f045 100644
--- a/cui/source/options/tsaurls.cxx
+++ b/cui/source/options/tsaurls.cxx
@@ -67,6 +67,17 @@ IMPL_LINK_NOARG(TSAURLsDialog, OKHdl_Impl)
TSAURLsDialog::~TSAURLsDialog()
{
+ disposeOnce();
+}
+
+void TSAURLsDialog::dispose()
+{
+ m_pAddBtn.clear();
+ m_pDeleteBtn.clear();
+ m_pOKBtn.clear();
+ m_pURLListBox.clear();
+
+ ModalDialog::dispose();
}
void TSAURLsDialog::AddTSAURL(const OUString& rURL)
diff --git a/cui/source/options/tsaurls.hxx b/cui/source/options/tsaurls.hxx
index aba749181ac5..0b25238f1397 100644
--- a/cui/source/options/tsaurls.hxx
+++ b/cui/source/options/tsaurls.hxx
@@ -16,10 +16,10 @@
class TSAURLsDialog : public ModalDialog
{
private:
- ListBox* m_pURLListBox;
- PushButton* m_pAddBtn;
- PushButton* m_pDeleteBtn;
- OKButton* m_pOKBtn;
+ VclPtr<ListBox> m_pURLListBox;
+ VclPtr<PushButton> m_pAddBtn;
+ VclPtr<PushButton> m_pDeleteBtn;
+ VclPtr<OKButton> m_pOKBtn;
DECL_LINK(AddHdl_Impl, void *);
DECL_LINK(DeleteHdl_Impl, void *);
@@ -32,7 +32,7 @@ private:
public:
TSAURLsDialog(vcl::Window* pParent);
virtual ~TSAURLsDialog();
-
+ virtual void dispose() SAL_OVERRIDE;
};
#endif
diff --git a/cui/source/options/webconninfo.cxx b/cui/source/options/webconninfo.cxx
index b5c61bf88397..e97f790b3a32 100644
--- a/cui/source/options/webconninfo.cxx
+++ b/cui/source/options/webconninfo.cxx
@@ -111,7 +111,7 @@ WebConnectionInfoDialog::WebConnectionInfoDialog(vcl::Window* pParent)
get(m_pChangeBtn, "change");
SvSimpleTableContainer *pPasswordsLBContainer = get<SvSimpleTableContainer>("logins");
- m_pPasswordsLB = new PasswordTable(*pPasswordsLBContainer, 0);
+ m_pPasswordsLB = VclPtr<PasswordTable>::Create(*pPasswordsLBContainer, 0);
long aStaticTabs[]= { 2, 0, 0 };
m_pPasswordsLB->SetTabs( aStaticTabs );
@@ -142,9 +142,17 @@ WebConnectionInfoDialog::WebConnectionInfoDialog(vcl::Window* pParent)
WebConnectionInfoDialog::~WebConnectionInfoDialog()
{
- delete m_pPasswordsLB;
+ disposeOnce();
}
+void WebConnectionInfoDialog::dispose()
+{
+ m_pPasswordsLB.disposeAndClear();
+ m_pRemoveBtn.clear();
+ m_pRemoveAllBtn.clear();
+ m_pChangeBtn.clear();
+ ModalDialog::dispose();
+}
IMPL_LINK( WebConnectionInfoDialog, HeaderBarClickedHdl, SvSimpleTable*, pTable )
{
diff --git a/cui/source/options/webconninfo.hxx b/cui/source/options/webconninfo.hxx
index 366bcfc31283..a9d1b566d592 100644
--- a/cui/source/options/webconninfo.hxx
+++ b/cui/source/options/webconninfo.hxx
@@ -47,10 +47,10 @@ namespace svx
class WebConnectionInfoDialog : public ModalDialog
{
private:
- PasswordTable* m_pPasswordsLB;
- PushButton* m_pRemoveBtn;
- PushButton* m_pRemoveAllBtn;
- PushButton* m_pChangeBtn;
+ VclPtr<PasswordTable> m_pPasswordsLB;
+ VclPtr<PushButton> m_pRemoveBtn;
+ VclPtr<PushButton> m_pRemoveAllBtn;
+ VclPtr<PushButton> m_pChangeBtn;
sal_Int32 m_nPos;
DECL_LINK( HeaderBarClickedHdl, SvSimpleTable* );
@@ -64,6 +64,7 @@ namespace svx
public:
WebConnectionInfoDialog( vcl::Window* pParent );
virtual ~WebConnectionInfoDialog();
+ virtual void dispose() SAL_OVERRIDE;
};
diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx
index 8a80c500e9f4..8d7329fe19b1 100644
--- a/cui/source/tabpages/align.cxx
+++ b/cui/source/tabpages/align.cxx
@@ -250,12 +250,44 @@ AlignmentTabPage::AlignmentTabPage( vcl::Window* pParent, const SfxItemSet& rCor
AlignmentTabPage::~AlignmentTabPage()
{
+ disposeOnce();
+}
+
+void AlignmentTabPage::dispose()
+{
delete m_pOrientHlp;
+ m_pOrientHlp = NULL;
+ m_pLbHorAlign.clear();
+ m_pFtIndent.clear();
+ m_pEdIndent.clear();
+ m_pFtVerAlign.clear();
+ m_pLbVerAlign.clear();
+ m_pCtrlDial.clear();
+ m_pFtRotate.clear();
+ m_pNfRotate.clear();
+ m_pFtRefEdge.clear();
+ m_pVsRefEdge.clear();
+ m_pCbStacked.clear();
+ m_pCbAsianMode.clear();
+ m_pBoxDirection.clear();
+ m_pBtnWrap.clear();
+ m_pBtnHyphen.clear();
+ m_pBtnShrink.clear();
+ m_pLbFrameDir.clear();
+ m_pFtBotLock.clear();
+ m_pFtTopLock.clear();
+ m_pFtCelLock.clear();
+ m_pFtABCD.clear();
+ m_pAlignmentFrame.clear();
+ m_pOrientFrame.clear();
+ m_pPropertiesFrame.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* AlignmentTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> AlignmentTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return new AlignmentTabPage( pParent, *rAttrSet );
+ return VclPtr<SfxTabPage>( new AlignmentTabPage( pParent, *rAttrSet ),
+ SAL_NO_ACQUIRE );
}
bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet )
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 5c46ca9f8488..9d492b843612 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -137,6 +137,18 @@ OfaAutoCorrDlg::OfaAutoCorrDlg(vcl::Window* pParent, const SfxItemSet* _pSet )
SetCurPageId("smarttags");
}
+OfaAutoCorrDlg::~OfaAutoCorrDlg()
+{
+ disposeOnce();
+}
+
+void OfaAutoCorrDlg::dispose()
+{
+ m_pLanguageBox.clear();
+ m_pLanguageLB.clear();
+ SfxTabDialog::dispose();
+}
+
void OfaAutoCorrDlg::EnableLanguage(bool bEnable)
{
m_pLanguageBox->Enable(bEnable);
@@ -192,10 +204,21 @@ OfaAutocorrOptionsPage::OfaAutocorrOptionsPage(vcl::Window* pParent, const SfxIt
get(m_pCheckLB, "checklist");
}
-SfxTabPage* OfaAutocorrOptionsPage::Create( vcl::Window* pParent,
- const SfxItemSet* rSet)
+OfaAutocorrOptionsPage::~OfaAutocorrOptionsPage()
+{
+ disposeOnce();
+}
+
+void OfaAutocorrOptionsPage::dispose()
+{
+ m_pCheckLB.clear();
+ SfxTabPage::dispose();
+}
+
+VclPtr<SfxTabPage> OfaAutocorrOptionsPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rSet)
{
- return new OfaAutocorrOptionsPage(pParent, *rSet);
+ return VclPtr<OfaAutocorrOptionsPage>::Create(pParent, *rSet);
}
bool OfaAutocorrOptionsPage::FillItemSet( SfxItemSet* )
@@ -282,13 +305,16 @@ struct ImpUserData
class OfaAutoFmtPrcntSet : public ModalDialog
{
- MetricField* m_pPrcntMF;
+ VclPtr<MetricField> m_pPrcntMF;
public:
OfaAutoFmtPrcntSet(vcl::Window* pParent)
: ModalDialog(pParent, "PercentDialog","cui/ui/percentdialog.ui")
{
get(m_pPrcntMF, "margin");
}
+ virtual ~OfaAutoFmtPrcntSet() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE { m_pPrcntMF.clear(); ModalDialog::dispose(); }
+
MetricField& GetPrcntFld()
{
return *m_pPrcntMF;
@@ -417,7 +443,7 @@ OfaSwAutoFmtOptionsPage::OfaSwAutoFmtOptionsPage( vcl::Window* pParent,
aControlSize = LogicToPixel(aControlSize, MAP_APPFONT);
pCheckLBContainer->set_width_request(aControlSize.Width());
pCheckLBContainer->set_height_request(aControlSize.Height());
- m_pCheckLB = new OfaACorrCheckListBox(*pCheckLBContainer);
+ m_pCheckLB = VclPtr<OfaACorrCheckListBox>::Create(*pCheckLBContainer);
m_pCheckLB->SetStyle(m_pCheckLB->GetStyle()|WB_HSCROLL| WB_VSCROLL);
@@ -469,17 +495,28 @@ SvTreeListEntry* OfaSwAutoFmtOptionsPage::CreateEntry(OUString& rTxt, sal_uInt16
OfaSwAutoFmtOptionsPage::~OfaSwAutoFmtOptionsPage()
{
- delete static_cast<ImpUserData*>(m_pCheckLB->GetUserData( REPLACE_BULLETS ));
- delete static_cast<ImpUserData*>(m_pCheckLB->GetUserData( APPLY_NUMBERING ));
- delete static_cast<ImpUserData*>(m_pCheckLB->GetUserData( MERGE_SINGLE_LINE_PARA ));
- delete pCheckButtonData;
- delete m_pCheckLB;
+ disposeOnce();
+}
+
+void OfaSwAutoFmtOptionsPage::dispose()
+{
+ if (m_pCheckLB)
+ {
+ delete static_cast<ImpUserData*>(m_pCheckLB->GetUserData( REPLACE_BULLETS ));
+ delete static_cast<ImpUserData*>(m_pCheckLB->GetUserData( APPLY_NUMBERING ));
+ delete static_cast<ImpUserData*>(m_pCheckLB->GetUserData( MERGE_SINGLE_LINE_PARA ));
+ delete pCheckButtonData;
+ pCheckButtonData = NULL;
+ }
+ m_pCheckLB.disposeAndClear();
+ m_pEditPB.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* OfaSwAutoFmtOptionsPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet)
+VclPtr<SfxTabPage> OfaSwAutoFmtOptionsPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet)
{
- return new OfaSwAutoFmtOptionsPage(pParent, *rAttrSet);
+ return VclPtr<SfxTabPage>( new OfaSwAutoFmtOptionsPage(pParent, *rAttrSet), SAL_NO_ACQUIRE );
}
bool OfaSwAutoFmtOptionsPage::FillItemSet( SfxItemSet* )
@@ -694,7 +731,7 @@ IMPL_LINK_NOARG(OfaSwAutoFmtOptionsPage, EditHdl)
if( nSelEntryPos == REPLACE_BULLETS ||
nSelEntryPos == APPLY_NUMBERING)
{
- boost::scoped_ptr<SvxCharacterMap> pMapDlg(new SvxCharacterMap(this));
+ ScopedVclPtrInstance< SvxCharacterMap > pMapDlg(this);
ImpUserData* pUserData = static_cast<ImpUserData*>(m_pCheckLB->FirstSelected()->GetUserData());
pMapDlg->SetCharFont(*pUserData->pFont);
pMapDlg->SetChar( (*pUserData->pString)[0] );
@@ -711,11 +748,11 @@ IMPL_LINK_NOARG(OfaSwAutoFmtOptionsPage, EditHdl)
else if( MERGE_SINGLE_LINE_PARA == nSelEntryPos )
{
// dialog for per cent settings
- OfaAutoFmtPrcntSet aDlg(this);
- aDlg.GetPrcntFld().SetValue(nPercent);
- if(RET_OK == aDlg.Execute())
+ ScopedVclPtrInstance< OfaAutoFmtPrcntSet > aDlg(this);
+ aDlg->GetPrcntFld().SetValue(nPercent);
+ if(RET_OK == aDlg->Execute())
{
- nPercent = (sal_uInt16)aDlg.GetPrcntFld().GetValue();
+ nPercent = (sal_uInt16)aDlg->GetPrcntFld().GetValue();
sMargin = " " +
unicode::formatPercent(nPercent, Application::GetSettings().GetUILanguageTag());
}
@@ -897,16 +934,31 @@ void OfaAutocorrReplacePage::Resize()
OfaAutocorrReplacePage::~OfaAutocorrReplacePage()
{
+ disposeOnce();
+}
+
+void OfaAutocorrReplacePage::dispose()
+{
aDoubleStringTable.clear();
aChangesTable.clear();
delete pCompareClass;
+ pCompareClass = NULL;
delete pCharClass;
+ pCharClass = NULL;
+
+ m_pTextOnlyCB.clear();
+ m_pShortED.clear();
+ m_pReplaceED.clear();
+ m_pReplaceTLB.clear();
+ m_pNewReplacePB.clear();
+ m_pDeleteReplacePB.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* OfaAutocorrReplacePage::Create( vcl::Window* pParent, const SfxItemSet* rSet)
+VclPtr<SfxTabPage> OfaAutocorrReplacePage::Create( vcl::Window* pParent, const SfxItemSet* rSet)
{
- return new OfaAutocorrReplacePage(pParent, *rSet);
+ return VclPtr<OfaAutocorrReplacePage>::Create(pParent, *rSet);
}
void OfaAutocorrReplacePage::ActivatePage( const SfxItemSet& )
@@ -1400,14 +1452,30 @@ OfaAutocorrExceptPage::OfaAutocorrExceptPage(vcl::Window* pParent, const SfxItem
OfaAutocorrExceptPage::~OfaAutocorrExceptPage()
{
+ disposeOnce();
+}
+
+void OfaAutocorrExceptPage::dispose()
+{
aStringsTable.clear();
delete pCompareClass;
+ m_pAbbrevED.clear();
+ m_pAbbrevLB.clear();
+ m_pNewAbbrevPB.clear();
+ m_pDelAbbrevPB.clear();
+ m_pAutoAbbrevCB.clear();
+ m_pDoubleCapsED.clear();
+ m_pDoubleCapsLB.clear();
+ m_pNewDoublePB.clear();
+ m_pDelDoublePB.clear();
+ m_pAutoCapsCB.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* OfaAutocorrExceptPage::Create( vcl::Window* pParent,
- const SfxItemSet* rSet)
+VclPtr<SfxTabPage> OfaAutocorrExceptPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rSet)
{
- return new OfaAutocorrExceptPage(pParent, *rSet);
+ return VclPtr<OfaAutocorrExceptPage>::Create(pParent, *rSet);
}
void OfaAutocorrExceptPage::ActivatePage( const SfxItemSet& )
@@ -1618,7 +1686,7 @@ void OfaAutocorrExceptPage::Reset( const SfxItemSet* )
IMPL_LINK(OfaAutocorrExceptPage, NewDelHdl, void*, pBtn)
{
- if((pBtn == m_pNewAbbrevPB || pBtn == m_pAbbrevED )
+ if((pBtn == m_pNewAbbrevPB || pBtn == m_pAbbrevED.get() )
&& !m_pAbbrevED->GetText().isEmpty())
{
m_pAbbrevLB->InsertEntry(m_pAbbrevED->GetText());
@@ -1629,7 +1697,7 @@ IMPL_LINK(OfaAutocorrExceptPage, NewDelHdl, void*, pBtn)
m_pAbbrevLB->RemoveEntry(m_pAbbrevED->GetText());
ModifyHdl(m_pAbbrevED);
}
- else if((pBtn == m_pNewDoublePB || pBtn == m_pDoubleCapsED )
+ else if((pBtn == m_pNewDoublePB || pBtn == m_pDoubleCapsED.get() )
&& !m_pDoubleCapsED->GetText().isEmpty())
{
m_pDoubleCapsLB->InsertEntry(m_pDoubleCapsED->GetText());
@@ -1756,7 +1824,7 @@ OfaQuoteTabPage::OfaQuoteTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
aControlSize = LogicToPixel(aControlSize, MAP_APPFONT);
pListContainer->set_width_request(aControlSize.Width());
pListContainer->set_height_request(aControlSize.Height());
- m_pSwCheckLB = new OfaACorrCheckListBox(*pListContainer),
+ m_pSwCheckLB = VclPtr<OfaACorrCheckListBox>::Create(*pListContainer),
get(m_pSingleTypoCB, "singlereplace");
get(m_pSglStartQuotePB, "startsingle");
@@ -1817,14 +1885,35 @@ OfaQuoteTabPage::OfaQuoteTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
OfaQuoteTabPage::~OfaQuoteTabPage()
{
- delete pCheckButtonData;
- delete m_pSwCheckLB;
+ disposeOnce();
}
-SfxTabPage* OfaQuoteTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet)
+void OfaQuoteTabPage::dispose()
{
- return new OfaQuoteTabPage(pParent, *rAttrSet);
+ delete pCheckButtonData;
+ pCheckButtonData = NULL;
+ m_pSwCheckLB.disposeAndClear();
+ m_pCheckLB.disposeAndClear();
+ m_pSingleTypoCB.clear();
+ m_pSglStartQuotePB.clear();
+ m_pSglStartExFT.clear();
+ m_pSglEndQuotePB.clear();
+ m_pSglEndExFT.clear();
+ m_pSglStandardPB.clear();
+ m_pDoubleTypoCB.clear();
+ m_pDblStartQuotePB.clear();
+ m_pDblStartExFT.clear();
+ m_pDblEndQuotePB.clear();
+ m_pDblEndExFT.clear();
+ m_pDblStandardPB.clear();
+ SfxTabPage::dispose();
+}
+
+VclPtr<SfxTabPage> OfaQuoteTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet)
+{
+ return VclPtr<SfxTabPage>( new OfaQuoteTabPage(pParent, *rAttrSet),
+ SAL_NO_ACQUIRE );
}
bool OfaQuoteTabPage::FillItemSet( SfxItemSet* )
@@ -1973,7 +2062,7 @@ IMPL_LINK( OfaQuoteTabPage, QuoteHdl, PushButton*, pBtn )
else if (pBtn == m_pDblEndQuotePB)
nMode = DBL_END;
// start character selection dialog
- boost::scoped_ptr<SvxCharacterMap> pMap(new SvxCharacterMap( this, true ));
+ ScopedVclPtrInstance< SvxCharacterMap > pMap( this, true );
pMap->SetCharFont( OutputDevice::GetDefaultFont(DEFAULTFONT_LATIN_TEXT,
LANGUAGE_ENGLISH_US, DEFAULTFONT_FLAGS_ONLYONE, 0 ));
pMap->SetText(nMode < SGL_END ? m_sStartQuoteDlg : m_sEndQuoteDlg );
@@ -2143,12 +2232,28 @@ OfaAutoCompleteTabPage::OfaAutoCompleteTabPage(vcl::Window* pParent,
OfaAutoCompleteTabPage::~OfaAutoCompleteTabPage()
{
+ disposeOnce();
}
-SfxTabPage* OfaAutoCompleteTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rSet)
+void OfaAutoCompleteTabPage::dispose()
{
- return new OfaAutoCompleteTabPage( pParent, *rSet );
+ m_pCBActiv.clear();
+ m_pCBAppendSpace.clear();
+ m_pCBAsTip.clear();
+ m_pCBCollect.clear();
+ m_pCBRemoveList.clear();
+ m_pDCBExpandKey.clear();
+ m_pNFMinWordlen.clear();
+ m_pNFMaxEntries.clear();
+ m_pLBEntries.clear();
+ m_pPBEntries.clear();
+ SfxTabPage::dispose();
+}
+
+VclPtr<SfxTabPage> OfaAutoCompleteTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rSet)
+{
+ return VclPtr<SfxTabPage>( new OfaAutoCompleteTabPage( pParent, *rSet ), SAL_NO_ACQUIRE );
}
bool OfaAutoCompleteTabPage::FillItemSet( SfxItemSet* )
@@ -2318,6 +2423,17 @@ void OfaAutoCompleteTabPage::CopyToClipboard() const
}
}
+OfaAutoCompleteTabPage::AutoCompleteMultiListBox::~AutoCompleteMultiListBox()
+{
+ disposeOnce();
+}
+
+void OfaAutoCompleteTabPage::AutoCompleteMultiListBox::dispose()
+{
+ m_pPage.clear();
+ MultiListBox::dispose();
+}
+
bool OfaAutoCompleteTabPage::AutoCompleteMultiListBox::PreNotify(
NotifyEvent& rNEvt )
{
@@ -2381,12 +2497,20 @@ OfaSmartTagOptionsTabPage::OfaSmartTagOptionsTabPage( vcl::Window* pParent,
OfaSmartTagOptionsTabPage::~OfaSmartTagOptionsTabPage()
{
+ disposeOnce();
+}
+void OfaSmartTagOptionsTabPage::dispose()
+{
+ m_pMainCB.clear();
+ m_pSmartTagTypesLB.clear();
+ m_pPropertiesPB.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* OfaSmartTagOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet)
+VclPtr<SfxTabPage> OfaSmartTagOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet)
{
- return new OfaSmartTagOptionsTabPage( pParent, *rSet );
+ return VclPtr<OfaSmartTagOptionsTabPage>::Create( pParent, *rSet );
}
/** This struct is used to associate list box entries with smart tag data
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 6be44956e12d..6ff30321d4d3 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -183,6 +183,7 @@ public:
BackgroundPreviewImpl(vcl::Window* pParent);
void setBmp(bool bBmp);
virtual ~BackgroundPreviewImpl();
+ virtual void dispose() SAL_OVERRIDE;
void NotifyChange( const Color& rColor );
void NotifyChange( const Bitmap* pBitmap );
@@ -230,9 +231,15 @@ void BackgroundPreviewImpl::setBmp(bool bBmp)
BackgroundPreviewImpl::~BackgroundPreviewImpl()
{
- delete pBitmap;
+ disposeOnce();
}
+void BackgroundPreviewImpl::dispose()
+{
+ delete pBitmap;
+ pBitmap = NULL;
+ vcl::Window::dispose();
+}
void BackgroundPreviewImpl::NotifyChange( const Color& rColor )
{
@@ -422,9 +429,20 @@ SvxBackgroundTabPage::SvxBackgroundTabPage(vcl::Window* pParent, const SfxItemSe
SvxBackgroundTabPage::~SvxBackgroundTabPage()
{
- delete pPageImpl->pLoadIdle;
- delete pPageImpl;
+ disposeOnce();
+}
+
+void SvxBackgroundTabPage::dispose()
+{
+ if (pPageImpl)
+ {
+ delete pPageImpl->pLoadIdle;
+ delete pPageImpl;
+ pPageImpl = NULL;
+ }
+
delete pImportDlg;
+ pImportDlg = NULL;
if( pTableBck_Impl)
{
@@ -432,6 +450,7 @@ SvxBackgroundTabPage::~SvxBackgroundTabPage()
delete pTableBck_Impl->pRowBrush;
delete pTableBck_Impl->pTableBrush;
delete pTableBck_Impl;
+ pTableBck_Impl = NULL;
}
if(pParaBck_Impl)
@@ -439,21 +458,44 @@ SvxBackgroundTabPage::~SvxBackgroundTabPage()
delete pParaBck_Impl->pParaBrush;
delete pParaBck_Impl->pCharBrush;
delete pParaBck_Impl;
+ pParaBck_Impl = NULL;
}
-}
-
+ m_pAsGrid.clear();
+ m_pSelectTxt.clear();
+ m_pLbSelect.clear();
+ m_pTblDesc.clear();
+ m_pTblLBox.clear();
+ m_pParaLBox.clear();
+ m_pBackGroundColorFrame.clear();
+ m_pBackgroundColorSet.clear();
+ m_pPreviewWin1.clear();
+ m_pColTransFT.clear();
+ m_pColTransMF.clear();
+ m_pBtnPreview.clear();
+ m_pBitmapContainer.clear();
+ m_pFileFrame.clear();
+ m_pBtnBrowse.clear();
+ m_pBtnLink.clear();
+ m_pFtUnlinked.clear();
+ m_pFtFile.clear();
+ m_pTypeFrame.clear();
+ m_pBtnPosition.clear();
+ m_pBtnArea.clear();
+ m_pBtnTile.clear();
+ m_pWndPosition.clear();
+ m_pGraphTransFrame.clear();
+ m_pGraphTransMF.clear();
+ m_pPreviewWin2.clear();
+ SvxTabPage::dispose();
+}
-SfxTabPage* SvxBackgroundTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet )
-
-/* [Description]
- create method for the TabDialog
-*/
+VclPtr<SfxTabPage> SvxBackgroundTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet )
{
- return ( new SvxBackgroundTabPage( pParent, *rAttrSet ) );
+ return VclPtr<SfxTabPage>( new SvxBackgroundTabPage( pParent, *rAttrSet ), SAL_NO_ACQUIRE );
}
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index 803779389026..387e003402c3 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -334,21 +334,47 @@ SvxBorderTabPage::SvxBorderTabPage(vcl::Window* pParent, const SfxItemSet& rCore
m_pMergeAdjacentBordersCB->Hide();
}
-
-
SvxBorderTabPage::~SvxBorderTabPage()
{
+ disposeOnce();
}
-
-
-SfxTabPage* SvxBorderTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet )
+void SvxBorderTabPage::dispose()
{
- return ( new SvxBorderTabPage( pParent, *rAttrSet ) );
+ m_pWndPresets.clear();
+ m_pUserDefFT.clear();
+ m_pFrameSel.clear();
+ m_pLbLineStyle.clear();
+ m_pLbLineColor.clear();
+ m_pLineWidthMF.clear();
+ m_pSpacingFrame.clear();
+ m_pLeftFT.clear();
+ m_pLeftMF.clear();
+ m_pRightFT.clear();
+ m_pRightMF.clear();
+ m_pTopFT.clear();
+ m_pTopMF.clear();
+ m_pBottomFT.clear();
+ m_pBottomMF.clear();
+ m_pSynchronizeCB.clear();
+ m_pShadowFrame.clear();
+ m_pWndShadows.clear();
+ m_pFtShadowSize.clear();
+ m_pEdShadowSize.clear();
+ m_pFtShadowColor.clear();
+ m_pLbShadowColor.clear();
+ m_pPropertiesFrame.clear();
+ m_pMergeWithNextCB.clear();
+ m_pMergeAdjacentBordersCB.clear();
+ SfxTabPage::dispose();
}
-
+VclPtr<SfxTabPage> SvxBorderTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet )
+{
+ return VclPtr<SfxTabPage>(new SvxBorderTabPage( pParent, *rAttrSet ),
+ SAL_NO_ACQUIRE);
+}
void SvxBorderTabPage::ResetFrameLine_Impl( svx::FrameBorderType eBorder, const SvxBorderLine* pCoreLine, bool bValid )
{
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 6df37aa3d3d8..96da16d8c445 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -183,12 +183,16 @@ SvxCharBasePage::SvxCharBasePage(vcl::Window* pParent, const OString& rID, const
{
}
-
-
SvxCharBasePage::~SvxCharBasePage()
{
+ disposeOnce();
}
+void SvxCharBasePage::dispose()
+{
+ m_pPreviewWin.clear();
+ SfxTabPage::dispose();
+}
void SvxCharBasePage::ActivatePage( const SfxItemSet& rSet )
@@ -375,10 +379,45 @@ SvxCharNamePage::SvxCharNamePage( vcl::Window* pParent, const SfxItemSet& rInSet
SvxCharNamePage::~SvxCharNamePage()
{
- delete m_pImpl;
+ disposeOnce();
}
-
+void SvxCharNamePage::dispose()
+{
+ delete m_pImpl;
+ m_pImpl = NULL;
+ m_pWestFrame.clear();
+ m_pWestFontNameFT.clear();
+ m_pWestFontNameLB.clear();
+ m_pWestFontStyleFT.clear();
+ m_pWestFontStyleLB.clear();
+ m_pWestFontSizeFT.clear();
+ m_pWestFontSizeLB.clear();
+ m_pWestFontLanguageFT.clear();
+ m_pWestFontLanguageLB.clear();
+ m_pWestFontTypeFT.clear();
+ m_pEastFrame.clear();
+ m_pEastFontNameFT.clear();
+ m_pEastFontNameLB.clear();
+ m_pEastFontStyleFT.clear();
+ m_pEastFontStyleLB.clear();
+ m_pEastFontSizeFT.clear();
+ m_pEastFontSizeLB.clear();
+ m_pEastFontLanguageFT.clear();
+ m_pEastFontLanguageLB.clear();
+ m_pEastFontTypeFT.clear();
+ m_pCTLFrame.clear();
+ m_pCTLFontNameFT.clear();
+ m_pCTLFontNameLB.clear();
+ m_pCTLFontStyleFT.clear();
+ m_pCTLFontStyleLB.clear();
+ m_pCTLFontSizeFT.clear();
+ m_pCTLFontSizeLB.clear();
+ m_pCTLFontLanguageFT.clear();
+ m_pCTLFontLanguageLB.clear();
+ m_pCTLFontTypeFT.clear();
+ SvxCharBasePage::dispose();
+}
void SvxCharNamePage::Initialize()
{
@@ -1180,9 +1219,10 @@ SfxTabPage::sfxpg SvxCharNamePage::DeactivatePage( SfxItemSet* _pSet )
-SfxTabPage* SvxCharNamePage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> SvxCharNamePage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return new SvxCharNamePage( pParent, *rSet );
+ return VclPtr<SfxTabPage>( new SvxCharNamePage( pParent, *rSet ),
+ SAL_NO_ACQUIRE );
}
@@ -1337,6 +1377,37 @@ SvxCharEffectsPage::SvxCharEffectsPage( vcl::Window* pParent, const SfxItemSet&
Initialize();
}
+SvxCharEffectsPage::~SvxCharEffectsPage()
+{
+ disposeOnce();
+}
+
+void SvxCharEffectsPage::dispose()
+{
+ m_pFontColorFT.clear();
+ m_pFontColorLB.clear();
+ m_pEffectsFT.clear();
+ m_pEffectsLB.clear();
+ m_pReliefFT.clear();
+ m_pReliefLB.clear();
+ m_pOutlineBtn.clear();
+ m_pShadowBtn.clear();
+ m_pBlinkingBtn.clear();
+ m_pHiddenBtn.clear();
+ m_pOverlineLB.clear();
+ m_pOverlineColorFT.clear();
+ m_pOverlineColorLB.clear();
+ m_pStrikeoutLB.clear();
+ m_pUnderlineLB.clear();
+ m_pUnderlineColorFT.clear();
+ m_pUnderlineColorLB.clear();
+ m_pIndividualWordsBtn.clear();
+ m_pEmphasisFT.clear();
+ m_pEmphasisLB.clear();
+ m_pPositionFT.clear();
+ m_pPositionLB.clear();
+ SvxCharBasePage::dispose();
+}
void SvxCharEffectsPage::Initialize()
@@ -1440,12 +1511,6 @@ void SvxCharEffectsPage::Initialize()
}
}
-SvxCharEffectsPage::~SvxCharEffectsPage()
-{
-}
-
-
-
void SvxCharEffectsPage::UpdatePreview_Impl()
{
SvxFont& rFont = GetPreviewFont();
@@ -1643,7 +1708,7 @@ IMPL_LINK( SvxCharEffectsPage, SelectHdl_Impl, ListBox*, pBox )
m_pOutlineBtn->Enable( bEnable );
m_pShadowBtn->Enable( bEnable );
}
- else if ( m_pPositionLB != pBox )
+ else if ( m_pPositionLB.get() != pBox )
{
sal_Int32 nUPos = m_pUnderlineLB->GetSelectEntryPos(),
nOPos = m_pOverlineLB->GetSelectEntryPos(),
@@ -1720,9 +1785,10 @@ SfxTabPage::sfxpg SvxCharEffectsPage::DeactivatePage( SfxItemSet* _pSet )
-SfxTabPage* SvxCharEffectsPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> SvxCharEffectsPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return new SvxCharEffectsPage( pParent, *rSet );
+ return VclPtr<SfxTabPage>( new SvxCharEffectsPage( pParent, *rSet ),
+ SAL_NO_ACQUIRE );
}
@@ -2585,6 +2651,35 @@ SvxCharPositionPage::SvxCharPositionPage( vcl::Window* pParent, const SfxItemSet
Initialize();
}
+SvxCharPositionPage::~SvxCharPositionPage()
+{
+ disposeOnce();
+}
+
+void SvxCharPositionPage::dispose()
+{
+ m_pHighPosBtn.clear();
+ m_pNormalPosBtn.clear();
+ m_pLowPosBtn.clear();
+ m_pHighLowFT.clear();
+ m_pHighLowMF.clear();
+ m_pHighLowRB.clear();
+ m_pFontSizeFT.clear();
+ m_pFontSizeMF.clear();
+ m_pRotationContainer.clear();
+ m_pScalingFT.clear();
+ m_pScalingAndRotationFT.clear();
+ m_p0degRB.clear();
+ m_p90degRB.clear();
+ m_p270degRB.clear();
+ m_pFitToLineCB.clear();
+ m_pScaleWidthMF.clear();
+ m_pKerningLB.clear();
+ m_pKerningFT.clear();
+ m_pKerningMF.clear();
+ m_pPairKerningBtn.clear();
+ SvxCharBasePage::dispose();
+}
void SvxCharPositionPage::Initialize()
@@ -2627,12 +2722,6 @@ void SvxCharPositionPage::Initialize()
m_pScaleWidthMF->SetModifyHdl( LINK( this, SvxCharPositionPage, ScaleWidthModifyHdl_Impl ) );
}
-SvxCharPositionPage::~SvxCharPositionPage()
-{
-}
-
-
-
void SvxCharPositionPage::UpdatePreview_Impl( sal_uInt8 nProp, sal_uInt8 nEscProp, short nEsc )
{
SetPrevFontEscapement( nProp, nEscProp, nEsc );
@@ -2887,9 +2976,10 @@ SfxTabPage::sfxpg SvxCharPositionPage::DeactivatePage( SfxItemSet* _pSet )
-SfxTabPage* SvxCharPositionPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> SvxCharPositionPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return new SvxCharPositionPage( pParent, *rSet );
+ return VclPtr<SfxTabPage>( new SvxCharPositionPage( pParent, *rSet ),
+ SAL_NO_ACQUIRE );
}
@@ -3323,9 +3413,17 @@ SvxCharTwoLinesPage::SvxCharTwoLinesPage(vcl::Window* pParent, const SfxItemSet&
SvxCharTwoLinesPage::~SvxCharTwoLinesPage()
{
+ disposeOnce();
}
-
+void SvxCharTwoLinesPage::dispose()
+{
+ m_pTwoLinesBtn.clear();
+ m_pEnclosingFrame.clear();
+ m_pStartBracketLB.clear();
+ m_pEndBracketLB.clear();
+ SvxCharBasePage::dispose();
+}
void SvxCharTwoLinesPage::Initialize()
{
@@ -3351,7 +3449,7 @@ void SvxCharTwoLinesPage::Initialize()
void SvxCharTwoLinesPage::SelectCharacter( ListBox* pBox )
{
bool bStart = pBox == m_pStartBracketLB;
- boost::scoped_ptr<SvxCharacterMap> aDlg(new SvxCharacterMap( this ));
+ VclPtrInstance< SvxCharacterMap > aDlg( this );
aDlg->DisableFontSelection();
if ( aDlg->Execute() == RET_OK )
@@ -3451,9 +3549,10 @@ SfxTabPage::sfxpg SvxCharTwoLinesPage::DeactivatePage( SfxItemSet* _pSet )
-SfxTabPage* SvxCharTwoLinesPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> SvxCharTwoLinesPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return new SvxCharTwoLinesPage( pParent, *rSet );
+ return VclPtr<SfxTabPage>( new SvxCharTwoLinesPage( pParent, *rSet ),
+ SAL_NO_ACQUIRE );
}
void SvxCharTwoLinesPage::Reset( const SfxItemSet* rSet )
diff --git a/cui/source/tabpages/connect.cxx b/cui/source/tabpages/connect.cxx
index 6b49e2aa0e83..66b493516fc1 100644
--- a/cui/source/tabpages/connect.cxx
+++ b/cui/source/tabpages/connect.cxx
@@ -54,7 +54,7 @@ SvxConnectionDialog::SvxConnectionDialog( vcl::Window* pParent, const SfxItemSet
const SdrView* pSdrView )
: SfxSingleTabDialog(pParent, rInAttrs)
{
- SvxConnectionPage* _pPage = new SvxConnectionPage( get_content_area(), rInAttrs );
+ VclPtrInstance<SvxConnectionPage> _pPage( get_content_area(), rInAttrs );
_pPage->SetView( pSdrView );
_pPage->Construct();
@@ -65,16 +65,6 @@ SvxConnectionDialog::SvxConnectionDialog( vcl::Window* pParent, const SfxItemSet
/*************************************************************************
|*
-|* Dtor
-|*
-\************************************************************************/
-
-SvxConnectionDialog::~SvxConnectionDialog()
-{
-}
-
-/*************************************************************************
-|*
|* page for changing connectors
|*
\************************************************************************/
@@ -141,14 +131,26 @@ SvxConnectionPage::SvxConnectionPage( vcl::Window* pWindow, const SfxItemSet& rI
m_pLbType->SetSelectHdl( aLink );
}
-/*************************************************************************
-|*
-|* Dtor
-|*
-\************************************************************************/
-
SvxConnectionPage::~SvxConnectionPage()
{
+ disposeOnce();
+}
+
+void SvxConnectionPage::dispose()
+{
+ m_pLbType.clear();
+ m_pFtLine1.clear();
+ m_pMtrFldLine1.clear();
+ m_pFtLine2.clear();
+ m_pMtrFldLine2.clear();
+ m_pFtLine3.clear();
+ m_pMtrFldLine3.clear();
+ m_pMtrFldHorz1.clear();
+ m_pMtrFldVert1.clear();
+ m_pMtrFldHorz2.clear();
+ m_pMtrFldVert2.clear();
+ m_pCtlPreview.clear();
+ SfxTabPage::dispose();
}
/*************************************************************************
@@ -388,10 +390,10 @@ void SvxConnectionPage::Construct()
|*
\************************************************************************/
-SfxTabPage* SvxConnectionPage::Create( vcl::Window* pWindow,
- const SfxItemSet* rAttrs )
+VclPtr<SfxTabPage> SvxConnectionPage::Create( vcl::Window* pWindow,
+ const SfxItemSet* rAttrs )
{
- return new SvxConnectionPage( pWindow, *rAttrs );
+ return VclPtr<SvxConnectionPage>::Create( pWindow, *rAttrs );
}
IMPL_LINK( SvxConnectionPage, ChangeAttrHdl_Impl, void *, p )
diff --git a/cui/source/tabpages/dstribut.cxx b/cui/source/tabpages/dstribut.cxx
index 86d23299112b..ac14dbd34f17 100644
--- a/cui/source/tabpages/dstribut.cxx
+++ b/cui/source/tabpages/dstribut.cxx
@@ -37,10 +37,21 @@ SvxDistributeDialog::SvxDistributeDialog(vcl::Window* pParent,
"cui/ui/distributiondialog.ui")
, mpPage(NULL)
{
- mpPage = new SvxDistributePage(get_content_area(), rInAttrs, eHor, eVer);
+ mpPage = VclPtr<SvxDistributePage>::Create(get_content_area(), rInAttrs, eHor, eVer);
SetTabPage(mpPage);
}
+SvxDistributeDialog::~SvxDistributeDialog()
+{
+ disposeOnce();
+}
+
+void SvxDistributeDialog::dispose()
+{
+ mpPage.clear();
+ SfxSingleTabDialog::dispose();
+}
+
/*************************************************************************
|*
|* Tabpage
@@ -68,16 +79,37 @@ SvxDistributePage::SvxDistributePage(vcl::Window* pWindow,
get(m_pBtnVerBottom, "verbottom");
}
+SvxDistributePage::~SvxDistributePage()
+{
+ disposeOnce();
+}
+
+void SvxDistributePage::dispose()
+{
+ m_pBtnHorNone.clear();
+ m_pBtnHorLeft.clear();
+ m_pBtnHorCenter.clear();
+ m_pBtnHorDistance.clear();
+ m_pBtnHorRight.clear();
+ m_pBtnVerNone.clear();
+ m_pBtnVerTop.clear();
+ m_pBtnVerCenter.clear();
+ m_pBtnVerDistance.clear();
+ m_pBtnVerBottom.clear();
+ SvxTabPage::dispose();
+}
+
+
/*************************************************************************
|*
|* create the tabpage
|*
\************************************************************************/
-SfxTabPage* SvxDistributePage::Create(vcl::Window* pWindow, const SfxItemSet& rAttrs,
+VclPtr<SfxTabPage> SvxDistributePage::Create(vcl::Window* pWindow, const SfxItemSet& rAttrs,
SvxDistributeHorizontal eHor, SvxDistributeVertical eVer)
{
- return new SvxDistributePage(pWindow, rAttrs, eHor, eVer);
+ return VclPtr<SvxDistributePage>::Create(pWindow, rAttrs, eHor, eVer);
}
void SvxDistributePage::PointChanged(vcl::Window* /*pWindow*/, RECT_POINT /*eRP*/)
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index c416ad7c267f..af1c96b4be62 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -127,12 +127,37 @@ SvxGrfCropPage::SvxGrfCropPage ( vcl::Window *pParent, const SfxItemSet &rSet )
SvxGrfCropPage::~SvxGrfCropPage()
{
+ disposeOnce();
+}
+
+void SvxGrfCropPage::dispose()
+{
aTimer.Stop();
+ m_pCropFrame.clear();
+ m_pZoomConstRB.clear();
+ m_pSizeConstRB.clear();
+ m_pLeftMF.clear();
+ m_pRightMF.clear();
+ m_pTopMF.clear();
+ m_pBottomMF.clear();
+ m_pScaleFrame.clear();
+ m_pWidthZoomMF.clear();
+ m_pHeightZoomMF.clear();
+ m_pSizeFrame.clear();
+ m_pWidthMF.clear();
+ m_pHeightMF.clear();
+ m_pOrigSizeGrid.clear();
+ m_pOrigSizeFT.clear();
+ m_pOrigSizePB.clear();
+ m_pExampleWN.clear();
+ pLastCropField.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* SvxGrfCropPage::Create(vcl::Window *pParent, const SfxItemSet *rSet)
+VclPtr<SfxTabPage> SvxGrfCropPage::Create(vcl::Window *pParent, const SfxItemSet *rSet)
{
- return new SvxGrfCropPage( pParent, *rSet );
+ return VclPtr<SfxTabPage>( new SvxGrfCropPage( pParent, *rSet ),
+ SAL_NO_ACQUIRE );
}
void SvxGrfCropPage::Reset( const SfxItemSet *rSet )
@@ -675,17 +700,17 @@ void SvxGrfCropPage::GraphicHasChanged( bool bFound )
// display original size
const FieldUnit eMetric = GetModuleFieldUnit( GetItemSet() );
- MetricField aFld(this, WB_HIDE);
- SetFieldUnit( aFld, eMetric );
- aFld.SetDecimalDigits( m_pWidthMF->GetDecimalDigits() );
- aFld.SetMax( LONG_MAX - 1 );
+ ScopedVclPtrInstance< MetricField > aFld(this, WB_HIDE);
+ SetFieldUnit( *aFld.get(), eMetric );
+ aFld->SetDecimalDigits( m_pWidthMF->GetDecimalDigits() );
+ aFld->SetMax( LONG_MAX - 1 );
- aFld.SetValue( aFld.Normalize( aOrigSize.Width() ), eUnit );
- OUString sTemp = aFld.GetText();
- aFld.SetValue( aFld.Normalize( aOrigSize.Height() ), eUnit );
+ aFld->SetValue( aFld->Normalize( aOrigSize.Width() ), eUnit );
+ OUString sTemp = aFld->GetText();
+ aFld->SetValue( aFld->Normalize( aOrigSize.Height() ), eUnit );
// multiplication sign (U+00D7)
sTemp += OUString( sal_Unicode (0x00D7) );
- sTemp += aFld.GetText();
+ sTemp += aFld->GetText();
if ( aOrigPixelSize.Width() && aOrigPixelSize.Height() ) {
sal_Int32 ax = sal_Int32(floor((float)aOrigPixelSize.Width() /
diff --git a/cui/source/tabpages/labdlg.cxx b/cui/source/tabpages/labdlg.cxx
index 243d9dcf038d..d57e180245d1 100644
--- a/cui/source/tabpages/labdlg.cxx
+++ b/cui/source/tabpages/labdlg.cxx
@@ -138,6 +138,26 @@ SvxCaptionTabPage::SvxCaptionTabPage(vcl::Window* pParent, const SfxItemSet& rIn
m_pCB_LAENGE->SetClickHdl(LINK(this,SvxCaptionTabPage,LineOptHdl_Impl));
}
+SvxCaptionTabPage::~SvxCaptionTabPage()
+{
+ disposeOnce();
+}
+
+void SvxCaptionTabPage::dispose()
+{
+ m_pCT_CAPTTYPE.clear();
+ m_pMF_ABSTAND.clear();
+ m_pLB_ANSATZ.clear();
+ m_pFT_UM.clear();
+ m_pMF_ANSATZ.clear();
+ m_pFT_ANSATZ_REL.clear();
+ m_pLB_ANSATZ_REL.clear();
+ m_pFT_LAENGE.clear();
+ m_pMF_LAENGE.clear();
+ m_pCB_LAENGE.clear();
+ SfxTabPage::dispose();
+}
+
void SvxCaptionTabPage::Construct()
{
// set rectangle and working area
@@ -336,10 +356,10 @@ void SvxCaptionTabPage::Reset( const SfxItemSet* )
-SfxTabPage* SvxCaptionTabPage::Create( vcl::Window* pWindow,
- const SfxItemSet* rOutAttrs )
+VclPtr<SfxTabPage> SvxCaptionTabPage::Create( vcl::Window* pWindow,
+ const SfxItemSet* rOutAttrs )
{
- return new SvxCaptionTabPage( pWindow, *rOutAttrs );
+ return VclPtr<SvxCaptionTabPage>::Create( pWindow, *rOutAttrs );
}
diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx
index 64d38b7e4ddf..ced57182cea9 100644
--- a/cui/source/tabpages/macroass.cxx
+++ b/cui/source/tabpages/macroass.cxx
@@ -44,16 +44,16 @@ class _SfxMacroTabPage_Impl
public:
_SfxMacroTabPage_Impl();
- OUString maStaticMacroLBLabel;
- PushButton* pAssignPB;
- PushButton* pDeletePB;
- OUString sStrEvent;
- OUString sAssignedMacro;
- MacroEventListBox* pEventLB;
- VclFrame* pGroupFrame;
- SfxConfigGroupListBox* pGroupLB;
- VclFrame* pMacroFrame;
- SfxConfigFunctionListBox* pMacroLB;
+ OUString maStaticMacroLBLabel;
+ VclPtr<PushButton> pAssignPB;
+ VclPtr<PushButton> pDeletePB;
+ OUString sStrEvent;
+ OUString sAssignedMacro;
+ VclPtr<MacroEventListBox> pEventLB;
+ VclPtr<VclFrame> pGroupFrame;
+ VclPtr<SfxConfigGroupListBox> pGroupLB;
+ VclPtr<VclFrame> pMacroFrame;
+ VclPtr<SfxConfigFunctionListBox> pMacroLB;
bool bReadOnly;
Idle maFillGroupIdle;
@@ -143,7 +143,13 @@ _SfxMacroTabPage::_SfxMacroTabPage(vcl::Window* pParent, const SfxItemSet& rAttr
_SfxMacroTabPage::~_SfxMacroTabPage()
{
+ disposeOnce();
+}
+
+void _SfxMacroTabPage::dispose()
+{
DELETEZ( mpImpl );
+ SfxTabPage::dispose();
}
void _SfxMacroTabPage::AddEvent( const OUString & rEventName, sal_uInt16 nEventId )
@@ -454,13 +460,13 @@ SfxMacroTabPage::SfxMacroTabPage(vcl::Window* pParent, const Reference< XFrame >
namespace
{
- SfxMacroTabPage* CreateSfxMacroTabPage( vcl::Window* pParent, const SfxItemSet& rAttrSet )
+ VclPtr<SfxMacroTabPage> CreateSfxMacroTabPage( vcl::Window* pParent, const SfxItemSet& rAttrSet )
{
- return new SfxMacroTabPage( pParent, NULL, rAttrSet );
+ return VclPtr<SfxMacroTabPage>( new SfxMacroTabPage( pParent, NULL, rAttrSet ), SAL_NO_ACQUIRE );
}
}
-SfxTabPage* SfxMacroTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> SfxMacroTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
return CreateSfxMacroTabPage(pParent, *rAttrSet);
}
diff --git a/cui/source/tabpages/measure.cxx b/cui/source/tabpages/measure.cxx
index ea086be40fb3..2053ecf37977 100644
--- a/cui/source/tabpages/measure.cxx
+++ b/cui/source/tabpages/measure.cxx
@@ -64,7 +64,7 @@ SvxMeasureDialog::SvxMeasureDialog( vcl::Window* pParent, const SfxItemSet& rInA
const SdrView* pSdrView )
: SfxSingleTabDialog(pParent, rInAttrs)
{
- SvxMeasurePage* _pPage = new SvxMeasurePage( get_content_area(), rInAttrs );
+ VclPtrInstance<SvxMeasurePage> _pPage( get_content_area(), rInAttrs );
_pPage->SetView( pSdrView );
_pPage->Construct();
@@ -148,14 +148,29 @@ SvxMeasurePage::SvxMeasurePage( vcl::Window* pWindow, const SfxItemSet& rInAttrs
m_pLbUnit->SetSelectHdl( aLink );
}
-/*************************************************************************
-|*
-|* Dtor
-|*
-\************************************************************************/
-
SvxMeasurePage::~SvxMeasurePage()
{
+ disposeOnce();
+}
+
+void SvxMeasurePage::dispose()
+{
+ m_pMtrFldLineDist.clear();
+ m_pMtrFldHelplineOverhang.clear();
+ m_pMtrFldHelplineDist.clear();
+ m_pMtrFldHelpline1Len.clear();
+ m_pMtrFldHelpline2Len.clear();
+ m_pTsbBelowRefEdge.clear();
+ m_pMtrFldDecimalPlaces.clear();
+ m_pCtlPosition.clear();
+ m_pTsbAutoPosV.clear();
+ m_pTsbAutoPosH.clear();
+ m_pTsbShowUnit.clear();
+ m_pLbUnit.clear();
+ m_pTsbParallel.clear();
+ m_pFtAutomatic.clear();
+ m_pCtlPreview.clear();
+ SvxTabPage::dispose();
}
/*************************************************************************
@@ -587,16 +602,10 @@ void SvxMeasurePage::Construct()
m_pCtlPreview->Invalidate();
}
-/*************************************************************************
-|*
-|* create the tabpage
-|*
-\************************************************************************/
-
-SfxTabPage* SvxMeasurePage::Create( vcl::Window* pWindow,
- const SfxItemSet* rAttrs )
+VclPtr<SfxTabPage> SvxMeasurePage::Create( vcl::Window* pWindow,
+ const SfxItemSet* rAttrs )
{
- return new SvxMeasurePage( pWindow, *rAttrs );
+ return VclPtr<SvxMeasurePage>::Create( pWindow, *rAttrs );
}
void SvxMeasurePage::PointChanged( vcl::Window* pWindow, RECT_POINT /*eRP*/ )
diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index bc6f14273893..852607ca84c5 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -282,8 +282,41 @@ SvxNumberFormatTabPage::SvxNumberFormatTabPage(vcl::Window* pParent,
SvxNumberFormatTabPage::~SvxNumberFormatTabPage()
{
+ disposeOnce();
+}
+
+
+void SvxNumberFormatTabPage::dispose()
+{
delete pNumFmtShell;
+ pNumFmtShell = NULL;
delete pNumItem;
+ pNumItem = NULL;
+ m_pFtCategory.clear();
+ m_pLbCategory.clear();
+ m_pFtFormat.clear();
+ m_pLbCurrency.clear();
+ m_pLbFormat.clear();
+ m_pFtLanguage.clear();
+ m_pLbLanguage.clear();
+ m_pCbSourceFormat.clear();
+ m_pWndPreview.clear();
+ m_pFtOptions.clear();
+ m_pFtDecimals.clear();
+ m_pEdDecimals.clear();
+ m_pBtnNegRed.clear();
+ m_pFtLeadZeroes.clear();
+ m_pEdLeadZeroes.clear();
+ m_pBtnThousand.clear();
+ m_pFormatCodeFrame.clear();
+ m_pEdFormat.clear();
+ m_pIbAdd.clear();
+ m_pIbInfo.clear();
+ m_pIbRemove.clear();
+ m_pFtComment.clear();
+ m_pEdComment.clear();
+ pLastActivWindow.clear();
+ SfxTabPage::dispose();
}
void SvxNumberFormatTabPage::Init_Impl()
@@ -347,21 +380,10 @@ void SvxNumberFormatTabPage::Init_Impl()
}
}
-/*************************************************************************
-#* Method: Create
-#*------------------------------------------------------------------------
-#*
-#* Class: SvxNumberFormatTabPage
-#* Function: Creates a new number format page.
-#* Input: Window, SfxItemSet
-#* Output: new TabPage
-#*
-#************************************************************************/
-
-SfxTabPage* SvxNumberFormatTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> SvxNumberFormatTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet )
{
- return ( new SvxNumberFormatTabPage( pParent, *rAttrSet ) );
+ return VclPtr<SfxTabPage>( new SvxNumberFormatTabPage( pParent, *rAttrSet ), SAL_NO_ACQUIRE );
}
@@ -1644,7 +1666,7 @@ bool SvxNumberFormatTabPage::PreNotify( NotifyEvent& rNEvt )
{
if(rNEvt.GetType()==MouseNotifyEvent::LOSEFOCUS)
{
- if ( rNEvt.GetWindow() == dynamic_cast< vcl::Window* >( m_pEdComment ) && !m_pEdComment->IsVisible() )
+ if ( rNEvt.GetWindow() == dynamic_cast< vcl::Window* >( m_pEdComment.get() ) && !m_pEdComment->IsVisible() )
{
pLastActivWindow = NULL;
}
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index a725a70180e5..34a19e76227d 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -219,14 +219,23 @@ SvxSingleNumPickTabPage::SvxSingleNumPickTabPage(vcl::Window* pParent,
SvxSingleNumPickTabPage::~SvxSingleNumPickTabPage()
{
+ disposeOnce();
+}
+
+void SvxSingleNumPickTabPage::dispose()
+{
delete pActNum;
+ pActNum = NULL;
delete pSaveNum;
+ pSaveNum = NULL;
+ m_pExamplesVS.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* SvxSingleNumPickTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet)
+VclPtr<SfxTabPage> SvxSingleNumPickTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet)
{
- return new SvxSingleNumPickTabPage(pParent, *rAttrSet);
+ return VclPtr<SvxSingleNumPickTabPage>::Create(pParent, *rAttrSet);
}
bool SvxSingleNumPickTabPage::FillItemSet( SfxItemSet* rSet )
@@ -380,14 +389,23 @@ SvxBulletPickTabPage::SvxBulletPickTabPage(vcl::Window* pParent,
SvxBulletPickTabPage::~SvxBulletPickTabPage()
{
+ disposeOnce();
+}
+
+void SvxBulletPickTabPage::dispose()
+{
delete pActNum;
+ pActNum = NULL;
delete pSaveNum;
+ pSaveNum = NULL;
+ m_pExamplesVS.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* SvxBulletPickTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet)
+VclPtr<SfxTabPage> SvxBulletPickTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet)
{
- return new SvxBulletPickTabPage(pParent, *rAttrSet);
+ return VclPtr<SvxBulletPickTabPage>::Create(pParent, *rAttrSet);
}
bool SvxBulletPickTabPage::FillItemSet( SfxItemSet* rSet )
@@ -577,14 +595,23 @@ SvxNumPickTabPage::SvxNumPickTabPage(vcl::Window* pParent,
SvxNumPickTabPage::~SvxNumPickTabPage()
{
+ disposeOnce();
+}
+
+void SvxNumPickTabPage::dispose()
+{
delete pActNum;
+ pActNum = NULL;
delete pSaveNum;
+ pSaveNum = NULL;
+ m_pExamplesVS.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* SvxNumPickTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet)
+VclPtr<SfxTabPage> SvxNumPickTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet)
{
- return new SvxNumPickTabPage(pParent, *rAttrSet);
+ return VclPtr<SvxNumPickTabPage>::Create(pParent, *rAttrSet);
}
bool SvxNumPickTabPage::FillItemSet( SfxItemSet* rSet )
@@ -818,14 +845,24 @@ SvxBitmapPickTabPage::SvxBitmapPickTabPage(vcl::Window* pParent,
SvxBitmapPickTabPage::~SvxBitmapPickTabPage()
{
+ disposeOnce();
+}
+
+void SvxBitmapPickTabPage::dispose()
+{
delete pActNum;
+ pActNum = NULL;
delete pSaveNum;
+ pSaveNum = NULL;
+ m_pErrorText.clear();
+ m_pExamplesVS.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* SvxBitmapPickTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet)
+VclPtr<SfxTabPage> SvxBitmapPickTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet)
{
- return new SvxBitmapPickTabPage(pParent, *rAttrSet);
+ return VclPtr<SvxBitmapPickTabPage>::Create(pParent, *rAttrSet);
}
void SvxBitmapPickTabPage::ActivatePage(const SfxItemSet& rSet)
@@ -1125,9 +1162,53 @@ SvxNumOptionsTabPage::SvxNumOptionsTabPage(vcl::Window* pParent,
SvxNumOptionsTabPage::~SvxNumOptionsTabPage()
{
- delete m_pBitmapMB->GetPopupMenu()->GetPopupMenu(m_nGalleryId);
+ disposeOnce();
+}
+
+void SvxNumOptionsTabPage::dispose()
+{
+ if (m_pBitmapMB)
+ {
+ delete m_pBitmapMB->GetPopupMenu()->GetPopupMenu(m_nGalleryId);
+ }
delete pActNum;
+ pActNum = NULL;
delete pSaveNum;
+ pSaveNum = NULL;
+ m_pLevelLB.clear();
+ m_pFmtLB.clear();
+ m_pSeparatorFT.clear();
+ m_pPrefixFT.clear();
+ m_pPrefixED.clear();
+ m_pSuffixFT.clear();
+ m_pSuffixED.clear();
+ m_pCharFmtFT.clear();
+ m_pCharFmtLB.clear();
+ m_pBulColorFT.clear();
+ m_pBulColLB.clear();
+ m_pBulRelSizeFT.clear();
+ m_pBulRelSizeMF.clear();
+ m_pAllLevelFT.clear();
+ m_pAllLevelNF.clear();
+ m_pStartFT.clear();
+ m_pStartED.clear();
+ m_pBulletFT.clear();
+ m_pBulletPB.clear();
+ m_pAlignFT.clear();
+ m_pAlignLB.clear();
+ m_pBitmapFT.clear();
+ m_pBitmapMB.clear();
+ m_pWidthFT.clear();
+ m_pWidthMF.clear();
+ m_pHeightFT.clear();
+ m_pHeightMF.clear();
+ m_pRatioCB.clear();
+ m_pOrientFT.clear();
+ m_pOrientLB.clear();
+ m_pAllLevelsFrame.clear();
+ m_pSameLevelCB.clear();
+ m_pPreviewWIN.clear();
+ SfxTabPage::dispose();
}
void SvxNumOptionsTabPage::SetMetric(FieldUnit eMetric)
@@ -1141,10 +1222,10 @@ void SvxNumOptionsTabPage::SetMetric(FieldUnit eMetric)
m_pHeightMF->SetUnit( eMetric );
}
-SfxTabPage* SvxNumOptionsTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet)
+VclPtr<SfxTabPage> SvxNumOptionsTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet)
{
- return new SvxNumOptionsTabPage(pParent, *rAttrSet);
+ return VclPtr<SvxNumOptionsTabPage>::Create(pParent, *rAttrSet);
};
void SvxNumOptionsTabPage::ActivatePage(const SfxItemSet& rSet)
@@ -2014,7 +2095,7 @@ IMPL_LINK_NOARG(SvxNumOptionsTabPage, PopupActivateHdl_Impl)
IMPL_LINK_NOARG(SvxNumOptionsTabPage, BulletHdl_Impl)
{
- boost::scoped_ptr<SvxCharacterMap> pMap(new SvxCharacterMap( this, true ));
+ VclPtrInstance< SvxCharacterMap > pMap( this, true );
sal_uInt16 nMask = 1;
const vcl::Font* pFmtFont = 0;
@@ -2298,7 +2379,7 @@ void SvxNumberingPreview::Paint( const Rectangle& /*rRect*/ )
const Color aBackColor = rStyleSettings.GetFieldColor();
const Color aTextColor = rStyleSettings.GetFieldTextColor();
- boost::scoped_ptr<VirtualDevice> pVDev(new VirtualDevice(*this));
+ ScopedVclPtrInstance< VirtualDevice > pVDev(*this);
pVDev->EnableRTL( IsRTLEnabled() );
pVDev->SetMapMode(GetMapMode());
pVDev->SetOutputSize( aSize );
@@ -2683,9 +2764,40 @@ SvxNumPositionTabPage::SvxNumPositionTabPage(vcl::Window* pParent,
SvxNumPositionTabPage::~SvxNumPositionTabPage()
{
+ disposeOnce();
+}
+
+void SvxNumPositionTabPage::dispose()
+{
delete pActNum;
+ pActNum = NULL;
delete pSaveNum;
+ pSaveNum = NULL;
+ m_pLevelLB.clear();
+ m_pDistBorderFT.clear();
+ m_pDistBorderMF.clear();
+ m_pRelativeCB.clear();
+ m_pIndentFT.clear();
+ m_pIndentMF.clear();
+ m_pDistNumFT.clear();
+ m_pDistNumMF.clear();
+ m_pAlignFT.clear();
+ m_pAlignLB.clear();
+ m_pLabelFollowedByFT.clear();
+ m_pLabelFollowedByLB.clear();
+ m_pListtabFT.clear();
+ m_pListtabMF.clear();
+ m_pAlign2FT.clear();
+ m_pAlign2LB.clear();
+ m_pAlignedAtFT.clear();
+ m_pAlignedAtMF.clear();
+ m_pIndentAtFT.clear();
+ m_pIndentAtMF.clear();
+ m_pStandardPB.clear();
+ m_pPreviewWIN.clear();
+ SfxTabPage::dispose();
}
+
/*-------------------------------------------------------*/
#if OSL_DEBUG_LEVEL > 1
@@ -3108,10 +3220,10 @@ void SvxNumPositionTabPage::ShowControlsDependingOnPosAndSpaceMode()
m_pIndentAtMF->Show( bLabelAlignmentPosAndSpaceModeActive );
}
-SfxTabPage* SvxNumPositionTabPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet)
+VclPtr<SfxTabPage> SvxNumPositionTabPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet)
{
- return new SvxNumPositionTabPage(pParent, *rAttrSet);
+ return VclPtr<SvxNumPositionTabPage>::Create(pParent, *rAttrSet);
}
void SvxNumPositionTabPage::SetMetric(FieldUnit eMetric)
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index ef8dc6a41b2c..6a37a3d1f1ed 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -164,9 +164,9 @@ bool IsEqualSize_Impl( const SvxSizeItem* pSize, const Size& rSize )
// class SvxPageDescPage --------------------------------------------------
-SfxTabPage* SvxPageDescPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> SvxPageDescPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return new SvxPageDescPage( pParent, *rSet );
+ return VclPtr<SfxTabPage>(new SvxPageDescPage( pParent, *rSet ), SAL_NO_ACQUIRE );
}
SvxPageDescPage::SvxPageDescPage( vcl::Window* pParent, const SfxItemSet& rAttr ) :
@@ -366,10 +366,46 @@ SvxPageDescPage::SvxPageDescPage( vcl::Window* pParent, const SfxItemSet& rAttr
SvxPageDescPage::~SvxPageDescPage()
{
+ disposeOnce();
+}
+
+void SvxPageDescPage::dispose()
+{
if(mbDelPrinter)
{
- delete mpDefPrinter;
+ mpDefPrinter.disposeAndClear();
+ mbDelPrinter = false;
}
+ m_pPaperSizeBox.clear();
+ m_pPaperWidthEdit.clear();
+ m_pPaperHeightEdit.clear();
+ m_pOrientationFT.clear();
+ m_pPortraitBtn.clear();
+ m_pLandscapeBtn.clear();
+ m_pBspWin.clear();
+ m_pTextFlowLbl.clear();
+ m_pTextFlowBox.clear();
+ m_pPaperTrayBox.clear();
+ m_pLeftMarginLbl.clear();
+ m_pLeftMarginEdit.clear();
+ m_pRightMarginLbl.clear();
+ m_pRightMarginEdit.clear();
+ m_pTopMarginEdit.clear();
+ m_pBottomMarginEdit.clear();
+ m_pPageText.clear();
+ m_pLayoutBox.clear();
+ m_pNumberFormatBox.clear();
+ m_pTblAlignFT.clear();
+ m_pHorzBox.clear();
+ m_pVertBox.clear();
+ m_pAdaptBox.clear();
+ m_pRegisterCB.clear();
+ m_pRegisterFT.clear();
+ m_pRegisterLB.clear();
+ m_pInsideLbl.clear();
+ m_pOutsideLbl.clear();
+ m_pPrintRangeQueryText.clear();
+ SfxTabPage::dispose();
}
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index 527f4f760079..56b1345db3ad 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -194,9 +194,9 @@ IMPL_LINK_NOARG(SvxStdParagraphTabPage, ELRLoseFocusHdl)
return 0;
}
-SfxTabPage* SvxStdParagraphTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet)
+VclPtr<SfxTabPage> SvxStdParagraphTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet)
{
- return new SvxStdParagraphTabPage( pParent, *rSet );
+ return VclPtr<SfxTabPage>( new SvxStdParagraphTabPage( pParent, *rSet ), SAL_NO_ACQUIRE );
}
bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
@@ -656,6 +656,29 @@ SvxStdParagraphTabPage::SvxStdParagraphTabPage( vcl::Window* pParent, const Sfx
SvxStdParagraphTabPage::~SvxStdParagraphTabPage()
{
+ disposeOnce();
+}
+
+void SvxStdParagraphTabPage::dispose()
+{
+ m_pLeftIndent.clear();
+ m_pRightLabel.clear();
+ m_pRightIndent.clear();
+ m_pFLineLabel.clear();
+ m_pFLineIndent.clear();
+ m_pAutoCB.clear();
+ m_pTopDist.clear();
+ m_pBottomDist.clear();
+ m_pContextualCB.clear();
+ m_pLineDist.clear();
+ m_pLineDistAtLabel.clear();
+ m_pLineDistAtPercentBox.clear();
+ m_pLineDistAtMetricBox.clear();
+ m_pAbsDist.clear();
+ m_pExampleWin.clear();
+ m_pRegisterFL.clear();
+ m_pRegisterCB.clear();
+ SfxTabPage::dispose();
}
void SvxStdParagraphTabPage::EnableNegativeMode()
@@ -1018,6 +1041,27 @@ SvxParaAlignTabPage::SvxParaAlignTabPage( vcl::Window* pParent, const SfxItemSet
SvxParaAlignTabPage::~SvxParaAlignTabPage()
{
+ disposeOnce();
+}
+
+void SvxParaAlignTabPage::dispose()
+{
+ m_pLeft.clear();
+ m_pRight.clear();
+ m_pCenter.clear();
+ m_pJustify.clear();
+ m_pLeftBottom.clear();
+ m_pRightTop.clear();
+ m_pLastLineFT.clear();
+ m_pLastLineLB.clear();
+ m_pExpandCB.clear();
+ m_pSnapToGridCB.clear();
+ m_pExampleWin.clear();
+ m_pVertAlignFL.clear();
+ m_pVertAlignLB.clear();
+ m_pPropertiesFL.clear();
+ m_pTextDirectionLB.clear();
+ SfxTabPage::dispose();
}
SfxTabPage::sfxpg SvxParaAlignTabPage::DeactivatePage( SfxItemSet* _pSet )
@@ -1027,9 +1071,9 @@ SfxTabPage::sfxpg SvxParaAlignTabPage::DeactivatePage( SfxItemSet* _pSet )
return LEAVE_PAGE;
}
-SfxTabPage* SvxParaAlignTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> SvxParaAlignTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return new SvxParaAlignTabPage(pParent, *rSet);
+ return VclPtr<SfxTabPage>( new SvxParaAlignTabPage(pParent, *rSet), SAL_NO_ACQUIRE );
}
bool SvxParaAlignTabPage::FillItemSet( SfxItemSet* rOutSet )
@@ -1300,10 +1344,10 @@ void SvxParaAlignTabPage::PageCreated (const SfxAllItemSet& aSet)
EnableJustifyExt();
}
-SfxTabPage* SvxExtParagraphTabPage::Create( vcl::Window* pParent,
+VclPtr<SfxTabPage> SvxExtParagraphTabPage::Create( vcl::Window* pParent,
const SfxItemSet* rSet )
{
- return new SvxExtParagraphTabPage( pParent, *rSet );
+ return VclPtr<SfxTabPage>( new SvxExtParagraphTabPage( pParent, *rSet ), SAL_NO_ACQUIRE );
}
bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
@@ -1901,6 +1945,36 @@ SvxExtParagraphTabPage::SvxExtParagraphTabPage( vcl::Window* pParent, const SfxI
SvxExtParagraphTabPage::~SvxExtParagraphTabPage()
{
+ disposeOnce();
+}
+
+void SvxExtParagraphTabPage::dispose()
+{
+ m_pHyphenBox.clear();
+ m_pBeforeText.clear();
+ m_pExtHyphenBeforeBox.clear();
+ m_pAfterText.clear();
+ m_pExtHyphenAfterBox.clear();
+ m_pMaxHyphenLabel.clear();
+ m_pMaxHyphenEdit.clear();
+ m_pPageBreakBox.clear();
+ m_pBreakTypeFT.clear();
+ m_pBreakTypeLB.clear();
+ m_pBreakPositionFT.clear();
+ m_pBreakPositionLB.clear();
+ m_pApplyCollBtn.clear();
+ m_pApplyCollBox.clear();
+ m_pPagenumText.clear();
+ m_pPagenumEdit.clear();
+ m_pKeepTogetherBox.clear();
+ m_pKeepParaBox.clear();
+ m_pOrphanBox.clear();
+ m_pOrphanRowNo.clear();
+ m_pOrphanRowLabel.clear();
+ m_pWidowBox.clear();
+ m_pWidowRowNo.clear();
+ m_pWidowRowLabel.clear();
+ SfxTabPage::dispose();
}
IMPL_LINK_NOARG(SvxExtParagraphTabPage, PageBreakHdl_Impl)
@@ -2107,11 +2181,20 @@ SvxAsianTabPage::SvxAsianTabPage( vcl::Window* pParent, const SfxItemSet& rSet )
SvxAsianTabPage::~SvxAsianTabPage()
{
+ disposeOnce();
+}
+
+void SvxAsianTabPage::dispose()
+{
+ m_pForbiddenRulesCB.clear();
+ m_pHangingPunctCB.clear();
+ m_pScriptSpaceCB.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* SvxAsianTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> SvxAsianTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return new SvxAsianTabPage(pParent, *rSet);
+ return VclPtr<SfxTabPage>(new SvxAsianTabPage(pParent, *rSet), SAL_NO_ACQUIRE );
}
const sal_uInt16* SvxAsianTabPage::GetRanges()
diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx
index dcf3b945de4a..64c9085f0a35 100644
--- a/cui/source/tabpages/swpossizetabpage.cxx
+++ b/cui/source/tabpages/swpossizetabpage.cxx
@@ -588,6 +588,43 @@ SvxSwPosSizeTabPage::SvxSwPosSizeTabPage(vcl::Window* pParent, const SfxItemSet&
m_pPositionCB->SetClickHdl(LINK(this, SvxSwPosSizeTabPage, ProtectHdl));
}
+SvxSwPosSizeTabPage::~SvxSwPosSizeTabPage()
+{
+ disposeOnce();
+}
+
+void SvxSwPosSizeTabPage::dispose()
+{
+ m_pWidthMF.clear();
+ m_pHeightMF.clear();
+ m_pKeepRatioCB.clear();
+ m_pToPageRB.clear();
+ m_pToParaRB.clear();
+ m_pToCharRB.clear();
+ m_pAsCharRB.clear();
+ m_pToFrameRB.clear();
+ m_pPositionCB.clear();
+ m_pSizeCB.clear();
+ m_pPosFrame.clear();
+ m_pHoriFT.clear();
+ m_pHoriLB.clear();
+ m_pHoriByFT.clear();
+ m_pHoriByMF.clear();
+ m_pHoriToFT.clear();
+ m_pHoriToLB.clear();
+ m_pHoriMirrorCB.clear();
+ m_pVertFT.clear();
+ m_pVertLB.clear();
+ m_pVertByFT.clear();
+ m_pVertByMF.clear();
+ m_pVertToFT.clear();
+ m_pVertToLB.clear();
+ m_pFollowCB.clear();
+ m_pExampleWN.clear();
+ SfxTabPage::dispose();
+}
+
+
namespace
{
struct FrmMaps
@@ -689,13 +726,9 @@ void SvxSwPosSizeTabPage::setOptimalRelWidth()
m_pHoriLB->Clear();
}
-SvxSwPosSizeTabPage::~SvxSwPosSizeTabPage()
-{
-}
-
-SfxTabPage* SvxSwPosSizeTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet)
+VclPtr<SfxTabPage> SvxSwPosSizeTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet)
{
- return new SvxSwPosSizeTabPage(pParent, *rSet);
+ return VclPtr<SvxSwPosSizeTabPage>::Create(pParent, *rSet);
}
const sal_uInt16* SvxSwPosSizeTabPage::GetRanges()
diff --git a/cui/source/tabpages/tabarea.cxx b/cui/source/tabpages/tabarea.cxx
index d856f6b91fc0..56e54c8bc07c 100644
--- a/cui/source/tabpages/tabarea.cxx
+++ b/cui/source/tabpages/tabarea.cxx
@@ -96,10 +96,6 @@ SvxAreaTabDialog::SvxAreaTabDialog
rBtnCancel.SetClickHdl( LINK( this, SvxAreaTabDialog, CancelHdlImpl ) );
}
-SvxAreaTabDialog::~SvxAreaTabDialog()
-{
-}
-
void SvxAreaTabDialog::SavePalettes()
{
SfxObjectShell* pShell = SfxObjectShell::Current();
diff --git a/cui/source/tabpages/tabline.cxx b/cui/source/tabpages/tabline.cxx
index be818ba57f02..f9ee914225b9 100644
--- a/cui/source/tabpages/tabline.cxx
+++ b/cui/source/tabpages/tabline.cxx
@@ -104,12 +104,6 @@ SvxLineTabDialog::SvxLineTabDialog
-SvxLineTabDialog::~SvxLineTabDialog()
-{
-}
-
-
-
void SvxLineTabDialog::SavePalettes()
{
SfxObjectShell* pShell = SfxObjectShell::Current();
diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx
index 4d589e7fe55f..2d8b7c0c7326 100644
--- a/cui/source/tabpages/tabstpge.cxx
+++ b/cui/source/tabpages/tabstpge.cxx
@@ -38,7 +38,7 @@
class TabWin_Impl : public vcl::Window
{
- SvxTabulatorTabPage* mpPage;
+ VclPtr<SvxTabulatorTabPage> mpPage;
private:
sal_uInt16 nTabStyle;
@@ -50,8 +50,10 @@ public:
, nTabStyle(0)
{
}
+ virtual ~TabWin_Impl() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE { mpPage.clear(); vcl::Window::dispose(); }
- virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
+ virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
void SetTabulatorTabPage(SvxTabulatorTabPage* pPage) { mpPage = pPage; }
void SetTabStyle(sal_uInt16 nStyle) {nTabStyle = nStyle; }
@@ -185,13 +187,37 @@ SvxTabulatorTabPage::SvxTabulatorTabPage( vcl::Window* pParent, const SfxItemSet
aAktTab.GetDecimal() = rLocaleWrapper.getNumDecimalSep()[0];
}
-
-
SvxTabulatorTabPage::~SvxTabulatorTabPage()
{
+ disposeOnce();
}
-
+void SvxTabulatorTabPage::dispose()
+{
+ m_pTabBox.clear();
+ m_pLeftTab.clear();
+ m_pRightTab.clear();
+ m_pCenterTab.clear();
+ m_pDezTab.clear();
+ m_pLeftWin.clear();
+ m_pRightWin.clear();
+ m_pCenterWin.clear();
+ m_pDezWin.clear();
+ m_pDezCharLabel.clear();
+ m_pDezChar.clear();
+ m_pNoFillChar.clear();
+ m_pFillPoints.clear();
+ m_pFillDashLine.clear();
+ m_pFillSolidLine.clear();
+ m_pFillSpecial.clear();
+ m_pFillChar.clear();
+ m_pNewBtn.clear();
+ m_pDelAllBtn.clear();
+ m_pDelBtn.clear();
+ m_pTypeFrame.clear();
+ m_pFillFrame.clear();
+ SfxTabPage::dispose();
+}
bool SvxTabulatorTabPage::FillItemSet( SfxItemSet* rSet )
{
@@ -252,10 +278,11 @@ bool SvxTabulatorTabPage::FillItemSet( SfxItemSet* rSet )
-SfxTabPage* SvxTabulatorTabPage::Create( vcl::Window* pParent,
+VclPtr<SfxTabPage> SvxTabulatorTabPage::Create( vcl::Window* pParent,
const SfxItemSet* rSet)
{
- return ( new SvxTabulatorTabPage( pParent, *rSet ) );
+ return VclPtr<SfxTabPage>( new SvxTabulatorTabPage( pParent, *rSet ),
+ SAL_NO_ACQUIRE );
}
diff --git a/cui/source/tabpages/textanim.cxx b/cui/source/tabpages/textanim.cxx
index 72626e953100..b2f2980de258 100644
--- a/cui/source/tabpages/textanim.cxx
+++ b/cui/source/tabpages/textanim.cxx
@@ -122,14 +122,30 @@ SvxTextAnimationPage::SvxTextAnimationPage( vcl::Window* pWindow, const SfxItemS
m_pBtnDown->SetClickHdl( aLink );
}
-/*************************************************************************
-|*
-|* Dtor
-|*
-\************************************************************************/
-
SvxTextAnimationPage::~SvxTextAnimationPage()
{
+ disposeOnce();
+}
+
+void SvxTextAnimationPage::dispose()
+{
+ m_pLbEffect.clear();
+ m_pBoxDirection.clear();
+ m_pBtnUp.clear();
+ m_pBtnLeft.clear();
+ m_pBtnRight.clear();
+ m_pBtnDown.clear();
+ m_pFlProperties.clear();
+ m_pTsbStartInside.clear();
+ m_pTsbStopInside.clear();
+ m_pBoxCount.clear();
+ m_pTsbEndless.clear();
+ m_pNumFldCount.clear();
+ m_pTsbPixel.clear();
+ m_pMtrFldAmount.clear();
+ m_pTsbAuto.clear();
+ m_pMtrFldDelay.clear();
+ SfxTabPage::dispose();
}
/*************************************************************************
@@ -445,10 +461,10 @@ bool SvxTextAnimationPage::FillItemSet( SfxItemSet* rAttrs)
|*
\************************************************************************/
-SfxTabPage* SvxTextAnimationPage::Create( vcl::Window* pWindow,
- const SfxItemSet* rAttrs )
+VclPtr<SfxTabPage> SvxTextAnimationPage::Create( vcl::Window* pWindow,
+ const SfxItemSet* rAttrs )
{
- return new SvxTextAnimationPage( pWindow, *rAttrs );
+ return VclPtr<SvxTextAnimationPage>::Create( pWindow, *rAttrs );
}
IMPL_LINK_NOARG(SvxTextAnimationPage, SelectEffectHdl_Impl)
diff --git a/cui/source/tabpages/textattr.cxx b/cui/source/tabpages/textattr.cxx
index 655638577e35..d04a830b9dbd 100644
--- a/cui/source/tabpages/textattr.cxx
+++ b/cui/source/tabpages/textattr.cxx
@@ -96,13 +96,28 @@ SvxTextAttrPage::SvxTextAttrPage(vcl::Window* pWindow, const SfxItemSet& rInAttr
m_pTsbFullWidth->SetClickHdl(LINK( this, SvxTextAttrPage, ClickFullWidthHdl_Impl ) );
}
-/*************************************************************************
-|*
-|* Dtor
-|*
-\************************************************************************/
SvxTextAttrPage::~SvxTextAttrPage()
{
+ disposeOnce();
+}
+
+void SvxTextAttrPage::dispose()
+{
+ m_pTsbAutoGrowWidth.clear();
+ m_pTsbAutoGrowHeight.clear();
+ m_pTsbFitToSize.clear();
+ m_pTsbContour.clear();
+ m_pTsbWordWrapText.clear();
+ m_pTsbAutoGrowSize.clear();
+ m_pFlDistance.clear();
+ m_pMtrFldLeft.clear();
+ m_pMtrFldRight.clear();
+ m_pMtrFldTop.clear();
+ m_pMtrFldBottom.clear();
+ m_pFlPosition.clear();
+ m_pCtlPosition.clear();
+ m_pTsbFullWidth.clear();
+ SvxTabPage::dispose();
}
/*************************************************************************
@@ -514,16 +529,10 @@ void SvxTextAttrPage::Construct()
m_pTsbWordWrapText->Enable( bWordWrapTextEnabled );
}
-/*************************************************************************
-|*
-|* creates the page
-|*
-\************************************************************************/
-
-SfxTabPage* SvxTextAttrPage::Create( vcl::Window* pWindow,
- const SfxItemSet* rAttrs )
+VclPtr<SfxTabPage> SvxTextAttrPage::Create( vcl::Window* pWindow,
+ const SfxItemSet* rAttrs )
{
- return new SvxTextAttrPage( pWindow, *rAttrs );
+ return VclPtr<SvxTextAttrPage>::Create( pWindow, *rAttrs );
}
/** Check whether we have to uncheck the "Full width" check box.
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index 944aff6abe8e..7cd0685cb031 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -118,6 +118,33 @@ IMPL_LINK_NOARG(SvxTransparenceTabPage, ClickTransGradientHdl_Impl)
return 0L;
}
+SvxTransparenceTabPage::~SvxTransparenceTabPage()
+{
+ disposeOnce();
+}
+
+void SvxTransparenceTabPage::dispose()
+{
+ m_pRbtTransOff.clear();
+ m_pRbtTransLinear.clear();
+ m_pRbtTransGradient.clear();
+ m_pMtrTransparent.clear();
+ m_pGridGradient.clear();
+ m_pLbTrgrGradientType.clear();
+ m_pFtTrgrCenterX.clear();
+ m_pMtrTrgrCenterX.clear();
+ m_pFtTrgrCenterY.clear();
+ m_pMtrTrgrCenterY.clear();
+ m_pFtTrgrAngle.clear();
+ m_pMtrTrgrAngle.clear();
+ m_pMtrTrgrBorder.clear();
+ m_pMtrTrgrStartValue.clear();
+ m_pMtrTrgrEndValue.clear();
+ m_pCtlBitmapPreview.clear();
+ m_pCtlXRectPreview.clear();
+ SvxTabPage::dispose();
+}
+
void SvxTransparenceTabPage::ActivateLinear(bool bActivate)
{
m_pMtrTransparent->Enable(bActivate);
@@ -287,9 +314,9 @@ SvxTransparenceTabPage::SvxTransparenceTabPage(vcl::Window* pParent, const SfxIt
SetExchangeSupport();
}
-SfxTabPage* SvxTransparenceTabPage::Create(vcl::Window* pWindow, const SfxItemSet* rAttrs)
+VclPtr<SfxTabPage> SvxTransparenceTabPage::Create(vcl::Window* pWindow, const SfxItemSet* rAttrs)
{
- return new SvxTransparenceTabPage(pWindow, *rAttrs);
+ return VclPtr<SvxTransparenceTabPage>::Create(pWindow, *rAttrs);
}
bool SvxTransparenceTabPage::FillItemSet(SfxItemSet* rAttrs)
@@ -768,6 +795,51 @@ SvxAreaTabPage::SvxAreaTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs
m_pCtlXRectPreview->set_height_request(aSize2.Height());
}
+SvxAreaTabPage::~SvxAreaTabPage()
+{
+ disposeOnce();
+}
+
+void SvxAreaTabPage::dispose()
+{
+ m_pTypeLB.clear();
+ m_pFillLB.clear();
+ m_pLbColor.clear();
+ m_pLbGradient.clear();
+ m_pLbHatching.clear();
+ m_pLbBitmap.clear();
+ m_pCtlBitmapPreview.clear();
+ m_pTsbStepCount.clear();
+ m_pFlStepCount.clear();
+ m_pNumFldStepCount.clear();
+ m_pFlHatchBckgrd.clear();
+ m_pCbxHatchBckgrd.clear();
+ m_pLbHatchBckgrdColor.clear();
+ m_pBxBitmap.clear();
+ m_pFlSize.clear();
+ m_pTsbOriginal.clear();
+ m_pTsbScale.clear();
+ m_pGridX_Y.clear();
+ m_pFtXSize.clear();
+ m_pMtrFldXSize.clear();
+ m_pFtYSize.clear();
+ m_pMtrFldYSize.clear();
+ m_pFlPosition.clear();
+ m_pCtlPosition.clear();
+ m_pGridOffset.clear();
+ m_pMtrFldXOffset.clear();
+ m_pMtrFldYOffset.clear();
+ m_pBxTile.clear();
+ m_pTsbTile.clear();
+ m_pTsbStretch.clear();
+ m_pFlOffset.clear();
+ m_pRbtRow.clear();
+ m_pRbtColumn.clear();
+ m_pMtrFldOffset.clear();
+ m_pCtlXRectPreview.clear();
+ m_pBtnImport.clear();
+ SvxTabPage::dispose();
+}
void SvxAreaTabPage::Construct()
@@ -1758,10 +1830,10 @@ void SvxAreaTabPage::Reset( const SfxItemSet* rAttrs )
-SfxTabPage* SvxAreaTabPage::Create( vcl::Window* pWindow,
- const SfxItemSet* rAttrs )
+VclPtr<SfxTabPage> SvxAreaTabPage::Create( vcl::Window* pWindow,
+ const SfxItemSet* rAttrs )
{
- return new SvxAreaTabPage( pWindow, *rAttrs );
+ return VclPtr<SvxAreaTabPage>::Create( pWindow, *rAttrs );
}
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index 3ce5ff5b1696..e75afb7d1a29 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -122,10 +122,28 @@ SvxBitmapTabPage::SvxBitmapTabPage( vcl::Window* pParent, const SfxItemSet& rIn
SvxBitmapTabPage::~SvxBitmapTabPage()
{
- delete m_pBitmapCtl;
+ disposeOnce();
}
-
+void SvxBitmapTabPage::dispose()
+{
+ delete m_pBitmapCtl;
+ m_pBitmapCtl = NULL;
+ m_pBxPixelEditor.clear();
+ m_pCtlPixel.clear();
+ m_pLbColor.clear();
+ m_pLbBackgroundColor.clear();
+ m_pLbBitmapsHidden.clear();
+ m_pLbBitmaps.clear();
+ m_pCtlPreview.clear();
+ m_pBtnAdd.clear();
+ m_pBtnModify.clear();
+ m_pBtnImport.clear();
+ m_pBtnDelete.clear();
+ m_pBtnLoad.clear();
+ m_pBtnSave.clear();
+ SvxTabPage::dispose();
+}
void SvxBitmapTabPage::Construct()
{
@@ -292,10 +310,10 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* )
-SfxTabPage* SvxBitmapTabPage::Create( vcl::Window* pWindow,
- const SfxItemSet* rSet )
+VclPtr<SfxTabPage> SvxBitmapTabPage::Create( vcl::Window* pWindow,
+ const SfxItemSet* rSet )
{
- return new SvxBitmapTabPage( pWindow, *rSet );
+ return VclPtr<SvxBitmapTabPage>::Create( pWindow, *rSet );
}
@@ -428,10 +446,10 @@ long SvxBitmapTabPage::CheckChanges_Impl()
{
ResMgr& rMgr = CUI_MGR();
Image aWarningBoxImage = WarningBox::GetStandardImage();
- boost::scoped_ptr<SvxMessDialog> aMessDlg(new SvxMessDialog(GetParentDialog(),
- SVX_RES( RID_SVXSTR_BITMAP ),
- CUI_RES( RID_SVXSTR_ASK_CHANGE_BITMAP ),
- &aWarningBoxImage ));
+ ScopedVclPtrInstance<SvxMessDialog> aMessDlg( GetParentDialog(),
+ SVX_RES( RID_SVXSTR_BITMAP ),
+ CUI_RES( RID_SVXSTR_ASK_CHANGE_BITMAP ),
+ &aWarningBoxImage );
DBG_ASSERT(aMessDlg, "Dialog creation failed!");
aMessDlg->SetButtonText( MESS_BTN_1, ResId( RID_SVXSTR_CHANGE, rMgr ) );
aMessDlg->SetButtonText( MESS_BTN_2, ResId( RID_SVXSTR_ADD, rMgr ) );
@@ -492,7 +510,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickAddHdl_Impl)
DBG_ASSERT(pFact, "Dialog creation failed!");
boost::scoped_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc ));
DBG_ASSERT(pDlg, "Dialog creation failed!");
- boost::scoped_ptr<MessageDialog> pWarnBox;
+ ScopedVclPtr<MessageDialog> pWarnBox;
sal_uInt16 nError(1);
while( pDlg->Execute() == RET_OK )
@@ -512,7 +530,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickAddHdl_Impl)
if( !pWarnBox )
{
- pWarnBox.reset(new MessageDialog( GetParentDialog()
+ pWarnBox.reset(VclPtr<MessageDialog>::Create( GetParentDialog()
,"DuplicateNameDialog"
,"cui/ui/queryduplicatedialog.ui"));
}
@@ -592,7 +610,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl_Impl)
if( !nError )
{
OUString aDesc( ResId(RID_SVXSTR_DESC_EXT_BITMAP, rMgr) );
- boost::scoped_ptr<MessageDialog> pWarnBox;
+ ScopedVclPtr<MessageDialog> pWarnBox;
// convert file URL to UI name
OUString aName;
@@ -621,7 +639,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl_Impl)
if( !pWarnBox )
{
- pWarnBox.reset(new MessageDialog( GetParentDialog()
+ pWarnBox.reset(VclPtr<MessageDialog>::Create( GetParentDialog()
,"DuplicateNameDialog"
,"cui/ui/queryduplicatedialog.ui"));
}
@@ -710,10 +728,11 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickModifyHdl_Impl)
}
else
{
- MessageDialog aBox( GetParentDialog()
+ ScopedVclPtrInstance<MessageDialog> aBox(
+ GetParentDialog()
,"DuplicateNameDialog"
,"cui/ui/queryduplicatedialog.ui");
- aBox.Execute();
+ aBox->Execute();
}
}
}
@@ -728,9 +747,9 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickDeleteHdl_Impl)
if( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- MessageDialog aQueryBox( GetParentDialog(),"AskDelBitmapDialog","cui/ui/querydeletebitmapdialog.ui");
+ ScopedVclPtrInstance< MessageDialog > aQueryBox( GetParentDialog(),"AskDelBitmapDialog","cui/ui/querydeletebitmapdialog.ui" );
- if( aQueryBox.Execute() == RET_YES )
+ if( aQueryBox->Execute() == RET_YES )
{
delete pBitmapList->Remove( nPos );
m_pLbBitmaps->RemoveEntry( nPos );
@@ -969,7 +988,7 @@ void SvxBitmapTabPage::PointChanged( vcl::Window* pWindow, RECT_POINT )
vcl::Window* SvxBitmapTabPage::GetParentLabeledBy( const vcl::Window* pLabeled ) const
{
if (pLabeled == m_pLbBitmaps)
- return m_pLbBitmapsHidden;
+ return m_pLbBitmapsHidden.get();
else
return SvxTabPage::GetParentLabeledBy (pLabeled);
}
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 165736eb60ca..b96b0d64e51c 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -51,8 +51,8 @@ using namespace com::sun::star;
XPropertyListRef SvxColorTabPage::GetList()
{
- SvxAreaTabDialog* pArea = dynamic_cast< SvxAreaTabDialog* >( mpTopDlg );
- SvxLineTabDialog* pLine = dynamic_cast< SvxLineTabDialog* >( mpTopDlg );
+ SvxAreaTabDialog* pArea = dynamic_cast< SvxAreaTabDialog* >( mpTopDlg.get() );
+ SvxLineTabDialog* pLine = dynamic_cast< SvxLineTabDialog* >( mpTopDlg.get() );
XColorListRef pList;
if( pArea )
@@ -162,8 +162,8 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickLoadHdl_Impl)
if( pList->Load() )
{
// check whether the table may be deleted:
- SvxAreaTabDialog* pArea = dynamic_cast< SvxAreaTabDialog* >( mpTopDlg );
- SvxLineTabDialog* pLine = dynamic_cast< SvxLineTabDialog* >( mpTopDlg );
+ SvxAreaTabDialog* pArea = dynamic_cast< SvxAreaTabDialog* >( mpTopDlg.get() );
+ SvxLineTabDialog* pLine = dynamic_cast< SvxLineTabDialog* >( mpTopDlg.get() );
// FIXME: want to have a generic set and get method by type ...
if( pArea )
@@ -397,10 +397,39 @@ SvxColorTabPage::SvxColorTabPage(vcl::Window* pParent, const SfxItemSet& rInAttr
SvxColorTabPage::~SvxColorTabPage()
{
- delete pShadow;
+ disposeOnce();
}
-
+void SvxColorTabPage::dispose()
+{
+ delete pShadow;
+ pShadow = NULL;
+ mpTopDlg.clear();
+ m_pBoxEmbed.clear();
+ m_pBtnLoad.clear();
+ m_pBtnSave.clear();
+ m_pTableName.clear();
+ m_pEdtName.clear();
+ m_pLbColor.clear();
+ m_pValSetColorList.clear();
+ m_pCtlPreviewOld.clear();
+ m_pCtlPreviewNew.clear();
+ m_pLbColorModel.clear();
+ m_pRGB.clear();
+ m_pR.clear();
+ m_pG.clear();
+ m_pB.clear();
+ m_pCMYK.clear();
+ m_pC.clear();
+ m_pY.clear();
+ m_pM.clear();
+ m_pK.clear();
+ m_pBtnAdd.clear();
+ m_pBtnModify.clear();
+ m_pBtnWorkOn.clear();
+ m_pBtnDelete.clear();
+ SfxTabPage::dispose();
+}
void SvxColorTabPage::ImpColorCountChanged()
{
@@ -510,10 +539,10 @@ long SvxColorTabPage::CheckChanges_Impl()
{
ResMgr& rMgr = CUI_MGR();
Image aWarningBoxImage = WarningBox::GetStandardImage();
- boost::scoped_ptr<SvxMessDialog> aMessDlg(new SvxMessDialog(GetParentDialog(),
- SVX_RESSTR( RID_SVXSTR_COLOR ),
- ResId( RID_SVXSTR_ASK_CHANGE_COLOR, rMgr ),
- &aWarningBoxImage ));
+ ScopedVclPtrInstance<SvxMessDialog> aMessDlg( GetParentDialog(),
+ SVX_RESSTR( RID_SVXSTR_COLOR ),
+ ResId( RID_SVXSTR_ASK_CHANGE_COLOR, rMgr ),
+ &aWarningBoxImage );
aMessDlg->SetButtonText( MESS_BTN_1,
ResId( RID_SVXSTR_CHANGE, rMgr ) );
aMessDlg->SetButtonText( MESS_BTN_2,
@@ -618,10 +647,10 @@ void SvxColorTabPage::Reset( const SfxItemSet* rSet )
-SfxTabPage* SvxColorTabPage::Create( vcl::Window* pWindow,
- const SfxItemSet* rOutAttrs )
+VclPtr<SfxTabPage> SvxColorTabPage::Create( vcl::Window* pWindow,
+ const SfxItemSet* rOutAttrs )
{
- return new SvxColorTabPage( pWindow, *rOutAttrs );
+ return VclPtr<SvxColorTabPage>::Create( pWindow, *rOutAttrs );
}
// is called when the content of the MtrFields is changed for color values
@@ -676,10 +705,10 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl)
// if yes, it is repeated and a new name is demanded
if ( !bDifferent )
{
- MessageDialog aWarningBox( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui");
- aWarningBox.Execute();
+ ScopedVclPtrInstance<MessageDialog> aWarningBox( GetParentDialog()
+ ,"DuplicateNameDialog"
+ ,"cui/ui/queryduplicatedialog.ui");
+ aWarningBox->Execute();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
boost::scoped_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc ));
@@ -699,7 +728,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl)
if( bDifferent )
bLoop = false;
else
- aWarningBox.Execute();
+ aWarningBox->Execute();
}
}
@@ -747,10 +776,10 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickModifyHdl_Impl)
// if yes, it is repeated and a new name is demanded
if ( !bDifferent )
{
- MessageDialog aWarningBox( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui");
- aWarningBox.Execute();
+ ScopedVclPtrInstance<MessageDialog> aWarningBox( GetParentDialog()
+ ,"DuplicateNameDialog"
+ ,"cui/ui/queryduplicatedialog.ui");
+ aWarningBox->Execute();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
boost::scoped_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc ));
@@ -768,7 +797,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickModifyHdl_Impl)
if( bDifferent )
bLoop = false;
else
- aWarningBox.Execute();
+ aWarningBox->Execute();
}
}
@@ -843,9 +872,9 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickDeleteHdl_Impl)
if( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- MessageDialog aQueryBox( GetParentDialog(),"AskDelColorDialog","cui/ui/querydeletecolordialog.ui");
+ ScopedVclPtrInstance< MessageDialog > aQueryBox( GetParentDialog(),"AskDelColorDialog","cui/ui/querydeletecolordialog.ui");
- if( aQueryBox.Execute() == RET_YES )
+ if( aQueryBox->Execute() == RET_YES )
{
XColorEntry* pEntry = pColorList->Remove( nPos );
DBG_ASSERT( pEntry, "ColorEntry not found !" );
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index b2c334883f91..55c81296f638 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -139,6 +139,34 @@ SvxGradientTabPage::SvxGradientTabPage
setPreviewsToSamePlace(pParent, this);
}
+SvxGradientTabPage::~SvxGradientTabPage()
+{
+ disposeOnce();
+}
+
+void SvxGradientTabPage::dispose()
+{
+ m_pLbGradientType.clear();
+ m_pFtCenterX.clear();
+ m_pMtrCenterX.clear();
+ m_pFtCenterY.clear();
+ m_pMtrCenterY.clear();
+ m_pFtAngle.clear();
+ m_pMtrAngle.clear();
+ m_pMtrBorder.clear();
+ m_pLbColorFrom.clear();
+ m_pMtrColorFrom.clear();
+ m_pLbColorTo.clear();
+ m_pMtrColorTo.clear();
+ m_pLbGradients.clear();
+ m_pCtlPreview.clear();
+ m_pBtnAdd.clear();
+ m_pBtnModify.clear();
+ m_pBtnDelete.clear();
+ m_pBtnLoad.clear();
+ m_pBtnSave.clear();
+ SfxTabPage::dispose();
+}
void SvxGradientTabPage::Construct()
@@ -263,10 +291,10 @@ long SvxGradientTabPage::CheckChanges_Impl()
{
ResMgr& rMgr = CUI_MGR();
Image aWarningBoxImage = WarningBox::GetStandardImage();
- boost::scoped_ptr<SvxMessDialog> aMessDlg(new SvxMessDialog(GetParentDialog(),
- SVX_RESSTR( RID_SVXSTR_GRADIENT ),
- CUI_RESSTR( RID_SVXSTR_ASK_CHANGE_GRADIENT ),
- &aWarningBoxImage ));
+ ScopedVclPtrInstance<SvxMessDialog> aMessDlg( GetParentDialog(),
+ SVX_RESSTR( RID_SVXSTR_GRADIENT ),
+ CUI_RESSTR( RID_SVXSTR_ASK_CHANGE_GRADIENT ),
+ &aWarningBoxImage );
DBG_ASSERT(aMessDlg, "Dialog creation failed!");
aMessDlg->SetButtonText( MESS_BTN_1,
OUString( ResId( RID_SVXSTR_CHANGE, rMgr ) ) );
@@ -366,10 +394,10 @@ void SvxGradientTabPage::Reset( const SfxItemSet* )
-SfxTabPage* SvxGradientTabPage::Create( vcl::Window* pWindow,
- const SfxItemSet* rOutAttrs )
+VclPtr<SfxTabPage> SvxGradientTabPage::Create( vcl::Window* pWindow,
+ const SfxItemSet* rOutAttrs )
{
- return new SvxGradientTabPage( pWindow, *rOutAttrs );
+ return VclPtr<SvxGradientTabPage>::Create( pWindow, *rOutAttrs );
}
@@ -429,7 +457,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl)
DBG_ASSERT(pFact, "Dialog creation failed!");
boost::scoped_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc ));
DBG_ASSERT(pDlg, "Dialog creation failed!");
- boost::scoped_ptr<MessageDialog> pWarnBox;
+ ScopedVclPtr<MessageDialog> pWarnBox;
sal_uInt16 nError = 1;
while( pDlg->Execute() == RET_OK )
@@ -450,7 +478,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl)
if( !pWarnBox )
{
- pWarnBox.reset(new MessageDialog( GetParentDialog()
+ pWarnBox.reset(VclPtr<MessageDialog>::Create( GetParentDialog()
,"DuplicateNameDialog"
,"cui/ui/queryduplicatedialog.ui"));
}
@@ -561,10 +589,10 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickModifyHdl_Impl)
}
else
{
- MessageDialog aBox( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui");
- aBox.Execute();
+ ScopedVclPtrInstance<MessageDialog> aBox( GetParentDialog()
+ ,"DuplicateNameDialog"
+ ,"cui/ui/queryduplicatedialog.ui" );
+ aBox->Execute();
}
}
@@ -580,9 +608,9 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickDeleteHdl_Impl)
if( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- MessageDialog aQueryBox( GetParentDialog(),"AskDelGradientDialog","cui/ui/querydeletegradientdialog.ui");
+ ScopedVclPtrInstance< MessageDialog > aQueryBox( GetParentDialog(),"AskDelGradientDialog","cui/ui/querydeletegradientdialog.ui");
- if ( aQueryBox.Execute() == RET_YES )
+ if ( aQueryBox->Execute() == RET_YES )
{
delete pGradientList->Remove( nPos );
m_pLbGradients->RemoveEntry( nPos );
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index 418a7ce500db..3e839505e0cc 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -137,6 +137,27 @@ SvxHatchTabPage::SvxHatchTabPage
setPreviewsToSamePlace(pParent, this);
}
+SvxHatchTabPage::~SvxHatchTabPage()
+{
+ disposeOnce();
+}
+
+void SvxHatchTabPage::dispose()
+{
+ m_pMtrDistance.clear();
+ m_pMtrAngle.clear();
+ m_pCtlAngle.clear();
+ m_pLbLineType.clear();
+ m_pLbLineColor.clear();
+ m_pLbHatchings.clear();
+ m_pCtlPreview.clear();
+ m_pBtnAdd.clear();
+ m_pBtnModify.clear();
+ m_pBtnDelete.clear();
+ m_pBtnLoad.clear();
+ m_pBtnSave.clear();
+ SvxTabPage::dispose();
+}
void SvxHatchTabPage::Construct()
@@ -240,10 +261,10 @@ long SvxHatchTabPage::CheckChanges_Impl()
{
ResMgr& rMgr = CUI_MGR();
Image aWarningBoxImage = WarningBox::GetStandardImage();
- boost::scoped_ptr<SvxMessDialog> aMessDlg(new SvxMessDialog(GetParentDialog(),
- SVX_RESSTR( RID_SVXSTR_HATCH ),
- CUI_RESSTR( RID_SVXSTR_ASK_CHANGE_HATCH ),
- &aWarningBoxImage ));
+ ScopedVclPtrInstance<SvxMessDialog> aMessDlg( GetParentDialog(),
+ SVX_RESSTR( RID_SVXSTR_HATCH ),
+ CUI_RESSTR( RID_SVXSTR_ASK_CHANGE_HATCH ),
+ &aWarningBoxImage );
DBG_ASSERT(aMessDlg, "Dialog creation failed!");
aMessDlg->SetButtonText( MESS_BTN_1,
OUString( ResId( RID_SVXSTR_CHANGE, rMgr ) ) );
@@ -339,10 +360,10 @@ void SvxHatchTabPage::Reset( const SfxItemSet* rSet )
-SfxTabPage* SvxHatchTabPage::Create( vcl::Window* pWindow,
- const SfxItemSet* rSet )
+VclPtr<SfxTabPage> SvxHatchTabPage::Create( vcl::Window* pWindow,
+ const SfxItemSet* rSet )
{
- return new SvxHatchTabPage( pWindow, *rSet );
+ return VclPtr<SvxHatchTabPage>::Create( pWindow, *rSet );
}
@@ -479,7 +500,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl)
DBG_ASSERT(pFact, "Dialog creation failed!");
boost::scoped_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc ));
DBG_ASSERT(pDlg, "Dialog creation failed!");
- boost::scoped_ptr<MessageDialog> pWarnBox;
+ ScopedVclPtr<MessageDialog> pWarnBox;
sal_uInt16 nError = 1;
while( pDlg->Execute() == RET_OK )
@@ -499,7 +520,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl)
if( !pWarnBox )
{
- pWarnBox.reset(new MessageDialog( GetParentDialog()
+ pWarnBox.reset(VclPtr<MessageDialog>::Create( GetParentDialog()
,"DuplicateNameDialog"
,"cui/ui/queryduplicatedialog.ui"));
}
@@ -606,10 +627,10 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickModifyHdl_Impl)
}
else
{
- MessageDialog aBox( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui");
- aBox.Execute();
+ ScopedVclPtrInstance<MessageDialog> aBox( GetParentDialog()
+ ,"DuplicateNameDialog"
+ ,"cui/ui/queryduplicatedialog.ui" );
+ aBox->Execute();
}
}
}
@@ -624,9 +645,9 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickDeleteHdl_Impl)
if( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- MessageDialog aQueryBox( GetParentDialog(),"AskDelHatchDialog","cui/ui/querydeletehatchdialog.ui");
+ ScopedVclPtrInstance< MessageDialog > aQueryBox( GetParentDialog(),"AskDelHatchDialog","cui/ui/querydeletehatchdialog.ui");
- if( aQueryBox.Execute() == RET_YES )
+ if( aQueryBox->Execute() == RET_YES )
{
delete pHatchingList->Remove( nPos );
m_pLbHatchings->RemoveEntry( nPos );
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index 119d59948a5f..300db7422607 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -230,12 +230,20 @@ void SvxLineTabPage::ShowSymbolControls(bool bOn)
SvxLineTabPage::~SvxLineTabPage()
{
- // Symbols on a line (e.g. StarCharts), dtor new!
+ disposeOnce();
+}
- delete m_pSymbolMB->GetPopupMenu()->GetPopupMenu( MN_GALLERY );
+void SvxLineTabPage::dispose()
+{
+ // Symbols on a line (e.g. StarCharts), dtor new!
+ if (m_pSymbolMB)
+ {
+ delete m_pSymbolMB->GetPopupMenu()->GetPopupMenu( MN_GALLERY );
- if(pSymbolList)
- delete m_pSymbolMB->GetPopupMenu()->GetPopupMenu( MN_SYMBOLS );
+ if(pSymbolList)
+ delete m_pSymbolMB->GetPopupMenu()->GetPopupMenu( MN_SYMBOLS );
+ m_pSymbolMB = NULL;
+ }
for ( size_t i = 0, n = aGrfBrushItems.size(); i < n; ++i )
{
@@ -243,7 +251,40 @@ SvxLineTabPage::~SvxLineTabPage()
delete pInfo->pBrushItem;
delete pInfo;
}
+ aGrfBrushItems.clear();
+
+ m_pBoxColor.clear();
+ m_pLbLineStyle.clear();
+ m_pLbColor.clear();
+ m_pBoxWidth.clear();
+ m_pMtrLineWidth.clear();
+ m_pBoxTransparency.clear();
+ m_pMtrTransparent.clear();
+ m_pFlLineEnds.clear();
+ m_pBoxArrowStyles.clear();
+ m_pLbStartStyle.clear();
+ m_pBoxStart.clear();
+ m_pMtrStartWidth.clear();
+ m_pTsbCenterStart.clear();
+ m_pBoxEnd.clear();
+ m_pLbEndStyle.clear();
+ m_pMtrEndWidth.clear();
+ m_pTsbCenterEnd.clear();
+ m_pCbxSynchronize.clear();
+ m_pCtlPreview.clear();
+ m_pFLEdgeStyle.clear();
+ m_pGridEdgeCaps.clear();
+ m_pLBEdgeStyle.clear();
+ m_pLBCapStyle.clear();
+ m_pFlSymbol.clear();
+ m_pGridIconSize.clear();
+ m_pSymbolMB.clear();
+ m_pSymbolWidthMF.clear();
+ m_pSymbolHeightMF.clear();
+ m_pSymbolRatioCB.clear();
+ SvxTabPage::dispose();
}
+
void SvxLineTabPage::Construct()
{
// Color chart
@@ -319,8 +360,8 @@ void SvxLineTabPage::InitSymbols(MenuButton* pButton)
if(!pButton->GetPopupMenu()->GetPopupMenu( MN_SYMBOLS ) && pSymbolList)
{
- VirtualDevice aVDev;
- aVDev.SetMapMode(MapMode(MAP_100TH_MM));
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
+ pVDev->SetMapMode(MapMode(MAP_100TH_MM));
boost::scoped_ptr<SdrModel> pModel(new SdrModel);
pModel->GetItemPool().FreezeIdRanges();
// Page
@@ -329,7 +370,7 @@ void SvxLineTabPage::InitSymbols(MenuButton* pButton)
pModel->InsertPage( pPage, 0 );
{
// 3D View
- boost::scoped_ptr<SdrView> pView(new SdrView( pModel.get(), &aVDev ));
+ boost::scoped_ptr<SdrView> pView(new SdrView( pModel.get(), pVDev ));
pView->hideMarkHandles();
pView->ShowSdrPage(pPage);
@@ -1114,8 +1155,8 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
}
else if(nSymType >= 0)
{
- VirtualDevice aVDev;
- aVDev.SetMapMode(MapMode(MAP_100TH_MM));
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
+ pVDev->SetMapMode(MapMode(MAP_100TH_MM));
boost::scoped_ptr<SdrModel> pModel(new SdrModel);
pModel->GetItemPool().FreezeIdRanges();
@@ -1123,7 +1164,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
pPage->SetSize(Size(1000,1000));
pModel->InsertPage( pPage, 0 );
{
- boost::scoped_ptr<SdrView> pView(new SdrView( pModel.get(), &aVDev ));
+ boost::scoped_ptr<SdrView> pView(new SdrView( pModel.get(), pVDev ));
pView->hideMarkHandles();
pView->ShowSdrPage(pPage);
SdrObject *pObj=NULL;
@@ -1488,10 +1529,10 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
-SfxTabPage* SvxLineTabPage::Create( vcl::Window* pWindow,
- const SfxItemSet* rAttrs )
+VclPtr<SfxTabPage> SvxLineTabPage::Create( vcl::Window* pWindow,
+ const SfxItemSet* rAttrs )
{
- return new SvxLineTabPage( pWindow, *rAttrs );
+ return VclPtr<SvxLineTabPage>::Create( pWindow, *rAttrs );
}
diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx
index 9e947e89358d..0e68ad35c932 100644
--- a/cui/source/tabpages/tplnedef.cxx
+++ b/cui/source/tabpages/tplnedef.cxx
@@ -154,6 +154,31 @@ SvxLineDefTabPage::SvxLineDefTabPage
pDashList = NULL;
}
+SvxLineDefTabPage::~SvxLineDefTabPage()
+{
+ disposeOnce();
+}
+
+void SvxLineDefTabPage::dispose()
+{
+ m_pLbLineStyles.clear();
+ m_pLbType1.clear();
+ m_pLbType2.clear();
+ m_pNumFldNumber1.clear();
+ m_pNumFldNumber2.clear();
+ m_pMtrLength1.clear();
+ m_pMtrLength2.clear();
+ m_pMtrDistance.clear();
+ m_pCbxSynchronize.clear();
+ m_pBtnAdd.clear();
+ m_pBtnModify.clear();
+ m_pBtnDelete.clear();
+ m_pBtnLoad.clear();
+ m_pBtnSave.clear();
+ m_pCtlPreview.clear();
+ SfxTabPage::dispose();
+}
+
void SvxLineDefTabPage::Construct()
{
// Line style fill; do *not* add default fields here
@@ -221,10 +246,10 @@ void SvxLineDefTabPage::CheckChanges_Impl()
{
ResMgr& rMgr = CUI_MGR();
Image aWarningBoxImage = WarningBox::GetStandardImage();
- boost::scoped_ptr<SvxMessDialog> aMessDlg(new SvxMessDialog(GetParentDialog(),
- SVX_RESSTR( RID_SVXSTR_LINESTYLE ),
- OUString( ResId( RID_SVXSTR_ASK_CHANGE_LINESTYLE, rMgr ) ),
- &aWarningBoxImage ));
+ ScopedVclPtrInstance<SvxMessDialog> aMessDlg( GetParentDialog(),
+ SVX_RESSTR( RID_SVXSTR_LINESTYLE ),
+ OUString( ResId( RID_SVXSTR_ASK_CHANGE_LINESTYLE, rMgr ) ),
+ &aWarningBoxImage );
DBG_ASSERT(aMessDlg, "Dialog creation failed!");
aMessDlg->SetButtonText( MESS_BTN_1, OUString( ResId( RID_SVXSTR_CHANGE, rMgr ) ) );
aMessDlg->SetButtonText( MESS_BTN_2, OUString( ResId( RID_SVXSTR_ADD, rMgr ) ) );
@@ -325,9 +350,9 @@ void SvxLineDefTabPage::Reset( const SfxItemSet* rAttrs )
-SfxTabPage* SvxLineDefTabPage::Create( vcl::Window* pWindow, const SfxItemSet* rOutAttrs )
+VclPtr<SfxTabPage> SvxLineDefTabPage::Create( vcl::Window* pWindow, const SfxItemSet* rOutAttrs )
{
- return new SvxLineDefTabPage( pWindow, *rOutAttrs );
+ return VclPtr<SvxLineDefTabPage>::Create( pWindow, *rOutAttrs );
}
@@ -593,11 +618,10 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickAddHdl_Impl)
}
else
{
-
- MessageDialog aBox( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui");
- aBox.Execute();
+ ScopedVclPtrInstance<MessageDialog> aBox( GetParentDialog()
+ ,"DuplicateNameDialog"
+ ,"cui/ui/queryduplicatedialog.ui" );
+ aBox->Execute();
}
}
pDlg.reset();
@@ -672,10 +696,10 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickModifyHdl_Impl)
}
else
{
- MessageDialog aBox( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui");
- aBox.Execute();
+ ScopedVclPtrInstance<MessageDialog> aBox( GetParentDialog()
+ ,"DuplicateNameDialog"
+ ,"cui/ui/queryduplicatedialog.ui" );
+ aBox->Execute();
}
}
}
@@ -690,11 +714,11 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickDeleteHdl_Impl)
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- MessageDialog aQueryBox( GetParentDialog()
- ,"AskDelLineStyleDialog"
- ,"cui/ui/querydeletelinestyledialog.ui");
+ ScopedVclPtrInstance<MessageDialog> aQueryBox( GetParentDialog()
+ ,"AskDelLineStyleDialog"
+ ,"cui/ui/querydeletelinestyledialog.ui" );
- if ( aQueryBox.Execute() == RET_YES )
+ if ( aQueryBox->Execute() == RET_YES )
{
delete pDashList->Remove( nPos );
m_pLbLineStyles->RemoveEntry( nPos );
diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx
index 194b0cd8f2fa..e33cd057f4ed 100644
--- a/cui/source/tabpages/tplneend.cxx
+++ b/cui/source/tabpages/tplneend.cxx
@@ -105,17 +105,29 @@ SvxLineEndDefTabPage::SvxLineEndDefTabPage
}
-void SvxLineEndDefTabPage::Resize()
+SvxLineEndDefTabPage::~SvxLineEndDefTabPage()
{
- rXLSet.Put(XLineStartWidthItem(m_pCtlPreview->GetOutputSize().Height() / 2 ));
- rXLSet.Put(XLineEndWidthItem(m_pCtlPreview->GetOutputSize().Height() / 2 ));
- SfxTabPage::Resize();
+ disposeOnce();
}
+void SvxLineEndDefTabPage::dispose()
+{
+ m_pEdtName.clear();
+ m_pLbLineEnds.clear();
+ m_pBtnAdd.clear();
+ m_pBtnModify.clear();
+ m_pBtnDelete.clear();
+ m_pBtnLoad.clear();
+ m_pBtnSave.clear();
+ m_pCtlPreview.clear();
+ SfxTabPage::dispose();
+}
-
-SvxLineEndDefTabPage::~SvxLineEndDefTabPage()
+void SvxLineEndDefTabPage::Resize()
{
+ rXLSet.Put(XLineStartWidthItem(m_pCtlPreview->GetOutputSize().Height() / 2 ));
+ rXLSet.Put(XLineEndWidthItem(m_pCtlPreview->GetOutputSize().Height() / 2 ));
+ SfxTabPage::Resize();
}
@@ -194,11 +206,10 @@ void SvxLineEndDefTabPage::CheckChanges_Impl()
if( aString != m_pLbLineEnds->GetSelectEntry() )
{
- MessageDialog aQueryBox( GetParentDialog()
- ,"AskChangeLineEndDialog"
- ,"cui/ui/querychangelineenddialog.ui");
-
- if ( aQueryBox.Execute() == RET_YES )
+ ScopedVclPtrInstance<MessageDialog> aQueryBox( GetParentDialog()
+ ,"AskChangeLineEndDialog"
+ ,"cui/ui/querychangelineenddialog.ui" );
+ if ( aQueryBox->Execute() == RET_YES )
ClickModifyHdl_Impl( this );
}
}
@@ -269,9 +280,9 @@ void SvxLineEndDefTabPage::Reset( const SfxItemSet* )
-SfxTabPage* SvxLineEndDefTabPage::Create( vcl::Window* pWindow, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> SvxLineEndDefTabPage::Create( vcl::Window* pWindow, const SfxItemSet* rSet )
{
- return new SvxLineEndDefTabPage( pWindow, *rSet );
+ return VclPtr<SvxLineEndDefTabPage>::Create( pWindow, *rSet );
}
@@ -331,10 +342,10 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickModifyHdl_Impl)
// if yes, repeat and demand a new name
if ( !bDifferent )
{
- MessageDialog aWarningBox( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui");
- aWarningBox.Execute();
+ ScopedVclPtrInstance<MessageDialog> aWarningBox( GetParentDialog()
+ ,"DuplicateNameDialog"
+ ,"cui/ui/queryduplicatedialog.ui" );
+ aWarningBox->Execute();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
DBG_ASSERT(pFact, "Dialog creation failed!");
@@ -356,7 +367,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickModifyHdl_Impl)
if( bDifferent )
bLoop = false;
else
- aWarningBox.Execute();
+ aWarningBox->Execute();
}
}
@@ -485,10 +496,10 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl)
}
else
{
- MessageDialog aBox( GetParentDialog()
- ,"DuplicateNameDialog"
- ,"cui/ui/queryduplicatedialog.ui");
- aBox.Execute();
+ ScopedVclPtrInstance<MessageDialog> aBox( GetParentDialog()
+ ,"DuplicateNameDialog"
+ ,"cui/ui/queryduplicatedialog.ui" );
+ aBox->Execute();
}
}
}
@@ -513,11 +524,11 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickDeleteHdl_Impl)
if( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- MessageDialog aQueryBox( GetParentDialog()
- ,"AskDelLineEndDialog"
- ,"cui/ui/querydeletelineenddialog.ui");
+ ScopedVclPtrInstance<MessageDialog> aQueryBox( GetParentDialog()
+ ,"AskDelLineEndDialog"
+ ,"cui/ui/querydeletelineenddialog.ui" );
- if ( aQueryBox.Execute() == RET_YES )
+ if ( aQueryBox->Execute() == RET_YES )
{
delete pLineEndList->Remove( nPos );
m_pLbLineEnds->RemoveEntry( nPos );
diff --git a/cui/source/tabpages/tpshadow.cxx b/cui/source/tabpages/tpshadow.cxx
index e1121a6acd65..9c18dc3240f7 100644
--- a/cui/source/tabpages/tpshadow.cxx
+++ b/cui/source/tabpages/tpshadow.cxx
@@ -165,6 +165,23 @@ SvxShadowTabPage::SvxShadowTabPage( vcl::Window* pParent, const SfxItemSet& rInA
m_pMtrDistance->SetModifyHdl( aLink );
}
+SvxShadowTabPage::~SvxShadowTabPage()
+{
+ disposeOnce();
+}
+
+void SvxShadowTabPage::dispose()
+{
+ m_pTsbShowShadow.clear();
+ m_pGridShadow.clear();
+ m_pCtlPosition.clear();
+ m_pMtrDistance.clear();
+ m_pLbShadowColor.clear();
+ m_pMtrTransparent.clear();
+ m_pCtlXRectPreview.clear();
+ SvxTabPage::dispose();
+}
+
void SvxShadowTabPage::Construct()
{
m_pLbShadowColor->Fill( pColorList );
@@ -466,10 +483,10 @@ void SvxShadowTabPage::Reset( const SfxItemSet* rAttrs )
-SfxTabPage* SvxShadowTabPage::Create( vcl::Window* pWindow,
- const SfxItemSet* rAttrs )
+VclPtr<SfxTabPage> SvxShadowTabPage::Create( vcl::Window* pWindow,
+ const SfxItemSet* rAttrs )
{
- return new SvxShadowTabPage( pWindow, *rAttrs );
+ return VclPtr<SvxShadowTabPage>::Create( pWindow, *rAttrs );
}
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx
index 5658f7aba4a8..2da50ac83e69 100644
--- a/cui/source/tabpages/transfrm.cxx
+++ b/cui/source/tabpages/transfrm.cxx
@@ -116,12 +116,6 @@ SvxTransformTabDialog::SvxTransformTabDialog( vcl::Window* pParent, const SfxIte
-SvxTransformTabDialog::~SvxTransformTabDialog()
-{
-}
-
-
-
void SvxTransformTabDialog::PageCreated(sal_uInt16 nId, SfxTabPage &rPage)
{
if (nId==nPosSize)
@@ -203,6 +197,23 @@ SvxAngleTabPage::SvxAngleTabPage(vcl::Window* pParent, const SfxItemSet& rInAttr
m_pCtlAngle->SetLinkedField( m_pNfAngle, 2 );
}
+SvxAngleTabPage::~SvxAngleTabPage()
+{
+ disposeOnce();
+}
+
+void SvxAngleTabPage::dispose()
+{
+ m_pFlPosition.clear();
+ m_pMtrPosX.clear();
+ m_pMtrPosY.clear();
+ m_pCtlRect.clear();
+ m_pFlAngle.clear();
+ m_pNfAngle.clear();
+ m_pCtlAngle.clear();
+ SvxTabPage::dispose();
+}
+
void SvxAngleTabPage::Construct()
{
DBG_ASSERT(pView, "No valid view (!)");
@@ -313,9 +324,9 @@ void SvxAngleTabPage::Reset(const SfxItemSet* rAttrs)
-SfxTabPage* SvxAngleTabPage::Create( vcl::Window* pWindow, const SfxItemSet* rSet)
+VclPtr<SfxTabPage> SvxAngleTabPage::Create( vcl::Window* pWindow, const SfxItemSet* rSet)
{
- return new SvxAngleTabPage(pWindow, *rSet);
+ return VclPtr<SvxAngleTabPage>::Create(pWindow, *rSet);
}
@@ -428,6 +439,20 @@ SvxSlantTabPage::SvxSlantTabPage(vcl::Window* pParent, const SfxItemSet& rInAttr
ePoolUnit = pPool->GetMetric( SID_ATTR_TRANSFORM_POS_X );
}
+SvxSlantTabPage::~SvxSlantTabPage()
+{
+ disposeOnce();
+}
+
+void SvxSlantTabPage::dispose()
+{
+ m_pFlRadius.clear();
+ m_pMtrRadius.clear();
+ m_pFlAngle.clear();
+ m_pMtrAngle.clear();
+ SvxTabPage::dispose();
+}
+
void SvxSlantTabPage::Construct()
{
// get the range
@@ -540,9 +565,9 @@ void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs)
-SfxTabPage* SvxSlantTabPage::Create( vcl::Window* pWindow, const SfxItemSet* rOutAttrs )
+VclPtr<SfxTabPage> SvxSlantTabPage::Create( vcl::Window* pWindow, const SfxItemSet* rOutAttrs )
{
- return new SvxSlantTabPage( pWindow, *rOutAttrs );
+ return VclPtr<SvxSlantTabPage>::Create( pWindow, *rOutAttrs );
}
@@ -643,6 +668,33 @@ SvxPositionSizeTabPage::SvxPositionSizeTabPage(vcl::Window* pParent, const SfxIt
}
+SvxPositionSizeTabPage::~SvxPositionSizeTabPage()
+{
+ disposeOnce();
+}
+
+void SvxPositionSizeTabPage::dispose()
+{
+ m_pFlPosition.clear();
+ m_pMtrPosX.clear();
+ m_pMtrPosY.clear();
+ m_pCtlPos.clear();
+ m_pFlSize.clear();
+ m_pFtWidth.clear();
+ m_pMtrWidth.clear();
+ m_pFtHeight.clear();
+ m_pMtrHeight.clear();
+ m_pCbxScale.clear();
+ m_pCtlSize.clear();
+ m_pFlProtect.clear();
+ m_pTsbPosProtect.clear();
+ m_pTsbSizeProtect.clear();
+ m_pFlAdjust.clear();
+ m_pTsbAutoGrowWidth.clear();
+ m_pTsbAutoGrowHeight.clear();
+ SvxTabPage::dispose();
+}
+
void SvxPositionSizeTabPage::Construct()
{
// get range and work area
@@ -972,9 +1024,9 @@ void SvxPositionSizeTabPage::Reset( const SfxItemSet* )
-SfxTabPage* SvxPositionSizeTabPage::Create( vcl::Window* pWindow, const SfxItemSet* rOutAttrs )
+VclPtr<SfxTabPage> SvxPositionSizeTabPage::Create( vcl::Window* pWindow, const SfxItemSet* rOutAttrs )
{
- return new SvxPositionSizeTabPage( pWindow, *rOutAttrs );
+ return VclPtr<SvxPositionSizeTabPage>::Create( pWindow, *rOutAttrs );
}
diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx
index a0bb7289ca28..5062648b9e3f 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -1505,6 +1505,7 @@ void SAL_CALL ODatabaseDocument::close( sal_Bool _bDeliverOwnership ) throw (Clo
// SYNCHRONIZED ->
{
DocumentGuard aGuard(*this, DocumentGuard::DefaultMethod);
+ assert (!m_bClosing);
m_bClosing = true;
}
// <- SYNCHRONIZED
diff --git a/dbaccess/source/ext/macromigration/macromigrationdialog.cxx b/dbaccess/source/ext/macromigration/macromigrationdialog.cxx
index c643e8042942..b778fd68587e 100644
--- a/dbaccess/source/ext/macromigration/macromigrationdialog.cxx
+++ b/dbaccess/source/ext/macromigration/macromigrationdialog.cxx
@@ -406,8 +406,8 @@ namespace dbmm
// check that the backup location isn't the same as the document itself
if ( lcl_equalURLs_nothrow( m_pData->aContext, sBackupLocation, m_pData->xDocumentModel->getURL() ) )
{
- MessageDialog aErrorBox( const_cast< MacroMigrationDialog* >( this ), MacroMigrationResId( STR_INVALID_BACKUP_LOCATION ) );
- aErrorBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrorBox( const_cast< MacroMigrationDialog* >( this ), MacroMigrationResId( STR_INVALID_BACKUP_LOCATION ) );
+ aErrorBox->Execute();
rBackupPage.grabLocationFocus();
return false;
}
diff --git a/dbaccess/source/ext/macromigration/macromigrationpages.cxx b/dbaccess/source/ext/macromigration/macromigrationpages.cxx
index c4ccd03e6353..c97494f41fda 100644
--- a/dbaccess/source/ext/macromigration/macromigrationpages.cxx
+++ b/dbaccess/source/ext/macromigration/macromigrationpages.cxx
@@ -67,14 +67,25 @@ namespace dbmm
get(m_pCloseDocError, "closedocerror");
}
+ PreparationPage::~PreparationPage()
+ {
+ disposeOnce();
+ }
+
+ void PreparationPage::dispose()
+ {
+ m_pCloseDocError.clear();
+ MacroMigrationPage::dispose();
+ }
+
void PreparationPage::showCloseDocsError( bool _bShow )
{
m_pCloseDocError->Show( _bShow );
}
- TabPage* PreparationPage::Create( ::svt::RoadmapWizard& _rParentDialog )
+ VclPtr<TabPage> PreparationPage::Create( ::svt::RoadmapWizard& _rParentDialog )
{
- return new PreparationPage(&_rParentDialog);
+ return VclPtr<PreparationPage>::Create(&_rParentDialog);
}
// SaveDBDocPage
@@ -95,7 +106,16 @@ namespace dbmm
SaveDBDocPage::~SaveDBDocPage()
{
+ disposeOnce();
+ }
+
+ void SaveDBDocPage::dispose()
+ {
delete m_pLocationController;
+ m_pSaveAsLocation.clear();
+ m_pBrowseSaveAsLocation.clear();
+ m_pStartMigration.clear();
+ MacroMigrationPage::dispose();
}
void SaveDBDocPage::impl_updateLocationDependentItems()
@@ -156,9 +176,9 @@ namespace dbmm
return true;
}
- TabPage* SaveDBDocPage::Create( ::svt::RoadmapWizard& _rParentDialog )
+ VclPtr<TabPage> SaveDBDocPage::Create( ::svt::RoadmapWizard& _rParentDialog )
{
- return new SaveDBDocPage( dynamic_cast< MacroMigrationDialog& >( _rParentDialog ) );
+ return VclPtr<SaveDBDocPage>::Create( dynamic_cast< MacroMigrationDialog& >( _rParentDialog ) );
}
// ProgressPage
@@ -174,9 +194,24 @@ namespace dbmm
get(m_pMigrationDone, "done");
}
- TabPage* ProgressPage::Create(::svt::RoadmapWizard& _rParentDialog)
+ ProgressPage::~ProgressPage()
{
- return new ProgressPage(&_rParentDialog);
+ disposeOnce();
+ }
+
+ void ProgressPage::dispose()
+ {
+ m_pObjectCount.clear();
+ m_pCurrentObject.clear();
+ m_pCurrentAction.clear();
+ m_pAllProgressText.clear();
+ m_pMigrationDone.clear();
+ MacroMigrationPage::dispose();
+ }
+
+ VclPtr<TabPage> ProgressPage::Create(::svt::RoadmapWizard& _rParentDialog)
+ {
+ return VclPtr<ProgressPage>::Create(&_rParentDialog);
}
void ProgressPage::setDocumentCounts( const sal_Int32 _nForms, const sal_Int32 _nReports )
@@ -256,9 +291,22 @@ namespace dbmm
get(m_pFailureLabel, "failure");
}
- TabPage* ResultPage::Create(::svt::RoadmapWizard& _rParentDialog)
+ ResultPage::~ResultPage()
+ {
+ disposeOnce();
+ }
+
+ void ResultPage::dispose()
+ {
+ m_pSuccessLabel.clear();
+ m_pFailureLabel.clear();
+ m_pChanges.clear();
+ MacroMigrationPage::dispose();
+ }
+
+ VclPtr<TabPage> ResultPage::Create(::svt::RoadmapWizard& _rParentDialog)
{
- return new ResultPage(&_rParentDialog);
+ return VclPtr<ResultPage>::Create(&_rParentDialog);
}
void ResultPage::displayMigrationLog(const bool _bSuccessful, const OUString& _rSummary)
diff --git a/dbaccess/source/ext/macromigration/macromigrationpages.hxx b/dbaccess/source/ext/macromigration/macromigrationpages.hxx
index fc6ffc934521..70a70826783f 100644
--- a/dbaccess/source/ext/macromigration/macromigrationpages.hxx
+++ b/dbaccess/source/ext/macromigration/macromigrationpages.hxx
@@ -57,14 +57,16 @@ namespace dbmm
{
public:
PreparationPage(vcl::Window *pParent);
+ virtual ~PreparationPage();
+ virtual void dispose() SAL_OVERRIDE;
- static TabPage* Create( ::svt::RoadmapWizard& _rParentDialog );
+ static VclPtr<TabPage> Create( ::svt::RoadmapWizard& _rParentDialog );
public:
void showCloseDocsError(bool _bShow);
protected:
- FixedText* m_pCloseDocError;
+ VclPtr<FixedText> m_pCloseDocError;
};
// SaveDBDocPage
@@ -73,16 +75,17 @@ namespace dbmm
public:
SaveDBDocPage(MacroMigrationDialog& _rParentDialog);
virtual ~SaveDBDocPage();
- static TabPage* Create( ::svt::RoadmapWizard& _rParentDialog );
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<TabPage> Create( ::svt::RoadmapWizard& _rParentDialog );
public:
OUString getBackupLocation() const { return m_pLocationController->getURL(); }
void grabLocationFocus() { m_pSaveAsLocation->GrabFocus(); }
protected:
- ::svt::OFileURLControl* m_pSaveAsLocation;
- PushButton* m_pBrowseSaveAsLocation;
- FixedText* m_pStartMigration;
+ VclPtr<::svt::OFileURLControl> m_pSaveAsLocation;
+ VclPtr<PushButton> m_pBrowseSaveAsLocation;
+ VclPtr<FixedText> m_pStartMigration;
::svx::DatabaseLocationInputController* m_pLocationController;
protected:
@@ -101,8 +104,10 @@ namespace dbmm
{
public:
ProgressPage(vcl::Window *pParent);
+ virtual ~ProgressPage();
+ virtual void dispose() SAL_OVERRIDE;
- static TabPage* Create( ::svt::RoadmapWizard& _rParentDialog );
+ static VclPtr<TabPage> Create( ::svt::RoadmapWizard& _rParentDialog );
void setDocumentCounts( const sal_Int32 _nForms, const sal_Int32 _nReports );
void onFinishedSuccessfully();
@@ -118,13 +123,13 @@ namespace dbmm
virtual void setOverallProgressValue( const sal_uInt32 _nValue ) SAL_OVERRIDE;
private:
- FixedText* m_pObjectCount;
- FixedText* m_pCurrentObject;
- FixedText* m_pCurrentAction;
- RangeProgressBar m_aCurrentProgress;
- FixedText* m_pAllProgressText;
- RangeProgressBar m_aAllProgress;
- FixedText* m_pMigrationDone;
+ VclPtr<FixedText> m_pObjectCount;
+ VclPtr<FixedText> m_pCurrentObject;
+ VclPtr<FixedText> m_pCurrentAction;
+ RangeProgressBar m_aCurrentProgress;
+ VclPtr<FixedText> m_pAllProgressText;
+ RangeProgressBar m_aAllProgress;
+ VclPtr<FixedText> m_pMigrationDone;
};
// ResultPage
@@ -132,15 +137,17 @@ namespace dbmm
{
public:
ResultPage(vcl::Window *pParent);
+ virtual ~ResultPage();
+ virtual void dispose() SAL_OVERRIDE;
- static TabPage* Create( ::svt::RoadmapWizard& _rParentDialog );
+ static VclPtr<TabPage> Create( ::svt::RoadmapWizard& _rParentDialog );
void displayMigrationLog( const bool _bSuccessful, const OUString& _rLog );
private:
- FixedText* m_pSuccessLabel;
- FixedText* m_pFailureLabel;
- VclMultiLineEdit* m_pChanges;
+ VclPtr<FixedText> m_pSuccessLabel;
+ VclPtr<FixedText> m_pFailureLabel;
+ VclPtr<VclMultiLineEdit> m_pChanges;
};
} // namespace dbmm
diff --git a/dbaccess/source/ext/macromigration/macromigrationwizard.cxx b/dbaccess/source/ext/macromigration/macromigrationwizard.cxx
index 5966a9b27e3c..740a337aeca8 100644
--- a/dbaccess/source/ext/macromigration/macromigrationwizard.cxx
+++ b/dbaccess/source/ext/macromigration/macromigrationwizard.cxx
@@ -88,7 +88,7 @@ namespace dbmm
virtual ~MacroMigrationDialogService();
protected:
- virtual Dialog* createDialog( vcl::Window* _pParent ) SAL_OVERRIDE;
+ virtual VclPtr<Dialog> createDialog( vcl::Window* _pParent ) SAL_OVERRIDE;
virtual void destroyDialog() SAL_OVERRIDE;
private:
@@ -121,9 +121,9 @@ namespace dbmm
return *(new MacroMigrationDialogService( _rxContext ) );
}
- Dialog* MacroMigrationDialogService::createDialog( vcl::Window* _pParent )
+ VclPtr<Dialog> MacroMigrationDialogService::createDialog( vcl::Window* _pParent )
{
- return new MacroMigrationDialog( _pParent, m_aContext, m_xDocument );
+ return VclPtr<MacroMigrationDialog>::Create( _pParent, m_aContext, m_xDocument );
}
void MacroMigrationDialogService::destroyDialog()
diff --git a/dbaccess/source/ext/macromigration/rangeprogressbar.hxx b/dbaccess/source/ext/macromigration/rangeprogressbar.hxx
index 0dde133e7f10..7b5a1a0e1282 100644
--- a/dbaccess/source/ext/macromigration/rangeprogressbar.hxx
+++ b/dbaccess/source/ext/macromigration/rangeprogressbar.hxx
@@ -65,7 +65,7 @@ namespace dbmm
}
private:
- ProgressBar *m_pBar;
+ VclPtr<ProgressBar> m_pBar;
sal_uInt32 m_nRange;
};
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index 1cbbf0e24897..8836a5dc0dce 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -309,9 +309,7 @@ OApplicationController::~OApplicationController()
osl_atomic_increment( &m_refCount );
dispose();
}
- ::std::unique_ptr< vcl::Window> aTemp( getView() );
clearView();
-
}
IMPLEMENT_FORWARD_XTYPEPROVIDER2(OApplicationController,OApplicationController_CBASE,OApplicationController_Base)
@@ -427,7 +425,7 @@ void SAL_CALL OApplicationController::disposing()
bool OApplicationController::Construct(vcl::Window* _pParent)
{
- setView( * new OApplicationView( _pParent, getORB(), *this, m_ePreviewMode ) );
+ setView( VclPtr<OApplicationView>::Create( _pParent, getORB(), *this, m_ePreviewMode ) );
getView()->SetUniqueId(UID_APP_VIEW);
// late construction
@@ -447,7 +445,6 @@ bool OApplicationController::Construct(vcl::Window* _pParent)
if ( !bSuccess )
{
- ::std::unique_ptr< vcl::Window> aTemp( getView() );
clearView();
return false;
}
@@ -2048,7 +2045,7 @@ void OApplicationController::renameEntry()
if ( xContainer.is() )
{
::std::unique_ptr< IObjectNameCheck > pNameChecker;
- ::std::unique_ptr< OSaveAsDlg > aDialog;
+ VclPtr< OSaveAsDlg > aDialog;
Reference<XRename> xRename;
const ElementType eType = getContainer()->getElementType();
@@ -2081,7 +2078,8 @@ void OApplicationController::renameEntry()
}
}
pNameChecker.reset( new HierarchicalNameCheck( xHNames.get(), OUString() ) );
- aDialog.reset( new OSaveAsDlg(
+ aDialog.reset( VclPtr<OSaveAsDlg>::Create(
+
getView(), getORB(), sName, sLabel, *pNameChecker, SAD_TITLE_RENAME ) );
}
}
@@ -2100,7 +2098,8 @@ void OApplicationController::renameEntry()
ensureConnection();
pNameChecker.reset( new DynamicTableOrQueryNameCheck( getConnection(), nCommandType ) );
- aDialog.reset( new OSaveAsDlg(
+ aDialog.reset( VclPtr<OSaveAsDlg>::Create(
+
getView(), nCommandType, getORB(), getConnection(),
*aList.begin(), *pNameChecker, SAD_TITLE_RENAME ) );
}
diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx
index 4f4da2f070d0..f18b2d010b85 100644
--- a/dbaccess/source/ui/app/AppControllerDnD.cxx
+++ b/dbaccess/source/ui/app/AppControllerDnD.cxx
@@ -175,8 +175,8 @@ void OApplicationController::deleteTables(const ::std::vector< OUString>& _rList
else
{
OUString sMessage(ModuleRes(STR_MISSING_TABLES_XDROP));
- MessageDialog aError(getView(), sMessage);
- aError.Execute();
+ ScopedVclPtrInstance< MessageDialog > aError(getView(), sMessage);
+ aError->Execute();
}
}
}
@@ -210,19 +210,19 @@ void OApplicationController::deleteObjects( ElementType _eType, const ::std::vec
if ( eResult != svtools::QUERYDELETE_ALL )
{
- svtools::QueryDeleteDlg_Impl aDlg( getView(), *aThisRound );
+ ScopedVclPtrInstance< svtools::QueryDeleteDlg_Impl > aDlg(getView(), *aThisRound);
if ( !sDialogPosition.isEmpty() )
- aDlg.SetWindowState( sDialogPosition );
+ aDlg->SetWindowState( sDialogPosition );
if ( nObjectsLeft > 1 )
- aDlg.EnableAllButton();
+ aDlg->EnableAllButton();
- eResult = aDlg.Execute();
+ eResult = aDlg->Execute();
if (eResult == svtools::QUERYDELETE_CANCEL)
return;
- sDialogPosition = aDlg.GetWindowState( );
+ sDialogPosition = aDlg->GetWindowState( );
}
bool bSuccess = false;
@@ -686,17 +686,18 @@ bool OApplicationController::paste( ElementType _eType, const ::svx::ODataAccess
has a /table/ with that name) */
if ( bNeedAskForName )
{
- OSaveAsDlg aAskForName( getView(),
+ ScopedVclPtrInstance<OSaveAsDlg> aAskForName(
+ getView(),
CommandType::QUERY,
getORB(),
getConnection(),
sTargetName,
aNameChecker,
- SAD_ADDITIONAL_DESCRIPTION | SAD_TITLE_PASTE_AS);
- if ( RET_OK != aAskForName.Execute() )
+ SAD_ADDITIONAL_DESCRIPTION | SAD_TITLE_PASTE_AS );
+ if ( RET_OK != aAskForName->Execute() )
// cancelled by the user
return false;
- sTargetName = aAskForName.getName();
+ sTargetName = aAskForName->getName();
}
// create a new object
diff --git a/dbaccess/source/ui/app/AppControllerGen.cxx b/dbaccess/source/ui/app/AppControllerGen.cxx
index 3eda31592a78..e9424506727a 100644
--- a/dbaccess/source/ui/app/AppControllerGen.cxx
+++ b/dbaccess/source/ui/app/AppControllerGen.cxx
@@ -111,12 +111,12 @@ void OApplicationController::convertToView(const OUString& _sName)
OUString aDefaultName = ::dbaui::createDefaultName(xMeta,xTables,aName);
DynamicTableOrQueryNameCheck aNameChecker( xConnection, CommandType::TABLE );
- OSaveAsDlg aDlg( getView(), CommandType::TABLE, getORB(), xConnection, aDefaultName, aNameChecker );
- if ( aDlg.Execute() == RET_OK )
+ ScopedVclPtrInstance< OSaveAsDlg > aDlg( getView(), CommandType::TABLE, getORB(), xConnection, aDefaultName, aNameChecker );
+ if ( aDlg->Execute() == RET_OK )
{
- OUString sName = aDlg.getName();
- OUString sCatalog = aDlg.getCatalog();
- OUString sSchema = aDlg.getSchema();
+ OUString sName = aDlg->getName();
+ OUString sCatalog = aDlg->getCatalog();
+ OUString sSchema = aDlg->getSchema();
OUString sNewName(
::dbtools::composeTableName( xMeta, sCatalog, sSchema, sName, false, ::dbtools::eInTableDefinitions ) );
Reference<XPropertySet> xView = ::dbaui::createView(sNewName,xConnection,xSourceObject);
@@ -534,8 +534,8 @@ void OApplicationController::askToReconnect()
bool bClear = true;
if ( !m_pSubComponentManager->empty() )
{
- MessageDialog aQry(getView(), ModuleRes(STR_QUERY_CLOSEDOCUMENTS), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
- switch (aQry.Execute())
+ ScopedVclPtrInstance< MessageDialog > aQry(getView(), ModuleRes(STR_QUERY_CLOSEDOCUMENTS), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ switch (aQry->Execute())
{
case RET_YES:
closeSubComponents();
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index f01c26bcf9ef..6907968e1fa2 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -188,34 +188,33 @@ namespace
// class OAppDetailPageHelper
OAppDetailPageHelper::OAppDetailPageHelper(vcl::Window* _pParent,OAppBorderWindow& _rBorderWin,PreviewMode _ePreviewMode) : Window(_pParent,WB_DIALOGCONTROL)
,m_rBorderWin(_rBorderWin)
- ,m_aFL(this,WB_VERT)
- ,m_aTBPreview(this,WB_TABSTOP )
- ,m_aBorder(this,WB_BORDER | WB_READONLY)
- ,m_aPreview(&m_aBorder)
- ,m_aDocumentInfo(&m_aBorder,WB_LEFT | WB_VSCROLL | WB_READONLY )
- ,m_pTablePreview(NULL)
+ ,m_aFL(VclPtr<FixedLine>::Create(this,WB_VERT))
+ ,m_aTBPreview(VclPtr<ToolBox>::Create(this,WB_TABSTOP) )
+ ,m_aBorder(VclPtr<Window>::Create(this,WB_BORDER | WB_READONLY))
+ ,m_aPreview(VclPtr<OPreviewWindow>::Create(m_aBorder.get()))
+ ,m_aDocumentInfo(new ::svtools::ODocumentInfoPreview(m_aBorder.get(), WB_LEFT | WB_VSCROLL | WB_READONLY) )
,m_ePreviewMode(_ePreviewMode)
{
- m_aBorder.SetBorderStyle(WindowBorderStyle::MONO);
+ m_aBorder->SetBorderStyle(WindowBorderStyle::MONO);
m_aMenu.reset(new PopupMenu( ModuleRes( RID_MENU_APP_PREVIEW ) ));
- m_aTBPreview.SetOutStyle(TOOLBOX_STYLE_FLAT);
- m_aTBPreview.InsertItem(SID_DB_APP_DISABLE_PREVIEW,m_aMenu->GetItemText(SID_DB_APP_DISABLE_PREVIEW),ToolBoxItemBits::LEFT|ToolBoxItemBits::DROPDOWN|ToolBoxItemBits::AUTOSIZE|ToolBoxItemBits::RADIOCHECK);
- m_aTBPreview.SetHelpId(HID_APP_VIEW_PREVIEW_CB);
- m_aTBPreview.SetDropdownClickHdl( LINK( this, OAppDetailPageHelper, OnDropdownClickHdl ) );
- m_aTBPreview.EnableMenuStrings();
- m_aTBPreview.Enable(true);
+ m_aTBPreview->SetOutStyle(TOOLBOX_STYLE_FLAT);
+ m_aTBPreview->InsertItem(SID_DB_APP_DISABLE_PREVIEW,m_aMenu->GetItemText(SID_DB_APP_DISABLE_PREVIEW),ToolBoxItemBits::LEFT|ToolBoxItemBits::DROPDOWN|ToolBoxItemBits::AUTOSIZE|ToolBoxItemBits::RADIOCHECK);
+ m_aTBPreview->SetHelpId(HID_APP_VIEW_PREVIEW_CB);
+ m_aTBPreview->SetDropdownClickHdl( LINK( this, OAppDetailPageHelper, OnDropdownClickHdl ) );
+ m_aTBPreview->EnableMenuStrings();
+ m_aTBPreview->Enable(true);
- m_aBorder.SetUniqueId(UID_APP_VIEW_PREVIEW_1);
+ m_aBorder->SetUniqueId(UID_APP_VIEW_PREVIEW_1);
- m_aPreview.SetHelpId(HID_APP_VIEW_PREVIEW_1);
+ m_aPreview->SetHelpId(HID_APP_VIEW_PREVIEW_1);
- m_pTablePreview = new OTablePreviewWindow(&m_aBorder,WB_READONLY | WB_DIALOGCONTROL );
+ m_pTablePreview.set( VclPtr<OTablePreviewWindow>::Create(m_aBorder.get(), WB_READONLY | WB_DIALOGCONTROL ) );
m_pTablePreview->SetHelpId(HID_APP_VIEW_PREVIEW_2);
- m_aDocumentInfo.SetHelpId(HID_APP_VIEW_PREVIEW_3);
+ m_aDocumentInfo->SetHelpId(HID_APP_VIEW_PREVIEW_3);
m_xWindow = VCLUnoHelper::GetInterface( m_pTablePreview );
@@ -227,6 +226,11 @@ OAppDetailPageHelper::OAppDetailPageHelper(vcl::Window* _pParent,OAppBorderWindo
OAppDetailPageHelper::~OAppDetailPageHelper()
{
+ disposeOnce();
+}
+
+void OAppDetailPageHelper::dispose()
+{
try
{
Reference< ::util::XCloseable> xCloseable(m_xFrame,UNO_QUERY);
@@ -244,13 +248,19 @@ OAppDetailPageHelper::~OAppDetailPageHelper()
{
m_pLists[i]->clearCurrentSelection();
m_pLists[i]->Hide();
- boost::scoped_ptr<DBTreeListBox> aTemp(m_pLists[i]);
m_pLists[i]->clearCurrentSelection(); // why a second time?
- m_pLists[i] = NULL;
+ m_pLists[i].disposeAndClear();
}
-
}
-
+ m_aMenu.reset();
+ m_pTablePreview.disposeAndClear();
+ m_aDocumentInfo.disposeAndClear();
+ m_aPreview.disposeAndClear();
+ m_aBorder.disposeAndClear();
+ m_aTBPreview.disposeAndClear();
+ m_aFL.disposeAndClear();
+
+ vcl::Window::dispose();
}
int OAppDetailPageHelper::getVisibleControlIndex() const
@@ -358,7 +368,7 @@ void OAppDetailPageHelper::describeCurrentSelectionForControl( const Control& _r
void OAppDetailPageHelper::describeCurrentSelectionForType( const ElementType _eType, Sequence< NamedDatabaseObject >& _out_rSelectedObjects )
{
OSL_ENSURE( _eType < E_ELEMENT_TYPE_COUNT, "OAppDetailPageHelper::describeCurrentSelectionForType: invalid type!" );
- DBTreeListBox* pList = ( _eType < E_ELEMENT_TYPE_COUNT ) ? m_pLists[ _eType ] : NULL;
+ DBTreeListBox* pList = ( _eType < E_ELEMENT_TYPE_COUNT ) ? m_pLists[ _eType ].get() : NULL;
OSL_ENSURE( pList, "OAppDetailPageHelper::describeCurrentSelectionForType: "
"You really should ensure this type has already been viewed before!" );
if ( !pList )
@@ -560,7 +570,7 @@ void OAppDetailPageHelper::createTablesPage(const Reference< XConnection>& _xCon
if ( !m_pLists[E_TABLE] )
{
- OTableTreeListBox* pTreeView = new OTableTreeListBox(this,
+ VclPtrInstance<OTableTreeListBox> pTreeView(this,
WB_HASLINES | WB_SORT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT | WB_TABSTOP);
pTreeView->SetHelpId(HID_APP_TABLE_TREE);
m_pLists[E_TABLE] = pTreeView;
@@ -571,11 +581,11 @@ void OAppDetailPageHelper::createTablesPage(const Reference< XConnection>& _xCon
);
pTreeView->notifyHiContrastChanged();
- m_aBorder.SetZOrder(pTreeView, WINDOW_ZORDER_BEHIND);
+ m_aBorder->SetZOrder(pTreeView, WINDOW_ZORDER_BEHIND);
}
if ( !m_pLists[E_TABLE]->GetEntryCount() )
{
- static_cast<OTableTreeListBox*>(m_pLists[E_TABLE])->UpdateTableList(_xConnection);
+ static_cast<OTableTreeListBox*>(m_pLists[E_TABLE].get())->UpdateTableList(_xConnection);
SvTreeListEntry* pEntry = m_pLists[E_TABLE]->First();
if ( pEntry )
@@ -657,13 +667,13 @@ void OAppDetailPageHelper::setDetailPage(vcl::Window* _pWindow)
showPreview(NULL);
bool bHasFocus = false;
- m_aFL.Show();
+ m_aFL->Show();
{
bHasFocus = pCurrent != 0 && pCurrent->HasChildPathFocus();
_pWindow->Show();
}
- m_aTBPreview.Show();
- m_aBorder.Show();
+ m_aTBPreview->Show();
+ m_aBorder->Show();
switchPreview(m_ePreviewMode,true);
if ( bHasFocus )
@@ -727,7 +737,7 @@ void OAppDetailPageHelper::fillNames( const Reference< XNameAccess >& _xContaine
DBTreeListBox* OAppDetailPageHelper::createSimpleTree( const OString& _sHelpId, const Image& _rImage)
{
- DBTreeListBox* pTreeView = new DBTreeListBox(this,
+ VclPtrInstance<DBTreeListBox> pTreeView(this,
WB_HASLINES | WB_SORT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT | WB_TABSTOP);
pTreeView->SetHelpId( _sHelpId );
return createTree( pTreeView, _rImage );
@@ -947,17 +957,17 @@ void OAppDetailPageHelper::Resize()
pWindow->SetPosSizePixel( Point(0, 0), Size(nHalfOutputWidth - n6PPT, nOutputHeight) );
- m_aFL.SetPosSizePixel( Point(nHalfOutputWidth , 0 ), Size(aFLSize.Width(), nOutputHeight ) );
+ m_aFL->SetPosSizePixel( Point(nHalfOutputWidth , 0 ), Size(aFLSize.Width(), nOutputHeight ) );
- Size aTBSize = m_aTBPreview.CalcWindowSizePixel();
- m_aTBPreview.SetPosSizePixel(Point(nOutputWidth - aTBSize.getWidth(), 0 ),
+ Size aTBSize = m_aTBPreview->CalcWindowSizePixel();
+ m_aTBPreview->SetPosSizePixel(Point(nOutputWidth - aTBSize.getWidth(), 0 ),
aTBSize );
- m_aBorder.SetPosSizePixel(Point(nHalfOutputWidth + aFLSize.Width() + n6PPT, aTBSize.getHeight() + n6PPT ),
+ m_aBorder->SetPosSizePixel(Point(nHalfOutputWidth + aFLSize.Width() + n6PPT, aTBSize.getHeight() + n6PPT ),
Size(nHalfOutputWidth - aFLSize.Width() - n6PPT, nOutputHeight - 2*n6PPT - aTBSize.getHeight()) );
- m_aPreview.SetPosSizePixel(Point(0,0),m_aBorder.GetSizePixel() );
- m_aDocumentInfo.SetPosSizePixel(Point(0,0),m_aBorder.GetSizePixel() );
- m_pTablePreview->SetPosSizePixel(Point(0,0),m_aBorder.GetSizePixel() );
+ m_aPreview->SetPosSizePixel(Point(0,0),m_aBorder->GetSizePixel() );
+ m_aDocumentInfo->SetPosSizePixel(Point(0,0),m_aBorder->GetSizePixel() );
+ m_pTablePreview->SetPosSizePixel(Point(0,0),m_aBorder->GetSizePixel() );
}
}
@@ -993,7 +1003,7 @@ void OAppDetailPageHelper::switchPreview(PreviewMode _eMode,bool _bForce)
}
m_aMenu->CheckItem(nSelectedAction);
- m_aTBPreview.SetItemText(SID_DB_APP_DISABLE_PREVIEW, m_aMenu->GetItemText(nSelectedAction));
+ m_aTBPreview->SetItemText(SID_DB_APP_DISABLE_PREVIEW, m_aMenu->GetItemText(nSelectedAction));
Resize();
// simulate a selectionChanged event at the controller, to force the preview to be updated
@@ -1007,8 +1017,8 @@ void OAppDetailPageHelper::switchPreview(PreviewMode _eMode,bool _bForce)
else
{
m_pTablePreview->Hide();
- m_aPreview.Hide();
- m_aDocumentInfo.Hide();
+ m_aPreview->Hide();
+ m_aDocumentInfo->Hide();
}
}
}
@@ -1034,8 +1044,8 @@ void OAppDetailPageHelper::showPreview(const Reference< XContent >& _xContent)
Any aPreview = xContent->execute(aCommand,xContent->createCommandIdentifier(),Reference< XCommandEnvironment >());
if ( m_ePreviewMode == E_DOCUMENT )
{
- m_aDocumentInfo.Hide();
- m_aPreview.Show();
+ m_aDocumentInfo->Hide();
+ m_aPreview->Show();
Graphic aGraphic;
Sequence < sal_Int8 > aBmpSequence;
@@ -1047,24 +1057,24 @@ void OAppDetailPageHelper::showPreview(const Reference< XContent >& _xContent)
GraphicConverter::Import(aData,aGraphic);
}
- m_aPreview.setGraphic( aGraphic );
- m_aPreview.Invalidate();
+ m_aPreview->setGraphic( aGraphic );
+ m_aPreview->Invalidate();
}
else
{
- m_aPreview.Hide();
- m_aDocumentInfo.clear();
- m_aDocumentInfo.Show();
+ m_aPreview->Hide();
+ m_aDocumentInfo->clear();
+ m_aDocumentInfo->Show();
Reference<document::XDocumentProperties> xProp(
aPreview, UNO_QUERY);
if ( xProp.is() )
- m_aDocumentInfo.fill(xProp,OUString());
+ m_aDocumentInfo->fill(xProp,OUString());
}
}
else
{
- m_aPreview.Hide();
- m_aDocumentInfo.Hide();
+ m_aPreview->Hide();
+ m_aDocumentInfo->Hide();
}
}
catch( const Exception& )
@@ -1081,8 +1091,8 @@ void OAppDetailPageHelper::showPreview( const OUString& _sDataSourceName,
if ( isPreviewEnabled() )
{
WaitObject aWaitCursor( this );
- m_aPreview.Hide();
- m_aDocumentInfo.Hide();
+ m_aPreview->Hide();
+ m_aDocumentInfo->Hide();
m_pTablePreview->Show();
if ( !m_xFrame.is() )
{
@@ -1142,17 +1152,17 @@ void OAppDetailPageHelper::showPreview( const OUString& _sDataSourceName,
IMPL_LINK(OAppDetailPageHelper, OnDropdownClickHdl, ToolBox*, /*pToolBox*/)
{
- m_aTBPreview.EndSelection();
+ m_aTBPreview->EndSelection();
// tell the toolbox that the item is pressed down
- m_aTBPreview.SetItemDown( SID_DB_APP_DISABLE_PREVIEW, true );
+ m_aTBPreview->SetItemDown( SID_DB_APP_DISABLE_PREVIEW, true );
// simulate a mouse move (so the "down" state is really painted)
- Point aPoint = m_aTBPreview.GetItemRect( SID_DB_APP_DISABLE_PREVIEW ).TopLeft();
+ Point aPoint = m_aTBPreview->GetItemRect( SID_DB_APP_DISABLE_PREVIEW ).TopLeft();
MouseEvent aMove( aPoint, 0, MouseEventModifiers::SIMPLEMOVE | MouseEventModifiers::SYNTHETIC );
- m_aTBPreview.MouseMove( aMove );
+ m_aTBPreview->MouseMove( aMove );
- m_aTBPreview.Update();
+ m_aTBPreview->Update();
// execute the menu
boost::scoped_ptr<PopupMenu> aMenu(new PopupMenu( ModuleRes( RID_MENU_APP_PREVIEW ) ));
@@ -1171,14 +1181,14 @@ IMPL_LINK(OAppDetailPageHelper, OnDropdownClickHdl, ToolBox*, /*pToolBox*/)
// no disabled entries
aMenu->RemoveDisabledEntries();
- sal_uInt16 nSelectedAction = aMenu->Execute(&m_aTBPreview, m_aTBPreview.GetItemRect( SID_DB_APP_DISABLE_PREVIEW ));
+ sal_uInt16 nSelectedAction = aMenu->Execute(m_aTBPreview.get(), m_aTBPreview->GetItemRect( SID_DB_APP_DISABLE_PREVIEW ));
// "cleanup" the toolbox state
MouseEvent aLeave( aPoint, 0, MouseEventModifiers::LEAVEWINDOW | MouseEventModifiers::SYNTHETIC );
- m_aTBPreview.MouseMove( aLeave );
- m_aTBPreview.SetItemDown( SID_DB_APP_DISABLE_PREVIEW, false);
+ m_aTBPreview->MouseMove( aLeave );
+ m_aTBPreview->SetItemDown( SID_DB_APP_DISABLE_PREVIEW, false);
if ( nSelectedAction )
{
- m_aTBPreview.SetItemText(SID_DB_APP_DISABLE_PREVIEW, aMenu->GetItemText(nSelectedAction));
+ m_aTBPreview->SetItemText(SID_DB_APP_DISABLE_PREVIEW, aMenu->GetItemText(nSelectedAction));
Resize();
getBorderWin().getView()->getAppController().executeChecked(nSelectedAction,Sequence<PropertyValue>());
}
@@ -1215,7 +1225,7 @@ void OAppDetailPageHelper::DataChanged( const DataChangedEvent& rDCEvt )
ImplInitSettings();
if ( m_pLists[ E_TABLE ] )
{
- OTableTreeListBox* pTableTree = dynamic_cast< OTableTreeListBox* >( m_pLists[ E_TABLE ] );
+ OTableTreeListBox* pTableTree = dynamic_cast< OTableTreeListBox* >( m_pLists[ E_TABLE ].get() );
OSL_ENSURE( pTableTree != NULL, "OAppDetailPageHelper::DataChanged: a tree list for tables which is no TableTreeList?" );
if ( pTableTree )
pTableTree->notifyHiContrastChanged();
@@ -1230,19 +1240,19 @@ void OAppDetailPageHelper::ImplInitSettings()
aFont = rStyleSettings.GetFieldFont();
aFont.SetColor( rStyleSettings.GetWindowTextColor() );
SetPointFont( aFont );
- m_aTBPreview.SetPointFont( aFont );
+ m_aTBPreview->SetPointFont( aFont );
SetTextColor( rStyleSettings.GetFieldTextColor() );
SetTextFillColor();
- m_aBorder.SetTextColor( rStyleSettings.GetFieldTextColor() );
- m_aBorder.SetTextFillColor();
- m_aTBPreview.SetTextColor( rStyleSettings.GetFieldTextColor() );
- m_aTBPreview.SetTextFillColor();
+ m_aBorder->SetTextColor( rStyleSettings.GetFieldTextColor() );
+ m_aBorder->SetTextFillColor();
+ m_aTBPreview->SetTextColor( rStyleSettings.GetFieldTextColor() );
+ m_aTBPreview->SetTextFillColor();
SetBackground( rStyleSettings.GetFieldColor() );
- m_aBorder.SetBackground( rStyleSettings.GetFieldColor() );
- m_aFL.SetBackground( rStyleSettings.GetFieldColor() );
- m_aDocumentInfo.SetBackground( rStyleSettings.GetFieldColor() );
- m_aTBPreview.SetBackground( rStyleSettings.GetFieldColor() );
+ m_aBorder->SetBackground( rStyleSettings.GetFieldColor() );
+ m_aFL->SetBackground( rStyleSettings.GetFieldColor() );
+ m_aDocumentInfo->SetBackground( rStyleSettings.GetFieldColor() );
+ m_aTBPreview->SetBackground( rStyleSettings.GetFieldColor() );
m_pTablePreview->SetBackground( rStyleSettings.GetFieldColor() );
}
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.hxx b/dbaccess/source/ui/app/AppDetailPageHelper.hxx
index fb86bdd3f050..9240fb94e0b5 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.hxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.hxx
@@ -77,15 +77,15 @@ namespace dbaui
// Combines general functionality.
class OAppDetailPageHelper : public vcl::Window
{
- DBTreeListBox* m_pLists[ELEMENT_COUNT];
+ VclPtr<DBTreeListBox> m_pLists[ELEMENT_COUNT];
OAppBorderWindow& m_rBorderWin;
- FixedLine m_aFL;
- ToolBox m_aTBPreview;
- Window m_aBorder;
- OPreviewWindow m_aPreview;
- ::svtools::ODocumentInfoPreview
- m_aDocumentInfo;
- vcl::Window* m_pTablePreview;
+ VclPtr<FixedLine> m_aFL;
+ VclPtr<ToolBox> m_aTBPreview;
+ VclPtr<Window> m_aBorder;
+ VclPtr<OPreviewWindow> m_aPreview;
+ VclPtr<::svtools::ODocumentInfoPreview>
+ m_aDocumentInfo;
+ VclPtr<vcl::Window> m_pTablePreview;
::std::unique_ptr<PopupMenu> m_aMenu;
PreviewMode m_ePreviewMode;
::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame2 >
@@ -169,6 +169,7 @@ namespace dbaui
public:
OAppDetailPageHelper(vcl::Window* _pParent,OAppBorderWindow& _rBorderWin,PreviewMode _ePreviewMode);
virtual ~OAppDetailPageHelper();
+ virtual void dispose() SAL_OVERRIDE;
// Window overrides
virtual void Resize() SAL_OVERRIDE;
@@ -193,7 +194,7 @@ namespace dbaui
inline DBTreeListBox* getCurrentView() const
{
ElementType eType = getElementType();
- return (eType != E_NONE ) ? m_pLists[static_cast<sal_Int32>(eType)] : NULL;
+ return (eType != E_NONE ) ? m_pLists[static_cast<sal_Int32>(eType)].get() : NULL;
}
/// select all entries in the visible control
diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx
index aebcd5d3d35d..5ef2b69be554 100644
--- a/dbaccess/source/ui/app/AppDetailView.cxx
+++ b/dbaccess/source/ui/app/AppDetailView.cxx
@@ -341,30 +341,41 @@ void OCreationList::KeyInput( const KeyEvent& rKEvt )
OTasksWindow::OTasksWindow(vcl::Window* _pParent,OApplicationDetailView* _pDetailView)
: Window(_pParent,WB_DIALOGCONTROL )
- ,m_aCreation(*this)
- ,m_aDescription(this)
- ,m_aHelpText(this,WB_WORDBREAK)
- ,m_aFL(this,WB_VERT)
+ ,m_aCreation(VclPtr<OCreationList>::Create(*this))
+ ,m_aDescription(VclPtr<FixedText>::Create(this))
+ ,m_aHelpText(VclPtr<FixedText>::Create(this,WB_WORDBREAK))
+ ,m_aFL(VclPtr<FixedLine>::Create(this,WB_VERT))
,m_pDetailView(_pDetailView)
{
SetUniqueId(UID_APP_TASKS_WINDOW);
- m_aCreation.SetHelpId(HID_APP_CREATION_LIST);
- m_aCreation.SetSelectHdl(LINK(this, OTasksWindow, OnEntrySelectHdl));
- m_aHelpText.SetHelpId(HID_APP_HELP_TEXT);
- m_aDescription.SetHelpId(HID_APP_DESCRIPTION_TEXT);
- m_aDescription.SetText(ModuleRes(STR_DESCRIPTION));
+ m_aCreation->SetHelpId(HID_APP_CREATION_LIST);
+ m_aCreation->SetSelectHdl(LINK(this, OTasksWindow, OnEntrySelectHdl));
+ m_aHelpText->SetHelpId(HID_APP_HELP_TEXT);
+ m_aDescription->SetHelpId(HID_APP_DESCRIPTION_TEXT);
+ m_aDescription->SetText(ModuleRes(STR_DESCRIPTION));
ImageProvider aImageProvider;
Image aFolderImage = aImageProvider.getFolderImage( css::sdb::application::DatabaseObject::FORM );
- m_aCreation.SetDefaultCollapsedEntryBmp( aFolderImage );
- m_aCreation.SetDefaultExpandedEntryBmp( aFolderImage );
+ m_aCreation->SetDefaultCollapsedEntryBmp( aFolderImage );
+ m_aCreation->SetDefaultExpandedEntryBmp( aFolderImage );
ImplInitSettings(true,true,true);
}
OTasksWindow::~OTasksWindow()
{
+ disposeOnce();
+}
+
+void OTasksWindow::dispose()
+{
Clear();
+ m_aCreation.disposeAndClear();
+ m_aDescription.disposeAndClear();
+ m_aHelpText.disposeAndClear();
+ m_aFL.disposeAndClear();
+ m_pDetailView.clear();
+ vcl::Window::dispose();
}
void OTasksWindow::DataChanged( const DataChangedEvent& rDCEvt )
@@ -394,23 +405,23 @@ void OTasksWindow::ImplInitSettings( bool bFont, bool bForeground, bool bBackgro
{
SetTextColor( rStyleSettings.GetFieldTextColor() );
SetTextFillColor();
- m_aHelpText.SetTextColor( rStyleSettings.GetFieldTextColor() );
- m_aHelpText.SetTextFillColor();
- m_aDescription.SetTextColor( rStyleSettings.GetFieldTextColor() );
- m_aDescription.SetTextFillColor();
+ m_aHelpText->SetTextColor( rStyleSettings.GetFieldTextColor() );
+ m_aHelpText->SetTextFillColor();
+ m_aDescription->SetTextColor( rStyleSettings.GetFieldTextColor() );
+ m_aDescription->SetTextFillColor();
}
if( bBackground )
{
SetBackground( rStyleSettings.GetFieldColor() );
- m_aHelpText.SetBackground( rStyleSettings.GetFieldColor() );
- m_aDescription.SetBackground( rStyleSettings.GetFieldColor() );
- m_aFL.SetBackground( rStyleSettings.GetFieldColor() );
+ m_aHelpText->SetBackground( rStyleSettings.GetFieldColor() );
+ m_aDescription->SetBackground( rStyleSettings.GetFieldColor() );
+ m_aFL->SetBackground( rStyleSettings.GetFieldColor() );
}
- vcl::Font aFont = m_aDescription.GetControlFont();
+ vcl::Font aFont = m_aDescription->GetControlFont();
aFont.SetWeight(WEIGHT_BOLD);
- m_aDescription.SetControlFont(aFont);
+ m_aDescription->SetControlFont(aFont);
}
void OTasksWindow::setHelpText(sal_uInt16 _nId)
@@ -418,20 +429,20 @@ void OTasksWindow::setHelpText(sal_uInt16 _nId)
if ( _nId )
{
OUString sText = ModuleRes(_nId);
- m_aHelpText.SetText(sText);
+ m_aHelpText->SetText(sText);
}
else
{
- m_aHelpText.SetText(OUString());
+ m_aHelpText->SetText(OUString());
}
}
IMPL_LINK(OTasksWindow, OnEntrySelectHdl, SvTreeListBox*, /*_pTreeBox*/)
{
- SvTreeListEntry* pEntry = m_aCreation.GetHdlEntry();
+ SvTreeListEntry* pEntry = m_aCreation->GetHdlEntry();
if ( pEntry )
- m_aHelpText.SetText( ModuleRes( static_cast< TaskEntry* >( pEntry->GetUserData() )->nHelpID ) );
+ m_aHelpText->SetText( ModuleRes( static_cast< TaskEntry* >( pEntry->GetUserData() )->nHelpID ) );
return 1L;
}
@@ -446,14 +457,14 @@ void OTasksWindow::Resize()
sal_Int32 n6PPT = aFLSize.Height();
long nHalfOutputWidth = static_cast<long>(nOutputWidth * 0.5);
- m_aCreation.SetPosSizePixel( Point(0, 0), Size(nHalfOutputWidth - n6PPT, nOutputHeight) );
+ m_aCreation->SetPosSizePixel( Point(0, 0), Size(nHalfOutputWidth - n6PPT, nOutputHeight) );
// i77897 make the m_aHelpText a little bit smaller. (-5)
sal_Int32 nNewWidth = nOutputWidth - nHalfOutputWidth - aFLSize.Width() - 5;
- m_aDescription.SetPosSizePixel( Point(nHalfOutputWidth + n6PPT, 0), Size(nNewWidth, nOutputHeight) );
- Size aDesc = m_aDescription.CalcMinimumSize();
- m_aHelpText.SetPosSizePixel( Point(nHalfOutputWidth + n6PPT, aDesc.Height() ), Size(nNewWidth, nOutputHeight - aDesc.Height() - n6PPT) );
+ m_aDescription->SetPosSizePixel( Point(nHalfOutputWidth + n6PPT, 0), Size(nNewWidth, nOutputHeight) );
+ Size aDesc = m_aDescription->CalcMinimumSize();
+ m_aHelpText->SetPosSizePixel( Point(nHalfOutputWidth + n6PPT, aDesc.Height() ), Size(nNewWidth, nOutputHeight - aDesc.Height() - n6PPT) );
- m_aFL.SetPosSizePixel( Point(nHalfOutputWidth , 0), Size(aFLSize.Width(), nOutputHeight ) );
+ m_aFL->SetPosSizePixel( Point(nHalfOutputWidth , 0), Size(aFLSize.Width(), nOutputHeight ) );
}
void OTasksWindow::fillTaskEntryList( const TaskEntryList& _rList )
@@ -485,79 +496,88 @@ void OTasksWindow::fillTaskEntryList( const TaskEntryList& _rList )
for ( TaskEntryList::const_iterator pTask = _rList.begin(); pTask != aEnd; ++pTask, ++pImages )
{
- SvTreeListEntry* pEntry = m_aCreation.InsertEntry( pTask->sTitle );
+ SvTreeListEntry* pEntry = m_aCreation->InsertEntry( pTask->sTitle );
pEntry->SetUserData( reinterpret_cast< void* >( new TaskEntry( *pTask ) ) );
Image aImage = Image( *pImages );
- m_aCreation.SetExpandedEntryBmp( pEntry, aImage );
- m_aCreation.SetCollapsedEntryBmp( pEntry, aImage );
+ m_aCreation->SetExpandedEntryBmp( pEntry, aImage );
+ m_aCreation->SetCollapsedEntryBmp( pEntry, aImage );
}
}
catch(Exception&)
{
}
- m_aCreation.Show();
- m_aCreation.SelectAll(false);
- m_aHelpText.Show();
- m_aDescription.Show();
- m_aFL.Show();
- m_aCreation.updateHelpText();
+ m_aCreation->Show();
+ m_aCreation->SelectAll(false);
+ m_aHelpText->Show();
+ m_aDescription->Show();
+ m_aFL->Show();
+ m_aCreation->updateHelpText();
Enable(!_rList.empty());
}
void OTasksWindow::Clear()
{
- m_aCreation.resetLastActive();
- SvTreeListEntry* pEntry = m_aCreation.First();
+ m_aCreation->resetLastActive();
+ SvTreeListEntry* pEntry = m_aCreation->First();
while ( pEntry )
{
delete static_cast< TaskEntry* >( pEntry->GetUserData() );
- pEntry = m_aCreation.Next(pEntry);
+ pEntry = m_aCreation->Next(pEntry);
}
- m_aCreation.Clear();
+ m_aCreation->Clear();
}
// class OApplicationDetailView
OApplicationDetailView::OApplicationDetailView(OAppBorderWindow& _rParent,PreviewMode _ePreviewMode) : OSplitterView(&_rParent,false )
- ,m_aHorzSplitter(this)
- ,m_aTasks(this,STR_TASKS,WB_BORDER | WB_DIALOGCONTROL )
- ,m_aContainer(this,0,WB_BORDER | WB_DIALOGCONTROL )
+ ,m_aHorzSplitter(VclPtr<Splitter>::Create(this))
+ ,m_aTasks(VclPtr<dbaui::OTitleWindow>::Create(this,STR_TASKS,WB_BORDER | WB_DIALOGCONTROL) )
+ ,m_aContainer(VclPtr<dbaui::OTitleWindow>::Create(this,0,WB_BORDER | WB_DIALOGCONTROL) )
,m_rBorderWin(_rParent)
{
SetUniqueId(UID_APP_DETAIL_VIEW);
ImplInitSettings( true, true, true );
- m_pControlHelper = new OAppDetailPageHelper(&m_aContainer,m_rBorderWin,_ePreviewMode);
+ m_pControlHelper = VclPtr<OAppDetailPageHelper>::Create(m_aContainer.get(),m_rBorderWin,_ePreviewMode);
m_pControlHelper->Show();
- m_aContainer.setChildWindow(m_pControlHelper);
+ m_aContainer->setChildWindow(m_pControlHelper);
- OTasksWindow* pTasks = new OTasksWindow(&m_aTasks,this);
+ VclPtrInstance<OTasksWindow> pTasks(m_aTasks.get(),this);
pTasks->Show();
pTasks->Disable(m_rBorderWin.getView()->getCommandController().isDataSourceReadOnly());
- m_aTasks.setChildWindow(pTasks);
- m_aTasks.SetUniqueId(UID_APP_TASKS_VIEW);
- m_aTasks.Show();
+ m_aTasks->setChildWindow(pTasks);
+ m_aTasks->SetUniqueId(UID_APP_TASKS_VIEW);
+ m_aTasks->Show();
- m_aContainer.SetUniqueId(UID_APP_CONTAINER_VIEW);
- m_aContainer.Show();
+ m_aContainer->SetUniqueId(UID_APP_CONTAINER_VIEW);
+ m_aContainer->Show();
const long nFrameWidth = LogicToPixel( Size( 3, 0 ), MAP_APPFONT ).Width();
- m_aHorzSplitter.SetPosSizePixel( Point(0,50), Size(0,nFrameWidth) );
+ m_aHorzSplitter->SetPosSizePixel( Point(0,50), Size(0,nFrameWidth) );
// now set the components at the base class
- set(&m_aContainer,&m_aTasks);
+ set(m_aContainer.get(),m_aTasks.get());
- m_aHorzSplitter.Show();
- m_aHorzSplitter.SetUniqueId(UID_APP_VIEW_HORZ_SPLIT);
- setSplitter(&m_aHorzSplitter);
+ m_aHorzSplitter->Show();
+ m_aHorzSplitter->SetUniqueId(UID_APP_VIEW_HORZ_SPLIT);
+ setSplitter(m_aHorzSplitter.get());
}
OApplicationDetailView::~OApplicationDetailView()
{
+ disposeOnce();
+}
+
+void OApplicationDetailView::dispose()
+{
set(NULL,NULL);
setSplitter(NULL);
- m_pControlHelper = NULL;
+ m_aHorzSplitter.disposeAndClear();
+ m_aTasks.disposeAndClear();
+ m_aContainer.disposeAndClear();
+ m_pControlHelper.clear();
+ OSplitterView::dispose();
}
void OApplicationDetailView::ImplInitSettings( bool bFont, bool bForeground, bool bBackground )
@@ -580,9 +600,9 @@ void OApplicationDetailView::ImplInitSettings( bool bFont, bool bForeground, boo
if( bBackground )
SetBackground( rStyleSettings.GetFieldColor() );
- m_aHorzSplitter.SetBackground( rStyleSettings.GetDialogColor() );
- m_aHorzSplitter.SetFillColor( rStyleSettings.GetDialogColor() );
- m_aHorzSplitter.SetTextFillColor(rStyleSettings.GetDialogColor() );
+ m_aHorzSplitter->SetBackground( rStyleSettings.GetDialogColor() );
+ m_aHorzSplitter->SetFillColor( rStyleSettings.GetDialogColor() );
+ m_aHorzSplitter->SetTextFillColor(rStyleSettings.GetDialogColor() );
}
void OApplicationDetailView::DataChanged( const DataChangedEvent& rDCEvt )
@@ -642,7 +662,7 @@ void OApplicationDetailView::impl_createPage( ElementType _eType, const Referenc
bool bEnabled = !rData.aTasks.empty()
&& getBorderWin().getView()->getCommandController().isCommandEnabled( rData.aTasks[0].sUNOCommand );
getTasksWindow().Enable( bEnabled );
- m_aContainer.setTitle( rData.nTitleId );
+ m_aContainer->setTitle( rData.nTitleId );
// let our helper create the object list
if ( _eType == E_TABLE )
diff --git a/dbaccess/source/ui/app/AppDetailView.hxx b/dbaccess/source/ui/app/AppDetailView.hxx
index f90048248ce8..fadf67574c38 100644
--- a/dbaccess/source/ui/app/AppDetailView.hxx
+++ b/dbaccess/source/ui/app/AppDetailView.hxx
@@ -111,11 +111,11 @@ namespace dbaui
class OTasksWindow : public vcl::Window
{
- OCreationList m_aCreation;
- FixedText m_aDescription;
- FixedText m_aHelpText;
- FixedLine m_aFL;
- OApplicationDetailView* m_pDetailView;
+ VclPtr<OCreationList> m_aCreation;
+ VclPtr<FixedText> m_aDescription;
+ VclPtr<FixedText> m_aHelpText;
+ VclPtr<FixedLine> m_aFL;
+ VclPtr<OApplicationDetailView> m_pDetailView;
DECL_LINK( OnEntrySelectHdl, SvTreeListBox* );
void ImplInitSettings( bool bFont, bool bForeground, bool bBackground );
@@ -124,6 +124,7 @@ namespace dbaui
public:
OTasksWindow(vcl::Window* _pParent,OApplicationDetailView* _pDetailView);
virtual ~OTasksWindow();
+ virtual void dispose() SAL_OVERRIDE;
// Window overrides
virtual void Resize() SAL_OVERRIDE;
@@ -135,7 +136,7 @@ namespace dbaui
inline bool HandleKeyInput( const KeyEvent& _rKEvt )
{
- return m_aCreation.HandleKeyInput( _rKEvt );
+ return m_aCreation->HandleKeyInput( _rKEvt );
}
void Clear();
@@ -144,11 +145,11 @@ namespace dbaui
class OApplicationDetailView : public OSplitterView
, public IClipboardTest
{
- Splitter m_aHorzSplitter;
- OTitleWindow m_aTasks;
- OTitleWindow m_aContainer;
+ VclPtr<Splitter> m_aHorzSplitter;
+ VclPtr<OTitleWindow> m_aTasks;
+ VclPtr<OTitleWindow> m_aContainer;
OAppBorderWindow& m_rBorderWin; // my parent
- OAppDetailPageHelper* m_pControlHelper;
+ VclPtr<OAppDetailPageHelper> m_pControlHelper;
::std::vector< TaskPaneData > m_aTaskPaneData;
MnemonicGenerator m_aExternalMnemonics;
@@ -161,6 +162,7 @@ namespace dbaui
OApplicationDetailView(OAppBorderWindow& _rParent,PreviewMode _ePreviewMode);
virtual ~OApplicationDetailView();
// Window overrides
+ virtual void dispose() SAL_OVERRIDE;
virtual void GetFocus() SAL_OVERRIDE;
/** creates the tables page
@@ -188,7 +190,7 @@ namespace dbaui
bool interceptKeyInput( const KeyEvent& _rEvent );
inline OAppBorderWindow& getBorderWin() const { return m_rBorderWin; }
- inline OTasksWindow& getTasksWindow() const { return *static_cast< OTasksWindow* >( m_aTasks.getChildWindow() ); }
+ inline OTasksWindow& getTasksWindow() const { return *static_cast< OTasksWindow* >( m_aTasks->getChildWindow() ); }
bool isCutAllowed() SAL_OVERRIDE ;
bool isCopyAllowed() SAL_OVERRIDE ;
diff --git a/dbaccess/source/ui/app/AppIconControl.cxx b/dbaccess/source/ui/app/AppIconControl.cxx
index ff73ba0fdafc..a4b7d02bb944 100644
--- a/dbaccess/source/ui/app/AppIconControl.cxx
+++ b/dbaccess/source/ui/app/AppIconControl.cxx
@@ -62,6 +62,11 @@ OApplicationIconControl::OApplicationIconControl(vcl::Window* _pParent)
OApplicationIconControl::~OApplicationIconControl()
{
+ disposeOnce();
+}
+
+void OApplicationIconControl::dispose()
+{
sal_uLong nCount = GetEntryCount();
for ( sal_uLong i = 0; i < nCount; ++i )
{
@@ -72,7 +77,7 @@ OApplicationIconControl::~OApplicationIconControl()
pEntry->SetUserData(NULL);
}
}
-
+ SvtIconChoiceCtrl::dispose();
}
sal_Int8 OApplicationIconControl::AcceptDrop( const AcceptDropEvent& _rEvt )
diff --git a/dbaccess/source/ui/app/AppIconControl.hxx b/dbaccess/source/ui/app/AppIconControl.hxx
index 5fcecef90022..10c425b6ea31 100644
--- a/dbaccess/source/ui/app/AppIconControl.hxx
+++ b/dbaccess/source/ui/app/AppIconControl.hxx
@@ -34,6 +34,7 @@ namespace dbaui
public:
OApplicationIconControl(vcl::Window* _pParent);
virtual ~OApplicationIconControl();
+ virtual void dispose() SAL_OVERRIDE;
void setControlActionListener( IControlActionListener* _pListener ) { m_pActionListener = _pListener; }
IControlActionListener* getControlActionListener( ) const { return m_pActionListener; }
diff --git a/dbaccess/source/ui/app/AppSwapWindow.cxx b/dbaccess/source/ui/app/AppSwapWindow.cxx
index 902c7181d5fe..1f215dfd22b5 100644
--- a/dbaccess/source/ui/app/AppSwapWindow.cxx
+++ b/dbaccess/source/ui/app/AppSwapWindow.cxx
@@ -38,35 +38,41 @@ using namespace ::com::sun::star::container;
// class OApplicationSwapWindow
OApplicationSwapWindow::OApplicationSwapWindow( vcl::Window* _pParent, OAppBorderWindow& _rBorderWindow )
:Window(_pParent,WB_DIALOGCONTROL )
- ,m_aIconControl(this)
+ ,m_aIconControl(VclPtr<OApplicationIconControl>::Create(this))
,m_eLastType(E_NONE)
,m_rBorderWin( _rBorderWindow )
{
ImplInitSettings( true, true, true );
- m_aIconControl.SetClickHdl(LINK(this, OApplicationSwapWindow, OnContainerSelectHdl));
- m_aIconControl.setControlActionListener( &m_rBorderWin.getView()->getAppController() );
- m_aIconControl.SetHelpId(HID_APP_SWAP_ICONCONTROL);
- m_aIconControl.Show();
+ m_aIconControl->SetClickHdl(LINK(this, OApplicationSwapWindow, OnContainerSelectHdl));
+ m_aIconControl->setControlActionListener( &m_rBorderWin.getView()->getAppController() );
+ m_aIconControl->SetHelpId(HID_APP_SWAP_ICONCONTROL);
+ m_aIconControl->Show();
}
OApplicationSwapWindow::~OApplicationSwapWindow()
{
+ disposeOnce();
+}
+void OApplicationSwapWindow::dispose()
+{
+ m_aIconControl.disposeAndClear();
+ vcl::Window::dispose();
}
void OApplicationSwapWindow::Resize()
{
Size aFLSize = LogicToPixel( Size( 8, 0 ), MAP_APPFONT );
long nX = 0;
- if ( m_aIconControl.GetEntryCount() != 0 )
- nX = m_aIconControl.GetBoundingBox( m_aIconControl.GetEntry(0) ).GetWidth() + aFLSize.Width();
+ if ( m_aIconControl->GetEntryCount() != 0 )
+ nX = m_aIconControl->GetBoundingBox( m_aIconControl->GetEntry(0) ).GetWidth() + aFLSize.Width();
Size aOutputSize = GetOutputSize();
- m_aIconControl.SetPosSizePixel( Point(static_cast<long>((aOutputSize.Width() - nX)*0.5), 0) ,Size(nX,aOutputSize.Height()));
- m_aIconControl.ArrangeIcons();
+ m_aIconControl->SetPosSizePixel( Point(static_cast<long>((aOutputSize.Width() - nX)*0.5), 0) ,Size(nX,aOutputSize.Height()));
+ m_aIconControl->ArrangeIcons();
}
void OApplicationSwapWindow::ImplInitSettings( bool bFont, bool bForeground, bool bBackground )
@@ -106,24 +112,24 @@ void OApplicationSwapWindow::DataChanged( const DataChangedEvent& rDCEvt )
void OApplicationSwapWindow::clearSelection()
{
- m_aIconControl.SetNoSelection();
+ m_aIconControl->SetNoSelection();
sal_uLong nPos = 0;
- SvxIconChoiceCtrlEntry* pEntry = m_aIconControl.GetSelectedEntry(nPos);
+ SvxIconChoiceCtrlEntry* pEntry = m_aIconControl->GetSelectedEntry(nPos);
if ( pEntry )
- m_aIconControl.InvalidateEntry(pEntry);
- m_aIconControl.GetClickHdl().Call(&m_aIconControl);
+ m_aIconControl->InvalidateEntry(pEntry);
+ m_aIconControl->GetClickHdl().Call(&m_aIconControl);
}
void OApplicationSwapWindow::createIconAutoMnemonics( MnemonicGenerator& _rMnemonics )
{
- m_aIconControl.CreateAutoMnemonics( _rMnemonics );
+ m_aIconControl->CreateAutoMnemonics( _rMnemonics );
}
bool OApplicationSwapWindow::interceptKeyInput( const KeyEvent& _rEvent )
{
const vcl::KeyCode& rKeyCode = _rEvent.GetKeyCode();
if ( rKeyCode.GetModifier() == KEY_MOD2 )
- return m_aIconControl.DoKeyInput( _rEvent );
+ return m_aIconControl->DoKeyInput( _rEvent );
// not handled
return false;
@@ -132,7 +138,7 @@ bool OApplicationSwapWindow::interceptKeyInput( const KeyEvent& _rEvent )
ElementType OApplicationSwapWindow::getElementType() const
{
sal_uLong nPos = 0;
- SvxIconChoiceCtrlEntry* pEntry = m_aIconControl.GetSelectedEntry(nPos);
+ SvxIconChoiceCtrlEntry* pEntry = m_aIconControl->GetSelectedEntry(nPos);
return ( pEntry ) ? *static_cast<ElementType*>(pEntry->GetUserData()) : E_NONE;
}
@@ -174,18 +180,18 @@ IMPL_LINK_NOARG(OApplicationSwapWindow, ChangeToLastSelected)
void OApplicationSwapWindow::selectContainer(ElementType _eType)
{
- sal_uLong nCount = m_aIconControl.GetEntryCount();
+ sal_uLong nCount = m_aIconControl->GetEntryCount();
SvxIconChoiceCtrlEntry* pEntry = NULL;
for (sal_uLong i=0; i < nCount; ++i)
{
- pEntry = m_aIconControl.GetEntry(i);
+ pEntry = m_aIconControl->GetEntry(i);
if ( pEntry && *static_cast<ElementType*>(pEntry->GetUserData()) == _eType )
break;
pEntry = NULL;
}
if ( pEntry )
- m_aIconControl.SetCursor(pEntry); // this call also initiates a onContainerSelected call
+ m_aIconControl->SetCursor(pEntry); // this call also initiates a onContainerSelected call
else
onContainerSelected( _eType );
}
diff --git a/dbaccess/source/ui/app/AppSwapWindow.hxx b/dbaccess/source/ui/app/AppSwapWindow.hxx
index c7b61c4651c6..b655dd8e4dc1 100644
--- a/dbaccess/source/ui/app/AppSwapWindow.hxx
+++ b/dbaccess/source/ui/app/AppSwapWindow.hxx
@@ -21,6 +21,7 @@
#include "IClipBoardTest.hxx"
#include <vcl/lstbox.hxx>
+#include <vcl/vclptr.hxx>
#include "AppIconControl.hxx"
#include "AppElementType.hxx"
@@ -30,7 +31,7 @@ namespace dbaui
class OApplicationSwapWindow : public vcl::Window,
public IClipboardTest
{
- OApplicationIconControl m_aIconControl;
+ VclPtr<OApplicationIconControl> m_aIconControl;
ElementType m_eLastType;
OAppBorderWindow& m_rBorderWin;
@@ -44,6 +45,7 @@ namespace dbaui
OApplicationSwapWindow( vcl::Window* _pParent, OAppBorderWindow& _rBorderWindow );
virtual ~OApplicationSwapWindow();
// Window overrides
+ virtual void dispose() SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
bool isCutAllowed() SAL_OVERRIDE { return false; }
@@ -54,9 +56,9 @@ namespace dbaui
void cut() SAL_OVERRIDE { }
void paste() SAL_OVERRIDE { }
- inline sal_uLong GetEntryCount() const { return m_aIconControl.GetEntryCount(); }
- inline SvxIconChoiceCtrlEntry* GetEntry( sal_uLong nPos ) const { return m_aIconControl.GetEntry(nPos); }
- inline Rectangle GetBoundingBox( SvxIconChoiceCtrlEntry* pEntry ) const { return m_aIconControl.GetBoundingBox(pEntry); }
+ inline sal_uLong GetEntryCount() const { return m_aIconControl->GetEntryCount(); }
+ inline SvxIconChoiceCtrlEntry* GetEntry( sal_uLong nPos ) const { return m_aIconControl->GetEntry(nPos); }
+ inline Rectangle GetBoundingBox( SvxIconChoiceCtrlEntry* pEntry ) const { return m_aIconControl->GetBoundingBox(pEntry); }
/** automatically creates mnemonics for the icon/texts in our left hand side panel
*/
diff --git a/dbaccess/source/ui/app/AppTitleWindow.cxx b/dbaccess/source/ui/app/AppTitleWindow.cxx
index 2bbd2c66231c..71317b01a82b 100644
--- a/dbaccess/source/ui/app/AppTitleWindow.cxx
+++ b/dbaccess/source/ui/app/AppTitleWindow.cxx
@@ -29,9 +29,9 @@ namespace dbaui
OTitleWindow::OTitleWindow(vcl::Window* _pParent,sal_uInt16 _nTitleId,WinBits _nBits,bool _bShift)
: Window(_pParent,_nBits | WB_DIALOGCONTROL)
-, m_aSpace1(this)
-, m_aSpace2(this)
-, m_aTitle(this)
+, m_aSpace1(VclPtr<FixedText>::Create(this))
+, m_aSpace2(VclPtr<FixedText>::Create(this))
+, m_aTitle(VclPtr<FixedText>::Create(this))
, m_pChild(NULL)
, m_bShift(_bShift)
{
@@ -40,20 +40,27 @@ OTitleWindow::OTitleWindow(vcl::Window* _pParent,sal_uInt16 _nTitleId,WinBits _n
SetBorderStyle(WindowBorderStyle::MONO);
ImplInitSettings( true, true, true );
- vcl::Window* pWindows [] = { &m_aSpace1, &m_aSpace2, &m_aTitle };
+ vcl::Window* pWindows [] = { m_aSpace1.get(), m_aSpace2.get(), m_aTitle.get() };
for (size_t i=0; i < sizeof(pWindows)/sizeof(pWindows[0]); ++i)
pWindows[i]->Show();
}
OTitleWindow::~OTitleWindow()
{
+ disposeOnce();
+}
+
+void OTitleWindow::dispose()
+{
if ( m_pChild )
{
m_pChild->Hide();
- boost::scoped_ptr<vcl::Window> aTemp(m_pChild);
- m_pChild = NULL;
}
-
+ m_pChild.disposeAndClear();
+ m_aSpace1.disposeAndClear();
+ m_aSpace2.disposeAndClear();
+ m_aTitle.disposeAndClear();
+ vcl::Window::dispose();
}
void OTitleWindow::setChildWindow(vcl::Window* _pChild)
@@ -74,11 +81,11 @@ void OTitleWindow::Resize()
sal_Int32 nYOffset = aTextSize.Height();
sal_Int32 nHeight = GetTextHeight() + 2*nYOffset;
- m_aSpace1.SetPosSizePixel( Point(SPACE_BORDER, SPACE_BORDER ),
+ m_aSpace1->SetPosSizePixel( Point(SPACE_BORDER, SPACE_BORDER ),
Size(nXOffset , nHeight - SPACE_BORDER) );
- m_aSpace2.SetPosSizePixel( Point(nXOffset + SPACE_BORDER, SPACE_BORDER ),
+ m_aSpace2->SetPosSizePixel( Point(nXOffset + SPACE_BORDER, SPACE_BORDER ),
Size(nOutputWidth - nXOffset - 2*SPACE_BORDER, nYOffset) );
- m_aTitle.SetPosSizePixel( Point(nXOffset + SPACE_BORDER, nYOffset + SPACE_BORDER),
+ m_aTitle->SetPosSizePixel( Point(nXOffset + SPACE_BORDER, nYOffset + SPACE_BORDER),
Size(nOutputWidth - nXOffset - 2*SPACE_BORDER, nHeight - nYOffset - SPACE_BORDER) );
if ( m_pChild )
{
@@ -91,7 +98,7 @@ void OTitleWindow::setTitle(sal_uInt16 _nTitleId)
{
if ( _nTitleId != 0 )
{
- m_aTitle.SetText(ModuleRes(_nTitleId));
+ m_aTitle->SetText(ModuleRes(_nTitleId));
}
}
@@ -105,7 +112,7 @@ void OTitleWindow::GetFocus()
long OTitleWindow::GetWidthPixel() const
{
Size aTextSize = LogicToPixel( Size( 12, 0 ), MAP_APPFONT );
- sal_Int32 nWidth = GetTextWidth(m_aTitle.GetText()) + 2*aTextSize.Width();
+ sal_Int32 nWidth = GetTextWidth(m_aTitle->GetText()) + 2*aTextSize.Width();
return nWidth;
}
@@ -151,7 +158,7 @@ void OTitleWindow::ImplInitSettings( bool bFont, bool bForeground, bool bBackgro
if( bBackground )
SetBackground( rStyleSettings.GetFieldColor() );
- vcl::Window* pWindows [] = { &m_aSpace1, &m_aSpace2, &m_aTitle};
+ vcl::Window* pWindows [] = { m_aSpace1.get(), m_aSpace2.get(), m_aTitle.get()};
for (size_t i=0; i < sizeof(pWindows)/sizeof(pWindows[0]); ++i)
{
vcl::Font aFont = pWindows[i]->GetFont();
diff --git a/dbaccess/source/ui/app/AppTitleWindow.hxx b/dbaccess/source/ui/app/AppTitleWindow.hxx
index 76228b54b6cf..875f693107ab 100644
--- a/dbaccess/source/ui/app/AppTitleWindow.hxx
+++ b/dbaccess/source/ui/app/AppTitleWindow.hxx
@@ -25,10 +25,10 @@ namespace dbaui
{
class OTitleWindow : public vcl::Window
{
- FixedText m_aSpace1;
- FixedText m_aSpace2;
- FixedText m_aTitle;
- vcl::Window* m_pChild;
+ VclPtr<FixedText> m_aSpace1;
+ VclPtr<FixedText> m_aSpace2;
+ VclPtr<FixedText> m_aTitle;
+ VclPtr<vcl::Window> m_pChild;
bool m_bShift;
void ImplInitSettings( bool bFont, bool bForeground, bool bBackground );
protected:
@@ -36,6 +36,7 @@ namespace dbaui
public:
OTitleWindow(vcl::Window* _pParent,sal_uInt16 _nTitleId,WinBits _nBits,bool _bShift = true);
virtual ~OTitleWindow();
+ virtual void dispose() SAL_OVERRIDE;
// Window overrides
virtual void Resize() SAL_OVERRIDE;
diff --git a/dbaccess/source/ui/app/AppView.cxx b/dbaccess/source/ui/app/AppView.cxx
index fe2d505e9018..6fa8030ceadc 100644
--- a/dbaccess/source/ui/app/AppView.cxx
+++ b/dbaccess/source/ui/app/AppView.cxx
@@ -68,9 +68,9 @@ OAppBorderWindow::OAppBorderWindow(OApplicationView* _pParent,PreviewMode _ePrev
SetBorderStyle(WindowBorderStyle::MONO);
- m_pPanel = new OTitleWindow(this,STR_DATABASE,WB_BORDER | WB_DIALOGCONTROL, false);
+ m_pPanel = VclPtr<OTitleWindow>::Create(this,STR_DATABASE,WB_BORDER | WB_DIALOGCONTROL, false);
m_pPanel->SetBorderStyle(WindowBorderStyle::MONO);
- OApplicationSwapWindow* pSwap = new OApplicationSwapWindow( m_pPanel, *this );
+ VclPtrInstance<OApplicationSwapWindow> pSwap( m_pPanel, *this );
pSwap->Show();
pSwap->SetUniqueId(UID_APP_SWAP_VIEW);
@@ -78,7 +78,7 @@ OAppBorderWindow::OAppBorderWindow(OApplicationView* _pParent,PreviewMode _ePrev
m_pPanel->SetUniqueId(UID_APP_DATABASE_VIEW);
m_pPanel->Show();
- m_pDetailView = new OApplicationDetailView(*this,_ePreviewMode);
+ m_pDetailView = VclPtr<OApplicationDetailView>::Create(*this,_ePreviewMode);
m_pDetailView->Show();
ImplInitSettings();
@@ -86,20 +86,20 @@ OAppBorderWindow::OAppBorderWindow(OApplicationView* _pParent,PreviewMode _ePrev
OAppBorderWindow::~OAppBorderWindow()
{
+ disposeOnce();
+}
+
+void OAppBorderWindow::dispose()
+{
// destroy children
if ( m_pPanel )
- {
m_pPanel->Hide();
- boost::scoped_ptr<vcl::Window> aTemp(m_pPanel);
- m_pPanel = NULL;
- }
+ m_pPanel.disposeAndClear();
if ( m_pDetailView )
- {
m_pDetailView->Hide();
- boost::scoped_ptr<vcl::Window> aTemp(m_pDetailView);
- m_pDetailView = NULL;
- }
-
+ m_pDetailView.disposeAndClear();
+ m_pView.clear();
+ vcl::Window::dispose();
}
void OAppBorderWindow::GetFocus()
@@ -195,7 +195,7 @@ OApplicationView::OApplicationView( vcl::Window* pParent
{
}
- m_pWin = new OAppBorderWindow(this,_ePreviewMode);
+ m_pWin = VclPtr<OAppBorderWindow>::Create(this,_ePreviewMode);
m_pWin->SetUniqueId(UID_APP_VIEW_BORDER_WIN);
m_pWin->Show();
@@ -204,13 +204,16 @@ OApplicationView::OApplicationView( vcl::Window* pParent
OApplicationView::~OApplicationView()
{
+ disposeOnce();
+}
- {
- stopComponentListening(m_xObject);
- m_pWin->Hide();
- boost::scoped_ptr<vcl::Window> aTemp(m_pWin);
- m_pWin = NULL;
- }
+void OApplicationView::dispose()
+{
+ stopComponentListening(m_xObject);
+ m_xObject.clear();
+ m_pWin->Hide();
+ m_pWin.disposeAndClear();
+ ODataView::dispose();
}
void OApplicationView::createIconAutoMnemonics( MnemonicGenerator& _rMnemonics )
diff --git a/dbaccess/source/ui/app/AppView.hxx b/dbaccess/source/ui/app/AppView.hxx
index 87288117d2cd..41f30c85b99e 100644
--- a/dbaccess/source/ui/app/AppView.hxx
+++ b/dbaccess/source/ui/app/AppView.hxx
@@ -44,9 +44,9 @@ namespace dbaui
class OTitleWindow;
class OAppBorderWindow : public vcl::Window
{
- OTitleWindow* m_pPanel;
- OApplicationDetailView* m_pDetailView;
- OApplicationView* m_pView;
+ VclPtr<OTitleWindow> m_pPanel;
+ VclPtr<OApplicationDetailView> m_pDetailView;
+ VclPtr<OApplicationView> m_pView;
void ImplInitSettings();
protected:
@@ -55,6 +55,7 @@ namespace dbaui
public:
OAppBorderWindow(OApplicationView* _pParent,PreviewMode _ePreviewMode);
virtual ~OAppBorderWindow();
+ virtual void dispose() SAL_OVERRIDE;
// Window overrides
virtual void GetFocus() SAL_OVERRIDE;
@@ -79,7 +80,7 @@ namespace dbaui
::com::sun::star::lang::Locale m_aLocale;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
m_xObject;
- OAppBorderWindow* m_pWin;
+ VclPtr<OAppBorderWindow> m_pWin;
IApplicationController& m_rAppController;
ChildFocusState m_eChildFocus;
@@ -103,6 +104,7 @@ namespace dbaui
,PreviewMode _ePreviewMode
);
virtual ~OApplicationView();
+ virtual void dispose() SAL_OVERRIDE;
/// automatically creates mnemonics for the icon/texts in our left hand side panel
void createIconAutoMnemonics( MnemonicGenerator& _rMnemonics );
diff --git a/dbaccess/source/ui/app/subcomponentmanager.cxx b/dbaccess/source/ui/app/subcomponentmanager.cxx
index e4c05397585b..880504587747 100644
--- a/dbaccess/source/ui/app/subcomponentmanager.cxx
+++ b/dbaccess/source/ui/app/subcomponentmanager.cxx
@@ -32,6 +32,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <tools/diagnose_ex.h>
+#include <dbaccess/dataview.hxx>
#include <vcl/svapp.hxx>
#include <osl/mutex.hxx>
diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx
index 0bfddcc7bb6c..d39dd447553b 100644
--- a/dbaccess/source/ui/browser/brwctrlr.cxx
+++ b/dbaccess/source/ui/browser/brwctrlr.cxx
@@ -757,7 +757,7 @@ bool SbaXDataBrowserController::Construct(vcl::Window* pParent)
}
// create the view
- setView( * new UnoDataBrowserView( pParent, *this, getORB() ) );
+ setView( VclPtr<UnoDataBrowserView>::Create( pParent, *this, getORB() ) );
if (!getBrowserView())
return false;
@@ -1271,8 +1271,8 @@ IMPL_LINK( SbaXDataBrowserController, OnAsyncDisplayError, void*, /* _pNotIntere
{
if ( m_aCurrentError.isValid() )
{
- OSQLMessageBox aDlg( getBrowserView(), m_aCurrentError );
- aDlg.Execute();
+ ScopedVclPtrInstance< OSQLMessageBox > aDlg( getBrowserView(), m_aCurrentError );
+ aDlg->Execute();
}
return 0L;
}
@@ -1764,19 +1764,19 @@ void SbaXDataBrowserController::ExecuteFilterSortCrit(bool bFilter)
Reference< XConnection> xCon(xFormSet->getPropertyValue(PROPERTY_ACTIVE_CONNECTION),UNO_QUERY);
if(bFilter)
{
- DlgFilterCrit aDlg( getBrowserView(), getORB(), xCon, xParser, xSup->getColumns() );
- if ( !aDlg.Execute() )
+ ScopedVclPtrInstance< DlgFilterCrit > aDlg( getBrowserView(), getORB(), xCon, xParser, xSup->getColumns() );
+ if ( !aDlg->Execute() )
return; // if so we don't need to update the grid
- aDlg.BuildWherePart();
+ aDlg->BuildWherePart();
}
else
{
- DlgOrderCrit aDlg( getBrowserView(),xCon,xParser,xSup->getColumns() );
- if(!aDlg.Execute())
+ ScopedVclPtrInstance< DlgOrderCrit > aDlg( getBrowserView(),xCon,xParser,xSup->getColumns() );
+ if(!aDlg->Execute())
{
return; // if so we don't need to actualize the grid
}
- aDlg.BuildOrderPart();
+ aDlg->BuildOrderPart();
}
}
catch(const SQLException& )
@@ -2172,11 +2172,11 @@ bool SbaXDataBrowserController::SaveModified(bool bAskFor)
{
getBrowserView()->getVclControl()->GrabFocus();
- MessageDialog aQry(getBrowserView()->getVclControl(),
- "SaveModifiedDialog",
- "dbaccess/ui/savemodifieddialog.ui");
+ ScopedVclPtrInstance<MessageDialog> aQry( getBrowserView()->getVclControl(),
+ "SaveModifiedDialog",
+ "dbaccess/ui/savemodifieddialog.ui" );
- switch (aQry.Execute())
+ switch (aQry->Execute())
{
case RET_NO:
Execute(ID_BROWSER_UNDORECORD,Sequence<PropertyValue>());
diff --git a/dbaccess/source/ui/browser/brwview.cxx b/dbaccess/source/ui/browser/brwview.cxx
index f41289e3a797..fe0ad003ab79 100644
--- a/dbaccess/source/ui/browser/brwview.cxx
+++ b/dbaccess/source/ui/browser/brwview.cxx
@@ -106,7 +106,7 @@ void UnoDataBrowserView::Construct(const Reference< ::com::sun::star::awt::XCont
m_pVclControl = NULL;
getVclControl();
- OSL_ENSURE(m_pVclControl != NULL, "UnoDataBrowserView::Construct : no real grid control !");
+ OSL_ENSURE(m_pVclControl != nullptr, "UnoDataBrowserView::Construct : no real grid control !");
}
catch(const Exception&)
{
@@ -117,17 +117,15 @@ void UnoDataBrowserView::Construct(const Reference< ::com::sun::star::awt::XCont
UnoDataBrowserView::~UnoDataBrowserView()
{
- {
- boost::scoped_ptr<Splitter> aTemp(m_pSplitter);
- m_pSplitter = NULL;
- }
+ disposeOnce();
+}
+
+void UnoDataBrowserView::dispose()
+{
+ m_pSplitter.disposeAndClear();
setTreeView(NULL);
- if ( m_pStatus )
- {
- delete m_pStatus;
- m_pStatus = NULL;
- }
+ m_pStatus.disposeAndClear();
try
{
@@ -136,7 +134,9 @@ UnoDataBrowserView::~UnoDataBrowserView()
}
catch(const Exception&)
{}
-
+ m_pTreeView.clear();
+ m_pVclControl.clear();
+ ODataView::dispose();
}
IMPL_LINK( UnoDataBrowserView, SplitHdl, void*, /*NOINTERESTEDIN*/ )
@@ -157,13 +157,9 @@ void UnoDataBrowserView::setSplitter(Splitter* _pSplitter)
void UnoDataBrowserView::setTreeView(DBTreeView* _pTreeView)
{
- if (m_pTreeView != _pTreeView)
+ if (m_pTreeView.get() != _pTreeView)
{
- if (m_pTreeView)
- {
- boost::scoped_ptr<vcl::Window> aTemp(m_pTreeView);
- m_pTreeView = NULL;
- }
+ m_pTreeView.disposeAndClear();
m_pTreeView = _pTreeView;
}
}
@@ -175,7 +171,7 @@ void UnoDataBrowserView::showStatus( const OUString& _rStatus )
else
{
if (!m_pStatus)
- m_pStatus = new FixedText(this);
+ m_pStatus = VclPtr<FixedText>::Create(this);
m_pStatus->SetText(_rStatus);
m_pStatus->Show();
Resize();
@@ -268,7 +264,7 @@ SbaGridControl* UnoDataBrowserView::getVclControl() const
UnoDataBrowserView* pTHIS = const_cast<UnoDataBrowserView*>(this);
if ( pPeer )
{
- m_pVclControl = static_cast<SbaGridControl*>(pPeer->GetWindow());
+ m_pVclControl = static_cast<SbaGridControl*>(pPeer->GetWindow().get());
pTHIS->startComponentListening(Reference<XComponent>(VCLUnoHelper::GetInterface(m_pVclControl),UNO_QUERY));
}
}
diff --git a/dbaccess/source/ui/browser/dataview.cxx b/dbaccess/source/ui/browser/dataview.cxx
index dc27afe956a3..fd7451f34891 100644
--- a/dbaccess/source/ui/browser/dataview.cxx
+++ b/dbaccess/source/ui/browser/dataview.cxx
@@ -42,7 +42,7 @@ namespace dbaui
class ColorChanger
{
protected:
- OutputDevice* m_pDev;
+ VclPtr<OutputDevice> m_pDev;
public:
ColorChanger( OutputDevice* _pDev, const ::Color& _rNewLineColor, const ::Color& _rNewFillColor )
@@ -65,12 +65,11 @@ namespace dbaui
WinBits nStyle)
:Window(pParent,nStyle)
,m_xContext(_rxContext)
- ,m_rController( _rController )
- ,m_aSeparator( this )
+ ,m_xController( &_rController )
+ ,m_aSeparator( VclPtr<FixedLine>::Create(this) )
{
- m_rController.acquire();
m_pAccel.reset(::svt::AcceleratorExecute::createAcceleratorHelper());
- m_aSeparator.Show();
+ m_aSeparator->Show();
}
void ODataView::Construct()
@@ -79,8 +78,15 @@ namespace dbaui
ODataView::~ODataView()
{
+ disposeOnce();
+ }
- m_rController.release();
+ void ODataView::dispose()
+ {
+ m_xController.clear();
+ m_aSeparator.disposeAndClear();
+ m_pAccel.reset();
+ vcl::Window::dispose();
}
void ODataView::resizeDocumentView( Rectangle& /*_rPlayground*/ )
@@ -105,7 +111,7 @@ namespace dbaui
// position the separator
const Size aSeparatorSize = Size( aPlayground.GetWidth(), 2 );
- m_aSeparator.SetPosSizePixel( aPlayground.TopLeft(), aSeparatorSize );
+ m_aSeparator->SetPosSizePixel( aPlayground.TopLeft(), aSeparatorSize );
aPlayground.Top() += aSeparatorSize.Height() + 1;
// position the controls of the document's view
@@ -134,7 +140,7 @@ namespace dbaui
case MouseNotifyEvent::KEYUP:
case MouseNotifyEvent::MOUSEBUTTONDOWN:
case MouseNotifyEvent::MOUSEBUTTONUP:
- bHandled = m_rController.interceptUserInput( _rNEvt );
+ bHandled = m_xController->interceptUserInput( _rNEvt );
break;
default:
break;
@@ -148,7 +154,7 @@ namespace dbaui
if ( nType == StateChangedType::CONTROLBACKGROUND )
{
// Check if we need to get new images for normal/high contrast mode
- m_rController.notifyHiContrastChanged();
+ m_xController->notifyHiContrastChanged();
}
if ( nType == StateChangedType::INITSHOW )
@@ -157,7 +163,7 @@ namespace dbaui
// model's arguments.
try
{
- Reference< XController > xController( m_rController.getXController(), UNO_SET_THROW );
+ Reference< XController > xController( m_xController->getXController(), UNO_SET_THROW );
Reference< XModel > xModel( xController->getModel(), UNO_QUERY );
if ( xModel.is() )
{
@@ -183,7 +189,7 @@ namespace dbaui
(rDCEvt.GetFlags() & AllSettingsFlags::STYLE)) )
{
// Check if we need to get new images for normal/high contrast mode
- m_rController.notifyHiContrastChanged();
+ m_xController->notifyHiContrastChanged();
}
}
void ODataView::attachFrame(const Reference< XFrame >& _xFrame)
diff --git a/dbaccess/source/ui/browser/dbtreeview.cxx b/dbaccess/source/ui/browser/dbtreeview.cxx
index 9dba9af17c20..bc0b44194983 100644
--- a/dbaccess/source/ui/browser/dbtreeview.cxx
+++ b/dbaccess/source/ui/browser/dbtreeview.cxx
@@ -36,7 +36,7 @@ DBTreeView::DBTreeView( vcl::Window* pParent, WinBits nBits)
, m_pTreeListBox(NULL)
{
- m_pTreeListBox = new DBTreeListBox(this, WB_BORDER | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT);
+ m_pTreeListBox = VclPtr<DBTreeListBox>::Create(this, WB_BORDER | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT);
m_pTreeListBox->EnableCheckButton(NULL);
m_pTreeListBox->SetDragDropMode( DragDropMode::NONE );
m_pTreeListBox->EnableInplaceEditing( true );
@@ -46,6 +46,11 @@ DBTreeView::DBTreeView( vcl::Window* pParent, WinBits nBits)
DBTreeView::~DBTreeView()
{
+ disposeOnce();
+}
+
+void DBTreeView::dispose()
+{
if (m_pTreeListBox)
{
if (m_pTreeListBox->GetModel())
@@ -53,9 +58,9 @@ DBTreeView::~DBTreeView()
m_pTreeListBox->GetModel()->RemoveView(m_pTreeListBox);
m_pTreeListBox->DisconnectFromModel();
}
- boost::scoped_ptr<vcl::Window> aTemp(m_pTreeListBox);
- m_pTreeListBox = NULL;
}
+ m_pTreeListBox.disposeAndClear();
+ vcl::Window::dispose();
}
void DBTreeView::SetPreExpandHandler(const Link& _rHdl)
diff --git a/dbaccess/source/ui/browser/dbtreeview.hxx b/dbaccess/source/ui/browser/dbtreeview.hxx
index 99bf4416ce8c..5313583fc061 100644
--- a/dbaccess/source/ui/browser/dbtreeview.hxx
+++ b/dbaccess/source/ui/browser/dbtreeview.hxx
@@ -31,7 +31,7 @@ namespace dbaui
class DBTreeView : public vcl::Window
{
private:
- DBTreeListBox* m_pTreeListBox;
+ VclPtr<DBTreeListBox> m_pTreeListBox;
protected:
// window overridables
virtual void Resize() SAL_OVERRIDE;
@@ -40,6 +40,7 @@ namespace dbaui
DBTreeView( vcl::Window* pParent,
WinBits nBits );
virtual ~DBTreeView();
+ virtual void dispose() SAL_OVERRIDE;
/** sets a handler which is called when an list box entry is to be expanded.
<p>When calling the link, the parameter is an SvTreeListEntry marking the entry to be expanded.
diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx
index c0e6c4686d56..7bf028e18ac1 100644
--- a/dbaccess/source/ui/browser/genericcontroller.cxx
+++ b/dbaccess/source/ui/browser/genericcontroller.cxx
@@ -291,7 +291,7 @@ void SAL_CALL OGenericUnoController::initialize( const Sequence< Any >& aArgumen
xParent = xFrame->getContainerWindow();
VCLXWindow* pParentComponent = VCLXWindow::GetImplementation(xParent);
- vcl::Window* pParentWin = pParentComponent ? pParentComponent->GetWindow() : NULL;
+ VclPtr< vcl::Window > pParentWin = pParentComponent ? pParentComponent->GetWindow() : VclPtr< vcl::Window >();
if (!pParentWin)
{
throw IllegalArgumentException("Parent window is null", *this, 1 );
@@ -312,7 +312,6 @@ void SAL_CALL OGenericUnoController::initialize( const Sequence< Any >& aArgumen
catch(Exception&)
{
// no one clears my view if I won't
- boost::scoped_ptr<vcl::Window> aTemp(m_pView);
m_pView = NULL;
throw;
}
@@ -983,6 +982,16 @@ Reference< XConnection > OGenericUnoController::connect( const OUString& _rDataS
return xConnection;
}
+void OGenericUnoController::setView( const VclPtr<ODataView> &i_rView )
+{
+ m_pView = i_rView;
+}
+
+void OGenericUnoController::clearView()
+{
+ m_pView = NULL;
+}
+
void OGenericUnoController::showError(const SQLExceptionInfo& _rInfo)
{
::dbaui::showError(_rInfo,getView(),getORB());
diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx
index 92bf55a2457e..fad16daabc0b 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -309,7 +309,7 @@ void SAL_CALL SbaXGridPeer::dispose() throw( RuntimeException, std::exception )
void SbaXGridPeer::NotifyStatusChanged(const ::com::sun::star::util::URL& _rUrl, const Reference< ::com::sun::star::frame::XStatusListener > & xControl)
{
- SbaGridControl* pGrid = static_cast<SbaGridControl*>(GetWindow());
+ VclPtr< SbaGridControl > pGrid = GetAs< SbaGridControl >();
if (!pGrid)
return;
@@ -361,7 +361,7 @@ Reference< ::com::sun::star::frame::XDispatch > SAL_CALL SbaXGridPeer::queryDis
IMPL_LINK( SbaXGridPeer, OnDispatchEvent, void*, /*NOTINTERESTEDIN*/ )
{
- SbaGridControl* pGrid = static_cast< SbaGridControl* >( GetWindow() );
+ VclPtr< SbaGridControl > pGrid = GetAs< SbaGridControl >();
if ( pGrid ) // if this fails, we were disposing before arriving here
{
if ( Application::GetMainThreadIdentifier() != ::osl::Thread::getCurrentIdentifier() )
@@ -398,7 +398,7 @@ SbaXGridPeer::DispatchType SbaXGridPeer::classifyDispatchURL( const URL& _rURL )
void SAL_CALL SbaXGridPeer::dispatch(const URL& aURL, const Sequence< PropertyValue >& aArgs) throw( RuntimeException, std::exception )
{
- SbaGridControl* pGrid = static_cast<SbaGridControl*>(GetWindow());
+ VclPtr< SbaGridControl > pGrid = GetAs< SbaGridControl >();
if (!pGrid)
return;
@@ -549,9 +549,9 @@ SbaXGridPeer* SbaXGridPeer::getImplementation(const Reference< XInterface >& _rx
return NULL;
}
-FmGridControl* SbaXGridPeer::imp_CreateControl(vcl::Window* pParent, WinBits nStyle)
+VclPtr<FmGridControl> SbaXGridPeer::imp_CreateControl(vcl::Window* pParent, WinBits nStyle)
{
- return new SbaGridControl( m_xContext, pParent, this, nStyle);
+ return VclPtr<SbaGridControl>::Create( m_xContext, pParent, this, nStyle);
}
// SbaGridHeader
@@ -717,13 +717,19 @@ SbaGridControl::SbaGridControl(Reference< XComponentContext > _rM,
SbaGridControl::~SbaGridControl()
{
+ disposeOnce();
+}
+
+void SbaGridControl::dispose()
+{
if (m_nAsyncDropEvent)
Application::RemoveUserEvent(m_nAsyncDropEvent);
+ FmGridControl::dispose();
}
-BrowserHeader* SbaGridControl::imp_CreateHeaderBar(BrowseBox* pParent)
+VclPtr<BrowserHeader> SbaGridControl::imp_CreateHeaderBar(BrowseBox* pParent)
{
- return new SbaGridHeader(pParent);
+ return VclPtr<SbaGridHeader>::Create(pParent);
}
CellController* SbaGridControl::GetController(long nRow, sal_uInt16 nCol)
@@ -786,10 +792,10 @@ void SbaGridControl::SetColWidth(sal_uInt16 nColId)
Any aWidth = xAffectedCol->getPropertyValue(PROPERTY_WIDTH);
sal_Int32 nCurWidth = aWidth.hasValue() ? ::comphelper::getINT32(aWidth) : -1;
- DlgSize aDlgColWidth(this, nCurWidth, false);
- if (aDlgColWidth.Execute())
+ ScopedVclPtrInstance< DlgSize > aDlgColWidth(this, nCurWidth, false);
+ if (aDlgColWidth->Execute())
{
- sal_Int32 nValue = aDlgColWidth.GetValue();
+ sal_Int32 nValue = aDlgColWidth->GetValue();
Any aNewWidth;
if (-1 == nValue)
{ // set to default
@@ -815,10 +821,10 @@ void SbaGridControl::SetRowHeight()
Any aHeight = xCols->getPropertyValue(PROPERTY_ROW_HEIGHT);
sal_Int32 nCurHeight = aHeight.hasValue() ? ::comphelper::getINT32(aHeight) : -1;
- DlgSize aDlgRowHeight(this, nCurHeight, true);
- if (aDlgRowHeight.Execute())
+ ScopedVclPtrInstance< DlgSize > aDlgRowHeight(this, nCurHeight, true);
+ if (aDlgRowHeight->Execute())
{
- sal_Int32 nValue = aDlgRowHeight.GetValue();
+ sal_Int32 nValue = aDlgRowHeight->GetValue();
Any aNewHeight;
if ((sal_Int16)-1 == nValue)
{ // set to default
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index ddc38f897c88..e546a4a7b33e 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -348,11 +348,11 @@ bool SbaTableQueryBrowser::Construct(vcl::Window* pParent)
// create controls and set sizes
const long nFrameWidth = getBrowserView()->LogicToPixel( ::Size( 3, 0 ), MAP_APPFONT ).Width();
- m_pSplitter = new Splitter(getBrowserView(),WB_HSCROLL);
+ m_pSplitter = VclPtr<Splitter>::Create(getBrowserView(),WB_HSCROLL);
m_pSplitter->SetPosSizePixel( ::Point(0,0), ::Size(nFrameWidth,0) );
m_pSplitter->SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetDialogColor() ) );
- m_pTreeView = new DBTreeView(getBrowserView(), WB_TABSTOP | WB_BORDER);
+ m_pTreeView = VclPtr<DBTreeView>::Create(getBrowserView(), WB_TABSTOP | WB_BORDER);
m_pTreeView->SetPreExpandHandler(LINK(this, SbaTableQueryBrowser, OnExpandEntry));
m_pTreeView->setCopyHandler(LINK(this, SbaTableQueryBrowser, OnCopyEntry));
diff --git a/dbaccess/source/ui/control/ColumnControlWindow.cxx b/dbaccess/source/ui/control/ColumnControlWindow.cxx
index a4d44cbc6464..36aff78e2f96 100644
--- a/dbaccess/source/ui/control/ColumnControlWindow.cxx
+++ b/dbaccess/source/ui/control/ColumnControlWindow.cxx
@@ -47,11 +47,6 @@ OColumnControlWindow::OColumnControlWindow(vcl::Window* pParent
m_aLocale = SvtSysLocale().GetLanguageTag().getLocale();
}
-OColumnControlWindow::~OColumnControlWindow()
-{
-
-}
-
void OColumnControlWindow::ActivateAggregate( EControlType eType )
{
switch(eType )
diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx
index 7643cfeb50e0..a6fb6d753efe 100644
--- a/dbaccess/source/ui/control/FieldDescControl.cxx
+++ b/dbaccess/source/ui/control/FieldDescControl.cxx
@@ -76,17 +76,15 @@ using namespace ::com::sun::star::util;
namespace
{
- template< typename T1, typename T2> void lcl_HideAndDeleteControl(short& _nPos,T1** _pControl,T2** _pControlText)
+ template< typename T1, typename T2> void lcl_HideAndDeleteControl(short& _nPos,VclPtr<T1>& _pControl, VclPtr<T2>& _pControlText)
{
- if ( *_pControl )
+ if ( _pControl )
{
--_nPos;
- (*_pControl)->Hide();
- (*_pControlText)->Hide();
- delete *_pControl;
- delete *_pControlText;
- (*_pControl) = NULL;
- (*_pControlText) = NULL;
+ _pControl->Hide();
+ _pControlText->Hide();
+ _pControl.disposeAndClear();
+ _pControlText.disposeAndClear();
}
}
@@ -141,8 +139,8 @@ OFieldDescControl::OFieldDescControl( vcl::Window* pParent, OTableDesignHelpBar*
void OFieldDescControl::Contruct()
{
- m_pVertScroll = new ScrollBar(this, WB_VSCROLL | WB_REPEAT | WB_DRAG);
- m_pHorzScroll = new ScrollBar(this, WB_HSCROLL | WB_REPEAT | WB_DRAG);
+ m_pVertScroll = VclPtr<ScrollBar>::Create(this, WB_VSCROLL | WB_REPEAT | WB_DRAG);
+ m_pHorzScroll = VclPtr<ScrollBar>::Create(this, WB_HSCROLL | WB_REPEAT | WB_DRAG);
m_pVertScroll->SetScrollHdl(LINK(this, OFieldDescControl, OnScroll));
m_pHorzScroll->SetScrollHdl(LINK(this, OFieldDescControl, OnScroll));
m_pVertScroll->Show();
@@ -161,18 +159,13 @@ void OFieldDescControl::Contruct()
OFieldDescControl::~OFieldDescControl()
{
+ disposeOnce();
+}
- {
- boost::scoped_ptr<vcl::Window> aTemp(m_pVertScroll);
- m_pVertScroll = NULL;
- }
- {
- boost::scoped_ptr<vcl::Window> aTemp(m_pHorzScroll);
- m_pHorzScroll = NULL;
- }
+void OFieldDescControl::dispose()
+{
if ( m_bAdded )
::dbaui::notifySystemWindow(this,this,::comphelper::mem_fun(&TaskPaneList::RemoveWindow));
- pLastFocusWindow = NULL;
// Destroy children
DeactivateAggregate( tpDefault );
@@ -187,6 +180,37 @@ OFieldDescControl::~OFieldDescControl()
DeactivateAggregate( tpColumnName );
DeactivateAggregate( tpType );
DeactivateAggregate( tpAutoIncrementValue );
+ pHelp.clear();
+ pLastFocusWindow.clear();
+ m_pActFocusWindow.clear();
+ pDefaultText.clear();
+ pRequiredText.clear();
+ pAutoIncrementText.clear();
+ pTextLenText.clear();
+ pNumTypeText.clear();
+ pLengthText.clear();
+ pScaleText.clear();
+ pFormatText.clear();
+ pBoolDefaultText.clear();
+ m_pColumnNameText.clear();
+ m_pTypeText.clear();
+ m_pAutoIncrementValueText.clear();
+ pRequired.clear();
+ pNumType.clear();
+ pAutoIncrement.clear();
+ pDefault.clear();
+ pTextLen.clear();
+ pLength.clear();
+ pScale.clear();
+ pFormatSample.clear();
+ pBoolDefault.clear();
+ m_pColumnName.clear();
+ m_pType.clear();
+ m_pAutoIncrementValue.clear();
+ pFormat.clear();
+ m_pVertScroll.clear();
+ m_pHorzScroll.clear();
+ TabPage::dispose();
}
OUString OFieldDescControl::BoolStringPersistent(const OUString& rUIString) const
@@ -680,8 +704,8 @@ void OFieldDescControl::ArrangeAggregates()
// A Control's description
struct AGGREGATE_DESCRIPTION
{
- Control* pctrlInputControl; // The actual Control for input
- Control* pctrlTextControl; // The corresponding Label
+ VclPtr<Control> pctrlInputControl; // The actual Control for input
+ VclPtr<Control> pctrlTextControl; // The corresponding Label
sal_uInt16 nPosSizeArgument; // The second argument for SetPosSize
};
AGGREGATE_DESCRIPTION adAggregates[] = {
@@ -717,8 +741,8 @@ void OFieldDescControl::ArrangeAggregates()
{
if (adAggregates[i].pctrlInputControl)
{
- SetPosSize(&adAggregates[i].pctrlTextControl, nCurrentControlPos, 0);
- SetPosSize(&adAggregates[i].pctrlInputControl, nCurrentControlPos, adAggregates[i].nPosSizeArgument);
+ SetPosSize(adAggregates[i].pctrlTextControl, nCurrentControlPos, 0);
+ SetPosSize(adAggregates[i].pctrlInputControl, nCurrentControlPos, adAggregates[i].nPosSizeArgument);
// Set the z-order in a way such that the Controls can be traversed in the same sequence in which they have been arranged here
adAggregates[i].pctrlTextControl->SetZOrder(pZOrderPredecessor, pZOrderPredecessor ? WINDOW_ZORDER_BEHIND : WINDOW_ZORDER_FIRST);
@@ -758,7 +782,7 @@ void OFieldDescControl::ActivateAggregate( EControlType eType )
return;
m_nPos++;
pDefaultText = CreateText(STR_DEFAULT_VALUE);
- pDefault = new OPropEditCtrl( this, STR_HELP_DEFAULT_VALUE, FIELD_PROPERTY_DEFAULT, WB_BORDER );
+ pDefault = VclPtr<OPropEditCtrl>::Create( this, STR_HELP_DEFAULT_VALUE, FIELD_PROPERTY_DEFAULT, WB_BORDER );
InitializeControl(pDefault,HID_TAB_ENT_DEFAULT,false);
break;
case tpAutoIncrementValue:
@@ -766,7 +790,7 @@ void OFieldDescControl::ActivateAggregate( EControlType eType )
return;
m_nPos++;
m_pAutoIncrementValueText = CreateText(STR_AUTOINCREMENT_VALUE);
- m_pAutoIncrementValue = new OPropEditCtrl( this, STR_HELP_AUTOINCREMENT_VALUE, FIELD_PROPERTY_AUTOINCREMENT, WB_BORDER );
+ m_pAutoIncrementValue = VclPtr<OPropEditCtrl>::Create( this, STR_HELP_AUTOINCREMENT_VALUE, FIELD_PROPERTY_AUTOINCREMENT, WB_BORDER );
m_pAutoIncrementValue->SetText( getAutoIncrementValue() );
InitializeControl(m_pAutoIncrementValue,HID_TAB_AUTOINCREMENTVALUE,false);
break;
@@ -781,7 +805,7 @@ void OFieldDescControl::ActivateAggregate( EControlType eType )
{
m_nPos++;
pRequiredText = CreateText(STR_FIELD_REQUIRED);
- pRequired = new OPropListBoxCtrl( this, STR_HELP_FIELD_REQUIRED, FIELD_PROPERTY_REQUIRED, WB_DROPDOWN);
+ pRequired = VclPtr<OPropListBoxCtrl>::Create( this, STR_HELP_FIELD_REQUIRED, FIELD_PROPERTY_REQUIRED, WB_DROPDOWN);
pRequired->InsertEntry( aYes );
pRequired->InsertEntry( aNo );
@@ -797,7 +821,7 @@ void OFieldDescControl::ActivateAggregate( EControlType eType )
return;
m_nPos++;
pAutoIncrementText = CreateText(STR_FIELD_AUTOINCREMENT);
- pAutoIncrement = new OPropListBoxCtrl( this, STR_HELP_AUTOINCREMENT, FIELD_PROPERTY_AUTOINC, WB_DROPDOWN );
+ pAutoIncrement = VclPtr<OPropListBoxCtrl>::Create( this, STR_HELP_AUTOINCREMENT, FIELD_PROPERTY_AUTOINC, WB_DROPDOWN );
pAutoIncrement->InsertEntry( aYes );
pAutoIncrement->InsertEntry( aNo );
pAutoIncrement->SelectEntryPos(0);
@@ -817,7 +841,7 @@ void OFieldDescControl::ActivateAggregate( EControlType eType )
return;
m_nPos++;
m_pTypeText = CreateText(STR_TAB_FIELD_DATATYPE);
- m_pType = new OPropListBoxCtrl( this, STR_HELP_AUTOINCREMENT, FIELD_PROPERTY_TYPE, WB_DROPDOWN );
+ m_pType = VclPtr<OPropListBoxCtrl>::Create( this, STR_HELP_AUTOINCREMENT, FIELD_PROPERTY_TYPE, WB_DROPDOWN );
m_pType->SetDropDownLineCount(20);
{
const OTypeInfoMap* pTypeInfo = getTypeInfo();
@@ -850,7 +874,7 @@ void OFieldDescControl::ActivateAggregate( EControlType eType )
DBG_UNHANDLED_EXCEPTION();
}
m_pColumnNameText = CreateText(STR_TAB_FIELD_NAME);
- m_pColumnName = new OPropColumnEditCtrl( this,
+ m_pColumnName = VclPtr<OPropColumnEditCtrl>::Create( this,
aTmpString,
STR_HELP_DEFAULT_VALUE,
FIELD_PROPERTY_COLUMNNAME,
@@ -867,7 +891,7 @@ void OFieldDescControl::ActivateAggregate( EControlType eType )
m_nPos++;
pNumTypeText = CreateText(STR_NUMERIC_TYPE);
- pNumType = new OPropListBoxCtrl( this, STR_HELP_NUMERIC_TYPE, FIELD_PROPERTY_NUMTYPE, WB_DROPDOWN );
+ pNumType = VclPtr<OPropListBoxCtrl>::Create( this, STR_HELP_NUMERIC_TYPE, FIELD_PROPERTY_NUMTYPE, WB_DROPDOWN );
pNumType->SetDropDownLineCount(5);
pNumType->InsertEntry( OUString("Byte") );
@@ -901,12 +925,12 @@ void OFieldDescControl::ActivateAggregate( EControlType eType )
m_nPos++;
pFormatText = CreateText(STR_FORMAT);
- pFormatSample = new OPropEditCtrl( this, STR_HELP_FORMAT_CODE, -1, WB_BORDER );
+ pFormatSample = VclPtr<OPropEditCtrl>::Create( this, STR_HELP_FORMAT_CODE, -1, WB_BORDER );
pFormatSample->SetReadOnly(true);
pFormatSample->Enable(false);
InitializeControl(pFormatSample,HID_TAB_ENT_FORMAT_SAMPLE,false);
- pFormat = new PushButton( this, ModuleRes(PB_FORMAT) );
+ pFormat = VclPtr<PushButton>::Create( this, ModuleRes(PB_FORMAT) );
const sal_Int32 nControlHeight = GetMaxControlHeight();
pFormat->SetSizePixel(Size(nControlHeight, nControlHeight));
pFormat->SetClickHdl( LINK( this, OFieldDescControl, FormatClickHdl ) );
@@ -921,7 +945,7 @@ void OFieldDescControl::ActivateAggregate( EControlType eType )
m_nPos++;
pBoolDefaultText = CreateText(STR_DEFAULT_VALUE);
- pBoolDefault = new OPropListBoxCtrl( this, STR_HELP_BOOL_DEFAULT, FIELD_PROPERTY_BOOL_DEFAULT, WB_DROPDOWN );
+ pBoolDefault = VclPtr<OPropListBoxCtrl>::Create( this, STR_HELP_BOOL_DEFAULT, FIELD_PROPERTY_BOOL_DEFAULT, WB_DROPDOWN );
pBoolDefault->SetDropDownLineCount(3);
pBoolDefault->InsertEntry(OUString(ModuleRes(STR_VALUE_NONE)));
pBoolDefault->InsertEntry(aYes);
@@ -943,17 +967,17 @@ void OFieldDescControl::InitializeControl(Control* _pControl,const OString& _sHe
_pControl->EnableClipSiblings();
}
-FixedText* OFieldDescControl::CreateText(sal_uInt16 _nTextRes)
+VclPtr<FixedText> OFieldDescControl::CreateText(sal_uInt16 _nTextRes)
{
- FixedText* pFixedText = new FixedText( this );
+ VclPtrInstance<FixedText> pFixedText( this );
pFixedText->SetText( ModuleRes(_nTextRes) );
pFixedText->EnableClipSiblings();
return pFixedText;
}
-OPropNumericEditCtrl* OFieldDescControl::CreateNumericControl(sal_uInt16 _nHelpStr,short _nProperty,const OString& _sHelpId)
+VclPtr<OPropNumericEditCtrl> OFieldDescControl::CreateNumericControl(sal_uInt16 _nHelpStr,short _nProperty,const OString& _sHelpId)
{
- OPropNumericEditCtrl* pControl = new OPropNumericEditCtrl( this, _nHelpStr, _nProperty, WB_BORDER );
+ VclPtrInstance<OPropNumericEditCtrl> pControl( this, _nHelpStr, _nProperty, WB_BORDER );
pControl->SetDecimalDigits(0);
pControl->SetMin(0);
pControl->SetMax(0x7FFFFFFF); // Should be changed outside, if needed
@@ -971,62 +995,61 @@ void OFieldDescControl::DeactivateAggregate( EControlType eType )
switch( eType )
{
case tpDefault:
- lcl_HideAndDeleteControl(m_nPos,&pDefault,&pDefaultText);
+ lcl_HideAndDeleteControl(m_nPos,pDefault,pDefaultText);
break;
case tpAutoIncrementValue:
- lcl_HideAndDeleteControl(m_nPos,&m_pAutoIncrementValue,&m_pAutoIncrementValueText);
+ lcl_HideAndDeleteControl(m_nPos,m_pAutoIncrementValue,m_pAutoIncrementValueText);
break;
case tpColumnName:
- lcl_HideAndDeleteControl(m_nPos,&m_pColumnName,&m_pColumnNameText);
+ lcl_HideAndDeleteControl(m_nPos,m_pColumnName,m_pColumnNameText);
break;
case tpType:
- lcl_HideAndDeleteControl(m_nPos,&m_pType,&m_pTypeText);
+ lcl_HideAndDeleteControl(m_nPos,m_pType,m_pTypeText);
break;
case tpAutoIncrement:
- lcl_HideAndDeleteControl(m_nPos,&pAutoIncrement,&pAutoIncrementText);
+ lcl_HideAndDeleteControl(m_nPos,pAutoIncrement,pAutoIncrementText);
break;
case tpRequired:
- lcl_HideAndDeleteControl(m_nPos,&pRequired,&pRequiredText);
+ lcl_HideAndDeleteControl(m_nPos,pRequired,pRequiredText);
break;
case tpTextLen:
- lcl_HideAndDeleteControl(m_nPos,&pTextLen,&pTextLenText);
+ lcl_HideAndDeleteControl(m_nPos,pTextLen,pTextLenText);
break;
case tpNumType:
- lcl_HideAndDeleteControl(m_nPos,&pNumType,&pNumTypeText);
+ lcl_HideAndDeleteControl(m_nPos,pNumType,pNumTypeText);
break;
case tpLength:
- lcl_HideAndDeleteControl(m_nPos,&pLength,&pLengthText);
+ lcl_HideAndDeleteControl(m_nPos,pLength,pLengthText);
break;
case tpScale:
- lcl_HideAndDeleteControl(m_nPos,&pScale,&pScaleText);
+ lcl_HideAndDeleteControl(m_nPos,pScale,pScaleText);
break;
case tpFormat:
// TODO: we have to check if we have to increment m_nPos again
- lcl_HideAndDeleteControl(m_nPos,&pFormat,&pFormatText);
+ lcl_HideAndDeleteControl(m_nPos,pFormat,pFormatText);
if ( pFormatSample )
{
pFormatSample->Hide();
- delete pFormatSample;
- pFormatSample = NULL;
+ pFormatSample.disposeAndClear();
}
break;
case tpBoolDefault:
- lcl_HideAndDeleteControl(m_nPos,&pBoolDefault,&pBoolDefaultText);
+ lcl_HideAndDeleteControl(m_nPos,pBoolDefault,pBoolDefaultText);
break;
}
}
-void OFieldDescControl::SetPosSize( Control** ppControl, long nRow, sal_uInt16 nCol )
+void OFieldDescControl::SetPosSize( VclPtr<Control>& rControl, long nRow, sal_uInt16 nCol )
{
// Calculate size
@@ -1077,18 +1100,18 @@ void OFieldDescControl::SetPosSize( Control** ppControl, long nRow, sal_uInt16 n
aPosition.X() = 0;
}
- (*ppControl)->SetSizePixel( aSize );
- aSize = (*ppControl)->GetSizePixel( );
+ rControl->SetSizePixel( aSize );
+ aSize = rControl->GetSizePixel( );
const sal_Int32 nControl_Spacing_y = LogicToPixel(Size(0, CONTROL_SPACING_Y),MAP_APPFONT).Height();
aPosition.Y() += ((nRow+1)*nControl_Spacing_y) +
(nRow*nControlHeight);
// Display Control
- (*ppControl)->SetPosSizePixel( aPosition, aSize );
- aSize = (*ppControl)->GetSizePixel();
+ rControl->SetPosSizePixel( aPosition, aSize );
+ aSize = rControl->GetSizePixel();
- (*ppControl)->Show();
+ rControl->Show();
}
void OFieldDescControl::DisplayData(OFieldDescription* pFieldDescr )
@@ -1453,7 +1476,7 @@ IMPL_LINK(OFieldDescControl, OnControlFocusGot, Control*, pControl )
if (pControl == pFormat)
strHelpText = ModuleRes(STR_HELP_FORMAT_BUTTON);
- if (!strHelpText.isEmpty() && (pHelp != NULL))
+ if (!strHelpText.isEmpty() && (pHelp != nullptr))
pHelp->SetHelpText(strHelpText);
m_pActFocusWindow = pControl;
@@ -1579,30 +1602,30 @@ void OFieldDescControl::LoseFocus()
bool OFieldDescControl::isCopyAllowed()
{
- bool bAllowed = (m_pActFocusWindow != NULL) &&
+ bool bAllowed = (m_pActFocusWindow != nullptr) &&
(m_pActFocusWindow == pDefault || m_pActFocusWindow == pFormatSample ||
m_pActFocusWindow == pTextLen || m_pActFocusWindow == pLength ||
m_pActFocusWindow == pScale || m_pActFocusWindow == m_pColumnName ||
m_pActFocusWindow == m_pAutoIncrementValue) &&
- !static_cast<Edit*>(m_pActFocusWindow)->GetSelected().isEmpty();
+ !static_cast<Edit*>(m_pActFocusWindow.get())->GetSelected().isEmpty();
return bAllowed;
}
bool OFieldDescControl::isCutAllowed()
{
- bool bAllowed = (m_pActFocusWindow != NULL) &&
+ bool bAllowed = (m_pActFocusWindow != nullptr) &&
(m_pActFocusWindow == pDefault || m_pActFocusWindow == pFormatSample ||
m_pActFocusWindow == pTextLen || m_pActFocusWindow == pLength ||
m_pActFocusWindow == pScale || m_pActFocusWindow == m_pColumnName ||
m_pActFocusWindow == m_pAutoIncrementValue) &&
- !static_cast<Edit*>(m_pActFocusWindow)->GetSelected().isEmpty();
+ !static_cast<Edit*>(m_pActFocusWindow.get())->GetSelected().isEmpty();
return bAllowed;
}
bool OFieldDescControl::isPasteAllowed()
{
- bool bAllowed = (m_pActFocusWindow != NULL) &&
+ bool bAllowed = (m_pActFocusWindow != nullptr) &&
(m_pActFocusWindow == pDefault || m_pActFocusWindow == pFormatSample ||
m_pActFocusWindow == pTextLen || m_pActFocusWindow == pLength ||
m_pActFocusWindow == pScale || m_pActFocusWindow == m_pColumnName ||
@@ -1618,19 +1641,19 @@ bool OFieldDescControl::isPasteAllowed()
void OFieldDescControl::cut()
{
if(isCutAllowed())
- static_cast<Edit*>(m_pActFocusWindow)->Cut();
+ static_cast<Edit*>(m_pActFocusWindow.get())->Cut();
}
void OFieldDescControl::copy()
{
if(isCopyAllowed()) // this only checks if the focus window is valid
- static_cast<Edit*>(m_pActFocusWindow)->Copy();
+ static_cast<Edit*>(m_pActFocusWindow.get())->Copy();
}
void OFieldDescControl::paste()
{
if(m_pActFocusWindow) // this only checks if the focus window is valid
- static_cast<Edit*>(m_pActFocusWindow)->Paste();
+ static_cast<Edit*>(m_pActFocusWindow.get())->Paste();
}
bool OFieldDescControl::isTextFormat(const OFieldDescription* _pFieldDescr, sal_uInt32& _nFormatKey) const
diff --git a/dbaccess/source/ui/control/RelationControl.cxx b/dbaccess/source/ui/control/RelationControl.cxx
index 0a7035d6f7f6..f011e060a719 100644
--- a/dbaccess/source/ui/control/RelationControl.cxx
+++ b/dbaccess/source/ui/control/RelationControl.cxx
@@ -59,7 +59,7 @@ namespace dbaui
{
friend class OTableListBoxControl;
- ::std::unique_ptr< ::svt::ListBoxControl> m_pListCell;
+ VclPtr< ::svt::ListBoxControl> m_pListCell;
TTableConnectionData::value_type m_pConnData;
OTableListBoxControl* m_pBoxControl;
long m_nDataPos;
@@ -83,7 +83,6 @@ namespace dbaui
{
m_pBoxControl = pController;
}
- virtual ~ORelationControl();
/** searches for a connection between these two tables
@param _pSource
@@ -102,6 +101,8 @@ namespace dbaui
void lateInit();
protected:
+ virtual ~ORelationControl() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE { m_pListCell.disposeAndClear(); ORelationControl_Base::dispose(); }
virtual void Resize() SAL_OVERRIDE;
virtual Size GetOptimalSize() const SAL_OVERRIDE;
virtual bool PreNotify(NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -144,10 +145,6 @@ namespace dbaui
return new ORelationControl(pParent);
}
- ORelationControl::~ORelationControl()
- {
- }
-
void ORelationControl::Init(const TTableConnectionData::value_type& _pConnData)
{
@@ -170,7 +167,7 @@ namespace dbaui
InsertDataColumn( DEST_COLUMN, m_pConnData->getReferencedTable()->GetWinName(), 100);
// If the Defs do not yet exits, we need to set them with SetSource-/-DestDef
- m_pListCell.reset( new ListBoxControl( &GetDataWindow() ) );
+ m_pListCell.reset( VclPtr<ListBoxControl>::Create( &GetDataWindow() ) );
// set browse mode
SetMode( BrowserMode::COLUMNSELECTION |
diff --git a/dbaccess/source/ui/control/TableGrantCtrl.cxx b/dbaccess/source/ui/control/TableGrantCtrl.cxx
index 122f230d4afb..1496a3610fcd 100644
--- a/dbaccess/source/ui/control/TableGrantCtrl.cxx
+++ b/dbaccess/source/ui/control/TableGrantCtrl.cxx
@@ -71,16 +71,22 @@ OTableGrantControl::OTableGrantControl( vcl::Window* pParent, WinBits nBits)
OTableGrantControl::~OTableGrantControl()
{
+ disposeOnce();
+}
+
+void OTableGrantControl::dispose()
+{
if (m_nDeactivateEvent)
{
Application::RemoveUserEvent(m_nDeactivateEvent);
m_nDeactivateEvent = 0;
}
- delete m_pCheckCell;
- delete m_pEdit;
+ m_pCheckCell.disposeAndClear();
+ m_pEdit.disposeAndClear();
m_xTables = NULL;
+ ::svt::EditBrowseBox::dispose();
}
void OTableGrantControl::setTablesSupplier(const Reference< XTablesSupplier >& _xTablesSup)
@@ -122,10 +128,10 @@ void OTableGrantControl::Init()
// ComboBox instanzieren
if(!m_pCheckCell)
{
- m_pCheckCell = new CheckBoxControl( &GetDataWindow() );
+ m_pCheckCell = VclPtr<CheckBoxControl>::Create( &GetDataWindow() );
m_pCheckCell->GetBox().EnableTriState(false);
- m_pEdit = new Edit( &GetDataWindow() );
+ m_pEdit = VclPtr<Edit>::Create( &GetDataWindow() );
m_pEdit->SetReadOnly();
m_pEdit->Enable(false);
}
diff --git a/dbaccess/source/ui/control/VertSplitView.cxx b/dbaccess/source/ui/control/VertSplitView.cxx
index 5313d4213cb6..5644fbbaf4bf 100644
--- a/dbaccess/source/ui/control/VertSplitView.cxx
+++ b/dbaccess/source/ui/control/VertSplitView.cxx
@@ -39,7 +39,15 @@ OSplitterView::OSplitterView(vcl::Window* _pParent,bool _bVertical) : Window(_pP
OSplitterView::~OSplitterView()
{
- m_pRight = m_pLeft = NULL;
+ disposeOnce();
+}
+
+void OSplitterView::dispose()
+{
+ m_pSplitter.clear();
+ m_pLeft.clear();
+ m_pRight.clear();
+ vcl::Window::dispose();
}
IMPL_LINK( OSplitterView, SplitHdl, Splitter*, /*pSplit*/ )
diff --git a/dbaccess/source/ui/control/charsetlistbox.cxx b/dbaccess/source/ui/control/charsetlistbox.cxx
index 9daa8b9be5de..d7a510b4e255 100644
--- a/dbaccess/source/ui/control/charsetlistbox.cxx
+++ b/dbaccess/source/ui/control/charsetlistbox.cxx
@@ -43,10 +43,6 @@ namespace dbaui
return new CharSetListBox(pParent);
}
- CharSetListBox::~CharSetListBox()
- {
- }
-
void CharSetListBox::SelectEntryByIanaName( const OUString& _rIanaName )
{
OCharsetDisplay::const_iterator aFind = m_aCharSets.findIanaName( _rIanaName );
diff --git a/dbaccess/source/ui/control/curledit.cxx b/dbaccess/source/ui/control/curledit.cxx
index 4dc9d7fffb52..917e8870c43a 100644
--- a/dbaccess/source/ui/control/curledit.cxx
+++ b/dbaccess/source/ui/control/curledit.cxx
@@ -40,11 +40,14 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeConnectionURLEdit(vcl:
OConnectionURLEdit::~OConnectionURLEdit()
{
- // delete my sub controls
- Edit* pSubEdit = GetSubEdit();
- SetSubEdit(NULL);
- delete pSubEdit;
- delete m_pForcedPrefix;
+ disposeOnce();
+}
+
+void OConnectionURLEdit::dispose()
+{
+ SetSubEdit(nullptr);
+ m_pForcedPrefix.disposeAndClear();
+ Edit::dispose();
}
void OConnectionURLEdit::SetTextNoPrefix(const OUString& _rText)
@@ -86,10 +89,10 @@ void OConnectionURLEdit::SetText(const OUString& _rStr, const Selection& /*_rNew
{
// create new sub controls, if necessary
if (!GetSubEdit())
- SetSubEdit(new Edit(this, 0));
+ SetSubEdit(VclPtr<Edit>::Create(this, 0));
if ( !m_pForcedPrefix )
{
- m_pForcedPrefix = new FixedText(this, WB_VCENTER);
+ m_pForcedPrefix = VclPtr<FixedText>::Create(this, WB_VCENTER);
// we use a gray background for the fixed text
StyleSettings aSystemStyle = Application::GetSettings().GetStyleSettings();
diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx
index 2d4e0cea22aa..afd7b1b60fb0 100644
--- a/dbaccess/source/ui/control/dbtreelistbox.cxx
+++ b/dbaccess/source/ui/control/dbtreelistbox.cxx
@@ -84,7 +84,13 @@ void DBTreeListBox::init()
DBTreeListBox::~DBTreeListBox()
{
+ disposeOnce();
+}
+
+void DBTreeListBox::dispose()
+{
implStopSelectionTimer();
+ SvTreeListBox::dispose();
}
SvTreeListEntry* DBTreeListBox::GetEntryPosByName( const OUString& aName, SvTreeListEntry* pStart, const IEntryFilter* _pFilter ) const
diff --git a/dbaccess/source/ui/control/marktree.cxx b/dbaccess/source/ui/control/marktree.cxx
index 2fc45e769fa2..ddd50aa66e58 100644
--- a/dbaccess/source/ui/control/marktree.cxx
+++ b/dbaccess/source/ui/control/marktree.cxx
@@ -37,8 +37,13 @@ OMarkableTreeListBox::OMarkableTreeListBox( vcl::Window* pParent, WinBits nWinSt
OMarkableTreeListBox::~OMarkableTreeListBox()
{
- delete m_pCheckButton;
+ disposeOnce();
+}
+void OMarkableTreeListBox::dispose()
+{
+ delete m_pCheckButton;
+ DBTreeListBox::dispose();
}
void OMarkableTreeListBox::Paint(const Rectangle& _rRect)
diff --git a/dbaccess/source/ui/control/sqledit.cxx b/dbaccess/source/ui/control/sqledit.cxx
index ff4007f729f9..9048294db7c3 100644
--- a/dbaccess/source/ui/control/sqledit.cxx
+++ b/dbaccess/source/ui/control/sqledit.cxx
@@ -105,6 +105,11 @@ OSqlEdit::OSqlEdit( OQueryTextView* pParent, WinBits nWinStyle ) :
OSqlEdit::~OSqlEdit()
{
+ disposeOnce();
+}
+
+void OSqlEdit::dispose()
+{
if (m_timerUndoActionCreation.IsActive())
m_timerUndoActionCreation.Stop();
css::uno::Reference< css::beans::XMultiPropertySet > n;
@@ -116,6 +121,8 @@ OSqlEdit::~OSqlEdit()
n->removePropertiesChangeListener(m_listener.get());
}
m_ColorConfig.RemoveListener(this);
+ m_pView.clear();
+ MultiLineEditSyntaxHighlight::dispose();
}
void OSqlEdit::KeyInput( const KeyEvent& rKEvt )
diff --git a/dbaccess/source/ui/control/toolboxcontroller.cxx b/dbaccess/source/ui/control/toolboxcontroller.cxx
index cb6d3061ad46..079e4a5f61e8 100644
--- a/dbaccess/source/ui/control/toolboxcontroller.cxx
+++ b/dbaccess/source/ui/control/toolboxcontroller.cxx
@@ -131,7 +131,7 @@ namespace dbaui
for (; aIter != aEnd; ++aIter)
addStatusListener(aIter->first);
- ToolBox* pToolBox = static_cast<ToolBox*>(VCLUnoHelper::GetWindow(getParent()));
+ VclPtr< ToolBox > pToolBox = static_cast<ToolBox*>(VCLUnoHelper::GetWindow(getParent()).get());
if ( pToolBox )
{
sal_uInt16 nCount = pToolBox->GetItemCount();
@@ -169,7 +169,7 @@ namespace dbaui
{
m_aCommandURL = aFind->first;
- ToolBox* pToolBox = static_cast<ToolBox*>(VCLUnoHelper::GetWindow(getParent()));
+ VclPtr< ToolBox > pToolBox = static_cast<ToolBox*>(VCLUnoHelper::GetWindow(getParent()).get());
lcl_copy(pMenu.get(),nItemId,i,pToolBox,m_nToolBoxId, m_aCommandURL);
break;
}
@@ -228,7 +228,7 @@ namespace dbaui
SolarMutexGuard aSolarMutexGuard;
::osl::MutexGuard aGuard(m_aMutex);
- ToolBox* pToolBox = static_cast<ToolBox*>(VCLUnoHelper::GetWindow(getParent()));
+ VclPtr< ToolBox > pToolBox = static_cast<ToolBox*>(VCLUnoHelper::GetWindow(getParent()).get());
::std::unique_ptr<PopupMenu> pMenu = getMenu();
sal_uInt16 nSelected = pMenu->Execute(pToolBox, pToolBox->GetItemRect( m_nToolBoxId ),POPUPMENU_EXECUTE_DOWN);
diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx b/dbaccess/source/ui/dlg/CollectionView.cxx
index aa50eb9bc4ca..1ceb8a62931d 100644
--- a/dbaccess/source/ui/dlg/CollectionView.cxx
+++ b/dbaccess/source/ui/dlg/CollectionView.cxx
@@ -91,10 +91,21 @@ OCollectionView::OCollectionView( vcl::Window * pParent
m_pPB_OK->SetClickHdl( LINK( this, OCollectionView, Save_Click ) );
}
-OCollectionView::~OCollectionView( )
+OCollectionView::~OCollectionView()
{
+ disposeOnce();
}
+void OCollectionView::dispose()
+{
+ m_pFTCurrentPath.clear();
+ m_pNewFolder.clear();
+ m_pUp.clear();
+ m_pView.clear();
+ m_pName.clear();
+ m_pPB_OK.clear();
+ ModalDialog::dispose();
+}
IMPL_LINK_NOARG(OCollectionView, Save_Click)
{
@@ -169,8 +180,8 @@ IMPL_LINK_NOARG(OCollectionView, Save_Click)
Reference< XContent> xContent;
if ( xNameContainer->hasByName(sName) )
{
- QueryBox aBox( this, WB_YES_NO, ModuleRes( STR_ALREADYEXISTOVERWRITE ) );
- if ( aBox.Execute() != RET_YES )
+ ScopedVclPtrInstance< QueryBox > aBox( this, WB_YES_NO, ModuleRes( STR_ALREADYEXISTOVERWRITE ) );
+ if ( aBox->Execute() != RET_YES )
return 0;
}
m_pName->SetText(sName);
diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
index a02b5d68b80b..8bf6989c9ab9 100644
--- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
@@ -91,7 +91,6 @@ namespace dbaui
: OGenericAdministrationPage(pParent, _rId, _rUIXMLDescription, _rCoreAttrs)
, m_bUserGrabFocus(false)
, m_pCollection(NULL)
- , m_bDelete(false)
{
get(m_pFT_Connection, "browseurllabel");
get(m_pConnectionURL, "browseurl");
@@ -110,13 +109,17 @@ namespace dbaui
OConnectionHelper::~OConnectionHelper()
{
- if(m_bDelete)
- {
- delete m_pFT_Connection;
- delete m_pConnectionURL;
- delete m_pPB_Connection;
- delete m_pPB_CreateDB;
- }
+ disposeOnce();
+ }
+
+ void OConnectionHelper::dispose()
+ {
+ // FIXME: used to have an if (m_bDelete) ...
+ m_pFT_Connection.disposeAndClear();
+ m_pConnectionURL.disposeAndClear();
+ m_pPB_Connection.disposeAndClear();
+ m_pPB_CreateDB.disposeAndClear();
+ OGenericAdministrationPage::dispose();
}
void OConnectionHelper::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue)
@@ -306,16 +309,16 @@ namespace dbaui
aProfiles.insert(pArray[index]);
// execute the select dialog
- ODatasourceSelectDialog aSelector(GetParent(), aProfiles);
+ ScopedVclPtrInstance< ODatasourceSelectDialog > aSelector(GetParent(), aProfiles);
OUString sOldProfile=getURLNoPrefix();
if (!sOldProfile.isEmpty())
- aSelector.Select(sOldProfile);
+ aSelector->Select(sOldProfile);
else
- aSelector.Select(xMozillaBootstrap->getDefaultProfile(profileType));
+ aSelector->Select(xMozillaBootstrap->getDefaultProfile(profileType));
- if ( RET_OK == aSelector.Execute() )
- setURLNoPrefix(aSelector.GetSelected());
+ if ( RET_OK == aSelector->Execute() )
+ setURLNoPrefix(aSelector->GetSelected());
break;
}
case ::dbaccess::DST_FIREBIRD:
@@ -476,8 +479,8 @@ namespace dbaui
sQuery = sQuery.replaceFirst("$path$", aTransformer.get(OFileNotation::N_SYSTEM));
m_bUserGrabFocus = false;
- QueryBox aQuery(GetParent(), WB_YES_NO | WB_DEF_YES, sQuery);
- sal_Int32 nQueryResult = aQuery.Execute();
+ ScopedVclPtrInstance< QueryBox > aQuery(GetParent(), WB_YES_NO | WB_DEF_YES, sQuery);
+ sal_Int32 nQueryResult = aQuery->Execute();
m_bUserGrabFocus = true;
switch (nQueryResult)
@@ -493,8 +496,8 @@ namespace dbaui
sQuery = sQuery.replaceFirst("$name$", aTransformer.get(OFileNotation::N_SYSTEM));
m_bUserGrabFocus = false;
- QueryBox aWhatToDo(GetParent(), WB_RETRY_CANCEL | WB_DEF_RETRY, sQuery);
- nQueryResult = aWhatToDo.Execute();
+ ScopedVclPtrInstance< QueryBox > aWhatToDo(GetParent(), WB_RETRY_CANCEL | WB_DEF_RETRY, sQuery);
+ nQueryResult = aWhatToDo->Execute();
m_bUserGrabFocus = true;
if (RET_RETRY == nQueryResult)
diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.hxx b/dbaccess/source/ui/dlg/ConnectionHelper.hxx
index 117295bea89d..9fd69e7459c4 100644
--- a/dbaccess/source/ui/dlg/ConnectionHelper.hxx
+++ b/dbaccess/source/ui/dlg/ConnectionHelper.hxx
@@ -42,10 +42,11 @@ namespace dbaui
public:
OConnectionHelper( vcl::Window* pParent, const OString& _rId, const OUString& _rUIXMLDescription, const SfxItemSet& _rCoreAttrs);
virtual ~OConnectionHelper();
- FixedText *m_pFT_Connection;
- OConnectionURLEdit *m_pConnectionURL;
- PushButton *m_pPB_Connection;
- PushButton *m_pPB_CreateDB;
+ virtual void dispose() SAL_OVERRIDE;
+ VclPtr<FixedText> m_pFT_Connection;
+ VclPtr<OConnectionURLEdit> m_pConnectionURL;
+ VclPtr<PushButton> m_pPB_Connection;
+ VclPtr<PushButton> m_pPB_CreateDB;
OUString m_eType; // the type can't be changed in this class, so we hold it as member.
public:
@@ -95,7 +96,6 @@ namespace dbaui
OUString impl_getURL( bool _bPrefix ) const;
void impl_setURL( const OUString& _rURL, bool _bPrefix );
void implUpdateURLDependentStates() const;
- bool m_bDelete;
};
} // namespace dbaui
diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx
index 4e7b8cc39987..ed99f813357d 100644
--- a/dbaccess/source/ui/dlg/ConnectionPage.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx
@@ -81,10 +81,11 @@ namespace dbaui
using namespace ::dbtools;
using namespace ::svt;
- SfxTabPage* OConnectionTabPage::Create( vcl::Window* pParent, const SfxItemSet* _rAttrSet )
+ VclPtr<SfxTabPage> OConnectionTabPage::Create( vcl::Window* pParent, const SfxItemSet* _rAttrSet )
{
- return ( new OConnectionTabPage( pParent, *_rAttrSet ) );
+ return VclPtr<SfxTabPage>(new OConnectionTabPage( pParent, *_rAttrSet ), SAL_NO_ACQUIRE);
}
+
// OConnectionTabPage
OConnectionTabPage::OConnectionTabPage(vcl::Window* pParent, const SfxItemSet& _rCoreAttrs)
:OConnectionHelper(pParent, "ConnectionPage", "dbaccess/ui/connectionpage.ui", _rCoreAttrs)
@@ -111,6 +112,21 @@ namespace dbaui
OConnectionTabPage::~OConnectionTabPage()
{
+ disposeOnce();
+ }
+
+ void OConnectionTabPage::dispose()
+ {
+ m_pFL2.clear();
+ m_pUserNameLabel.clear();
+ m_pUserName.clear();
+ m_pPasswordRequired.clear();
+ m_pFL3.clear();
+ m_pJavaDriverLabel.clear();
+ m_pJavaDriver.clear();
+ m_pTestJavaDriver.clear();
+ m_pTestConnection.clear();
+ OConnectionHelper::dispose();
}
void OConnectionTabPage::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue)
@@ -293,8 +309,8 @@ namespace dbaui
const sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
const OSQLMessageBox::MessageType mt = bSuccess ? OSQLMessageBox::Info : OSQLMessageBox::Error;
- OSQLMessageBox aMsg( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt );
- aMsg.Execute();
+ ScopedVclPtrInstance< OSQLMessageBox > aMsg( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt );
+ aMsg->Execute();
return 0L;
}
bool OConnectionTabPage::checkTestConnection()
diff --git a/dbaccess/source/ui/dlg/ConnectionPage.hxx b/dbaccess/source/ui/dlg/ConnectionPage.hxx
index 5e1c84fb88a1..2b4626d8fa08 100644
--- a/dbaccess/source/ui/dlg/ConnectionPage.hxx
+++ b/dbaccess/source/ui/dlg/ConnectionPage.hxx
@@ -36,26 +36,28 @@ namespace dbaui
{
protected:
// user authentification
- FixedText* m_pFL2;
- FixedText* m_pUserNameLabel;
- Edit* m_pUserName;
- CheckBox* m_pPasswordRequired;
+ VclPtr<FixedText> m_pFL2;
+ VclPtr<FixedText> m_pUserNameLabel;
+ VclPtr<Edit> m_pUserName;
+ VclPtr<CheckBox> m_pPasswordRequired;
// jdbc driver
- FixedText* m_pFL3;
- FixedText* m_pJavaDriverLabel;
- Edit* m_pJavaDriver;
- PushButton* m_pTestJavaDriver;
+ VclPtr<FixedText> m_pFL3;
+ VclPtr<FixedText> m_pJavaDriverLabel;
+ VclPtr<Edit> m_pJavaDriver;
+ VclPtr<PushButton> m_pTestJavaDriver;
// connection test
- PushButton* m_pTestConnection;
+ VclPtr<PushButton> m_pTestConnection;
// called when the test connection button was clicked
- DECL_LINK(OnTestJavaClickHdl,PushButton*);
- DECL_LINK(OnEditModified,Edit*);
+ DECL_LINK(OnTestJavaClickHdl, PushButton*);
+ DECL_LINK(OnEditModified, Edit*);
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* _rAttrSet );
+ virtual ~OConnectionTabPage();
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* _rAttrSet );
virtual bool FillItemSet (SfxItemSet* _rCoreAttrs) SAL_OVERRIDE;
virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE;
@@ -70,7 +72,6 @@ namespace dbaui
private:
OConnectionTabPage(vcl::Window* pParent, const SfxItemSet& _rCoreAttrs);
// nControlFlags is a combination of the CBTP_xxx-constants
- virtual ~OConnectionTabPage();
private:
/** enables the test connection button, if allowed
diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx
index db19ebb9d21b..b081ad82c565 100644
--- a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx
@@ -63,29 +63,29 @@ namespace dbaui
using namespace ::dbtools;
using namespace ::svt;
- OGenericAdministrationPage* OConnectionTabPageSetup::CreateDbaseTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
+ VclPtr<OGenericAdministrationPage> OConnectionTabPageSetup::CreateDbaseTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
{
- return new OConnectionTabPageSetup( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, STR_DBASE_HELPTEXT, STR_DBASE_HEADERTEXT, STR_DBASE_PATH_OR_FILE);
+ return VclPtr<OGenericAdministrationPage>( new OConnectionTabPageSetup ( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, STR_DBASE_HELPTEXT, STR_DBASE_HEADERTEXT, STR_DBASE_PATH_OR_FILE), SAL_NO_ACQUIRE );
}
- OGenericAdministrationPage* OConnectionTabPageSetup::CreateMSAccessTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
+ VclPtr<OGenericAdministrationPage> OConnectionTabPageSetup::CreateMSAccessTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
{
- return new OConnectionTabPageSetup( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, STR_MSACCESS_HELPTEXT, STR_MSACCESS_HEADERTEXT, STR_MSACCESS_MDB_FILE);
+ return VclPtr<OGenericAdministrationPage>( new OConnectionTabPageSetup( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, STR_MSACCESS_HELPTEXT, STR_MSACCESS_HEADERTEXT, STR_MSACCESS_MDB_FILE), SAL_NO_ACQUIRE );
}
- OGenericAdministrationPage* OConnectionTabPageSetup::CreateADOTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
+ VclPtr<OGenericAdministrationPage> OConnectionTabPageSetup::CreateADOTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
{
- return new OConnectionTabPageSetup( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, STR_ADO_HELPTEXT, STR_ADO_HEADERTEXT, STR_COMMONURL);
+ return VclPtr<OGenericAdministrationPage>( new OConnectionTabPageSetup( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, STR_ADO_HELPTEXT, STR_ADO_HEADERTEXT, STR_COMMONURL), SAL_NO_ACQUIRE );
}
- OGenericAdministrationPage* OConnectionTabPageSetup::CreateODBCTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
+ VclPtr<OGenericAdministrationPage> OConnectionTabPageSetup::CreateODBCTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
{
- return new OConnectionTabPageSetup( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, STR_ODBC_HELPTEXT, STR_ODBC_HEADERTEXT, STR_NAME_OF_ODBC_DATASOURCE);
+ return VclPtr<OGenericAdministrationPage>( new OConnectionTabPageSetup( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, STR_ODBC_HELPTEXT, STR_ODBC_HEADERTEXT, STR_NAME_OF_ODBC_DATASOURCE), SAL_NO_ACQUIRE );
}
- OGenericAdministrationPage* OConnectionTabPageSetup::CreateUserDefinedTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
+ VclPtr<OGenericAdministrationPage> OConnectionTabPageSetup::CreateUserDefinedTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
{
- return new OConnectionTabPageSetup( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, USHRT_MAX, USHRT_MAX, STR_COMMONURL);
+ return VclPtr<OGenericAdministrationPage>( new OConnectionTabPageSetup( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, USHRT_MAX, USHRT_MAX, STR_COMMONURL), SAL_NO_ACQUIRE );
}
OConnectionTabPageSetup::OConnectionTabPageSetup(vcl::Window* pParent, const OString& _rId, const OUString& _rUIXMLDescription, const SfxItemSet& _rCoreAttrs, sal_uInt16 _nHelpTextResId, sal_uInt16 _nHeaderResId, sal_uInt16 _nUrlResId)
@@ -121,6 +121,14 @@ namespace dbaui
OConnectionTabPageSetup::~OConnectionTabPageSetup()
{
+ disposeOnce();
+ }
+
+ void OConnectionTabPageSetup::dispose()
+ {
+ m_pHelpText.clear();
+ m_pHeaderText.clear();
+ OConnectionHelper::dispose();
}
void OConnectionTabPageSetup::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue)
diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx
index 5705c1530cc2..1f0a22c69cf4 100644
--- a/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx
+++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx
@@ -39,18 +39,20 @@ namespace dbaui
bool m_bUserGrabFocus : 1;
protected:
- FixedText *m_pHelpText;
- FixedText *m_pHeaderText;
+ VclPtr<FixedText> m_pHelpText;
+ VclPtr<FixedText> m_pHeaderText;
// called when the test connection button was clicked
DECL_LINK(OnEditModified,Edit*);
public:
- static OGenericAdministrationPage* CreateDbaseTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
- static OGenericAdministrationPage* CreateMSAccessTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
- static OGenericAdministrationPage* CreateADOTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
- static OGenericAdministrationPage* CreateODBCTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
- static OGenericAdministrationPage* CreateUserDefinedTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
+ virtual ~OConnectionTabPageSetup();
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<OGenericAdministrationPage> CreateDbaseTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
+ static VclPtr<OGenericAdministrationPage> CreateMSAccessTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
+ static VclPtr<OGenericAdministrationPage> CreateADOTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
+ static VclPtr<OGenericAdministrationPage> CreateODBCTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
+ static VclPtr<OGenericAdministrationPage> CreateUserDefinedTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
virtual bool FillItemSet (SfxItemSet* _rCoreAttrs) SAL_OVERRIDE;
@@ -71,7 +73,6 @@ namespace dbaui
OConnectionTabPageSetup(vcl::Window* pParent, const OString& _rId, const OUString& _rUIXMLDescription, const SfxItemSet& _rCoreAttrs, sal_uInt16 _nHelpTextResId, sal_uInt16 _nHeaderResId, sal_uInt16 _nUrlResId);
virtual bool checkTestConnection() SAL_OVERRIDE;
// nControlFlags is a combination of the CBTP_xxx-constants
- virtual ~OConnectionTabPageSetup();
};
} // namespace dbaui
diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
index 523b1aa9278d..c457c962c8fa 100644
--- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
+++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
@@ -60,9 +60,9 @@ namespace dbaui
{
using namespace ::com::sun::star;
- OGenericAdministrationPage* OTextConnectionPageSetup::CreateTextTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
+ VclPtr<OGenericAdministrationPage> OTextConnectionPageSetup::CreateTextTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
{
- return ( new OTextConnectionPageSetup( pParent, _rAttrSet ) );
+ return VclPtr<OTextConnectionPageSetup>::Create( pParent, _rAttrSet );
}
// OTextConnectionPageSetup
@@ -70,14 +70,19 @@ using namespace ::com::sun::star;
:OConnectionTabPageSetup(pParent, "DBWizTextPage", "dbaccess/ui/dbwiztextpage.ui", _rCoreAttrs, STR_TEXT_HELPTEXT, STR_TEXT_HEADERTEXT, STR_TEXT_PATH_OR_FILE)
{
- m_pTextConnectionHelper = new OTextConnectionHelper( get<VclVBox>("TextPageContainer"), TC_EXTENSION | TC_SEPARATORS );
+ m_pTextConnectionHelper = VclPtr<OTextConnectionHelper>::Create( get<VclVBox>("TextPageContainer"), TC_EXTENSION | TC_SEPARATORS );
m_pTextConnectionHelper->SetClickHandler(LINK( this, OTextConnectionPageSetup, ImplGetExtensionHdl ) );
}
OTextConnectionPageSetup::~OTextConnectionPageSetup()
{
- DELETEZ(m_pTextConnectionHelper);
+ disposeOnce();
+ }
+ void OTextConnectionPageSetup::dispose()
+ {
+ m_pTextConnectionHelper.disposeAndClear();
+ OConnectionTabPageSetup::dispose();
}
IMPL_LINK(OTextConnectionPageSetup, ImplGetExtensionHdl, OTextConnectionHelper*, /*_pTextConnectionHelper*/)
@@ -124,9 +129,9 @@ using namespace ::com::sun::star;
return m_pTextConnectionHelper->prepareLeave();
}
- OGenericAdministrationPage* OLDAPConnectionPageSetup::CreateLDAPTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
+ VclPtr<OGenericAdministrationPage> OLDAPConnectionPageSetup::CreateLDAPTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
{
- return ( new OLDAPConnectionPageSetup( pParent, _rAttrSet ) );
+ return VclPtr<OLDAPConnectionPageSetup>::Create( pParent, _rAttrSet );
}
// OLDAPPageSetup
@@ -151,6 +156,25 @@ using namespace ::com::sun::star;
SetRoadmapStateValue(false);
}
+ OLDAPConnectionPageSetup::~OLDAPConnectionPageSetup()
+ {
+ disposeOnce();
+ }
+
+ void OLDAPConnectionPageSetup::dispose()
+ {
+ m_pFTHelpText.clear();
+ m_pFTHostServer.clear();
+ m_pETHostServer.clear();
+ m_pFTBaseDN.clear();
+ m_pETBaseDN.clear();
+ m_pFTPortNumber.clear();
+ m_pNFPortNumber.clear();
+ m_pFTDefaultPortNumber.clear();
+ m_pCBUseSSL.clear();
+ OGenericAdministrationPage::dispose();
+ }
+
bool OLDAPConnectionPageSetup::FillItemSet( SfxItemSet* _rSet )
{
bool bChangedSomething = false;
@@ -217,9 +241,9 @@ using namespace ::com::sun::star;
return 0L;
}
- OMySQLIntroPageSetup* OMySQLIntroPageSetup::CreateMySQLIntroTabPage( vcl::Window* _pParent, const SfxItemSet& _rAttrSet )
+ VclPtr<OMySQLIntroPageSetup> OMySQLIntroPageSetup::CreateMySQLIntroTabPage( vcl::Window* _pParent, const SfxItemSet& _rAttrSet )
{
- return ( new OMySQLIntroPageSetup( _pParent, _rAttrSet) );
+ return VclPtr<OMySQLIntroPageSetup>::Create( _pParent, _rAttrSet);
}
@@ -235,15 +259,23 @@ using namespace ::com::sun::star;
m_pNATIVEDatabase->SetToggleHdl(LINK(this, OMySQLIntroPageSetup, OnSetupModeSelected));
}
- IMPL_LINK(OMySQLIntroPageSetup, OnSetupModeSelected, RadioButton*, /*_pBox*/)
+ OMySQLIntroPageSetup::~OMySQLIntroPageSetup()
{
- maClickHdl.Call( this );
- return long(true);
+ disposeOnce();
}
- OMySQLIntroPageSetup::~OMySQLIntroPageSetup()
+ void OMySQLIntroPageSetup::dispose()
{
+ m_pODBCDatabase.clear();
+ m_pJDBCDatabase.clear();
+ m_pNATIVEDatabase.clear();
+ OGenericAdministrationPage::dispose();
+ }
+ IMPL_LINK(OMySQLIntroPageSetup, OnSetupModeSelected, RadioButton*, /*_pBox*/)
+ {
+ maClickHdl.Call( this );
+ return long(true);
}
void OMySQLIntroPageSetup::implInitControls(const SfxItemSet& _rSet, bool /*_bSaveValue*/)
@@ -292,38 +324,50 @@ using namespace ::com::sun::star;
// MySQLNativeSetupPage
MySQLNativeSetupPage::MySQLNativeSetupPage( vcl::Window* _pParent, const SfxItemSet& _rCoreAttrs )
:OGenericAdministrationPage( _pParent, "DBWizMysqlNativePage", "dbaccess/ui/dbwizmysqlnativepage.ui", _rCoreAttrs )
- ,m_aMySQLSettings ( *get<VclVBox>("MySQLSettingsContainer"), getControlModifiedLink() )
+ ,m_aMySQLSettings ( VclPtr<MySQLNativeSettings>::Create(*get<VclVBox>("MySQLSettingsContainer"), getControlModifiedLink()) )
{
get(m_pHelpText, "helptext");
- m_aMySQLSettings.Show();
+ m_aMySQLSettings->Show();
SetRoadmapStateValue(false);
}
- OGenericAdministrationPage* MySQLNativeSetupPage::Create( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
+ MySQLNativeSetupPage::~MySQLNativeSetupPage()
+ {
+ disposeOnce();
+ }
+
+ void MySQLNativeSetupPage::dispose()
{
- return new MySQLNativeSetupPage( pParent, _rAttrSet );
+ m_aMySQLSettings.disposeAndClear();
+ m_pHelpText.clear();
+ OGenericAdministrationPage::dispose();
+ }
+
+ VclPtr<OGenericAdministrationPage> MySQLNativeSetupPage::Create( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
+ {
+ return VclPtr<MySQLNativeSetupPage>::Create( pParent, _rAttrSet );
}
void MySQLNativeSetupPage::fillControls( ::std::vector< ISaveValueWrapper* >& _rControlList )
{
- m_aMySQLSettings.fillControls( _rControlList );
+ m_aMySQLSettings->fillControls( _rControlList );
}
void MySQLNativeSetupPage::fillWindows( ::std::vector< ISaveValueWrapper* >& _rControlList )
{
_rControlList.push_back( new ODisableWrapper< FixedText >( m_pHelpText ) );
- m_aMySQLSettings.fillWindows( _rControlList );
+ m_aMySQLSettings->fillWindows( _rControlList );
}
bool MySQLNativeSetupPage::FillItemSet( SfxItemSet* _rSet )
{
- return m_aMySQLSettings.FillItemSet( _rSet );
+ return m_aMySQLSettings->FillItemSet( _rSet );
}
void MySQLNativeSetupPage::implInitControls( const SfxItemSet& _rSet, bool _bSaveValue )
{
- m_aMySQLSettings.implInitControls( _rSet );
+ m_aMySQLSettings->implInitControls( _rSet );
OGenericAdministrationPage::implInitControls( _rSet, _bSaveValue );
@@ -337,7 +381,7 @@ using namespace ::com::sun::star;
IMPL_LINK( MySQLNativeSetupPage, OnModified, Edit*, _pEdit )
{
- SetRoadmapStateValue( m_aMySQLSettings.canAdvance() );
+ SetRoadmapStateValue( m_aMySQLSettings->canAdvance() );
return OGenericAdministrationPage::getControlModifiedLink().Call( _pEdit );
}
@@ -387,26 +431,48 @@ using namespace ::com::sun::star;
SetRoadmapStateValue(false);
}
- OGenericAdministrationPage* OGeneralSpecialJDBCConnectionPageSetup::CreateMySQLJDBCTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
+ OGeneralSpecialJDBCConnectionPageSetup::~OGeneralSpecialJDBCConnectionPageSetup()
+ {
+ disposeOnce();
+ }
+
+ void OGeneralSpecialJDBCConnectionPageSetup::dispose()
{
- return ( new OGeneralSpecialJDBCConnectionPageSetup( pParent,
+ m_pHeaderText.clear();
+ m_pFTHelpText.clear();
+ m_pFTDatabasename.clear();
+ m_pETDatabasename.clear();
+ m_pFTHostname.clear();
+ m_pETHostname.clear();
+ m_pFTPortNumber.clear();
+ m_pFTDefaultPortNumber.clear();
+ m_pNFPortNumber.clear();
+ m_pFTDriverClass.clear();
+ m_pETDriverClass.clear();
+ m_pPBTestJavaDriver.clear();
+ OGenericAdministrationPage::dispose();
+ }
+
+ VclPtr<OGenericAdministrationPage> OGeneralSpecialJDBCConnectionPageSetup::CreateMySQLJDBCTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
+ {
+ return VclPtr<OGeneralSpecialJDBCConnectionPageSetup>::Create( pParent,
_rAttrSet,
DSID_MYSQL_PORTNUMBER ,
STR_MYSQL_DEFAULT,
STR_MYSQLJDBC_HELPTEXT,
STR_MYSQLJDBC_HEADERTEXT,
- STR_MYSQL_DRIVERCLASSTEXT) );
+ STR_MYSQL_DRIVERCLASSTEXT);
}
- OGenericAdministrationPage* OGeneralSpecialJDBCConnectionPageSetup::CreateOracleJDBCTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
+ VclPtr<OGenericAdministrationPage> OGeneralSpecialJDBCConnectionPageSetup::CreateOracleJDBCTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
{
- return ( new OGeneralSpecialJDBCConnectionPageSetup( pParent,
+ return VclPtr<OGeneralSpecialJDBCConnectionPageSetup>::Create( pParent,
_rAttrSet,
DSID_ORACLE_PORTNUMBER,
STR_ORACLE_DEFAULT,
STR_ORACLE_HELPTEXT,
STR_ORACLE_HEADERTEXT,
- STR_ORACLE_DRIVERCLASSTEXT) );
+ STR_ORACLE_DRIVERCLASSTEXT);
}
void OGeneralSpecialJDBCConnectionPageSetup::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList)
@@ -497,8 +563,8 @@ using namespace ::com::sun::star;
#endif
const sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
const OSQLMessageBox::MessageType mt = bSuccess ? OSQLMessageBox::Info : OSQLMessageBox::Error;
- OSQLMessageBox aMsg( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt );
- aMsg.Execute();
+ ScopedVclPtrInstance< OSQLMessageBox > aMsg( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt );
+ aMsg->Execute();
return 0L;
}
@@ -512,9 +578,9 @@ using namespace ::com::sun::star;
return 0L;
}
- OGenericAdministrationPage* OJDBCConnectionPageSetup::CreateJDBCTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
+ VclPtr<OGenericAdministrationPage> OJDBCConnectionPageSetup::CreateJDBCTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
{
- return ( new OJDBCConnectionPageSetup( pParent, _rAttrSet));
+ return VclPtr<OJDBCConnectionPageSetup>::Create( pParent, _rAttrSet);
}
// OMySQLJDBCConnectionPageSetup
@@ -529,6 +595,19 @@ using namespace ::com::sun::star;
m_pPBTestJavaDriver->SetClickHdl(LINK(this,OJDBCConnectionPageSetup,OnTestJavaClickHdl));
}
+ OJDBCConnectionPageSetup::~OJDBCConnectionPageSetup()
+ {
+ disposeOnce();
+ }
+
+ void OJDBCConnectionPageSetup::dispose()
+ {
+ m_pFTDriverClass.clear();
+ m_pETDriverClass.clear();
+ m_pPBTestJavaDriver.clear();
+ OConnectionTabPageSetup::dispose();
+ }
+
void OJDBCConnectionPageSetup::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList)
{
_rControlList.push_back(new OSaveValueWrapper<Edit>(m_pETDriverClass));
@@ -606,8 +685,8 @@ using namespace ::com::sun::star;
}
#endif
sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
- OSQLMessageBox aMsg( this, OUString( ModuleRes( nMessage ) ), OUString() );
- aMsg.Execute();
+ ScopedVclPtrInstance< OSQLMessageBox > aMsg( this, OUString( ModuleRes( nMessage ) ), OUString() );
+ aMsg->Execute();
return 0L;
}
@@ -621,9 +700,9 @@ using namespace ::com::sun::star;
return 0L;
}
- OGenericAdministrationPage* OSpreadSheetConnectionPageSetup::CreateSpreadSheetTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
+ VclPtr<OGenericAdministrationPage> OSpreadSheetConnectionPageSetup::CreateSpreadSheetTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
{
- return ( new OSpreadSheetConnectionPageSetup( pParent, _rAttrSet ) );
+ return VclPtr<OSpreadSheetConnectionPageSetup>::Create( pParent, _rAttrSet );
}
@@ -636,7 +715,13 @@ using namespace ::com::sun::star;
OSpreadSheetConnectionPageSetup::~OSpreadSheetConnectionPageSetup()
{
+ disposeOnce();
+ }
+ void OSpreadSheetConnectionPageSetup::dispose()
+ {
+ m_pPasswordrequired.clear();
+ OConnectionTabPageSetup::dispose();
}
void OSpreadSheetConnectionPageSetup::fillWindows(::std::vector< ISaveValueWrapper* >& /*_rControlList*/)
@@ -662,9 +747,9 @@ using namespace ::com::sun::star;
return bChangedSomething;
}
- OGenericAdministrationPage* OAuthentificationPageSetup::CreateAuthentificationTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
+ VclPtr<OGenericAdministrationPage> OAuthentificationPageSetup::CreateAuthentificationTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
{
- return ( new OAuthentificationPageSetup( pParent, _rAttrSet) );
+ return VclPtr<OAuthentificationPageSetup>::Create( pParent, _rAttrSet);
}
@@ -685,7 +770,17 @@ using namespace ::com::sun::star;
OAuthentificationPageSetup::~OAuthentificationPageSetup()
{
+ disposeOnce();
+ }
+ void OAuthentificationPageSetup::dispose()
+ {
+ m_pFTHelpText.clear();
+ m_pFTUserName.clear();
+ m_pETUserName.clear();
+ m_pCBPasswordRequired.clear();
+ m_pPBTestConnection.clear();
+ OGenericAdministrationPage::dispose();
}
void OAuthentificationPageSetup::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList)
@@ -729,9 +824,9 @@ using namespace ::com::sun::star;
return bChangedSomething;
}
- OGenericAdministrationPage* OFinalDBPageSetup::CreateFinalDBTabPageSetup( vcl::Window* pParent, const SfxItemSet& _rAttrSet)
+ VclPtr<OGenericAdministrationPage> OFinalDBPageSetup::CreateFinalDBTabPageSetup( vcl::Window* pParent, const SfxItemSet& _rAttrSet)
{
- return ( new OFinalDBPageSetup( pParent, _rAttrSet) );
+ return VclPtr<OFinalDBPageSetup>::Create( pParent, _rAttrSet);
}
@@ -755,7 +850,20 @@ using namespace ::com::sun::star;
OFinalDBPageSetup::~OFinalDBPageSetup()
{
+ disposeOnce();
+ }
+ void OFinalDBPageSetup::dispose()
+ {
+ m_pFTFinalHeader.clear();
+ m_pFTFinalHelpText.clear();
+ m_pRBRegisterDataSource.clear();
+ m_pRBDontregisterDataSource.clear();
+ m_pFTAdditionalSettings.clear();
+ m_pCBOpenAfterwards.clear();
+ m_pCBStartTableWizard.clear();
+ m_pFTFinalText.clear();
+ OGenericAdministrationPage::dispose();
}
bool OFinalDBPageSetup::IsDatabaseDocumentToBeRegistered()
diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx
index 4756b6c75b57..109c3f3c93d3 100644
--- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx
+++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx
@@ -40,12 +40,13 @@ namespace dbaui
{
public:
virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) SAL_OVERRIDE;
- static OGenericAdministrationPage* CreateSpreadSheetTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
+ static VclPtr<OGenericAdministrationPage> CreateSpreadSheetTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
OSpreadSheetConnectionPageSetup(vcl::Window* pParent, const SfxItemSet& _rCoreAttrs);
+ virtual ~OSpreadSheetConnectionPageSetup();
+ virtual void dispose() SAL_OVERRIDE;
protected:
- CheckBox *m_pPasswordrequired;
- virtual ~OSpreadSheetConnectionPageSetup();
+ VclPtr<CheckBox> m_pPasswordrequired;
protected:
virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE;
@@ -58,14 +59,14 @@ namespace dbaui
class OTextConnectionPageSetup : public OConnectionTabPageSetup
{
public:
+ VclPtr<OTextConnectionHelper> m_pTextConnectionHelper;
+
virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) SAL_OVERRIDE;
- static OGenericAdministrationPage* CreateTextTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
+ static VclPtr<OGenericAdministrationPage> CreateTextTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
OTextConnectionPageSetup( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs );
- OTextConnectionHelper* m_pTextConnectionHelper;
- private:
-
- protected:
virtual ~OTextConnectionPageSetup();
+ virtual void dispose() SAL_OVERRIDE;
+ protected:
virtual bool prepareLeave() SAL_OVERRIDE;
virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE;
virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) SAL_OVERRIDE;
@@ -81,8 +82,10 @@ namespace dbaui
{
public:
virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) SAL_OVERRIDE;
- static OGenericAdministrationPage* CreateLDAPTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
+ static VclPtr<OGenericAdministrationPage> CreateLDAPTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
OLDAPConnectionPageSetup( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs );
+ virtual ~OLDAPConnectionPageSetup();
+ virtual void dispose() SAL_OVERRIDE;
virtual Link getControlModifiedLink() SAL_OVERRIDE { return LINK(this, OLDAPConnectionPageSetup, OnEditModified); }
protected:
@@ -92,28 +95,30 @@ namespace dbaui
DECL_LINK(OnEditModified,Edit*);
private:
- FixedText* m_pFTHelpText;
- FixedText* m_pFTHostServer;
- Edit* m_pETHostServer;
- FixedText* m_pFTBaseDN;
- Edit* m_pETBaseDN;
- FixedText* m_pFTPortNumber;
- NumericField* m_pNFPortNumber;
- FixedText* m_pFTDefaultPortNumber;
- CheckBox* m_pCBUseSSL;
+ VclPtr<FixedText> m_pFTHelpText;
+ VclPtr<FixedText> m_pFTHostServer;
+ VclPtr<Edit> m_pETHostServer;
+ VclPtr<FixedText> m_pFTBaseDN;
+ VclPtr<Edit> m_pETBaseDN;
+ VclPtr<FixedText> m_pFTPortNumber;
+ VclPtr<NumericField> m_pNFPortNumber;
+ VclPtr<FixedText> m_pFTDefaultPortNumber;
+ VclPtr<CheckBox> m_pCBUseSSL;
};
// MySQLNativeSetupPage
class MySQLNativeSetupPage : public OGenericAdministrationPage
{
private:
- FixedText *m_pHelpText;
- MySQLNativeSettings m_aMySQLSettings;
+ VclPtr<FixedText> m_pHelpText;
+ VclPtr<MySQLNativeSettings> m_aMySQLSettings;
public:
MySQLNativeSetupPage( vcl::Window* _pParent, const SfxItemSet& _rCoreAttrs );
+ virtual ~MySQLNativeSetupPage();
+ virtual void dispose() SAL_OVERRIDE;
- static OGenericAdministrationPage* Create( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
+ static VclPtr<OGenericAdministrationPage> Create( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
protected:
virtual void fillControls( ::std::vector< ISaveValueWrapper* >& _rControlList ) SAL_OVERRIDE;
@@ -139,8 +144,10 @@ namespace dbaui
, sal_uInt16 _nHelpTextResId
, sal_uInt16 _nHeaderTextResId
, sal_uInt16 _nDriverClassId );
- static OGenericAdministrationPage* CreateMySQLJDBCTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
- static OGenericAdministrationPage* CreateOracleJDBCTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
+ virtual ~OGeneralSpecialJDBCConnectionPageSetup();
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<OGenericAdministrationPage> CreateMySQLJDBCTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
+ static VclPtr<OGenericAdministrationPage> CreateOracleJDBCTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
protected:
virtual bool FillItemSet( SfxItemSet* _rCoreAttrs ) SAL_OVERRIDE;
@@ -151,19 +158,19 @@ namespace dbaui
DECL_LINK(OnTestJavaClickHdl,PushButton*);
DECL_LINK(OnEditModified,Edit*);
- FixedText* m_pHeaderText;
- FixedText* m_pFTHelpText;
- FixedText* m_pFTDatabasename;
- Edit* m_pETDatabasename;
- FixedText* m_pFTHostname;
- Edit* m_pETHostname;
- FixedText* m_pFTPortNumber;
- FixedText* m_pFTDefaultPortNumber;
- NumericField* m_pNFPortNumber;
-
- FixedText* m_pFTDriverClass;
- Edit* m_pETDriverClass;
- PushButton* m_pPBTestJavaDriver;
+ VclPtr<FixedText> m_pHeaderText;
+ VclPtr<FixedText> m_pFTHelpText;
+ VclPtr<FixedText> m_pFTDatabasename;
+ VclPtr<Edit> m_pETDatabasename;
+ VclPtr<FixedText> m_pFTHostname;
+ VclPtr<Edit> m_pETHostname;
+ VclPtr<FixedText> m_pFTPortNumber;
+ VclPtr<FixedText> m_pFTDefaultPortNumber;
+ VclPtr<NumericField> m_pNFPortNumber;
+
+ VclPtr<FixedText> m_pFTDriverClass;
+ VclPtr<Edit> m_pETDriverClass;
+ VclPtr<PushButton> m_pPBTestJavaDriver;
OUString m_sDefaultJdbcDriverName;
sal_uInt16 m_nPortId;
@@ -174,7 +181,9 @@ namespace dbaui
{
public:
OJDBCConnectionPageSetup( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs );
- static OGenericAdministrationPage* CreateJDBCTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
+ virtual ~OJDBCConnectionPageSetup();
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<OGenericAdministrationPage> CreateJDBCTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
protected:
virtual bool checkTestConnection() SAL_OVERRIDE;
@@ -186,9 +195,9 @@ namespace dbaui
DECL_LINK(OnTestJavaClickHdl,PushButton*);
DECL_LINK(OnEditModified,Edit*);
- FixedText* m_pFTDriverClass;
- Edit* m_pETDriverClass;
- PushButton* m_pPBTestJavaDriver;
+ VclPtr<FixedText> m_pFTDriverClass;
+ VclPtr<Edit> m_pETDriverClass;
+ VclPtr<PushButton> m_pPBTestJavaDriver;
};
// OJDBCConnectionPageSetup
@@ -203,8 +212,10 @@ namespace dbaui
};
OMySQLIntroPageSetup( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs);
+ virtual ~OMySQLIntroPageSetup();
+ virtual void dispose() SAL_OVERRIDE;
- static OMySQLIntroPageSetup* CreateMySQLIntroTabPage( vcl::Window* _pParent, const SfxItemSet& _rAttrSet );
+ static VclPtr<OMySQLIntroPageSetup> CreateMySQLIntroTabPage( vcl::Window* _pParent, const SfxItemSet& _rAttrSet );
ConnectionType getMySQLMode();
Link maClickHdl;
void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
@@ -216,12 +227,11 @@ namespace dbaui
virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE;
virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) SAL_OVERRIDE;
virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) SAL_OVERRIDE;
- virtual ~OMySQLIntroPageSetup();
private:
- RadioButton *m_pODBCDatabase;
- RadioButton *m_pJDBCDatabase;
- RadioButton *m_pNATIVEDatabase;
+ VclPtr<RadioButton> m_pODBCDatabase;
+ VclPtr<RadioButton> m_pJDBCDatabase;
+ VclPtr<RadioButton> m_pNATIVEDatabase;
DECL_LINK(OnSetupModeSelected, RadioButton*);
@@ -232,16 +242,17 @@ namespace dbaui
{
public:
virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) SAL_OVERRIDE;
- static OGenericAdministrationPage* CreateAuthentificationTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
+ static VclPtr<OGenericAdministrationPage> CreateAuthentificationTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet );
OAuthentificationPageSetup(vcl::Window* pParent, const SfxItemSet& _rCoreAttrs);
+ virtual ~OAuthentificationPageSetup();
+ virtual void dispose() SAL_OVERRIDE;
protected:
- FixedText* m_pFTHelpText;
- FixedText* m_pFTUserName;
- Edit* m_pETUserName;
- CheckBox* m_pCBPasswordRequired;
- PushButton* m_pPBTestConnection;
- virtual ~OAuthentificationPageSetup();
+ VclPtr<FixedText> m_pFTHelpText;
+ VclPtr<FixedText> m_pFTUserName;
+ VclPtr<Edit> m_pETUserName;
+ VclPtr<CheckBox> m_pCBPasswordRequired;
+ VclPtr<PushButton> m_pPBTestConnection;
protected:
virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE;
@@ -254,18 +265,20 @@ namespace dbaui
{
public:
virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) SAL_OVERRIDE;
- static OGenericAdministrationPage* CreateFinalDBTabPageSetup( vcl::Window* pParent, const SfxItemSet& _rAttrSet);
+ static VclPtr<OGenericAdministrationPage> CreateFinalDBTabPageSetup( vcl::Window* pParent, const SfxItemSet& _rAttrSet);
- FixedText* m_pFTFinalHeader;
- FixedText* m_pFTFinalHelpText;
- RadioButton* m_pRBRegisterDataSource;
- RadioButton* m_pRBDontregisterDataSource;
- FixedText* m_pFTAdditionalSettings;
- CheckBox* m_pCBOpenAfterwards;
- CheckBox* m_pCBStartTableWizard;
- FixedText* m_pFTFinalText;
+ VclPtr<FixedText> m_pFTFinalHeader;
+ VclPtr<FixedText> m_pFTFinalHelpText;
+ VclPtr<RadioButton> m_pRBRegisterDataSource;
+ VclPtr<RadioButton> m_pRBDontregisterDataSource;
+ VclPtr<FixedText> m_pFTAdditionalSettings;
+ VclPtr<CheckBox> m_pCBOpenAfterwards;
+ VclPtr<CheckBox> m_pCBStartTableWizard;
+ VclPtr<FixedText> m_pFTFinalText;
OFinalDBPageSetup(vcl::Window* pParent, const SfxItemSet& _rCoreAttrs);
+ virtual ~OFinalDBPageSetup();
+ virtual void dispose() SAL_OVERRIDE;
bool IsDatabaseDocumentToBeRegistered();
bool IsDatabaseDocumentToBeOpened();
bool IsTableWizardToBeStarted();
@@ -276,9 +289,6 @@ namespace dbaui
DECL_LINK(OnOpenSelected, CheckBox*);
protected:
- virtual ~OFinalDBPageSetup();
-
- protected:
virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE;
virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) SAL_OVERRIDE;
virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) SAL_OVERRIDE;
diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.hxx b/dbaccess/source/ui/dlg/DbAdminImpl.hxx
index 4b46778afb92..890a7acc33cd 100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.hxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.hxx
@@ -35,6 +35,7 @@
#include <svl/itemset.hxx>
#include <com/sun/star/frame/XModel.hpp>
#include <svl/poolitem.hxx>
+#include <vcl/vclptr.hxx>
namespace vcl { class Window; }
namespace dbaui
@@ -68,7 +69,7 @@ namespace dbaui
MapInt2String m_aDirectPropTranslator; /// translating property id's into names (direct properties of a data source)
MapInt2String m_aIndirectPropTranslator; /// translating property id's into names (indirect properties of a data source)
- vcl::Window* m_pParent;
+ VclPtr<vcl::Window> m_pParent;
IItemSetHelper* m_pItemSetHelper;
public:
diff --git a/dbaccess/source/ui/dlg/DriverSettings.hxx b/dbaccess/source/ui/dlg/DriverSettings.hxx
index 6a6ed636f295..071c346df3ba 100644
--- a/dbaccess/source/ui/dlg/DriverSettings.hxx
+++ b/dbaccess/source/ui/dlg/DriverSettings.hxx
@@ -21,6 +21,7 @@
#include "dsntypes.hxx"
#include <svl/poolitem.hxx>
+#include <vcl/vclptr.hxx>
#include <vector>
class SfxTabPage;
@@ -44,53 +45,53 @@ namespace dbaui
/** Creates the detail page for Dbase
*/
- static SfxTabPage* CreateDbase2( vcl::Window* _pParent, const SfxItemSet* _rAttrSet );
+ static VclPtr<SfxTabPage> CreateDbase2( vcl::Window* _pParent, const SfxItemSet* _rAttrSet );
/** Creates the detail page for ado
*/
- static SfxTabPage* CreateDbase( vcl::Window* _pParent, const SfxItemSet* _rAttrSet );
+ static VclPtr<SfxTabPage> CreateDbase( vcl::Window* _pParent, const SfxItemSet* _rAttrSet );
/** Creates the detail page for ado
*/
- static SfxTabPage* CreateAdo( vcl::Window* _pParent, const SfxItemSet* _rAttrSet );
+ static VclPtr<SfxTabPage> CreateAdo( vcl::Window* _pParent, const SfxItemSet* _rAttrSet );
/** Creates the detail page for ODBC
*/
- static SfxTabPage* CreateODBC( vcl::Window* _pParent, const SfxItemSet* _rAttrSet );
+ static VclPtr<SfxTabPage> CreateODBC( vcl::Window* _pParent, const SfxItemSet* _rAttrSet );
/** Creates the detail page for user
*/
- static SfxTabPage* CreateUser( vcl::Window* _pParent, const SfxItemSet* _rAttrSet );
+ static VclPtr<SfxTabPage> CreateUser( vcl::Window* _pParent, const SfxItemSet* _rAttrSet );
/** Creates the detail page for MySQLODBC
*/
- static SfxTabPage* CreateMySQLODBC( vcl::Window* _pParent, const SfxItemSet* _rAttrSet );
+ static VclPtr<SfxTabPage> CreateMySQLODBC( vcl::Window* _pParent, const SfxItemSet* _rAttrSet );
/** Creates the detail page for MySQLJDBC
*/
- static SfxTabPage* CreateMySQLJDBC( vcl::Window* _pParent, const SfxItemSet* _rAttrSet );
+ static VclPtr<SfxTabPage> CreateMySQLJDBC( vcl::Window* _pParent, const SfxItemSet* _rAttrSet );
/** Creates the detail page for MySQLNATIVE
*/
- static SfxTabPage* CreateMySQLNATIVE( vcl::Window* _pParent, const SfxItemSet* _rAttrSet );
+ static VclPtr<SfxTabPage> CreateMySQLNATIVE( vcl::Window* _pParent, const SfxItemSet* _rAttrSet );
/** Creates the detail page for Oracle JDBC
*/
- static SfxTabPage* CreateOracleJDBC( vcl::Window* pParent, const SfxItemSet* _rAttrSet );
+ static VclPtr<SfxTabPage> CreateOracleJDBC( vcl::Window* pParent, const SfxItemSet* _rAttrSet );
/** Creates the detail page for LDAP
*/
- static SfxTabPage* CreateLDAP( vcl::Window* _pParent, const SfxItemSet* _rAttrSet );
+ static VclPtr<SfxTabPage> CreateLDAP( vcl::Window* _pParent, const SfxItemSet* _rAttrSet );
/// Creates the detail page for Text
- static SfxTabPage* CreateText( vcl::Window* _pParent, const SfxItemSet* _rAttrSet );
+ static VclPtr<SfxTabPage> CreateText( vcl::Window* _pParent, const SfxItemSet* _rAttrSet );
/// creates the GeneratedValues page
- static SfxTabPage* CreateGeneratedValuesPage( vcl::Window* _pParent, const SfxItemSet* _rAttrSet );
+ static VclPtr<SfxTabPage> CreateGeneratedValuesPage( vcl::Window* _pParent, const SfxItemSet* _rAttrSet );
/// creates the "Special Settings" page of the "Advanced Settings" dialog
- static SfxTabPage* CreateSpecialSettingsPage( vcl::Window* _pParent, const SfxItemSet* _rAttrSet );
+ static VclPtr<SfxTabPage> CreateSpecialSettingsPage( vcl::Window* _pParent, const SfxItemSet* _rAttrSet );
};
}
diff --git a/dbaccess/source/ui/dlg/QueryPropertiesDialog.cxx b/dbaccess/source/ui/dlg/QueryPropertiesDialog.cxx
index 2c8b9b68ab48..7182276a6224 100644
--- a/dbaccess/source/ui/dlg/QueryPropertiesDialog.cxx
+++ b/dbaccess/source/ui/dlg/QueryPropertiesDialog.cxx
@@ -30,6 +30,15 @@ QueryPropertiesDialog::QueryPropertiesDialog(
QueryPropertiesDialog::~QueryPropertiesDialog()
{
+ disposeOnce();
+}
+
+void QueryPropertiesDialog::dispose()
+{
+ m_pRB_Distinct.clear();
+ m_pRB_NonDistinct.clear();
+ m_pLB_Limit.clear();
+ ModalDialog::dispose();
}
} ///dbaui namespace
diff --git a/dbaccess/source/ui/dlg/RelationDlg.cxx b/dbaccess/source/ui/dlg/RelationDlg.cxx
index 28d33723dae6..50913994c298 100644
--- a/dbaccess/source/ui/dlg/RelationDlg.cxx
+++ b/dbaccess/source/ui/dlg/RelationDlg.cxx
@@ -88,6 +88,26 @@ ORelationDialog::ORelationDialog( OJoinTableView* pParent,
m_xTableControl->NotifyCellChange();
}
+ORelationDialog::~ORelationDialog()
+{
+ disposeOnce();
+}
+
+void ORelationDialog::dispose()
+{
+ m_pRB_NoCascUpd.clear();
+ m_pRB_CascUpd.clear();
+ m_pRB_CascUpdNull.clear();
+ m_pRB_CascUpdDefault.clear();
+ m_pRB_NoCascDel.clear();
+ m_pRB_CascDel.clear();
+ m_pRB_CascDelNull.clear();
+ m_pRB_CascDelDefault.clear();
+ m_pPB_OK.clear();
+ ModalDialog::dispose();
+}
+
+
void ORelationDialog::Init(const TTableConnectionData::value_type& _pConnectionData)
{
ORelationTableConnectionData* pConnData = static_cast<ORelationTableConnectionData*>(_pConnectionData.get());
@@ -132,10 +152,6 @@ void ORelationDialog::Init(const TTableConnectionData::value_type& _pConnectionD
}
}
-ORelationDialog::~ORelationDialog()
-{
-}
-
IMPL_LINK( ORelationDialog, OKClickHdl, Button*, /*pButton*/ )
{
// RadioButtons auslesen
diff --git a/dbaccess/source/ui/dlg/TablesSingleDlg.cxx b/dbaccess/source/ui/dlg/TablesSingleDlg.cxx
index a4a51e3d2623..8a29c4873208 100644
--- a/dbaccess/source/ui/dlg/TablesSingleDlg.cxx
+++ b/dbaccess/source/ui/dlg/TablesSingleDlg.cxx
@@ -54,14 +54,20 @@ OTableSubscriptionDialog::OTableSubscriptionDialog(vcl::Window* pParent
m_pImpl->translateProperties(xDatasource, *m_pOutSet);
SetInputSet(m_pOutSet);
- OTableSubscriptionPage* pTabPage = new OTableSubscriptionPage(get_content_area(), *m_pOutSet, this);
+ VclPtrInstance<OTableSubscriptionPage> pTabPage(get_content_area(), *m_pOutSet, this);
pTabPage->SetServiceFactory(_rxORB);
SetTabPage(pTabPage);
}
OTableSubscriptionDialog::~OTableSubscriptionDialog()
{
+ disposeOnce();
+}
+
+void OTableSubscriptionDialog::dispose()
+{
delete m_pOutSet;
+ SfxSingleTabDialog::dispose();
}
short OTableSubscriptionDialog::Execute()
diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
index c99292a925ef..5c8b4b3551aa 100644
--- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
@@ -114,7 +114,7 @@ namespace dbaui
struct SectionDescriptor
{
short nFlag;
- vcl::Window* pFirstControl;
+ VclPtr<vcl::Window> pFirstControl;
} aSections[] = {
{ TC_EXTENSION, m_pExtensionHeader },
{ TC_SEPARATORS, m_pFormatHeader },
@@ -153,7 +153,31 @@ namespace dbaui
OTextConnectionHelper::~OTextConnectionHelper()
{
+ disposeOnce();
+ }
+ void OTextConnectionHelper::dispose()
+ {
+ m_pExtensionHeader.clear();
+ m_pAccessTextFiles.clear();
+ m_pAccessCSVFiles.clear();
+ m_pAccessOtherFiles.clear();
+ m_pOwnExtension.clear();
+ m_pExtensionExample.clear();
+ m_pFormatHeader.clear();
+ m_pFieldSeparatorLabel.clear();
+ m_pFieldSeparator.clear();
+ m_pTextSeparatorLabel.clear();
+ m_pTextSeparator.clear();
+ m_pDecimalSeparatorLabel.clear();
+ m_pDecimalSeparator.clear();
+ m_pThousandsSeparatorLabel.clear();
+ m_pThousandsSeparator.clear();
+ m_pRowHeader.clear();
+ m_pCharSetHeader.clear();
+ m_pCharSetLabel.clear();
+ m_pCharSet.clear();
+ TabPage::dispose();
}
IMPL_LINK(OTextConnectionHelper, OnControlModified, Control*, /*EMPTYARG*/)
diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.hxx b/dbaccess/source/ui/dlg/TextConnectionHelper.hxx
index b9317f8b46b6..56610e6e615b 100644
--- a/dbaccess/source/ui/dlg/TextConnectionHelper.hxx
+++ b/dbaccess/source/ui/dlg/TextConnectionHelper.hxx
@@ -49,27 +49,28 @@ namespace dbaui
public:
OTextConnectionHelper( vcl::Window* pParent, const short _nAvailableSections );
virtual ~OTextConnectionHelper();
+ virtual void dispose() SAL_OVERRIDE;
private:
- FixedText *m_pExtensionHeader;
- RadioButton *m_pAccessTextFiles;
- RadioButton *m_pAccessCSVFiles;
- RadioButton *m_pAccessOtherFiles;
- Edit *m_pOwnExtension;
- FixedText *m_pExtensionExample;
- FixedText *m_pFormatHeader;
- FixedText *m_pFieldSeparatorLabel;
- ComboBox *m_pFieldSeparator;
- FixedText *m_pTextSeparatorLabel;
- ComboBox *m_pTextSeparator;
- FixedText *m_pDecimalSeparatorLabel;
- ComboBox *m_pDecimalSeparator;
- FixedText *m_pThousandsSeparatorLabel;
- ComboBox *m_pThousandsSeparator;
- CheckBox *m_pRowHeader;
- FixedText *m_pCharSetHeader;
- FixedText *m_pCharSetLabel;
- CharSetListBox *m_pCharSet;
+ VclPtr<FixedText> m_pExtensionHeader;
+ VclPtr<RadioButton> m_pAccessTextFiles;
+ VclPtr<RadioButton> m_pAccessCSVFiles;
+ VclPtr<RadioButton> m_pAccessOtherFiles;
+ VclPtr<Edit> m_pOwnExtension;
+ VclPtr<FixedText> m_pExtensionExample;
+ VclPtr<FixedText> m_pFormatHeader;
+ VclPtr<FixedText> m_pFieldSeparatorLabel;
+ VclPtr<ComboBox> m_pFieldSeparator;
+ VclPtr<FixedText> m_pTextSeparatorLabel;
+ VclPtr<ComboBox> m_pTextSeparator;
+ VclPtr<FixedText> m_pDecimalSeparatorLabel;
+ VclPtr<ComboBox> m_pDecimalSeparator;
+ VclPtr<FixedText> m_pThousandsSeparatorLabel;
+ VclPtr<ComboBox> m_pThousandsSeparator;
+ VclPtr<CheckBox> m_pRowHeader;
+ VclPtr<FixedText> m_pCharSetHeader;
+ VclPtr<FixedText> m_pCharSetLabel;
+ VclPtr<CharSetListBox> m_pCharSet;
OUString m_aFieldSeparatorList;
OUString m_aTextSeparatorList;
OUString m_aTextNone;
diff --git a/dbaccess/source/ui/dlg/UserAdmin.cxx b/dbaccess/source/ui/dlg/UserAdmin.cxx
index 66556c6b8630..ee25dd304bb1 100644
--- a/dbaccess/source/ui/dlg/UserAdmin.cxx
+++ b/dbaccess/source/ui/dlg/UserAdmin.cxx
@@ -51,17 +51,27 @@ using namespace comphelper;
class OPasswordDialog : public ModalDialog
{
- VclFrame* m_pUser;
- Edit* m_pEDOldPassword;
- Edit* m_pEDPassword;
- Edit* m_pEDPasswordRepeat;
- OKButton* m_pOKBtn;
+ VclPtr<VclFrame> m_pUser;
+ VclPtr<Edit> m_pEDOldPassword;
+ VclPtr<Edit> m_pEDPassword;
+ VclPtr<Edit> m_pEDPasswordRepeat;
+ VclPtr<OKButton> m_pOKBtn;
DECL_LINK( OKHdl_Impl, void * );
DECL_LINK( ModifiedHdl, Edit * );
public:
OPasswordDialog( vcl::Window* pParent,const OUString& _sUserName);
+ virtual ~OPasswordDialog() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE
+ {
+ m_pUser.clear();
+ m_pEDOldPassword.clear();
+ m_pEDPassword.clear();
+ m_pEDPasswordRepeat.clear();
+ m_pOKBtn.clear();
+ ModalDialog::dispose();
+ }
OUString GetOldPassword() const { return m_pEDOldPassword->GetText(); }
OUString GetNewPassword() const { return m_pEDPassword->GetText(); }
@@ -92,8 +102,8 @@ IMPL_LINK_NOARG(OPasswordDialog, OKHdl_Impl)
else
{
OUString aErrorMsg( ModuleRes( STR_ERROR_PASSWORDS_NOT_IDENTICAL));
- MessageDialog aErrorBox(this, aErrorMsg);
- aErrorBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(this, aErrorMsg);
+ aErrorBox->Execute();
m_pEDPassword->SetText( OUString() );
m_pEDPasswordRepeat->SetText( OUString() );
m_pEDPassword->GrabFocus();
@@ -114,9 +124,9 @@ OUserAdmin::OUserAdmin(vcl::Window* pParent,const SfxItemSet& _rAttrSet)
, m_pNEWUSER(0)
, m_pCHANGEPWD(0)
, m_pDELETEUSER(0)
- ,m_TableCtrl(get<VclAlignment>("table"), WB_TABSTOP)
+ ,m_TableCtrl(VclPtr<OTableGrantControl>::Create(get<VclAlignment>("table"), WB_TABSTOP))
{
- m_TableCtrl.Show();
+ m_TableCtrl->Show();
get(m_pUSER, "user");
get(m_pNEWUSER, "add");
get(m_pCHANGEPWD, "changepass");
@@ -131,7 +141,18 @@ OUserAdmin::OUserAdmin(vcl::Window* pParent,const SfxItemSet& _rAttrSet)
OUserAdmin::~OUserAdmin()
{
+ disposeOnce();
+}
+
+void OUserAdmin::dispose()
+{
m_xConnection = NULL;
+ m_TableCtrl.disposeAndClear();
+ m_pUSER.clear();
+ m_pNEWUSER.clear();
+ m_pCHANGEPWD.clear();
+ m_pDELETEUSER.clear();
+ OGenericAdministrationPage::dispose();
}
void OUserAdmin::FillUserNames()
@@ -162,11 +183,11 @@ void OUserAdmin::FillUserNames()
{
Reference<XAuthorizable> xAuth;
m_xUsers->getByName(m_UserName) >>= xAuth;
- m_TableCtrl.setGrantUser(xAuth);
+ m_TableCtrl->setGrantUser(xAuth);
}
- m_TableCtrl.setUserName(GetUser());
- m_TableCtrl.Init();
+ m_TableCtrl->setUserName(GetUser());
+ m_TableCtrl->Init();
}
}
}
@@ -177,13 +198,13 @@ void OUserAdmin::FillUserNames()
m_pDELETEUSER->Enable(xDrop.is());
m_pCHANGEPWD->Enable(m_xUsers.is());
- m_TableCtrl.Enable(m_xUsers.is());
+ m_TableCtrl->Enable(m_xUsers.is());
}
-SfxTabPage* OUserAdmin::Create( vcl::Window* pParent, const SfxItemSet* _rAttrSet )
+VclPtr<SfxTabPage> OUserAdmin::Create( vcl::Window* pParent, const SfxItemSet* _rAttrSet )
{
- return ( new OUserAdmin( pParent, *_rAttrSet ) );
+ return VclPtr<SfxTabPage>(new OUserAdmin( pParent, *_rAttrSet ), SAL_NO_ACQUIRE);
}
IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton )
@@ -192,16 +213,16 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton )
{
if(pButton == m_pNEWUSER)
{
- SfxPasswordDialog aPwdDlg(this);
- aPwdDlg.ShowExtras(SfxShowExtras::ALL);
- if(aPwdDlg.Execute())
+ ScopedVclPtrInstance< SfxPasswordDialog > aPwdDlg(this);
+ aPwdDlg->ShowExtras(SfxShowExtras::ALL);
+ if(aPwdDlg->Execute())
{
Reference<XDataDescriptorFactory> xUserFactory(m_xUsers,UNO_QUERY);
Reference<XPropertySet> xNewUser = xUserFactory->createDataDescriptor();
if(xNewUser.is())
{
- xNewUser->setPropertyValue(PROPERTY_NAME,makeAny(OUString(aPwdDlg.GetUser())));
- xNewUser->setPropertyValue(PROPERTY_PASSWORD,makeAny(OUString(aPwdDlg.GetPassword())));
+ xNewUser->setPropertyValue(PROPERTY_NAME,makeAny(OUString(aPwdDlg->GetUser())));
+ xNewUser->setPropertyValue(PROPERTY_PASSWORD,makeAny(OUString(aPwdDlg->GetPassword())));
Reference<XAppend> xAppend(m_xUsers,UNO_QUERY);
if(xAppend.is())
xAppend->appendByDescriptor(xNewUser);
@@ -219,11 +240,11 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton )
if(xUser.is())
{
OUString sNewPassword,sOldPassword;
- OPasswordDialog aDlg(this,sName);
- if(aDlg.Execute() == RET_OK)
+ ScopedVclPtrInstance< OPasswordDialog > aDlg(this,sName);
+ if(aDlg->Execute() == RET_OK)
{
- sNewPassword = aDlg.GetNewPassword();
- sOldPassword = aDlg.GetOldPassword();
+ sNewPassword = aDlg->GetNewPassword();
+ sOldPassword = aDlg->GetOldPassword();
if(!sNewPassword.isEmpty())
xUser->changePassword(sOldPassword,sNewPassword);
@@ -238,8 +259,8 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton )
Reference<XDrop> xDrop(m_xUsers,UNO_QUERY);
if(xDrop.is())
{
- MessageDialog aQry(this, ModuleRes(STR_QUERY_USERADMIN_DELETE_USER), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
- if(aQry.Execute() == RET_YES)
+ ScopedVclPtrInstance< MessageDialog > aQry(this, ModuleRes(STR_QUERY_USERADMIN_DELETE_USER), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ if(aQry->Execute() == RET_YES)
xDrop->dropByName(GetUser());
}
}
@@ -261,10 +282,10 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton )
IMPL_LINK( OUserAdmin, ListDblClickHdl, ListBox *, /*pListBox*/ )
{
- m_TableCtrl.setUserName(GetUser());
- m_TableCtrl.UpdateTables();
- m_TableCtrl.DeactivateCell();
- m_TableCtrl.ActivateCell(m_TableCtrl.GetCurRow(),m_TableCtrl.GetCurColumnId());
+ m_TableCtrl->setUserName(GetUser());
+ m_TableCtrl->UpdateTables();
+ m_TableCtrl->DeactivateCell();
+ m_TableCtrl->ActivateCell(m_TableCtrl->GetCurRow(),m_TableCtrl->GetCurColumnId());
return 0;
}
@@ -283,7 +304,7 @@ void OUserAdmin::fillWindows(::std::vector< ISaveValueWrapper* >& /*_rControlLis
void OUserAdmin::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue)
{
- m_TableCtrl.setComponentContext(m_xORB);
+ m_TableCtrl->setComponentContext(m_xORB);
try
{
if ( !m_xConnection.is() && m_pAdminDialog )
@@ -302,7 +323,7 @@ void OUserAdmin::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue)
}
if ( xUsersSup.is() )
{
- m_TableCtrl.setTablesSupplier(xTablesSup);
+ m_TableCtrl->setTablesSupplier(xTablesSup);
m_xUsers = xUsersSup->getUsers();
}
}
diff --git a/dbaccess/source/ui/dlg/UserAdmin.hxx b/dbaccess/source/ui/dlg/UserAdmin.hxx
index 6f0720d7a43b..eeea260a60ee 100644
--- a/dbaccess/source/ui/dlg/UserAdmin.hxx
+++ b/dbaccess/source/ui/dlg/UserAdmin.hxx
@@ -41,11 +41,11 @@ namespace dbaui
class OUserAdmin : public OGenericAdministrationPage
{
protected:
- ListBox *m_pUSER;
- PushButton *m_pNEWUSER;
- PushButton *m_pCHANGEPWD;
- PushButton *m_pDELETEUSER;
- OTableGrantControl m_TableCtrl; // show the grant rights of one user
+ VclPtr<ListBox> m_pUSER;
+ VclPtr<PushButton> m_pNEWUSER;
+ VclPtr<PushButton> m_pCHANGEPWD;
+ VclPtr<PushButton> m_pDELETEUSER;
+ VclPtr<OTableGrantControl> m_TableCtrl; // show the grant rights of one user
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> m_xConnection;
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xUsers;
@@ -62,9 +62,10 @@ protected:
OUserAdmin( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs);
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* _rAttrSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* _rAttrSet );
virtual ~OUserAdmin();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetUser();
// subclasses must override this, but it isn't pure virtual
diff --git a/dbaccess/source/ui/dlg/UserAdminDlg.cxx b/dbaccess/source/ui/dlg/UserAdminDlg.cxx
index 2b17eccec0f9..57f8c8ec2673 100644
--- a/dbaccess/source/ui/dlg/UserAdminDlg.cxx
+++ b/dbaccess/source/ui/dlg/UserAdminDlg.cxx
@@ -73,6 +73,11 @@ namespace dbaui
OUserAdminDlg::~OUserAdminDlg()
{
+ disposeOnce();
+ }
+
+ void OUserAdminDlg::dispose()
+ {
if ( m_bOwnConnection )
{
try
@@ -86,8 +91,9 @@ namespace dbaui
SetInputSet(NULL);
DELETEZ(pExampleSet);
-
+ SfxTabDialog::dispose();
}
+
short OUserAdminDlg::Execute()
{
try
diff --git a/dbaccess/source/ui/dlg/admincontrols.cxx b/dbaccess/source/ui/dlg/admincontrols.cxx
index ddff2e67b7cf..a4ff866067d7 100644
--- a/dbaccess/source/ui/dlg/admincontrols.cxx
+++ b/dbaccess/source/ui/dlg/admincontrols.cxx
@@ -170,6 +170,24 @@ namespace dbaui
MySQLNativeSettings::~MySQLNativeSettings()
{
+ disposeOnce();
+ }
+
+ void MySQLNativeSettings::dispose()
+ {
+ m_pDatabaseNameLabel.clear();
+ m_pDatabaseName.clear();
+ m_pHostPortRadio.clear();
+ m_pSocketRadio.clear();
+ m_pNamedPipeRadio.clear();
+ m_pHostNameLabel.clear();
+ m_pHostName.clear();
+ m_pPortLabel.clear();
+ m_pPort.clear();
+ m_pDefaultPort.clear();
+ m_pSocket.clear();
+ m_pNamedPipe.clear();
+ TabPage::dispose();
}
void MySQLNativeSettings::fillControls( ::std::vector< ISaveValueWrapper* >& _rControlList )
diff --git a/dbaccess/source/ui/dlg/admincontrols.hxx b/dbaccess/source/ui/dlg/admincontrols.hxx
index e6e214dca1b9..544ef8b89a24 100644
--- a/dbaccess/source/ui/dlg/admincontrols.hxx
+++ b/dbaccess/source/ui/dlg/admincontrols.hxx
@@ -35,18 +35,18 @@ namespace dbaui
class MySQLNativeSettings : public TabPage
{
private:
- FixedText *m_pDatabaseNameLabel;
- Edit *m_pDatabaseName;
- RadioButton *m_pHostPortRadio;
- RadioButton *m_pSocketRadio;
- RadioButton *m_pNamedPipeRadio;
- FixedText *m_pHostNameLabel;
- Edit *m_pHostName;
- FixedText *m_pPortLabel;
- NumericField *m_pPort;
- FixedText *m_pDefaultPort;
- Edit *m_pSocket;
- Edit *m_pNamedPipe;
+ VclPtr<FixedText> m_pDatabaseNameLabel;
+ VclPtr<Edit> m_pDatabaseName;
+ VclPtr<RadioButton> m_pHostPortRadio;
+ VclPtr<RadioButton> m_pSocketRadio;
+ VclPtr<RadioButton> m_pNamedPipeRadio;
+ VclPtr<FixedText> m_pHostNameLabel;
+ VclPtr<Edit> m_pHostName;
+ VclPtr<FixedText> m_pPortLabel;
+ VclPtr<NumericField> m_pPort;
+ VclPtr<FixedText> m_pDefaultPort;
+ VclPtr<Edit> m_pSocket;
+ VclPtr<Edit> m_pNamedPipe;
::svt::ControlDependencyManager
m_aControlDependencies;
@@ -54,7 +54,7 @@ namespace dbaui
public:
MySQLNativeSettings( vcl::Window& _rParent, const Link& _rControlModificationLink );
virtual ~MySQLNativeSettings();
-
+ virtual void dispose() SAL_OVERRIDE;
void fillControls( ::std::vector< ISaveValueWrapper* >& _rControlList );
void fillWindows( ::std::vector< ISaveValueWrapper* >& _rControlList );
diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx
index ffb2c8d02df4..5848b5b2036c 100644
--- a/dbaccess/source/ui/dlg/adminpages.cxx
+++ b/dbaccess/source/ui/dlg/adminpages.cxx
@@ -117,19 +117,19 @@ namespace dbaui
// show an error message
OUString sError( ModuleRes( STR_COULD_NOT_LOAD_ODBC_LIB ) );
sError = sError.replaceFirst("#lib#", aEnumeration.getLibraryName());
- MessageDialog aDialog(this, sError);
- aDialog.Execute();
+ ScopedVclPtrInstance< MessageDialog > aDialog(this, sError);
+ aDialog->Execute();
return false;
}
else
{
aEnumeration.getDatasourceNames(aOdbcDatasources);
// execute the select dialog
- ODatasourceSelectDialog aSelector(GetParent(), aOdbcDatasources);
+ ScopedVclPtrInstance< ODatasourceSelectDialog > aSelector(GetParent(), aOdbcDatasources);
if (!_sCurr.isEmpty())
- aSelector.Select(_sCurr);
- if ( RET_OK == aSelector.Execute() )
- _sReturn = aSelector.GetSelected();
+ aSelector->Select(_sCurr);
+ if ( RET_OK == aSelector->Execute() )
+ _sReturn = aSelector->GetSelected();
}
return true;
}
@@ -242,8 +242,8 @@ namespace dbaui
eImage = OSQLMessageBox::Error;
aMessage = ModuleRes(STR_CONNECTION_NO_SUCCESS);
}
- OSQLMessageBox aMsg( this, sTitle, aMessage, WB_OK, eImage );
- aMsg.Execute();
+ ScopedVclPtrInstance< OSQLMessageBox > aMsg( this, sTitle, aMessage, WB_OK, eImage );
+ aMsg->Execute();
}
if ( !bSuccess )
m_pAdminDialog->clearPassword();
diff --git a/dbaccess/source/ui/dlg/adminpages.hxx b/dbaccess/source/ui/dlg/adminpages.hxx
index b866cd721f38..3572cd860055 100644
--- a/dbaccess/source/ui/dlg/adminpages.hxx
+++ b/dbaccess/source/ui/dlg/adminpages.hxx
@@ -231,7 +231,7 @@ namespace dbaui
is modified. The implementation just calls callModifiedHdl.
*/
DECL_LINK(OnControlModified, void*);
- DECL_LINK(OnTestConnectionClickHdl,PushButton*);
+ DECL_LINK(OnTestConnectionClickHdl, PushButton*);
/// may be used in SetXXXHdl calls to controls, is a link to <method>OnControlModified</method>
virtual Link getControlModifiedLink() { return LINK(this, OGenericAdministrationPage, OnControlModified); }
diff --git a/dbaccess/source/ui/dlg/adtabdlg.cxx b/dbaccess/source/ui/dlg/adtabdlg.cxx
index 5e4cb63aa6f0..1b42d45ffcd1 100644
--- a/dbaccess/source/ui/dlg/adtabdlg.cxx
+++ b/dbaccess/source/ui/dlg/adtabdlg.cxx
@@ -362,7 +362,19 @@ OAddTableDlg::OAddTableDlg( vcl::Window* pParent, IAddTableDialogContext& _rCont
OAddTableDlg::~OAddTableDlg()
{
+ disposeOnce();
+}
+
+void OAddTableDlg::dispose()
+{
m_rContext.onWindowClosing( this );
+ m_pCaseTables.clear();
+ m_pCaseQueries.clear();
+ m_pTableList.clear();
+ m_pQueryList.clear();
+ m_pAddButton.clear();
+ m_pCloseButton.clear();
+ ModelessDialog::dispose();
}
void OAddTableDlg::impl_switchTo( ObjectList _eList )
diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx
index 65288cd41c81..2fe318634f13 100644
--- a/dbaccess/source/ui/dlg/advancedsettings.cxx
+++ b/dbaccess/source/ui/dlg/advancedsettings.cxx
@@ -48,7 +48,7 @@ namespace dbaui
// SpecialSettingsPage
struct BooleanSettingDesc
{
- CheckBox** ppControl; // the dialog's control which displays this setting
+ VclPtr<CheckBox>* ppControl; // the dialog's control which displays this setting
OString sControlId; // the widget name of the control in the .ui
sal_uInt16 nItemId; // the ID of the item (in an SfxItemSet) which corresponds to this setting
bool bInvertedDisplay; // true if and only if the checkbox is checked when the item is sal_False, and vice versa
@@ -95,7 +95,7 @@ namespace dbaui
sal_uInt16 nItemId = setting->nItemId;
if ( rFeatures.has( nItemId ) )
{
- get((*setting->ppControl), setting->sControlId);
+ get(*setting->ppControl, setting->sControlId);
(*setting->ppControl)->SetClickHdl( getControlModifiedLink() );
(*setting->ppControl)->Show();
@@ -134,7 +134,33 @@ namespace dbaui
SpecialSettingsPage::~SpecialSettingsPage()
{
+ disposeOnce();
+ }
+
+ void SpecialSettingsPage::dispose()
+ {
m_aControlDependencies.clear();
+ m_pIsSQL92Check.clear();
+ m_pAppendTableAlias.clear();
+ m_pAsBeforeCorrelationName.clear();
+ m_pEnableOuterJoin.clear();
+ m_pIgnoreDriverPrivileges.clear();
+ m_pParameterSubstitution.clear();
+ m_pSuppressVersionColumn.clear();
+ m_pCatalog.clear();
+ m_pSchema.clear();
+ m_pIndexAppendix.clear();
+ m_pDosLineEnds.clear();
+ m_pCheckRequiredFields.clear();
+ m_pIgnoreCurrency.clear();
+ m_pEscapeDateTime.clear();
+ m_pPrimaryKeySupport.clear();
+ m_pRespectDriverResultSetType.clear();
+ m_pBooleanComparisonModeLabel.clear();
+ m_pBooleanComparisonMode.clear();
+ m_pMaxRowScanLabel.clear();
+ m_pMaxRowScan.clear();
+ OGenericAdministrationPage::dispose();
}
void SpecialSettingsPage::impl_initBooleanSettings()
@@ -149,22 +175,21 @@ namespace dbaui
{ &m_pEnableOuterJoin, "useoj", DSID_ENABLEOUTERJOIN, false },
{ &m_pIgnoreDriverPrivileges, "ignoreprivs", DSID_IGNOREDRIVER_PRIV, false },
{ &m_pParameterSubstitution, "replaceparams", DSID_PARAMETERNAMESUBST, false },
- { &m_pSuppressVersionColumn, "displayver", DSID_SUPPRESSVERSIONCL, true },
+ { &m_pSuppressVersionColumn, "displayver", DSID_SUPPRESSVERSIONCL, true },
{ &m_pCatalog, "usecatalogname", DSID_CATALOG, false },
{ &m_pSchema, "useschemaname", DSID_SCHEMA, false },
{ &m_pIndexAppendix, "createindex", DSID_INDEXAPPENDIX, false },
{ &m_pDosLineEnds, "eol", DSID_DOSLINEENDS, false },
- { &m_pCheckRequiredFields, "inputchecks", DSID_CHECK_REQUIRED_FIELDS, false },
- { &m_pIgnoreCurrency, "ignorecurrency", DSID_IGNORECURRENCY, false },
+ { &m_pCheckRequiredFields, "ignorecurrency", DSID_CHECK_REQUIRED_FIELDS, false },
+ { &m_pIgnoreCurrency, "inputchecks", DSID_IGNORECURRENCY, false },
{ &m_pEscapeDateTime, "useodbcliterals", DSID_ESCAPE_DATETIME, false },
{ &m_pPrimaryKeySupport, "primarykeys", DSID_PRIMARY_KEY_SUPPORT, false },
- { &m_pRespectDriverResultSetType, "resulttype", DSID_RESPECTRESULTSETTYPE, false },
- { NULL, "", 0, false }
+ { &m_pRespectDriverResultSetType, "resulttype", DSID_RESPECTRESULTSETTYPE, false }
};
- for ( const BooleanSettingDesc* pCopy = aSettings; pCopy->nItemId != 0; ++pCopy )
+ for ( const BooleanSettingDesc& pCopy : aSettings )
{
- m_aBooleanSettings.push_back( *pCopy );
+ m_aBooleanSettings.push_back( pCopy );
}
}
@@ -187,7 +212,7 @@ namespace dbaui
++setting
)
{
- if ( *setting->ppControl )
+ if ( (*setting->ppControl) )
{
_rControlList.push_back( new OSaveValueWrapper< CheckBox >( *setting->ppControl ) );
}
@@ -217,7 +242,7 @@ namespace dbaui
++setting
)
{
- if ( !*setting->ppControl )
+ if ( !(*setting->ppControl) )
continue;
::boost::optional< bool > aValue(false);
@@ -317,7 +342,19 @@ namespace dbaui
GeneratedValuesPage::~GeneratedValuesPage()
{
+ disposeOnce();
+ }
+
+ void GeneratedValuesPage::dispose()
+ {
m_aControlDependencies.clear();
+ m_pAutoFrame.clear();
+ m_pAutoRetrievingEnabled.clear();
+ m_pAutoIncrementLabel.clear();
+ m_pAutoIncrement.clear();
+ m_pAutoRetrievingLabel.clear();
+ m_pAutoRetrieving.clear();
+ OGenericAdministrationPage::dispose();
}
void GeneratedValuesPage::fillWindows( ::std::vector< ISaveValueWrapper* >& _rControlList )
@@ -406,8 +443,14 @@ namespace dbaui
AdvancedSettingsDialog::~AdvancedSettingsDialog()
{
+ disposeOnce();
+ }
+
+ void AdvancedSettingsDialog::dispose()
+ {
SetInputSet(NULL);
DELETEZ(pExampleSet);
+ SfxTabDialog::dispose();
}
bool AdvancedSettingsDialog::doesHaveAnyAdvancedSettings( const OUString& _sURL )
diff --git a/dbaccess/source/ui/dlg/advancedsettings.hxx b/dbaccess/source/ui/dlg/advancedsettings.hxx
index 005f0cb909c5..7c08e920a687 100644
--- a/dbaccess/source/ui/dlg/advancedsettings.hxx
+++ b/dbaccess/source/ui/dlg/advancedsettings.hxx
@@ -40,28 +40,28 @@ namespace dbaui
class SpecialSettingsPage : public OGenericAdministrationPage
{
protected:
- CheckBox* m_pIsSQL92Check;
- CheckBox* m_pAppendTableAlias;
- CheckBox* m_pAsBeforeCorrelationName;
- CheckBox* m_pEnableOuterJoin;
- CheckBox* m_pIgnoreDriverPrivileges;
- CheckBox* m_pParameterSubstitution;
- CheckBox* m_pSuppressVersionColumn;
- CheckBox* m_pCatalog;
- CheckBox* m_pSchema;
- CheckBox* m_pIndexAppendix;
- CheckBox* m_pDosLineEnds;
- CheckBox* m_pCheckRequiredFields;
- CheckBox* m_pIgnoreCurrency;
- CheckBox* m_pEscapeDateTime;
- CheckBox* m_pPrimaryKeySupport;
- CheckBox* m_pRespectDriverResultSetType;
-
- FixedText* m_pBooleanComparisonModeLabel;
- ListBox* m_pBooleanComparisonMode;
-
- FixedText* m_pMaxRowScanLabel;
- NumericField* m_pMaxRowScan;
+ VclPtr<CheckBox> m_pIsSQL92Check;
+ VclPtr<CheckBox> m_pAppendTableAlias;
+ VclPtr<CheckBox> m_pAsBeforeCorrelationName;
+ VclPtr<CheckBox> m_pEnableOuterJoin;
+ VclPtr<CheckBox> m_pIgnoreDriverPrivileges;
+ VclPtr<CheckBox> m_pParameterSubstitution;
+ VclPtr<CheckBox> m_pSuppressVersionColumn;
+ VclPtr<CheckBox> m_pCatalog;
+ VclPtr<CheckBox> m_pSchema;
+ VclPtr<CheckBox> m_pIndexAppendix;
+ VclPtr<CheckBox> m_pDosLineEnds;
+ VclPtr<CheckBox> m_pCheckRequiredFields;
+ VclPtr<CheckBox> m_pIgnoreCurrency;
+ VclPtr<CheckBox> m_pEscapeDateTime;
+ VclPtr<CheckBox> m_pPrimaryKeySupport;
+ VclPtr<CheckBox> m_pRespectDriverResultSetType;
+
+ VclPtr<FixedText> m_pBooleanComparisonModeLabel;
+ VclPtr<ListBox> m_pBooleanComparisonMode;
+
+ VclPtr<FixedText> m_pMaxRowScanLabel;
+ VclPtr<NumericField> m_pMaxRowScan;
::svt::ControlDependencyManager
m_aControlDependencies;
@@ -78,6 +78,7 @@ namespace dbaui
protected:
virtual ~SpecialSettingsPage();
+ virtual void dispose() SAL_OVERRIDE;
// OGenericAdministrationPage overridables
virtual void implInitControls (const SfxItemSet& _rSet, bool _bSaveValue ) SAL_OVERRIDE;
@@ -97,12 +98,12 @@ namespace dbaui
{
protected:
- VclFrame* m_pAutoFrame;
- CheckBox* m_pAutoRetrievingEnabled;
- FixedText* m_pAutoIncrementLabel;
- Edit* m_pAutoIncrement;
- FixedText* m_pAutoRetrievingLabel;
- Edit* m_pAutoRetrieving;
+ VclPtr<VclFrame> m_pAutoFrame;
+ VclPtr<CheckBox> m_pAutoRetrievingEnabled;
+ VclPtr<FixedText> m_pAutoIncrementLabel;
+ VclPtr<Edit> m_pAutoIncrement;
+ VclPtr<FixedText> m_pAutoRetrievingLabel;
+ VclPtr<Edit> m_pAutoRetrieving;
::svt::ControlDependencyManager
m_aControlDependencies;
@@ -115,6 +116,7 @@ namespace dbaui
// nControlFlags is a combination of the CBTP_xxx-constants
virtual ~GeneratedValuesPage();
+ virtual void dispose() SAL_OVERRIDE;
// subclasses must override this, but it isn't pure virtual
virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE;
diff --git a/dbaccess/source/ui/dlg/dbadmin.cxx b/dbaccess/source/ui/dlg/dbadmin.cxx
index 7eeedec9500a..6f040bec4838 100644
--- a/dbaccess/source/ui/dlg/dbadmin.cxx
+++ b/dbaccess/source/ui/dlg/dbadmin.cxx
@@ -66,9 +66,14 @@ ODbAdminDialog::ODbAdminDialog(vcl::Window* _pParent
ODbAdminDialog::~ODbAdminDialog()
{
+ disposeOnce();
+}
+
+void ODbAdminDialog::dispose()
+{
SetInputSet(NULL);
DELETEZ(pExampleSet);
-
+ SfxTabDialog::dispose();
}
short ODbAdminDialog::Ok()
diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx
index 1493734256b1..f767f4ea31e9 100644
--- a/dbaccess/source/ui/dlg/dbfindex.cxx
+++ b/dbaccess/source/ui/dlg/dbfindex.cxx
@@ -76,6 +76,25 @@ ODbaseIndexDialog::ODbaseIndexDialog(vcl::Window * pParent, const OUString& aDat
SetCtrls();
}
+ODbaseIndexDialog::~ODbaseIndexDialog()
+{
+ disposeOnce();
+}
+
+void ODbaseIndexDialog::dispose()
+{
+ m_pPB_OK.clear();
+ m_pCB_Tables.clear();
+ m_pIndexes.clear();
+ m_pLB_TableIndexes.clear();
+ m_pLB_FreeIndexes.clear();
+ m_pAdd.clear();
+ m_pRemove.clear();
+ m_pAddAll.clear();
+ m_pRemoveAll.clear();
+ ModalDialog::dispose();
+}
+
bool ODbaseIndexDialog::GetTable(const OUString& _rName, TableInfoList::iterator& _rPosition)
{
for ( _rPosition = m_aTableInfoList.begin();
diff --git a/dbaccess/source/ui/dlg/dbfindex.hxx b/dbaccess/source/ui/dlg/dbfindex.hxx
index 58aae3b04091..46aac76028af 100644
--- a/dbaccess/source/ui/dlg/dbfindex.hxx
+++ b/dbaccess/source/ui/dlg/dbfindex.hxx
@@ -73,16 +73,16 @@ typedef ::std::list< OTableInfo > TableInfoList;
class ODbaseIndexDialog : public ModalDialog
{
protected:
- OKButton* m_pPB_OK;
- ComboBox* m_pCB_Tables;
- VclContainer* m_pIndexes;
- ListBox* m_pLB_TableIndexes;
- ListBox* m_pLB_FreeIndexes;
+ VclPtr<OKButton> m_pPB_OK;
+ VclPtr<ComboBox> m_pCB_Tables;
+ VclPtr<VclContainer> m_pIndexes;
+ VclPtr<ListBox> m_pLB_TableIndexes;
+ VclPtr<ListBox> m_pLB_FreeIndexes;
- PushButton* m_pAdd;
- PushButton* m_pRemove;
- PushButton* m_pAddAll;
- PushButton* m_pRemoveAll;
+ VclPtr<PushButton> m_pAdd;
+ VclPtr<PushButton> m_pRemove;
+ VclPtr<PushButton> m_pAddAll;
+ VclPtr<PushButton> m_pRemoveAll;
DECL_LINK( TableSelectHdl, ComboBox* );
DECL_LINK( AddClickHdl, PushButton* );
@@ -113,6 +113,8 @@ protected:
public:
ODbaseIndexDialog( vcl::Window * pParent, const OUString& aDataSrcName );
+ virtual ~ODbaseIndexDialog();
+ virtual void dispose() SAL_OVERRIDE;
};
} // namespace dbaui
diff --git a/dbaccess/source/ui/dlg/dbwiz.cxx b/dbaccess/source/ui/dlg/dbwiz.cxx
index f39d0dba2454..566c30af0fa0 100644
--- a/dbaccess/source/ui/dlg/dbwiz.cxx
+++ b/dbaccess/source/ui/dlg/dbwiz.cxx
@@ -102,7 +102,13 @@ ODbTypeWizDialog::ODbTypeWizDialog(vcl::Window* _pParent
ODbTypeWizDialog::~ODbTypeWizDialog()
{
+ disposeOnce();
+}
+
+void ODbTypeWizDialog::dispose()
+{
delete m_pOutSet;
+ svt::OWizardMachine::dispose();
}
IMPL_LINK(ODbTypeWizDialog, OnTypeSelected, OGeneralPage*, _pTabPage)
@@ -227,16 +233,16 @@ void ODbTypeWizDialog::clearPassword()
m_pImpl->clearPassword();
}
-TabPage* ODbTypeWizDialog::createPage(WizardState _nState)
+VclPtr<TabPage> ODbTypeWizDialog::createPage(WizardState _nState)
{
sal_uInt16 nStringId = STR_PAGETITLE_ADVANCED;
- TabPage* pPage = NULL;
+ VclPtr<TabPage> pPage;
switch(_nState)
{
case START_PAGE: // start state
{
- pPage = new OGeneralPageDialog(this,*m_pOutSet);
- OGeneralPage* pGeneralPage = static_cast< OGeneralPage* >( pPage );
+ pPage = VclPtr<OGeneralPageDialog>::Create(this,*m_pOutSet);
+ OGeneralPage* pGeneralPage = static_cast< OGeneralPage* >( pPage.get() );
pGeneralPage->SetTypeSelectHandler( LINK( this, ODbTypeWizDialog, OnTypeSelected));
nStringId = STR_PAGETITLE_GENERAL;
}
@@ -284,8 +290,8 @@ TabPage* ODbTypeWizDialog::createPage(WizardState _nState)
// register ourself as modified listener
if ( pPage )
{
- static_cast<OGenericAdministrationPage*>(pPage)->SetServiceFactory( m_pImpl->getORB() );
- static_cast<OGenericAdministrationPage*>(pPage)->SetAdminDialog(this,this);
+ static_cast<OGenericAdministrationPage*>(pPage.get())->SetServiceFactory( m_pImpl->getORB() );
+ static_cast<OGenericAdministrationPage*>(pPage.get())->SetAdminDialog(this,this);
pPage->SetText(ModuleRes(nStringId));
defaultButton( _nState == START_PAGE ? WZB_NEXT : WZB_FINISH );
enableButtons( WZB_FINISH, _nState != START_PAGE);
diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx
index 6a9f3c814928..b063828432e3 100644
--- a/dbaccess/source/ui/dlg/dbwizsetup.cxx
+++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx
@@ -264,7 +264,16 @@ OUString ODbTypeWizDialogSetup::getStateDisplayName( WizardState _nState ) const
ODbTypeWizDialogSetup::~ODbTypeWizDialogSetup()
{
+ disposeOnce();
+}
+
+void ODbTypeWizDialogSetup::dispose()
+{
delete m_pOutSet;
+ m_pGeneralPage.clear();
+ m_pMySQLIntroPage.clear();
+ m_pFinalPage.clear();
+ svt::RoadmapWizard::dispose();
}
IMPL_LINK(ODbTypeWizDialogSetup, OnTypeSelected, OGeneralPage*, /*_pTabPage*/)
@@ -420,7 +429,7 @@ Reference< XDriver > ODbTypeWizDialogSetup::getDriver()
::dbaccess::DATASOURCE_TYPE LocDatabaseType = _DatabaseType;
if ((LocDatabaseType == ::dbaccess::DST_MYSQL_JDBC) || (LocDatabaseType == ::dbaccess::DST_MYSQL_ODBC) || (LocDatabaseType == ::dbaccess::DST_MYSQL_NATIVE))
{
- if (m_pMySQLIntroPage != NULL)
+ if (m_pMySQLIntroPage != nullptr)
{
switch( m_pMySQLIntroPage->getMySQLMode() )
{
@@ -439,7 +448,7 @@ Reference< XDriver > ODbTypeWizDialogSetup::getDriver()
OUString ODbTypeWizDialogSetup::getDatasourceType(const SfxItemSet& _rSet) const
{
OUString sRet = dbaui::ODbDataSourceAdministrationHelper::getDatasourceType(_rSet);
- if (m_pMySQLIntroPage != NULL && m_pMySQLIntroPage->IsVisible() )
+ if (m_pMySQLIntroPage != nullptr && m_pMySQLIntroPage->IsVisible() )
{
switch( m_pMySQLIntroPage->getMySQLMode() )
{
@@ -462,16 +471,16 @@ void ODbTypeWizDialogSetup::clearPassword()
m_pImpl->clearPassword();
}
-TabPage* ODbTypeWizDialogSetup::createPage(WizardState _nState)
+VclPtr<TabPage> ODbTypeWizDialogSetup::createPage(WizardState _nState)
{
- SfxTabPage* pFirstPage;
- OGenericAdministrationPage* pPage = NULL;
+ VclPtr<SfxTabPage> pFirstPage;
+ VclPtr<OGenericAdministrationPage> pPage;
switch(_nState)
{
case PAGE_DBSETUPWIZARD_INTRO:
- pFirstPage = new OGeneralPageWizard(this,*m_pOutSet);
- pPage = static_cast<OGenericAdministrationPage*> (pFirstPage);
- m_pGeneralPage = static_cast<OGeneralPageWizard*>(pFirstPage);
+ pFirstPage = VclPtr<OGeneralPageWizard>::Create(this,*m_pOutSet);
+ pPage = static_cast<OGenericAdministrationPage*> (pFirstPage.get());
+ m_pGeneralPage = static_cast<OGeneralPageWizard*>(pFirstPage.get());
m_pGeneralPage->SetTypeSelectHandler(LINK(this, ODbTypeWizDialogSetup, OnTypeSelected));
m_pGeneralPage->SetCreationModeHandler(LINK( this, ODbTypeWizDialogSetup, OnChangeCreationMode ) );
m_pGeneralPage->SetDocumentSelectionHandler(LINK( this, ODbTypeWizDialogSetup, OnRecentDocumentSelected ) );
@@ -543,7 +552,7 @@ TabPage* ODbTypeWizDialogSetup::createPage(WizardState _nState)
case PAGE_DBSETUPWIZARD_FINAL:
pPage = OFinalDBPageSetup::CreateFinalDBTabPageSetup(this,*m_pOutSet);
- m_pFinalPage = static_cast<OFinalDBPageSetup*> (pPage);
+ m_pFinalPage = static_cast<OFinalDBPageSetup*> (pPage.get());
break;
}
@@ -734,7 +743,7 @@ bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
if ( m_pGeneralPage->GetDatabaseCreationMode() == OGeneralPageWizard::eOpenExisting )
return true;
- if ( m_pFinalPage != NULL )
+ if ( m_pFinalPage != nullptr )
return m_pFinalPage->IsDatabaseDocumentToBeOpened();
return true;
@@ -745,7 +754,7 @@ bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
if ( m_pGeneralPage->GetDatabaseCreationMode() == OGeneralPageWizard::eOpenExisting )
return false;
- if ( m_pFinalPage != NULL )
+ if ( m_pFinalPage != nullptr )
return m_pFinalPage->IsTableWizardToBeStarted();
return false;
diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx
index 5018b582288d..b090ddc8df06 100644
--- a/dbaccess/source/ui/dlg/detailpages.cxx
+++ b/dbaccess/source/ui/dlg/detailpages.cxx
@@ -71,7 +71,6 @@ namespace dbaui
,m_pAutoRetrievingLabel(NULL)
,m_pAutoRetrieving(NULL)
,m_nControlFlags(nControlFlags)
- ,m_bDelete(false)
{
if ((m_nControlFlags & CBTP_USE_OPTIONS) == CBTP_USE_OPTIONS)
@@ -97,22 +96,21 @@ namespace dbaui
OCommonBehaviourTabPage::~OCommonBehaviourTabPage()
{
- if(m_bDelete)
- {
- DELETEZ(m_pOptionsLabel);
- DELETEZ(m_pOptions);
-
- DELETEZ(m_pCharsetLabel);
- DELETEZ(m_pCharset);
-
- DELETEZ(m_pAutoIncrementLabel);
- DELETEZ(m_pAutoIncrement);
-
- DELETEZ(m_pAutoRetrievingEnabled);
- DELETEZ(m_pAutoRetrievingLabel);
- DELETEZ(m_pAutoRetrieving);
- }
+ disposeOnce();
+ }
+ void OCommonBehaviourTabPage::dispose()
+ {
+ m_pOptionsLabel.disposeAndClear();
+ m_pOptions.disposeAndClear();
+ m_pCharsetLabel.disposeAndClear();
+ m_pCharset.disposeAndClear();
+ m_pAutoIncrementLabel.disposeAndClear();
+ m_pAutoIncrement.disposeAndClear();
+ m_pAutoRetrievingEnabled.disposeAndClear();
+ m_pAutoRetrievingLabel.disposeAndClear();
+ m_pAutoRetrieving.disposeAndClear();
+ OGenericAdministrationPage::dispose();
}
void OCommonBehaviourTabPage::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList)
@@ -196,12 +194,20 @@ namespace dbaui
ODbaseDetailsPage::~ODbaseDetailsPage()
{
+ disposeOnce();
+ }
+ void ODbaseDetailsPage::dispose()
+ {
+ m_pShowDeleted.clear();
+ m_pFT_Message.clear();
+ m_pIndexes.clear();
+ OCommonBehaviourTabPage::dispose();
}
- SfxTabPage* ODriversSettings::CreateDbase( vcl::Window* pParent, const SfxItemSet* _rAttrSet )
+ VclPtr<SfxTabPage> ODriversSettings::CreateDbase( vcl::Window* pParent, const SfxItemSet* _rAttrSet )
{
- return ( new ODbaseDetailsPage( pParent, *_rAttrSet ) );
+ return VclPtr<ODbaseDetailsPage>::Create( pParent, *_rAttrSet );
}
void ODbaseDetailsPage::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue)
@@ -241,8 +247,8 @@ namespace dbaui
{
if (m_pIndexes == pButton)
{
- ODbaseIndexDialog aIndexDialog(this, m_sDsn);
- aIndexDialog.Execute();
+ ScopedVclPtrInstance< ODbaseIndexDialog > aIndexDialog(this, m_sDsn);
+ aIndexDialog->Execute();
}
else
{
@@ -261,13 +267,9 @@ namespace dbaui
}
- OAdoDetailsPage::~OAdoDetailsPage()
- {
-
- }
- SfxTabPage* ODriversSettings::CreateAdo( vcl::Window* pParent, const SfxItemSet* _rAttrSet )
+ VclPtr<SfxTabPage> ODriversSettings::CreateAdo( vcl::Window* pParent, const SfxItemSet* _rAttrSet )
{
- return ( new OAdoDetailsPage( pParent, *_rAttrSet ) );
+ return VclPtr<OAdoDetailsPage>::Create( pParent, *_rAttrSet );
}
// OOdbcDetailsPage
@@ -278,9 +280,20 @@ namespace dbaui
m_pUseCatalog->SetToggleHdl(getControlModifiedLink());
}
- SfxTabPage* ODriversSettings::CreateODBC( vcl::Window* pParent, const SfxItemSet* _rAttrSet )
+ OOdbcDetailsPage::~OOdbcDetailsPage()
+ {
+ disposeOnce();
+ }
+
+ void OOdbcDetailsPage::dispose()
{
- return ( new OOdbcDetailsPage( pParent, *_rAttrSet ) );
+ m_pUseCatalog.clear();
+ OCommonBehaviourTabPage::dispose();
+ }
+
+ VclPtr<SfxTabPage> ODriversSettings::CreateODBC( vcl::Window* pParent, const SfxItemSet* _rAttrSet )
+ {
+ return VclPtr<OOdbcDetailsPage>::Create( pParent, *_rAttrSet );
}
bool OOdbcDetailsPage::FillItemSet( SfxItemSet* _rSet )
@@ -316,9 +329,24 @@ namespace dbaui
m_pUseCatalog->SetToggleHdl(getControlModifiedLink());
}
- SfxTabPage* ODriversSettings::CreateUser( vcl::Window* pParent, const SfxItemSet* _rAttrSet )
+ OUserDriverDetailsPage::~OUserDriverDetailsPage()
+ {
+ disposeOnce();
+ }
+
+ void OUserDriverDetailsPage::dispose()
+ {
+ m_pFTHostname.clear();
+ m_pEDHostname.clear();
+ m_pPortNumber.clear();
+ m_pNFPortNumber.clear();
+ m_pUseCatalog.clear();
+ OCommonBehaviourTabPage::dispose();
+ }
+
+ VclPtr<SfxTabPage> ODriversSettings::CreateUser( vcl::Window* pParent, const SfxItemSet* _rAttrSet )
{
- return ( new OUserDriverDetailsPage( pParent, *_rAttrSet ) );
+ return VclPtr<OUserDriverDetailsPage>::Create( pParent, *_rAttrSet );
}
bool OUserDriverDetailsPage::FillItemSet( SfxItemSet* _rSet )
@@ -373,9 +401,9 @@ namespace dbaui
{
}
- SfxTabPage* ODriversSettings::CreateMySQLODBC( vcl::Window* pParent, const SfxItemSet* _rAttrSet )
+ VclPtr<SfxTabPage> ODriversSettings::CreateMySQLODBC( vcl::Window* pParent, const SfxItemSet* _rAttrSet )
{
- return ( new OMySQLODBCDetailsPage( pParent, *_rAttrSet ) );
+ return VclPtr<OMySQLODBCDetailsPage>::Create( pParent, *_rAttrSet );
}
// OMySQLJDBCDetailsPage
@@ -422,6 +450,23 @@ namespace dbaui
m_pEDSocket->SetModifyHdl(getControlModifiedLink());
}
+ OGeneralSpecialJDBCDetailsPage::~OGeneralSpecialJDBCDetailsPage()
+ {
+ disposeOnce();
+ }
+
+ void OGeneralSpecialJDBCDetailsPage::dispose()
+ {
+ m_pEDHostname.clear();
+ m_pNFPortNumber.clear();
+ m_pFTSocket.clear();
+ m_pEDSocket.clear();
+ m_pFTDriverClass.clear();
+ m_pEDDriverClass.clear();
+ m_pTestJavaDriver.clear();
+ OCommonBehaviourTabPage::dispose();
+ }
+
bool OGeneralSpecialJDBCDetailsPage::FillItemSet( SfxItemSet* _rSet )
{
bool bChangedSomething = OCommonBehaviourTabPage::FillItemSet(_rSet);
@@ -494,8 +539,8 @@ namespace dbaui
#endif
const sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
const OSQLMessageBox::MessageType mt = bSuccess ? OSQLMessageBox::Info : OSQLMessageBox::Error;
- OSQLMessageBox aMsg( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt );
- aMsg.Execute();
+ ScopedVclPtrInstance< OSQLMessageBox > aMsg( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt );
+ aMsg->Execute();
return 0L;
}
IMPL_LINK(OGeneralSpecialJDBCDetailsPage, OnEditModified, Edit*, _pEdit)
@@ -511,7 +556,7 @@ namespace dbaui
// MySQLNativePage
MySQLNativePage::MySQLNativePage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs )
:OCommonBehaviourTabPage(pParent, "MysqlNativePage", "dbaccess/ui/mysqlnativepage.ui", _rCoreAttrs, CBTP_USE_CHARSET )
- ,m_aMySQLSettings ( *get<VclVBox>("MySQLSettingsContainer"), getControlModifiedLink() )
+ ,m_aMySQLSettings ( VclPtr<MySQLNativeSettings>::Create(*get<VclVBox>("MySQLSettingsContainer"), getControlModifiedLink()) )
{
get(m_pSeparator1, "connectionheader");
get(m_pSeparator2, "userheader");
@@ -521,13 +566,29 @@ namespace dbaui
m_pUserName->SetModifyHdl(getControlModifiedLink());
- m_aMySQLSettings.Show();
+ m_aMySQLSettings->Show();
+ }
+
+ MySQLNativePage::~MySQLNativePage()
+ {
+ disposeOnce();
+ }
+
+ void MySQLNativePage::dispose()
+ {
+ m_aMySQLSettings.disposeAndClear();
+ m_pSeparator1.clear();
+ m_pSeparator2.clear();
+ m_pUserNameLabel.clear();
+ m_pUserName.clear();
+ m_pPasswordRequired.clear();
+ OCommonBehaviourTabPage::dispose();
}
void MySQLNativePage::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList)
{
OCommonBehaviourTabPage::fillControls( _rControlList );
- m_aMySQLSettings.fillControls( _rControlList );
+ m_aMySQLSettings->fillControls( _rControlList );
_rControlList.push_back(new OSaveValueWrapper<Edit>(m_pUserName));
_rControlList.push_back(new OSaveValueWrapper<CheckBox>(m_pPasswordRequired));
@@ -535,7 +596,7 @@ namespace dbaui
void MySQLNativePage::fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList)
{
OCommonBehaviourTabPage::fillWindows( _rControlList );
- m_aMySQLSettings.fillWindows( _rControlList);
+ m_aMySQLSettings->fillWindows( _rControlList);
_rControlList.push_back(new ODisableWrapper<FixedText>(m_pSeparator1));
_rControlList.push_back(new ODisableWrapper<FixedText>(m_pSeparator2));
@@ -546,7 +607,7 @@ namespace dbaui
{
bool bChangedSomething = OCommonBehaviourTabPage::FillItemSet( _rSet );
- bChangedSomething |= m_aMySQLSettings.FillItemSet( _rSet );
+ bChangedSomething |= m_aMySQLSettings->FillItemSet( _rSet );
if ( m_pUserName->IsValueChangedFromSaved() )
{
@@ -564,7 +625,7 @@ namespace dbaui
bool bValid, bReadonly;
getFlags(_rSet, bValid, bReadonly);
- m_aMySQLSettings.implInitControls( _rSet );
+ m_aMySQLSettings->implInitControls( _rSet );
SFX_ITEMSET_GET(_rSet, pUidItem, SfxStringItem, DSID_USER, true);
SFX_ITEMSET_GET(_rSet, pAllowEmptyPwd, SfxBoolItem, DSID_PASSWORDREQUIRED, true);
@@ -579,18 +640,18 @@ namespace dbaui
OCommonBehaviourTabPage::implInitControls(_rSet, _bSaveValue);
}
- SfxTabPage* ODriversSettings::CreateMySQLJDBC( vcl::Window* pParent, const SfxItemSet* _rAttrSet )
+ VclPtr<SfxTabPage> ODriversSettings::CreateMySQLJDBC( vcl::Window* pParent, const SfxItemSet* _rAttrSet )
{
- return ( new OGeneralSpecialJDBCDetailsPage( pParent, *_rAttrSet,DSID_MYSQL_PORTNUMBER ) );
+ return VclPtr<OGeneralSpecialJDBCDetailsPage>::Create( pParent, *_rAttrSet,DSID_MYSQL_PORTNUMBER );
}
- SfxTabPage* ODriversSettings::CreateMySQLNATIVE( vcl::Window* pParent, const SfxItemSet* _rAttrSet )
+ VclPtr<SfxTabPage> ODriversSettings::CreateMySQLNATIVE( vcl::Window* pParent, const SfxItemSet* _rAttrSet )
{
- return ( new MySQLNativePage( pParent, *_rAttrSet ) );
+ return VclPtr<MySQLNativePage>::Create( pParent, *_rAttrSet );
}
- SfxTabPage* ODriversSettings::CreateOracleJDBC( vcl::Window* pParent, const SfxItemSet* _rAttrSet )
+ VclPtr<SfxTabPage> ODriversSettings::CreateOracleJDBC( vcl::Window* pParent, const SfxItemSet* _rAttrSet )
{
- return ( new OGeneralSpecialJDBCDetailsPage( pParent, *_rAttrSet,DSID_ORACLE_PORTNUMBER, false) );
+ return VclPtr<OGeneralSpecialJDBCDetailsPage>::Create( pParent, *_rAttrSet,DSID_ORACLE_PORTNUMBER, false);
}
// OLDAPDetailsPage
@@ -614,9 +675,23 @@ namespace dbaui
m_pCBUseSSL->SetClickHdl(LINK(this, OLDAPDetailsPage,OnCheckBoxClick));
}
- SfxTabPage* ODriversSettings::CreateLDAP( vcl::Window* pParent, const SfxItemSet* _rAttrSet )
+ OLDAPDetailsPage::~OLDAPDetailsPage()
+ {
+ disposeOnce();
+ }
+
+ void OLDAPDetailsPage::dispose()
{
- return ( new OLDAPDetailsPage( pParent, *_rAttrSet ) );
+ m_pETBaseDN.clear();
+ m_pCBUseSSL.clear();
+ m_pNFPortNumber.clear();
+ m_pNFRowCount.clear();
+ OCommonBehaviourTabPage::dispose();
+ }
+
+ VclPtr<SfxTabPage> ODriversSettings::CreateLDAP( vcl::Window* pParent, const SfxItemSet* _rAttrSet )
+ {
+ return VclPtr<OLDAPDetailsPage>::Create( pParent, *_rAttrSet );
}
bool OLDAPDetailsPage::FillItemSet( SfxItemSet* _rSet )
@@ -675,18 +750,23 @@ namespace dbaui
:OCommonBehaviourTabPage(pParent, "EmptyPage", "dbaccess/ui/emptypage.ui", _rCoreAttrs, 0)
{
- m_pTextConnectionHelper = new OTextConnectionHelper( get<VclVBox>("EmptyPage"), TC_EXTENSION | TC_HEADER | TC_SEPARATORS | TC_CHARSET );
+ m_pTextConnectionHelper = VclPtr<OTextConnectionHelper>::Create( get<VclVBox>("EmptyPage"), TC_EXTENSION | TC_HEADER | TC_SEPARATORS | TC_CHARSET );
}
OTextDetailsPage::~OTextDetailsPage()
{
- DELETEZ(m_pTextConnectionHelper);
+ disposeOnce();
+ }
+ void OTextDetailsPage::dispose()
+ {
+ m_pTextConnectionHelper.disposeAndClear();
+ OCommonBehaviourTabPage::dispose();
}
- SfxTabPage* ODriversSettings::CreateText( vcl::Window* pParent, const SfxItemSet* _rAttrSet )
+ VclPtr<SfxTabPage> ODriversSettings::CreateText( vcl::Window* pParent, const SfxItemSet* _rAttrSet )
{
- return ( new OTextDetailsPage( pParent, *_rAttrSet ) );
+ return VclPtr<OTextDetailsPage>::Create( pParent, *_rAttrSet );
}
void OTextDetailsPage::fillControls(::std::vector< ISaveValueWrapper* >& _rControlList)
{
@@ -722,16 +802,16 @@ namespace dbaui
return m_pTextConnectionHelper->prepareLeave();
}
- SfxTabPage* ODriversSettings::CreateGeneratedValuesPage( vcl::Window* _pParent, const SfxItemSet* _rAttrSet )
+ VclPtr<SfxTabPage> ODriversSettings::CreateGeneratedValuesPage( vcl::Window* _pParent, const SfxItemSet* _rAttrSet )
{
- return new GeneratedValuesPage( _pParent, *_rAttrSet );
+ return VclPtr<GeneratedValuesPage>::Create( _pParent, *_rAttrSet );
}
- SfxTabPage* ODriversSettings::CreateSpecialSettingsPage( vcl::Window* _pParent, const SfxItemSet* _rAttrSet )
+ VclPtr<SfxTabPage> ODriversSettings::CreateSpecialSettingsPage( vcl::Window* _pParent, const SfxItemSet* _rAttrSet )
{
OUString eType = ODbDataSourceAdministrationHelper::getDatasourceType( *_rAttrSet );
DataSourceMetaData aMetaData( eType );
- return new SpecialSettingsPage( _pParent, *_rAttrSet, aMetaData );
+ return VclPtr<SpecialSettingsPage>::Create( _pParent, *_rAttrSet, aMetaData );
}
} // namespace dbaui
diff --git a/dbaccess/source/ui/dlg/detailpages.hxx b/dbaccess/source/ui/dlg/detailpages.hxx
index fd4119bdbbfa..407a986c2c1c 100644
--- a/dbaccess/source/ui/dlg/detailpages.hxx
+++ b/dbaccess/source/ui/dlg/detailpages.hxx
@@ -50,22 +50,20 @@ namespace dbaui
{
protected:
- FixedText* m_pOptionsLabel;
- Edit* m_pOptions;
+ VclPtr<FixedText> m_pOptionsLabel;
+ VclPtr<Edit> m_pOptions;
- FixedText* m_pCharsetLabel;
- CharSetListBox* m_pCharset;
+ VclPtr<FixedText> m_pCharsetLabel;
+ VclPtr<CharSetListBox> m_pCharset;
- CheckBox* m_pAutoRetrievingEnabled;
- FixedText* m_pAutoIncrementLabel;
- Edit* m_pAutoIncrement;
- FixedText* m_pAutoRetrievingLabel;
- Edit* m_pAutoRetrieving;
+ VclPtr<CheckBox> m_pAutoRetrievingEnabled;
+ VclPtr<FixedText> m_pAutoIncrementLabel;
+ VclPtr<Edit> m_pAutoIncrement;
+ VclPtr<FixedText> m_pAutoRetrievingLabel;
+ VclPtr<Edit> m_pAutoRetrieving;
sal_uInt32 m_nControlFlags;
- bool m_bDelete;
-
public:
virtual bool FillItemSet (SfxItemSet* _rCoreAttrs) SAL_OVERRIDE;
@@ -74,6 +72,7 @@ namespace dbaui
protected:
virtual ~OCommonBehaviourTabPage();
+ virtual void dispose() SAL_OVERRIDE;
// subclasses must override this, but it isn't pure virtual
virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE;
@@ -92,18 +91,16 @@ namespace dbaui
virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) SAL_OVERRIDE;
ODbaseDetailsPage(vcl::Window* pParent, const SfxItemSet& _rCoreAttrs);
+ virtual ~ODbaseDetailsPage();
+ virtual void dispose() SAL_OVERRIDE;
private:
- CheckBox* m_pShowDeleted;
- FixedText* m_pFT_Message;
- PushButton* m_pIndexes;
+ VclPtr<CheckBox> m_pShowDeleted;
+ VclPtr<FixedText> m_pFT_Message;
+ VclPtr<PushButton> m_pIndexes;
OUString m_sDsn;
protected:
-
- virtual ~ODbaseDetailsPage();
-
- protected:
virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE;
private:
@@ -113,10 +110,7 @@ namespace dbaui
// OAdoDetailsPage
class OAdoDetailsPage : public OCommonBehaviourTabPage
{
- protected:
- virtual ~OAdoDetailsPage();
public:
-
OAdoDetailsPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs );
};
@@ -127,10 +121,12 @@ namespace dbaui
virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) SAL_OVERRIDE;
OOdbcDetailsPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs );
+ virtual ~OOdbcDetailsPage();
+ virtual void dispose() SAL_OVERRIDE;
protected:
virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE;
private:
- CheckBox* m_pUseCatalog;
+ VclPtr<CheckBox> m_pUseCatalog;
};
// OUserDriverDetailsPage
@@ -140,16 +136,18 @@ namespace dbaui
virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) SAL_OVERRIDE;
OUserDriverDetailsPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs );
+ virtual ~OUserDriverDetailsPage();
+ virtual void dispose() SAL_OVERRIDE;
protected:
virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE;
virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) SAL_OVERRIDE;
virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList) SAL_OVERRIDE;
private:
- FixedText* m_pFTHostname;
- Edit* m_pEDHostname;
- FixedText* m_pPortNumber;
- NumericField* m_pNFPortNumber;
- CheckBox* m_pUseCatalog;
+ VclPtr<FixedText> m_pFTHostname;
+ VclPtr<Edit> m_pEDHostname;
+ VclPtr<FixedText> m_pPortNumber;
+ VclPtr<NumericField> m_pNFPortNumber;
+ VclPtr<CheckBox> m_pUseCatalog;
};
// OMySQLODBCDetailsPage
@@ -168,6 +166,8 @@ namespace dbaui
, sal_uInt16 _nPortId
, bool bShowSocket = true
);
+ virtual ~OGeneralSpecialJDBCDetailsPage();
+ virtual void dispose() SAL_OVERRIDE;
protected:
@@ -177,14 +177,14 @@ namespace dbaui
DECL_LINK(OnTestJavaClickHdl,PushButton*);
DECL_LINK(OnEditModified,Edit*);
- Edit* m_pEDHostname;
- NumericField* m_pNFPortNumber;
- FixedText* m_pFTSocket;
- Edit* m_pEDSocket;
+ VclPtr<Edit> m_pEDHostname;
+ VclPtr<NumericField> m_pNFPortNumber;
+ VclPtr<FixedText> m_pFTSocket;
+ VclPtr<Edit> m_pEDSocket;
- FixedText* m_pFTDriverClass;
- Edit* m_pEDDriverClass;
- PushButton* m_pTestJavaDriver;
+ VclPtr<FixedText> m_pFTDriverClass;
+ VclPtr<Edit> m_pEDDriverClass;
+ VclPtr<PushButton> m_pTestJavaDriver;
OUString m_sDefaultJdbcDriverName;
sal_uInt16 m_nPortId;
@@ -197,15 +197,17 @@ namespace dbaui
public:
MySQLNativePage( vcl::Window* pParent,
const SfxItemSet& _rCoreAttrs );
+ virtual ~MySQLNativePage();
+ virtual void dispose() SAL_OVERRIDE;
private:
- FixedText *m_pSeparator1;
- MySQLNativeSettings m_aMySQLSettings;
+ VclPtr<FixedText> m_pSeparator1;
+ VclPtr<MySQLNativeSettings> m_aMySQLSettings;
- FixedText *m_pSeparator2;
- FixedText *m_pUserNameLabel;
- Edit *m_pUserName;
- CheckBox *m_pPasswordRequired;
+ VclPtr<FixedText> m_pSeparator2;
+ VclPtr<FixedText> m_pUserNameLabel;
+ VclPtr<Edit> m_pUserName;
+ VclPtr<CheckBox> m_pPasswordRequired;
protected:
virtual bool FillItemSet( SfxItemSet* _rCoreAttrs ) SAL_OVERRIDE;
@@ -221,13 +223,15 @@ namespace dbaui
virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) SAL_OVERRIDE;
OLDAPDetailsPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs );
+ virtual ~OLDAPDetailsPage();
+ virtual void dispose() SAL_OVERRIDE;
protected:
virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE;
private:
- Edit* m_pETBaseDN;
- CheckBox* m_pCBUseSSL;
- NumericField* m_pNFPortNumber;
- NumericField* m_pNFRowCount;
+ VclPtr<Edit> m_pETBaseDN;
+ VclPtr<CheckBox> m_pCBUseSSL;
+ VclPtr<NumericField> m_pNFPortNumber;
+ VclPtr<NumericField> m_pNFRowCount;
sal_Int32 m_iSSLPort;
sal_Int32 m_iNormalPort;
@@ -237,10 +241,7 @@ namespace dbaui
// OMozillaDetailsPage Detail page for Mozilla and Thunderbird addressbook
class OMozillaDetailsPage : public OCommonBehaviourTabPage
{
- protected:
- virtual ~OMozillaDetailsPage();
public:
-
OMozillaDetailsPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs );
};
@@ -251,10 +252,11 @@ namespace dbaui
virtual bool FillItemSet ( SfxItemSet* _rCoreAttrs ) SAL_OVERRIDE;
OTextDetailsPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs );
- OTextConnectionHelper* m_pTextConnectionHelper;
+ VclPtr<OTextConnectionHelper> m_pTextConnectionHelper;
protected:
virtual ~OTextDetailsPage();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool prepareLeave() SAL_OVERRIDE;
virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) SAL_OVERRIDE;
diff --git a/dbaccess/source/ui/dlg/directsql.cxx b/dbaccess/source/ui/dlg/directsql.cxx
index b02b73332e6f..c5ceccbae91b 100644
--- a/dbaccess/source/ui/dlg/directsql.cxx
+++ b/dbaccess/source/ui/dlg/directsql.cxx
@@ -76,11 +76,23 @@ namespace dbaui
DirectSQLDialog::~DirectSQLDialog()
{
+ disposeOnce();
+ }
+
+ void DirectSQLDialog::dispose()
+ {
{
::osl::MutexGuard aGuard(m_aMutex);
stopAllComponentListening();
}
-
+ m_pSQL.clear();
+ m_pExecute.clear();
+ m_pSQLHistory.clear();
+ m_pStatus.clear();
+ m_pShowOutput.clear();
+ m_pOutput.clear();
+ m_pClose.clear();
+ ModalDialog::dispose();
}
void DirectSQLDialog::_disposing( const EventObject& _rSource )
@@ -94,8 +106,8 @@ namespace dbaui
{
OUString sMessage(ModuleRes(STR_DIRECTSQL_CONNECTIONLOST));
- MessageDialog aError(this, sMessage);
- aError.Execute();
+ ScopedVclPtrInstance< MessageDialog > aError(this, sMessage);
+ aError->Execute();
}
PostUserEvent(LINK(this, DirectSQLDialog, OnClose));
diff --git a/dbaccess/source/ui/dlg/dlgattr.cxx b/dbaccess/source/ui/dlg/dlgattr.cxx
index 468233f5c748..1ca5043be4bb 100644
--- a/dbaccess/source/ui/dlg/dlgattr.cxx
+++ b/dbaccess/source/ui/dlg/dlgattr.cxx
@@ -52,8 +52,13 @@ SbaSbAttrDlg::SbaSbAttrDlg(vcl::Window* pParent, const SfxItemSet* pCellAttrs,
SbaSbAttrDlg::~SbaSbAttrDlg()
{
- delete pNumberInfoItem;
+ disposeOnce();
+}
+void SbaSbAttrDlg::dispose()
+{
+ delete pNumberInfoItem;
+ SfxTabDialog::dispose();
}
void SbaSbAttrDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage )
diff --git a/dbaccess/source/ui/dlg/dlgsave.cxx b/dbaccess/source/ui/dlg/dlgsave.cxx
index e2817a3d9b7a..46bbbacf63c7 100644
--- a/dbaccess/source/ui/dlg/dlgsave.cxx
+++ b/dbaccess/source/ui/dlg/dlgsave.cxx
@@ -48,14 +48,14 @@ namespace dbaui
class OSaveAsDlgImpl
{
public:
- FixedText* m_pDescription;
- FixedText* m_pCatalogLbl;
- OSQLNameComboBox* m_pCatalog;
- FixedText* m_pSchemaLbl;
- OSQLNameComboBox* m_pSchema;
- FixedText* m_pLabel;
- OSQLNameEdit* m_pTitle;
- OKButton* m_pPB_OK;
+ VclPtr<FixedText> m_pDescription;
+ VclPtr<FixedText> m_pCatalogLbl;
+ VclPtr<OSQLNameComboBox> m_pCatalog;
+ VclPtr<FixedText> m_pSchemaLbl;
+ VclPtr<OSQLNameComboBox> m_pSchema;
+ VclPtr<FixedText> m_pLabel;
+ VclPtr<OSQLNameEdit> m_pTitle;
+ VclPtr<OKButton> m_pPB_OK;
OUString m_aQryLabel;
OUString m_sTblLabel;
OUString m_aName;
@@ -285,7 +285,13 @@ OSaveAsDlg::OSaveAsDlg( vcl::Window * pParent,
OSaveAsDlg::~OSaveAsDlg()
{
+ disposeOnce();
+}
+
+void OSaveAsDlg::dispose()
+{
DELETEZ(m_pImpl);
+ ModalDialog::dispose();
}
IMPL_LINK(OSaveAsDlg, ButtonClickHdl, Button *, pButton)
diff --git a/dbaccess/source/ui/dlg/dlgsize.cxx b/dbaccess/source/ui/dlg/dlgsize.cxx
index 11750ab0917a..6c254a494e84 100644
--- a/dbaccess/source/ui/dlg/dlgsize.cxx
+++ b/dbaccess/source/ui/dlg/dlgsize.cxx
@@ -51,6 +51,19 @@ DlgSize::DlgSize( vcl::Window* pParent, sal_Int32 nVal, bool bRow, sal_Int32 _nA
LINK(this,DlgSize,CbClickHdl).Call(m_pCB_STANDARD);
}
+DlgSize::~DlgSize()
+{
+ disposeOnce();
+}
+
+void DlgSize::dispose()
+{
+ m_pMF_VALUE.clear();
+ m_pCB_STANDARD.clear();
+ ModalDialog::dispose();
+}
+
+
void DlgSize::SetValue( sal_Int32 nVal )
{
m_pMF_VALUE->SetValue(nVal, FUNIT_CM );
diff --git a/dbaccess/source/ui/dlg/dsselect.cxx b/dbaccess/source/ui/dlg/dsselect.cxx
index bcd1dc6add60..950903da5ccd 100644
--- a/dbaccess/source/ui/dlg/dsselect.cxx
+++ b/dbaccess/source/ui/dlg/dsselect.cxx
@@ -72,8 +72,18 @@ ODatasourceSelectDialog::ODatasourceSelectDialog(vcl::Window* _pParent, const St
ODatasourceSelectDialog::~ODatasourceSelectDialog()
{
+ disposeOnce();
}
+void ODatasourceSelectDialog::dispose()
+{
+ m_pDatasource.clear();
+ m_pOk.clear();
+ m_pCancel.clear();
+ ModalDialog::dispose();
+}
+
+
IMPL_LINK( ODatasourceSelectDialog, ListDblClickHdl, ListBox *, pListBox )
{
if (pListBox->GetSelectEntryCount())
diff --git a/dbaccess/source/ui/dlg/dsselect.hxx b/dbaccess/source/ui/dlg/dsselect.hxx
index b124fb0cdaee..2cb4cb6537e6 100644
--- a/dbaccess/source/ui/dlg/dsselect.hxx
+++ b/dbaccess/source/ui/dlg/dsselect.hxx
@@ -41,12 +41,12 @@ namespace dbaui
class ODatasourceSelectDialog : public ModalDialog
{
protected:
- ListBox* m_pDatasource;
- OKButton* m_pOk;
- CancelButton* m_pCancel;
+ VclPtr<ListBox> m_pDatasource;
+ VclPtr<OKButton> m_pOk;
+ VclPtr<CancelButton> m_pCancel;
SfxItemSet* m_pOutputSet;
#ifdef HAVE_ODBC_ADMINISTRATION
- PushButton* m_pManageDatasources;
+ VclPtr<PushButton> m_pManageDatasources;
::std::unique_ptr< OOdbcManagement >
m_pODBCManagement;
#endif
@@ -54,7 +54,7 @@ protected:
public:
ODatasourceSelectDialog( vcl::Window* _pParent, const StringBag& _rDatasources, SfxItemSet* _pOutputSet = NULL );
virtual ~ODatasourceSelectDialog();
-
+ virtual void dispose() SAL_OVERRIDE;
OUString GetSelected() const { return m_pDatasource->GetSelectEntry();}
void Select( const OUString& _rEntry ) { m_pDatasource->SelectEntry(_rEntry); }
diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx
index 1a543dce4c73..4ece5045c04d 100644
--- a/dbaccess/source/ui/dlg/generalpage.cxx
+++ b/dbaccess/source/ui/dlg/generalpage.cxx
@@ -76,6 +76,14 @@ namespace dbaui
OGeneralPage::~OGeneralPage()
{
+ disposeOnce();
+ }
+
+ void OGeneralPage::dispose()
+ {
+ m_pSpecialMessage.clear();
+ m_pDatasourceType.clear();
+ OGenericAdministrationPage::dispose();
}
namespace
@@ -537,6 +545,24 @@ namespace dbaui
m_pPB_OpenDatabase->SetClickHdl( LINK( this, OGeneralPageWizard, OnOpenDocument ) );
}
+ OGeneralPageWizard::~OGeneralPageWizard()
+ {
+ disposeOnce();
+ }
+
+ void OGeneralPageWizard::dispose()
+ {
+ m_pRB_CreateDatabase.clear();
+ m_pRB_OpenExistingDatabase.clear();
+ m_pRB_ConnectDatabase.clear();
+ m_pFT_EmbeddedDBLabel.clear();
+ m_pEmbeddedDBType.clear();
+ m_pFT_DocListLabel.clear();
+ m_pLB_DocumentList.clear();
+ m_pPB_OpenDatabase.clear();
+ OGeneralPage::dispose();
+ }
+
OGeneralPageWizard::CreationMode OGeneralPageWizard::GetDatabaseCreationMode() const
{
if ( m_pRB_CreateDatabase->IsChecked() )
@@ -712,8 +738,8 @@ namespace dbaui
if ( aFileDlg.GetCurrentFilter() != pFilter->GetUIName() || !pFilter->GetWildcard().Matches(sPath) )
{
OUString sMessage(ModuleRes(STR_ERR_USE_CONNECT_TO));
- InfoBox aError(this, sMessage);
- aError.Execute();
+ ScopedVclPtrInstance< InfoBox > aError(this, sMessage);
+ aError->Execute();
m_pRB_ConnectDatabase->Check();
OnSetupModeSelected( m_pRB_ConnectDatabase );
return 0L;
diff --git a/dbaccess/source/ui/dlg/generalpage.hxx b/dbaccess/source/ui/dlg/generalpage.hxx
index 0668f679721a..6c5d3294f749 100644
--- a/dbaccess/source/ui/dlg/generalpage.hxx
+++ b/dbaccess/source/ui/dlg/generalpage.hxx
@@ -34,14 +34,13 @@ namespace dbaui
{
protected:
OGeneralPage( vcl::Window* pParent, const OUString& _rUIXMLDescription, const SfxItemSet& _rItems );
- virtual ~OGeneralPage();
OUString m_eCurrentSelection; /// currently selected type
::dbaccess::DATASOURCE_TYPE
m_eNotSupportedKnownType; /// if a data source of an unsupported, but known type is encountered ....
private:
- FixedText* m_pSpecialMessage;
+ VclPtr<FixedText> m_pSpecialMessage;
enum SPECIAL_MESSAGE
{
@@ -57,7 +56,7 @@ namespace dbaui
void insertDatasourceTypeEntryData( const OUString& _sType, const OUString& sDisplayName );
protected:
- ListBox* m_pDatasourceType;
+ VclPtr<ListBox> m_pDatasourceType;
::dbaccess::ODsnTypeCollection*
m_pCollection; /// the DSN type collection instance
@@ -66,6 +65,9 @@ namespace dbaui
m_aURLPrefixes;
public:
+ virtual ~OGeneralPage();
+ virtual void dispose() SAL_OVERRIDE;
+
/// set a handler which gets called every time the user selects a new type
void SetTypeSelectHandler( const Link& _rHandler ) { m_aTypeSelectHandler = _rHandler; }
@@ -116,7 +118,8 @@ namespace dbaui
{
public:
OGeneralPageWizard( vcl::Window* pParent, const SfxItemSet& _rItems );
-
+ virtual ~OGeneralPageWizard();
+ virtual void dispose() SAL_OVERRIDE;
public:
enum CreationMode
{
@@ -133,16 +136,16 @@ namespace dbaui
private:
// dialog controls
- RadioButton* m_pRB_CreateDatabase;
- RadioButton* m_pRB_OpenExistingDatabase;
- RadioButton* m_pRB_ConnectDatabase;
+ VclPtr<RadioButton> m_pRB_CreateDatabase;
+ VclPtr<RadioButton> m_pRB_OpenExistingDatabase;
+ VclPtr<RadioButton> m_pRB_ConnectDatabase;
- FixedText* m_pFT_EmbeddedDBLabel;
- ListBox* m_pEmbeddedDBType;
+ VclPtr<FixedText> m_pFT_EmbeddedDBLabel;
+ VclPtr<ListBox> m_pEmbeddedDBType;
- FixedText* m_pFT_DocListLabel;
- OpenDocumentListBox* m_pLB_DocumentList;
- OpenDocumentButton* m_pPB_OpenDatabase;
+ VclPtr<FixedText> m_pFT_DocListLabel;
+ VclPtr<OpenDocumentListBox> m_pLB_DocumentList;
+ VclPtr<OpenDocumentButton> m_pPB_OpenDatabase;
// state
DocumentDescriptor m_aBrowsedDocument;
diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx
index d034b68bd597..a033fab3b3bf 100644
--- a/dbaccess/source/ui/dlg/indexdialog.cxx
+++ b/dbaccess/source/ui/dlg/indexdialog.cxx
@@ -311,9 +311,23 @@ namespace dbaui
DbaIndexDialog::~DbaIndexDialog( )
{
+ disposeOnce();
+ }
+
+ void DbaIndexDialog::dispose()
+ {
setToolBox(NULL);
delete m_pIndexes;
-
+ m_pActions.clear();
+ m_pIndexList.clear();
+ m_pIndexDetails.clear();
+ m_pDescriptionLabel.clear();
+ m_pDescription.clear();
+ m_pUnique.clear();
+ m_pFieldsLabel.clear();
+ m_pFields.clear();
+ m_pClose.clear();
+ ModalDialog::dispose();
}
bool DbaIndexDialog::implCommit(SvTreeListEntry* _pEntry)
@@ -408,8 +422,8 @@ namespace dbaui
{
OUString sConfirm(ModuleRes(STR_CONFIRM_DROP_INDEX));
sConfirm = sConfirm.replaceFirst("$name$", m_pIndexList->GetEntryText(pSelected));
- MessageDialog aConfirm(this, sConfirm, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
- if (RET_YES != aConfirm.Execute())
+ ScopedVclPtrInstance< MessageDialog > aConfirm(this, sConfirm, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ if (RET_YES != aConfirm->Execute())
return;
}
@@ -572,9 +586,9 @@ namespace dbaui
if (aSelected->isModified() || aSelected->isNew())
{
- MessageDialog aQuestion(this, "SaveIndexDialog",
- "dbaccess/ui/saveindexdialog.ui");
- nResponse = aQuestion.Execute();
+ ScopedVclPtrInstance<MessageDialog> aQuestion(this, "SaveIndexDialog",
+ "dbaccess/ui/saveindexdialog.ui" );
+ nResponse = aQuestion->Execute();
}
}
@@ -616,8 +630,8 @@ namespace dbaui
{
OUString sError(ModuleRes(STR_INDEX_NAME_ALREADY_USED));
sError = sError.replaceFirst("$name$", sNewName);
- MessageDialog aError(this, sError);
- aError.Execute();
+ ScopedVclPtrInstance< MessageDialog > aError(this, sError);
+ aError->Execute();
updateToolbox();
m_bEditAgain = true;
@@ -677,8 +691,8 @@ namespace dbaui
// need at least one field
if (0 == _rPos->aFields.size())
{
- MessageDialog aError(this, ModuleRes(STR_NEED_INDEX_FIELDS));
- aError.Execute();
+ ScopedVclPtrInstance< MessageDialog > aError(this, ModuleRes(STR_NEED_INDEX_FIELDS));
+ aError->Execute();
m_pFields->GrabFocus();
return false;
}
@@ -695,8 +709,8 @@ namespace dbaui
// a column is specified twice ... won't work anyway, so prevent this here and now
OUString sMessage(ModuleRes(STR_INDEXDESIGN_DOUBLE_COLUMN_NAME));
sMessage = sMessage.replaceFirst("$name$", aFieldCheck->sFieldName);
- MessageDialog aError(this, sMessage);
- aError.Execute();
+ ScopedVclPtrInstance< MessageDialog > aError(this, sMessage);
+ aError->Execute();
m_pFields->GrabFocus();
return false;
}
diff --git a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx
index dc0d7a40d3b6..a236e46ea7dc 100644
--- a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx
+++ b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx
@@ -110,9 +110,14 @@ namespace dbaui
IndexFieldsControl::~IndexFieldsControl()
{
- delete m_pSortingCell;
- delete m_pFieldNameCell;
+ disposeOnce();
+ }
+ void IndexFieldsControl::dispose()
+ {
+ m_pSortingCell.disposeAndClear();
+ m_pFieldNameCell.disposeAndClear();
+ ::svt::EditBrowseBox::dispose();
}
bool IndexFieldsControl::SeekRow(long nRow)
@@ -240,7 +245,7 @@ namespace dbaui
nSortOrderColumnWidth += GetTextWidth(OUString('0')) * 2;
InsertDataColumn(COLUMN_ID_ORDER, sColumnName, nSortOrderColumnWidth, HeaderBarItemBits::STDSTYLE, 1);
- m_pSortingCell = new ListBoxControl(&GetDataWindow());
+ m_pSortingCell = VclPtr<ListBoxControl>::Create(&GetDataWindow());
m_pSortingCell->InsertEntry(m_sAscendingText);
m_pSortingCell->InsertEntry(m_sDescendingText);
m_pSortingCell->SetHelpId( HID_DLGINDEX_INDEXDETAILS_SORTORDER );
@@ -256,7 +261,7 @@ namespace dbaui
// create the cell controllers
// for the field name cell
- m_pFieldNameCell = new ListBoxControl(&GetDataWindow());
+ m_pFieldNameCell = VclPtr<ListBoxControl>::Create(&GetDataWindow());
m_pFieldNameCell->InsertEntry(OUString());
m_pFieldNameCell->SetHelpId( HID_DLGINDEX_INDEXDETAILS_FIELD );
const OUString* pFields = _rAvailableFields.getConstArray();
diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx
index d39d86fb623a..c0425048091a 100644
--- a/dbaccess/source/ui/dlg/paramdialog.cxx
+++ b/dbaccess/source/ui/dlg/paramdialog.cxx
@@ -113,9 +113,19 @@ namespace dbaui
OParameterDialog::~OParameterDialog()
{
+ disposeOnce();
+ }
+
+ void OParameterDialog::dispose()
+ {
if (m_aResetVisitFlag.IsActive())
m_aResetVisitFlag.Stop();
-
+ m_pAllParams.clear();
+ m_pParam.clear();
+ m_pTravelNext.clear();
+ m_pOKBtn.clear();
+ m_pCancelBtn.clear();
+ ModalDialog::dispose();
}
void OParameterDialog::Construct()
diff --git a/dbaccess/source/ui/dlg/queryfilter.cxx b/dbaccess/source/ui/dlg/queryfilter.cxx
index 1274a03bf9b2..a86bd6326e66 100644
--- a/dbaccess/source/ui/dlg/queryfilter.cxx
+++ b/dbaccess/source/ui/dlg/queryfilter.cxx
@@ -192,6 +192,23 @@ DlgFilterCrit::DlgFilterCrit(vcl::Window * pParent,
DlgFilterCrit::~DlgFilterCrit()
{
+ disposeOnce();
+}
+
+void DlgFilterCrit::dispose()
+{
+ m_pLB_WHEREFIELD1.clear();
+ m_pLB_WHERECOMP1.clear();
+ m_pET_WHEREVALUE1.clear();
+ m_pLB_WHERECOND2.clear();
+ m_pLB_WHEREFIELD2.clear();
+ m_pLB_WHERECOMP2.clear();
+ m_pET_WHEREVALUE2.clear();
+ m_pLB_WHERECOND3.clear();
+ m_pLB_WHEREFIELD3.clear();
+ m_pLB_WHERECOMP3.clear();
+ m_pET_WHEREVALUE3.clear();
+ ModalDialog::dispose();
}
#define LbText(x) ((x).GetSelectEntry())
diff --git a/dbaccess/source/ui/dlg/queryorder.cxx b/dbaccess/source/ui/dlg/queryorder.cxx
index f58d3ad7f0c5..410598b5663e 100644
--- a/dbaccess/source/ui/dlg/queryorder.cxx
+++ b/dbaccess/source/ui/dlg/queryorder.cxx
@@ -127,6 +127,20 @@ DlgOrderCrit::DlgOrderCrit(vcl::Window * pParent,
DlgOrderCrit::~DlgOrderCrit()
{
+ disposeOnce();
+}
+
+void DlgOrderCrit::dispose()
+{
+ m_pLB_ORDERFIELD1.clear();
+ m_pLB_ORDERVALUE1.clear();
+ m_pLB_ORDERFIELD2.clear();
+ m_pLB_ORDERVALUE2.clear();
+ m_pLB_ORDERFIELD3.clear();
+ m_pLB_ORDERVALUE3.clear();
+ for (auto a : m_aColumnList) a.clear();
+ for (auto a : m_aValueList) a.clear();
+ ModalDialog::dispose();
}
IMPL_LINK_INLINE_START( DlgOrderCrit, FieldListSelectHdl, ListBox *, /*pListBox*/ )
diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx
index 70ba97341669..36341e32751f 100644
--- a/dbaccess/source/ui/dlg/sqlmessage.cxx
+++ b/dbaccess/source/ui/dlg/sqlmessage.cxx
@@ -292,8 +292,8 @@ namespace
class OExceptionChainDialog : public ModalDialog
{
- SvTreeListBox* m_pExceptionList;
- VclMultiLineEdit* m_pExceptionText;
+ VclPtr<SvTreeListBox> m_pExceptionList;
+ VclPtr<VclMultiLineEdit> m_pExceptionText;
OUString m_sStatusLabel;
OUString m_sErrorCodeLabel;
@@ -302,6 +302,13 @@ class OExceptionChainDialog : public ModalDialog
public:
OExceptionChainDialog( vcl::Window* pParent, const ExceptionDisplayChain& _rExceptions );
+ virtual ~OExceptionChainDialog() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE
+ {
+ m_pExceptionList.clear();
+ m_pExceptionText.clear();
+ ModalDialog::dispose();
+ }
protected:
DECL_LINK(OnExceptionSelected, void*);
@@ -470,24 +477,24 @@ void OSQLMessageBox::impl_positionControls()
}
// image
- lcl_positionInAppFont( *this, m_aInfoImage, OUTER_MARGIN, OUTER_MARGIN, IMAGE_SIZE, IMAGE_SIZE );
- m_aInfoImage.Show();
+ lcl_positionInAppFont( *this, *m_aInfoImage.get(), OUTER_MARGIN, OUTER_MARGIN, IMAGE_SIZE, IMAGE_SIZE );
+ m_aInfoImage->Show();
// primary text
- lcl_positionInAppFont( *this, m_aTitle, TEXT_POS_X, OUTER_MARGIN, DIALOG_WIDTH - TEXT_POS_X - 2 * OUTER_MARGIN, 16 );
+ lcl_positionInAppFont( *this, *m_aTitle.get(), TEXT_POS_X, OUTER_MARGIN, DIALOG_WIDTH - TEXT_POS_X - 2 * OUTER_MARGIN, 16 );
sPrimary = lcl_stripOOoBaseVendor( sPrimary );
- m_aTitle.SetText( sPrimary );
- m_aTitle.Show();
+ m_aTitle->SetText( sPrimary );
+ m_aTitle->Show();
- Rectangle aPrimaryRect( m_aTitle.GetPosPixel(), m_aTitle.GetSizePixel() );
+ Rectangle aPrimaryRect( m_aTitle->GetPosPixel(), m_aTitle->GetSizePixel() );
// secondary text (if applicable)
- m_aMessage.SetStyle( m_aMessage.GetStyle() | WB_NOLABEL );
+ m_aMessage->SetStyle( m_aMessage->GetStyle() | WB_NOLABEL );
sSecondary = lcl_stripOOoBaseVendor( sSecondary );
- m_aMessage.SetText( sSecondary );
+ m_aMessage->SetText( sSecondary );
- lcl_positionInAppFont( *this, m_aMessage, TEXT_POS_X, OUTER_MARGIN + 16 + 3, DIALOG_WIDTH - TEXT_POS_X - 2 * OUTER_MARGIN, 8 );
- Rectangle aSecondaryRect( m_aMessage.GetPosPixel(), m_aMessage.GetSizePixel() );
+ lcl_positionInAppFont( *this, *m_aMessage.get(), TEXT_POS_X, OUTER_MARGIN + 16 + 3, DIALOG_WIDTH - TEXT_POS_X - 2 * OUTER_MARGIN, 8 );
+ Rectangle aSecondaryRect( m_aMessage->GetPosPixel(), m_aMessage->GetSizePixel() );
bool bHaveSecondaryText = !sSecondary.isEmpty();
@@ -498,8 +505,8 @@ void OSQLMessageBox::impl_positionControls()
aSecondaryRect.Bottom() = aSecondaryRect.Top() - 1;
// adjust secondary control height accordingly
- m_aMessage.SetSizePixel( aSecondaryRect.GetSize() );
- m_aMessage.Show( aSecondaryRect.GetHeight() > 0 );
+ m_aMessage->SetSizePixel( aSecondaryRect.GetSize() );
+ m_aMessage->Show( aSecondaryRect.GetHeight() > 0 );
// if there's no secondary text ...
if ( !bHaveSecondaryText )
@@ -508,23 +515,23 @@ void OSQLMessageBox::impl_positionControls()
aPrimaryRect.Right() = aPrimaryRect.Left() + aSuggestedRect.GetWidth();
aPrimaryRect.Bottom() = aPrimaryRect.Top() + aSuggestedRect.GetHeight();
// and center it horizontally
- m_aTitle.SetStyle( ( m_aTitle.GetStyle() & ~WB_LEFT ) | WB_CENTER );
+ m_aTitle->SetStyle( ( m_aTitle->GetStyle() & ~WB_LEFT ) | WB_CENTER );
- Rectangle aInfoRect( m_aInfoImage.GetPosPixel(), m_aInfoImage.GetSizePixel() );
+ Rectangle aInfoRect( m_aInfoImage->GetPosPixel(), m_aInfoImage->GetSizePixel() );
// also, if it's not as high as the image ...
- if ( aPrimaryRect.GetHeight() < m_aInfoImage.GetSizePixel().Height() )
+ if ( aPrimaryRect.GetHeight() < m_aInfoImage->GetSizePixel().Height() )
{ // ... make it fit the image height
aPrimaryRect.Bottom() += aInfoRect.GetHeight() - aPrimaryRect.GetHeight();
// and center it vertically
- m_aTitle.SetStyle( m_aTitle.GetStyle() | WB_VCENTER );
+ m_aTitle->SetStyle( m_aTitle->GetStyle() | WB_VCENTER );
}
else
{ // ... otherwise, center the image vertically, relative to the primary text
aInfoRect.Move( 0, ( aPrimaryRect.GetHeight() - aInfoRect.GetHeight() ) / 2 );
- m_aInfoImage.SetPosSizePixel( aInfoRect.TopLeft(), aInfoRect.GetSize() );
+ m_aInfoImage->SetPosSizePixel( aInfoRect.TopLeft(), aInfoRect.GetSize() );
}
- m_aTitle.SetPosSizePixel( aPrimaryRect.TopLeft(), aPrimaryRect.GetSize() );
+ m_aTitle->SetPosSizePixel( aPrimaryRect.TopLeft(), aPrimaryRect.GetSize() );
}
// adjust dialog size accordingly
@@ -546,16 +553,16 @@ void OSQLMessageBox::impl_initImage( MessageType _eImage )
OSL_FAIL( "OSQLMessageBox::impl_initImage: unsupported image type!" );
/* Fall through */
case Info:
- m_aInfoImage.SetImage(InfoBox::GetStandardImage());
+ m_aInfoImage->SetImage(InfoBox::GetStandardImage());
break;
case Warning:
- m_aInfoImage.SetImage(WarningBox::GetStandardImage());
+ m_aInfoImage->SetImage(WarningBox::GetStandardImage());
break;
case Error:
- m_aInfoImage.SetImage(ErrorBox::GetStandardImage());
+ m_aInfoImage->SetImage(ErrorBox::GetStandardImage());
break;
case Query:
- m_aInfoImage.SetImage(QueryBox::GetStandardImage());
+ m_aInfoImage->SetImage(QueryBox::GetStandardImage());
break;
}
}
@@ -606,7 +613,7 @@ void OSQLMessageBox::impl_createStandardButtons( WinBits _nStyle )
void OSQLMessageBox::impl_addDetailsButton()
{
- size_t nFirstPageVisible = m_aMessage.IsVisible() ? 2 : 1;
+ size_t nFirstPageVisible = m_aMessage->IsVisible() ? 2 : 1;
bool bMoreDetailsAvailable = m_pImpl->aDisplayInfo.size() > nFirstPageVisible;
if ( !bMoreDetailsAvailable )
@@ -664,9 +671,9 @@ void OSQLMessageBox::Construct( WinBits _nStyle, MessageType _eImage )
OSQLMessageBox::OSQLMessageBox(vcl::Window* _pParent, const SQLExceptionInfo& _rException, WinBits _nStyle, const OUString& _rHelpURL )
:ButtonDialog( _pParent, WB_HORZ | WB_STDDIALOG )
- ,m_aInfoImage( this )
- ,m_aTitle( this, WB_WORDBREAK | WB_LEFT )
- ,m_aMessage( this, WB_WORDBREAK | WB_LEFT )
+ ,m_aInfoImage( VclPtr<FixedImage>::Create(this) )
+ ,m_aTitle( VclPtr<FixedText>::Create(this, WB_WORDBREAK | WB_LEFT) )
+ ,m_aMessage( VclPtr<FixedText>::Create(this, WB_WORDBREAK | WB_LEFT) )
,m_sHelpURL( _rHelpURL )
,m_pImpl( new SQLMessageBox_Impl( _rException ) )
{
@@ -675,9 +682,9 @@ OSQLMessageBox::OSQLMessageBox(vcl::Window* _pParent, const SQLExceptionInfo& _r
OSQLMessageBox::OSQLMessageBox( vcl::Window* _pParent, const OUString& _rTitle, const OUString& _rMessage, WinBits _nStyle, MessageType _eType, const ::dbtools::SQLExceptionInfo* _pAdditionalErrorInfo )
:ButtonDialog( _pParent, WB_HORZ | WB_STDDIALOG )
- ,m_aInfoImage( this )
- ,m_aTitle( this, WB_WORDBREAK | WB_LEFT )
- ,m_aMessage( this, WB_WORDBREAK | WB_LEFT )
+ ,m_aInfoImage( VclPtr<FixedImage>::Create(this) )
+ ,m_aTitle( VclPtr<FixedText>::Create(this, WB_WORDBREAK | WB_LEFT) )
+ ,m_aMessage( VclPtr<FixedText>::Create(this, WB_WORDBREAK | WB_LEFT) )
{
SQLContext aError;
aError.Message = _rTitle;
@@ -692,12 +699,21 @@ OSQLMessageBox::OSQLMessageBox( vcl::Window* _pParent, const OUString& _rTitle,
OSQLMessageBox::~OSQLMessageBox()
{
+ disposeOnce();
+}
+
+void OSQLMessageBox::dispose()
+{
+ m_aInfoImage.disposeAndClear();
+ m_aTitle.disposeAndClear();
+ m_aMessage.disposeAndClear();
+ ButtonDialog::dispose();
}
IMPL_LINK( OSQLMessageBox, ButtonClickHdl, Button *, /*pButton*/ )
{
- OExceptionChainDialog aDlg( this, m_pImpl->aDisplayInfo );
- aDlg.Execute();
+ ScopedVclPtrInstance< OExceptionChainDialog > aDlg( this, m_pImpl->aDisplayInfo );
+ aDlg->Execute();
return 0;
}
diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx
index 59d9af9d75be..54ab0c3cecdf 100644
--- a/dbaccess/source/ui/dlg/tablespage.cxx
+++ b/dbaccess/source/ui/dlg/tablespage.cxx
@@ -99,13 +99,21 @@ namespace dbaui
OTableSubscriptionPage::~OTableSubscriptionPage()
{
+ disposeOnce();
+ }
+
+ void OTableSubscriptionPage::dispose()
+ {
// just to make sure that our connection will be removed
try
{
::comphelper::disposeComponent(m_xCurrentConnection);
}
catch (RuntimeException&) { }
-
+ m_pTables.clear();
+ m_pTablesList.clear();
+ m_pTablesDlg.clear();
+ OGenericAdministrationPage::dispose();
}
void OTableSubscriptionPage::StateChanged( StateChangedType nType )
@@ -319,8 +327,8 @@ namespace dbaui
if (aErrorInfo.isValid())
{
// establishing the connection failed. Show an error window and exit.
- OSQLMessageBox aMessageBox( GetParentDialog(), aErrorInfo );
- aMessageBox.Execute();
+ ScopedVclPtrInstance< OSQLMessageBox > aMessageBox( GetParentDialog(), aErrorInfo );
+ aMessageBox->Execute();
m_pTables->Enable(false);
m_pTablesList->Clear();
diff --git a/dbaccess/source/ui/dlg/tablespage.hxx b/dbaccess/source/ui/dlg/tablespage.hxx
index bd1568a82f36..a5dc8e8e9dbc 100644
--- a/dbaccess/source/ui/dlg/tablespage.hxx
+++ b/dbaccess/source/ui/dlg/tablespage.hxx
@@ -36,8 +36,8 @@ namespace dbaui
:public OGenericAdministrationPage
{
private:
- VclContainer* m_pTables;
- OTableTreeListBox* m_pTablesList;
+ VclPtr<VclContainer> m_pTables;
+ VclPtr<OTableTreeListBox> m_pTablesList;
OUString m_sCatalogSeparator;
bool m_bCatalogAtStart : 1;
@@ -46,7 +46,7 @@ namespace dbaui
m_xCurrentConnection; /// valid as long as the page is active
::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCollator >
m_xCollator;
- OTableSubscriptionDialog* m_pTablesDlg;
+ VclPtr<OTableSubscriptionDialog> m_pTablesDlg;
public:
virtual bool FillItemSet(SfxItemSet* _rCoreAttrs) SAL_OVERRIDE;
@@ -62,6 +62,7 @@ namespace dbaui
OTableSubscriptionPage( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ,OTableSubscriptionDialog* _pTablesDlg);
virtual ~OTableSubscriptionPage();
+ virtual void dispose() SAL_OVERRIDE;
protected:
virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList) SAL_OVERRIDE;
diff --git a/dbaccess/source/ui/dlg/textconnectionsettings.cxx b/dbaccess/source/ui/dlg/textconnectionsettings.cxx
index 11f84162318b..9fa798b1b096 100644
--- a/dbaccess/source/ui/dlg/textconnectionsettings.cxx
+++ b/dbaccess/source/ui/dlg/textconnectionsettings.cxx
@@ -34,13 +34,21 @@ namespace dbaui
,m_rItems( _rItems )
{
get(m_pOK, "ok");
- m_pTextConnectionHelper.reset( new OTextConnectionHelper( get<VclVBox>("TextPageContainer"), TC_HEADER | TC_SEPARATORS | TC_CHARSET ) );
+ m_pTextConnectionHelper.reset( VclPtr<OTextConnectionHelper>::Create( get<VclVBox>("TextPageContainer"), TC_HEADER | TC_SEPARATORS | TC_CHARSET ) );
m_pOK->SetClickHdl( LINK( this, TextConnectionSettingsDialog, OnOK ) );
}
TextConnectionSettingsDialog::~TextConnectionSettingsDialog()
{
+ disposeOnce();
+ }
+
+ void TextConnectionSettingsDialog::dispose()
+ {
+ m_pOK.clear();
+ m_pTextConnectionHelper.disposeAndClear();
+ ModalDialog::dispose();
}
void TextConnectionSettingsDialog::bindItemStorages( SfxItemSet& _rSet, PropertyValues& _rValues )
diff --git a/dbaccess/source/ui/inc/CollectionView.hxx b/dbaccess/source/ui/inc/CollectionView.hxx
index 704ea76c6068..f407b70bc918 100644
--- a/dbaccess/source/ui/inc/CollectionView.hxx
+++ b/dbaccess/source/ui/inc/CollectionView.hxx
@@ -34,12 +34,12 @@ namespace dbaui
*/
class OCollectionView : public ModalDialog
{
- FixedText* m_pFTCurrentPath;
- PushButton* m_pNewFolder;
- PushButton* m_pUp;
- SvtFileView* m_pView;
- Edit* m_pName;
- PushButton* m_pPB_OK;
+ VclPtr<FixedText> m_pFTCurrentPath;
+ VclPtr<PushButton> m_pNewFolder;
+ VclPtr<PushButton> m_pUp;
+ VclPtr<SvtFileView> m_pView;
+ VclPtr<Edit> m_pName;
+ VclPtr<PushButton> m_pPB_OK;
::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent> m_xContent;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
bool m_bCreateForm;
@@ -57,7 +57,7 @@ namespace dbaui
,const OUString& _sDefaultName
,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext);
virtual ~OCollectionView();
-
+ virtual void dispose() SAL_OVERRIDE;
::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent> getSelectedFolder() const { return m_xContent;}
OUString getName() const;
};
diff --git a/dbaccess/source/ui/inc/ColumnControlWindow.hxx b/dbaccess/source/ui/inc/ColumnControlWindow.hxx
index b09d6ff6e030..583481a7d7b2 100644
--- a/dbaccess/source/ui/inc/ColumnControlWindow.hxx
+++ b/dbaccess/source/ui/inc/ColumnControlWindow.hxx
@@ -55,7 +55,6 @@ namespace dbaui
public:
OColumnControlWindow(vcl::Window* pParent
,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext);
- virtual ~OColumnControlWindow();
void setConnection(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xCon);
diff --git a/dbaccess/source/ui/inc/ConnectionLine.hxx b/dbaccess/source/ui/inc/ConnectionLine.hxx
index 6ae780d4705a..f5bef2a5d5d9 100644
--- a/dbaccess/source/ui/inc/ConnectionLine.hxx
+++ b/dbaccess/source/ui/inc/ConnectionLine.hxx
@@ -22,6 +22,7 @@
#include <tools/gen.hxx>
#include "ConnectionLineData.hxx"
#include <functional>
+#include <vcl/vclptr.hxx>
class OutputDevice;
namespace dbaui
@@ -38,7 +39,7 @@ namespace dbaui
class OTableConnection;
class OConnectionLine
{
- OTableConnection* m_pTabConn;
+ VclPtr<OTableConnection> m_pTabConn;
OConnectionLineDataRef m_pData;
Point m_aSourceConnPos,
@@ -72,7 +73,7 @@ namespace dbaui
/// draws a connectionline object on outputdevice
struct TConnectionLineDrawFunctor : ::std::unary_function<OConnectionLine*,void>
{
- OutputDevice* pDevice;
+ VclPtr<OutputDevice> pDevice;
TConnectionLineDrawFunctor(OutputDevice* _pDevice)
{
pDevice = _pDevice;
diff --git a/dbaccess/source/ui/inc/ConnectionLineAccess.hxx b/dbaccess/source/ui/inc/ConnectionLineAccess.hxx
index fb63317073f6..8df3cf848f34 100644
--- a/dbaccess/source/ui/inc/ConnectionLineAccess.hxx
+++ b/dbaccess/source/ui/inc/ConnectionLineAccess.hxx
@@ -22,6 +22,7 @@
#include <com/sun/star/accessibility/XAccessibleRelationSet.hpp>
#include <cppuhelper/implbase2.hxx>
#include <toolkit/awt/vclxaccessiblecomponent.hxx>
+#include <vcl/vclptr.hxx>
namespace dbaui
{
@@ -35,7 +36,7 @@ namespace dbaui
class OConnectionLineAccess : public VCLXAccessibleComponent
, public OConnectionLineAccess_BASE
{
- const OTableConnection* m_pLine; // the window which I should give accessibility to
+ VclPtr<const OTableConnection> m_pLine; // the window which I should give accessibility to
protected:
/** this function is called upon disposing the component
*/
diff --git a/dbaccess/source/ui/inc/FieldDescControl.hxx b/dbaccess/source/ui/inc/FieldDescControl.hxx
index d8913ed932fa..983bfc6d2183 100644
--- a/dbaccess/source/ui/inc/FieldDescControl.hxx
+++ b/dbaccess/source/ui/inc/FieldDescControl.hxx
@@ -65,40 +65,40 @@ namespace dbaui
class OFieldDescControl : public TabPage
{
private:
- OTableDesignHelpBar* pHelp;
- vcl::Window* pLastFocusWindow;
- vcl::Window* m_pActFocusWindow;
-
- FixedText* pDefaultText;
- FixedText* pRequiredText;
- FixedText* pAutoIncrementText;
- FixedText* pTextLenText;
- FixedText* pNumTypeText;
- FixedText* pLengthText;
- FixedText* pScaleText;
- FixedText* pFormatText;
- FixedText* pBoolDefaultText;
- FixedText* m_pColumnNameText;
- FixedText* m_pTypeText;
- FixedText* m_pAutoIncrementValueText;
-
- OPropListBoxCtrl* pRequired;
- OPropListBoxCtrl* pNumType;
- OPropListBoxCtrl* pAutoIncrement;
- OPropEditCtrl* pDefault;
- OPropNumericEditCtrl* pTextLen;
- OPropNumericEditCtrl* pLength;
- OPropNumericEditCtrl* pScale;
- OPropEditCtrl* pFormatSample;
- OPropListBoxCtrl* pBoolDefault;
- OPropColumnEditCtrl* m_pColumnName;
- OPropListBoxCtrl* m_pType;
- OPropEditCtrl* m_pAutoIncrementValue;
-
- PushButton* pFormat;
-
- ScrollBar* m_pVertScroll;
- ScrollBar* m_pHorzScroll;
+ VclPtr<OTableDesignHelpBar> pHelp;
+ VclPtr<vcl::Window> pLastFocusWindow;
+ VclPtr<vcl::Window> m_pActFocusWindow;
+
+ VclPtr<FixedText> pDefaultText;
+ VclPtr<FixedText> pRequiredText;
+ VclPtr<FixedText> pAutoIncrementText;
+ VclPtr<FixedText> pTextLenText;
+ VclPtr<FixedText> pNumTypeText;
+ VclPtr<FixedText> pLengthText;
+ VclPtr<FixedText> pScaleText;
+ VclPtr<FixedText> pFormatText;
+ VclPtr<FixedText> pBoolDefaultText;
+ VclPtr<FixedText> m_pColumnNameText;
+ VclPtr<FixedText> m_pTypeText;
+ VclPtr<FixedText> m_pAutoIncrementValueText;
+
+ VclPtr<OPropListBoxCtrl> pRequired;
+ VclPtr<OPropListBoxCtrl> pNumType;
+ VclPtr<OPropListBoxCtrl> pAutoIncrement;
+ VclPtr<OPropEditCtrl> pDefault;
+ VclPtr<OPropNumericEditCtrl> pTextLen;
+ VclPtr<OPropNumericEditCtrl> pLength;
+ VclPtr<OPropNumericEditCtrl> pScale;
+ VclPtr<OPropEditCtrl> pFormatSample;
+ VclPtr<OPropListBoxCtrl> pBoolDefault;
+ VclPtr<OPropColumnEditCtrl> m_pColumnName;
+ VclPtr<OPropListBoxCtrl> m_pType;
+ VclPtr<OPropEditCtrl> m_pAutoIncrementValue;
+
+ VclPtr<PushButton> pFormat;
+
+ VclPtr<ScrollBar> m_pVertScroll;
+ VclPtr<ScrollBar> m_pHorzScroll;
TOTypeInfoSP m_pPreviousType;
short m_nPos;
@@ -126,15 +126,15 @@ namespace dbaui
void UpdateFormatSample(OFieldDescription* pFieldDescr);
void ArrangeAggregates();
- void SetPosSize( Control** ppControl, long nRow, sal_uInt16 nCol );
+ void SetPosSize( VclPtr<Control>& rControl, long nRow, sal_uInt16 nCol );
void ScrollAggregate(Control* pText, Control* pInput, Control* pButton, long nDeltaX, long nDeltaY);
void ScrollAllAggregates();
bool isTextFormat(const OFieldDescription* _pFieldDescr,sal_uInt32& _nFormatKey) const;
void Contruct();
- OPropNumericEditCtrl* CreateNumericControl(sal_uInt16 _nHelpStr,short _nProperty,const OString& _sHelpId);
- FixedText* CreateText(sal_uInt16 _nTextRes);
+ VclPtr<OPropNumericEditCtrl> CreateNumericControl(sal_uInt16 _nHelpStr,short _nProperty,const OString& _sHelpId);
+ VclPtr<FixedText> CreateText(sal_uInt16 _nTextRes);
void InitializeControl(Control* _pControl,const OString& _sHelpId,bool _bAddChangeHandler);
protected:
@@ -175,6 +175,7 @@ namespace dbaui
public:
OFieldDescControl( vcl::Window* pParent, OTableDesignHelpBar* pHelpBar);
virtual ~OFieldDescControl();
+ virtual void dispose() SAL_OVERRIDE;
void DisplayData(OFieldDescription* pFieldDescr );
diff --git a/dbaccess/source/ui/inc/JAccess.hxx b/dbaccess/source/ui/inc/JAccess.hxx
index 2306dfef8d4b..11604c2e2fd3 100644
--- a/dbaccess/source/ui/inc/JAccess.hxx
+++ b/dbaccess/source/ui/inc/JAccess.hxx
@@ -21,6 +21,7 @@
#include <toolkit/awt/vclxaccessiblecomponent.hxx>
#include <cppuhelper/implbase1.hxx>
+#include <vcl/vclptr.hxx>
namespace dbaui
{
@@ -32,7 +33,7 @@ namespace dbaui
*/
class OJoinDesignViewAccess : public VCLXAccessibleComponent, public OJoinDesignViewAccess_BASE
{
- OJoinTableView* m_pTableView; // the window which I should give accessibility to
+ VclPtr<OJoinTableView> m_pTableView; // the window which I should give accessibility to
public:
/** OJoinDesignViewAccess needs a valid view
diff --git a/dbaccess/source/ui/inc/JoinController.hxx b/dbaccess/source/ui/inc/JoinController.hxx
index bfbfc560544b..4fd57a929b86 100644
--- a/dbaccess/source/ui/inc/JoinController.hxx
+++ b/dbaccess/source/ui/inc/JoinController.hxx
@@ -51,7 +51,7 @@ namespace dbaui
Fraction m_aZoom;
::dbtools::SQLExceptionInfo m_aExceptionInfo;
- OAddTableDlg* m_pAddTableDialog;
+ VclPtr<OAddTableDlg> m_pAddTableDialog;
::std::unique_ptr< AddTableDialogContext > m_pDialogContext;
Point m_aMinimumTableViewSize;
diff --git a/dbaccess/source/ui/inc/JoinDesignView.hxx b/dbaccess/source/ui/inc/JoinDesignView.hxx
index 7b29ddde90af..da50da1e20ac 100644
--- a/dbaccess/source/ui/inc/JoinDesignView.hxx
+++ b/dbaccess/source/ui/inc/JoinDesignView.hxx
@@ -33,8 +33,8 @@ namespace dbaui
class OJoinDesignView : public ODataView
{
protected:
- OScrollWindowHelper* m_pScrollWindow; // contains only the scrollbars
- OJoinTableView* m_pTableView; // presents the upper window
+ VclPtr<OScrollWindowHelper> m_pScrollWindow; // contains only the scrollbars
+ VclPtr<OJoinTableView> m_pTableView; // presents the upper window
OJoinController& m_rController;
public:
@@ -42,6 +42,7 @@ namespace dbaui
OJoinController& _rController,
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& );
virtual ~OJoinDesignView();
+ virtual void dispose() SAL_OVERRIDE;
// set the view readonly or not
virtual void setReadOnly(bool _bReadOnly);
diff --git a/dbaccess/source/ui/inc/JoinTableView.hxx b/dbaccess/source/ui/inc/JoinTableView.hxx
index f43cdd254baf..608c2d82dc98 100644
--- a/dbaccess/source/ui/inc/JoinTableView.hxx
+++ b/dbaccess/source/ui/inc/JoinTableView.hxx
@@ -23,6 +23,7 @@
#include <vcl/timer.hxx>
#include <vcl/idle.hxx>
#include <vcl/scrbar.hxx>
+#include <vcl/vclptr.hxx>
#include <tools/rtti.hxx>
#include <svtools/transfer.hxx>
@@ -51,10 +52,10 @@ namespace dbaui
class OJoinTableView;
class OScrollWindowHelper : public vcl::Window
{
- ScrollBar m_aHScrollBar;
- ScrollBar m_aVScrollBar;
- vcl::Window* m_pCornerWindow;
- OJoinTableView* m_pTableView;
+ VclPtr<ScrollBar> m_aHScrollBar;
+ VclPtr<ScrollBar> m_aVScrollBar;
+ VclPtr<vcl::Window> m_pCornerWindow;
+ VclPtr<OJoinTableView> m_pTableView;
protected:
virtual void Resize() SAL_OVERRIDE;
@@ -62,14 +63,15 @@ namespace dbaui
public:
OScrollWindowHelper( vcl::Window* pParent);
virtual ~OScrollWindowHelper();
+ virtual void dispose() SAL_OVERRIDE;
void setTableView(OJoinTableView* _pTableView);
void resetRange(const Point& _aSize);
// own methods
- ScrollBar& GetHScrollBar() { return m_aHScrollBar; }
- ScrollBar& GetVScrollBar() { return m_aVScrollBar; }
+ ScrollBar& GetHScrollBar() { return *m_aHScrollBar.get(); }
+ ScrollBar& GetVScrollBar() { return *m_aVScrollBar.get(); }
};
@@ -80,11 +82,11 @@ namespace dbaui
friend class OJoinMoveTabWinUndoAct;
public:
- typedef std::map<OUString, OTableWindow*> OTableWindowMap;
+ typedef std::map<OUString, VclPtr<OTableWindow> > OTableWindowMap;
private:
OTableWindowMap m_aTableMap;
- ::std::vector<OTableConnection*> m_vTableConnection;
+ ::std::vector<VclPtr<OTableConnection> > m_vTableConnection;
Idle m_aDragScrollIdle;
Rectangle m_aDragRect;
@@ -95,9 +97,9 @@ namespace dbaui
Size m_aOutputSize;
- OTableWindow* m_pDragWin;
- OTableWindow* m_pSizingWin;
- OTableConnection* m_pSelectedConn;
+ VclPtr<OTableWindow> m_pDragWin;
+ VclPtr<OTableWindow> m_pSizingWin;
+ VclPtr<OTableConnection> m_pSelectedConn;
bool m_bTrackingInitiallyMoved;
@@ -105,13 +107,14 @@ namespace dbaui
DECL_LINK(OnDragScrollTimer, void*);
protected:
- OTableWindow* m_pLastFocusTabWin;
- OJoinDesignView* m_pView;
+ VclPtr<OTableWindow> m_pLastFocusTabWin;
+ VclPtr<OJoinDesignView> m_pView;
OJoinDesignViewAccess* m_pAccessible;
public:
OJoinTableView( vcl::Window* pParent, OJoinDesignView* pView );
virtual ~OJoinTableView();
+ virtual void dispose() SAL_OVERRIDE;
// window override
virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
@@ -180,7 +183,7 @@ namespace dbaui
/** gives a read only access to the connection vector
*/
- const ::std::vector<OTableConnection*>& getTableConnections() const { return m_vTableConnection; }
+ const ::std::vector<VclPtr<OTableConnection> >& getTableConnections() const { return m_vTableConnection; }
bool ExistsAConn(const OTableWindow* pFromWin) const;
@@ -189,7 +192,7 @@ namespace dbaui
@param _pFromWin the table for which connections should be found
@return an iterator which can be used to travel all connections of the table
*/
- ::std::vector<OTableConnection*>::const_iterator getTableConnections(const OTableWindow* _pFromWin) const;
+ ::std::vector<VclPtr<OTableConnection> >::const_iterator getTableConnections(const OTableWindow* _pFromWin) const;
/** how many connection belongs to single table
@@ -290,7 +293,7 @@ namespace dbaui
@param _pData The data corresponding to the window.
@return The new TableWindow
*/
- virtual OTableWindow* createWindow(const TTableWindowData::value_type& _pData) = 0;
+ virtual VclPtr<OTableWindow> createWindow(const TTableWindowData::value_type& _pData) = 0;
/** determines whether the classes Init method should accept a query
name, or only table names */
diff --git a/dbaccess/source/ui/inc/LimitBox.hxx b/dbaccess/source/ui/inc/LimitBox.hxx
index 5f9187a38bba..6ff436daa170 100644
--- a/dbaccess/source/ui/inc/LimitBox.hxx
+++ b/dbaccess/source/ui/inc/LimitBox.hxx
@@ -24,7 +24,6 @@ class LimitBox: public NumericBox
{
public:
LimitBox( vcl::Window* pParent, WinBits nStyle );
- virtual ~LimitBox();
virtual OUString CreateFieldText( sal_Int64 nValue ) const SAL_OVERRIDE;
diff --git a/dbaccess/source/ui/inc/QueryDesignView.hxx b/dbaccess/source/ui/inc/QueryDesignView.hxx
index 2baba04ac840..04d2724f94f1 100644
--- a/dbaccess/source/ui/inc/QueryDesignView.hxx
+++ b/dbaccess/source/ui/inc/QueryDesignView.hxx
@@ -64,18 +64,19 @@ namespace dbaui
NONE
};
- Splitter m_aSplitter;
+ VclPtr<Splitter> m_aSplitter;
::com::sun::star::lang::Locale m_aLocale;
- OUString m_sDecimalSep;
+ OUString m_sDecimalSep;
- OSelectionBrowseBox* m_pSelectionBox; // presents the lower window
+ VclPtr<OSelectionBrowseBox> m_pSelectionBox; // presents the lower window
ChildFocusState m_eChildFocus;
- bool m_bInSplitHandler;
+ bool m_bInSplitHandler;
public:
OQueryDesignView(OQueryContainerWindow* pParent, OQueryController& _rController,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& );
virtual ~OQueryDesignView();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool isCutAllowed() SAL_OVERRIDE;
virtual bool isPasteAllowed() SAL_OVERRIDE;
diff --git a/dbaccess/source/ui/inc/QueryPropertiesDialog.hxx b/dbaccess/source/ui/inc/QueryPropertiesDialog.hxx
index 6b19daedb287..a083b4cca893 100644
--- a/dbaccess/source/ui/inc/QueryPropertiesDialog.hxx
+++ b/dbaccess/source/ui/inc/QueryPropertiesDialog.hxx
@@ -30,16 +30,16 @@ public:
QueryPropertiesDialog(
vcl::Window* pParent, const bool bDistinct, const sal_Int64 nLimit );
virtual ~QueryPropertiesDialog();
-
+ virtual void dispose() SAL_OVERRIDE;
bool getDistinct() const;
sal_Int64 getLimit() const;
private:
- RadioButton* m_pRB_Distinct;
- RadioButton* m_pRB_NonDistinct;
+ VclPtr<RadioButton> m_pRB_Distinct;
+ VclPtr<RadioButton> m_pRB_NonDistinct;
- LimitBox* m_pLB_Limit;
+ VclPtr<LimitBox> m_pLB_Limit;
};
diff --git a/dbaccess/source/ui/inc/QueryTableView.hxx b/dbaccess/source/ui/inc/QueryTableView.hxx
index 5bac4fb4d2b0..3b8d74618bd9 100644
--- a/dbaccess/source/ui/inc/QueryTableView.hxx
+++ b/dbaccess/source/ui/inc/QueryTableView.hxx
@@ -47,7 +47,7 @@ namespace dbaui
virtual void ConnDoubleClicked(OTableConnection* pConnection) SAL_OVERRIDE;
virtual void KeyInput(const KeyEvent& rEvt) SAL_OVERRIDE;
- virtual OTableWindow* createWindow(const TTableWindowData::value_type& _pData) SAL_OVERRIDE;
+ virtual VclPtr<OTableWindow> createWindow(const TTableWindowData::value_type& _pData) SAL_OVERRIDE;
/** called when init fails at the tablewindowdata because the m_xTable
object could not provide columns, but no exception was thrown.
@@ -58,7 +58,6 @@ namespace dbaui
public:
OQueryTableView(vcl::Window* pParent,OQueryDesignView* pView);
- virtual ~OQueryTableView();
/// base class overwritten: create and delete windows
/// (not really delete, as it becomes an UndoAction)
diff --git a/dbaccess/source/ui/inc/QueryTextView.hxx b/dbaccess/source/ui/inc/QueryTextView.hxx
index 5d9cff71e4e4..ff447f27a476 100644
--- a/dbaccess/source/ui/inc/QueryTextView.hxx
+++ b/dbaccess/source/ui/inc/QueryTextView.hxx
@@ -28,10 +28,11 @@ namespace dbaui
class OQueryTextView : public vcl::Window
{
friend class OQueryViewSwitch;
- OSqlEdit* m_pEdit;
+ VclPtr<OSqlEdit> m_pEdit;
public:
OQueryTextView( OQueryContainerWindow* pParent );
virtual ~OQueryTextView();
+ virtual void dispose() SAL_OVERRIDE;
virtual void GetFocus() SAL_OVERRIDE;
diff --git a/dbaccess/source/ui/inc/QueryViewSwitch.hxx b/dbaccess/source/ui/inc/QueryViewSwitch.hxx
index e6f936a57617..ccf45802c394 100644
--- a/dbaccess/source/ui/inc/QueryViewSwitch.hxx
+++ b/dbaccess/source/ui/inc/QueryViewSwitch.hxx
@@ -34,8 +34,8 @@ namespace dbaui
class OQueryContainerWindow;
class OQueryViewSwitch
{
- OQueryDesignView* m_pDesignView;
- OQueryTextView* m_pTextView;
+ VclPtr<OQueryDesignView> m_pDesignView;
+ VclPtr<OQueryTextView> m_pTextView;
bool m_bAddTableDialogWasVisible; // true if so
public:
OQueryViewSwitch(OQueryContainerWindow* pParent, OQueryController& _rController,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& );
diff --git a/dbaccess/source/ui/inc/RelationControl.hxx b/dbaccess/source/ui/inc/RelationControl.hxx
index a04c08d5f9ca..12973d55b9f5 100644
--- a/dbaccess/source/ui/inc/RelationControl.hxx
+++ b/dbaccess/source/ui/inc/RelationControl.hxx
@@ -32,10 +32,10 @@ namespace dbaui
class OTableListBoxControl
{
- ListBox* m_pLeftTable;
- ListBox* m_pRightTable;
+ VclPtr<ListBox> m_pLeftTable;
+ VclPtr<ListBox> m_pRightTable;
- ORelationControl* m_pRC_Tables;
+ VclPtr<ORelationControl> m_pRC_Tables;
const OJoinTableView::OTableWindowMap* m_pTableMap;
IRelationControlInterface* m_pParentDialog;
OUString m_strCurrentLeft;
diff --git a/dbaccess/source/ui/inc/RelationDesignView.hxx b/dbaccess/source/ui/inc/RelationDesignView.hxx
index f7a97a9687f5..7f1559427eb9 100644
--- a/dbaccess/source/ui/inc/RelationDesignView.hxx
+++ b/dbaccess/source/ui/inc/RelationDesignView.hxx
@@ -33,7 +33,6 @@ namespace dbaui
{
public:
ORelationDesignView(vcl::Window* pParent, ORelationController& _rController,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& );
- virtual ~ORelationDesignView();
// set the statement for representation
/// late construction
diff --git a/dbaccess/source/ui/inc/RelationDlg.hxx b/dbaccess/source/ui/inc/RelationDlg.hxx
index 5950d64f7502..3435632c08f8 100644
--- a/dbaccess/source/ui/inc/RelationDlg.hxx
+++ b/dbaccess/source/ui/inc/RelationDlg.hxx
@@ -27,11 +27,11 @@
#include "JoinTableView.hxx"
#include "RelControliFace.hxx"
#include "moduledbu.hxx"
+#include "RelationControl.hxx"
namespace dbaui
{
class OJoinTableView;
- class OTableListBoxControl;
class ORelationDialog : public ModalDialog
,public IRelationControlInterface
{
@@ -39,16 +39,16 @@ namespace dbaui
boost::scoped_ptr<OTableListBoxControl> m_xTableControl;
OJoinTableView::OTableWindowMap* m_pTableMap;
- RadioButton* m_pRB_NoCascUpd;
- RadioButton* m_pRB_CascUpd;
- RadioButton* m_pRB_CascUpdNull;
- RadioButton* m_pRB_CascUpdDefault;
- RadioButton* m_pRB_NoCascDel;
- RadioButton* m_pRB_CascDel;
- RadioButton* m_pRB_CascDelNull;
- RadioButton* m_pRB_CascDelDefault;
+ VclPtr<RadioButton> m_pRB_NoCascUpd;
+ VclPtr<RadioButton> m_pRB_CascUpd;
+ VclPtr<RadioButton> m_pRB_CascUpdNull;
+ VclPtr<RadioButton> m_pRB_CascUpdDefault;
+ VclPtr<RadioButton> m_pRB_NoCascDel;
+ VclPtr<RadioButton> m_pRB_CascDel;
+ VclPtr<RadioButton> m_pRB_CascDelNull;
+ VclPtr<RadioButton> m_pRB_CascDelDefault;
- OKButton* m_pPB_OK;
+ VclPtr<OKButton> m_pPB_OK;
TTableConnectionData::value_type m_pConnData;
TTableConnectionData::value_type m_pOrigConnData;
@@ -61,6 +61,7 @@ namespace dbaui
const TTableConnectionData::value_type& pConnectionData,
bool bAllowTableSelect = false );
virtual ~ORelationDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > getConnection() SAL_OVERRIDE { return m_xConnection; }
diff --git a/dbaccess/source/ui/inc/RelationTableView.hxx b/dbaccess/source/ui/inc/RelationTableView.hxx
index 9b38d8fb47b6..da09f88bf900 100644
--- a/dbaccess/source/ui/inc/RelationTableView.hxx
+++ b/dbaccess/source/ui/inc/RelationTableView.hxx
@@ -32,7 +32,7 @@ namespace dbaui
public OJoinTableView,
public ::comphelper::OContainerListener
{
- OTableConnection* m_pExistingConnection; ///< is set when a connection was draged on an existing connection
+ VclPtr<OTableConnection> m_pExistingConnection; ///< is set when a connection was draged on an existing connection
TTableConnectionData::value_type m_pCurrentlyTabConnData; ///< set when we creating a connection with more than one keycolumn
::rtl::Reference< comphelper::OContainerListenerAdapter> m_pContainerListener;
bool m_bInRemove;
@@ -40,7 +40,7 @@ namespace dbaui
virtual void ConnDoubleClicked( OTableConnection* pConnection ) SAL_OVERRIDE;
virtual void AddTabWin(const OUString& _rComposedName, const OUString& rWinName, bool bNewTable = false) SAL_OVERRIDE;
- virtual OTableWindow* createWindow(const TTableWindowData::value_type& _pData) SAL_OVERRIDE;
+ virtual VclPtr<OTableWindow> createWindow(const TTableWindowData::value_type& _pData) SAL_OVERRIDE;
/** determines whether the classes Init method should accept a query
name, or only table names */
@@ -54,6 +54,7 @@ namespace dbaui
public:
ORelationTableView( vcl::Window* pParent, ORelationDesignView* pView );
virtual ~ORelationTableView();
+ virtual void dispose() SAL_OVERRIDE;
virtual void RemoveTabWin( OTableWindow* pTabWin ) SAL_OVERRIDE;
virtual void AddConnection(const OJoinExchangeData& jxdSource, const OJoinExchangeData& jxdDest) SAL_OVERRIDE;
diff --git a/dbaccess/source/ui/inc/TableConnection.hxx b/dbaccess/source/ui/inc/TableConnection.hxx
index 76428fb60b24..a027fa033e5a 100644
--- a/dbaccess/source/ui/inc/TableConnection.hxx
+++ b/dbaccess/source/ui/inc/TableConnection.hxx
@@ -41,7 +41,7 @@ namespace dbaui
::std::vector<OConnectionLine*> m_vConnLine;
TTableConnectionData::value_type
m_pData;
- OJoinTableView* m_pParent;
+ VclPtr<OJoinTableView> m_pParent;
bool m_bSelected;
@@ -65,6 +65,7 @@ namespace dbaui
eventually.
*/
virtual ~OTableConnection();
+ virtual void dispose() SAL_OVERRIDE;
OTableConnection& operator=( const OTableConnection& rConn );
diff --git a/dbaccess/source/ui/inc/TableDesignControl.hxx b/dbaccess/source/ui/inc/TableDesignControl.hxx
index 4cabf5d7dd7e..97acc014cf04 100644
--- a/dbaccess/source/ui/inc/TableDesignControl.hxx
+++ b/dbaccess/source/ui/inc/TableDesignControl.hxx
@@ -47,7 +47,6 @@ namespace dbaui
public:
OTableRowView(vcl::Window* pParent);
- virtual ~OTableRowView();
virtual void SetCellData( long nRow, sal_uInt16 nColId, const TOTypeInfoSP& _pTypeInfo ) = 0;
virtual void SetCellData( long nRow, sal_uInt16 nColId, const ::com::sun::star::uno::Any& _rNewData ) = 0;
diff --git a/dbaccess/source/ui/inc/TableDesignHelpBar.hxx b/dbaccess/source/ui/inc/TableDesignHelpBar.hxx
index 900c32374754..bcc79095dec8 100644
--- a/dbaccess/source/ui/inc/TableDesignHelpBar.hxx
+++ b/dbaccess/source/ui/inc/TableDesignHelpBar.hxx
@@ -33,7 +33,7 @@ namespace dbaui
{
private:
OUString m_sHelpText;
- MultiLineEdit* m_pTextWin;
+ VclPtr<MultiLineEdit> m_pTextWin;
protected:
virtual void Resize() SAL_OVERRIDE;
@@ -41,6 +41,7 @@ namespace dbaui
public:
OTableDesignHelpBar( vcl::Window* pParent );
virtual ~OTableDesignHelpBar();
+ virtual void dispose() SAL_OVERRIDE;
void SetHelpText( const OUString& rText );
OUString GetHelpText() const { return m_sHelpText; }
diff --git a/dbaccess/source/ui/inc/TableDesignView.hxx b/dbaccess/source/ui/inc/TableDesignView.hxx
index 72ece65cf6cc..7a1016f6753f 100644
--- a/dbaccess/source/ui/inc/TableDesignView.hxx
+++ b/dbaccess/source/ui/inc/TableDesignView.hxx
@@ -32,9 +32,9 @@ namespace dbaui
class OTableEditorCtrl;
class OTableBorderWindow : public vcl::Window
{
- Splitter m_aHorzSplitter;
- OTableFieldDescWin* m_pFieldDescWin;
- OTableEditorCtrl* m_pEditorCtrl;
+ VclPtr<Splitter> m_aHorzSplitter;
+ VclPtr<OTableFieldDescWin> m_pFieldDescWin;
+ VclPtr<OTableEditorCtrl> m_pEditorCtrl;
void ImplInitSettings( bool bFont, bool bForeground, bool bBackground );
void ArrangeChildren( long nSplitPos ,Rectangle& rRect);
@@ -45,6 +45,7 @@ namespace dbaui
OTableBorderWindow(vcl::Window* pParent);
virtual ~OTableBorderWindow();
// Window overrides
+ virtual void dispose() SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
virtual void GetFocus() SAL_OVERRIDE;
@@ -62,7 +63,7 @@ namespace dbaui
};
private:
::com::sun::star::lang::Locale m_aLocale;
- OTableBorderWindow* m_pWin;
+ VclPtr<OTableBorderWindow> m_pWin;
OTableController& m_rController;
ChildFocusState m_eChildFocus;
@@ -77,6 +78,7 @@ namespace dbaui
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&,
OTableController& _rController);
virtual ~OTableDesignView();
+ virtual void dispose() SAL_OVERRIDE;
// Window overrides
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
diff --git a/dbaccess/source/ui/inc/TableFieldDescription.hxx b/dbaccess/source/ui/inc/TableFieldDescription.hxx
index 9a6992bd732c..d8e5f3d524d2 100644
--- a/dbaccess/source/ui/inc/TableFieldDescription.hxx
+++ b/dbaccess/source/ui/inc/TableFieldDescription.hxx
@@ -25,6 +25,7 @@
#include <rtl/ustring.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <rtl/ref.hxx>
+#include <vcl/vclptr.hxx>
#include <salhelper/simplereferenceobject.hxx>
@@ -49,7 +50,7 @@ namespace dbaui
OUString m_aFieldAlias; ///< column alias
OUString m_aFunctionName;///< contains the function name (only if m_eFunctionType != FKT_NONE)
- vcl::Window* m_pTabWindow;
+ VclPtr<vcl::Window> m_pTabWindow;
sal_Int32 m_eDataType;
sal_Int32 m_eFunctionType;
diff --git a/dbaccess/source/ui/inc/TableGrantCtrl.hxx b/dbaccess/source/ui/inc/TableGrantCtrl.hxx
index c16cba5d5568..5f80e75fcbf3 100644
--- a/dbaccess/source/ui/inc/TableGrantCtrl.hxx
+++ b/dbaccess/source/ui/inc/TableGrantCtrl.hxx
@@ -53,14 +53,15 @@ class OTableGrantControl : public ::svt::EditBrowseBox
mutable TTablePrivilegeMap m_aPrivMap;
OUString m_sUserName;
- ::svt::CheckBoxControl* m_pCheckCell;
- Edit* m_pEdit;
+ VclPtr<::svt::CheckBoxControl> m_pCheckCell;
+ VclPtr<Edit> m_pEdit;
long m_nDataPos;
ImplSVEvent * m_nDeactivateEvent;
public:
OTableGrantControl( vcl::Window* pParent, WinBits nBits);
virtual ~OTableGrantControl();
+ virtual void dispose() SAL_OVERRIDE;
void UpdateTables();
void setUserName(const OUString& _sUserName);
void setGrantUser(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XAuthorizable>& _xGrantUser);
diff --git a/dbaccess/source/ui/inc/TableWindow.hxx b/dbaccess/source/ui/inc/TableWindow.hxx
index 004139a5cb95..2d1aac671a01 100644
--- a/dbaccess/source/ui/inc/TableWindow.hxx
+++ b/dbaccess/source/ui/inc/TableWindow.hxx
@@ -54,9 +54,9 @@ namespace dbaui
friend class OTableWindowListBox;
protected:
// and the table itself (needed for me as I want to lock it as long as the window is alive)
- FixedImage m_aTypeImage;
- OTableWindowTitle m_aTitle;
- OTableWindowListBox* m_pListBox;
+ VclPtr<FixedImage> m_aTypeImage;
+ VclPtr<OTableWindowTitle> m_aTitle;
+ VclPtr<OTableWindowListBox> m_pListBox;
OTableWindowAccess* m_pAccessible;
private:
@@ -82,7 +82,7 @@ namespace dbaui
virtual void MouseButtonDown( const MouseEvent& rEvt ) SAL_OVERRIDE;
virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
- OTableWindowListBox* CreateListBox();
+ VclPtr<OTableWindowListBox> CreateListBox();
// called at FIRST Init
bool FillListBox();
// called at EACH Init
@@ -125,6 +125,7 @@ namespace dbaui
public:
virtual ~OTableWindow();
+ virtual void dispose() SAL_OVERRIDE;
// late Constructor, see also CreateListbox and FillListbox
virtual bool Init();
@@ -148,7 +149,7 @@ namespace dbaui
OUString GetComposedName() const { return m_pData->GetComposedName(); }
OTableWindowListBox* GetListBox() const { return m_pListBox; }
TTableWindowData::value_type GetData() const { return m_pData; }
- OTableWindowTitle& GetTitleCtrl() { return m_aTitle; }
+ OTableWindowTitle& GetTitleCtrl() { return *m_aTitle.get(); }
/** returns the name which should be used when displaying join or relations
@return
diff --git a/dbaccess/source/ui/inc/TableWindowAccess.hxx b/dbaccess/source/ui/inc/TableWindowAccess.hxx
index 305f89838f20..c03871c2b7ea 100644
--- a/dbaccess/source/ui/inc/TableWindowAccess.hxx
+++ b/dbaccess/source/ui/inc/TableWindowAccess.hxx
@@ -22,6 +22,7 @@
#include <com/sun/star/accessibility/XAccessibleRelationSet.hpp>
#include <cppuhelper/implbase2.hxx>
#include <toolkit/awt/vclxaccessiblecomponent.hxx>
+#include <vcl/vclptr.hxx>
namespace dbaui
{
@@ -35,7 +36,7 @@ namespace dbaui
class OTableWindowAccess : public VCLXAccessibleComponent
, public OTableWindowAccess_BASE
{
- OTableWindow* m_pTable; // the window which I should give accessibility to
+ VclPtr<OTableWindow> m_pTable; // the window which I should give accessibility to
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > getParentChild(sal_Int32 _nIndex);
protected:
diff --git a/dbaccess/source/ui/inc/TableWindowListBox.hxx b/dbaccess/source/ui/inc/TableWindowListBox.hxx
index 13f30c6437fb..dfd8f4b39e21 100644
--- a/dbaccess/source/ui/inc/TableWindowListBox.hxx
+++ b/dbaccess/source/ui/inc/TableWindowListBox.hxx
@@ -30,7 +30,7 @@ namespace dbaui
struct OJoinExchangeData
{
public:
- OTableWindowListBox* pListBox; // the ListBox inside the same (you can get the TabWin and the WinName out of it)
+ VclPtr<OTableWindowListBox> pListBox; // the ListBox inside the same (you can get the TabWin and the WinName out of it)
SvTreeListEntry* pEntry; // the entry, which was dragged or to which was dropped on
OJoinExchangeData(OTableWindowListBox* pBox);
@@ -56,7 +56,7 @@ namespace dbaui
Timer m_aScrollTimer;
Point m_aMousePos;
- OTableWindow* m_pTabWin;
+ VclPtr<OTableWindow> m_pTabWin;
ImplSVEvent * m_nDropEvent;
ImplSVEvent * m_nUiEvent;
OJoinDropData m_aDropInfo;
@@ -78,6 +78,7 @@ namespace dbaui
public:
OTableWindowListBox(OTableWindow* pParent);
virtual ~OTableWindowListBox();
+ virtual void dispose() SAL_OVERRIDE;
// DnD stuff
virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ) SAL_OVERRIDE;
diff --git a/dbaccess/source/ui/inc/TableWindowTitle.hxx b/dbaccess/source/ui/inc/TableWindowTitle.hxx
index 77ac0d4ce89f..3d009e3c603e 100644
--- a/dbaccess/source/ui/inc/TableWindowTitle.hxx
+++ b/dbaccess/source/ui/inc/TableWindowTitle.hxx
@@ -26,7 +26,7 @@ namespace dbaui
class OTableWindow;
class OTableWindowTitle : public FixedText
{
- OTableWindow* m_pTabWin;
+ VclPtr<OTableWindow> m_pTabWin;
protected:
virtual void Command(const CommandEvent& rEvt) SAL_OVERRIDE;
@@ -38,6 +38,7 @@ namespace dbaui
public:
OTableWindowTitle( OTableWindow* pParent );
virtual ~OTableWindowTitle();
+ virtual void dispose() SAL_OVERRIDE;
virtual void LoseFocus() SAL_OVERRIDE;
virtual void GetFocus() SAL_OVERRIDE;
virtual void RequestHelp( const HelpEvent& rHEvt ) SAL_OVERRIDE;
diff --git a/dbaccess/source/ui/inc/TablesSingleDlg.hxx b/dbaccess/source/ui/inc/TablesSingleDlg.hxx
index 7b0bf1651d2a..51977b928e4c 100644
--- a/dbaccess/source/ui/inc/TablesSingleDlg.hxx
+++ b/dbaccess/source/ui/inc/TablesSingleDlg.hxx
@@ -55,6 +55,7 @@ class ODbDataSourceAdministrationHelper;
,const ::com::sun::star::uno::Any& _aDataSourceName
);
virtual ~OTableSubscriptionDialog();
+ virtual void dispose() SAL_OVERRIDE;
// forwards from ODbDataSourceAdministrationHelper
void successfullyConnected();
diff --git a/dbaccess/source/ui/inc/TokenWriter.hxx b/dbaccess/source/ui/inc/TokenWriter.hxx
index 6e0cc172a7b7..35b81ad01ea4 100644
--- a/dbaccess/source/ui/inc/TokenWriter.hxx
+++ b/dbaccess/source/ui/inc/TokenWriter.hxx
@@ -196,7 +196,7 @@ namespace dbaui
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetUpdate > m_xTargetResultSetUpdate;
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowUpdate > m_xTargetRowUpdate;
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > m_xTargetResultSetMetaData;
- vcl::Window* m_pParent;
+ VclPtr<vcl::Window> m_pParent;
bool m_bAlreadyAsked;
bool insertNewRow();
diff --git a/dbaccess/source/ui/inc/UserAdminDlg.hxx b/dbaccess/source/ui/inc/UserAdminDlg.hxx
index a003fe898e3e..cc2df632a9f5 100644
--- a/dbaccess/source/ui/inc/UserAdminDlg.hxx
+++ b/dbaccess/source/ui/inc/UserAdminDlg.hxx
@@ -60,6 +60,7 @@ namespace dbaui
,const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection);
virtual ~OUserAdminDlg();
+ virtual void dispose() SAL_OVERRIDE;
virtual const SfxItemSet* getOutputSet() const SAL_OVERRIDE;
virtual SfxItemSet* getWriteOutputSet() SAL_OVERRIDE;
diff --git a/dbaccess/source/ui/inc/VertSplitView.hxx b/dbaccess/source/ui/inc/VertSplitView.hxx
index 4a91f47e05d5..ac7bde548eed 100644
--- a/dbaccess/source/ui/inc/VertSplitView.hxx
+++ b/dbaccess/source/ui/inc/VertSplitView.hxx
@@ -27,9 +27,9 @@ namespace dbaui
{
class OSplitterView : public vcl::Window
{
- Splitter* m_pSplitter;
- vcl::Window* m_pLeft;
- vcl::Window* m_pRight;
+ VclPtr<Splitter> m_pSplitter;
+ VclPtr<vcl::Window> m_pLeft;
+ VclPtr<vcl::Window> m_pRight;
bool m_bVertical;
void ImplInitSettings( bool bFont, bool bForeground, bool bBackground );
@@ -40,6 +40,7 @@ namespace dbaui
OSplitterView(vcl::Window* _pParent,bool _bVertical = true);
virtual ~OSplitterView();
// Window overrides
+ virtual void dispose() SAL_OVERRIDE;
virtual void GetFocus() SAL_OVERRIDE;
void setSplitter(Splitter* _pSplitter);
diff --git a/dbaccess/source/ui/inc/WCPage.hxx b/dbaccess/source/ui/inc/WCPage.hxx
index e99fcf810529..008a9376ce01 100644
--- a/dbaccess/source/ui/inc/WCPage.hxx
+++ b/dbaccess/source/ui/inc/WCPage.hxx
@@ -34,19 +34,19 @@ namespace dbaui
class OCopyTable : public OWizardPage
{
protected:
- Edit* m_pEdTableName;
- RadioButton* m_pRB_DefData;
- RadioButton* m_pRB_Def;
- RadioButton* m_pRB_View;
- RadioButton* m_pRB_AppendData;
- CheckBox* m_pCB_UseHeaderLine;
- CheckBox* m_pCB_PrimaryColumn;
- FixedText* m_pFT_KeyName;
- Edit* m_pEdKeyName;
+ VclPtr<Edit> m_pEdTableName;
+ VclPtr<RadioButton> m_pRB_DefData;
+ VclPtr<RadioButton> m_pRB_Def;
+ VclPtr<RadioButton> m_pRB_View;
+ VclPtr<RadioButton> m_pRB_AppendData;
+ VclPtr<CheckBox> m_pCB_UseHeaderLine;
+ VclPtr<CheckBox> m_pCB_PrimaryColumn;
+ VclPtr<FixedText> m_pFT_KeyName;
+ VclPtr<Edit> m_pEdKeyName;
sal_Int16 m_nOldOperation;
- OWizColumnSelect* m_pPage2;
- OWizNormalExtend* m_pPage3;
+ VclPtr<OWizColumnSelect> m_pPage2;
+ VclPtr<OWizNormalExtend> m_pPage3;
bool m_bPKeyAllowed;
bool m_bUseHeaderAllowed;
@@ -66,6 +66,7 @@ namespace dbaui
OCopyTable( vcl::Window * pParent );
virtual ~OCopyTable();
+ virtual void dispose() SAL_OVERRIDE;
bool IsOptionDefData() const { return m_pRB_DefData->IsChecked(); }
bool IsOptionDef() const { return m_pRB_Def->IsChecked(); }
diff --git a/dbaccess/source/ui/inc/WColumnSelect.hxx b/dbaccess/source/ui/inc/WColumnSelect.hxx
index 98f029c6c665..9b08f6b97f0d 100644
--- a/dbaccess/source/ui/inc/WColumnSelect.hxx
+++ b/dbaccess/source/ui/inc/WColumnSelect.hxx
@@ -35,12 +35,12 @@ namespace dbaui
class OWizColumnSelect : public OWizardPage
{
- ListBox* m_pOrgColumnNames; // left side
- PushButton* m_pColumn_RH;
- PushButton* m_pColumns_RH;
- PushButton* m_pColumn_LH;
- PushButton* m_pColumns_LH;
- ListBox* m_pNewColumnNames; // right side
+ VclPtr<ListBox> m_pOrgColumnNames; // left side
+ VclPtr<PushButton> m_pColumn_RH;
+ VclPtr<PushButton> m_pColumns_RH;
+ VclPtr<PushButton> m_pColumn_LH;
+ VclPtr<PushButton> m_pColumns_LH;
+ VclPtr<ListBox> m_pNewColumnNames; // right side
DECL_LINK( ButtonClickHdl, Button * );
DECL_LINK( ListDoubleClickHdl, ListBox * );
@@ -80,6 +80,7 @@ namespace dbaui
OWizColumnSelect(vcl::Window* pParent);
virtual ~OWizColumnSelect();
+ virtual void dispose() SAL_OVERRIDE;
};
}
#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_WCOLUMNSELECT_HXX
diff --git a/dbaccess/source/ui/inc/WCopyTable.hxx b/dbaccess/source/ui/inc/WCopyTable.hxx
index 32fa0a79e9cc..8a10f01cc795 100644
--- a/dbaccess/source/ui/inc/WCopyTable.hxx
+++ b/dbaccess/source/ui/inc/WCopyTable.hxx
@@ -238,11 +238,11 @@ namespace dbaui
ODatabaseExport::TColumns m_vSourceColumns;
ODatabaseExport::TColumnVector m_vSourceVec;
- HelpButton* m_pbHelp;
- CancelButton* m_pbCancel;
- PushButton* m_pbPrev;
- PushButton* m_pbNext;
- PushButton* m_pbFinish;
+ VclPtr<HelpButton> m_pbHelp;
+ VclPtr<CancelButton> m_pbCancel;
+ VclPtr<PushButton> m_pbPrev;
+ VclPtr<PushButton> m_pbNext;
+ VclPtr<PushButton> m_pbFinish;
OTypeInfoMap m_aTypeInfo;
::std::vector<OTypeInfoMap::iterator> m_aTypeInfoIndex;
@@ -323,6 +323,7 @@ namespace dbaui
);
virtual ~OCopyTableWizard();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool DeactivatePage() SAL_OVERRIDE;
OKButton& GetOKButton() { return static_cast<OKButton&>(*m_pbFinish); }
diff --git a/dbaccess/source/ui/inc/WExtendPages.hxx b/dbaccess/source/ui/inc/WExtendPages.hxx
index e9d19621457f..e51abe09a9bd 100644
--- a/dbaccess/source/ui/inc/WExtendPages.hxx
+++ b/dbaccess/source/ui/inc/WExtendPages.hxx
@@ -35,9 +35,7 @@ namespace dbaui
{
}
- static OWizTypeSelect* Create( vcl::Window* _pParent, SvStream& _rInput ) { return new OWizHTMLExtend( _pParent, _rInput ); }
-
- virtual ~OWizHTMLExtend(){}
+ static VclPtr<OWizTypeSelect> Create( vcl::Window* _pParent, SvStream& _rInput ) { return VclPtr<OWizHTMLExtend>::Create( _pParent, _rInput ); }
};
// Wizard Page: OWizRTFExtend
class OWizRTFExtend : public OWizTypeSelect
@@ -50,9 +48,7 @@ namespace dbaui
{
}
- static OWizTypeSelect* Create( vcl::Window* _pParent, SvStream& _rInput ) { return new OWizRTFExtend( _pParent, _rInput ); }
-
- virtual ~OWizRTFExtend(){}
+ static VclPtr<OWizTypeSelect> Create( vcl::Window* _pParent, SvStream& _rInput ) { return VclPtr<OWizRTFExtend>::Create( _pParent, _rInput ); }
};
// Wizard Page: OWizNormalExtend
diff --git a/dbaccess/source/ui/inc/WNameMatch.hxx b/dbaccess/source/ui/inc/WNameMatch.hxx
index 3feb7dc28e01..61f71b56ce47 100644
--- a/dbaccess/source/ui/inc/WNameMatch.hxx
+++ b/dbaccess/source/ui/inc/WNameMatch.hxx
@@ -50,16 +50,16 @@ namespace dbaui
// Name matching for data appending
class OWizNameMatching : public OWizardPage
{
- FixedText *m_pTABLE_LEFT;
- FixedText *m_pTABLE_RIGHT;
- OColumnTreeBox *m_pCTRL_LEFT; // left side
- OColumnTreeBox *m_pCTRL_RIGHT; // right side
- PushButton *m_pColumn_up;
- PushButton *m_pColumn_down;
- PushButton *m_pColumn_up_right;
- PushButton *m_pColumn_down_right;
- PushButton *m_pAll;
- PushButton *m_pNone;
+ VclPtr<FixedText> m_pTABLE_LEFT;
+ VclPtr<FixedText> m_pTABLE_RIGHT;
+ VclPtr<OColumnTreeBox> m_pCTRL_LEFT; // left side
+ VclPtr<OColumnTreeBox> m_pCTRL_RIGHT; // right side
+ VclPtr<PushButton> m_pColumn_up;
+ VclPtr<PushButton> m_pColumn_down;
+ VclPtr<PushButton> m_pColumn_up_right;
+ VclPtr<PushButton> m_pColumn_down_right;
+ VclPtr<PushButton> m_pAll;
+ VclPtr<PushButton> m_pNone;
OUString m_sSourceText;
OUString m_sDestText;
Image m_aImgUp;
@@ -79,7 +79,7 @@ namespace dbaui
OWizNameMatching(vcl::Window* pParent);
virtual ~OWizNameMatching();
-
+ virtual void dispose() SAL_OVERRIDE;
};
}
#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_WNAMEMATCH_HXX
diff --git a/dbaccess/source/ui/inc/WTabPage.hxx b/dbaccess/source/ui/inc/WTabPage.hxx
index 9a30d7c311fb..6a5d3ab48eb1 100644
--- a/dbaccess/source/ui/inc/WTabPage.hxx
+++ b/dbaccess/source/ui/inc/WTabPage.hxx
@@ -29,12 +29,14 @@ namespace dbaui
class OWizardPage : public TabPage
{
protected:
- OCopyTableWizard* m_pParent;
+ VclPtr<OCopyTableWizard> m_pParent;
bool m_bFirstTime; // Page wird das erste mal gerufen ; should be set in the reset methode
OWizardPage( vcl::Window *pParent, const OString& rID, const OUString& rUIXMLDescription );
public:
+ virtual ~OWizardPage();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Reset ( ) = 0;
virtual bool LeavePage() = 0;
virtual OUString GetTitle() const = 0;
diff --git a/dbaccess/source/ui/inc/WTypeSelect.hxx b/dbaccess/source/ui/inc/WTypeSelect.hxx
index 5f587481e867..d86c70e5f07a 100644
--- a/dbaccess/source/ui/inc/WTypeSelect.hxx
+++ b/dbaccess/source/ui/inc/WTypeSelect.hxx
@@ -37,7 +37,7 @@ namespace dbaui
class OWizTypeSelectControl : public OFieldDescControl
{
protected:
- vcl::Window* m_pParentTabPage;
+ VclPtr<vcl::Window> m_pParentTabPage;
virtual void ActivateAggregate( EControlType eType ) SAL_OVERRIDE;
virtual void DeactivateAggregate( EControlType eType ) SAL_OVERRIDE;
@@ -53,6 +53,7 @@ namespace dbaui
public:
OWizTypeSelectControl(vcl::Window* pParent, vcl::Window* pParentTabPage, OTableDesignHelpBar* pHelpBar=NULL);
virtual ~OWizTypeSelectControl();
+ virtual void dispose() SAL_OVERRIDE;
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData> getMetaData() SAL_OVERRIDE;
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getConnection() SAL_OVERRIDE;
@@ -69,13 +70,15 @@ namespace dbaui
bool _bSet = false);
protected:
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
- vcl::Window* m_pParentTabPage;
+ VclPtr<vcl::Window> m_pParentTabPage;
public:
OWizTypeSelectList( vcl::Window* pParent, WinBits nStyle = WB_BORDER )
: MultiListBox(pParent,nStyle)
, m_bPKey(false)
, m_pParentTabPage(NULL)
{}
+ virtual ~OWizTypeSelectList();
+ virtual void dispose() SAL_OVERRIDE;
void SetPKey(bool bPKey) { m_bPKey = bPKey; }
void SetParentTabPage(vcl::Window* pParentTabPage) { m_pParentTabPage = pParentTabPage; }
};
@@ -91,13 +94,13 @@ namespace dbaui
DECL_LINK( ColumnSelectHdl, MultiListBox* );
DECL_LINK( ButtonClickHdl, Button * );
protected:
- OWizTypeSelectList *m_pColumnNames;
- FixedText *m_pColumns;
- OWizTypeSelectControl *m_pTypeControl;
- FixedText *m_pAutoType;
- FixedText *m_pAutoFt;
- NumericField *m_pAutoEt;
- PushButton *m_pAutoPb;
+ VclPtr<OWizTypeSelectList> m_pColumnNames;
+ VclPtr<FixedText> m_pColumns;
+ VclPtr<OWizTypeSelectControl> m_pTypeControl;
+ VclPtr<FixedText> m_pAutoType;
+ VclPtr<FixedText> m_pAutoFt;
+ VclPtr<NumericField> m_pAutoEt;
+ VclPtr<PushButton> m_pAutoPb;
Image m_imgPKey;
SvStream* m_pParserStream; // stream to read the tokens from or NULL
@@ -118,12 +121,13 @@ namespace dbaui
OWizTypeSelect(vcl::Window* pParent, SvStream* _pStream = NULL );
virtual ~OWizTypeSelect();
+ virtual void dispose() SAL_OVERRIDE;
inline void setDisplayRow(sal_Int32 _nRow) { m_nDisplayRow = _nRow - 1; }
inline void setDuplicateName(bool _bDuplicateName) { m_bDuplicateName = _bDuplicateName; }
};
- typedef OWizTypeSelect* (*TypeSelectionPageFactory)( vcl::Window*, SvStream& );
+ typedef VclPtr<OWizTypeSelect> (*TypeSelectionPageFactory)( vcl::Window*, SvStream& );
}
#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_WTYPESELECT_HXX
diff --git a/dbaccess/source/ui/inc/adtabdlg.hxx b/dbaccess/source/ui/inc/adtabdlg.hxx
index 360ee70fa9eb..815f8c4d566a 100644
--- a/dbaccess/source/ui/inc/adtabdlg.hxx
+++ b/dbaccess/source/ui/inc/adtabdlg.hxx
@@ -58,15 +58,15 @@ namespace dbaui
class OAddTableDlg : public ModelessDialog
{
- RadioButton* m_pCaseTables;
- RadioButton* m_pCaseQueries;
+ VclPtr<RadioButton> m_pCaseTables;
+ VclPtr<RadioButton> m_pCaseQueries;
- OTableTreeListBox* m_pTableList;
- SvTreeListBox* m_pQueryList;
+ VclPtr<OTableTreeListBox> m_pTableList;
+ VclPtr<SvTreeListBox> m_pQueryList;
boost::scoped_ptr< TableObjectListFacade > m_xCurrentList;
- PushButton* m_pAddButton;
- PushButton* m_pCloseButton;
+ VclPtr<PushButton> m_pAddButton;
+ VclPtr<PushButton> m_pCloseButton;
IAddTableDialogContext& m_rContext;
@@ -81,6 +81,7 @@ namespace dbaui
vcl::Window* _pParent,
IAddTableDialogContext& _rContext );
virtual ~OAddTableDlg();
+ virtual void dispose() SAL_OVERRIDE;
void DetermineAddTable() { m_pAddButton->Enable( impl_isAddAllowed() ); }
void Update();
diff --git a/dbaccess/source/ui/inc/advancedsettingsdlg.hxx b/dbaccess/source/ui/inc/advancedsettingsdlg.hxx
index 108467ac78f8..2ba76b55466c 100644
--- a/dbaccess/source/ui/inc/advancedsettingsdlg.hxx
+++ b/dbaccess/source/ui/inc/advancedsettingsdlg.hxx
@@ -51,6 +51,7 @@ namespace dbaui
,const ::com::sun::star::uno::Any& _aDataSourceName);
virtual ~AdvancedSettingsDialog();
+ virtual void dispose() SAL_OVERRIDE;
/// determines whether or not the given data source type has any advanced setting
static bool doesHaveAnyAdvancedSettings( const OUString& _sURL );
diff --git a/dbaccess/source/ui/inc/brwview.hxx b/dbaccess/source/ui/inc/brwview.hxx
index a214e462e08e..e68ff09847c4 100644
--- a/dbaccess/source/ui/inc/brwview.hxx
+++ b/dbaccess/source/ui/inc/brwview.hxx
@@ -46,10 +46,10 @@ namespace dbaui
protected:
::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > m_xGrid; // our grid's UNO representation
::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > m_xMe; // our own UNO representation
- DBTreeView* m_pTreeView;
- Splitter* m_pSplitter;
- mutable SbaGridControl* m_pVclControl; // our grid's VCL representation
- vcl::Window* m_pStatus;
+ VclPtr<DBTreeView> m_pTreeView;
+ VclPtr<Splitter> m_pSplitter;
+ mutable VclPtr<SbaGridControl> m_pVclControl; // our grid's VCL representation
+ VclPtr<vcl::Window> m_pStatus;
DECL_LINK( SplitHdl, void* );
// attribute access
@@ -62,6 +62,7 @@ namespace dbaui
IController& _rController,
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& );
virtual ~UnoDataBrowserView();
+ virtual void dispose() SAL_OVERRIDE;
/// late construction
void Construct(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& xModel);
@@ -93,7 +94,7 @@ namespace dbaui
class BrowserViewStatusDisplay
{
protected:
- UnoDataBrowserView* m_pView;
+ VclPtr<UnoDataBrowserView> m_pView;
public:
BrowserViewStatusDisplay( UnoDataBrowserView* _pView, const OUString& _rStatus );
diff --git a/dbaccess/source/ui/inc/charsetlistbox.hxx b/dbaccess/source/ui/inc/charsetlistbox.hxx
index 78f2da4f4a28..02641062174a 100644
--- a/dbaccess/source/ui/inc/charsetlistbox.hxx
+++ b/dbaccess/source/ui/inc/charsetlistbox.hxx
@@ -34,7 +34,6 @@ namespace dbaui
{
public:
CharSetListBox( vcl::Window* _pParent, WinBits _nBits );
- virtual ~CharSetListBox();
void SelectEntryByIanaName( const OUString& _rIanaName );
bool StoreSelectedCharSet( SfxItemSet& _rSet, const sal_uInt16 _nItemId );
diff --git a/dbaccess/source/ui/inc/curledit.hxx b/dbaccess/source/ui/inc/curledit.hxx
index cb9201328ada..4dff5e14ca9f 100644
--- a/dbaccess/source/ui/inc/curledit.hxx
+++ b/dbaccess/source/ui/inc/curledit.hxx
@@ -36,13 +36,14 @@ class OConnectionURLEdit : public Edit
{
::dbaccess::ODsnTypeCollection*
m_pTypeCollection;
- FixedText* m_pForcedPrefix;
+ VclPtr<FixedText> m_pForcedPrefix;
OUString m_sSaveValueNoPrefix;
bool m_bShowPrefix; // when <TRUE> the prefix will be visible, otherwise not
public:
OConnectionURLEdit(vcl::Window* pParent, WinBits _nBits,bool _bShowPrefix = false);
virtual ~OConnectionURLEdit();
+ virtual void dispose() SAL_OVERRIDE;
public:
// Edit overridables
diff --git a/dbaccess/source/ui/inc/datasourceconnector.hxx b/dbaccess/source/ui/inc/datasourceconnector.hxx
index f5d64a0f48cd..c5459ecbe15b 100644
--- a/dbaccess/source/ui/inc/datasourceconnector.hxx
+++ b/dbaccess/source/ui/inc/datasourceconnector.hxx
@@ -24,6 +24,7 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/sdbc/XConnection.hpp>
#include <com/sun/star/sdbc/XDataSource.hpp>
+#include <vcl/vclptr.hxx>
namespace dbtools
{
@@ -38,10 +39,10 @@ namespace dbaui
class ODatasourceConnector
{
protected:
- vcl::Window* m_pErrorMessageParent;
+ VclPtr<vcl::Window> m_pErrorMessageParent;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
- m_xContext;
- OUString m_sContextInformation;
+ m_xContext;
+ OUString m_sContextInformation;
public:
ODatasourceConnector(
diff --git a/dbaccess/source/ui/inc/dbadmin.hxx b/dbaccess/source/ui/inc/dbadmin.hxx
index 7c437d6f1ab7..0510cd6fa10d 100644
--- a/dbaccess/source/ui/inc/dbadmin.hxx
+++ b/dbaccess/source/ui/inc/dbadmin.hxx
@@ -66,6 +66,7 @@ public:
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB
);
virtual ~ODbAdminDialog();
+ virtual void dispose() SAL_OVERRIDE;
/** create and return an item set for use with the dialog.
@param _pTypeCollection pointer to an <type>ODatasourceMap</type>. May be NULL, in this case
diff --git a/dbaccess/source/ui/inc/dbtreelistbox.hxx b/dbaccess/source/ui/inc/dbtreelistbox.hxx
index 0a5b71da3809..cbeb1b6e540f 100644
--- a/dbaccess/source/ui/inc/dbtreelistbox.hxx
+++ b/dbaccess/source/ui/inc/dbtreelistbox.hxx
@@ -84,6 +84,7 @@ namespace dbaui
,WinBits nWinStyle=0
,bool _bHandleEnterKey = false);
virtual ~DBTreeListBox();
+ virtual void dispose() SAL_OVERRIDE;
void setControlActionListener( IControlActionListener* _pListener ) { m_pActionListener = _pListener; }
void setContextMenuProvider( IContextMenuProvider* _pContextMenuProvider ) { m_pContextMenuProvider = _pContextMenuProvider; }
diff --git a/dbaccess/source/ui/inc/dbwiz.hxx b/dbaccess/source/ui/inc/dbwiz.hxx
index d86e027a0092..ce534eba107d 100644
--- a/dbaccess/source/ui/inc/dbwiz.hxx
+++ b/dbaccess/source/ui/inc/dbwiz.hxx
@@ -76,6 +76,7 @@ public:
,const ::com::sun::star::uno::Any& _aDataSourceName
);
virtual ~ODbTypeWizDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual const SfxItemSet* getOutputSet() const SAL_OVERRIDE;
virtual SfxItemSet* getWriteOutputSet() SAL_OVERRIDE;
@@ -92,7 +93,7 @@ public:
protected:
/// to override to create new pages
- virtual TabPage* createPage(WizardState _nState) SAL_OVERRIDE;
+ virtual VclPtr<TabPage> createPage(WizardState _nState) SAL_OVERRIDE;
virtual WizardState determineNextState(WizardState _nCurrentState) const SAL_OVERRIDE;
virtual bool leaveState(WizardState _nState) SAL_OVERRIDE;
virtual ::svt::IWizardPageController*
diff --git a/dbaccess/source/ui/inc/dbwizsetup.hxx b/dbaccess/source/ui/inc/dbwizsetup.hxx
index 734f967e7ef8..79926668b5d5 100644
--- a/dbaccess/source/ui/inc/dbwizsetup.hxx
+++ b/dbaccess/source/ui/inc/dbwizsetup.hxx
@@ -85,9 +85,9 @@ private:
OUString m_sRM_FinalText;
INetURLObject m_aDocURL;
OUString m_sWorkPath;
- OGeneralPageWizard* m_pGeneralPage;
- OMySQLIntroPageSetup* m_pMySQLIntroPage;
- OFinalDBPageSetup* m_pFinalPage;
+ VclPtr<OGeneralPageWizard> m_pGeneralPage;
+ VclPtr<OMySQLIntroPageSetup> m_pMySQLIntroPage;
+ VclPtr<OFinalDBPageSetup> m_pFinalPage;
::dbaccess::ODsnTypeCollection*
m_pCollection; /// the DSN type collection instance
@@ -102,6 +102,7 @@ public:
,const ::com::sun::star::uno::Any& _aDataSourceName
);
virtual ~ODbTypeWizDialogSetup();
+ virtual void dispose() SAL_OVERRIDE;
virtual const SfxItemSet* getOutputSet() const SAL_OVERRIDE;
virtual SfxItemSet* getWriteOutputSet() SAL_OVERRIDE;
@@ -127,7 +128,7 @@ public:
protected:
/// to override to create new pages
- virtual TabPage* createPage(WizardState _nState) SAL_OVERRIDE;
+ virtual VclPtr<TabPage> createPage(WizardState _nState) SAL_OVERRIDE;
virtual bool leaveState(WizardState _nState) SAL_OVERRIDE;
virtual void enterState(WizardState _nState) SAL_OVERRIDE;
virtual ::svt::IWizardPageController* getPageController( TabPage* _pCurrentPage ) const SAL_OVERRIDE;
diff --git a/dbaccess/source/ui/inc/directsql.hxx b/dbaccess/source/ui/inc/directsql.hxx
index 401b46df7f8e..60a5d05f6b84 100644
--- a/dbaccess/source/ui/inc/directsql.hxx
+++ b/dbaccess/source/ui/inc/directsql.hxx
@@ -49,13 +49,13 @@ namespace dbaui
OModuleClient m_aModuleClient;
::osl::Mutex m_aMutex;
- MultiLineEditSyntaxHighlight* m_pSQL;
- PushButton* m_pExecute;
- ListBox* m_pSQLHistory;
- VclMultiLineEdit* m_pStatus;
- CheckBox* m_pShowOutput;
- VclMultiLineEdit* m_pOutput;
- PushButton* m_pClose;
+ VclPtr<MultiLineEditSyntaxHighlight> m_pSQL;
+ VclPtr<PushButton> m_pExecute;
+ VclPtr<ListBox> m_pSQLHistory;
+ VclPtr<VclMultiLineEdit> m_pStatus;
+ VclPtr<CheckBox> m_pShowOutput;
+ VclPtr<VclMultiLineEdit> m_pOutput;
+ VclPtr<PushButton> m_pClose;
typedef ::std::deque< OUString > StringQueue;
StringQueue m_aStatementHistory; // previous statements
@@ -72,6 +72,7 @@ namespace dbaui
vcl::Window* _pParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConn);
virtual ~DirectSQLDialog();
+ virtual void dispose() SAL_OVERRIDE;
/// number of history entries
sal_Int32 getHistorySize() const;
diff --git a/dbaccess/source/ui/inc/dlgattr.hxx b/dbaccess/source/ui/inc/dlgattr.hxx
index b6614cf62701..4bf07d1b3406 100644
--- a/dbaccess/source/ui/inc/dlgattr.hxx
+++ b/dbaccess/source/ui/inc/dlgattr.hxx
@@ -35,6 +35,7 @@ namespace dbaui
public:
SbaSbAttrDlg(vcl::Window * pParent, const SfxItemSet*, SvNumberFormatter*, bool bHasFormat, bool bRow = false);
virtual ~SbaSbAttrDlg();
+ virtual void dispose() SAL_OVERRIDE;
virtual void PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage ) SAL_OVERRIDE;
};
diff --git a/dbaccess/source/ui/inc/dlgsave.hxx b/dbaccess/source/ui/inc/dlgsave.hxx
index 5217e1fcb0a0..38c0f5b7c2d8 100644
--- a/dbaccess/source/ui/inc/dlgsave.hxx
+++ b/dbaccess/source/ui/inc/dlgsave.hxx
@@ -66,6 +66,7 @@ namespace dbaui
const IObjectNameCheck& _rObjectNameCheck,
sal_Int32 _nFlags = SAD_DEFAULT | SAD_TITLE_STORE_AS);
virtual ~OSaveAsDlg();
+ virtual void dispose() SAL_OVERRIDE;
OUString getName() const;
OUString getCatalog() const;
diff --git a/dbaccess/source/ui/inc/dlgsize.hxx b/dbaccess/source/ui/inc/dlgsize.hxx
index e145cf7675ad..1d51ed11a534 100644
--- a/dbaccess/source/ui/inc/dlgsize.hxx
+++ b/dbaccess/source/ui/inc/dlgsize.hxx
@@ -39,11 +39,13 @@ namespace dbaui
protected:
DECL_LINK( CbClickHdl, Button * );
- MetricField* m_pMF_VALUE;
- CheckBox* m_pCB_STANDARD;
+ VclPtr<MetricField> m_pMF_VALUE;
+ VclPtr<CheckBox> m_pCB_STANDARD;
public:
DlgSize( vcl::Window * pParent, sal_Int32 nVal, bool bRow, sal_Int32 _nAlternativeStandard = -1 );
+ virtual ~DlgSize();
+ virtual void dispose() SAL_OVERRIDE;
sal_Int32 GetValue();
};
} // namespace dbaui
diff --git a/dbaccess/source/ui/inc/indexdialog.hxx b/dbaccess/source/ui/inc/indexdialog.hxx
index f204c8c3cf89..bd595e012263 100644
--- a/dbaccess/source/ui/inc/indexdialog.hxx
+++ b/dbaccess/source/ui/inc/indexdialog.hxx
@@ -85,15 +85,15 @@ namespace dbaui
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
SvtViewOptions m_aGeometrySettings;
- ToolBox *m_pActions;
- DbaIndexList *m_pIndexList;
- FixedText *m_pIndexDetails;
- FixedText *m_pDescriptionLabel;
- FixedText *m_pDescription;
- CheckBox *m_pUnique;
- FixedText *m_pFieldsLabel;
- IndexFieldsControl *m_pFields;
- PushButton *m_pClose;
+ VclPtr<ToolBox> m_pActions;
+ VclPtr<DbaIndexList> m_pIndexList;
+ VclPtr<FixedText> m_pIndexDetails;
+ VclPtr<FixedText> m_pDescriptionLabel;
+ VclPtr<FixedText> m_pDescription;
+ VclPtr<CheckBox> m_pUnique;
+ VclPtr<FixedText> m_pFieldsLabel;
+ VclPtr<IndexFieldsControl> m_pFields;
+ VclPtr<PushButton> m_pClose;
OIndexCollection* m_pIndexes;
SvTreeListEntry* m_pPreviousSelection;
@@ -111,6 +111,7 @@ namespace dbaui
sal_Int32 _nMaxColumnsInIndex
);
virtual ~DbaIndexDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
diff --git a/dbaccess/source/ui/inc/indexfieldscontrol.hxx b/dbaccess/source/ui/inc/indexfieldscontrol.hxx
index fb1347d2b3eb..3f262156d129 100644
--- a/dbaccess/source/ui/inc/indexfieldscontrol.hxx
+++ b/dbaccess/source/ui/inc/indexfieldscontrol.hxx
@@ -40,8 +40,8 @@ namespace dbaui
Link m_aModifyHdl;
- ::svt::ListBoxControl* m_pSortingCell;
- ::svt::ListBoxControl* m_pFieldNameCell;
+ VclPtr<::svt::ListBoxControl> m_pSortingCell;
+ VclPtr<::svt::ListBoxControl> m_pFieldNameCell;
OUString m_sAscendingText;
OUString m_sDescendingText;
@@ -52,6 +52,7 @@ namespace dbaui
public:
IndexFieldsControl( vcl::Window* _pParent, WinBits nWinStyle);
virtual ~IndexFieldsControl();
+ virtual void dispose() SAL_OVERRIDE;
void Init(const ::com::sun::star::uno::Sequence< OUString >& _rAvailableFields, sal_Int32 _nMaxColumnsInIndex,bool _bAddIndexAppendix);
diff --git a/dbaccess/source/ui/inc/linkeddocuments.hxx b/dbaccess/source/ui/inc/linkeddocuments.hxx
index 7c597b24624e..a13383b71955 100644
--- a/dbaccess/source/ui/inc/linkeddocuments.hxx
+++ b/dbaccess/source/ui/inc/linkeddocuments.hxx
@@ -32,6 +32,7 @@
#include <com/sun/star/ucb/XContent.hpp>
#include <com/sun/star/sdb/application/XDatabaseDocumentUI.hpp>
#include <comphelper/namedvaluecollection.hxx>
+#include <vcl/vclptr.hxx>
namespace vcl { class Window; }
namespace dbaui
@@ -49,7 +50,7 @@ namespace dbaui
m_xConnection;
::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XDatabaseDocumentUI >
m_xDocumentUI;
- vcl::Window* m_pDialogParent;
+ VclPtr<vcl::Window> m_pDialogParent;
OUString m_sCurrentlyEditing;
OUString m_sDataSourceName;
diff --git a/dbaccess/source/ui/inc/marktree.hxx b/dbaccess/source/ui/inc/marktree.hxx
index 2e10a99b82c6..f39d5281ffde 100644
--- a/dbaccess/source/ui/inc/marktree.hxx
+++ b/dbaccess/source/ui/inc/marktree.hxx
@@ -40,6 +40,7 @@ class OMarkableTreeListBox : public DBTreeListBox
public:
OMarkableTreeListBox( vcl::Window* pParent, WinBits nWinStyle=0 );
virtual ~OMarkableTreeListBox();
+ virtual void dispose() SAL_OVERRIDE;
virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
virtual void CheckButtonHdl() SAL_OVERRIDE;
diff --git a/dbaccess/source/ui/inc/paramdialog.hxx b/dbaccess/source/ui/inc/paramdialog.hxx
index edc37862a366..11db9808841f 100644
--- a/dbaccess/source/ui/inc/paramdialog.hxx
+++ b/dbaccess/source/ui/inc/paramdialog.hxx
@@ -52,11 +52,11 @@ namespace dbaui
{
protected:
// the controls
- ListBox* m_pAllParams;
- Edit* m_pParam;
- PushButton* m_pTravelNext;
- OKButton* m_pOKBtn;
- CancelButton* m_pCancelBtn;
+ VclPtr<ListBox> m_pAllParams;
+ VclPtr<Edit> m_pParam;
+ VclPtr<PushButton> m_pTravelNext;
+ VclPtr<OKButton> m_pOKBtn;
+ VclPtr<CancelButton> m_pCancelBtn;
sal_Int32 m_nCurrentlySelected;
@@ -84,6 +84,7 @@ namespace dbaui
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > & _rxConnection,
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext);
virtual ~OParameterDialog();
+ virtual void dispose() SAL_OVERRIDE;
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
getValues() const { return m_aFinalValues; }
diff --git a/dbaccess/source/ui/inc/querycontainerwindow.hxx b/dbaccess/source/ui/inc/querycontainerwindow.hxx
index 646c5e1488a9..5c1e151aedbe 100644
--- a/dbaccess/source/ui/inc/querycontainerwindow.hxx
+++ b/dbaccess/source/ui/inc/querycontainerwindow.hxx
@@ -42,14 +42,15 @@ namespace dbaui
class OQueryContainerWindow : public ODataView
{
OQueryViewSwitch* m_pViewSwitch;
- OBeamer* m_pBeamer;
- Splitter* m_pSplitter;
+ VclPtr<OBeamer> m_pBeamer;
+ VclPtr<Splitter> m_pSplitter;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame2 > m_xBeamer;
DECL_LINK( SplitHdl, void* );
public:
OQueryContainerWindow(vcl::Window* pParent, OQueryController& _rController,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&);
virtual ~OQueryContainerWindow();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Construct() SAL_OVERRIDE;
diff --git a/dbaccess/source/ui/inc/queryfilter.hxx b/dbaccess/source/ui/inc/queryfilter.hxx
index b9d76cccca97..06cc9510080f 100644
--- a/dbaccess/source/ui/inc/queryfilter.hxx
+++ b/dbaccess/source/ui/inc/queryfilter.hxx
@@ -67,19 +67,19 @@ namespace dbaui
,public ::svxform::OParseContextClient
{
private:
- ListBox* m_pLB_WHEREFIELD1;
- ListBox* m_pLB_WHERECOMP1;
- Edit* m_pET_WHEREVALUE1;
+ VclPtr<ListBox> m_pLB_WHEREFIELD1;
+ VclPtr<ListBox> m_pLB_WHERECOMP1;
+ VclPtr<Edit> m_pET_WHEREVALUE1;
- ListBox* m_pLB_WHERECOND2;
- ListBox* m_pLB_WHEREFIELD2;
- ListBox* m_pLB_WHERECOMP2;
- Edit* m_pET_WHEREVALUE2;
+ VclPtr<ListBox> m_pLB_WHERECOND2;
+ VclPtr<ListBox> m_pLB_WHEREFIELD2;
+ VclPtr<ListBox> m_pLB_WHERECOMP2;
+ VclPtr<Edit> m_pET_WHEREVALUE2;
- ListBox* m_pLB_WHERECOND3;
- ListBox* m_pLB_WHEREFIELD3;
- ListBox* m_pLB_WHERECOMP3;
- Edit* m_pET_WHEREVALUE3;
+ VclPtr<ListBox> m_pLB_WHERECOND3;
+ VclPtr<ListBox> m_pLB_WHEREFIELD3;
+ VclPtr<ListBox> m_pLB_WHERECOMP3;
+ VclPtr<Edit> m_pET_WHEREVALUE3;
OUString m_aSTR_COMPARE_OPERATORS;
@@ -113,6 +113,7 @@ namespace dbaui
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& _rxCols
);
virtual ~DlgFilterCrit();
+ virtual void dispose() SAL_OVERRIDE;
void BuildWherePart();
diff --git a/dbaccess/source/ui/inc/queryorder.hxx b/dbaccess/source/ui/inc/queryorder.hxx
index 007c42966a6a..46da94464b53 100644
--- a/dbaccess/source/ui/inc/queryorder.hxx
+++ b/dbaccess/source/ui/inc/queryorder.hxx
@@ -59,12 +59,12 @@ namespace dbaui
class DlgOrderCrit : public ModalDialog
{
protected:
- ListBox* m_pLB_ORDERFIELD1;
- ListBox* m_pLB_ORDERVALUE1;
- ListBox* m_pLB_ORDERFIELD2;
- ListBox* m_pLB_ORDERVALUE2;
- ListBox* m_pLB_ORDERFIELD3;
- ListBox* m_pLB_ORDERVALUE3;
+ VclPtr<ListBox> m_pLB_ORDERFIELD1;
+ VclPtr<ListBox> m_pLB_ORDERVALUE1;
+ VclPtr<ListBox> m_pLB_ORDERFIELD2;
+ VclPtr<ListBox> m_pLB_ORDERVALUE2;
+ VclPtr<ListBox> m_pLB_ORDERFIELD3;
+ VclPtr<ListBox> m_pLB_ORDERVALUE3;
OUString aSTR_NOENTRY;
OUString m_sOrgOrder;
@@ -72,8 +72,8 @@ namespace dbaui
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xColumns;
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> m_xConnection;
- ListBox* m_aColumnList[DOG_ROWS];
- ListBox* m_aValueList[DOG_ROWS];
+ VclPtr<ListBox> m_aColumnList[DOG_ROWS];
+ VclPtr<ListBox> m_aValueList[DOG_ROWS];
DECL_LINK( FieldListSelectHdl, ListBox * );
void EnableLines();
@@ -83,8 +83,9 @@ namespace dbaui
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _rxConnection,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer>& _rxComposer,
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& _rxCols);
+ virtual ~DlgOrderCrit();
+ virtual void dispose() SAL_OVERRIDE;
- virtual ~DlgOrderCrit();
void BuildOrderPart();
OUString GetOrderList( ) const;
diff --git a/dbaccess/source/ui/inc/queryview.hxx b/dbaccess/source/ui/inc/queryview.hxx
index 0a05a3153b40..645525ca8874 100644
--- a/dbaccess/source/ui/inc/queryview.hxx
+++ b/dbaccess/source/ui/inc/queryview.hxx
@@ -28,7 +28,6 @@ namespace dbaui
{
public:
OQueryView(vcl::Window* pParent, OQueryController& _rController,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& );
- virtual ~OQueryView();
virtual bool isCutAllowed() = 0;
virtual bool isPasteAllowed() = 0;
diff --git a/dbaccess/source/ui/inc/sbagrid.hxx b/dbaccess/source/ui/inc/sbagrid.hxx
index 443ed2791a48..25292c90231e 100644
--- a/dbaccess/source/ui/inc/sbagrid.hxx
+++ b/dbaccess/source/ui/inc/sbagrid.hxx
@@ -127,7 +127,7 @@ namespace dbaui
virtual void SAL_CALL dispose() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
protected:
- virtual FmGridControl* imp_CreateControl(vcl::Window* pParent, WinBits nStyle) SAL_OVERRIDE;
+ virtual VclPtr<FmGridControl> imp_CreateControl(vcl::Window* pParent, WinBits nStyle) SAL_OVERRIDE;
#ifdef _MSC_VER
typedef ::com::sun::star::frame::XStatusListener xstlist_type;
typedef ::com::sun::star::uno::Reference< xstlist_type > xlistener_type;
@@ -231,6 +231,7 @@ namespace dbaui
public:
SbaGridControl(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >,Window* pParent, FmXGridPeer* _pPeer, WinBits nBits = WB_TABSTOP);
virtual ~SbaGridControl();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE;
virtual void Select() SAL_OVERRIDE;
@@ -273,7 +274,7 @@ namespace dbaui
virtual void MouseButtonDown( const BrowserMouseEvent& rMEvt) SAL_OVERRIDE;
// EditBrowseBox overridables
- virtual BrowserHeader* imp_CreateHeaderBar(BrowseBox* pParent) SAL_OVERRIDE;
+ virtual VclPtr<BrowserHeader> imp_CreateHeaderBar(BrowseBox* pParent) SAL_OVERRIDE;
virtual ::svt::CellController* GetController(long nRow, sal_uInt16 nCol) SAL_OVERRIDE;
// DbGridControl overridables
diff --git a/dbaccess/source/ui/inc/sqledit.hxx b/dbaccess/source/ui/inc/sqledit.hxx
index c941bdfa4c6e..2e5ac221ee65 100644
--- a/dbaccess/source/ui/inc/sqledit.hxx
+++ b/dbaccess/source/ui/inc/sqledit.hxx
@@ -43,7 +43,7 @@ namespace dbaui
Timer m_timerUndoActionCreation;
Link m_lnkTextModifyHdl;
OUString m_strOrigText; // is restored on undo
- OQueryTextView* m_pView;
+ VclPtr<OQueryTextView> m_pView;
bool m_bAccelAction; // is set on cut, copy, paste
bool m_bStopTimer;
svtools::ColorConfig m_ColorConfig;
@@ -68,6 +68,7 @@ namespace dbaui
public:
OSqlEdit( OQueryTextView* pParent, WinBits nWinStyle = WB_LEFT | WB_VSCROLL |WB_BORDER);
virtual ~OSqlEdit();
+ virtual void dispose() SAL_OVERRIDE;
// Edit overridables
virtual void SetText(const OUString& rNewText) SAL_OVERRIDE;
diff --git a/dbaccess/source/ui/inc/sqlmessage.hxx b/dbaccess/source/ui/inc/sqlmessage.hxx
index 1f4200c827ad..51cc296b5624 100644
--- a/dbaccess/source/ui/inc/sqlmessage.hxx
+++ b/dbaccess/source/ui/inc/sqlmessage.hxx
@@ -45,9 +45,9 @@ namespace dbaui
struct SQLMessageBox_Impl;
class OSQLMessageBox : public ButtonDialog
{
- FixedImage m_aInfoImage;
- FixedText m_aTitle;
- FixedText m_aMessage;
+ VclPtr<FixedImage> m_aInfoImage;
+ VclPtr<FixedText> m_aTitle;
+ VclPtr<FixedText> m_aMessage;
OUString m_sHelpURL;
::std::unique_ptr< SQLMessageBox_Impl > m_pImpl;
@@ -90,6 +90,7 @@ public:
const ::dbtools::SQLExceptionInfo* _pAdditionalErrorInfo = NULL );
virtual ~OSQLMessageBox();
+ virtual void dispose() SAL_OVERRIDE;
private:
void Construct( WinBits nStyle, MessageType eImage );
diff --git a/dbaccess/source/ui/inc/textconnectionsettings.hxx b/dbaccess/source/ui/inc/textconnectionsettings.hxx
index 872b02e42734..89bcfc354e9c 100644
--- a/dbaccess/source/ui/inc/textconnectionsettings.hxx
+++ b/dbaccess/source/ui/inc/textconnectionsettings.hxx
@@ -39,6 +39,7 @@ namespace dbaui
public:
TextConnectionSettingsDialog( vcl::Window* _pParent, SfxItemSet& _rItems );
virtual ~TextConnectionSettingsDialog();
+ virtual void dispose() SAL_OVERRIDE;
/** initializes a set of PropertyStorage instaces, which are bound to
the text-connection relevant items in our item sets
@@ -48,8 +49,8 @@ namespace dbaui
virtual short Execute() SAL_OVERRIDE;
private:
- ::std::unique_ptr< OTextConnectionHelper > m_pTextConnectionHelper;
- OKButton *m_pOK;
+ VclPtr<OTextConnectionHelper> m_pTextConnectionHelper;
+ VclPtr<OKButton> m_pOK;
SfxItemSet& m_rItems;
private:
diff --git a/dbaccess/source/ui/inc/undosqledit.hxx b/dbaccess/source/ui/inc/undosqledit.hxx
index e9307c66c599..66a2f48795c3 100644
--- a/dbaccess/source/ui/inc/undosqledit.hxx
+++ b/dbaccess/source/ui/inc/undosqledit.hxx
@@ -21,6 +21,7 @@
#include "GeneralUndo.hxx"
#include "dbu_control.hrc"
+#include <vcl/vclptr.hxx>
namespace dbaui
{
@@ -29,7 +30,7 @@ namespace dbaui
class OSqlEditUndoAct : public OCommentUndoAction
{
protected:
- OSqlEdit* m_pOwner;
+ VclPtr<OSqlEdit> m_pOwner;
OUString m_strNextText;
virtual void Undo() SAL_OVERRIDE { ToggleText(); }
diff --git a/dbaccess/source/ui/inc/unodatbr.hxx b/dbaccess/source/ui/inc/unodatbr.hxx
index a544a2a98fee..18cb4322295c 100644
--- a/dbaccess/source/ui/inc/unodatbr.hxx
+++ b/dbaccess/source/ui/inc/unodatbr.hxx
@@ -100,11 +100,11 @@ namespace dbaui
OUString m_sQueryCommand; // the command of the query currently loaded (if any)
//OUString m_sToBeLoaded; // contains the element name which should be loaded if any
- DBTreeView* m_pTreeView;
- Splitter* m_pSplitter;
- SvTreeList* m_pTreeModel; // contains the datasources of the registry
- SvTreeListEntry* m_pCurrentlyDisplayed;
- ImplSVEvent * m_nAsyncDrop;
+ VclPtr<DBTreeView> m_pTreeView;
+ VclPtr<Splitter> m_pSplitter;
+ SvTreeList* m_pTreeModel; // contains the datasources of the registry
+ SvTreeListEntry* m_pCurrentlyDisplayed;
+ ImplSVEvent * m_nAsyncDrop;
sal_Int16 m_nBorder; // sal_True when border should be shown
diff --git a/dbaccess/source/ui/inc/unosqlmessage.hxx b/dbaccess/source/ui/inc/unosqlmessage.hxx
index 7028db2c22e6..5a41729aee2c 100644
--- a/dbaccess/source/ui/inc/unosqlmessage.hxx
+++ b/dbaccess/source/ui/inc/unosqlmessage.hxx
@@ -71,7 +71,7 @@ protected:
virtual sal_Bool SAL_CALL convertFastPropertyValue( com::sun::star::uno::Any& _rConvertedValue, com::sun::star::uno::Any& _rOldValue, sal_Int32 _nHandle, const com::sun::star::uno::Any& _rValue) throw(com::sun::star::lang::IllegalArgumentException) SAL_OVERRIDE;
// OGenericUnoDialog overridables
- virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
+ virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
};
} // namespace dbaui
diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx
index 0f16a402c1f1..67d464ada188 100644
--- a/dbaccess/source/ui/misc/DExport.cxx
+++ b/dbaccess/source/ui/misc/DExport.cxx
@@ -687,8 +687,8 @@ bool ODatabaseExport::executeWizard(const OUString& _rTableName, const Any& _aTe
{
bool bHaveDefaultTable = !m_sDefaultTableName.isEmpty();
OUString sTableName( bHaveDefaultTable ? m_sDefaultTableName : _rTableName );
- OCopyTableWizard aWizard(
- NULL,
+ ScopedVclPtrInstance<OCopyTableWizard> aWizard(
+ nullptr,
sTableName,
bHaveDefaultTable ? CopyTableOperation::AppendData : CopyTableOperation::CopyDefinitionAndData,
m_aDestColumns,
@@ -703,14 +703,14 @@ bool ODatabaseExport::executeWizard(const OUString& _rTableName, const Any& _aTe
bool bError = false;
try
{
- if (aWizard.Execute())
+ if (aWizard->Execute())
{
- switch(aWizard.getOperation())
+ switch(aWizard->getOperation())
{
case CopyTableOperation::CopyDefinitionAndData:
case CopyTableOperation::AppendData:
{
- m_xTable = aWizard.createTable();
+ m_xTable = aWizard->createTable();
bError = !m_xTable.is();
if(m_xTable.is())
{
@@ -718,10 +718,10 @@ bool ODatabaseExport::executeWizard(const OUString& _rTableName, const Any& _aTe
if(_aTextColor.hasValue())
m_xTable->setPropertyValue(PROPERTY_TEXTCOLOR,_aTextColor);
}
- m_bIsAutoIncrement = aWizard.shouldCreatePrimaryKey();
- m_vColumns = aWizard.GetColumnPositions();
- m_vColumnTypes = aWizard.GetColumnTypes();
- m_bAppendFirstLine = !aWizard.UseHeaderLine();
+ m_bIsAutoIncrement = aWizard->shouldCreatePrimaryKey();
+ m_vColumns = aWizard->GetColumnPositions();
+ m_vColumnTypes = aWizard->GetColumnTypes();
+ m_bAppendFirstLine = !aWizard->UseHeaderLine();
}
break;
default:
@@ -736,7 +736,7 @@ bool ODatabaseExport::executeWizard(const OUString& _rTableName, const Any& _aTe
}
catch( const SQLException&)
{
- ::dbaui::showError( ::dbtools::SQLExceptionInfo( ::cppu::getCaughtException() ), &aWizard, m_xContext );
+ ::dbaui::showError( ::dbtools::SQLExceptionInfo( ::cppu::getCaughtException() ), aWizard.get(), m_xContext );
bError = true;
}
catch( const Exception& )
@@ -754,9 +754,9 @@ void ODatabaseExport::showErrorDialog(const ::com::sun::star::sdbc::SQLException
OUString aMsg(e.Message);
aMsg += "\n";
aMsg += ModuleRes( STR_QRY_CONTINUE );
- OSQLWarningBox aBox( NULL, aMsg, WB_YES_NO | WB_DEF_NO );
+ ScopedVclPtrInstance< OSQLWarningBox > aBox( nullptr, aMsg, WB_YES_NO | WB_DEF_NO );
- if (aBox.Execute() == RET_YES)
+ if (aBox->Execute() == RET_YES)
m_bDontAskAgain = true;
else
m_bError = true;
diff --git a/dbaccess/source/ui/misc/RowSetDrop.cxx b/dbaccess/source/ui/misc/RowSetDrop.cxx
index 5a061ea0c448..1d2316ad3d02 100644
--- a/dbaccess/source/ui/misc/RowSetDrop.cxx
+++ b/dbaccess/source/ui/misc/RowSetDrop.cxx
@@ -241,8 +241,8 @@ bool ORowSetImportExport::insertNewRow()
if(!m_bAlreadyAsked)
{
OUString sAskIfContinue = ModuleRes(STR_ERROR_OCCURRED_WHILE_COPYING);
- OSQLWarningBox aDlg( m_pParent, sAskIfContinue, WB_YES_NO | WB_DEF_YES );
- if(aDlg.Execute() == RET_YES)
+ ScopedVclPtrInstance< OSQLWarningBox > aDlg( m_pParent, sAskIfContinue, WB_YES_NO | WB_DEF_YES );
+ if(aDlg->Execute() == RET_YES)
m_bAlreadyAsked = true;
else
return false;
diff --git a/dbaccess/source/ui/misc/ToolBoxHelper.cxx b/dbaccess/source/ui/misc/ToolBoxHelper.cxx
index ac5e461bd951..52f658e12aea 100644
--- a/dbaccess/source/ui/misc/ToolBoxHelper.cxx
+++ b/dbaccess/source/ui/misc/ToolBoxHelper.cxx
@@ -92,7 +92,7 @@ namespace dbaui
}
void OToolBoxHelper::setToolBox(ToolBox* _pTB)
{
- bool bFirstTime = (m_pToolBox == NULL);
+ bool bFirstTime = (m_pToolBox == nullptr);
m_pToolBox = _pTB;
if ( m_pToolBox )
{
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index e7dbf9c57e18..397f2a639663 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -852,12 +852,12 @@ bool callColumnFormatDialog(vcl::Window* _pParent,
}
{ // want the dialog to be destroyed before our set
- SbaSbAttrDlg aDlg(_pParent, pFormatDescriptor, _pFormatter, _bHasFormat);
- if (RET_OK == aDlg.Execute())
+ ScopedVclPtrInstance< SbaSbAttrDlg > aDlg(_pParent, pFormatDescriptor, _pFormatter, _bHasFormat);
+ if (RET_OK == aDlg->Execute())
{
// ItemSet->UNO
// UNO-properties
- const SfxItemSet* pSet = aDlg.GetExampleSet();
+ const SfxItemSet* pSet = aDlg->GetExampleSet();
// (of course we could put the modified items directly into the column, but then the UNO-model
// won't reflect these changes, and why do we have a model, then ?)
@@ -875,7 +875,7 @@ bool callColumnFormatDialog(vcl::Window* _pParent,
bRet = true;
}
// deleted formats
- const SfxItemSet* pResult = aDlg.GetOutputItemSet();
+ const SfxItemSet* pResult = aDlg->GetOutputItemSet();
if (pResult)
{
const SfxPoolItem* pItem = pResult->GetItem( SID_ATTR_NUMBERFORMAT_INFO );
@@ -997,10 +997,10 @@ void adjustBrowseBoxColumnWidth( ::svt::EditBrowseBox* _pBox, sal_uInt16 _nColId
Size aDefaultMM = _pBox->PixelToLogic( Size( nDefaultWidth, 0 ), MapMode( MAP_MM ) );
- DlgSize aColumnSizeDlg( _pBox, nColSize, false, aDefaultMM.Width() * 10 );
- if ( aColumnSizeDlg.Execute() )
+ ScopedVclPtrInstance< DlgSize > aColumnSizeDlg( _pBox, nColSize, false, aDefaultMM.Width() * 10 );
+ if ( aColumnSizeDlg->Execute() )
{
- sal_Int32 nValue = aColumnSizeDlg.GetValue();
+ sal_Int32 nValue = aColumnSizeDlg->GetValue();
if ( -1 == nValue )
{ // default width
nValue = _pBox->GetDefaultColumnWidth( _pBox->GetColumnTitle( _nColId ) );
@@ -1286,13 +1286,13 @@ sal_Int32 askForUserAction(vcl::Window* _pParent,sal_uInt16 _nTitle,sal_uInt16 _
SolarMutexGuard aGuard;
OUString aMsg = ModuleRes(_nText);
aMsg = aMsg.replaceFirst("%1", _sName);
- OSQLMessageBox aAsk(_pParent, ModuleRes(_nTitle ), aMsg,WB_YES_NO | WB_DEF_YES,OSQLMessageBox::Query);
+ ScopedVclPtrInstance< OSQLMessageBox > aAsk(_pParent, ModuleRes(_nTitle ), aMsg,WB_YES_NO | WB_DEF_YES,OSQLMessageBox::Query);
if ( _bAll )
{
- aAsk.AddButton(ModuleRes(STR_BUTTON_TEXT_ALL), RET_ALL, 0);
- aAsk.GetPushButton(RET_ALL)->SetHelpId(HID_CONFIRM_DROP_BUTTON_ALL);
+ aAsk->AddButton(ModuleRes(STR_BUTTON_TEXT_ALL), RET_ALL, 0);
+ aAsk->GetPushButton(RET_ALL)->SetHelpId(HID_CONFIRM_DROP_BUTTON_ALL);
}
- return aAsk.Execute();
+ return aAsk->Execute();
}
namespace
@@ -1431,17 +1431,18 @@ bool insertHierachyElement( vcl::Window* _pParent, const Reference< XComponentCo
// here we have everything needed to create a new query object ...
HierarchicalNameCheck aNameChecker( _xNames.get(), sName );
// ... ehm, except a new name
- OSaveAsDlg aAskForName( _pParent,
+ ScopedVclPtrInstance<OSaveAsDlg> aAskForName(
+ _pParent,
_rxContext,
sTargetName,
sLabel,
aNameChecker,
- SAD_ADDITIONAL_DESCRIPTION | SAD_TITLE_PASTE_AS);
- if ( RET_OK != aAskForName.Execute() )
+ SAD_ADDITIONAL_DESCRIPTION | SAD_TITLE_PASTE_AS );
+ if ( RET_OK != aAskForName->Execute() )
// cancelled by the user
return false;
- sNewName = aAskForName.getName();
+ sNewName = aAskForName->getName();
}
}
else if ( xNameAccess->hasByName(sNewName) )
diff --git a/dbaccess/source/ui/misc/WCPage.cxx b/dbaccess/source/ui/misc/WCPage.cxx
index 9856a3d8e185..0c99a437378d 100644
--- a/dbaccess/source/ui/misc/WCPage.cxx
+++ b/dbaccess/source/ui/misc/WCPage.cxx
@@ -19,6 +19,8 @@
#include "WCPage.hxx"
#include "WCopyTable.hxx"
+#include "WColumnSelect.hxx"
+#include "WExtendPages.hxx"
#include "defaultobjectnamecheck.hxx"
#include <tools/debug.hxx>
@@ -103,6 +105,23 @@ OCopyTable::OCopyTable(vcl::Window * pParent)
OCopyTable::~OCopyTable()
{
+ disposeOnce();
+}
+
+void OCopyTable::dispose()
+{
+ m_pEdTableName.clear();
+ m_pRB_DefData.clear();
+ m_pRB_Def.clear();
+ m_pRB_View.clear();
+ m_pRB_AppendData.clear();
+ m_pCB_UseHeaderLine.clear();
+ m_pCB_PrimaryColumn.clear();
+ m_pFT_KeyName.clear();
+ m_pEdKeyName.clear();
+ m_pPage2.clear();
+ m_pPage3.clear();
+ OWizardPage::dispose();
}
IMPL_LINK( OCopyTable, AppendDataClickHdl, Button*, /*pButton*/ )
diff --git a/dbaccess/source/ui/misc/WColumnSelect.cxx b/dbaccess/source/ui/misc/WColumnSelect.cxx
index 0df651f41212..d9ca01bf3565 100644
--- a/dbaccess/source/ui/misc/WColumnSelect.cxx
+++ b/dbaccess/source/ui/misc/WColumnSelect.cxx
@@ -50,6 +50,17 @@ OWizardPage::OWizardPage(vcl::Window* pParent, const OString& rID, const OUStrin
{
}
+OWizardPage::~OWizardPage()
+{
+ disposeOnce();
+}
+
+void OWizardPage::dispose()
+{
+ m_pParent.clear();
+ TabPage::dispose();
+}
+
// OWizColumnSelect
OWizColumnSelect::OWizColumnSelect( vcl::Window* pParent)
:OWizardPage( pParent, "ApplyColPage", "dbaccess/ui/applycolpage.ui")
@@ -81,6 +92,11 @@ OWizColumnSelect::OWizColumnSelect( vcl::Window* pParent)
OWizColumnSelect::~OWizColumnSelect()
{
+ disposeOnce();
+}
+
+void OWizColumnSelect::dispose()
+{
while ( m_pNewColumnNames->GetEntryCount() )
{
void* pData = m_pNewColumnNames->GetEntryData(0);
@@ -90,6 +106,13 @@ OWizColumnSelect::~OWizColumnSelect()
m_pNewColumnNames->RemoveEntry(0);
}
m_pNewColumnNames->Clear();
+ m_pOrgColumnNames.clear();
+ m_pColumn_RH.clear();
+ m_pColumns_RH.clear();
+ m_pColumn_LH.clear();
+ m_pColumns_LH.clear();
+ m_pNewColumnNames.clear();
+ OWizardPage::dispose();
}
void OWizColumnSelect::Reset()
diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx
index 90f1894c41bc..9569788f759b 100644
--- a/dbaccess/source/ui/misc/WCopyTable.cxx
+++ b/dbaccess/source/ui/misc/WCopyTable.cxx
@@ -578,16 +578,16 @@ OCopyTableWizard::OCopyTableWizard( vcl::Window * pParent, const OUString& _rDef
m_sName = ::dbtools::composeTableName(m_xDestConnection->getMetaData(),sCatalog,sSchema,sTable,false,::dbtools::eInTableDefinitions);
}
- OCopyTable* pPage1( new OCopyTable( this ) );
+ VclPtrInstance<OCopyTable> pPage1( this );
pPage1->disallowUseHeaderLine();
if ( !bAllowViews )
pPage1->disallowViews();
pPage1->setCreateStyleAction();
AddWizardPage(pPage1);
- AddWizardPage( new OWizNameMatching( this ) );
- AddWizardPage( new OWizColumnSelect( this ) );
- AddWizardPage( new OWizNormalExtend( this ) );
+ AddWizardPage( VclPtr<OWizNameMatching>::Create( this ) );
+ AddWizardPage( VclPtr<OWizColumnSelect>::Create( this ) );
+ AddWizardPage( VclPtr<OWizNormalExtend>::Create( this ) );
ActivatePage();
}
@@ -624,13 +624,13 @@ OCopyTableWizard::OCopyTableWizard( vcl::Window* pParent, const OUString& _rDefa
m_xInteractionHandler.set( InteractionHandler::createWithParent(m_xContext, 0), UNO_QUERY );
- OCopyTable* pPage1( new OCopyTable( this ) );
+ VclPtrInstance<OCopyTable> pPage1( this );
pPage1->disallowViews();
pPage1->setCreateStyleAction();
AddWizardPage( pPage1 );
- AddWizardPage( new OWizNameMatching( this ) );
- AddWizardPage( new OWizColumnSelect( this ) );
+ AddWizardPage( VclPtr<OWizNameMatching>::Create( this ) );
+ AddWizardPage( VclPtr<OWizColumnSelect>::Create( this ) );
AddWizardPage( (*_pTypeSelectionPageFactory)( this, _rTypeSelectionPageArg ) );
ActivatePage();
@@ -640,11 +640,11 @@ void OCopyTableWizard::construct()
{
SetSizePixel(Size(580, 350));
- AddButton( m_pbHelp = new HelpButton(this, WB_TABSTOP) );
- AddButton( m_pbCancel = new CancelButton(this, WB_TABSTOP) );
- AddButton( m_pbPrev = new PushButton(this, WB_TABSTOP));
- AddButton( m_pbNext = new PushButton(this, WB_TABSTOP));
- AddButton( m_pbFinish = new PushButton(this, WB_TABSTOP));
+ AddButton( m_pbHelp = VclPtr<HelpButton>::Create(this, WB_TABSTOP) );
+ AddButton( m_pbCancel = VclPtr<CancelButton>::Create(this, WB_TABSTOP) );
+ AddButton( m_pbPrev = VclPtr<PushButton>::Create(this, WB_TABSTOP));
+ AddButton( m_pbNext = VclPtr<PushButton>::Create(this, WB_TABSTOP));
+ AddButton( m_pbFinish = VclPtr<PushButton>::Create(this, WB_TABSTOP));
m_pbHelp->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
m_pbCancel->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
@@ -686,13 +686,18 @@ void OCopyTableWizard::construct()
OCopyTableWizard::~OCopyTableWizard()
{
+ disposeOnce();
+}
+
+void OCopyTableWizard::dispose()
+{
for ( ;; )
{
- TabPage *pPage = GetPage(0);
- if ( pPage == NULL )
+ VclPtr<TabPage> pPage = GetPage(0);
+ if ( pPage == nullptr )
break;
RemovePage( pPage );
- delete pPage;
+ pPage.disposeAndClear();
}
if ( m_bDeleteSourceColumns )
@@ -705,11 +710,12 @@ OCopyTableWizard::~OCopyTableWizard()
m_aTypeInfo.clear();
m_aDestTypeInfoIndex.clear();
- delete m_pbHelp;
- delete m_pbCancel;
- delete m_pbPrev;
- delete m_pbNext;
- delete m_pbFinish;
+ m_pbHelp.disposeAndClear();
+ m_pbCancel.disposeAndClear();
+ m_pbPrev.disposeAndClear();
+ m_pbNext.disposeAndClear();
+ m_pbFinish.disposeAndClear();
+ WizardDialog::dispose();
}
IMPL_LINK_NOARG(OCopyTableWizard, ImplPrevHdl)
diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx
index aa35ed9d6c16..c533db6fce9f 100644
--- a/dbaccess/source/ui/misc/WNameMatch.cxx
+++ b/dbaccess/source/ui/misc/WNameMatch.cxx
@@ -74,6 +74,22 @@ OWizNameMatching::OWizNameMatching( vcl::Window* pParent)
OWizNameMatching::~OWizNameMatching()
{
+ disposeOnce();
+}
+
+void OWizNameMatching::dispose()
+{
+ m_pTABLE_LEFT.clear();
+ m_pTABLE_RIGHT.clear();
+ m_pCTRL_LEFT.clear();
+ m_pCTRL_RIGHT.clear();
+ m_pColumn_up.clear();
+ m_pColumn_down.clear();
+ m_pColumn_up_right.clear();
+ m_pColumn_down_right.clear();
+ m_pAll.clear();
+ m_pNone.clear();
+ OWizardPage::dispose();
}
void OWizNameMatching::Reset()
diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx
index 40e2227fd3ea..e294f324b62a 100644
--- a/dbaccess/source/ui/misc/WTypeSelect.cxx
+++ b/dbaccess/source/ui/misc/WTypeSelect.cxx
@@ -45,13 +45,18 @@ using namespace ::com::sun::star::sdbc;
OWizTypeSelectControl::OWizTypeSelectControl(vcl::Window* pParent, vcl::Window* pParentTabPage, OTableDesignHelpBar* pHelpBar)
: OFieldDescControl(pParent, pHelpBar)
{
-
m_pParentTabPage = pParentTabPage;
}
OWizTypeSelectControl::~OWizTypeSelectControl()
{
+ disposeOnce();
+}
+void OWizTypeSelectControl::dispose()
+{
+ m_pParentTabPage.clear();
+ OFieldDescControl::dispose();
}
void OWizTypeSelectControl::ActivateAggregate( EControlType eType )
@@ -87,7 +92,7 @@ void OWizTypeSelectControl::CellModified(long nRow, sal_uInt16 nColId )
OSL_ENSURE(nRow == -1,"nRow muss -1 sein!");
(void)nRow;
- MultiListBox *pListBox = static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_pColumnNames;
+ MultiListBox *pListBox = static_cast<OWizTypeSelect*>(m_pParentTabPage.get())->m_pColumnNames;
OFieldDescription* pCurFieldDescr = getCurrentFieldDescData();
@@ -137,13 +142,13 @@ void OWizTypeSelectControl::CellModified(long nRow, sal_uInt16 nColId )
pWiz->showError(strMessage);
pCurFieldDescr->SetName(sName);
DisplayData(pCurFieldDescr);
- static_cast<OWizTypeSelect*>(m_pParentTabPage)->setDuplicateName(true);
+ static_cast<OWizTypeSelect*>(m_pParentTabPage.get())->setDuplicateName(true);
return;
}
OUString sOldName = pCurFieldDescr->GetName();
pCurFieldDescr->SetName(sNewName);
- static_cast<OWizTypeSelect*>(m_pParentTabPage)->setDuplicateName(false);
+ static_cast<OWizTypeSelect*>(m_pParentTabPage.get())->setDuplicateName(false);
// now we change the name
OCopyTableWizard::TNameMapping::iterator aIter = pWiz->m_mNameMapping.begin();
@@ -172,48 +177,48 @@ void OWizTypeSelectControl::CellModified(long nRow, sal_uInt16 nColId )
::com::sun::star::lang::Locale OWizTypeSelectControl::GetLocale() const
{
- return static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_pParent->GetLocale();
+ return static_cast<OWizTypeSelect*>(m_pParentTabPage.get())->m_pParent->GetLocale();
}
Reference< XNumberFormatter > OWizTypeSelectControl::GetFormatter() const
{
- return static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_pParent->GetFormatter();
+ return static_cast<OWizTypeSelect*>(m_pParentTabPage.get())->m_pParent->GetFormatter();
}
TOTypeInfoSP OWizTypeSelectControl::getTypeInfo(sal_Int32 _nPos)
{
- return static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_pParent->getDestTypeInfo(_nPos);
+ return static_cast<OWizTypeSelect*>(m_pParentTabPage.get())->m_pParent->getDestTypeInfo(_nPos);
}
const OTypeInfoMap* OWizTypeSelectControl::getTypeInfo() const
{
- return &static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_pParent->getDestTypeInfo();
+ return &static_cast<OWizTypeSelect*>(m_pParentTabPage.get())->m_pParent->getDestTypeInfo();
}
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData> OWizTypeSelectControl::getMetaData()
{
- return static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_pParent->m_xDestConnection->getMetaData();
+ return static_cast<OWizTypeSelect*>(m_pParentTabPage.get())->m_pParent->m_xDestConnection->getMetaData();
}
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> OWizTypeSelectControl::getConnection()
{
- return static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_pParent->m_xDestConnection;
+ return static_cast<OWizTypeSelect*>(m_pParentTabPage.get())->m_pParent->m_xDestConnection;
}
bool OWizTypeSelectControl::isAutoIncrementValueEnabled() const
{
- return static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_bAutoIncrementEnabled;
+ return static_cast<OWizTypeSelect*>(m_pParentTabPage.get())->m_bAutoIncrementEnabled;
}
OUString OWizTypeSelectControl::getAutoIncrementValue() const
{
- return static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_sAutoIncrementValue;
+ return static_cast<OWizTypeSelect*>(m_pParentTabPage.get())->m_sAutoIncrementValue;
}
#define IMG_PRIMARY_KEY 1
OWizTypeSelect::OWizTypeSelect( vcl::Window* pParent, SvStream* _pStream )
:OWizardPage( pParent, "TypeSelect", "dbaccess/ui/typeselectpage.ui")
- ,m_pTypeControl(new OWizTypeSelectControl(get<VclVBox>("control_container"), this) )
+ ,m_pTypeControl(VclPtr<OWizTypeSelectControl>::Create(get<VclVBox>("control_container"), this) )
,m_pParserStream( _pStream )
,m_nDisplayRow(0)
,m_bAutoIncrementEnabled(false)
@@ -255,7 +260,19 @@ OWizTypeSelect::OWizTypeSelect( vcl::Window* pParent, SvStream* _pStream )
OWizTypeSelect::~OWizTypeSelect()
{
- delete m_pTypeControl;
+ disposeOnce();
+}
+
+void OWizTypeSelect::dispose()
+{
+ m_pTypeControl.disposeAndClear();
+ m_pColumnNames.clear();
+ m_pColumns.clear();
+ m_pAutoType.clear();
+ m_pAutoFt.clear();
+ m_pAutoEt.clear();
+ m_pAutoPb.clear();
+ OWizardPage::dispose();
}
OUString OWizTypeSelect::GetTitle() const
@@ -344,6 +361,17 @@ IMPL_LINK( OWizTypeSelect, ButtonClickHdl, Button *, /*pButton*/ )
return 0;
}
+OWizTypeSelectList::~OWizTypeSelectList()
+{
+ disposeOnce();
+}
+
+void OWizTypeSelectList::dispose()
+{
+ m_pParentTabPage.clear();
+ MultiListBox::dispose();
+}
+
bool OWizTypeSelectList::IsPrimaryKeyAllowed() const
{
sal_uInt16 nCount = GetSelectEntryCount();
@@ -364,7 +392,7 @@ void OWizTypeSelectList::setPrimaryKey(OFieldDescription* _pFieldDescr, sal_uInt
RemoveEntry(_nPos);
_pFieldDescr->SetPrimaryKey(_bSet);
if( _bSet )
- InsertEntry(sColumnName, static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_imgPKey,_nPos);
+ InsertEntry(sColumnName, static_cast<OWizTypeSelect*>(m_pParentTabPage.get())->m_imgPKey,_nPos);
else if( _pFieldDescr->getTypeInfo()->bNullable )
{
_pFieldDescr->SetControlDefault(Any());
diff --git a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx
index cfe5df91130c..1903b0cd6029 100644
--- a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx
+++ b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx
@@ -308,8 +308,8 @@ namespace dbaui
bool bReConnect = true;
if ( _bUI )
{
- MessageDialog aQuery(getView(), ModuleRes(STR_QUERY_CONNECTION_LOST), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
- bReConnect = ( RET_YES == aQuery.Execute() );
+ ScopedVclPtrInstance< MessageDialog > aQuery(getView(), ModuleRes(STR_QUERY_CONNECTION_LOST), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ bReConnect = ( RET_YES == aQuery->Execute() );
}
// now really reconnect ...
diff --git a/dbaccess/source/ui/misc/singledoccontroller.cxx b/dbaccess/source/ui/misc/singledoccontroller.cxx
index 3f55ef279a78..77408cdaf51a 100644
--- a/dbaccess/source/ui/misc/singledoccontroller.cxx
+++ b/dbaccess/source/ui/misc/singledoccontroller.cxx
@@ -18,6 +18,7 @@
*/
#include <dbaccess/dbaundomanager.hxx>
+#include <dbaccess/dataview.hxx>
#include "singledoccontroller.hxx"
#include "browserids.hxx"
#include "dbu_misc.hrc"
diff --git a/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx b/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx
index e58d60f183f3..9b584be0715b 100644
--- a/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx
+++ b/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx
@@ -82,10 +82,10 @@ namespace dbaui
{
// search the position of our table window in the table window map
nIndex = m_pLine->GetParent()->GetTabWinMap().size();
- const ::std::vector<OTableConnection*>& rVec = m_pLine->GetParent()->getTableConnections();
- ::std::vector<OTableConnection*>::const_iterator aIter = rVec.begin();
- ::std::vector<OTableConnection*>::const_iterator aEnd = rVec.end();
- for (; aIter != aEnd && (*aIter) != m_pLine; ++nIndex,++aIter)
+ const auto& rVec = m_pLine->GetParent()->getTableConnections();
+ auto aIter = rVec.begin();
+ auto aEnd = rVec.end();
+ for (; aIter != aEnd && (*aIter).get() != m_pLine; ++nIndex,++aIter)
;
nIndex = ( aIter != aEnd ) ? nIndex : -1;
}
@@ -169,8 +169,14 @@ namespace dbaui
}
OTableConnection::~OTableConnection()
{
+ disposeOnce();
+ }
+ void OTableConnection::dispose()
+ {
// clear vector
clearLineData();
+ m_pParent.clear();
+ vcl::Window::dispose();
}
Reference< XAccessibleContext > SAL_CALL OConnectionLineAccess::getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException, std::exception)
{
diff --git a/dbaccess/source/ui/querydesign/JoinController.cxx b/dbaccess/source/ui/querydesign/JoinController.cxx
index 9e192e66b3ab..ac483039587c 100644
--- a/dbaccess/source/ui/querydesign/JoinController.cxx
+++ b/dbaccess/source/ui/querydesign/JoinController.cxx
@@ -170,10 +170,7 @@ OJoinDesignView* OJoinController::getJoinView()
void OJoinController::disposing()
{
- {
- boost::scoped_ptr< vcl::Window > pEnsureDelete( m_pAddTableDialog );
- m_pAddTableDialog = NULL;
- }
+ m_pAddTableDialog = NULL;
OJoinController_BASE::disposing();
@@ -225,7 +222,7 @@ FeatureState OJoinController::GetState(sal_uInt16 _nId) const
case ID_BROWSER_ADDTABLE:
aReturn.bEnabled = ( getView() != NULL )
&& const_cast< OJoinController* >( this )->getJoinView()->getTableView()->IsAddAllowed();
- aReturn.bChecked = aReturn.bEnabled && m_pAddTableDialog != NULL && m_pAddTableDialog->IsVisible() ;
+ aReturn.bChecked = aReturn.bEnabled && m_pAddTableDialog != nullptr && m_pAddTableDialog->IsVisible() ;
if ( aReturn.bEnabled )
aReturn.sTitle = OAddTableDlg::getDialogTitleForContext( impl_getDialogContext() );
break;
@@ -272,7 +269,7 @@ void OJoinController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >&
return;
case ID_BROWSER_ADDTABLE:
if ( !m_pAddTableDialog )
- m_pAddTableDialog = new OAddTableDlg( getView(), impl_getDialogContext() );
+ m_pAddTableDialog = VclPtr<OAddTableDlg>::Create( getView(), impl_getDialogContext() );
if ( m_pAddTableDialog->IsVisible() )
{
diff --git a/dbaccess/source/ui/querydesign/JoinDesignView.cxx b/dbaccess/source/ui/querydesign/JoinDesignView.cxx
index b61a512c1de6..61e40284dd92 100644
--- a/dbaccess/source/ui/querydesign/JoinDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinDesignView.cxx
@@ -56,15 +56,19 @@ OJoinDesignView::OJoinDesignView(vcl::Window* _pParent, OJoinController& _rContr
,m_pTableView(NULL)
,m_rController( _rController )
{
- m_pScrollWindow = new OScrollWindowHelper(this);
+ m_pScrollWindow = VclPtr<OScrollWindowHelper>::Create(this);
}
OJoinDesignView::~OJoinDesignView()
{
- boost::scoped_ptr<vcl::Window> aT3(m_pScrollWindow);
- m_pScrollWindow = NULL;
- boost::scoped_ptr<vcl::Window> aT2(m_pTableView);
- m_pTableView = NULL;
+ disposeOnce();
+}
+
+void OJoinDesignView::dispose()
+{
+ m_pScrollWindow.disposeAndClear();
+ m_pTableView.disposeAndClear();
+ ODataView::dispose();
}
void OJoinDesignView::Construct()
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx
index 8b0c63d177b8..efc798032f18 100644
--- a/dbaccess/source/ui/querydesign/JoinTableView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx
@@ -65,9 +65,9 @@ using namespace ::com::sun::star::lang;
#define TABWIN_HEIGHT_STD 120
OScrollWindowHelper::OScrollWindowHelper( vcl::Window* pParent) : Window( pParent)
- ,m_aHScrollBar( this, WB_HSCROLL|WB_REPEAT|WB_DRAG )
- ,m_aVScrollBar( this, WB_VSCROLL|WB_REPEAT|WB_DRAG )
- ,m_pCornerWindow(new ScrollBarBox(this, WB_3DLOOK))
+ ,m_aHScrollBar( VclPtr<ScrollBar>::Create(this, WB_HSCROLL|WB_REPEAT|WB_DRAG) )
+ ,m_aVScrollBar( VclPtr<ScrollBar>::Create(this, WB_VSCROLL|WB_REPEAT|WB_DRAG) )
+ ,m_pCornerWindow(VclPtr<ScrollBarBox>::Create(this, WB_3DLOOK))
,m_pTableView(NULL)
{
@@ -89,9 +89,16 @@ OScrollWindowHelper::OScrollWindowHelper( vcl::Window* pParent) : Window( pParen
OScrollWindowHelper::~OScrollWindowHelper()
{
- boost::scoped_ptr<vcl::Window> aTemp(m_pCornerWindow);
- m_pCornerWindow = NULL;
- m_pTableView = NULL;
+ disposeOnce();
+}
+
+void OScrollWindowHelper::dispose()
+{
+ m_aHScrollBar.disposeAndClear();
+ m_aVScrollBar.disposeAndClear();
+ m_pCornerWindow.disposeAndClear();
+ m_pTableView.clear();
+ vcl::Window::dispose();
}
void OScrollWindowHelper::setTableView(OJoinTableView* _pTableView)
@@ -174,6 +181,11 @@ OJoinTableView::OJoinTableView( vcl::Window* pParent, OJoinDesignView* pView )
OJoinTableView::~OJoinTableView()
{
+ disposeOnce();
+}
+
+void OJoinTableView::dispose()
+{
if( m_pAccessible )
{
m_pAccessible->clearTableView();
@@ -181,6 +193,12 @@ OJoinTableView::~OJoinTableView()
}
// delete lists
clearLayoutInformation();
+ m_pDragWin.clear();
+ m_pSizingWin.clear();
+ m_pSelectedConn.clear();
+ m_pLastFocusTabWin.clear();
+ m_pView.clear();
+ vcl::Window::dispose();
}
IMPL_LINK( OJoinTableView, ScrollHdl, ScrollBar*, pScrollBar )
@@ -246,9 +264,7 @@ bool OJoinTableView::RemoveConnection( OTableConnection* _pConn,bool _bDelete )
makeAny(_pConn->GetAccessible()),
Any());
if ( _bDelete )
- {
- delete _pConn;
- }
+ _pConn->disposeOnce();
return true;
}
@@ -257,7 +273,7 @@ OTableWindow* OJoinTableView::GetTabWindow( const OUString& rName )
{
OTableWindowMap::iterator aIter = m_aTableMap.find(rName);
- return aIter == m_aTableMap.end() ? NULL : aIter->second;
+ return aIter == m_aTableMap.end() ? nullptr : aIter->second;
}
TTableWindowData::value_type OJoinTableView::createTableWindowData(const OUString& _rComposedName
@@ -308,7 +324,7 @@ void OJoinTableView::AddTabWin(const OUString& _rComposedName, const OUString& r
TTableWindowData::value_type pNewTabWinData(createTableWindowData( _rComposedName, rWinName,rWinName ));
// insert new window in window list
- OTableWindow* pNewTabWin = createWindow( pNewTabWinData );
+ VclPtr<OTableWindow> pNewTabWin = createWindow( pNewTabWinData );
if ( pNewTabWin->Init() )
{
m_pView->getController().getTableWindowData().push_back( pNewTabWinData);
@@ -330,7 +346,7 @@ void OJoinTableView::AddTabWin(const OUString& _rComposedName, const OUString& r
else
{
pNewTabWin->clearListBox();
- delete pNewTabWin;
+ pNewTabWin.disposeAndClear();
}
}
@@ -340,7 +356,7 @@ void OJoinTableView::RemoveTabWin( OTableWindow* pTabWin )
bool bRemove = true;
TTableWindowData::value_type pData = pTabWin->GetData();
sal_Int32 nCount = m_vTableConnection.size();
- ::std::vector<OTableConnection*>::reverse_iterator aIter = m_vTableConnection.rbegin();
+ auto aIter = m_vTableConnection.rbegin();
while(aIter != m_vTableConnection.rend() && bRemove)
{
OTableConnection* pTabConn = (*aIter);
@@ -380,9 +396,9 @@ void OJoinTableView::RemoveTabWin( OTableWindow* pTabWin )
m_pLastFocusTabWin = NULL;
pTabWin->clearListBox();
- delete pTabWin;
-
+ pTabWin->disposeOnce();
}
+
if ( (sal_Int32)m_vTableConnection.size() < (nCount-1) ) // if some connections could be removed
modified();
}
@@ -814,8 +830,8 @@ void OJoinTableView::MouseButtonUp( const MouseEvent& rEvt )
{
DeselectConn(GetSelectedConn());
- ::std::vector<OTableConnection*>::iterator aIter = m_vTableConnection.begin();
- ::std::vector<OTableConnection*>::iterator aEnd = m_vTableConnection.end();
+ auto aIter = m_vTableConnection.begin();
+ auto aEnd = m_vTableConnection.end();
for(;aIter != aEnd;++aIter)
{
if( (*aIter)->CheckHit(rEvt.GetPosPixel()) )
@@ -927,20 +943,21 @@ void OJoinTableView::Paint( const Rectangle& rRect )
void OJoinTableView::InvalidateConnections()
{
// draw Joins
- ::std::for_each(m_vTableConnection.begin(),m_vTableConnection.end(),
- ::std::mem_fun(& OTableConnection::InvalidateConnection));
+ for(auto & conn : m_vTableConnection)
+ conn->InvalidateConnection();
}
void OJoinTableView::DrawConnections( const Rectangle& rRect )
{
// draw Joins
- ::std::for_each(m_vTableConnection.begin(),m_vTableConnection.end(),boost::bind( &OTableConnection::Draw, _1, boost::cref( rRect )));
+ for(auto conn : m_vTableConnection)
+ conn->Draw(rRect);
// finally redraw the selected one above all others
if (GetSelectedConn())
GetSelectedConn()->Draw( rRect );
}
-::std::vector<OTableConnection*>::const_iterator OJoinTableView::getTableConnections(const OTableWindow* _pFromWin) const
+::std::vector<VclPtr<OTableConnection> >::const_iterator OJoinTableView::getTableConnections(const OTableWindow* _pFromWin) const
{
return ::std::find_if( m_vTableConnection.begin(),
m_vTableConnection.end(),
@@ -966,8 +983,8 @@ void OJoinTableView::ClearAll()
HideTabWins();
// and the same with the Connections
- ::std::vector<OTableConnection*>::iterator aIter = m_vTableConnection.begin();
- ::std::vector<OTableConnection*>::iterator aEnd = m_vTableConnection.end();
+ auto aIter = m_vTableConnection.begin();
+ auto aEnd = m_vTableConnection.end();
for(;aIter != aEnd;++aIter)
RemoveConnection( *aIter ,true);
m_vTableConnection.clear();
@@ -983,7 +1000,7 @@ void OJoinTableView::ClearAll()
bool OJoinTableView::ScrollWhileDragging()
{
- OSL_ENSURE(m_pDragWin != NULL, "OJoinTableView::ScrollWhileDragging must not be called when a window is being dragged !");
+ OSL_ENSURE(m_pDragWin != nullptr, "OJoinTableView::ScrollWhileDragging must not be called when a window is being dragged !");
// kill the timer
if (m_aDragScrollIdle.IsActive())
@@ -1155,8 +1172,8 @@ void OJoinTableView::Command(const CommandEvent& rEvt)
DeselectConn(pSelConnection);
const Point& aMousePos = rEvt.GetMousePosPixel();
- ::std::vector<OTableConnection*>::iterator aIter = m_vTableConnection.begin();
- ::std::vector<OTableConnection*>::iterator aEnd = m_vTableConnection.end();
+ auto aIter = m_vTableConnection.begin();
+ auto aEnd = m_vTableConnection.end();
for(;aIter != aEnd;++aIter)
{
if( (*aIter)->CheckHit(aMousePos) )
@@ -1185,8 +1202,8 @@ OTableConnection* OJoinTableView::GetTabConn(const OTableWindow* pLhs,const OTab
{
bool bFoundStart = _rpFirstAfter == nullptr;
- ::std::vector<OTableConnection*>::const_iterator aIter = m_vTableConnection.begin();
- ::std::vector<OTableConnection*>::const_iterator aEnd = m_vTableConnection.end();
+ auto aIter = m_vTableConnection.begin();
+ auto aEnd = m_vTableConnection.end();
for(;aIter != aEnd;++aIter)
{
OTableConnection* pData = *aIter;
@@ -1318,12 +1335,12 @@ bool OJoinTableView::PreNotify(NotifyEvent& rNEvt)
{ // no active tab win -> travel the connections
// find the currently selected conn within the conn list
sal_Int32 i(0);
- for ( ::std::vector<OTableConnection*>::iterator connectionIter = m_vTableConnection.begin();
+ for ( auto connectionIter = m_vTableConnection.begin();
connectionIter != m_vTableConnection.end();
++connectionIter, ++i
)
{
- if ( (*connectionIter) == GetSelectedConn() )
+ if ( (*connectionIter).get() == GetSelectedConn() )
break;
}
if (i == sal_Int32(m_vTableConnection.size() - 1) && bForward)
@@ -1511,16 +1528,14 @@ void OJoinTableView::clearLayoutInformation()
{
if ( aIter->second )
aIter->second->clearListBox();
- boost::scoped_ptr<vcl::Window> aTemp(aIter->second);
aIter->second = NULL;
}
m_aTableMap.clear();
- ::std::vector<OTableConnection*>::const_iterator aIter2 = m_vTableConnection.begin();
- ::std::vector<OTableConnection*>::const_iterator aEnd2 = m_vTableConnection.end();
- for(;aIter2 != aEnd2;++aIter2)
- delete *aIter2;
+ for(auto i = m_vTableConnection.begin();
+ i != m_vTableConnection.end(); ++i)
+ i->disposeAndClear();
m_vTableConnection.clear();
}
diff --git a/dbaccess/source/ui/querydesign/LimitBox.cxx b/dbaccess/source/ui/querydesign/LimitBox.cxx
index 4f4175be859b..4cd42066f4a6 100644
--- a/dbaccess/source/ui/querydesign/LimitBox.cxx
+++ b/dbaccess/source/ui/querydesign/LimitBox.cxx
@@ -47,10 +47,6 @@ LimitBox::LimitBox( vcl::Window* pParent, WinBits nStyle )
SetSizePixel(aSize);
}
-LimitBox::~LimitBox()
-{
-}
-
OUString LimitBox::CreateFieldText( sal_Int64 nValue ) const
{
if( nValue == ALL_INT )
@@ -114,8 +110,7 @@ void LimitBox::LoadDefaultLimits()
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeLimitBox( vcl::Window *pParent, VclBuilder::stringmap & )
{
- LimitBox* pBox = new LimitBox( pParent, WB_DROPDOWN | WB_VSCROLL );
- return pBox;
+ return new LimitBox( pParent, WB_DROPDOWN | WB_VSCROLL );
}
diff --git a/dbaccess/source/ui/querydesign/QTableConnection.cxx b/dbaccess/source/ui/querydesign/QTableConnection.cxx
index 2789e7bc11aa..0f546066be32 100644
--- a/dbaccess/source/ui/querydesign/QTableConnection.cxx
+++ b/dbaccess/source/ui/querydesign/QTableConnection.cxx
@@ -37,10 +37,6 @@ OQueryTableConnection::OQueryTableConnection(const OQueryTableConnection& rConn)
// no own members, so base class functionality is sufficient
}
-OQueryTableConnection::~OQueryTableConnection()
-{
-}
-
OQueryTableConnection& OQueryTableConnection::operator=(const OQueryTableConnection& rConn)
{
if (&rConn == this)
diff --git a/dbaccess/source/ui/querydesign/QTableConnection.hxx b/dbaccess/source/ui/querydesign/QTableConnection.hxx
index 414b805346e3..33f492fcc03b 100644
--- a/dbaccess/source/ui/querydesign/QTableConnection.hxx
+++ b/dbaccess/source/ui/querydesign/QTableConnection.hxx
@@ -32,7 +32,6 @@ namespace dbaui
public:
OQueryTableConnection(OQueryTableView* pContainer, const TTableConnectionData::value_type& pTabConnData);
OQueryTableConnection(const OQueryTableConnection& rConn);
- virtual ~OQueryTableConnection();
OQueryTableConnection& operator=(const OQueryTableConnection& rConn);
bool operator==(const OQueryTableConnection& rCompare);
diff --git a/dbaccess/source/ui/querydesign/QTableWindow.cxx b/dbaccess/source/ui/querydesign/QTableWindow.cxx
index 6c3ab2d64d18..607552ff2389 100644
--- a/dbaccess/source/ui/querydesign/QTableWindow.cxx
+++ b/dbaccess/source/ui/querydesign/QTableWindow.cxx
@@ -66,10 +66,6 @@ OQueryTableWindow::OQueryTableWindow( vcl::Window* pParent, const TTableWindowDa
SetHelpId(HID_CTL_QRYDGNTAB);
}
-OQueryTableWindow::~OQueryTableWindow()
-{
-}
-
bool OQueryTableWindow::Init()
{
bool bSuccess = OTableWindow::Init();
@@ -102,8 +98,8 @@ bool OQueryTableWindow::Init()
SetAliasName(sAliasName);
// SetAliasName passes it as WinName, hence it uses the base class
// reset the title
- m_aTitle.SetText( pWinData->GetWinName() );
- m_aTitle.Show();
+ m_aTitle->SetText( pWinData->GetWinName() );
+ m_aTitle->Show();
getTableView()->getDesignView()->getController().InvalidateFeature(ID_BROWSER_QUERY_EXECUTE);
return bSuccess;
@@ -148,7 +144,7 @@ void OQueryTableWindow::OnEntryDoubleClicked(SvTreeListEntry* pEntry)
bool OQueryTableWindow::ExistsField(const OUString& strFieldName, OTableFieldDescRef& rInfo)
{
- OSL_ENSURE(m_pListBox != NULL, "OQueryTableWindow::ExistsField : doesn't have ::com::sun::star::form::ListBox !");
+ OSL_ENSURE(m_pListBox != nullptr, "OQueryTableWindow::ExistsField : doesn't have ::com::sun::star::form::ListBox !");
OSL_ENSURE(rInfo.is(),"OQueryTableWindow::ExistsField: invalid argument for OTableFieldDescRef!");
Reference< XConnection> xConnection = getTableView()->getDesignView()->getController().getConnection();
bool bExists = false;
diff --git a/dbaccess/source/ui/querydesign/QTableWindow.hxx b/dbaccess/source/ui/querydesign/QTableWindow.hxx
index 95c674107e77..8f64918b4eb5 100644
--- a/dbaccess/source/ui/querydesign/QTableWindow.hxx
+++ b/dbaccess/source/ui/querydesign/QTableWindow.hxx
@@ -32,7 +32,6 @@ namespace dbaui
OUString m_strInitialAlias;
public:
OQueryTableWindow( vcl::Window* pParent, const TTableWindowData::value_type& pTabWinData, sal_Unicode* pszInitialAlias = NULL );
- virtual ~OQueryTableWindow();
OUString GetAliasName() const
{
diff --git a/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx b/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx
index 61c7507d63f8..a009832b5624 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx
@@ -30,7 +30,7 @@ namespace dbaui
class OQueryDesignFieldUndoAct : public OCommentUndoAction
{
protected:
- OSelectionBrowseBox* pOwner;
+ VclPtr<OSelectionBrowseBox> pOwner;
sal_uInt16 m_nColumnPostion;
virtual void Undo() SAL_OVERRIDE = 0;
diff --git a/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx b/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx
index d74ce27e9fc7..9166a2e782c4 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx
@@ -20,6 +20,7 @@
#define INCLUDED_DBACCESS_SOURCE_UI_QUERYDESIGN_QUERYDESIGNUNDOACTION_HXX
#include "GeneralUndo.hxx"
+#include <vcl/vclptr.hxx>
namespace dbaui
{
@@ -28,7 +29,7 @@ namespace dbaui
class OQueryDesignUndoAction : public OCommentUndoAction
{
protected:
- OJoinTableView* m_pOwner; // in this container it all happens
+ VclPtr<OJoinTableView> m_pOwner; // in this container it all happens
public:
OQueryDesignUndoAction(OJoinTableView* pOwner, sal_uInt16 nCommentID) : OCommentUndoAction(nCommentID), m_pOwner(pOwner) { }
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index dba71c0e72cb..61039e895f6b 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -159,10 +159,10 @@ namespace
}
}
- OQueryTableConnection aInfo(pTableView, aInfoData);
+ ScopedVclPtrInstance< OQueryTableConnection > aInfo(pTableView, aInfoData);
// Because OQueryTableConnection never takes ownership of the data passed to it, but only remembers the pointer,
// this pointer to a local variable is not critical, as aInfoData and aInfo have the same lifetime
- pTableView->NotifyTabConnection( aInfo );
+ pTableView->NotifyTabConnection( *aInfo.get() );
}
else
{
@@ -509,12 +509,12 @@ namespace
pEntryConn->SetVisited(true);
// first search for the "to" window
- const ::std::vector<OTableConnection*>& rConnections = pEntryConn->GetParent()->getTableConnections();
- ::std::vector<OTableConnection*>::const_iterator aIter = rConnections.begin();
- ::std::vector<OTableConnection*>::const_iterator aEnd = rConnections.end();
+ const auto& rConnections = pEntryConn->GetParent()->getTableConnections();
+ auto aIter = rConnections.begin();
+ auto aEnd = rConnections.end();
for(;aIter != aEnd;++aIter)
{
- OQueryTableConnection* pNext = static_cast<OQueryTableConnection*>(*aIter);
+ OQueryTableConnection* pNext = static_cast<OQueryTableConnection*>((*aIter).get());
if(!pNext->IsVisited() && (pNext->GetSourceWin() == pEntryTabTo || pNext->GetDestWin() == pEntryTabTo))
{
OQueryTableWindow* pEntryTab = pNext->GetSourceWin() == pEntryTabTo ? static_cast<OQueryTableWindow*>(pNext->GetDestWin()) : static_cast<OQueryTableWindow*>(pNext->GetSourceWin());
@@ -532,7 +532,7 @@ namespace
aIter = rConnections.begin();
for(;aIter != aEnd;++aIter)
{
- OQueryTableConnection* pNext = static_cast<OQueryTableConnection*>(*aIter);
+ OQueryTableConnection* pNext = static_cast<OQueryTableConnection*>((*aIter).get());
if(!pNext->IsVisited() && (pNext->GetSourceWin() == pEntryTabFrom || pNext->GetDestWin() == pEntryTabFrom))
{
OQueryTableWindow* pEntryTab = pNext->GetSourceWin() == pEntryTabFrom ? static_cast<OQueryTableWindow*>(pNext->GetDestWin()) : static_cast<OQueryTableWindow*>(pNext->GetSourceWin());
@@ -666,7 +666,7 @@ namespace
bool bFound = false;
for(;!bFound && tableIter != tableEnd ;++tableIter)
{
- OQueryTableWindow* pTabWin = static_cast<OQueryTableWindow*>(tableIter->second);
+ OQueryTableWindow* pTabWin = static_cast<OQueryTableWindow*>(tableIter->second.get());
bFound = pTabWin->ExistsField( rFieldName, aInfo );
if ( bFound )
@@ -985,13 +985,13 @@ namespace
void GenerateInnerJoinCriterias(const Reference< XConnection>& _xConnection,
OUString& _rJoinCrit,
- const ::std::vector<OTableConnection*>* _pConnList)
+ const ::std::vector<VclPtr<OTableConnection> >& _rConnList)
{
- ::std::vector<OTableConnection*>::const_iterator aIter = _pConnList->begin();
- ::std::vector<OTableConnection*>::const_iterator aEnd = _pConnList->end();
+ auto aIter = _rConnList.begin();
+ auto aEnd = _rConnList.end();
for(;aIter != aEnd;++aIter)
{
- const OQueryTableConnection* pEntryConn = static_cast<const OQueryTableConnection*>(*aIter);
+ const OQueryTableConnection* pEntryConn = static_cast<const OQueryTableConnection*>((*aIter).get());
OQueryTableConnectionData* pEntryConnData = static_cast<OQueryTableConnectionData*>(pEntryConn->GetData().get());
if ( pEntryConnData->GetJoinType() == INNER_JOIN && !pEntryConnData->isNatural() )
{
@@ -1018,7 +1018,7 @@ namespace
}
OUString GenerateFromClause( const Reference< XConnection>& _xConnection,
const OQueryTableView::OTableWindowMap* pTabList,
- const ::std::vector<OTableConnection*>* pConnList
+ const ::std::vector<VclPtr<OTableConnection> >& rConnList
)
{
@@ -1027,14 +1027,14 @@ namespace
tableNames_t aTableNames;
// generate outer join clause in from
- if(!pConnList->empty())
+ if(!rConnList.empty())
{
- ::std::vector<OTableConnection*>::const_iterator aIter = pConnList->begin();
- ::std::vector<OTableConnection*>::const_iterator aEnd = pConnList->end();
+ auto aIter = rConnList.begin();
+ auto aEnd = rConnList.end();
::std::map<OTableWindow*,sal_Int32> aConnectionCount;
for(;aIter != aEnd;++aIter)
{
- static_cast<OQueryTableConnection*>(*aIter)->SetVisited(false);
+ static_cast<OQueryTableConnection*>((*aIter).get())->SetVisited(false);
++aConnectionCount[(*aIter)->GetSourceWin()];
++aConnectionCount[(*aIter)->GetDestWin()];
}
@@ -1051,10 +1051,10 @@ namespace
::std::multimap<sal_Int32 , OTableWindow*>::reverse_iterator aREnd = aMulti.rend();
for(;aRIter != aREnd;++aRIter)
{
- ::std::vector<OTableConnection*>::const_iterator aConIter = aRIter->second->getTableView()->getTableConnections(aRIter->second);
+ auto aConIter = aRIter->second->getTableView()->getTableConnections(aRIter->second);
for(;aConIter != aEnd;++aConIter)
{
- OQueryTableConnection* pEntryConn = static_cast<OQueryTableConnection*>(*aConIter);
+ OQueryTableConnection* pEntryConn = static_cast<OQueryTableConnection*>((*aConIter).get());
if(!pEntryConn->IsVisited() && pEntryConn->GetSourceWin() == aRIter->second )
{
OUString aJoin;
@@ -1097,10 +1097,10 @@ namespace
// "FROM tbl1, tbl2 WHERE tbl1.col1=tlb2.col2"
// rather than
// "FROM tbl1 INNER JOIN tbl2 ON tbl1.col1=tlb2.col2"
- aIter = pConnList->begin();
+ aIter = rConnList.begin();
for(;aIter != aEnd;++aIter)
{
- OQueryTableConnection* pEntryConn = static_cast<OQueryTableConnection*>(*aIter);
+ OQueryTableConnection* pEntryConn = static_cast<OQueryTableConnection*>((*aIter).get());
if(!pEntryConn->IsVisited())
{
searchAndAppendName(_xConnection,
@@ -1120,7 +1120,7 @@ namespace
OQueryTableView::OTableWindowMap::const_iterator aTabEnd = pTabList->end();
for(;aTabIter != aTabEnd;++aTabIter)
{
- const OQueryTableWindow* pEntryTab = static_cast<const OQueryTableWindow*>(aTabIter->second);
+ const OQueryTableWindow* pEntryTab = static_cast<const OQueryTableWindow*>(aTabIter->second.get());
if(!pEntryTab->ExistsAConn())
{
aTableListStr += BuildTable(_xConnection,pEntryTab);
@@ -1541,7 +1541,7 @@ namespace
OJoinTableView::OTableWindowMap::iterator aTabEnd = rTabList.end();
for(;aIter != aTabEnd;++aIter)
{
- OQueryTableWindow* pTabWin = static_cast<OQueryTableWindow*>(aIter->second);
+ OQueryTableWindow* pTabWin = static_cast<OQueryTableWindow*>(aIter->second.get());
if (pTabWin->ExistsField( OUString("*"), aDragLeft ))
{
aDragLeft->SetAlias(OUString());
@@ -1749,7 +1749,7 @@ namespace
OJoinTableView::OTableWindowMap::const_iterator aEnd = _rTabList.end();
for ( ; aIter != aEnd; ++aIter )
{
- OQueryTableWindow* pTabWin = static_cast< OQueryTableWindow* >( aIter->second );
+ OQueryTableWindow* pTabWin = static_cast< OQueryTableWindow* >( aIter->second.get() );
if ( pTabWin && pTabWin->ExistsField( _rColumName, _rInfo ) )
return pTabWin;
}
@@ -2105,7 +2105,7 @@ namespace
OJoinTableView::OTableWindowMap::iterator aEnd = _pTabList->end();
for(;aIter != aEnd && eOk == eErrorCode ;++aIter)
{
- OQueryTableWindow* pTabWin = static_cast<OQueryTableWindow*>(aIter->second);
+ OQueryTableWindow* pTabWin = static_cast<OQueryTableWindow*>(aIter->second.get());
OTableFieldDescRef aInfo = new OTableFieldDesc();
if (pTabWin->ExistsField( sAsterisk, aInfo ))
{
@@ -2202,7 +2202,7 @@ namespace
const OJoinTableView::OTableWindowMap::const_iterator aEnd = pTabList->end();
for(;aIter != aEnd;++aIter)
{
- OQueryTableWindow* pTabWin = static_cast<OQueryTableWindow*>(aIter->second);
+ OQueryTableWindow* pTabWin = static_cast<OQueryTableWindow*>(aIter->second.get());
if (pTabWin->ExistsField( OUString("*"), aInfo ))
{
aInfo->SetAlias(OUString());
@@ -2491,7 +2491,7 @@ OQueryDesignView::OQueryDesignView( OQueryContainerWindow* _pParent,
OQueryController& _rController,
const Reference< XComponentContext >& _rxContext)
:OQueryView( _pParent, _rController, _rxContext )
- ,m_aSplitter( this )
+ ,m_aSplitter( VclPtr<Splitter>::Create(this) )
,m_eChildFocus(NONE)
,m_bInSplitHandler( false )
{
@@ -2506,23 +2506,28 @@ OQueryDesignView::OQueryDesignView( OQueryContainerWindow* _pParent,
{
}
- m_pSelectionBox = new OSelectionBrowseBox(this);
+ m_pSelectionBox = VclPtr<OSelectionBrowseBox>::Create(this);
setNoneVisbleRow(static_cast<OQueryController&>(getController()).getVisibleRows());
m_pSelectionBox->Show();
// setup Splitter
- m_aSplitter.SetSplitHdl(LINK(this, OQueryDesignView,SplitHdl));
- m_aSplitter.Show();
+ m_aSplitter->SetSplitHdl(LINK(this, OQueryDesignView,SplitHdl));
+ m_aSplitter->Show();
}
OQueryDesignView::~OQueryDesignView()
{
+ disposeOnce();
+}
+
+void OQueryDesignView::dispose()
+{
if ( m_pTableView )
::dbaui::notifySystemWindow(this,m_pTableView,::comphelper::mem_fun(&TaskPaneList::RemoveWindow));
- boost::scoped_ptr<vcl::Window> aTemp(m_pSelectionBox);
- m_pSelectionBox = NULL;
-
+ m_pSelectionBox.disposeAndClear();
+ m_aSplitter.disposeAndClear();
+ OQueryView::dispose();
}
IMPL_LINK( OQueryDesignView, SplitHdl, void*, /*p*/ )
@@ -2530,8 +2535,8 @@ IMPL_LINK( OQueryDesignView, SplitHdl, void*, /*p*/ )
if (!getController().isReadOnly())
{
m_bInSplitHandler = true;
- m_aSplitter.SetPosPixel( Point( m_aSplitter.GetPosPixel().X(),m_aSplitter.GetSplitPosPixel() ) );
- static_cast<OQueryController&>(getController()).setSplitPos(m_aSplitter.GetSplitPosPixel());
+ m_aSplitter->SetPosPixel( Point( m_aSplitter->GetPosPixel().X(),m_aSplitter->GetSplitPosPixel() ) );
+ static_cast<OQueryController&>(getController()).setSplitPos(m_aSplitter->GetSplitPosPixel());
static_cast<OQueryController&>(getController()).setModified( sal_True );
Resize();
m_bInSplitHandler = true;
@@ -2541,7 +2546,7 @@ IMPL_LINK( OQueryDesignView, SplitHdl, void*, /*p*/ )
void OQueryDesignView::Construct()
{
- m_pTableView = new OQueryTableView(m_pScrollWindow,this);
+ m_pTableView = VclPtr<OQueryTableView>::Create(m_pScrollWindow,this);
::dbaui::notifySystemWindow(this,m_pTableView,::comphelper::mem_fun(&TaskPaneList::AddWindow));
OQueryView::Construct();
}
@@ -2550,8 +2555,8 @@ void OQueryDesignView::initialize()
{
if(static_cast<OQueryController&>(getController()).getSplitPos() != -1)
{
- m_aSplitter.SetPosPixel( Point( m_aSplitter.GetPosPixel().X(),static_cast<OQueryController&>(getController()).getSplitPos() ) );
- m_aSplitter.SetSplitPosPixel(static_cast<OQueryController&>(getController()).getSplitPos());
+ m_aSplitter->SetPosPixel( Point( m_aSplitter->GetPosPixel().X(),static_cast<OQueryController&>(getController()).getSplitPos() ) );
+ m_aSplitter->SetSplitPosPixel(static_cast<OQueryController&>(getController()).getSplitPos());
}
m_pSelectionBox->initialize();
reset();
@@ -2572,7 +2577,7 @@ void OQueryDesignView::resizeDocumentView(Rectangle& _rPlayground)
{
// let the selection browse box determine an optimal size
Size aSelectionBoxSize = m_pSelectionBox->CalcOptimalSize( aPlaygroundSize );
- nSplitPos = aPlaygroundSize.Height() - aSelectionBoxSize.Height() - m_aSplitter.GetSizePixel().Height();
+ nSplitPos = aPlaygroundSize.Height() - aSelectionBoxSize.Height() - m_aSplitter->GetSizePixel().Height();
// still an invalid size?
if ( nSplitPos == -1 || nSplitPos >= aPlaygroundSize.Height() )
nSplitPos = sal_Int32(aPlaygroundSize.Height()*0.6);
@@ -2587,13 +2592,13 @@ void OQueryDesignView::resizeDocumentView(Rectangle& _rPlayground)
if ( aSelBoxSize.Height() )
{
// keep the size of the sel box constant
- nSplitPos = aPlaygroundSize.Height() - m_aSplitter.GetSizePixel().Height() - aSelBoxSize.Height();
+ nSplitPos = aPlaygroundSize.Height() - m_aSplitter->GetSizePixel().Height() - aSelBoxSize.Height();
// and if the box is smaller than the optimal size, try to do something about it
Size aSelBoxOptSize = m_pSelectionBox->CalcOptimalSize( aPlaygroundSize );
if ( aSelBoxOptSize.Height() > aSelBoxSize.Height() )
{
- nSplitPos = aPlaygroundSize.Height() - m_aSplitter.GetSizePixel().Height() - aSelBoxOptSize.Height();
+ nSplitPos = aPlaygroundSize.Height() - m_aSplitter->GetSizePixel().Height() - aSelBoxOptSize.Height();
}
static_cast< OQueryController& >(getController()).setSplitPos( nSplitPos );
@@ -2603,7 +2608,7 @@ void OQueryDesignView::resizeDocumentView(Rectangle& _rPlayground)
// normalize the split pos
Point aSplitPos = Point( _rPlayground.Left(), nSplitPos );
- Size aSplitSize = Size( _rPlayground.GetSize().Width(), m_aSplitter.GetSizePixel().Height() );
+ Size aSplitSize = Size( _rPlayground.GetSize().Width(), m_aSplitter->GetSizePixel().Height() );
if( ( aSplitPos.Y() + aSplitSize.Height() ) > ( aPlaygroundSize.Height() ))
aSplitPos.Y() = aPlaygroundSize.Height() - aSplitSize.Height();
@@ -2620,8 +2625,8 @@ void OQueryDesignView::resizeDocumentView(Rectangle& _rPlayground)
m_pSelectionBox->SetPosSizePixel( aPos, Size( aPlaygroundSize.Width(), aPlaygroundSize.Height() - aSplitSize.Height() - aTableViewSize.Height() ));
// set the size of the splitter
- m_aSplitter.SetPosSizePixel( aSplitPos, aSplitSize );
- m_aSplitter.SetDragRectPixel( _rPlayground );
+ m_aSplitter->SetPosSizePixel( aSplitPos, aSplitSize );
+ m_aSplitter->SetDragRectPixel( _rPlayground );
// just for completeness: there is no space left, we occupied it all ...
_rPlayground.SetPos( _rPlayground.BottomRight() );
@@ -2746,7 +2751,7 @@ void OQueryDesignView::fillValidFields(const OUString& sAliasName, ComboBox* pFi
OJoinTableView::OTableWindowMap::iterator aEnd = rTabWins.end();
for(;aIter != aEnd;++aIter)
{
- OQueryTableWindow* pCurrentWin = static_cast<OQueryTableWindow*>(aIter->second);
+ OQueryTableWindow* pCurrentWin = static_cast<OQueryTableWindow*>(aIter->second.get());
if (bAllTables || (pCurrentWin->GetAliasName() == sAliasName))
{
strCurrentPrefix = pCurrentWin->GetAliasName();
@@ -2846,9 +2851,9 @@ OUString OQueryDesignView::getStatement()
// and trigger a error message
// ----------------- Build table list ----------------------
- const ::std::vector<OTableConnection*>& rConnList = m_pTableView->getTableConnections();
+ const auto& rConnList = m_pTableView->getTableConnections();
Reference< XConnection> xConnection = rController.getConnection();
- OUString aTableListStr(GenerateFromClause(xConnection,&rTabList,&rConnList));
+ OUString aTableListStr(GenerateFromClause(xConnection,&rTabList,rConnList));
OSL_ENSURE(!aTableListStr.isEmpty(), "OQueryDesignView::getStatement() : unexpected : have Fields, but no Tables !");
// if fields exist now, these only can be created by inserting from an already existing table; if on the other hand
// a table is deleted, also the belonging fields will be deleted -> therefore it CANNOT occur that fields
@@ -2860,7 +2865,7 @@ OUString OQueryDesignView::getStatement()
return OUString();
OUString aJoinCrit;
- GenerateInnerJoinCriterias(xConnection,aJoinCrit,&rConnList);
+ GenerateInnerJoinCriterias(xConnection,aJoinCrit,rConnList);
if(!aJoinCrit.isEmpty())
{
OUString aTmp = "( " + aJoinCrit + " )";
@@ -2994,8 +2999,8 @@ void OQueryDesignView::SaveUIConfig()
OQueryController& rCtrl = static_cast<OQueryController&>(getController());
rCtrl.SaveTabWinsPosSize( &m_pTableView->GetTabWinMap(), m_pScrollWindow->GetHScrollBar().GetThumbPos(), m_pScrollWindow->GetVScrollBar().GetThumbPos() );
rCtrl.setVisibleRows( m_pSelectionBox->GetNoneVisibleRows() );
- if ( m_aSplitter.GetSplitPosPixel() != 0 )
- rCtrl.setSplitPos( m_aSplitter.GetSplitPosPixel() );
+ if ( m_aSplitter->GetSplitPosPixel() != 0 )
+ rCtrl.setSplitPos( m_aSplitter->GetSplitPosPixel() );
}
OSQLParseNode* OQueryDesignView::getPredicateTreeFromEntry(OTableFieldDescRef pEntry,
diff --git a/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.hxx b/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.hxx
index 49060c1bc08e..b8c9f52ad0c1 100644
--- a/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.hxx
+++ b/dbaccess/source/ui/querydesign/QueryMoveTabWinUndoAct.hxx
@@ -31,7 +31,7 @@ namespace dbaui
class OJoinMoveTabWinUndoAct : public OQueryDesignUndoAction
{
Point m_ptNextPosition;
- OTableWindow* m_pTabWin;
+ VclPtr<OTableWindow> m_pTabWin;
protected:
void TogglePosition();
diff --git a/dbaccess/source/ui/querydesign/QuerySizeTabWinUndoAct.hxx b/dbaccess/source/ui/querydesign/QuerySizeTabWinUndoAct.hxx
index 4de742deb1d4..bd9381468ca0 100644
--- a/dbaccess/source/ui/querydesign/QuerySizeTabWinUndoAct.hxx
+++ b/dbaccess/source/ui/querydesign/QuerySizeTabWinUndoAct.hxx
@@ -31,7 +31,7 @@ namespace dbaui
{
Point m_ptNextPosition;
Size m_szNextSize;
- OTableWindow* m_pTabWin;
+ VclPtr<OTableWindow> m_pTabWin;
protected:
inline void ToggleSizePosition();
diff --git a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx
index 16f8e0e4b7cd..02c59c3cb998 100644
--- a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx
@@ -19,6 +19,7 @@
#include "QueryTabConnUndoAction.hxx"
#include "QTableConnection.hxx"
+#include "QTableWindow.hxx"
#include <tools/debug.hxx>
#include "QueryTableView.hxx"
#include "QueryAddTabConnUndoAction.hxx"
@@ -32,7 +33,7 @@ OQueryTabConnUndoAction::~OQueryTabConnUndoAction()
if (m_bOwnerOfConn)
{ // I have the connection -> delete
m_pOwner->DeselectConn(m_pConnection);
- delete m_pConnection;
+ m_pConnection.disposeAndClear();
}
}
@@ -50,13 +51,13 @@ OQueryAddTabConnUndoAction::OQueryAddTabConnUndoAction(OQueryTableView* pOwner)
void OQueryAddTabConnUndoAction::Undo()
{
- static_cast<OQueryTableView*>(m_pOwner)->DropConnection(m_pConnection);
+ static_cast<OQueryTableView*>(m_pOwner.get())->DropConnection(m_pConnection);
SetOwnership(true);
}
void OQueryAddTabConnUndoAction::Redo()
{
- static_cast<OQueryTableView*>(m_pOwner)->GetConnection(m_pConnection);
+ static_cast<OQueryTableView*>(m_pOwner.get())->GetConnection(m_pConnection);
SetOwnership(false);
}
@@ -67,13 +68,13 @@ OQueryDelTabConnUndoAction::OQueryDelTabConnUndoAction(OQueryTableView* pOwner)
void OQueryDelTabConnUndoAction::Undo()
{
- static_cast<OQueryTableView*>(m_pOwner)->GetConnection(m_pConnection);
+ static_cast<OQueryTableView*>(m_pOwner.get())->GetConnection(m_pConnection);
SetOwnership(false);
}
void OQueryDelTabConnUndoAction::Redo()
{
- static_cast<OQueryTableView*>(m_pOwner)->DropConnection(m_pConnection);
+ static_cast<OQueryTableView*>(m_pOwner.get())->DropConnection(m_pConnection);
SetOwnership(true);
}
@@ -88,13 +89,13 @@ OQueryTabWinShowUndoAct::~OQueryTabWinShowUndoAct()
void OQueryTabWinShowUndoAct::Undo()
{
- static_cast<OQueryTableView*>(m_pOwner)->HideTabWin(m_pTabWin, this);
+ static_cast<OQueryTableView*>(m_pOwner.get())->HideTabWin(m_pTabWin, this);
SetOwnership(true);
}
void OQueryTabWinShowUndoAct::Redo()
{
- static_cast<OQueryTableView*>(m_pOwner)->ShowTabWin(m_pTabWin, this,true);
+ static_cast<OQueryTableView*>(m_pOwner.get())->ShowTabWin(m_pTabWin, this,true);
SetOwnership(false);
}
@@ -109,13 +110,13 @@ OQueryTabWinDelUndoAct::~OQueryTabWinDelUndoAct()
void OQueryTabWinDelUndoAct::Undo()
{
- static_cast<OQueryTableView*>(m_pOwner)->ShowTabWin( m_pTabWin, this,true );
+ static_cast<OQueryTableView*>(m_pOwner.get())->ShowTabWin( m_pTabWin, this,true );
SetOwnership(false);
}
void OQueryTabWinDelUndoAct::Redo()
{
- static_cast<OQueryTableView*>(m_pOwner)->HideTabWin( m_pTabWin, this );
+ static_cast<OQueryTableView*>(m_pOwner.get())->HideTabWin( m_pTabWin, this );
SetOwnership(true);
}
diff --git a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.hxx b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.hxx
index 72b31532213d..6541a4ed5b42 100644
--- a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.hxx
+++ b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.hxx
@@ -28,7 +28,7 @@ namespace dbaui
class OQueryTabConnUndoAction : public OQueryDesignUndoAction
{
protected:
- OQueryTableConnection* m_pConnection;
+ VclPtr<OQueryTableConnection> m_pConnection;
bool m_bOwnerOfConn;
// am I the only owner of the connection? (changes with every redo and undo)
diff --git a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx
index f7bee57ce37a..d898780b9d48 100644
--- a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx
@@ -51,20 +51,20 @@ OQueryTabWinUndoAct::~OQueryTabWinUndoAct()
if (m_bOwnerOfObjects)
{
// I should take care to delete the window if I am the only owner
- OSL_ENSURE(m_pTabWin != NULL, "OQueryTabWinUndoAct::~OQueryTabWinUndoAct() : m_pTabWin sollte nicht NULL sein");
+ OSL_ENSURE(m_pTabWin != nullptr, "OQueryTabWinUndoAct::~OQueryTabWinUndoAct() : m_pTabWin sollte nicht NULL sein");
OSL_ENSURE(!m_pTabWin->IsVisible(), "OQueryTabWinUndoAct::~OQueryTabWinUndoAct() : *m_pTabWin sollte nicht sichtbar sein");
if ( m_pTabWin )
m_pTabWin->clearListBox();
- delete m_pTabWin;
+ m_pTabWin.disposeAndClear();
// and of course the corresponding connections
- ::std::vector<OTableConnection*>::iterator aIter = m_vTableConnection.begin();
- ::std::vector<OTableConnection*>::iterator aEnd = m_vTableConnection.end();
+ auto aIter = m_vTableConnection.begin();
+ auto aEnd = m_vTableConnection.end();
for(;aIter != aEnd;++aIter)
{
m_pOwner->DeselectConn(*aIter);
- delete (*aIter);
+ aIter->disposeAndClear();
}
m_vTableConnection.clear();
}
diff --git a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx
index 22c9921330a6..af22a64063d2 100644
--- a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx
+++ b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx
@@ -33,8 +33,8 @@ namespace dbaui
class OQueryTabWinUndoAct : public OQueryDesignUndoAction
{
protected:
- ::std::vector<OTableConnection*> m_vTableConnection;
- OQueryTableWindow* m_pTabWin;
+ ::std::vector<VclPtr<OTableConnection> > m_vTableConnection;
+ VclPtr<OQueryTableWindow> m_pTabWin;
bool m_bOwnerOfObjects;
// am I the only owner of the managed objects? (changes with every redo or undo)
@@ -54,7 +54,7 @@ namespace dbaui
// access to the managed connections
sal_uInt16 ConnCount() { return (sal_uInt16)m_vTableConnection.size(); }
- ::std::vector<OTableConnection*>& GetTabConnList() { return m_vTableConnection; }
+ ::std::vector<VclPtr<OTableConnection> >& GetTabConnList() { return m_vTableConnection; }
void InsertConnection( OTableConnection* pConnection ) { m_vTableConnection.push_back(pConnection); }
void RemoveConnection( OTableConnection* pConnection )
diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx
index e3e92e2c3637..b39bf31e0cf0 100644
--- a/dbaccess/source/ui/querydesign/QueryTableView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx
@@ -118,11 +118,11 @@ namespace
{
OQueryTableConnectionData* pData = static_cast< OQueryTableConnectionData*>(_pConnectionData.get());
- DlgQryJoin aDlg(_pView,_pConnectionData,&_pView->GetTabWinMap(),_pView->getDesignView()->getController().getConnection(),_bSelectableTables);
- bool bOk = aDlg.Execute() == RET_OK;
+ ScopedVclPtrInstance< DlgQryJoin > aDlg(_pView,_pConnectionData,&_pView->GetTabWinMap(),_pView->getDesignView()->getController().getConnection(),_bSelectableTables);
+ bool bOk = aDlg->Execute() == RET_OK;
if( bOk )
{
- pData->SetJoinType(aDlg.GetJoinType());
+ pData->SetJoinType(aDlg->GetJoinType());
_pView->getDesignView()->getController().setModified(sal_True);
}
@@ -208,10 +208,10 @@ namespace
pNewConnData->AppendConnLine(*pIter,sRelatedColumn);
// now add the Conn itself
- OQueryTableConnection aNewConn(_pView, aNewConnData);
+ ScopedVclPtrInstance< OQueryTableConnection > aNewConn(_pView, aNewConnData);
// referring to the local variable is not important, as NotifyQueryTabConn creates a new copy
// to add me (if not existent)
- _pView->NotifyTabConnection(aNewConn, false);
+ _pView->NotifyTabConnection(*aNewConn.get(), false);
// don't create an Undo-Action for the new connection : the connection is
// covered by the Undo-Action for the tabwin, as the "Undo the insert" will
// automatically remove all connections adjacent to the win.
@@ -228,10 +228,6 @@ OQueryTableView::OQueryTableView( vcl::Window* pParent,OQueryDesignView* pView)
SetHelpId(HID_CTL_QRYDGNTAB);
}
-OQueryTableView::~OQueryTableView()
-{
-}
-
sal_Int32 OQueryTableView::CountTableAlias(const OUString& rName, sal_Int32& rMax)
{
sal_Int32 nRet = 0;
@@ -263,7 +259,7 @@ void OQueryTableView::ReSync()
for(;aIter != rTabWinDataList.rend();++aIter)
{
OQueryTableWindowData* pData = static_cast<OQueryTableWindowData*>(aIter->get());
- OTableWindow* pTabWin = createWindow(*aIter);
+ VclPtr<OTableWindow> pTabWin = createWindow(*aIter);
// I dont't use ShowTabWin as this adds the window data to the list of documents.
// This would be bad as I am getting them from there.
@@ -273,7 +269,7 @@ void OQueryTableView::ReSync()
// The initialisation has gone wrong, this TabWin is not available, so
// I must clean up the data and the document
pTabWin->clearListBox();
- delete pTabWin;
+ pTabWin.disposeAndClear();
arrInvalidTables.push_back(pData->GetAliasName());
rTabWinDataList.erase( ::std::remove(rTabWinDataList.begin(), rTabWinDataList.end(), *aIter), rTabWinDataList.end());
@@ -310,7 +306,7 @@ void OQueryTableView::ReSync()
}
// adds a new connection to join view and notifies our accessible and invaldates the controller
- addConnection(new OQueryTableConnection(this, *aConIter));
+ addConnection(VclPtr<OQueryTableConnection>::Create(this, *aConIter));
}
}
@@ -322,35 +318,35 @@ void OQueryTableView::ClearAll()
m_pView->getController().setModified(sal_True);
}
-OTableWindow* OQueryTableView::createWindow(const TTableWindowData::value_type& _pData)
+VclPtr<OTableWindow> OQueryTableView::createWindow(const TTableWindowData::value_type& _pData)
{
- return new OQueryTableWindow(this,_pData);
+ return VclPtr<OQueryTableWindow>::Create(this,_pData);
}
void OQueryTableView::NotifyTabConnection(const OQueryTableConnection& rNewConn, bool _bCreateUndoAction)
{
// let's first check if I have the connection already
OQueryTableConnection* pTabConn = NULL;
- const ::std::vector<OTableConnection*>& rConnections = getTableConnections();
- ::std::vector<OTableConnection*>::const_iterator aEnd = rConnections.end();
- ::std::vector<OTableConnection*>::const_iterator aIter = ::std::find( rConnections.begin(),
- aEnd,
- static_cast<const OTableConnection*>(&rNewConn)
- );
+ const auto& rConnections = getTableConnections();
+ auto aEnd = rConnections.end();
+ auto aIter = ::std::find( rConnections.begin(),
+ aEnd,
+ VclPtr<OTableConnection>(const_cast<OTableConnection*>(static_cast<const OTableConnection*>(&rNewConn)))
+ );
if(aIter == aEnd )
{
aIter = rConnections.begin();
for(;aIter != aEnd;++aIter)
{
- if(*static_cast<OQueryTableConnection*>(*aIter) == rNewConn)
+ if(*static_cast<OQueryTableConnection*>((*aIter).get()) == rNewConn)
{
- pTabConn = static_cast<OQueryTableConnection*>(*aIter);
+ pTabConn = static_cast<OQueryTableConnection*>((*aIter).get());
break;
}
}
}
else
- pTabConn = static_cast<OQueryTableConnection*>(*aIter);
+ pTabConn = static_cast<OQueryTableConnection*>((*aIter).get());
// no -> insert
if (pTabConn == NULL)
@@ -359,7 +355,7 @@ void OQueryTableView::NotifyTabConnection(const OQueryTableConnection& rNewConn,
OQueryTableConnectionData* pNewData = static_cast< OQueryTableConnectionData*>(rNewConn.GetData()->NewInstance());
pNewData->CopyFrom(*rNewConn.GetData());
TTableConnectionData::value_type aData(pNewData);
- OQueryTableConnection* pNewConn = new OQueryTableConnection(this, aData);
+ VclPtrInstance<OQueryTableConnection> pNewConn(this, aData);
GetConnection(pNewConn);
connectionModified(this,pNewConn,_bCreateUndoAction);
@@ -461,7 +457,7 @@ void OQueryTableView::AddTabWin(const OUString& _rComposedName, const OUString&
// I do not need to add TabWinData to the DocShell list, ShowTabWin does that.
// Create a new window
- OQueryTableWindow* pNewTabWin = static_cast<OQueryTableWindow*>(createWindow(pNewTabWinData));
+ VclPtr<OQueryTableWindow> pNewTabWin = static_cast<OQueryTableWindow*>(createWindow(pNewTabWinData).get());
// No need to initialize, as that happens in ShowTabWin
// New UndoAction
@@ -529,14 +525,14 @@ void OQueryTableView::AddTabWin(const OUString& _rComposedName, const OUString&
{
for(aIter = rTabWins.begin();aIter != aEnd;++aIter)
{
- OQueryTableWindow* pTabWinTmp = static_cast<OQueryTableWindow*>(aIter->second);
+ OQueryTableWindow* pTabWinTmp = static_cast<OQueryTableWindow*>(aIter->second.get());
OSL_ENSURE( pTabWinTmp,"TableWindow is null!" );
if ( pTabWinTmp != pNewTabWin && pTabWinTmp->GetComposedName() == aReferencedTable )
break;
}
}
- if ( aIter != aEnd && pNewTabWin != aIter->second )
- addConnections( this, *pNewTabWin, *static_cast<OQueryTableWindow*>(aIter->second), xFKeyColumns );
+ if ( aIter != aEnd && pNewTabWin.get() != aIter->second.get() )
+ addConnections( this, *pNewTabWin, *static_cast<OQueryTableWindow*>(aIter->second.get()), xFKeyColumns );
}
break;
@@ -547,7 +543,7 @@ void OQueryTableView::AddTabWin(const OUString& _rComposedName, const OUString&
OTableWindowMap::const_iterator aEnd = rTabWins.end();
for(;aIter != aEnd;++aIter)
{
- OQueryTableWindow* pTabWinTmp = static_cast<OQueryTableWindow*>(aIter->second);
+ OQueryTableWindow* pTabWinTmp = static_cast<OQueryTableWindow*>(aIter->second.get());
if ( pTabWinTmp == pNewTabWin )
continue;
@@ -625,8 +621,8 @@ void OQueryTableView::AddConnection(const OJoinExchangeData& jxdSource, const OJ
pNewConnectionData->AppendConnLine( aSourceFieldName,aDestFieldName );
- OQueryTableConnection aNewConnection(this, aNewConnectionData);
- NotifyTabConnection(aNewConnection);
+ ScopedVclPtrInstance< OQueryTableConnection > aNewConnection(this, aNewConnectionData);
+ NotifyTabConnection(*aNewConnection.get());
// As usual with NotifyTabConnection, using a local variable is fine because a copy is made
}
else
@@ -660,8 +656,8 @@ void OQueryTableView::createNewConnection()
if( openJoinDialog(this,pData,true) )
{
OTableWindowMap& rMap = GetTabWinMap();
- OQueryTableWindow* pSourceWin = static_cast< OQueryTableWindow*>(rMap[pData->getReferencingTable()->GetWinName()]);
- OQueryTableWindow* pDestWin = static_cast< OQueryTableWindow*>(rMap[pData->getReferencedTable()->GetWinName()]);
+ OQueryTableWindow* pSourceWin = static_cast< OQueryTableWindow*>(rMap[pData->getReferencingTable()->GetWinName()].get());
+ OQueryTableWindow* pDestWin = static_cast< OQueryTableWindow*>(rMap[pData->getReferencedTable()->GetWinName()].get());
// first we have to look if the this connection already exists
OTableConnection* pConn = GetTabConn(pSourceWin,pDestWin,true);
bool bNew = true;
@@ -673,7 +669,7 @@ void OQueryTableView::createNewConnection()
else
{
// create a new conenction and append it
- OQueryTableConnection* pQConn = new OQueryTableConnection(this, pData);
+ VclPtrInstance<OQueryTableConnection> pQConn(this, pData);
GetConnection(pQConn);
pConn = pQConn;
}
@@ -708,7 +704,7 @@ OQueryTableWindow* OQueryTableView::FindTable(const OUString& rAliasName)
// (it is harmless but does not make sense and indicates that there is probably an error in the caller)
OTableWindowMap::const_iterator aIter = GetTabWinMap().find(rAliasName);
if(aIter != GetTabWinMap().end())
- return static_cast<OQueryTableWindow*>(aIter->second);
+ return static_cast<OQueryTableWindow*>(aIter->second.get());
return NULL;
}
@@ -719,7 +715,7 @@ bool OQueryTableView::FindTableFromField(const OUString& rFieldName, OTableField
OTableWindowMap::const_iterator aEnd = GetTabWinMap().end();
for(;aIter != aEnd;++aIter)
{
- if(static_cast<OQueryTableWindow*>(aIter->second)->ExistsField(rFieldName, rInfo))
+ if(static_cast<OQueryTableWindow*>(aIter->second.get())->ExistsField(rFieldName, rInfo))
++rCnt;
}
@@ -838,11 +834,11 @@ void OQueryTableView::HideTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUndoAc
// collect connections belonging to the window and pass to UndoAction
sal_Int16 nCnt = 0;
- const ::std::vector<OTableConnection*>& rTabConList = getTableConnections();
- ::std::vector<OTableConnection*>::const_iterator aIter2 = rTabConList.begin();
+ const auto& rTabConList = getTableConnections();
+ auto aIter2 = rTabConList.begin();
for(;aIter2 != rTabConList.end();)// the end may change
{
- OQueryTableConnection* pTmpEntry = static_cast<OQueryTableConnection*>(*aIter2);
+ OQueryTableConnection* pTmpEntry = static_cast<OQueryTableConnection*>((*aIter2).get());
OSL_ENSURE(pTmpEntry,"OQueryTableConnection is null!");
if( pTmpEntry->GetAliasName(JTCS_FROM) == pTabWin->GetAliasName() ||
pTmpEntry->GetAliasName(JTCS_TO) == pTabWin->GetAliasName() )
@@ -908,12 +904,9 @@ bool OQueryTableView::ShowTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUndoAc
// GetEntryPos, and then in turn by the Connection, when its starting point to the window must be determined.
// the Connections
- ::std::vector<OTableConnection*>& rTableCon = pUndoAction->GetTabConnList();
- ::std::vector<OTableConnection*>::iterator aIter = rTableCon.begin();
- ::std::vector<OTableConnection*>::iterator aEnd = rTableCon.end();
-
- for(;aIter != aEnd;++aIter)
- addConnection(*aIter); // add all connections from the undo action
+ auto rTableCon = pUndoAction->GetTabConnList();
+ for(auto conn : rTableCon)
+ addConnection(conn); // add all connections from the undo action
rTableCon.clear();
@@ -933,7 +926,7 @@ bool OQueryTableView::ShowTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUndoAc
// Initialisation failed
// (for example when the Connection to the database is not available at the moment)
pTabWin->clearListBox();
- delete pTabWin;
+ pTabWin->disposeOnce();
}
}
@@ -954,12 +947,9 @@ void OQueryTableView::InsertField(const OTableFieldDescRef& rInfo)
bool OQueryTableView::ExistsAVisitedConn(const OQueryTableWindow* pFrom) const
{
- const ::std::vector<OTableConnection*>& rList = getTableConnections();
- ::std::vector<OTableConnection*>::const_iterator aIter = rList.begin();
- ::std::vector<OTableConnection*>::const_iterator aEnd = rList.end();
- for(;aIter != aEnd;++aIter)
+ for(auto conn : getTableConnections())
{
- OQueryTableConnection* pTemp = static_cast<OQueryTableConnection*>(*aIter);
+ OQueryTableConnection* pTemp = static_cast<OQueryTableConnection*>(conn.get());
if (pTemp->IsVisited() &&
(pFrom == static_cast< OQueryTableWindow*>(pTemp->GetSourceWin()) || pFrom == static_cast< OQueryTableWindow*>(pTemp->GetDestWin())))
return true;
diff --git a/dbaccess/source/ui/querydesign/QueryTextView.cxx b/dbaccess/source/ui/querydesign/QueryTextView.cxx
index 107daa95ec2d..9c3e7412cc6a 100644
--- a/dbaccess/source/ui/querydesign/QueryTextView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTextView.cxx
@@ -42,7 +42,7 @@ using namespace ::com::sun::star::frame;
OQueryTextView::OQueryTextView(OQueryContainerWindow* _pParent)
:Window(_pParent)
{
- m_pEdit = new OSqlEdit(this);
+ m_pEdit = VclPtr<OSqlEdit>::Create(this);
m_pEdit->SetRightToLeft(false);
m_pEdit->ClearModifyFlag();
m_pEdit->SaveValue();
@@ -52,8 +52,13 @@ OQueryTextView::OQueryTextView(OQueryContainerWindow* _pParent)
OQueryTextView::~OQueryTextView()
{
- boost::scoped_ptr<vcl::Window> aTemp(m_pEdit);
- m_pEdit = NULL;
+ disposeOnce();
+}
+
+void OQueryTextView::dispose()
+{
+ m_pEdit.disposeAndClear();
+ vcl::Window::dispose();
}
void OQueryTextView::GetFocus()
diff --git a/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx b/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx
index cdc16fd0dea1..4baf60797154 100644
--- a/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx
+++ b/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx
@@ -36,20 +36,12 @@ OQueryViewSwitch::OQueryViewSwitch(OQueryContainerWindow* _pParent, OQueryContro
: m_bAddTableDialogWasVisible(false)
{
- m_pTextView = new OQueryTextView(_pParent);
- m_pDesignView = new OQueryDesignView( _pParent, _rController, _rxContext );
+ m_pTextView = VclPtr<OQueryTextView>::Create(_pParent);
+ m_pDesignView = VclPtr<OQueryDesignView>::Create( _pParent, _rController, _rxContext );
}
OQueryViewSwitch::~OQueryViewSwitch()
{
- {
- boost::scoped_ptr<vcl::Window> aTemp(m_pTextView);
- m_pTextView = NULL;
- }
- {
- boost::scoped_ptr<vcl::Window> aTemp(m_pDesignView);
- m_pDesignView = NULL;
- }
}
void OQueryViewSwitch::Construct()
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index b628238191d9..05d3d05219db 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -117,12 +117,12 @@ OSelectionBrowseBox::OSelectionBrowseBox( vcl::Window* pParent )
| BrowserMode::HLINES | BrowserMode::VLINES
| BrowserMode::HEADERBAR_NEW ;
- m_pTextCell = new Edit(&GetDataWindow(), 0);
- m_pVisibleCell = new CheckBoxControl(&GetDataWindow());
- m_pTableCell = new ListBoxControl(&GetDataWindow()); m_pTableCell->SetDropDownLineCount( 20 );
- m_pFieldCell = new ComboBoxControl(&GetDataWindow()); m_pFieldCell->SetDropDownLineCount( 20 );
- m_pOrderCell = new ListBoxControl(&GetDataWindow());
- m_pFunctionCell = new ListBoxControl(&GetDataWindow()); m_pFunctionCell->SetDropDownLineCount( 20 );
+ m_pTextCell = VclPtr<Edit>::Create(&GetDataWindow(), 0);
+ m_pVisibleCell = VclPtr<CheckBoxControl>::Create(&GetDataWindow());
+ m_pTableCell = VclPtr<ListBoxControl>::Create(&GetDataWindow()); m_pTableCell->SetDropDownLineCount( 20 );
+ m_pFieldCell = VclPtr<ComboBoxControl>::Create(&GetDataWindow()); m_pFieldCell->SetDropDownLineCount( 20 );
+ m_pOrderCell = VclPtr<ListBoxControl>::Create(&GetDataWindow());
+ m_pFunctionCell = VclPtr<ListBoxControl>::Create(&GetDataWindow()); m_pFunctionCell->SetDropDownLineCount( 20 );
m_pVisibleCell->SetHelpId(HID_QRYDGN_ROW_VISIBLE);
m_pTableCell->SetHelpId(HID_QRYDGN_ROW_TABLE);
@@ -154,13 +154,18 @@ OSelectionBrowseBox::OSelectionBrowseBox( vcl::Window* pParent )
OSelectionBrowseBox::~OSelectionBrowseBox()
{
+ disposeOnce();
+}
- delete m_pTextCell;
- delete m_pVisibleCell;
- delete m_pFieldCell;
- delete m_pTableCell;
- delete m_pOrderCell;
- delete m_pFunctionCell;
+void OSelectionBrowseBox::dispose()
+{
+ m_pTextCell.disposeAndClear();
+ m_pVisibleCell.disposeAndClear();
+ m_pFieldCell.disposeAndClear();
+ m_pTableCell.disposeAndClear();
+ m_pOrderCell.disposeAndClear();
+ m_pFunctionCell.disposeAndClear();
+ ::svt::EditBrowseBox::dispose();
}
void OSelectionBrowseBox::initialize()
@@ -241,11 +246,13 @@ namespace
{
class OSelectionBrwBoxHeader : public ::svt::EditBrowserHeader
{
- OSelectionBrowseBox* m_pBrowseBox;
+ VclPtr<OSelectionBrowseBox> m_pBrowseBox;
protected:
virtual void Select() SAL_OVERRIDE;
public:
OSelectionBrwBoxHeader(OSelectionBrowseBox* pParent);
+ virtual ~OSelectionBrwBoxHeader() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE { m_pBrowseBox.clear(); ::svt::EditBrowserHeader::dispose(); }
};
OSelectionBrwBoxHeader::OSelectionBrwBoxHeader(OSelectionBrowseBox* pParent)
: ::svt::EditBrowserHeader(pParent,WB_BUTTONSTYLE|WB_DRAG)
@@ -275,9 +282,9 @@ namespace
}
}
-BrowserHeader* OSelectionBrowseBox::imp_CreateHeaderBar(BrowseBox* /*pParent*/)
+VclPtr<BrowserHeader> OSelectionBrowseBox::imp_CreateHeaderBar(BrowseBox* /*pParent*/)
{
- return new OSelectionBrwBoxHeader(this);
+ return VclPtr<OSelectionBrwBoxHeader>::Create(this);
}
void OSelectionBrowseBox::ColumnMoved( sal_uInt16 nColId, bool _bCreateUndo )
@@ -491,7 +498,7 @@ void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, lon
OJoinTableView::OTableWindowMap::iterator aEnd = rTabWinList.end();
for(;aIter != aEnd;++aIter)
- m_pTableCell->InsertEntry(static_cast<OQueryTableWindow*>(aIter->second)->GetAliasName());
+ m_pTableCell->InsertEntry(static_cast<OQueryTableWindow*>(aIter->second.get())->GetAliasName());
m_pTableCell->InsertEntry(OUString(ModuleRes(STR_QUERY_NOTABLE)), 0);
if (!pEntry->GetAlias().isEmpty())
@@ -986,7 +993,7 @@ bool OSelectionBrowseBox::SaveModified()
OJoinTableView::OTableWindowMap::iterator aIter = rTabWinList.find(aAliasName);
if(aIter != rTabWinList.end())
{
- OQueryTableWindow* pEntryTab = static_cast<OQueryTableWindow*>(aIter->second);
+ OQueryTableWindow* pEntryTab = static_cast<OQueryTableWindow*>(aIter->second.get());
if (pEntryTab)
{
pEntry->SetTable(pEntryTab->GetTableName());
@@ -2603,7 +2610,7 @@ bool OSelectionBrowseBox::fillEntryTable(OTableFieldDescRef& _pEntry,const OUStr
OJoinTableView::OTableWindowMap::iterator aIter = rTabWinList.find(_sTableName);
if(aIter != rTabWinList.end())
{
- OQueryTableWindow* pEntryTab = static_cast<OQueryTableWindow*>(aIter->second);
+ OQueryTableWindow* pEntryTab = static_cast<OQueryTableWindow*>(aIter->second.get());
if (pEntryTab)
{
_pEntry->SetTable(pEntryTab->GetTableName());
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx
index 6d3901e8d4ca..8c30610be159 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx
@@ -56,12 +56,12 @@ namespace dbaui
long m_nSeekRow;
BrowserMode m_nMode; // remember the BrowseModes
- Edit* m_pTextCell;
- ::svt::CheckBoxControl* m_pVisibleCell;
- ::svt::ComboBoxControl* m_pFieldCell;
- ::svt::ListBoxControl* m_pFunctionCell;
- ::svt::ListBoxControl* m_pTableCell;
- ::svt::ListBoxControl* m_pOrderCell;
+ VclPtr<Edit> m_pTextCell;
+ VclPtr<::svt::CheckBoxControl> m_pVisibleCell;
+ VclPtr<::svt::ComboBoxControl> m_pFieldCell;
+ VclPtr<::svt::ListBoxControl> m_pFunctionCell;
+ VclPtr<::svt::ListBoxControl> m_pTableCell;
+ VclPtr<::svt::ListBoxControl> m_pOrderCell;
OTableFieldDescRef m_pEmptyEntry; // default entry in the list may reference more than once
@@ -80,6 +80,7 @@ namespace dbaui
DECL_LINK(OnInvalidateTimer, void*);
public: OSelectionBrowseBox( vcl::Window* pParent );
virtual ~OSelectionBrowseBox();
+ virtual void dispose() SAL_OVERRIDE;
void initialize();
OTableFieldDescRef InsertField( const OJoinExchangeData& jxdSource, sal_uInt16 _nColumnPosition = BROWSER_INVALIDID, bool bVis=true, bool bActivate=true );
@@ -205,7 +206,7 @@ namespace dbaui
virtual sal_uInt32 GetTotalCellWidth(long nRow, sal_uInt16 nColId) SAL_OVERRIDE;
// if you want to have an own header ...
- virtual BrowserHeader* imp_CreateHeaderBar(BrowseBox* pParent) SAL_OVERRIDE;
+ virtual VclPtr<BrowserHeader> imp_CreateHeaderBar(BrowseBox* pParent) SAL_OVERRIDE;
void stopTimer();
void startTimer();
diff --git a/dbaccess/source/ui/querydesign/TableConnection.cxx b/dbaccess/source/ui/querydesign/TableConnection.cxx
index 6d7864e06db7..457a58481c64 100644
--- a/dbaccess/source/ui/querydesign/TableConnection.cxx
+++ b/dbaccess/source/ui/querydesign/TableConnection.cxx
@@ -43,7 +43,7 @@ namespace dbaui
Show();
}
- OTableConnection::OTableConnection( const OTableConnection& _rConn ) : Window(_rConn.m_pParent)
+ OTableConnection::OTableConnection( const OTableConnection& _rConn ) : Window(_rConn.m_pParent.get())
,m_pData(_rConn.GetData()->NewInstance())
,m_pParent(NULL)
{
diff --git a/dbaccess/source/ui/querydesign/TableFieldDescription.cxx b/dbaccess/source/ui/querydesign/TableFieldDescription.cxx
index d27e3dadb494..db44c06a982b 100644
--- a/dbaccess/source/ui/querydesign/TableFieldDescription.cxx
+++ b/dbaccess/source/ui/querydesign/TableFieldDescription.cxx
@@ -23,6 +23,7 @@
#include <tools/debug.hxx>
#include <com/sun/star/sdbc/DataType.hpp>
#include <comphelper/namedvaluecollection.hxx>
+#include <vcl/window.hxx>
#include <functional>
diff --git a/dbaccess/source/ui/querydesign/TableWindow.cxx b/dbaccess/source/ui/querydesign/TableWindow.cxx
index 35888462af34..e0c1e5bf0ea3 100644
--- a/dbaccess/source/ui/querydesign/TableWindow.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindow.cxx
@@ -69,8 +69,8 @@ namespace DatabaseObject = css::sdb::application::DatabaseObject;
OTableWindow::OTableWindow( vcl::Window* pParent, const TTableWindowData::value_type& pTabWinData )
: ::comphelper::OContainerListener(m_aMutex)
,Window( pParent, WB_3DLOOK|WB_MOVEABLE )
- ,m_aTypeImage( this )
- ,m_aTitle( this )
+ ,m_aTypeImage( VclPtr<FixedImage>::Create(this) )
+ ,m_aTitle( VclPtr<OTableWindowTitle>::Create(this) )
,m_pListBox(NULL)
,m_pAccessible(NULL)
,m_pData( pTabWinData )
@@ -99,17 +99,23 @@ OTableWindow::OTableWindow( vcl::Window* pParent, const TTableWindowData::value_
OTableWindow::~OTableWindow()
{
+ disposeOnce();
+}
+void OTableWindow::dispose()
+{
if (m_pListBox)
{
OSL_ENSURE(m_pListBox->GetEntryCount()==0,"Forgot to call EmptyListbox()!");
- boost::scoped_ptr<vcl::Window> aTemp(m_pListBox);
- m_pListBox = NULL;
}
+ m_pListBox.disposeAndClear();
if ( m_pContainerListener.is() )
m_pContainerListener->dispose();
m_pAccessible = NULL;
+ m_aTypeImage.disposeAndClear();
+ m_aTitle.disposeAndClear();
+ vcl::Window::dispose();
}
const OJoinTableView* OTableWindow::getTableView() const
@@ -155,9 +161,9 @@ void OTableWindow::SetPosSizePixel( const Point& rNewPos, const Size& rNewSize )
SetSizePixel( rNewSize );
}
-OTableWindowListBox* OTableWindow::CreateListBox()
+VclPtr<OTableWindowListBox> OTableWindow::CreateListBox()
{
- return new OTableWindowListBox(this);
+ return VclPtr<OTableWindowListBox>::Create(this);
}
bool OTableWindow::FillListBox()
@@ -263,8 +269,8 @@ void OTableWindow::impl_updateImage()
return;
}
- m_aTypeImage.SetModeImage( aImage );
- m_aTypeImage.Show();
+ m_aTypeImage->SetModeImage( aImage );
+ m_aTypeImage->Show();
}
bool OTableWindow::Init()
@@ -273,13 +279,13 @@ bool OTableWindow::Init()
if ( !m_pListBox )
{
m_pListBox = CreateListBox();
- OSL_ENSURE( m_pListBox != NULL, "OTableWindow::Init() : CreateListBox returned NULL !" );
+ OSL_ENSURE( m_pListBox != nullptr, "OTableWindow::Init() : CreateListBox returned NULL !" );
m_pListBox->SetSelectionMode( MULTIPLE_SELECTION );
}
// Set the title
- m_aTitle.SetText( m_pData->GetWinName() );
- m_aTitle.Show();
+ m_aTitle->SetText( m_pData->GetWinName() );
+ m_aTitle->Show();
m_pListBox->Show();
@@ -456,15 +462,15 @@ void OTableWindow::Resize()
long nPositionY = n5Pos;
// position the image which indicates the type
- m_aTypeImage.SetPosPixel( Point( nPositionX, nPositionY ) );
- Size aImageSize( m_aTypeImage.GetImage().GetSizePixel() );
- m_aTypeImage.SetSizePixel( aImageSize );
+ m_aTypeImage->SetPosPixel( Point( nPositionX, nPositionY ) );
+ Size aImageSize( m_aTypeImage->GetImage().GetSizePixel() );
+ m_aTypeImage->SetSizePixel( aImageSize );
if ( nTitleHeight < aImageSize.Height() )
nTitleHeight = aImageSize.Height();
nPositionX += aImageSize.Width() + CalcZoom( 2 );
- m_aTitle.SetPosSizePixel( Point( nPositionX, nPositionY ), Size( aOutSize.Width() - nPositionX - n5Pos, nTitleHeight ) );
+ m_aTitle->SetPosSizePixel( Point( nPositionX, nPositionY ), Size( aOutSize.Width() - nPositionX - n5Pos, nTitleHeight ) );
long nTitleToList = CalcZoom( 3 );
@@ -478,10 +484,10 @@ void OTableWindow::Resize()
void OTableWindow::SetBoldTitle( bool bBold )
{
- vcl::Font aFont = m_aTitle.GetFont();
+ vcl::Font aFont = m_aTitle->GetFont();
aFont.SetWeight( bBold?WEIGHT_BOLD:WEIGHT_NORMAL );
- m_aTitle.SetFont( aFont );
- m_aTitle.Invalidate();
+ m_aTitle->SetFont( aFont );
+ m_aTitle->Invalidate();
}
void OTableWindow::GetFocus()
@@ -559,7 +565,7 @@ void OTableWindow::StateChanged( StateChangedType nType )
aFont.Merge( GetControlFont() );
SetZoomedPointFont( aFont );
- m_aTitle.SetZoom(GetZoom());
+ m_aTitle->SetZoom(GetZoom());
m_pListBox->SetZoom(GetZoom());
Resize();
Invalidate();
@@ -591,7 +597,7 @@ void OTableWindow::Command(const CommandEvent& rEvt)
if ( pCurrent )
ptWhere = m_pListBox->GetEntryPosition(pCurrent);
else
- ptWhere = m_aTitle.GetPosPixel();
+ ptWhere = m_aTitle->GetPosPixel();
}
PopupMenu aContextMenu(ModuleRes(RID_MENU_JOINVIEW_TABLE));
@@ -746,7 +752,7 @@ bool OTableWindow::PreNotify(NotifyEvent& rNEvt)
OUString OTableWindow::getTitle() const
{
- return m_aTitle.GetText();
+ return m_aTitle->GetText();
}
void OTableWindow::_elementInserted( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException, std::exception)
diff --git a/dbaccess/source/ui/querydesign/TableWindowAccess.cxx b/dbaccess/source/ui/querydesign/TableWindowAccess.cxx
index c122c96dc79d..82580fc83f02 100644
--- a/dbaccess/source/ui/querydesign/TableWindowAccess.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowAccess.cxx
@@ -192,7 +192,7 @@ namespace dbaui
if( m_pTable )
{
OJoinTableView* pView = m_pTable->getTableView();
- ::std::vector<OTableConnection*>::const_iterator aIter = pView->getTableConnections(m_pTable) + nIndex;
+ auto aIter = pView->getTableConnections(m_pTable) + nIndex;
aRet.TargetSet.realloc(1);
aRet.TargetSet[0] = getParentChild(aIter - pView->getTableConnections().begin());
aRet.RelationType = AccessibleRelationType::CONTROLLER_FOR;
@@ -211,10 +211,10 @@ namespace dbaui
if( AccessibleRelationType::CONTROLLER_FOR == aRelationType && m_pTable)
{
OJoinTableView* pView = m_pTable->getTableView();
- const ::std::vector<OTableConnection*>& rConnectionList = pView->getTableConnections();
+ const auto& rConnectionList = pView->getTableConnections();
- ::std::vector<OTableConnection*>::const_iterator aIter = pView->getTableConnections(m_pTable);
- ::std::vector<OTableConnection*>::const_iterator aEnd = rConnectionList.end();
+ auto aIter = pView->getTableConnections(m_pTable);
+ auto aEnd = rConnectionList.end();
::std::vector< Reference<XInterface> > aRelations;
aRelations.reserve(5); // just guessing
for (; aIter != aEnd ; ++aIter )
diff --git a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
index 1796dcf8e574..2453bd292f67 100644
--- a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
@@ -68,13 +68,19 @@ void OTableWindowListBox::dragFinished( )
OTableWindowListBox::~OTableWindowListBox()
{
+ disposeOnce();
+}
+
+void OTableWindowListBox::dispose()
+{
if (m_nDropEvent)
Application::RemoveUserEvent(m_nDropEvent);
if (m_nUiEvent)
Application::RemoveUserEvent(m_nUiEvent);
if( m_aScrollTimer.IsActive() )
m_aScrollTimer.Stop();
- m_pTabWin = NULL;
+ m_pTabWin.clear();
+ SvTreeListBox::dispose();
}
SvTreeListEntry* OTableWindowListBox::GetEntryFromText( const OUString& rEntryText )
diff --git a/dbaccess/source/ui/querydesign/TableWindowTitle.cxx b/dbaccess/source/ui/querydesign/TableWindowTitle.cxx
index 79bcc29c871d..a0fba532d142 100644
--- a/dbaccess/source/ui/querydesign/TableWindowTitle.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowTitle.cxx
@@ -55,7 +55,13 @@ OTableWindowTitle::OTableWindowTitle( OTableWindow* pParent ) :
OTableWindowTitle::~OTableWindowTitle()
{
- m_pTabWin = NULL;
+ disposeOnce();
+}
+
+void OTableWindowTitle::dispose()
+{
+ m_pTabWin.clear();
+ FixedText::dispose();
}
void OTableWindowTitle::GetFocus()
@@ -130,10 +136,8 @@ void OTableWindowTitle::MouseButtonDown( const MouseEvent& rEvt )
OJoinTableView* pView = static_cast<OJoinTableView*>(m_pTabWin->getTableView());
OSL_ENSURE(pView,"No OJoinTableView!");
- const ::std::vector<OTableConnection*>& rConns = pView->getTableConnections();
- ::std::for_each(rConns.begin(),
- rConns.end(),
- ::std::mem_fun(&OTableConnection::RecalcLines));
+ for (auto conn : pView->getTableConnections())
+ conn->RecalcLines();
pView->InvalidateConnections();
pView->getDesignView()->getController().setModified(sal_True);
diff --git a/dbaccess/source/ui/querydesign/limitboxcontroller.cxx b/dbaccess/source/ui/querydesign/limitboxcontroller.cxx
index ad0c88866ed6..54a682e77482 100644
--- a/dbaccess/source/ui/querydesign/limitboxcontroller.cxx
+++ b/dbaccess/source/ui/querydesign/limitboxcontroller.cxx
@@ -34,7 +34,6 @@ class LimitBoxImpl: public LimitBox
{
public:
LimitBoxImpl( vcl::Window* pParent, LimitBoxController* pCtrl );
- virtual ~LimitBoxImpl();
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -48,10 +47,6 @@ LimitBoxImpl::LimitBoxImpl( vcl::Window* pParent, LimitBoxController* pCtrl )
{
}
-LimitBoxImpl::~LimitBoxImpl()
-{
-}
-
bool LimitBoxImpl::Notify( NotifyEvent& rNEvt )
{
bool nHandled = false;
@@ -144,8 +139,7 @@ throw (uno::RuntimeException, std::exception)
svt::ToolboxController::dispose();
SolarMutexGuard aSolarMutexGuard;
- delete m_pLimitBox;
- m_pLimitBox = 0;
+ m_pLimitBox.disposeAndClear();
}
/// XStatusListener
@@ -206,7 +200,7 @@ uno::Reference< awt::XWindow > SAL_CALL LimitBoxController::createItemWindow(
if ( pParent )
{
SolarMutexGuard aSolarMutexGuard;
- m_pLimitBox = new LimitBoxImpl(pParent, this);
+ m_pLimitBox = VclPtr<LimitBoxImpl>::Create(pParent, this);
m_pLimitBox->SetSizePixel(m_pLimitBox->CalcBlockSize(6,1));
xItemWindow = VCLUnoHelper::GetInterface( m_pLimitBox );
}
diff --git a/dbaccess/source/ui/querydesign/limitboxcontroller.hxx b/dbaccess/source/ui/querydesign/limitboxcontroller.hxx
index 1db59a8e6ebf..93401164eca1 100644
--- a/dbaccess/source/ui/querydesign/limitboxcontroller.hxx
+++ b/dbaccess/source/ui/querydesign/limitboxcontroller.hxx
@@ -13,6 +13,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <svtools/toolboxcontroller.hxx>
#include <rtl/ustring.hxx>
+#include <vcl/vclptr.hxx>
#include "apitools.hxx"
@@ -59,7 +60,7 @@ class LimitBoxController: public svt::ToolboxController,
using svt::ToolboxController::dispatchCommand;
private:
- LimitBoxImpl* m_pLimitBox;
+ VclPtr<LimitBoxImpl> m_pLimitBox;
};
} ///dbaui namespace
diff --git a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx
index 7372ec724d2a..9aa8ba3d6494 100644
--- a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx
+++ b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx
@@ -49,20 +49,24 @@ namespace dbaui
{
m_pViewSwitch = new OQueryViewSwitch( this, _rController, _rxContext );
- m_pSplitter = new Splitter(this,WB_VSCROLL);
+ m_pSplitter = VclPtr<Splitter>::Create(this,WB_VSCROLL);
m_pSplitter->Hide();
m_pSplitter->SetSplitHdl( LINK( this, OQueryContainerWindow, SplitHdl ) );
m_pSplitter->SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetDialogColor() ) );
}
OQueryContainerWindow::~OQueryContainerWindow()
{
+ disposeOnce();
+ }
+ void OQueryContainerWindow::dispose()
+ {
{
boost::scoped_ptr<OQueryViewSwitch> aTemp(m_pViewSwitch);
m_pViewSwitch = NULL;
}
if ( m_pBeamer )
::dbaui::notifySystemWindow(this,m_pBeamer,::comphelper::mem_fun(&TaskPaneList::RemoveWindow));
- m_pBeamer = NULL;
+ m_pBeamer.clear();
if ( m_xBeamer.is() )
{
Reference< ::com::sun::star::util::XCloseable > xCloseable(m_xBeamer,UNO_QUERY);
@@ -71,9 +75,8 @@ namespace dbaui
xCloseable->close(sal_False); // false - holds the ownership of this frame
}
- boost::scoped_ptr<vcl::Window> aTemp(m_pSplitter);
- m_pSplitter = NULL;
-
+ m_pSplitter.disposeAndClear();
+ ODataView::dispose();
}
bool OQueryContainerWindow::switchView( ::dbtools::SQLExceptionInfo* _pErrorInfo )
{
@@ -171,7 +174,7 @@ namespace dbaui
{
if(!m_pBeamer)
{
- m_pBeamer = new OBeamer(this);
+ m_pBeamer = VclPtr<OBeamer>::Create(this);
::dbaui::notifySystemWindow(this,m_pBeamer,::comphelper::mem_fun(&TaskPaneList::AddWindow));
diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx
index 92dde0c697a5..ad454569a103 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -763,9 +763,9 @@ void OQueryController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >&
if ( pNode )
{
vcl::Window* pView = getView();
- ModalDialog* pWindow = new ModalDialog( pView, WB_STDMODAL | WB_SIZEMOVE | WB_CENTER );
+ ScopedVclPtrInstance<ModalDialog> pWindow( pView, WB_STDMODAL | WB_SIZEMOVE | WB_CENTER );
pWindow->SetSizePixel( ::Size( pView->GetSizePixel().Width() / 2, pView->GetSizePixel().Height() / 2 ) );
- SvTreeListBox* pTreeBox = new SvTreeListBox( pWindow, WB_BORDER | WB_HASLINES | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HASLINESATROOT | WB_VSCROLL );
+ ScopedVclPtrInstance<SvTreeListBox> pTreeBox( pWindow, WB_BORDER | WB_HASLINES | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HASLINESATROOT | WB_VSCROLL );
pTreeBox->SetPosSizePixel( ::Point( 6, 6 ), ::Size( pWindow->GetSizePixel().Width() - 12, pWindow->GetSizePixel().Height() - 12 ));
pTreeBox->SetNodeDefaultImages();
@@ -799,8 +799,6 @@ void OQueryController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >&
pTreeBox->Show();
pWindow->Execute();
- delete pTreeBox;
- delete pWindow;
delete pNode;
}
break;
@@ -987,8 +985,8 @@ void OQueryController::impl_initialize()
OUString aTitle( ModuleRes( STR_QUERYDESIGN_NO_VIEW_SUPPORT ) );
OUString aMessage( ModuleRes( STR_QUERYDESIGN_NO_VIEW_ASK ) );
ODataView* pWindow = getView();
- OSQLMessageBox aDlg( pWindow, aTitle, aMessage, WB_YES_NO | WB_DEF_YES, OSQLMessageBox::Query );
- bClose = aDlg.Execute() == RET_NO;
+ ScopedVclPtrInstance< OSQLMessageBox > aDlg( pWindow, aTitle, aMessage, WB_YES_NO | WB_DEF_YES, OSQLMessageBox::Query );
+ bClose = aDlg->Execute() == RET_NO;
}
if ( bClose )
throw VetoException();
@@ -1117,7 +1115,7 @@ bool OQueryController::Construct(vcl::Window* pParent)
{
// TODO: we have to check if we should create the text view or the design view
- setView( * new OQueryContainerWindow( pParent, *this, getORB() ) );
+ setView( VclPtr<OQueryContainerWindow>::Create( pParent, *this, getORB() ) );
return OJoinController::Construct(pParent);
}
@@ -1238,13 +1236,13 @@ void OQueryController::loadViewSettings( const ::comphelper::NamedValueCollectio
void OQueryController::execute_QueryPropDlg()
{
- QueryPropertiesDialog aQueryPropDlg(
+ ScopedVclPtrInstance<QueryPropertiesDialog> aQueryPropDlg(
getContainer(), m_bDistinct, m_nLimit );
- if( aQueryPropDlg.Execute() == RET_OK )
+ if( aQueryPropDlg->Execute() == RET_OK )
{
- m_bDistinct = aQueryPropDlg.getDistinct();
- m_nLimit = aQueryPropDlg.getLimit();
+ m_bDistinct = aQueryPropDlg->getDistinct();
+ m_nLimit = aQueryPropDlg->getLimit();
InvalidateFeature( SID_QUERY_DISTINCT_VALUES );
InvalidateFeature( SID_QUERY_LIMIT, 0, true );
}
@@ -1398,7 +1396,7 @@ bool OQueryController::askForNewName(const Reference<XNameAccess>& _xElements, b
}
DynamicTableOrQueryNameCheck aNameChecker( getConnection(), CommandType::QUERY );
- OSaveAsDlg aDlg(
+ ScopedVclPtrInstance<OSaveAsDlg> aDlg(
getView(),
m_nCommandType,
getORB(),
@@ -1407,14 +1405,14 @@ bool OQueryController::askForNewName(const Reference<XNameAccess>& _xElements, b
aNameChecker,
SAD_DEFAULT );
- bRet = ( aDlg.Execute() == RET_OK );
+ bRet = ( aDlg->Execute() == RET_OK );
if ( bRet )
{
- m_sName = aDlg.getName();
+ m_sName = aDlg->getName();
if ( editingView() )
{
- m_sUpdateCatalogName = aDlg.getCatalog();
- m_sUpdateSchemaName = aDlg.getSchema();
+ m_sUpdateCatalogName = aDlg->getCatalog();
+ m_sUpdateSchemaName = aDlg->getSchema();
}
}
}
@@ -1802,9 +1800,9 @@ short OQueryController::saveModified()
)
{
OUString sMessageText( lcl_getObjectResourceString( STR_QUERY_SAVEMODIFIED, m_nCommandType ) );
- QueryBox aQry( getView(), WB_YES_NO_CANCEL | WB_DEF_YES, sMessageText );
+ ScopedVclPtrInstance< QueryBox > aQry( getView(), WB_YES_NO_CANCEL | WB_DEF_YES, sMessageText );
- nRet = aQry.Execute();
+ nRet = aQry->Execute();
if ( ( nRet == RET_YES )
&& !doSaveAsDoc( false )
)
@@ -1914,8 +1912,8 @@ void OQueryController::impl_reset( const bool i_bForceCurrentControllerSettings
if ( !i_bForceCurrentControllerSettings && !editingView() )
{
OUString aTitle(ModuleRes(STR_SVT_SQL_SYNTAX_ERROR));
- OSQLMessageBox aDlg(getView(),aTitle,aErrorMsg);
- aDlg.Execute();
+ ScopedVclPtrInstance< OSQLMessageBox > aDlg(getView(),aTitle,aErrorMsg);
+ aDlg->Execute();
}
bError = true;
}
diff --git a/dbaccess/source/ui/querydesign/querydlg.cxx b/dbaccess/source/ui/querydesign/querydlg.cxx
index 6263d0cd52a7..798fcaef3d80 100644
--- a/dbaccess/source/ui/querydesign/querydlg.cxx
+++ b/dbaccess/source/ui/querydesign/querydlg.cxx
@@ -139,7 +139,18 @@ DlgQryJoin::DlgQryJoin( OQueryTableView * pParent,
DlgQryJoin::~DlgQryJoin()
{
+ disposeOnce();
+}
+
+void DlgQryJoin::dispose()
+{
delete m_pTableControl;
+ m_pML_HelpText.clear();
+ m_pPB_OK.clear();
+ m_pLB_JoinType.clear();
+ m_pCBNatural.clear();
+ m_pTableView.clear();
+ ModalDialog::dispose();
}
IMPL_LINK( DlgQryJoin, LBChangeHdl, ListBox*, /*pListBox*/ )
diff --git a/dbaccess/source/ui/querydesign/querydlg.hxx b/dbaccess/source/ui/querydesign/querydlg.hxx
index e8ce875cbdea..ec31515d007e 100644
--- a/dbaccess/source/ui/querydesign/querydlg.hxx
+++ b/dbaccess/source/ui/querydesign/querydlg.hxx
@@ -39,14 +39,14 @@ namespace dbaui
,public IRelationControlInterface
{
protected:
- FixedText* m_pML_HelpText;
- OKButton* m_pPB_OK;
- ListBox* m_pLB_JoinType;
- CheckBox* m_pCBNatural;
+ VclPtr<FixedText> m_pML_HelpText;
+ VclPtr<OKButton> m_pPB_OK;
+ VclPtr<ListBox> m_pLB_JoinType;
+ VclPtr<CheckBox> m_pCBNatural;
OTableListBoxControl* m_pTableControl;
OJoinTableView::OTableWindowMap* m_pTableMap;
- OQueryTableView* m_pTableView;
+ VclPtr<OQueryTableView> m_pTableView;
EJoinType eJoinType;
TTableConnectionData::value_type m_pConnData; // contains left and right table
@@ -69,6 +69,7 @@ namespace dbaui
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection,
bool _bAllowTableSelect);
virtual ~DlgQryJoin();
+ virtual void dispose() SAL_OVERRIDE;
EJoinType GetJoinType() const { return eJoinType; };
/** getConnectionData returns the current connection data
diff --git a/dbaccess/source/ui/querydesign/queryview.cxx b/dbaccess/source/ui/querydesign/queryview.cxx
index a10a73045a0b..c18ef092d24d 100644
--- a/dbaccess/source/ui/querydesign/queryview.cxx
+++ b/dbaccess/source/ui/querydesign/queryview.cxx
@@ -30,9 +30,4 @@ OQueryView::OQueryView(vcl::Window* _pParent, OQueryController& _rController,con
}
-OQueryView::~OQueryView()
-{
-
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/ui/relationdesign/RTableConnection.cxx b/dbaccess/source/ui/relationdesign/RTableConnection.cxx
index 03a9b56c8826..1f18d83af39a 100644
--- a/dbaccess/source/ui/relationdesign/RTableConnection.cxx
+++ b/dbaccess/source/ui/relationdesign/RTableConnection.cxx
@@ -38,10 +38,6 @@ ORelationTableConnection::ORelationTableConnection( const ORelationTableConnecti
// no own members, thus the base class functionality is enough
}
-ORelationTableConnection::~ORelationTableConnection()
-{
-}
-
ORelationTableConnection& ORelationTableConnection::operator=( const ORelationTableConnection& rConn )
{
// this doesn't change anything, since the base class tests this, too and I don't have my own members to copy
diff --git a/dbaccess/source/ui/relationdesign/RTableConnection.hxx b/dbaccess/source/ui/relationdesign/RTableConnection.hxx
index 24339b521a23..3ebea9b873f3 100644
--- a/dbaccess/source/ui/relationdesign/RTableConnection.hxx
+++ b/dbaccess/source/ui/relationdesign/RTableConnection.hxx
@@ -31,7 +31,6 @@ namespace dbaui
ORelationTableConnection( ORelationTableView* pContainer, const TTableConnectionData::value_type& pTabConnData );
ORelationTableConnection( const ORelationTableConnection& rConn );
// wichtiger Kommentar zum CopyConstructor siehe OTableConnection(const OTableConnection&)
- virtual ~ORelationTableConnection();
ORelationTableConnection& operator=( const ORelationTableConnection& rConn );
diff --git a/dbaccess/source/ui/relationdesign/RelationController.cxx b/dbaccess/source/ui/relationdesign/RelationController.cxx
index 2bc001a585bf..430d0a35aef0 100644
--- a/dbaccess/source/ui/relationdesign/RelationController.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationController.cxx
@@ -205,8 +205,8 @@ void ORelationController::impl_initialize()
{
OUString sTitle(ModuleRes(STR_RELATIONDESIGN));
sTitle = sTitle.copy(3);
- OSQLMessageBox aDlg(NULL,sTitle,ModuleRes(STR_RELATIONDESIGN_NOT_AVAILABLE));
- aDlg.Execute();
+ ScopedVclPtrInstance< OSQLMessageBox > aDlg(nullptr,sTitle,ModuleRes(STR_RELATIONDESIGN_NOT_AVAILABLE));
+ aDlg->Execute();
}
disconnect();
throw SQLException();
@@ -245,7 +245,7 @@ OUString ORelationController::getPrivateTitle( ) const
bool ORelationController::Construct(vcl::Window* pParent)
{
- setView( * new ORelationDesignView( pParent, *this, getORB() ) );
+ setView( VclPtr<ORelationDesignView>::Create( pParent, *this, getORB() ) );
OJoinController::Construct(pParent);
return true;
}
@@ -255,9 +255,9 @@ short ORelationController::saveModified()
short nSaved = RET_YES;
if(haveDataSource() && isModified())
{
- MessageDialog aQry(getView(), "DesignSaveModifiedDialog",
- "dbaccess/ui/designsavemodifieddialog.ui");
- nSaved = aQry.Execute();
+ ScopedVclPtrInstance<MessageDialog> aQry(getView(), "DesignSaveModifiedDialog",
+ "dbaccess/ui/designsavemodifieddialog.ui");
+ nSaved = aQry->Execute();
if(nSaved == RET_YES)
Execute(ID_BROWSER_SAVEDOC,Sequence<PropertyValue>());
}
diff --git a/dbaccess/source/ui/relationdesign/RelationDesignView.cxx b/dbaccess/source/ui/relationdesign/RelationDesignView.cxx
index a27f4a5b2eb6..72e75deb07b9 100644
--- a/dbaccess/source/ui/relationdesign/RelationDesignView.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationDesignView.cxx
@@ -50,13 +50,9 @@ ORelationDesignView::ORelationDesignView(vcl::Window* _pParent, ORelationControl
{
}
-ORelationDesignView::~ORelationDesignView()
-{
-}
-
void ORelationDesignView::Construct()
{
- m_pTableView = new ORelationTableView(m_pScrollWindow,this);
+ m_pTableView = VclPtr<ORelationTableView>::Create(m_pScrollWindow,this);
OJoinDesignView::Construct();
}
diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
index 38ee81fb1715..06f5839c8483 100644
--- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
@@ -73,8 +73,15 @@ ORelationTableView::ORelationTableView( vcl::Window* pParent, ORelationDesignVie
ORelationTableView::~ORelationTableView()
{
+ disposeOnce();
+}
+
+void ORelationTableView::dispose()
+{
if ( m_pContainerListener.is() )
m_pContainerListener->dispose();
+ m_pExistingConnection.clear();
+ OJoinTableView::dispose();
}
void ORelationTableView::ReSync()
@@ -99,14 +106,14 @@ void ORelationTableView::ReSync()
for(;aIter != rTabWinDataList.rend();++aIter)
{
TTableWindowData::value_type pData = *aIter;
- OTableWindow* pTabWin = createWindow(pData);
+ VclPtr<OTableWindow> pTabWin = createWindow(pData);
if (!pTabWin->Init())
{
// initialisation failed, which means this TabWin is not available, therefore,
// it should be cleaned up, including its data in the document
pTabWin->clearListBox();
- delete pTabWin;
+ pTabWin.disposeAndClear();
arrInvalidTables.push_back(pData->GetTableName());
rTabWinDataList.erase( ::std::remove(rTabWinDataList.begin(), rTabWinDataList.end(), *aIter), rTabWinDataList.end());
@@ -144,7 +151,7 @@ void ORelationTableView::ReSync()
}
}
- addConnection( new ORelationTableConnection(this, *aConIter), false ); // don't add the data again
+ addConnection( VclPtr<ORelationTableConnection>::Create(this, *aConIter), false );
}
if ( !GetTabWinMap().empty() )
@@ -164,8 +171,8 @@ void ORelationTableView::AddConnection(const OJoinExchangeData& jxdSource, const
OTableWindow* pSourceWin = jxdSource.pListBox->GetTabWin();
OTableWindow* pDestWin = jxdDest.pListBox->GetTabWin();
- ::std::vector<OTableConnection*>::const_iterator aIter = getTableConnections().begin();
- ::std::vector<OTableConnection*>::const_iterator aEnd = getTableConnections().end();
+ auto aIter = getTableConnections().begin();
+ auto aEnd = getTableConnections().end();
for(;aIter != aEnd;++aIter)
{
OTableConnection* pFirst = *aIter;
@@ -200,7 +207,7 @@ void ORelationTableView::AddConnection(const OJoinExchangeData& jxdSource, const
if( pTabConnData->Update() )
{
// enter UI-object into ConnList
- addConnection( new ORelationTableConnection( this, pTabConnData ) );
+ addConnection( VclPtr<ORelationTableConnection>::Create( this, pTabConnData ) );
}
}
catch(const SQLException&)
@@ -216,8 +223,8 @@ void ORelationTableView::AddConnection(const OJoinExchangeData& jxdSource, const
void ORelationTableView::ConnDoubleClicked( OTableConnection* pConnection )
{
- ORelationDialog aRelDlg( this, pConnection->GetData() );
- switch (aRelDlg.Execute())
+ ScopedVclPtrInstance< ORelationDialog > aRelDlg( this, pConnection->GetData() );
+ switch (aRelDlg->Execute())
{
case RET_OK:
// successfully updated
@@ -244,14 +251,14 @@ void ORelationTableView::AddNewRelation()
{
TTableConnectionData::value_type pNewConnData( new ORelationTableConnectionData() );
- ORelationDialog aRelDlg(this, pNewConnData, true);
+ ScopedVclPtrInstance< ORelationDialog > aRelDlg(this, pNewConnData, true);
- bool bSuccess = (aRelDlg.Execute() == RET_OK);
+ bool bSuccess = (aRelDlg->Execute() == RET_OK);
if (bSuccess)
{
// already updated by the dialog
// announce it to the document
- addConnection( new ORelationTableConnection(this, pNewConnData) );
+ addConnection( VclPtr<ORelationTableConnection>::Create(this, pNewConnData) );
}
}
@@ -293,7 +300,7 @@ void ORelationTableView::AddTabWin(const OUString& _rComposedName, const OUStrin
pNewTabWinData->ShowAll(false);
// link new window into the window list
- OTableWindow* pNewTabWin = createWindow( pNewTabWinData );
+ VclPtr<OTableWindow> pNewTabWin = createWindow( pNewTabWinData );
if(pNewTabWin->Init())
{
m_pView->getController().getTableWindowData().push_back( pNewTabWinData);
@@ -313,14 +320,14 @@ void ORelationTableView::AddTabWin(const OUString& _rComposedName, const OUStrin
else
{
pNewTabWin->clearListBox();
- delete pNewTabWin;
+ pNewTabWin.disposeAndClear();
}
}
void ORelationTableView::RemoveTabWin( OTableWindow* pTabWin )
{
- OSQLWarningBox aDlg( this, ModuleRes( STR_QUERY_REL_DELETE_WINDOW ), WB_YES_NO | WB_DEF_YES );
- if ( m_bInRemove || aDlg.Execute() == RET_YES )
+ ScopedVclPtrInstance< OSQLWarningBox > aDlg( this, ModuleRes( STR_QUERY_REL_DELETE_WINDOW ), WB_YES_NO | WB_DEF_YES );
+ if ( m_bInRemove || aDlg->Execute() == RET_YES )
{
m_pView->getController().ClearUndoManager();
OJoinTableView::RemoveTabWin( pTabWin );
@@ -337,13 +344,13 @@ void ORelationTableView::lookForUiActivities()
{
OUString sTitle(ModuleRes(STR_RELATIONDESIGN));
sTitle = sTitle.copy(3);
- OSQLMessageBox aDlg(this,ModuleRes(STR_QUERY_REL_EDIT_RELATION),OUString(),0);
- aDlg.SetText(sTitle);
- aDlg.RemoveButton(aDlg.GetButtonId(0));
- aDlg.AddButton( ModuleRes(STR_QUERY_REL_EDIT), RET_OK, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON);
- aDlg.AddButton( ModuleRes(STR_QUERY_REL_CREATE), RET_YES, 0);
- aDlg.AddButton( StandardButtonType::Cancel,RET_CANCEL,0);
- sal_uInt16 nRet = aDlg.Execute();
+ ScopedVclPtrInstance< OSQLMessageBox > aDlg(this,ModuleRes(STR_QUERY_REL_EDIT_RELATION),OUString(),0);
+ aDlg->SetText(sTitle);
+ aDlg->RemoveButton(aDlg->GetButtonId(0));
+ aDlg->AddButton( ModuleRes(STR_QUERY_REL_EDIT), RET_OK, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON);
+ aDlg->AddButton( ModuleRes(STR_QUERY_REL_CREATE), RET_YES, 0);
+ aDlg->AddButton( StandardButtonType::Cancel,RET_CANCEL,0);
+ sal_uInt16 nRet = aDlg->Execute();
if( nRet == RET_CANCEL)
{
m_pCurrentlyTabConnData.reset();
@@ -357,19 +364,19 @@ void ORelationTableView::lookForUiActivities()
}
if(m_pCurrentlyTabConnData)
{
- ORelationDialog aRelDlg( this, m_pCurrentlyTabConnData );
- if (aRelDlg.Execute() == RET_OK)
+ ScopedVclPtrInstance< ORelationDialog > aRelDlg( this, m_pCurrentlyTabConnData );
+ if (aRelDlg->Execute() == RET_OK)
{
// already updated by the dialog
- addConnection( new ORelationTableConnection( this, m_pCurrentlyTabConnData ) );
+ addConnection( VclPtr<ORelationTableConnection>::Create( this, m_pCurrentlyTabConnData ) );
}
m_pCurrentlyTabConnData.reset();
}
}
-OTableWindow* ORelationTableView::createWindow(const TTableWindowData::value_type& _pData)
+VclPtr<OTableWindow> ORelationTableView::createWindow(const TTableWindowData::value_type& _pData)
{
- return new ORelationTableWindow(this,_pData);
+ return VclPtr<ORelationTableWindow>::Create(this,_pData);
}
bool ORelationTableView::allowQueries() const
diff --git a/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx b/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx
index 94f646154b58..3252a5dd510a 100644
--- a/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx
+++ b/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx
@@ -31,15 +31,20 @@ using namespace dbaui;
OFieldDescGenWin::OFieldDescGenWin( vcl::Window* pParent, OTableDesignHelpBar* pHelp ) :
TabPage( pParent, WB_3DLOOK | WB_DIALOGCONTROL )
{
- m_pFieldControl = new OTableFieldControl(this,pHelp);
+ m_pFieldControl = VclPtr<OTableFieldControl>::Create(this,pHelp);
m_pFieldControl->SetHelpId(HID_TAB_DESIGN_FIELDCONTROL);
m_pFieldControl->Show();
}
OFieldDescGenWin::~OFieldDescGenWin()
{
- boost::scoped_ptr<vcl::Window> aTemp(m_pFieldControl);
- m_pFieldControl = NULL;
+ disposeOnce();
+}
+
+void OFieldDescGenWin::dispose()
+{
+ m_pFieldControl.disposeAndClear();
+ TabPage::dispose();
}
void OFieldDescGenWin::Init()
@@ -74,7 +79,6 @@ void OFieldDescGenWin::SetControlText( sal_uInt16 nControlId, const OUString& rT
void OFieldDescGenWin::DisplayData( OFieldDescription* pFieldDescr )
{
-
m_pFieldControl->DisplayData(pFieldDescr);
}
diff --git a/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx b/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx
index 1af0ffd68876..04011c61c340 100644
--- a/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx
+++ b/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx
@@ -32,13 +32,14 @@ namespace dbaui
,public IClipboardTest
{
- OTableFieldControl *m_pFieldControl;
+ VclPtr<OTableFieldControl> m_pFieldControl;
protected:
virtual void Resize() SAL_OVERRIDE;
public:
OFieldDescGenWin( vcl::Window* pParent, OTableDesignHelpBar* pHelpBar );
virtual ~OFieldDescGenWin();
+ virtual void dispose() SAL_OVERRIDE;
virtual void GetFocus() SAL_OVERRIDE;
virtual void LoseFocus() SAL_OVERRIDE;
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx
index 5e1be232385e..d8321b173b39 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx
@@ -210,19 +210,19 @@ void OTableEditorCtrl::InitCellController()
OSL_FAIL("getMaxColumnNameLength");
}
- pNameCell = new OSQLNameEdit(&GetDataWindow(), WB_LEFT, sExtraNameChars);
+ pNameCell = VclPtr<OSQLNameEdit>::Create(&GetDataWindow(), WB_LEFT, sExtraNameChars);
pNameCell->SetMaxTextLen( nMaxTextLen );
pNameCell->setCheck( isSQL92CheckEnabled(xCon) );
// Cell type
- pTypeCell = new ListBoxControl( &GetDataWindow() );
+ pTypeCell = VclPtr<ListBoxControl>::Create( &GetDataWindow() );
pTypeCell->SetDropDownLineCount( 15 );
// Cell description
- pDescrCell = new Edit( &GetDataWindow(), WB_LEFT );
+ pDescrCell = VclPtr<Edit>::Create( &GetDataWindow(), WB_LEFT );
pDescrCell->SetMaxTextLen( MAX_DESCR_LEN );
- pHelpTextCell = new Edit( &GetDataWindow(), WB_LEFT );
+ pHelpTextCell = VclPtr<Edit>::Create( &GetDataWindow(), WB_LEFT );
pHelpTextCell->SetMaxTextLen( MAX_DESCR_LEN );
pNameCell->SetHelpId(HID_TABDESIGN_NAMECELL);
@@ -253,6 +253,11 @@ void OTableEditorCtrl::ClearModified()
OTableEditorCtrl::~OTableEditorCtrl()
{
+ disposeOnce();
+}
+
+void OTableEditorCtrl::dispose()
+{
// Reset the Undo-Manager
GetUndoManager().Clear();
@@ -269,10 +274,12 @@ OTableEditorCtrl::~OTableEditorCtrl()
Application::RemoveUserEvent( nInvalidateTypeEvent );
// Delete the control types
- delete pNameCell;
- delete pTypeCell;
- delete pDescrCell;
- delete pHelpTextCell;
+ pNameCell.disposeAndClear();
+ pTypeCell.disposeAndClear();
+ pDescrCell.disposeAndClear();
+ pHelpTextCell.disposeAndClear();
+ pDescrWin.clear();
+ OTableRowView::dispose();
}
bool OTableEditorCtrl::SetDataPtr( long nRow )
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.hxx b/dbaccess/source/ui/tabledesign/TEditControl.hxx
index bfae245eca31..03f9b4598c67 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.hxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.hxx
@@ -46,11 +46,11 @@ namespace dbaui
::std::vector< ::boost::shared_ptr<OTableRow> > m_aUndoList;
::std::vector< ::boost::shared_ptr<OTableRow> >* m_pRowList;
- OSQLNameEdit* pNameCell;
- ::svt::ListBoxControl* pTypeCell;
- Edit* pHelpTextCell;
- Edit* pDescrCell;
- OTableFieldDescWin* pDescrWin; // properties of one column
+ VclPtr<OSQLNameEdit> pNameCell;
+ VclPtr<::svt::ListBoxControl> pTypeCell;
+ VclPtr<Edit> pHelpTextCell;
+ VclPtr<Edit> pDescrCell;
+ VclPtr<OTableFieldDescWin> pDescrWin; // properties of one column
::boost::shared_ptr<OTableRow> pActRow;
@@ -71,7 +71,7 @@ namespace dbaui
{
private:
AutoTimer m_aInvalidateTimer;
- OTableEditorCtrl* m_pOwner;
+ VclPtr<OTableEditorCtrl> m_pOwner;
public:
ClipboardInvalidator(sal_uLong nTimeout,OTableEditorCtrl*);
@@ -122,6 +122,7 @@ namespace dbaui
public:
OTableEditorCtrl(vcl::Window* pParentWin);
virtual ~OTableEditorCtrl();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool CursorMoving(long nNewRow, sal_uInt16 nNewCol) SAL_OVERRIDE;
SfxUndoManager& GetUndoManager() const;
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx
index a242f10d5bbe..bb7df8cd65f8 100644
--- a/dbaccess/source/ui/tabledesign/TableController.cxx
+++ b/dbaccess/source/ui/tabledesign/TableController.cxx
@@ -285,7 +285,7 @@ bool OTableController::doSaveDoc(bool _bSaveAs)
if (!xTablesSup.is())
{
OUString aMessage(ModuleRes(STR_TABLEDESIGN_CONNECTION_MISSING));
- OSQLWarningBox( getView(), aMessage ).Execute();
+ ScopedVclPtrInstance<OSQLWarningBox>(getView(), aMessage )->Execute();
return false;
}
@@ -318,13 +318,13 @@ bool OTableController::doSaveDoc(bool _bSaveAs)
}
DynamicTableOrQueryNameCheck aNameChecker( getConnection(), CommandType::TABLE );
- OSaveAsDlg aDlg( getView(), CommandType::TABLE, getORB(), getConnection(), aDefaultName, aNameChecker );
- if ( aDlg.Execute() != RET_OK )
+ ScopedVclPtrInstance< OSaveAsDlg > aDlg( getView(), CommandType::TABLE, getORB(), getConnection(), aDefaultName, aNameChecker );
+ if ( aDlg->Execute() != RET_OK )
return false;
- m_sName = aDlg.getName();
- sCatalog = aDlg.getCatalog();
- sSchema = aDlg.getSchema();
+ m_sName = aDlg->getName();
+ sCatalog = aDlg->getCatalog();
+ sSchema = aDlg->getSchema();
}
// did we get a name
@@ -415,9 +415,9 @@ bool OTableController::doSaveDoc(bool _bSaveAs)
{
OUString sText( ModuleRes( STR_NAME_ALREADY_EXISTS ) );
sText = sText.replaceFirst( "#" , m_sName);
- OSQLMessageBox aDlg( getView(), OUString( ModuleRes( STR_ERROR_DURING_CREATION ) ), sText, WB_OK, OSQLMessageBox::Error );
+ ScopedVclPtrInstance< OSQLMessageBox > aDlg( getView(), OUString( ModuleRes( STR_ERROR_DURING_CREATION ) ), sText, WB_OK, OSQLMessageBox::Error );
- aDlg.Execute();
+ aDlg->Execute();
bError = true;
}
catch( const Exception& )
@@ -447,8 +447,8 @@ void OTableController::doEditIndexes()
// table needs to be saved before editing indexes
if (m_bNew || isModified())
{
- MessageDialog aAsk(getView(), ModuleRes(STR_QUERY_SAVE_TABLE_EDIT_INDEXES), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
- if (RET_YES != aAsk.Execute())
+ ScopedVclPtrInstance< MessageDialog > aAsk(getView(), ModuleRes(STR_QUERY_SAVE_TABLE_EDIT_INDEXES), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ if (RET_YES != aAsk->Execute())
return;
if (!doSaveDoc(false))
@@ -490,8 +490,8 @@ void OTableController::doEditIndexes()
if (!xIndexes.is())
return;
- DbaIndexDialog aDialog(getView(), aFieldNames, xIndexes, getConnection(), getORB(), isConnected() && getConnection()->getMetaData().is() ? getConnection()->getMetaData()->getMaxColumnsInIndex() : 0);
- if (RET_OK != aDialog.Execute())
+ ScopedVclPtrInstance< DbaIndexDialog > aDialog(getView(), aFieldNames, xIndexes, getConnection(), getORB(), isConnected() && getConnection()->getMetaData().is() ? getConnection()->getMetaData()->getMaxColumnsInIndex() : 0);
+ if (RET_OK != aDialog->Execute())
return;
}
@@ -522,7 +522,7 @@ void OTableController::impl_initialize()
}
catch(const SQLException&)
{
- OSQLWarningBox( getView(), ModuleRes( STR_NO_TYPE_INFO_AVAILABLE ) ).Execute();
+ ScopedVclPtrInstance<OSQLWarningBox>(getView(), ModuleRes( STR_NO_TYPE_INFO_AVAILABLE ))->Execute();
throw;
}
try
@@ -540,7 +540,7 @@ void OTableController::impl_initialize()
bool OTableController::Construct(vcl::Window* pParent)
{
- setView( * new OTableDesignView( pParent, getORB(), *this ) );
+ setView( VclPtr<OTableDesignView>::Create( pParent, getORB(), *this ) );
OTableController_BASE::Construct(pParent);
return true;
}
@@ -563,9 +563,9 @@ sal_Bool SAL_CALL OTableController::suspend(sal_Bool /*_bSuspend*/) throw( Runti
::boost::mem_fn(&OTableRow::isValid));
if ( aIter != m_vRowList.end() )
{
- MessageDialog aQry(getView(), "TableDesignSaveModifiedDialog",
- "dbaccess/ui/tabledesignsavemodifieddialog.ui");
- switch (aQry.Execute())
+ ScopedVclPtrInstance<MessageDialog> aQry(getView(), "TableDesignSaveModifiedDialog",
+ "dbaccess/ui/tabledesignsavemodifieddialog.ui");
+ switch (aQry->Execute())
{
case RET_YES:
Execute(ID_BROWSER_SAVEDOC,Sequence<PropertyValue>());
@@ -580,9 +580,9 @@ sal_Bool SAL_CALL OTableController::suspend(sal_Bool /*_bSuspend*/) throw( Runti
}
else if ( !m_bNew )
{
- MessageDialog aQry(getView(), "DeleteAllRowsDialog",
- "dbaccess/ui/deleteallrowsdialog.ui");
- switch (aQry.Execute())
+ ScopedVclPtrInstance<MessageDialog> aQry(getView(), "DeleteAllRowsDialog",
+ "dbaccess/ui/deleteallrowsdialog.ui");
+ switch (aQry->Execute())
{
case RET_YES:
{
@@ -936,7 +936,7 @@ bool OTableController::checkColumns(bool _bNew)
{
OUString strMessage = ModuleRes(STR_TABLEDESIGN_DUPLICATE_NAME);
strMessage = strMessage.replaceFirst("$column$", pFieldDesc->GetName());
- OSQLWarningBox( getView(), strMessage ).Execute();
+ ScopedVclPtrInstance<OSQLWarningBox>(getView(), strMessage)->Execute();
return false;
}
}
@@ -946,9 +946,9 @@ bool OTableController::checkColumns(bool _bNew)
{
OUString sTitle(ModuleRes(STR_TABLEDESIGN_NO_PRIM_KEY_HEAD));
OUString sMsg(ModuleRes(STR_TABLEDESIGN_NO_PRIM_KEY));
- OSQLMessageBox aBox(getView(), sTitle,sMsg, WB_YES_NO_CANCEL | WB_DEF_YES);
+ ScopedVclPtrInstance< OSQLMessageBox > aBox(getView(), sTitle,sMsg, WB_YES_NO_CANCEL | WB_DEF_YES);
- switch ( aBox.Execute() )
+ switch ( aBox->Execute() )
{
case RET_YES:
{
@@ -1075,8 +1075,8 @@ void OTableController::alterColumns()
aMessage = aMessage.replaceFirst( "$column$", pField->GetName() );
SQLExceptionInfo aError( ::cppu::getCaughtException() );
- OSQLWarningBox aMsg( getView(), aMessage, WB_YES_NO | WB_DEF_YES , &aError );
- bNotOk = aMsg.Execute() == RET_YES;
+ ScopedVclPtrInstance< OSQLWarningBox > aMsg( getView(), aMessage, WB_YES_NO | WB_DEF_YES , &aError );
+ bNotOk = aMsg->Execute() == RET_YES;
}
else
throw;
@@ -1131,8 +1131,8 @@ void OTableController::alterColumns()
{
OUString aMessage(ModuleRes(STR_TABLEDESIGN_ALTER_ERROR));
aMessage = aMessage.replaceFirst("$column$",pField->GetName());
- OSQLWarningBox aMsg( getView(), aMessage, WB_YES_NO | WB_DEF_YES );
- if ( aMsg.Execute() != RET_YES )
+ ScopedVclPtrInstance< OSQLWarningBox > aMsg( getView(), aMessage, WB_YES_NO | WB_DEF_YES );
+ if ( aMsg->Execute() != RET_YES )
{
Reference<XPropertySet> xNewColumn(xIdxColumns->getByIndex(nPos),UNO_QUERY_THROW);
OUString sName;
@@ -1198,8 +1198,8 @@ void OTableController::alterColumns()
OUString aMsgT(ModuleRes(STR_TBL_COLUMN_IS_KEYCOLUMN));
aMsgT = aMsgT.replaceFirst("$column$",*pIter);
OUString aTitle(ModuleRes(STR_TBL_COLUMN_IS_KEYCOLUMN_TITLE));
- OSQLMessageBox aMsg(getView(),aTitle,aMsgT,WB_YES_NO| WB_DEF_YES);
- if(aMsg.Execute() == RET_YES)
+ ScopedVclPtrInstance< OSQLMessageBox > aMsg(getView(),aTitle,aMsgT,WB_YES_NO| WB_DEF_YES);
+ if(aMsg->Execute() == RET_YES)
{
xKeyColumns = NULL;
dropPrimaryKey();
diff --git a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx
index a92af1c10353..81dfc575169d 100644
--- a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx
@@ -48,11 +48,6 @@ OTableRowView::OTableRowView(vcl::Window* pParent)
}
-OTableRowView::~OTableRowView()
-{
-
-}
-
void OTableRowView::Init()
{
EditBrowseBox::Init();
diff --git a/dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx b/dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx
index a5f2010fb15d..5c1fcc11f340 100644
--- a/dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx
+++ b/dbaccess/source/ui/tabledesign/TableDesignHelpBar.cxx
@@ -29,7 +29,7 @@ using namespace dbaui;
OTableDesignHelpBar::OTableDesignHelpBar( vcl::Window* pParent ) :
TabPage( pParent, WB_3DLOOK )
{
- m_pTextWin = new MultiLineEdit( this, WB_VSCROLL | WB_LEFT | WB_BORDER | WB_NOTABSTOP | WB_READONLY);
+ m_pTextWin = VclPtr<MultiLineEdit>::Create( this, WB_VSCROLL | WB_LEFT | WB_BORDER | WB_NOTABSTOP | WB_READONLY);
m_pTextWin->SetHelpId(HID_TABLE_DESIGN_HELP_WINDOW);
m_pTextWin->SetReadOnly();
m_pTextWin->SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor() );
@@ -38,8 +38,13 @@ OTableDesignHelpBar::OTableDesignHelpBar( vcl::Window* pParent ) :
OTableDesignHelpBar::~OTableDesignHelpBar()
{
- boost::scoped_ptr<vcl::Window> aTemp(m_pTextWin);
- m_pTextWin = NULL;
+ disposeOnce();
+}
+
+void OTableDesignHelpBar::dispose()
+{
+ m_pTextWin.disposeAndClear();
+ TabPage::dispose();
}
void OTableDesignHelpBar::SetHelpText( const OUString& rText )
diff --git a/dbaccess/source/ui/tabledesign/TableDesignView.cxx b/dbaccess/source/ui/tabledesign/TableDesignView.cxx
index 996a84c0e162..9b5598f11a9b 100644
--- a/dbaccess/source/ui/tabledesign/TableDesignView.cxx
+++ b/dbaccess/source/ui/tabledesign/TableDesignView.cxx
@@ -42,13 +42,13 @@ using namespace ::com::sun::star::beans;
// class OTableBorderWindow
OTableBorderWindow::OTableBorderWindow(vcl::Window* pParent) : Window(pParent,WB_BORDER)
- ,m_aHorzSplitter( this )
+ ,m_aHorzSplitter( VclPtr<Splitter>::Create(this) )
{
ImplInitSettings( true, true, true );
// Children erzeugen
- m_pEditorCtrl = new OTableEditorCtrl( this);
- m_pFieldDescWin = new OTableFieldDescWin( this );
+ m_pEditorCtrl = VclPtr<OTableEditorCtrl>::Create( this);
+ m_pFieldDescWin = VclPtr<OTableFieldDescWin>::Create( this );
m_pFieldDescWin->SetHelpId(HID_TAB_DESIGN_DESCWIN);
@@ -56,26 +56,25 @@ OTableBorderWindow::OTableBorderWindow(vcl::Window* pParent) : Window(pParent,WB
m_pEditorCtrl->SetDescrWin(m_pFieldDescWin);
// Splitter einrichten
- m_aHorzSplitter.SetSplitHdl( LINK(this, OTableBorderWindow, SplitHdl) );
- m_aHorzSplitter.Show();
+ m_aHorzSplitter->SetSplitHdl( LINK(this, OTableBorderWindow, SplitHdl) );
+ m_aHorzSplitter->Show();
}
OTableBorderWindow::~OTableBorderWindow()
{
+ disposeOnce();
+}
+
+void OTableBorderWindow::dispose()
+{
// Children zerstoeren
// ::dbaui::notifySystemWindow(this,m_pFieldDescWin,::comphelper::mem_fun(&TaskPaneList::RemoveWindow));
m_pEditorCtrl->Hide();
m_pFieldDescWin->Hide();
-
- {
- boost::scoped_ptr<vcl::Window> aTemp(m_pEditorCtrl);
- m_pEditorCtrl = NULL;
- }
- {
- boost::scoped_ptr<vcl::Window> aTemp(m_pFieldDescWin);
- m_pFieldDescWin = NULL;
- }
-
+ m_pEditorCtrl.disposeAndClear();
+ m_pFieldDescWin.disposeAndClear();
+ m_aHorzSplitter.disposeAndClear();
+ vcl::Window::dispose();
}
void OTableBorderWindow::Resize()
@@ -86,18 +85,18 @@ void OTableBorderWindow::Resize()
Size aOutputSize( GetOutputSize() );
long nOutputWidth = aOutputSize.Width();
long nOutputHeight = aOutputSize.Height();
- long nSplitPos = m_aHorzSplitter.GetSplitPosPixel();
+ long nSplitPos = m_aHorzSplitter->GetSplitPosPixel();
// Verschiebebereich Splitter mittleres Drittel des Outputs
long nDragPosY = nOutputHeight/3;
long nDragSizeHeight = nOutputHeight/3;
- m_aHorzSplitter.SetDragRectPixel( Rectangle(Point(0,nDragPosY), Size(nOutputWidth,nDragSizeHeight) ), this );
+ m_aHorzSplitter->SetDragRectPixel( Rectangle(Point(0,nDragPosY), Size(nOutputWidth,nDragSizeHeight) ), this );
if( (nSplitPos < nDragPosY) || (nSplitPos > (nDragPosY+nDragSizeHeight)) )
nSplitPos = nDragPosY+nDragSizeHeight-5;
// Splitter setzen
- m_aHorzSplitter.SetPosSizePixel( Point( 0, nSplitPos ), Size(nOutputWidth, nSplitterHeight));
- m_aHorzSplitter.SetSplitPosPixel( nSplitPos );
+ m_aHorzSplitter->SetPosSizePixel( Point( 0, nSplitPos ), Size(nOutputWidth, nSplitterHeight));
+ m_aHorzSplitter->SetSplitPosPixel( nSplitPos );
// Fenster setzen
m_pEditorCtrl->SetPosSizePixel( Point(0, 0), Size(nOutputWidth , nSplitPos) );
@@ -108,9 +107,9 @@ void OTableBorderWindow::Resize()
IMPL_LINK( OTableBorderWindow, SplitHdl, Splitter*, pSplit )
{
- if(pSplit == &m_aHorzSplitter)
+ if(pSplit == m_aHorzSplitter.get())
{
- m_aHorzSplitter.SetPosPixel( Point( m_aHorzSplitter.GetPosPixel().X(),m_aHorzSplitter.GetSplitPosPixel() ) );
+ m_aHorzSplitter->SetPosPixel( Point( m_aHorzSplitter->GetPosPixel().X(),m_aHorzSplitter->GetSplitPosPixel() ) );
Resize();
}
return 0;
@@ -184,18 +183,20 @@ OTableDesignView::OTableDesignView( vcl::Window* pParent,
{
}
- m_pWin = new OTableBorderWindow(this);
+ m_pWin = VclPtr<OTableBorderWindow>::Create(this);
m_pWin->Show();
}
OTableDesignView::~OTableDesignView()
{
- m_pWin->Hide();
+ disposeOnce();
+}
- {
- boost::scoped_ptr<vcl::Window> aTemp(m_pWin);
- m_pWin = NULL;
- }
+void OTableDesignView::dispose()
+{
+ m_pWin->Hide();
+ m_pWin.disposeAndClear();
+ ODataView::dispose();
}
void OTableDesignView::initialize()
diff --git a/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx b/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx
index 1cd013e008cf..e0b89dbfddbe 100644
--- a/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx
+++ b/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx
@@ -50,39 +50,36 @@ OTableFieldDescWin::OTableFieldDescWin( vcl::Window* pParent)
, m_eChildFocus(NONE)
{
// Header
- m_pHeader = new FixedText( this, WB_CENTER | WB_INFO ); // | WB_3DLOOK
+ m_pHeader = VclPtr<FixedText>::Create( this, WB_CENTER | WB_INFO );
m_pHeader->SetText( OUString(ModuleRes(STR_TAB_PROPERTIES)) );
m_pHeader->Show();
// HelpBar
- m_pHelpBar = new OTableDesignHelpBar( this );
+ m_pHelpBar = VclPtr<OTableDesignHelpBar>::Create( this );
m_pHelpBar->SetHelpId(HID_TAB_DESIGN_HELP_TEXT_FRAME);
m_pHelpBar->Show();
- m_pGenPage = new OFieldDescGenWin( this, m_pHelpBar );
+ m_pGenPage = VclPtr<OFieldDescGenWin>::Create( this, m_pHelpBar );
getGenPage()->SetHelpId( HID_TABLE_DESIGN_TABPAGE_GENERAL );
getGenPage()->Show();
}
OTableFieldDescWin::~OTableFieldDescWin()
{
+ disposeOnce();
+}
+
+void OTableFieldDescWin::dispose()
+{
// destroy children
m_pHelpBar->Hide();
getGenPage()->Hide();
m_pHeader->Hide();
- {
- boost::scoped_ptr<vcl::Window> aTemp(m_pGenPage);
- m_pGenPage = NULL;
- }
- {
- boost::scoped_ptr<vcl::Window> aTemp(m_pHeader);
- m_pHeader = NULL;
- }
- {
- boost::scoped_ptr<vcl::Window> aTemp(m_pHelpBar);
- m_pHelpBar = NULL;
- }
+ m_pGenPage.disposeAndClear();
+ m_pHeader.disposeAndClear();
+ m_pHelpBar.disposeAndClear();
+ TabPage::dispose();
}
void OTableFieldDescWin::Init()
diff --git a/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx b/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx
index f2092ff35a13..a8914fd42cb3 100644
--- a/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx
+++ b/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx
@@ -41,9 +41,9 @@ namespace dbaui
NONE
};
private:
- OTableDesignHelpBar* m_pHelpBar;
- OFieldDescGenWin* m_pGenPage;
- FixedText* m_pHeader;
+ VclPtr<OTableDesignHelpBar> m_pHelpBar;
+ VclPtr<OFieldDescGenWin> m_pGenPage;
+ VclPtr<FixedText> m_pHeader;
ChildFocusState m_eChildFocus;
IClipboardTest* getActiveChild() const;
@@ -55,6 +55,7 @@ namespace dbaui
public:
OTableFieldDescWin( vcl::Window* pParent);
virtual ~OTableFieldDescWin();
+ virtual void dispose() SAL_OVERRIDE;
void Init();
diff --git a/dbaccess/source/ui/tabledesign/TableUndo.hxx b/dbaccess/source/ui/tabledesign/TableUndo.hxx
index d16e55272fbd..7646684e3a09 100644
--- a/dbaccess/source/ui/tabledesign/TableUndo.hxx
+++ b/dbaccess/source/ui/tabledesign/TableUndo.hxx
@@ -26,6 +26,7 @@
#include <com/sun/star/uno/Any.h>
#include "TypeInfo.hxx"
+#include <vcl/vclptr.hxx>
namespace dbaui
{
@@ -34,7 +35,7 @@ namespace dbaui
class OTableDesignUndoAct : public OCommentUndoAction
{
protected:
- OTableRowView* m_pTabDgnCtrl;
+ VclPtr<OTableRowView> m_pTabDgnCtrl;
virtual void Undo() SAL_OVERRIDE;
virtual void Redo() SAL_OVERRIDE;
@@ -48,7 +49,7 @@ namespace dbaui
class OTableEditorUndoAct : public OTableDesignUndoAct
{
protected:
- OTableEditorCtrl* pTabEdCtrl;
+ VclPtr<OTableEditorCtrl> pTabEdCtrl;
public:
TYPEINFO_OVERRIDE();
@@ -136,7 +137,7 @@ namespace dbaui
protected:
MultiSelection m_aDelKeys,
m_aInsKeys;
- OTableEditorCtrl* m_pEditorCtrl;
+ VclPtr<OTableEditorCtrl> m_pEditorCtrl;
virtual void Undo() SAL_OVERRIDE;
virtual void Redo() SAL_OVERRIDE;
diff --git a/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx b/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx
index 222903c1af58..3e2cb86fb94e 100644
--- a/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx
+++ b/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx
@@ -63,7 +63,7 @@ namespace dbaui
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const SAL_OVERRIDE;
protected:
// OGenericUnoDialog overridables
- virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
+ virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
};
OAdvancedSettingsDialog::OAdvancedSettingsDialog(const Reference< XComponentContext >& _rxORB)
@@ -119,10 +119,9 @@ namespace dbaui
describeProperties(aProps);
return new ::cppu::OPropertyArrayHelper(aProps);
}
- Dialog* OAdvancedSettingsDialog::createDialog(vcl::Window* _pParent)
+ VclPtr<Dialog> OAdvancedSettingsDialog::createDialog(vcl::Window* _pParent)
{
- AdvancedSettingsDialog* pDlg = new AdvancedSettingsDialog(_pParent, m_pDatasourceItems, m_aContext, m_aInitialSelection);
- return pDlg;
+ return VclPtr<AdvancedSettingsDialog>::Create(_pParent, m_pDatasourceItems, m_aContext, m_aInitialSelection);
}
} // namespace dbaui
diff --git a/dbaccess/source/ui/uno/ColumnPeer.cxx b/dbaccess/source/ui/uno/ColumnPeer.cxx
index 1422c629b3a1..7a32f0b175f6 100644
--- a/dbaccess/source/ui/uno/ColumnPeer.cxx
+++ b/dbaccess/source/ui/uno/ColumnPeer.cxx
@@ -36,7 +36,7 @@ OColumnPeer::OColumnPeer(vcl::Window* _pParent,const Reference<XComponentContext
{
osl_atomic_increment( &m_refCount );
{
- OColumnControlWindow* pFieldControl = new OColumnControlWindow(_pParent, _rxContext);
+ VclPtrInstance<OColumnControlWindow> pFieldControl(_pParent, _rxContext);
pFieldControl->SetComponentInterface(this);
pFieldControl->Show();
}
@@ -46,19 +46,16 @@ OColumnPeer::OColumnPeer(vcl::Window* _pParent,const Reference<XComponentContext
void OColumnPeer::setEditWidth(sal_Int32 _nWidth)
{
SolarMutexGuard aGuard;
-
- OColumnControlWindow* pFieldControl = static_cast<OColumnControlWindow*>( GetWindow() );
+ VclPtr<OColumnControlWindow> pFieldControl = GetAs<OColumnControlWindow>();
if ( pFieldControl )
- {
pFieldControl->setEditWidth(_nWidth);
- }
}
void OColumnPeer::setColumn(const Reference< XPropertySet>& _xColumn)
{
SolarMutexGuard aGuard;
- OColumnControlWindow* pFieldControl = static_cast<OColumnControlWindow*>( GetWindow() );
+ VclPtr<OColumnControlWindow> pFieldControl = GetAs<OColumnControlWindow>();
if ( pFieldControl )
{
if ( m_pActFieldDescr )
@@ -105,7 +102,7 @@ void OColumnPeer::setColumn(const Reference< XPropertySet>& _xColumn)
void OColumnPeer::setConnection(const Reference< XConnection>& _xCon)
{
SolarMutexGuard aGuard;
- OColumnControlWindow* pFieldControl = static_cast<OColumnControlWindow*>( GetWindow() );
+ VclPtr<OColumnControlWindow> pFieldControl = GetAs<OColumnControlWindow>();
if ( pFieldControl )
pFieldControl->setConnection(_xCon);
}
@@ -131,7 +128,7 @@ void OColumnPeer::setProperty( const OUString& _rPropertyName, const Any& Value)
Any OColumnPeer::getProperty( const OUString& _rPropertyName ) throw( RuntimeException, std::exception )
{
Any aProp;
- OFieldDescControl* pFieldControl = static_cast<OFieldDescControl*>( GetWindow() );
+ VclPtr< OFieldDescControl > pFieldControl = GetAs< OFieldDescControl >();
if (pFieldControl && _rPropertyName == PROPERTY_COLUMN)
{
aProp <<= m_xColumn;
diff --git a/dbaccess/source/ui/uno/DBTypeWizDlg.cxx b/dbaccess/source/ui/uno/DBTypeWizDlg.cxx
index 6c5d796872d1..a667d1f90e56 100644
--- a/dbaccess/source/ui/uno/DBTypeWizDlg.cxx
+++ b/dbaccess/source/ui/uno/DBTypeWizDlg.cxx
@@ -92,10 +92,9 @@ Reference<XPropertySetInfo> SAL_CALL ODBTypeWizDialog::getPropertySetInfo() thr
return new ::cppu::OPropertyArrayHelper(aProps);
}
-Dialog* ODBTypeWizDialog::createDialog(vcl::Window* _pParent)
+VclPtr<Dialog> ODBTypeWizDialog::createDialog(vcl::Window* _pParent)
{
- ODbTypeWizDialog* pDlg = new ODbTypeWizDialog(_pParent, m_pDatasourceItems, m_aContext, m_aInitialSelection);
- return pDlg;
+ return VclPtr<ODbTypeWizDialog>::Create(_pParent, m_pDatasourceItems, m_aContext, m_aInitialSelection);
}
} // namespace dbaui
diff --git a/dbaccess/source/ui/uno/DBTypeWizDlg.hxx b/dbaccess/source/ui/uno/DBTypeWizDlg.hxx
index 10df28c4e6dd..80e8830792b1 100644
--- a/dbaccess/source/ui/uno/DBTypeWizDlg.hxx
+++ b/dbaccess/source/ui/uno/DBTypeWizDlg.hxx
@@ -55,7 +55,7 @@ public:
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const SAL_OVERRIDE;
protected:
// OGenericUnoDialog overridables
- virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
+ virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
};
} // namespace dbaui
diff --git a/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx b/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx
index 4c46903fd03b..f13cc2e142e6 100644
--- a/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx
+++ b/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx
@@ -106,16 +106,16 @@ Reference<XPropertySetInfo> SAL_CALL ODBTypeWizDialogSetup::getPropertySetInfo(
return new ::cppu::OPropertyArrayHelper(aProps);
}
-Dialog* ODBTypeWizDialogSetup::createDialog(vcl::Window* _pParent)
+VclPtr<Dialog> ODBTypeWizDialogSetup::createDialog(vcl::Window* _pParent)
{
- return new ODbTypeWizDialogSetup(_pParent, m_pDatasourceItems, m_aContext, m_aInitialSelection);
+ return VclPtr<ODbTypeWizDialogSetup>::Create(_pParent, m_pDatasourceItems, m_aContext, m_aInitialSelection);
}
void ODBTypeWizDialogSetup::executedDialog(sal_Int16 _nExecutionResult)
{
if ( _nExecutionResult == RET_OK )
{
- const ODbTypeWizDialogSetup* pDialog = static_cast< ODbTypeWizDialogSetup* >( m_pDialog );
+ const ODbTypeWizDialogSetup* pDialog = static_cast< ODbTypeWizDialogSetup* >( m_pDialog.get() );
m_bOpenDatabase = pDialog->IsDatabaseDocumentToBeOpened();
m_bStartTableWizard = pDialog->IsTableWizardToBeStarted();
}
diff --git a/dbaccess/source/ui/uno/DBTypeWizDlgSetup.hxx b/dbaccess/source/ui/uno/DBTypeWizDlgSetup.hxx
index c0f6faeb86a1..2a7112678154 100644
--- a/dbaccess/source/ui/uno/DBTypeWizDlgSetup.hxx
+++ b/dbaccess/source/ui/uno/DBTypeWizDlgSetup.hxx
@@ -57,7 +57,7 @@ public:
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const SAL_OVERRIDE;
protected:
// OGenericUnoDialog overridables
- virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
+ virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
virtual void executedDialog(sal_Int16 _nExecutionResult) SAL_OVERRIDE;
};
diff --git a/dbaccess/source/ui/uno/TableFilterDlg.cxx b/dbaccess/source/ui/uno/TableFilterDlg.cxx
index 475c66457157..813736d0ecbf 100644
--- a/dbaccess/source/ui/uno/TableFilterDlg.cxx
+++ b/dbaccess/source/ui/uno/TableFilterDlg.cxx
@@ -92,10 +92,9 @@ Reference<XPropertySetInfo> SAL_CALL OTableFilterDialog::getPropertySetInfo() t
return new ::cppu::OPropertyArrayHelper(aProps);
}
-Dialog* OTableFilterDialog::createDialog(vcl::Window* _pParent)
+VclPtr<Dialog> OTableFilterDialog::createDialog(vcl::Window* _pParent)
{
- OTableSubscriptionDialog* pDlg = new OTableSubscriptionDialog(_pParent, m_pDatasourceItems, m_aContext, m_aInitialSelection);
- return pDlg;
+ return VclPtr<OTableSubscriptionDialog>::Create(_pParent, m_pDatasourceItems, m_aContext, m_aInitialSelection);
}
} // namespace dbaui
diff --git a/dbaccess/source/ui/uno/TableFilterDlg.hxx b/dbaccess/source/ui/uno/TableFilterDlg.hxx
index 9acfe840ac87..f3798c29b2d6 100644
--- a/dbaccess/source/ui/uno/TableFilterDlg.hxx
+++ b/dbaccess/source/ui/uno/TableFilterDlg.hxx
@@ -55,7 +55,7 @@ public:
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const SAL_OVERRIDE;
protected:
// OGenericUnoDialog overridables
- virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
+ virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
};
} // namespace dbaui
diff --git a/dbaccess/source/ui/uno/UserSettingsDlg.cxx b/dbaccess/source/ui/uno/UserSettingsDlg.cxx
index 55bab9fcb5a2..db51ea598542 100644
--- a/dbaccess/source/ui/uno/UserSettingsDlg.cxx
+++ b/dbaccess/source/ui/uno/UserSettingsDlg.cxx
@@ -92,10 +92,9 @@ Reference<XPropertySetInfo> SAL_CALL OUserSettingsDialog::getPropertySetInfo()
return new ::cppu::OPropertyArrayHelper(aProps);
}
-Dialog* OUserSettingsDialog::createDialog(vcl::Window* _pParent)
+VclPtr<Dialog> OUserSettingsDialog::createDialog(vcl::Window* _pParent)
{
- OUserAdminDlg* pDlg = new OUserAdminDlg(_pParent, m_pDatasourceItems, m_aContext, m_aInitialSelection, m_xActiveConnection);
- return pDlg;
+ return VclPtr<OUserAdminDlg>::Create(_pParent, m_pDatasourceItems, m_aContext, m_aInitialSelection, m_xActiveConnection);
}
} // namespace dbaui
diff --git a/dbaccess/source/ui/uno/UserSettingsDlg.hxx b/dbaccess/source/ui/uno/UserSettingsDlg.hxx
index efc682601b62..f8aa793a279e 100644
--- a/dbaccess/source/ui/uno/UserSettingsDlg.hxx
+++ b/dbaccess/source/ui/uno/UserSettingsDlg.hxx
@@ -55,7 +55,7 @@ public:
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const SAL_OVERRIDE;
protected:
// OGenericUnoDialog overridables
- virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
+ virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
};
} // namespace dbaui
diff --git a/dbaccess/source/ui/uno/admindlg.cxx b/dbaccess/source/ui/uno/admindlg.cxx
index d6f7a98d3188..adfe04c33ebe 100644
--- a/dbaccess/source/ui/uno/admindlg.cxx
+++ b/dbaccess/source/ui/uno/admindlg.cxx
@@ -92,10 +92,9 @@ Reference<XPropertySetInfo> SAL_CALL ODataSourcePropertyDialog::getPropertySetI
return new ::cppu::OPropertyArrayHelper(aProps);
}
-Dialog* ODataSourcePropertyDialog::createDialog(vcl::Window* _pParent)
+VclPtr<Dialog> ODataSourcePropertyDialog::createDialog(vcl::Window* _pParent)
{
-
- ODbAdminDialog* pDialog = new ODbAdminDialog(_pParent, m_pDatasourceItems, m_aContext);
+ VclPtrInstance<ODbAdminDialog> pDialog(_pParent, m_pDatasourceItems, m_aContext);
// the initial selection
if ( m_aInitialSelection.hasValue() )
diff --git a/dbaccess/source/ui/uno/admindlg.hxx b/dbaccess/source/ui/uno/admindlg.hxx
index d326ce1f3693..7c5737d99d5f 100644
--- a/dbaccess/source/ui/uno/admindlg.hxx
+++ b/dbaccess/source/ui/uno/admindlg.hxx
@@ -55,7 +55,7 @@ public:
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const SAL_OVERRIDE;
protected:
// OGenericUnoDialog overridables
- virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
+ virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
};
} // namespace dbaui
diff --git a/dbaccess/source/ui/uno/composerdialogs.cxx b/dbaccess/source/ui/uno/composerdialogs.cxx
index 7404f5b4d5d3..a4b29d889ecf 100644
--- a/dbaccess/source/ui/uno/composerdialogs.cxx
+++ b/dbaccess/source/ui/uno/composerdialogs.cxx
@@ -77,7 +77,7 @@ namespace dbaui
IMPLEMENT_PROPERTYCONTAINER_DEFAULTS( ComposerDialog )
- Dialog* ComposerDialog::createDialog(vcl::Window* _pParent)
+ VclPtr<Dialog> ComposerDialog::createDialog(vcl::Window* _pParent)
{
// obtain all the objects needed for the dialog
Reference< XConnection > xConnection;
@@ -140,9 +140,9 @@ namespace dbaui
return static_cast< XServiceInfo* >(new RowsetFilterDialog( comphelper::getComponentContext(_rxORB)));
}
- Dialog* RowsetFilterDialog::createComposerDialog( vcl::Window* _pParent, const Reference< XConnection >& _rxConnection, const Reference< XNameAccess >& _rxColumns )
+ VclPtr<Dialog> RowsetFilterDialog::createComposerDialog( vcl::Window* _pParent, const Reference< XConnection >& _rxConnection, const Reference< XNameAccess >& _rxColumns )
{
- return new DlgFilterCrit( _pParent, m_aContext, _rxConnection, m_xComposer, _rxColumns );
+ return VclPtr<DlgFilterCrit>::Create( _pParent, m_aContext, _rxConnection, m_xComposer, _rxColumns );
}
void SAL_CALL RowsetFilterDialog::initialize( const Sequence< Any >& aArguments ) throw (Exception, RuntimeException, std::exception)
@@ -169,7 +169,7 @@ namespace dbaui
ComposerDialog::executedDialog( _nExecutionResult );
if ( _nExecutionResult && m_pDialog )
- static_cast< DlgFilterCrit* >( m_pDialog )->BuildWherePart();
+ static_cast< DlgFilterCrit* >( m_pDialog.get() )->BuildWherePart();
}
// RowsetOrderDialog
@@ -188,9 +188,9 @@ namespace dbaui
return static_cast< XServiceInfo* >(new RowsetOrderDialog( comphelper::getComponentContext(_rxORB)));
}
- Dialog* RowsetOrderDialog::createComposerDialog( vcl::Window* _pParent, const Reference< XConnection >& _rxConnection, const Reference< XNameAccess >& _rxColumns )
+ VclPtr<Dialog> RowsetOrderDialog::createComposerDialog( vcl::Window* _pParent, const Reference< XConnection >& _rxConnection, const Reference< XNameAccess >& _rxColumns )
{
- return new DlgOrderCrit( _pParent, _rxConnection, m_xComposer, _rxColumns );
+ return VclPtr<DlgOrderCrit>::Create( _pParent, _rxConnection, m_xComposer, _rxColumns );
}
void SAL_CALL RowsetOrderDialog::initialize( const Sequence< Any >& aArguments ) throw (Exception, RuntimeException, std::exception)
@@ -216,9 +216,9 @@ namespace dbaui
return;
if ( _nExecutionResult )
- static_cast< DlgOrderCrit* >( m_pDialog )->BuildOrderPart();
+ static_cast< DlgOrderCrit* >( m_pDialog.get() )->BuildOrderPart();
else if ( m_xComposer.is() )
- m_xComposer->setOrder( static_cast< DlgOrderCrit* >( m_pDialog )->GetOrignalOrder() );
+ m_xComposer->setOrder( static_cast< DlgOrderCrit* >( m_pDialog.get() )->GetOrignalOrder() );
}
} // namespace dbaui
diff --git a/dbaccess/source/ui/uno/composerdialogs.hxx b/dbaccess/source/ui/uno/composerdialogs.hxx
index 4eb6fe8c2de1..3423427d89af 100644
--- a/dbaccess/source/ui/uno/composerdialogs.hxx
+++ b/dbaccess/source/ui/uno/composerdialogs.hxx
@@ -62,7 +62,7 @@ namespace dbaui
protected:
// own overridables
- virtual Dialog* createComposerDialog(
+ virtual VclPtr<Dialog> createComposerDialog(
vcl::Window* _pParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxColumns
@@ -70,7 +70,7 @@ namespace dbaui
private:
// OGenericUnoDialog overridables
- virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
+ virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
};
// RowsetFilterDialog
@@ -85,7 +85,7 @@ namespace dbaui
protected:
// own overridables
- virtual Dialog* createComposerDialog(
+ virtual VclPtr<Dialog> createComposerDialog(
vcl::Window* _pParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxColumns
@@ -110,7 +110,7 @@ namespace dbaui
protected:
// own overridables
- virtual Dialog* createComposerDialog(
+ virtual VclPtr<Dialog> createComposerDialog(
vcl::Window* _pParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxColumns
diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx
index cbcadf4f7376..bf5a00634914 100644
--- a/dbaccess/source/ui/uno/copytablewizard.cxx
+++ b/dbaccess/source/ui/uno/copytablewizard.cxx
@@ -193,7 +193,7 @@ namespace dbaui
virtual ~CopyTableWizard();
// OGenericUnoDialog overridables
- virtual Dialog* createDialog( vcl::Window* _pParent ) SAL_OVERRIDE;
+ virtual VclPtr<Dialog> createDialog( vcl::Window* _pParent ) SAL_OVERRIDE;
virtual void executedDialog( sal_Int16 _nExecutionResult ) SAL_OVERRIDE;
private:
@@ -548,7 +548,7 @@ void SAL_CALL CopyTableWizard::setTitle( const OUString& _rTitle ) throw (Runtim
OCopyTableWizard& CopyTableWizard::impl_getDialog_throw()
{
- OCopyTableWizard* pWizard = dynamic_cast< OCopyTableWizard* >( m_pDialog );
+ OCopyTableWizard* pWizard = dynamic_cast< OCopyTableWizard* >( m_pDialog.get() );
if ( !pWizard )
throw DisposedException( OUString(), *this );
return *pWizard;
@@ -1514,12 +1514,12 @@ void SAL_CALL CopyTableWizard::initialize( const Sequence< Any >& _rArguments )
return new ::cppu::OPropertyArrayHelper( aProps );
}
-Dialog* CopyTableWizard::createDialog( vcl::Window* _pParent )
+VclPtr<Dialog> CopyTableWizard::createDialog( vcl::Window* _pParent )
{
OSL_PRECOND( isInitialized(), "CopyTableWizard::createDialog: not initialized!" );
// this should have been prevented in ::execute already
- OCopyTableWizard* pWizard = new OCopyTableWizard(
+ VclPtrInstance<OCopyTableWizard> pWizard(
_pParent,
m_sDestinationTable,
m_nOperation,
diff --git a/dbaccess/source/ui/uno/dbinteraction.cxx b/dbaccess/source/ui/uno/dbinteraction.cxx
index 7087c3b04d13..dd2d477dfa84 100644
--- a/dbaccess/source/ui/uno/dbinteraction.cxx
+++ b/dbaccess/source/ui/uno/dbinteraction.cxx
@@ -127,8 +127,8 @@ namespace dbaui
xParamCallback = Reference< XInteractionSupplyParameters >(_rContinuations[nParamPos], UNO_QUERY);
OSL_ENSURE(xParamCallback.is(), "BasicInteractionHandler::implHandle(ParametersRequest): can't set the parameters without an appropriate interaction handler!s");
- OParameterDialog aDlg(NULL, _rParamRequest.Parameters, _rParamRequest.Connection, m_xContext);
- sal_Int16 nResult = aDlg.Execute();
+ ScopedVclPtrInstance< OParameterDialog > aDlg(nullptr, _rParamRequest.Parameters, _rParamRequest.Connection, m_xContext);
+ sal_Int16 nResult = aDlg->Execute();
try
{
switch (nResult)
@@ -136,7 +136,7 @@ namespace dbaui
case RET_OK:
if (xParamCallback.is())
{
- xParamCallback->setParameters(aDlg.getValues());
+ xParamCallback->setParameters(aDlg->getValues());
xParamCallback->select();
}
break;
@@ -182,9 +182,9 @@ namespace dbaui
}
// execute the dialog
- OSQLMessageBox aDialog(NULL, _rSqlInfo, nDialogStyle);
+ ScopedVclPtrInstance< OSQLMessageBox > aDialog(nullptr, _rSqlInfo, nDialogStyle);
// TODO: need a way to specify the parent window
- sal_Int16 nResult = aDialog.Execute();
+ sal_Int16 nResult = aDialog->Execute();
try
{
switch (nResult)
@@ -256,8 +256,8 @@ namespace dbaui
Reference< XInteractionDocumentSave > xCallback(_rContinuations[nDocuPos], UNO_QUERY);
OSL_ENSURE(xCallback.is(), "BasicInteractionHandler::implHandle(DocumentSaveRequest): can't save document without an appropriate interaction handler!s");
- OCollectionView aDlg(NULL, _rDocuRequest.Content, _rDocuRequest.Name, m_xContext);
- sal_Int16 nResult = aDlg.Execute();
+ ScopedVclPtrInstance< OCollectionView > aDlg(nullptr, _rDocuRequest.Content, _rDocuRequest.Name, m_xContext);
+ sal_Int16 nResult = aDlg->Execute();
try
{
switch (nResult)
@@ -265,7 +265,7 @@ namespace dbaui
case RET_OK:
if (xCallback.is())
{
- xCallback->setName(aDlg.getName(),aDlg.getSelectedFolder());
+ xCallback->setName(aDlg->getName(), aDlg->getSelectedFolder());
xCallback->select();
}
break;
diff --git a/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx b/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx
index d0c4969b57fb..9744b5af026b 100644
--- a/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx
+++ b/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx
@@ -104,7 +104,7 @@ namespace dbaui
protected:
// OGenericUnoDialog overridables
- virtual Dialog* createDialog( vcl::Window* _pParent ) SAL_OVERRIDE;
+ virtual VclPtr<Dialog> createDialog( vcl::Window* _pParent ) SAL_OVERRIDE;
virtual void implInitialize( const com::sun::star::uno::Any& _rValue ) SAL_OVERRIDE;
protected:
using OTextConnectionSettingsDialog_BASE::getFastPropertyValue;
@@ -204,9 +204,9 @@ namespace dbaui
return new ::cppu::OPropertyArrayHelper( aProps );
}
- Dialog* OTextConnectionSettingsDialog::createDialog(vcl::Window* _pParent)
+ VclPtr<Dialog> OTextConnectionSettingsDialog::createDialog(vcl::Window* _pParent)
{
- return new TextConnectionSettingsDialog( _pParent, *m_pDatasourceItems );
+ return VclPtr<TextConnectionSettingsDialog>::Create( _pParent, *m_pDatasourceItems );
}
void OTextConnectionSettingsDialog::implInitialize(const Any& _rValue)
diff --git a/dbaccess/source/ui/uno/unoDirectSql.cxx b/dbaccess/source/ui/uno/unoDirectSql.cxx
index 9f752dac81d0..94b57f10f090 100644
--- a/dbaccess/source/ui/uno/unoDirectSql.cxx
+++ b/dbaccess/source/ui/uno/unoDirectSql.cxx
@@ -78,7 +78,7 @@ namespace dbaui
IMPLEMENT_PROPERTYCONTAINER_DEFAULTS( ODirectSQLDialog )
- Dialog* ODirectSQLDialog::createDialog(vcl::Window* _pParent)
+ VclPtr<Dialog> ODirectSQLDialog::createDialog(vcl::Window* _pParent)
{
// obtain all the objects needed for the dialog
Reference< XConnection > xConnection = m_xActiveConnection;
@@ -99,7 +99,7 @@ namespace dbaui
// can't create the dialog if I have improper settings
return NULL;
- return new DirectSQLDialog( _pParent, xConnection);
+ return VclPtr<DirectSQLDialog>::Create( _pParent, xConnection );
}
void ODirectSQLDialog::implInitialize(const Any& _rValue)
{
diff --git a/dbaccess/source/ui/uno/unoDirectSql.hxx b/dbaccess/source/ui/uno/unoDirectSql.hxx
index 43844874009e..d3330170b538 100644
--- a/dbaccess/source/ui/uno/unoDirectSql.hxx
+++ b/dbaccess/source/ui/uno/unoDirectSql.hxx
@@ -57,7 +57,7 @@ namespace dbaui
protected:
// OGenericUnoDialog overridables
- virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
+ virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
virtual void implInitialize(const com::sun::star::uno::Any& _rValue) SAL_OVERRIDE;
};
diff --git a/dbaccess/source/ui/uno/unosqlmessage.cxx b/dbaccess/source/ui/uno/unosqlmessage.cxx
index ec22c959d384..914974d9efed 100644
--- a/dbaccess/source/ui/uno/unosqlmessage.cxx
+++ b/dbaccess/source/ui/uno/unosqlmessage.cxx
@@ -141,13 +141,13 @@ Reference<XPropertySetInfo> SAL_CALL OSQLMessageDialog::getPropertySetInfo() th
return new ::cppu::OPropertyArrayHelper(aProps);
}
-Dialog* OSQLMessageDialog::createDialog(vcl::Window* _pParent)
+VclPtr<Dialog> OSQLMessageDialog::createDialog(vcl::Window* _pParent)
{
if ( m_aException.hasValue() )
- return new OSQLMessageBox( _pParent, SQLExceptionInfo( m_aException ), WB_OK | WB_DEF_OK, m_sHelpURL );
+ return VclPtr<OSQLMessageBox>::Create( _pParent, SQLExceptionInfo( m_aException ), WB_OK | WB_DEF_OK, m_sHelpURL );
OSL_FAIL("OSQLMessageDialog::createDialog : You should use the SQLException property to specify the error to display!");
- return new OSQLMessageBox(_pParent, SQLException());
+ return VclPtr<OSQLMessageBox>::Create(_pParent, SQLException());
}
} // namespace dbaui
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index f0c5d8090458..389389294551 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -709,9 +709,9 @@ void Desktop::HandleBootstrapPathErrors( ::utl::Bootstrap::Status aBootstrapStat
OUString const aMessage(aDiagnosticMessage + "\n");
- MessageDialog aBootstrapFailedBox(NULL, aMessage);
- aBootstrapFailedBox.SetText( aProductKey );
- aBootstrapFailedBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aBootstrapFailedBox(nullptr, aMessage);
+ aBootstrapFailedBox->SetText( aProductKey );
+ aBootstrapFailedBox->Execute();
}
}
@@ -2355,8 +2355,8 @@ void Desktop::OpenClients()
ResMgr* pDtResMgr = GetDesktopResManager();
if( pDtResMgr )
{
- MessageDialog aBox(NULL, ResId(STR_ERR_PRINTDISABLED, *pDtResMgr));
- aBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aBox(nullptr, ResId(STR_ERR_PRINTDISABLED, *pDtResMgr));
+ aBox->Execute();
}
}
diff --git a/desktop/source/app/cmdlinehelp.hxx b/desktop/source/app/cmdlinehelp.hxx
index 07b4f520979d..d7b7233ab3ac 100644
--- a/desktop/source/app/cmdlinehelp.hxx
+++ b/desktop/source/app/cmdlinehelp.hxx
@@ -34,10 +34,10 @@ namespace desktop
public:
CmdlineHelpDialog();
- FixedText* m_pftHead;
- FixedText* m_pftLeft;
- FixedText* m_pftRight;
- FixedText* m_pftBottom;
+ VclPtr<FixedText> m_pftHead;
+ VclPtr<FixedText> m_pftLeft;
+ VclPtr<FixedText> m_pftRight;
+ VclPtr<FixedText> m_pftBottom;
};
#endif
}
diff --git a/desktop/source/app/lockfile2.cxx b/desktop/source/app/lockfile2.cxx
index c590ab7cf799..7636431048a6 100644
--- a/desktop/source/app/lockfile2.cxx
+++ b/desktop/source/app/lockfile2.cxx
@@ -38,22 +38,22 @@ bool Lockfile_execWarning( Lockfile * that )
OString aTime = aConfig.ReadKey( LOCKFILE_TIMEKEY );
// display warning and return response
- MessageDialog aBox(NULL, DesktopResId(STR_QUERY_USERDATALOCKED),
- VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ ScopedVclPtrInstance<MessageDialog> aBox(nullptr, DesktopResId(STR_QUERY_USERDATALOCKED),
+ VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
// set box title
OUString aTitle = OUString( DesktopResId( STR_TITLE_USERDATALOCKED ));
- aBox.SetText( aTitle );
+ aBox->SetText( aTitle );
// insert values...
- OUString aMsgText = aBox.get_primary_text();
+ OUString aMsgText = aBox->get_primary_text();
aMsgText = aMsgText.replaceFirst(
"$u", OStringToOUString( aUser, RTL_TEXTENCODING_ASCII_US) );
aMsgText = aMsgText.replaceFirst(
"$h", OStringToOUString( aHost, RTL_TEXTENCODING_ASCII_US) );
aMsgText = aMsgText.replaceFirst(
"$t", OStringToOUString( aTime, RTL_TEXTENCODING_ASCII_US) );
- aBox.set_primary_text(aMsgText);
+ aBox->set_primary_text(aMsgText);
// do it
- return aBox.Execute( ) == RET_YES;
+ return aBox->Execute( ) == RET_YES;
}
}
diff --git a/desktop/source/deployment/gui/dp_gui_dependencydialog.cxx b/desktop/source/deployment/gui/dp_gui_dependencydialog.cxx
index da831ad9b38f..56db76bd1b64 100644
--- a/desktop/source/deployment/gui/dp_gui_dependencydialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dependencydialog.cxx
@@ -50,6 +50,14 @@ DependencyDialog::DependencyDialog(
}
}
-DependencyDialog::~DependencyDialog() {}
+DependencyDialog::~DependencyDialog()
+{
+ disposeOnce();
+}
+void DependencyDialog::dispose()
+{
+ m_list.clear();
+ ModalDialog::dispose();
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/gui/dp_gui_dependencydialog.hxx b/desktop/source/deployment/gui/dp_gui_dependencydialog.hxx
index 1175470c33d5..2d7d3e9a13da 100644
--- a/desktop/source/deployment/gui/dp_gui_dependencydialog.hxx
+++ b/desktop/source/deployment/gui/dp_gui_dependencydialog.hxx
@@ -37,14 +37,14 @@ class DependencyDialog: public ModalDialog {
public:
DependencyDialog(
vcl::Window * parent, std::vector< OUString > const & dependencies);
-
virtual ~DependencyDialog();
+ virtual void dispose() SAL_OVERRIDE;
private:
DependencyDialog(DependencyDialog &) SAL_DELETED_FUNCTION;
void operator =(DependencyDialog &) SAL_DELETED_FUNCTION;
- ListBox* m_list;
+ VclPtr<ListBox> m_list;
};
}
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index 0aba4b407dcb..60c9db1ee306 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -116,11 +116,11 @@ class ExtBoxWithBtns_Impl : public ExtensionBox_Impl
{
bool m_bInterfaceLocked;
- PushButton *m_pOptionsBtn;
- PushButton *m_pEnableBtn;
- PushButton *m_pRemoveBtn;
+ VclPtr<PushButton> m_pOptionsBtn;
+ VclPtr<PushButton> m_pEnableBtn;
+ VclPtr<PushButton> m_pRemoveBtn;
- ExtMgrDialog *m_pParent;
+ VclPtr<ExtMgrDialog> m_pParent;
void SetButtonPos( const Rectangle& rRect );
void SetButtonStatus( const TEntry_Impl& rEntry );
@@ -137,6 +137,7 @@ class ExtBoxWithBtns_Impl : public ExtensionBox_Impl
public:
ExtBoxWithBtns_Impl(vcl::Window* pParent);
virtual ~ExtBoxWithBtns_Impl();
+ virtual void dispose() SAL_OVERRIDE;
void InitFromDialog(ExtMgrDialog *pParentDialog);
@@ -165,9 +166,9 @@ void ExtBoxWithBtns_Impl::InitFromDialog(ExtMgrDialog *pParentDialog)
m_pParent = pParentDialog;
- m_pOptionsBtn = new PushButton( this, WB_TABSTOP );
- m_pEnableBtn = new PushButton( this, WB_TABSTOP );
- m_pRemoveBtn = new PushButton( this, WB_TABSTOP );
+ m_pOptionsBtn = VclPtr<PushButton>::Create( this, WB_TABSTOP );
+ m_pEnableBtn = VclPtr<PushButton>::Create( this, WB_TABSTOP );
+ m_pRemoveBtn = VclPtr<PushButton>::Create( this, WB_TABSTOP );
SetHelpId( HID_EXTENSION_MANAGER_LISTBOX );
m_pOptionsBtn->SetHelpId( HID_EXTENSION_MANAGER_LISTBOX_OPTIONS );
@@ -202,9 +203,16 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeExtBoxWithBtns(vcl::Wi
ExtBoxWithBtns_Impl::~ExtBoxWithBtns_Impl()
{
- delete m_pOptionsBtn;
- delete m_pEnableBtn;
- delete m_pRemoveBtn;
+ disposeOnce();
+}
+
+void ExtBoxWithBtns_Impl::dispose()
+{
+ m_pOptionsBtn.disposeAndClear();
+ m_pEnableBtn.disposeAndClear();
+ m_pRemoveBtn.disposeAndClear();
+ m_pParent.clear();
+ ExtensionBox_Impl::dispose();
}
@@ -400,8 +408,8 @@ void ExtBoxWithBtns_Impl::MouseButtonDown( const MouseEvent& rMEvt )
break;
case CMD_SHOW_LICENSE:
{
- ShowLicenseDialog aLicenseDlg( m_pParent, GetEntryData( nPos )->m_xPackage );
- aLicenseDlg.Execute();
+ ScopedVclPtrInstance< ShowLicenseDialog > aLicenseDlg( m_pParent, GetEntryData( nPos )->m_xPackage );
+ aLicenseDlg->Execute();
break;
}
}
@@ -587,12 +595,11 @@ bool DialogHelper::continueOnSharedExtension( const uno::Reference< deployment::
if ( !bHadWarning && IsSharedPkgMgr( xPackage ) )
{
const SolarMutexGuard guard;
- MessageDialog aInfoBox(pParent, getResId(nResID),
- VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL);
-
+ ScopedVclPtrInstance<MessageDialog> aInfoBox(pParent, getResId(nResID),
+ VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL);
bHadWarning = true;
- if ( RET_OK == aInfoBox.Execute() )
+ if ( RET_OK == aInfoBox->Execute() )
return true;
else
return false;
@@ -619,32 +626,32 @@ void DialogHelper::openWebBrowser( const OUString & sURL, const OUString &sTitle
uno::Any exc( ::cppu::getCaughtException() );
OUString msg( ::comphelper::anyToString( exc ) );
const SolarMutexGuard guard;
- MessageDialog aErrorBox(NULL, msg);
- aErrorBox.SetText( sTitle );
- aErrorBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(nullptr, msg);
+ aErrorBox->SetText( sTitle );
+ aErrorBox->Execute();
}
}
bool DialogHelper::installExtensionWarn( const OUString &rExtensionName ) const
{
const SolarMutexGuard guard;
- MessageDialog aInfo(m_pVCLWindow, getResId(RID_STR_WARNING_INSTALL_EXTENSION),
- VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL);
+ ScopedVclPtrInstance<MessageDialog> aInfo(m_pVCLWindow, getResId(RID_STR_WARNING_INSTALL_EXTENSION),
+ VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL);
- OUString sText(aInfo.get_primary_text());
+ OUString sText(aInfo->get_primary_text());
sText = sText.replaceAll("%NAME", rExtensionName);
- aInfo.set_primary_text(sText);
+ aInfo->set_primary_text(sText);
- return ( RET_OK == aInfo.Execute() );
+ return ( RET_OK == aInfo->Execute() );
}
bool DialogHelper::installForAllUsers( bool &bInstallForAll ) const
{
const SolarMutexGuard guard;
- MessageDialog aQuery(m_pVCLWindow, "InstallForAllDialog",
- "desktop/ui/installforalldialog.ui");
+ ScopedVclPtrInstance<MessageDialog> aQuery(m_pVCLWindow, "InstallForAllDialog",
+ "desktop/ui/installforalldialog.ui");
- short nRet = aQuery.Execute();
+ short nRet = aQuery->Execute();
if (nRet == RET_CANCEL)
return false;
@@ -716,7 +723,24 @@ ExtMgrDialog::ExtMgrDialog(vcl::Window *pParent, TheExtensionManager *pManager)
ExtMgrDialog::~ExtMgrDialog()
{
+ disposeOnce();
+}
+
+void ExtMgrDialog::dispose()
+{
m_aIdle.Stop();
+ m_pExtensionBox.clear();
+ m_pAddBtn.clear();
+ m_pUpdateBtn.clear();
+ m_pCloseBtn.clear();
+ m_pBundledCbx.clear();
+ m_pSharedCbx.clear();
+ m_pUserCbx.clear();
+ m_pGetExtensions.clear();
+ m_pProgressText.clear();
+ m_pProgressBar.clear();
+ m_pCancelBtn.clear();
+ ModelessDialog::dispose();
}
@@ -769,14 +793,14 @@ void ExtMgrDialog::checkEntries()
bool ExtMgrDialog::removeExtensionWarn( const OUString &rExtensionName ) const
{
const SolarMutexGuard guard;
- MessageDialog aInfo(const_cast<ExtMgrDialog*>(this), getResId(RID_STR_WARNING_REMOVE_EXTENSION),
- VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL);
+ ScopedVclPtrInstance<MessageDialog> aInfo(const_cast<ExtMgrDialog*>(this), getResId(RID_STR_WARNING_REMOVE_EXTENSION),
+ VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL);
- OUString sText(aInfo.get_primary_text());
+ OUString sText(aInfo->get_primary_text());
sText = sText.replaceAll("%NAME", rExtensionName);
- aInfo.set_primary_text(sText);
+ aInfo->set_primary_text(sText);
- return ( RET_OK == aInfo.Execute() );
+ return ( RET_OK == aInfo->Execute() );
}
bool ExtMgrDialog::enablePackage( const uno::Reference< deployment::XPackage > &xPackage,
@@ -1197,7 +1221,20 @@ UpdateRequiredDialog::UpdateRequiredDialog(vcl::Window *pParent, TheExtensionMan
UpdateRequiredDialog::~UpdateRequiredDialog()
{
+ disposeOnce();
+}
+
+void UpdateRequiredDialog::dispose()
+{
m_aIdle.Stop();
+ m_pExtensionBox.clear();
+ m_pUpdateNeeded.clear();
+ m_pUpdateBtn.clear();
+ m_pCloseBtn.clear();
+ m_pCancelBtn.clear();
+ m_pProgressText.clear();
+ m_pProgressBar.clear();
+ ModalDialog::dispose();
}
long UpdateRequiredDialog::addPackageToList( const uno::Reference< deployment::XPackage > &xPackage,
@@ -1570,6 +1607,16 @@ ShowLicenseDialog::ShowLicenseDialog( vcl::Window * pParent,
m_pLicenseText->SetText(xPackage->getLicenseText());
}
+ShowLicenseDialog::~ShowLicenseDialog()
+{
+ disposeOnce();
+}
+
+void ShowLicenseDialog::dispose()
+{
+ m_pLicenseText.clear();
+ ModalDialog::dispose();
+}
// UpdateRequiredDialogService
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.hxx b/desktop/source/deployment/gui/dp_gui_dialog2.hxx
index 0db6be025f18..2f6052be71af 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.hxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.hxx
@@ -55,7 +55,7 @@ class TheExtensionManager;
class DialogHelper
{
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
- Dialog* m_pVCLWindow;
+ VclPtr<Dialog> m_pVCLWindow;
ImplSVEvent * m_nEventID;
bool m_bIsBusy;
@@ -99,17 +99,17 @@ public:
class ExtMgrDialog : public ModelessDialog,
public DialogHelper
{
- ExtBoxWithBtns_Impl *m_pExtensionBox;
- PushButton *m_pAddBtn;
- PushButton *m_pUpdateBtn;
- CloseButton *m_pCloseBtn;
- CheckBox *m_pBundledCbx;
- CheckBox *m_pSharedCbx;
- CheckBox *m_pUserCbx;
- FixedHyperlink *m_pGetExtensions;
- FixedText *m_pProgressText;
- ProgressBar *m_pProgressBar;
- CancelButton *m_pCancelBtn;
+ VclPtr<ExtBoxWithBtns_Impl> m_pExtensionBox;
+ VclPtr<PushButton> m_pAddBtn;
+ VclPtr<PushButton> m_pUpdateBtn;
+ VclPtr<CloseButton> m_pCloseBtn;
+ VclPtr<CheckBox> m_pBundledCbx;
+ VclPtr<CheckBox> m_pSharedCbx;
+ VclPtr<CheckBox> m_pUserCbx;
+ VclPtr<FixedHyperlink> m_pGetExtensions;
+ VclPtr<FixedText> m_pProgressText;
+ VclPtr<ProgressBar> m_pProgressBar;
+ VclPtr<CancelButton> m_pCancelBtn;
const OUString m_sAddPackages;
OUString m_sProgressText;
OUString m_sLastFolderURL;
@@ -141,6 +141,7 @@ class ExtMgrDialog : public ModelessDialog,
public:
ExtMgrDialog( vcl::Window * pParent, TheExtensionManager *pManager );
virtual ~ExtMgrDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual bool Close() SAL_OVERRIDE;
@@ -173,13 +174,13 @@ public:
class UpdateRequiredDialog : public ModalDialog,
public DialogHelper
{
- ExtensionBox_Impl* m_pExtensionBox;
- FixedText* m_pUpdateNeeded;
- PushButton* m_pUpdateBtn;
- PushButton* m_pCloseBtn;
- CancelButton* m_pCancelBtn;
- FixedText* m_pProgressText;
- ProgressBar* m_pProgressBar;
+ VclPtr<ExtensionBox_Impl> m_pExtensionBox;
+ VclPtr<FixedText> m_pUpdateNeeded;
+ VclPtr<PushButton> m_pUpdateBtn;
+ VclPtr<PushButton> m_pCloseBtn;
+ VclPtr<CancelButton> m_pCancelBtn;
+ VclPtr<FixedText> m_pProgressText;
+ VclPtr<ProgressBar> m_pProgressBar;
const OUString m_sAddPackages;
const OUString m_sCloseText;
OUString m_sProgressText;
@@ -212,6 +213,7 @@ class UpdateRequiredDialog : public ModalDialog,
public:
UpdateRequiredDialog( vcl::Window * pParent, TheExtensionManager *pManager );
virtual ~UpdateRequiredDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
virtual bool Close() SAL_OVERRIDE;
@@ -240,9 +242,11 @@ public:
class ShowLicenseDialog : public ModalDialog
{
- VclMultiLineEdit* m_pLicenseText;
+ VclPtr<VclMultiLineEdit> m_pLicenseText;
public:
ShowLicenseDialog(vcl::Window * pParent, const css::uno::Reference< css::deployment::XPackage > &xPackage);
+ virtual ~ShowLicenseDialog();
+ virtual void dispose() SAL_OVERRIDE;
};
diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
index adcb6c740fa3..7e97c526d33c 100644
--- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
@@ -451,12 +451,12 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
verExc.Deployed->getDisplayName());
{
SolarMutexGuard guard;
- MessageDialog box(m_pDialogHelper? m_pDialogHelper->getWindow() : NULL,
- ResId(id, *DeploymentGuiResMgr::get()), VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL);
+ ScopedVclPtrInstance<MessageDialog> box(m_pDialogHelper? m_pDialogHelper->getWindow() : NULL,
+ ResId(id, *DeploymentGuiResMgr::get()), VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL);
OUString s;
if (bEqualNames)
{
- s = box.get_primary_text();
+ s = box->get_primary_text();
}
else if (id == RID_STR_WARNING_VERSION_EQUAL)
{
@@ -477,8 +477,8 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
s = s.replaceAll("$OLDNAME", verExc.Deployed->getDisplayName());
s = s.replaceAll("$NEW", getVersion(verExc.NewVersion));
s = s.replaceAll("$DEPLOYED", getVersion(verExc.Deployed));
- box.set_primary_text(s);
- approve = box.Execute() == RET_OK;
+ box->set_primary_text(s);
+ approve = box->Execute() == RET_OK;
abort = !approve;
}
}
@@ -506,8 +506,8 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
SolarMutexGuard guard;
OUString sMsg(ResId(RID_STR_UNSUPPORTED_PLATFORM, *DeploymentGuiResMgr::get()).toString());
sMsg = sMsg.replaceAll("%Name", platExc.package->getDisplayName());
- MessageDialog box(m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, sMsg);
- box.Execute();
+ ScopedVclPtrInstance< MessageDialog > box(m_pDialogHelper? m_pDialogHelper->getWindow() : nullptr, sMsg);
+ box->Execute();
approve = true;
}
@@ -571,7 +571,7 @@ void ProgressCmdEnv::update_( uno::Any const & rStatus )
text = ::comphelper::anyToString( rStatus ); // fallback
const SolarMutexGuard aGuard;
- const boost::scoped_ptr<MessageDialog> aBox(new MessageDialog(m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, text));
+ ScopedVclPtrInstance< MessageDialog > aBox(m_pDialogHelper? m_pDialogHelper->getWindow() : nullptr, text);
aBox->Execute();
}
++m_nCurrentProgress;
@@ -813,8 +813,8 @@ void ExtensionCmdQueue::Thread::execute()
msg = ::comphelper::anyToString(exc);
const SolarMutexGuard guard;
- boost::scoped_ptr<MessageDialog> box(
- new MessageDialog(currentCmdEnv->activeDialog(), msg));
+ ScopedVclPtr<MessageDialog> box(
+ VclPtr<MessageDialog>::Create(currentCmdEnv->activeDialog(), msg));
if ( m_pDialogHelper )
box->SetText( m_pDialogHelper->getWindow()->GetText() );
box->Execute();
@@ -923,12 +923,10 @@ void ExtensionCmdQueue::Thread::_removeExtension( ::rtl::Reference< ProgressCmdE
void ExtensionCmdQueue::Thread::_checkForUpdates(
const std::vector<uno::Reference<deployment::XPackage > > &vExtensionList )
{
- UpdateDialog* pUpdateDialog;
- std::vector< UpdateData > vData;
-
const SolarMutexGuard guard;
- pUpdateDialog = new UpdateDialog( m_xContext, m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, vExtensionList, &vData );
+ std::vector< UpdateData > vData;
+ ScopedVclPtrInstance<UpdateDialog> pUpdateDialog( m_xContext, m_pDialogHelper? m_pDialogHelper->getWindow() : nullptr, vExtensionList, &vData );
pUpdateDialog->notifyMenubar( true, false ); // prepare the checking, if there updates to be notified via menu bar icon
@@ -970,7 +968,7 @@ void ExtensionCmdQueue::Thread::_checkForUpdates(
else
pUpdateDialog->notifyMenubar( false, false ); // check if there updates to be notified via menu bar icon
- delete pUpdateDialog;
+ pUpdateDialog.disposeAndClear();
}
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
index ade275724174..1b3f6a17fc8e 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
@@ -201,7 +201,7 @@ void ExtensionBox_Impl::Init()
{
SetHelpId( HID_EXTENSION_MANAGER_LISTBOX );
- m_pScrollBar = new ScrollBar( this, WB_VERT );
+ m_pScrollBar = VclPtr<ScrollBar>::Create( this, WB_VERT );
m_pScrollBar->SetScrollHdl( LINK( this, ExtensionBox_Impl, ScrollHdl ) );
m_pScrollBar->EnableDrag();
@@ -239,6 +239,11 @@ void ExtensionBox_Impl::Init()
ExtensionBox_Impl::~ExtensionBox_Impl()
{
+ disposeOnce();
+}
+
+void ExtensionBox_Impl::dispose()
+{
if ( ! m_bInDelete )
DeleteRemoved();
@@ -248,22 +253,19 @@ ExtensionBox_Impl::~ExtensionBox_Impl()
for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
{
- if ( (*iIndex)->m_pPublisher )
- {
- delete (*iIndex)->m_pPublisher;
- (*iIndex)->m_pPublisher = NULL;
- }
+ (*iIndex)->m_pPublisher.disposeAndClear();
(*iIndex)->m_xPackage->removeEventListener( uno::Reference< lang::XEventListener > ( m_xRemoveListener, uno::UNO_QUERY ) );
}
m_vEntries.clear();
- delete m_pScrollBar;
+ m_pScrollBar.disposeAndClear();
m_xRemoveListener.clear();
delete m_pLocale;
delete m_pCollator;
+ ::svt::IExtensionListBox::dispose();
}
@@ -433,11 +435,7 @@ void ExtensionBox_Impl::DeleteRemoved()
for ( ITER iIndex = m_vRemovedEntries.begin(); iIndex < m_vRemovedEntries.end(); ++iIndex )
{
- if ( (*iIndex)->m_pPublisher )
- {
- delete (*iIndex)->m_pPublisher;
- (*iIndex)->m_pPublisher = NULL;
- }
+ (*iIndex)->m_pPublisher.disposeAndClear();
}
m_vRemovedEntries.clear();
@@ -546,7 +544,7 @@ void ExtensionBox_Impl::DrawRow( const Rectangle& rRect, const TEntry_Impl& rEnt
// Init publisher link here
if ( !rEntry->m_pPublisher && !rEntry->m_sPublisher.isEmpty() )
{
- rEntry->m_pPublisher = new FixedHyperlink( this );
+ rEntry->m_pPublisher = VclPtr<FixedHyperlink>::Create( this );
rEntry->m_pPublisher->SetBackground();
rEntry->m_pPublisher->SetPaintTransparent( true );
rEntry->m_pPublisher->SetURL( rEntry->m_sPublisherURL );
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
index 1590f82500a5..d49e4a132690 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
@@ -78,7 +78,7 @@ struct Entry_Impl
OUString m_sLicenseText;
Image m_aIcon;
Image m_aIconHC;
- FixedHyperlink* m_pPublisher;
+ VclPtr<FixedHyperlink> m_pPublisher;
::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage> m_xPackage;
@@ -99,7 +99,7 @@ class ExtensionBox_Impl;
class ExtensionRemovedListener : public ::cppu::WeakImplHelper1< ::com::sun::star::lang::XEventListener >
{
- ExtensionBox_Impl *m_pParent;
+ VclPtr<ExtensionBox_Impl> m_pParent;
public:
@@ -134,7 +134,7 @@ class ExtensionBox_Impl : public ::svt::IExtensionListBox
Image m_aDefaultImage;
Link m_aClickHdl;
- ScrollBar *m_pScrollBar;
+ VclPtr<ScrollBar> m_pScrollBar;
com::sun::star::uno::Reference< ExtensionRemovedListener > m_xRemoveListener;
@@ -182,6 +182,7 @@ class ExtensionBox_Impl : public ::svt::IExtensionListBox
public:
ExtensionBox_Impl(vcl::Window* pParent);
virtual ~ExtensionBox_Impl();
+ virtual void dispose() SAL_OVERRIDE;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void Paint( const Rectangle &rPaintRect ) SAL_OVERRIDE;
diff --git a/desktop/source/deployment/gui/dp_gui_service.cxx b/desktop/source/deployment/gui/dp_gui_service.cxx
index 45839a498619..f07042d44a23 100644
--- a/desktop/source/deployment/gui/dp_gui_service.cxx
+++ b/desktop/source/deployment/gui/dp_gui_service.cxx
@@ -223,9 +223,8 @@ void ServiceImpl::startExecuteModal(
catch (const Exception & exc) {
if (bAppUp) {
const SolarMutexGuard guard;
- boost::scoped_ptr<MessageDialog> box(
- new MessageDialog(Application::GetActiveTopWindow(),
- exc.Message));
+ ScopedVclPtrInstance<MessageDialog> box(
+ Application::GetActiveTopWindow(), exc.Message);
box->Execute();
}
throw;
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
index f3584d043640..3980a2396b81 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
@@ -98,8 +98,8 @@ TheExtensionManager::TheExtensionManager( vcl::Window *pParent,
TheExtensionManager::~TheExtensionManager()
{
- delete m_pUpdReqDialog;
- delete m_pExtMgrDialog;
+ m_pUpdReqDialog.disposeAndClear();
+ m_pExtMgrDialog.disposeAndClear();
delete m_pExecuteCmdQueue;
}
@@ -112,7 +112,7 @@ void TheExtensionManager::createDialog( const bool bCreateUpdDlg )
{
if ( !m_pUpdReqDialog )
{
- m_pUpdReqDialog = new UpdateRequiredDialog( NULL, this );
+ m_pUpdReqDialog = VclPtr<UpdateRequiredDialog>::Create( nullptr, this );
delete m_pExecuteCmdQueue;
m_pExecuteCmdQueue = new ExtensionCmdQueue( (DialogHelper*) m_pUpdReqDialog, this, m_xContext );
createPackageList();
@@ -120,7 +120,7 @@ void TheExtensionManager::createDialog( const bool bCreateUpdDlg )
}
else if ( !m_pExtMgrDialog )
{
- m_pExtMgrDialog = new ExtMgrDialog( m_pParent, this );
+ m_pExtMgrDialog = VclPtr<ExtMgrDialog>::Create( m_pParent, this );
delete m_pExecuteCmdQueue;
m_pExecuteCmdQueue = new ExtensionCmdQueue( (DialogHelper*) m_pExtMgrDialog, this, m_xContext );
m_pExtMgrDialog->setGetExtensionsURL( m_sGetExtensionsURL );
@@ -171,8 +171,7 @@ sal_Int16 TheExtensionManager::execute()
if ( m_pUpdReqDialog )
{
nRet = m_pUpdReqDialog->Execute();
- delete m_pUpdReqDialog;
- m_pUpdReqDialog = NULL;
+ m_pUpdReqDialog.disposeAndClear();
}
return nRet;
@@ -259,10 +258,8 @@ void TheExtensionManager::terminateDialog()
if ( ! dp_misc::office_is_running() )
{
const SolarMutexGuard guard;
- delete m_pExtMgrDialog;
- m_pExtMgrDialog = NULL;
- delete m_pUpdReqDialog;
- m_pUpdReqDialog = NULL;
+ m_pExtMgrDialog.disposeAndClear();
+ m_pUpdReqDialog.disposeAndClear();
Application::Quit();
}
}
@@ -426,10 +423,8 @@ void TheExtensionManager::disposing( lang::EventObject const & rEvt )
if ( dp_misc::office_is_running() )
{
const SolarMutexGuard guard;
- delete m_pExtMgrDialog;
- m_pExtMgrDialog = NULL;
- delete m_pUpdReqDialog;
- m_pUpdReqDialog = NULL;
+ m_pExtMgrDialog.disposeAndClear();
+ m_pUpdReqDialog.disposeAndClear();
}
s_ExtMgr.clear();
}
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
index 67836b2223d3..9281ddef4c05 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
@@ -53,9 +53,9 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::deployment::XExtensionManager > m_xExtensionManager;
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xNameAccessNodes;
- vcl::Window *m_pParent;
- ExtMgrDialog *m_pExtMgrDialog;
- UpdateRequiredDialog *m_pUpdReqDialog;
+ VclPtr<vcl::Window> m_pParent;
+ VclPtr<ExtMgrDialog> m_pExtMgrDialog;
+ VclPtr<UpdateRequiredDialog> m_pUpdReqDialog;
ExtensionCmdQueue *m_pExecuteCmdQueue;
OUString m_sGetExtensionsURL;
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
index 5a66653d400e..8e75bd04b42a 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
@@ -520,7 +520,7 @@ UpdateDialog::UpdateDialog(
get(m_pthrobber, "THROBBER");
get(m_pUpdate, "UPDATE_LABEL");
get(m_pContainer, "UPDATES_CONTAINER");
- m_pUpdates = new UpdateDialog::CheckListBox(m_pContainer, *this);
+ m_pUpdates = VclPtr<UpdateDialog::CheckListBox>::Create(m_pContainer, *this);
Size aSize(LogicToPixel(Size(240, 51), MAP_APPFONT));
m_pUpdates->set_width_request(aSize.Width());
m_pUpdates->set_height_request(aSize.Height());
@@ -564,6 +564,11 @@ UpdateDialog::UpdateDialog(
UpdateDialog::~UpdateDialog()
{
+ disposeOnce();
+}
+
+void UpdateDialog::dispose()
+{
storeIgnoredUpdates();
for ( std::vector< UpdateDialog::Index* >::iterator i( m_ListboxEntries.begin() ); i != m_ListboxEntries.end(); ++i )
@@ -574,7 +579,22 @@ UpdateDialog::~UpdateDialog()
{
delete (*i);
}
- delete m_pUpdates;
+ m_pUpdates.disposeAndClear();
+ m_pchecking.clear();
+ m_pthrobber.clear();
+ m_pUpdate.clear();
+ m_pContainer.clear();
+ m_pAll.clear();
+ m_pDescription.clear();
+ m_pPublisherLabel.clear();
+ m_pPublisherLink.clear();
+ m_pReleaseNotesLabel.clear();
+ m_pReleaseNotesLink.clear();
+ m_pDescriptions.clear();
+ m_pHelp.clear();
+ m_pOk.clear();
+ m_pClose.clear();
+ ModalDialog::dispose();
}
@@ -599,9 +619,6 @@ UpdateDialog::CheckListBox::CheckListBox( vcl::Window* pParent, UpdateDialog & d
SetNormalStaticImage(Image(DpGuiResId(RID_DLG_UPDATE_NORMALALERT)));
}
-UpdateDialog::CheckListBox::~CheckListBox() {}
-
-
sal_uInt16 UpdateDialog::CheckListBox::getItemCount() const {
sal_uLong i = GetEntryCount();
OSL_ASSERT(i <= std::numeric_limits< sal_uInt16 >::max());
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.hxx b/desktop/source/deployment/gui/dp_gui_updatedialog.hxx
index c2eedcbba4b2..18fa9de6ebde 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.hxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.hxx
@@ -85,6 +85,7 @@ public:
std::vector< dp_gui::UpdateData > * updateData);
virtual ~UpdateDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool Close() SAL_OVERRIDE;
@@ -111,8 +112,6 @@ private:
CheckListBox(
vcl::Window* pParent, UpdateDialog & dialog);
- virtual ~CheckListBox();
-
sal_uInt16 getItemCount() const;
private:
@@ -169,21 +168,21 @@ private:
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
m_context;
- FixedText* m_pchecking;
- Throbber* m_pthrobber;
- FixedText* m_pUpdate;
- VclViewport* m_pContainer;
- UpdateDialog::CheckListBox* m_pUpdates;
- CheckBox* m_pAll;
- FixedText* m_pDescription;
- FixedText* m_pPublisherLabel;
- FixedHyperlink* m_pPublisherLink;
- FixedText* m_pReleaseNotesLabel;
- FixedHyperlink* m_pReleaseNotesLink;
- VclMultiLineEdit* m_pDescriptions;
- HelpButton* m_pHelp;
- PushButton* m_pOk;
- PushButton* m_pClose;
+ VclPtr<FixedText> m_pchecking;
+ VclPtr<Throbber> m_pthrobber;
+ VclPtr<FixedText> m_pUpdate;
+ VclPtr<VclViewport> m_pContainer;
+ VclPtr<UpdateDialog::CheckListBox> m_pUpdates;
+ VclPtr<CheckBox> m_pAll;
+ VclPtr<FixedText> m_pDescription;
+ VclPtr<FixedText> m_pPublisherLabel;
+ VclPtr<FixedHyperlink> m_pPublisherLink;
+ VclPtr<FixedText> m_pReleaseNotesLabel;
+ VclPtr<FixedHyperlink> m_pReleaseNotesLink;
+ VclPtr<VclMultiLineEdit> m_pDescriptions;
+ VclPtr<HelpButton> m_pHelp;
+ VclPtr<PushButton> m_pOk;
+ VclPtr<PushButton> m_pClose;
OUString m_error;
OUString m_none;
OUString m_noInstallable;
diff --git a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx
index e844e35fa5bd..69c49d8bbeac 100644
--- a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.cxx
@@ -237,7 +237,22 @@ UpdateInstallDialog::UpdateInstallDialog(
m_pHelp->Disable();
}
-UpdateInstallDialog::~UpdateInstallDialog() {}
+UpdateInstallDialog::~UpdateInstallDialog()
+{
+ disposeOnce();
+}
+
+void UpdateInstallDialog::dispose()
+{
+ m_pFt_action.clear();
+ m_pStatusbar.clear();
+ m_pFt_extension_name.clear();
+ m_pMle_info.clear();
+ m_pHelp.clear();
+ m_pOk.clear();
+ m_pCancel.clear();
+ ModalDialog::dispose();
+}
bool UpdateInstallDialog::Close()
{
diff --git a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx
index bff71e788820..9c05abd36358 100644
--- a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx
+++ b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.hxx
@@ -60,6 +60,7 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xCtx);
virtual ~UpdateInstallDialog();
+ virtual void dispose() SAL_OVERRIDE;
bool Close() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
@@ -104,13 +105,13 @@ private:
OUString m_sNoInstall;
OUString m_sThisErrorOccurred;
- FixedText *m_pFt_action;
- ProgressBar *m_pStatusbar;
- FixedText *m_pFt_extension_name;
- VclMultiLineEdit *m_pMle_info;
- HelpButton *m_pHelp;
- OKButton *m_pOk;
- CancelButton *m_pCancel;
+ VclPtr<FixedText> m_pFt_action;
+ VclPtr<ProgressBar> m_pStatusbar;
+ VclPtr<FixedText> m_pFt_extension_name;
+ VclPtr<VclMultiLineEdit> m_pMle_info;
+ VclPtr<HelpButton> m_pHelp;
+ VclPtr<OKButton> m_pOk;
+ VclPtr<CancelButton> m_pCancel;
};
}
diff --git a/desktop/source/deployment/gui/license_dialog.cxx b/desktop/source/deployment/gui/license_dialog.cxx
index c9aab531d127..710052f3180f 100644
--- a/desktop/source/deployment/gui/license_dialog.cxx
+++ b/desktop/source/deployment/gui/license_dialog.cxx
@@ -57,6 +57,7 @@ class LicenseView : public MultiLineEdit, public SfxListener
public:
LicenseView( vcl::Window* pParent, WinBits nStyle );
virtual ~LicenseView();
+ virtual void dispose() SAL_OVERRIDE;
void ScrollDown( ScrollType eScroll );
@@ -76,14 +77,14 @@ protected:
struct LicenseDialogImpl : public ModalDialog
{
cssu::Reference<cssu::XComponentContext> m_xComponentContext;
- FixedText* m_pFtHead;
- FixedImage* m_pArrow1;
- FixedImage* m_pArrow2;
- LicenseView* m_pLicense;
- PushButton* m_pDown;
+ VclPtr<FixedText> m_pFtHead;
+ VclPtr<FixedImage> m_pArrow1;
+ VclPtr<FixedImage> m_pArrow2;
+ VclPtr<LicenseView> m_pLicense;
+ VclPtr<PushButton> m_pDown;
- PushButton* m_pAcceptButton;
- PushButton* m_pDeclineButton;
+ VclPtr<PushButton> m_pAcceptButton;
+ VclPtr<PushButton> m_pDeclineButton;
DECL_LINK(PageDownHdl, void *);
DECL_LINK(ScrolledHdl, void *);
@@ -98,11 +99,26 @@ struct LicenseDialogImpl : public ModalDialog
css::uno::Reference< css::uno::XComponentContext > const & xContext,
const OUString & sExtensionName,
const OUString & sLicenseText);
+ virtual ~LicenseDialogImpl() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE;
virtual void Activate() SAL_OVERRIDE;
};
+void LicenseDialogImpl::dispose()
+{
+ m_pFtHead.clear();
+ m_pArrow1.clear();
+ m_pArrow2.clear();
+ m_pLicense.clear();
+ m_pDown.clear();
+ m_pAcceptButton.clear();
+ m_pDeclineButton.clear();
+ ModalDialog::dispose();
+}
+
+
LicenseView::LicenseView( vcl::Window* pParent, WinBits nStyle )
: MultiLineEdit( pParent, nStyle )
{
@@ -122,9 +138,15 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeLicenseView(vcl::Windo
LicenseView::~LicenseView()
{
+ disposeOnce();
+}
+
+void LicenseView::dispose()
+{
maEndReachedHdl = Link();
maScrolledHdl = Link();
EndListeningAll();
+ MultiLineEdit::dispose();
}
void LicenseView::ScrollDown( ScrollType eScroll )
@@ -307,8 +329,9 @@ sal_Int16 LicenseDialog::execute() throw (RuntimeException, std::exception)
sal_Int16 LicenseDialog::solar_execute()
{
- std::unique_ptr<LicenseDialogImpl> dlg(
- new LicenseDialogImpl(
+ VclPtr<LicenseDialogImpl> dlg(
+ VclPtr<LicenseDialogImpl>::Create(
+
VCLUnoHelper::GetWindow(m_parent),
m_xComponentContext, m_sExtensionName, m_sLicenseText));
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index b783612ecb73..67e4750c05cb 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -610,21 +610,21 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
#ifndef IOS
InitSvpForLibreOfficeKit();
- VirtualDevice aDevice(0, Size(1, 1), (sal_uInt16)32);
+ ScopedVclPtrInstance< VirtualDevice > pDevice(nullptr, Size(1, 1), (sal_uInt16)32) ;
boost::shared_array< sal_uInt8 > aBuffer( pBuffer, NoDelete< sal_uInt8 >() );
- aDevice.SetOutputSizePixelScaleOffsetAndBuffer(
+ pDevice->SetOutputSizePixelScaleOffsetAndBuffer(
Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(),
aBuffer, true );
- pDoc->paintTile(aDevice, nCanvasWidth, nCanvasHeight,
+ pDoc->paintTile(*pDevice.get(), nCanvasWidth, nCanvasHeight,
nTilePosX, nTilePosY, nTileWidth, nTileHeight);
#else
SystemGraphicsData aData;
aData.rCGContext = reinterpret_cast<CGContextRef>(pBuffer);
// the Size argument is irrelevant, I hope
- VirtualDevice aDevice(&aData, Size(1, 1), (sal_uInt16)0);
+ ScopedVclPtrInstance<VirtualDevice> pDevice(&aData, Size(1, 1), (sal_uInt16)0);
- pDoc->paintTile(aDevice, nCanvasWidth, nCanvasHeight,
+ pDoc->paintTile(*pDevice.get(), nCanvasWidth, nCanvasHeight,
nTilePosX, nTilePosY, nTileWidth, nTileHeight);
#endif
@@ -633,12 +633,12 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
{
// Draw a small red rectangle in the top left corner so that it's easy to see where a new tile begins.
Rectangle aRect(0, 0, 5, 5);
- aRect = aDevice.PixelToLogic(aRect);
- aDevice.Push(PushFlags::FILLCOLOR | PushFlags::LINECOLOR);
- aDevice.SetFillColor(COL_LIGHTRED);
- aDevice.SetLineColor();
- aDevice.DrawRect(aRect);
- aDevice.Pop();
+ aRect = pDevice->PixelToLogic(aRect);
+ pDevice->Push(PushFlags::FILLCOLOR | PushFlags::LINECOLOR);
+ pDevice->SetFillColor(COL_LIGHTRED);
+ pDevice->SetLineColor();
+ pDevice->DrawRect(aRect);
+ pDevice->Pop();
}
#else
diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
index b4ab62a5a309..d86a455238cf 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
@@ -472,10 +472,10 @@ Reference<XComponentContext> getUNO(
if ( ! InitVCL() )
throw RuntimeException( "Cannot initialize VCL!" );
{
- WarningBox warn(NULL, WB_OK | WB_DEF_OK, sMsg);
- warn.SetText(utl::ConfigManager::getProductName());
- warn.SetIcon(0);
- warn.Execute();
+ ScopedVclPtrInstance< WarningBox > warn(nullptr, WB_OK | WB_DEF_OK, sMsg);
+ warn->SetText(utl::ConfigManager::getProductName());
+ warn->SetIcon(0);
+ warn->Execute();
}
DeInitVCL();
}
diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx
index 2cfba719e758..156a2d103f11 100644
--- a/desktop/source/splash/splash.cxx
+++ b/desktop/source/splash/splash.cxx
@@ -47,13 +47,29 @@ using namespace ::com::sun::star::uno;
namespace {
+class SplashScreen;
+
+class SplashScreenWindow : public IntroWindow
+{
+public:
+ SplashScreen *pSpl;
+ ScopedVclPtr<VirtualDevice> _vdev;
+ SplashScreenWindow(SplashScreen *);
+ virtual ~SplashScreenWindow() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE;
+ // workwindow
+ virtual void Paint( const Rectangle& ) SAL_OVERRIDE;
+};
+
class SplashScreen
: public ::cppu::WeakImplHelper3< XStatusIndicator, XInitialization, XServiceInfo >
- , public IntroWindow
{
+ friend SplashScreenWindow;
private:
enum BitmapMode { BM_FULLSCREEN, BM_DEFAULTMODE };
+ VclPtr<SplashScreenWindow> pWindow;
+
DECL_LINK( AppEventListenerHdl, VclWindowEvent * );
virtual ~SplashScreen();
void loadConfig();
@@ -63,7 +79,6 @@ private:
static osl::Mutex _aMutex;
- VirtualDevice _vdev;
BitmapEx _aIntroBmp;
Color _cProgressFrameColor;
Color _cProgressBarColor;
@@ -112,15 +127,24 @@ public:
virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
{ return desktop::splash::getSupportedServiceNames(); }
+};
- // workwindow
- virtual void Paint( const Rectangle& ) SAL_OVERRIDE;
+SplashScreenWindow::SplashScreenWindow(SplashScreen *pSplash)
+ : IntroWindow()
+ , pSpl( pSplash )
+ , _vdev(VclPtr<VirtualDevice>::Create(*this))
+{
+ _vdev->EnableRTL(IsRTLEnabled());
+}
-};
+void SplashScreenWindow::dispose()
+{
+ pSpl = NULL;
+ IntroWindow::dispose();
+}
SplashScreen::SplashScreen()
- : IntroWindow()
- , _vdev(*((IntroWindow*)this))
+ : pWindow( new SplashScreenWindow (this) )
, _cProgressFrameColor(sal::static_int_cast< ColorData >(NOT_LOADED))
, _cProgressBarColor(sal::static_int_cast< ColorData >(NOT_LOADED))
, _cProgressTextColor(sal::static_int_cast< ColorData >(NOT_LOADED))
@@ -150,15 +174,14 @@ SplashScreen::SplashScreen()
, _yoffset(18)
{
loadConfig();
- _vdev.EnableRTL(IsRTLEnabled());
}
SplashScreen::~SplashScreen()
{
Application::RemoveEventListener(
LINK( this, SplashScreen, AppEventListenerHdl ) );
- Hide();
-
+ pWindow->Hide();
+ pWindow.disposeAndClear();
}
void SAL_CALL SplashScreen::start(const OUString&, sal_Int32 nRange)
@@ -169,10 +192,10 @@ void SAL_CALL SplashScreen::start(const OUString&, sal_Int32 nRange)
_bProgressEnd = false;
SolarMutexGuard aSolarGuard;
if ( _eBitmapMode == BM_FULLSCREEN )
- ShowFullScreenMode( true );
- Show();
- Paint(Rectangle());
- Flush();
+ pWindow->ShowFullScreenMode( true );
+ pWindow->Show();
+ pWindow->Paint(Rectangle());
+ pWindow->Flush();
}
}
@@ -183,8 +206,8 @@ void SAL_CALL SplashScreen::end()
if (_bVisible )
{
if ( _eBitmapMode == BM_FULLSCREEN )
- EndFullScreenMode();
- Hide();
+ pWindow->EndFullScreenMode();
+ pWindow->Hide();
}
_bProgressEnd = true;
}
@@ -196,8 +219,8 @@ void SAL_CALL SplashScreen::reset()
if (_bVisible && !_bProgressEnd )
{
if ( _eBitmapMode == BM_FULLSCREEN )
- ShowFullScreenMode( true );
- Show();
+ pWindow->ShowFullScreenMode( true );
+ pWindow->Show();
updateStatus();
}
}
@@ -213,8 +236,8 @@ void SAL_CALL SplashScreen::setText(const OUString& rText)
if (_bVisible && !_bProgressEnd)
{
if ( _eBitmapMode == BM_FULLSCREEN )
- ShowFullScreenMode( true );
- Show();
+ pWindow->ShowFullScreenMode( true );
+ pWindow->Show();
updateStatus();
}
}
@@ -228,11 +251,13 @@ void SAL_CALL SplashScreen::setValue(sal_Int32 nValue)
SolarMutexGuard aSolarGuard;
if (_bVisible && !_bProgressEnd) {
if ( _eBitmapMode == BM_FULLSCREEN )
- ShowFullScreenMode( true );
- Show();
- if (nValue >= _iMax) _iProgress = _iMax;
- else _iProgress = nValue;
- updateStatus();
+ pWindow->ShowFullScreenMode( true );
+ pWindow->Show();
+ if (nValue >= _iMax)
+ _iProgress = _iMax;
+ else
+ _iProgress = nValue;
+ updateStatus();
}
}
@@ -252,8 +277,8 @@ SplashScreen::initialize( const ::com::sun::star::uno::Sequence< ::com::sun::sta
if ( _bShowLogo )
SetScreenBitmap (_aIntroBmp);
Size aSize = _aIntroBmp.GetSizePixel();
- SetOutputSizePixel( aSize );
- _vdev.SetOutputSizePixel( aSize );
+ pWindow->SetOutputSizePixel( aSize );
+ pWindow->_vdev->SetOutputSizePixel( aSize );
_height = aSize.Height();
_width = aSize.Width();
if (_width > 500)
@@ -323,10 +348,12 @@ SplashScreen::initialize( const ::com::sun::star::uno::Sequence< ::com::sun::sta
void SplashScreen::updateStatus()
{
- if (!_bVisible || _bProgressEnd) return;
- if (!_bPaintProgress) _bPaintProgress = true;
- Paint(Rectangle());
- Flush();
+ if (!_bVisible || _bProgressEnd)
+ return;
+ if (!_bPaintProgress)
+ _bPaintProgress = true;
+ pWindow->Paint(Rectangle());
+ pWindow->Flush();
}
// internal private methods
@@ -337,7 +364,7 @@ IMPL_LINK( SplashScreen, AppEventListenerHdl, VclWindowEvent *, inEvent )
switch ( inEvent->GetId() )
{
case VCLEVENT_WINDOW_SHOW:
- Paint( Rectangle() );
+ pWindow->Paint( Rectangle() );
break;
default:
break;
@@ -578,18 +605,19 @@ void SplashScreen::determineProgressRatioValues(
}
}
-void SplashScreen::Paint( const Rectangle&)
+void SplashScreenWindow::Paint( const Rectangle&)
{
- if(!_bVisible) return;
+ if (!pSpl || !pSpl->_bVisible)
+ return;
//native drawing
// in case of native controls we need to draw directly to the window
- if( _bNativeProgress && IsNativeControlSupported( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL ) )
+ if( pSpl->_bNativeProgress && IsNativeControlSupported( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL ) )
{
- DrawBitmapEx( Point(), _aIntroBmp );
+ DrawBitmapEx( Point(), pSpl->_aIntroBmp );
- ImplControlValue aValue( _iProgress * _barwidth / _iMax);
- Rectangle aDrawRect( Point(_tlx, _tly), Size( _barwidth, _barheight ) );
+ ImplControlValue aValue( pSpl->_iProgress * pSpl->_barwidth / pSpl->_iMax);
+ Rectangle aDrawRect( Point(pSpl->_tlx, pSpl->_tly), Size( pSpl->_barwidth, pSpl->_barheight ) );
Rectangle aNativeControlRegion, aNativeContentRegion;
if( GetNativeControlRegion( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL, aDrawRect,
@@ -597,41 +625,42 @@ void SplashScreen::Paint( const Rectangle&)
aNativeControlRegion, aNativeContentRegion ) )
{
long nProgressHeight = aNativeControlRegion.GetHeight();
- aDrawRect.Top() -= (nProgressHeight - _barheight)/2;
- aDrawRect.Bottom() += (nProgressHeight - _barheight)/2;
+ aDrawRect.Top() -= (nProgressHeight - pSpl->_barheight)/2;
+ aDrawRect.Bottom() += (nProgressHeight - pSpl->_barheight)/2;
}
if( (DrawNativeControl( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL, aDrawRect,
- ControlState::ENABLED, aValue, _sProgressText )) )
+ ControlState::ENABLED, aValue, pSpl->_sProgressText )) )
{
return;
}
}
- //non native drawing
+
+ // non native drawing
// draw bitmap
- if (_bPaintBitmap)
- _vdev.DrawBitmapEx( Point(), _aIntroBmp );
+ if (pSpl->_bPaintBitmap)
+ _vdev->DrawBitmapEx( Point(), pSpl->_aIntroBmp );
- if (_bPaintProgress) {
+ if (pSpl->_bPaintProgress) {
// draw progress...
- long length = (_iProgress * _barwidth / _iMax) - (2 * _barspace);
+ long length = (pSpl->_iProgress * pSpl->_barwidth / pSpl->_iMax) - (2 * pSpl->_barspace);
if (length < 0) length = 0;
// border
- _vdev.SetFillColor();
- _vdev.SetLineColor( _cProgressFrameColor );
- _vdev.DrawRect(Rectangle(_tlx, _tly, _tlx+_barwidth, _tly+_barheight));
- _vdev.SetFillColor( _cProgressBarColor );
- _vdev.SetLineColor();
- _vdev.DrawRect(Rectangle(_tlx+_barspace, _tly+_barspace, _tlx+_barspace+length, _tly+_barheight-_barspace));
+ _vdev->SetFillColor();
+ _vdev->SetLineColor( pSpl->_cProgressFrameColor );
+ _vdev->DrawRect(Rectangle(pSpl->_tlx, pSpl->_tly, pSpl->_tlx+pSpl->_barwidth, pSpl->_tly+pSpl->_barheight));
+ _vdev->SetFillColor( pSpl->_cProgressBarColor );
+ _vdev->SetLineColor();
+ _vdev->DrawRect(Rectangle(pSpl->_tlx+pSpl->_barspace, pSpl->_tly+pSpl->_barspace, pSpl->_tlx+pSpl->_barspace+length, pSpl->_tly+pSpl->_barheight-pSpl->_barspace));
vcl::Font aFont;
aFont.SetSize(Size(0, 12));
aFont.SetAlign(ALIGN_BASELINE);
- _vdev.SetFont(aFont);
- _vdev.SetTextColor(_cProgressTextColor);
- _vdev.DrawText(Point(_tlx, _textBaseline), _sProgressText);
+ _vdev->SetFont(aFont);
+ _vdev->SetTextColor(pSpl->_cProgressTextColor);
+ _vdev->DrawText(Point(pSpl->_tlx, pSpl->_textBaseline), pSpl->_sProgressText);
}
- DrawOutDev(Point(), GetOutputSizePixel(), Point(), _vdev.GetOutputSizePixel(), _vdev );
+ DrawOutDev(Point(), GetOutputSizePixel(), Point(), _vdev->GetOutputSizePixel(), *_vdev.get() );
}
diff --git a/drawinglayer/source/primitive2d/controlprimitive2d.cxx b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
index b764e02c21d1..d782962fa11d 100644
--- a/drawinglayer/source/primitive2d/controlprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
@@ -116,15 +116,15 @@ namespace drawinglayer
if(nSizeX > 0 && nSizeY > 0)
{
// prepare VirtualDevice
- VirtualDevice aVirtualDevice(*Application::GetDefaultDevice());
+ ScopedVclPtrInstance< VirtualDevice > aVirtualDevice(*Application::GetDefaultDevice());
const Size aSizePixel(nSizeX, nSizeY);
- aVirtualDevice.SetOutputSizePixel(aSizePixel);
+ aVirtualDevice->SetOutputSizePixel(aSizePixel);
// set size at control
xControlWindow->setPosSize(0, 0, nSizeX, nSizeY, awt::PosSize::POSSIZE);
// get graphics and view
- uno::Reference< awt::XGraphics > xGraphics(aVirtualDevice.CreateUnoGraphics());
+ uno::Reference< awt::XGraphics > xGraphics(aVirtualDevice->CreateUnoGraphics());
uno::Reference< awt::XView > xControlView(rXControl, uno::UNO_QUERY);
if(xGraphics.is() && xControlView.is())
@@ -190,7 +190,7 @@ namespace drawinglayer
xControlView->draw(0, 0);
// get bitmap
- const Bitmap aContent(aVirtualDevice.GetBitmap(Point(), aSizePixel));
+ const Bitmap aContent(aVirtualDevice->GetBitmap(Point(), aSizePixel));
// to avoid scaling, use the Bitmap pixel size as primitive size
const Size aBitmapSize(aContent.GetSizePixel());
diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
index ecf3bb257ce0..7ed0045f778a 100644
--- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
@@ -96,16 +96,16 @@ namespace
// with a step count of zero
if(maAnimation.Count())
{
- VirtualDevice aVirtualDevice(*Application::GetDefaultDevice());
- VirtualDevice aVirtualDeviceMask(*Application::GetDefaultDevice(), 1L);
+ ScopedVclPtrInstance< VirtualDevice > aVirtualDevice(*Application::GetDefaultDevice());
+ ScopedVclPtrInstance< VirtualDevice > aVirtualDeviceMask(*Application::GetDefaultDevice(), 1L);
// Prepare VirtualDevices and their states
- aVirtualDevice.EnableMapMode(false);
- aVirtualDeviceMask.EnableMapMode(false);
- aVirtualDevice.SetOutputSizePixel(maAnimation.GetDisplaySizePixel());
- aVirtualDeviceMask.SetOutputSizePixel(maAnimation.GetDisplaySizePixel());
- aVirtualDevice.Erase();
- aVirtualDeviceMask.Erase();
+ aVirtualDevice->EnableMapMode(false);
+ aVirtualDeviceMask->EnableMapMode(false);
+ aVirtualDevice->SetOutputSizePixel(maAnimation.GetDisplaySizePixel());
+ aVirtualDeviceMask->SetOutputSizePixel(maAnimation.GetDisplaySizePixel());
+ aVirtualDevice->Erase();
+ aVirtualDeviceMask->Erase();
for(sal_uInt16 a(0L); a < maAnimation.Count(); a++)
{
@@ -119,20 +119,20 @@ namespace
{
case DISPOSE_NOT:
{
- aVirtualDevice.DrawBitmapEx(rAnimBitmap.aPosPix, rAnimBitmap.aBmpEx);
+ aVirtualDevice->DrawBitmapEx(rAnimBitmap.aPosPix, rAnimBitmap.aBmpEx);
Bitmap aMask = rAnimBitmap.aBmpEx.GetMask();
if(aMask.IsEmpty())
{
const Point aEmpty;
- const Rectangle aRect(aEmpty, aVirtualDeviceMask.GetOutputSizePixel());
+ const Rectangle aRect(aEmpty, aVirtualDeviceMask->GetOutputSizePixel());
const Wallpaper aWallpaper(COL_BLACK);
- aVirtualDeviceMask.DrawWallpaper(aRect, aWallpaper);
+ aVirtualDeviceMask->DrawWallpaper(aRect, aWallpaper);
}
else
{
BitmapEx aExpandVisibilityMask = BitmapEx(aMask, aMask);
- aVirtualDeviceMask.DrawBitmapEx(rAnimBitmap.aPosPix, aExpandVisibilityMask);
+ aVirtualDeviceMask->DrawBitmapEx(rAnimBitmap.aPosPix, aExpandVisibilityMask);
}
break;
@@ -143,42 +143,42 @@ namespace
const Bitmap aMask(rAnimBitmap.aBmpEx.GetMask());
const Bitmap aContent(rAnimBitmap.aBmpEx.GetBitmap());
- aVirtualDeviceMask.Erase();
- aVirtualDevice.DrawBitmap(rAnimBitmap.aPosPix, aContent);
+ aVirtualDeviceMask->Erase();
+ aVirtualDevice->DrawBitmap(rAnimBitmap.aPosPix, aContent);
if(aMask.IsEmpty())
{
const Rectangle aRect(rAnimBitmap.aPosPix, aContent.GetSizePixel());
- aVirtualDeviceMask.SetFillColor(COL_BLACK);
- aVirtualDeviceMask.SetLineColor();
- aVirtualDeviceMask.DrawRect(aRect);
+ aVirtualDeviceMask->SetFillColor(COL_BLACK);
+ aVirtualDeviceMask->SetLineColor();
+ aVirtualDeviceMask->DrawRect(aRect);
}
else
{
- aVirtualDeviceMask.DrawBitmap(rAnimBitmap.aPosPix, aMask);
+ aVirtualDeviceMask->DrawBitmap(rAnimBitmap.aPosPix, aMask);
}
break;
}
case DISPOSE_FULL:
{
- aVirtualDevice.DrawBitmapEx(rAnimBitmap.aPosPix, rAnimBitmap.aBmpEx);
+ aVirtualDevice->DrawBitmapEx(rAnimBitmap.aPosPix, rAnimBitmap.aBmpEx);
break;
}
case DISPOSE_PREVIOUS :
{
- aVirtualDevice.DrawBitmapEx(rAnimBitmap.aPosPix, rAnimBitmap.aBmpEx);
- aVirtualDeviceMask.DrawBitmap(rAnimBitmap.aPosPix, rAnimBitmap.aBmpEx.GetMask());
+ aVirtualDevice->DrawBitmapEx(rAnimBitmap.aPosPix, rAnimBitmap.aBmpEx);
+ aVirtualDeviceMask->DrawBitmap(rAnimBitmap.aPosPix, rAnimBitmap.aBmpEx.GetMask());
break;
}
}
// create BitmapEx
- Bitmap aMainBitmap = aVirtualDevice.GetBitmap(Point(), aVirtualDevice.GetOutputSizePixel());
+ Bitmap aMainBitmap = aVirtualDevice->GetBitmap(Point(), aVirtualDevice->GetOutputSizePixel());
#if defined(MACOSX) || defined(IOS)
- AlphaMask aMaskBitmap( aVirtualDeviceMask.GetBitmap( Point(), aVirtualDeviceMask.GetOutputSizePixel()));
+ AlphaMask aMaskBitmap( aVirtualDeviceMask->GetBitmap( Point(), aVirtualDeviceMask->GetOutputSizePixel()));
#else
- Bitmap aMaskBitmap = aVirtualDeviceMask.GetBitmap( Point(), aVirtualDeviceMask.GetOutputSizePixel());
+ Bitmap aMaskBitmap = aVirtualDeviceMask->GetBitmap( Point(), aVirtualDeviceMask->GetOutputSizePixel());
#endif
aNextStep.maBitmapEx = BitmapEx(aMainBitmap, aMaskBitmap);
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
index 93dfc867d3e5..a9dfdb6a75bc 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
@@ -59,7 +59,7 @@ namespace
class ImpTimedRefDev : public Timer
{
scoped_timed_RefDev& mrOwnerOfMe;
- VirtualDevice* mpVirDev;
+ VclPtr<VirtualDevice> mpVirDev;
sal_uInt32 mnUseCount;
public:
@@ -84,7 +84,7 @@ namespace
{
OSL_ENSURE(0L == mnUseCount, "destruction of a still used ImpTimedRefDev (!)");
const SolarMutexGuard aGuard;
- delete mpVirDev;
+ mpVirDev.disposeAndClear();
}
void ImpTimedRefDev::Invoke()
@@ -97,7 +97,7 @@ namespace
{
if(!mpVirDev)
{
- mpVirDev = new VirtualDevice();
+ mpVirDev = VclPtr<VirtualDevice>::Create();
mpVirDev->SetReferenceDevice( VirtualDevice::REFDEV_MODE_MSO1 );
}
diff --git a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
index efa41c8565bc..93919c0019a2 100644
--- a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
+++ b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
@@ -32,7 +32,7 @@
namespace
{
- typedef ::std::vector< VirtualDevice* > aBuffers;
+ typedef ::std::vector< VclPtr<VirtualDevice> > aBuffers;
class VDevBuffer : public Timer, protected comphelper::OBaseMutex
{
@@ -69,13 +69,13 @@ namespace
while(!maFreeBuffers.empty())
{
- delete *(maFreeBuffers.end() - 1);
+ (*(maFreeBuffers.end() - 1)).disposeAndClear();
maFreeBuffers.pop_back();
}
while(!maUsedBuffers.empty())
{
- delete *(maUsedBuffers.end() - 1);
+ (*(maUsedBuffers.end() - 1)).disposeAndClear();
maUsedBuffers.pop_back();
}
}
@@ -163,7 +163,7 @@ namespace
// no success yet, create new buffer
if(!pRetval)
{
- pRetval = new VirtualDevice(rOutDev, nBits);
+ pRetval = VclPtr<VirtualDevice>::Create(rOutDev, nBits);
pRetval->SetOutputSizePixel(rSizePixel, bClear);
}
else
@@ -197,7 +197,7 @@ namespace
while(!maFreeBuffers.empty())
{
- delete *(maFreeBuffers.end() - 1);
+ (*(maFreeBuffers.end() - 1)).disposeAndClear();
maFreeBuffers.pop_back();
}
}
diff --git a/drawinglayer/source/processor2d/vclhelperbufferdevice.hxx b/drawinglayer/source/processor2d/vclhelperbufferdevice.hxx
index 02aa3c0024ab..0ba73114dc4f 100644
--- a/drawinglayer/source/processor2d/vclhelperbufferdevice.hxx
+++ b/drawinglayer/source/processor2d/vclhelperbufferdevice.hxx
@@ -35,9 +35,9 @@ namespace drawinglayer
class impBufferDevice
{
OutputDevice& mrOutDev;
- VirtualDevice* mpContent;
- VirtualDevice* mpMask;
- VirtualDevice* mpAlpha;
+ VclPtr<VirtualDevice> mpContent;
+ VclPtr<VirtualDevice> mpMask;
+ VclPtr<VirtualDevice> mpAlpha;
Rectangle maDestPixel;
public:
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 2b2c0b86d220..4c8df82cf393 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -252,20 +252,20 @@ namespace drawinglayer
const Rectangle aPrimitiveRectangle(
basegfx::fround(aPrimitiveRange.getMinX()), basegfx::fround(aPrimitiveRange.getMinY()),
basegfx::fround(aPrimitiveRange.getMaxX()), basegfx::fround(aPrimitiveRange.getMaxY()));
- VirtualDevice aContentVDev;
+ ScopedVclPtrInstance< VirtualDevice > aContentVDev;
MapMode aNewMapMode(pLastOutputDevice->GetMapMode());
- mpOutputDevice = &aContentVDev;
+ mpOutputDevice = aContentVDev.get();
mpMetaFile = &o_rContentMetafile;
- aContentVDev.EnableOutput(false);
- aContentVDev.SetMapMode(pLastOutputDevice->GetMapMode());
- o_rContentMetafile.Record(&aContentVDev);
- aContentVDev.SetLineColor(pLastOutputDevice->GetLineColor());
- aContentVDev.SetFillColor(pLastOutputDevice->GetFillColor());
- aContentVDev.SetFont(pLastOutputDevice->GetFont());
- aContentVDev.SetDrawMode(pLastOutputDevice->GetDrawMode());
- aContentVDev.SetSettings(pLastOutputDevice->GetSettings());
- aContentVDev.SetRefPoint(pLastOutputDevice->GetRefPoint());
+ aContentVDev->EnableOutput(false);
+ aContentVDev->SetMapMode(pLastOutputDevice->GetMapMode());
+ o_rContentMetafile.Record(aContentVDev.get());
+ aContentVDev->SetLineColor(pLastOutputDevice->GetLineColor());
+ aContentVDev->SetFillColor(pLastOutputDevice->GetFillColor());
+ aContentVDev->SetFont(pLastOutputDevice->GetFont());
+ aContentVDev->SetDrawMode(pLastOutputDevice->GetDrawMode());
+ aContentVDev->SetSettings(pLastOutputDevice->GetSettings());
+ aContentVDev->SetRefPoint(pLastOutputDevice->GetRefPoint());
// dump to MetaFile
process(rContent);
@@ -2016,7 +2016,7 @@ namespace drawinglayer
const Rectangle aRectPixel(mpOutputDevice->LogicToPixel(aRectLogic));
Size aSizePixel(aRectPixel.GetSize());
const Point aEmptyPoint;
- VirtualDevice aBufferDevice;
+ ScopedVclPtrInstance< VirtualDevice > aBufferDevice;
const sal_uInt32 nMaxQuadratPixels(500000);
const sal_uInt32 nViewVisibleArea(aSizePixel.getWidth() * aSizePixel.getHeight());
double fReduceFactor(1.0);
@@ -2029,20 +2029,20 @@ namespace drawinglayer
basegfx::fround((double)aSizePixel.getHeight() * fReduceFactor));
}
- if(aBufferDevice.SetOutputSizePixel(aSizePixel))
+ if(aBufferDevice->SetOutputSizePixel(aSizePixel))
{
// create and set MapModes for target devices
MapMode aNewMapMode(mpOutputDevice->GetMapMode());
aNewMapMode.SetOrigin(Point(-aRectLogic.Left(), -aRectLogic.Top()));
- aBufferDevice.SetMapMode(aNewMapMode);
+ aBufferDevice->SetMapMode(aNewMapMode);
// prepare view transformation for target renderers
// ATTENTION! Need to apply another scaling because of the potential DPI differences
// between Printer and VDev (mpOutputDevice and aBufferDevice here).
// To get the DPI, LogicToPixel from (1,1) from MAP_INCH needs to be used.
- basegfx::B2DHomMatrix aViewTransform(aBufferDevice.GetViewTransformation());
+ basegfx::B2DHomMatrix aViewTransform(aBufferDevice->GetViewTransformation());
const Size aDPIOld(mpOutputDevice->LogicToPixel(Size(1, 1), MAP_INCH));
- const Size aDPINew(aBufferDevice.LogicToPixel(Size(1, 1), MAP_INCH));
+ const Size aDPINew(aBufferDevice->LogicToPixel(Size(1, 1), MAP_INCH));
const double fDPIXChange((double)aDPIOld.getWidth() / (double)aDPINew.getWidth());
const double fDPIYChange((double)aDPIOld.getHeight() / (double)aDPINew.getHeight());
@@ -2067,16 +2067,16 @@ namespace drawinglayer
getViewInformation2D().getViewTime(),
getViewInformation2D().getExtendedInformationSequence());
- VclPixelProcessor2D aBufferProcessor(aViewInfo, aBufferDevice);
+ VclPixelProcessor2D aBufferProcessor(aViewInfo, *aBufferDevice.get());
// draw content using pixel renderer
aBufferProcessor.process(rContent);
- const Bitmap aBmContent(aBufferDevice.GetBitmap(aEmptyPoint, aSizePixel));
+ const Bitmap aBmContent(aBufferDevice->GetBitmap(aEmptyPoint, aSizePixel));
// draw transparence using pixel renderer
- aBufferDevice.Erase();
+ aBufferDevice->Erase();
aBufferProcessor.process(rTransparence);
- const AlphaMask aBmAlpha(aBufferDevice.GetBitmap(aEmptyPoint, aSizePixel));
+ const AlphaMask aBmAlpha(aBufferDevice->GetBitmap(aEmptyPoint, aSizePixel));
// paint
mpOutputDevice->DrawBitmapEx(
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.hxx b/drawinglayer/source/processor2d/vclprocessor2d.hxx
index 70de6a19aca1..a527bb27c5e3 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.hxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.hxx
@@ -26,6 +26,7 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/color/bcolormodifier.hxx>
#include <svtools/optionsdrawinglayer.hxx>
+#include <vcl/vclptr.hxx>
// predefines
@@ -70,7 +71,7 @@ namespace drawinglayer
{
protected:
// the destination OutDev
- OutputDevice* mpOutputDevice;
+ VclPtr<OutputDevice> mpOutputDevice;
// the modifiedColorPrimitive stack
basegfx::BColorModifierStack maBColorModifierStack;
diff --git a/drawinglayer/source/tools/converters.cxx b/drawinglayer/source/tools/converters.cxx
index 188bfa9f5327..2dd3d9d8d2ee 100644
--- a/drawinglayer/source/tools/converters.cxx
+++ b/drawinglayer/source/tools/converters.cxx
@@ -73,21 +73,21 @@ namespace drawinglayer
const Point aEmptyPoint;
const Size aSizePixel(nDiscreteWidth, nDiscreteHeight);
geometry::ViewInformation2D aViewInformation2D(rViewInformation2D);
- VirtualDevice maContent;
+ ScopedVclPtrInstance< VirtualDevice > maContent;
// prepare vdev
- maContent.SetOutputSizePixel(aSizePixel, false);
- maContent.SetMapMode(aMapModePixel);
+ maContent->SetOutputSizePixel(aSizePixel, false);
+ maContent->SetMapMode(aMapModePixel);
// set to all white
- maContent.SetBackground(Wallpaper(Color(COL_WHITE)));
- maContent.Erase();
+ maContent->SetBackground(Wallpaper(Color(COL_WHITE)));
+ maContent->Erase();
// create pixel processor, also already takes care of AAing and
// checking the getOptionsDrawinglayer().IsAntiAliasing() switch. If
// not wanted, change after this call as needed
processor2d::BaseProcessor2D* pContentProcessor = processor2d::createPixelProcessor2DFromOutputDevice(
- maContent,
+ *maContent.get(),
aViewInformation2D);
if(pContentProcessor)
@@ -96,8 +96,8 @@ namespace drawinglayer
pContentProcessor->process(aSequence);
// get content
- maContent.EnableMapMode(false);
- const Bitmap aContent(maContent.GetBitmap(aEmptyPoint, aSizePixel));
+ maContent->EnableMapMode(false);
+ const Bitmap aContent(maContent->GetBitmap(aEmptyPoint, aSizePixel));
#ifdef DBG_UTIL
if(bDoSaveForVisualControl)
@@ -108,10 +108,10 @@ namespace drawinglayer
}
#endif
// prepare for mask creation
- maContent.SetMapMode(aMapModePixel);
+ maContent->SetMapMode(aMapModePixel);
// set alpha to all white (fully transparent)
- maContent.Erase();
+ maContent->Erase();
// embed primitives to paint them black
const primitive2d::Primitive2DReference xRef(
@@ -127,8 +127,8 @@ namespace drawinglayer
delete pContentProcessor;
// get alpha cahannel from vdev
- maContent.EnableMapMode(false);
- const Bitmap aAlpha(maContent.GetBitmap(aEmptyPoint, aSizePixel));
+ maContent->EnableMapMode(false);
+ const Bitmap aAlpha(maContent->GetBitmap(aEmptyPoint, aSizePixel));
#ifdef DBG_UTIL
if(bDoSaveForVisualControl)
{
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index e1b0cd615b7a..e62e29de8353 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -1755,14 +1755,14 @@ SvxFont EditEngine::GetStandardSvxFont( sal_Int32 nPara )
void EditEngine::StripPortions()
{
- VirtualDevice aTmpDev;
+ ScopedVclPtrInstance< VirtualDevice > aTmpDev;
Rectangle aBigRect( Point( 0, 0 ), Size( 0x7FFFFFFF, 0x7FFFFFFF ) );
if ( IsVertical() )
{
aBigRect.Right() = 0;
aBigRect.Left() = -0x7FFFFFFF;
}
- pImpEditEngine->Paint( &aTmpDev, aBigRect, Point(), true );
+ pImpEditEngine->Paint( aTmpDev.get(), aBigRect, Point(), true );
}
void EditEngine::GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList )
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 6805c60de4ff..2061716107bd 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1593,7 +1593,7 @@ void ImpEditView::ShowDDCursor( const Rectangle& rRect )
#endif
if ( !pDragAndDropInfo->pBackground )
{
- pDragAndDropInfo->pBackground = new VirtualDevice( *GetWindow() );
+ pDragAndDropInfo->pBackground = VclPtr<VirtualDevice>::Create( *GetWindow() );
MapMode aMapMode( GetWindow()->GetMapMode() );
aMapMode.SetOrigin( Point( 0, 0 ) );
pDragAndDropInfo->pBackground->SetMapMode( aMapMode );
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 23ac30e6538d..fccd6d8e99af 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -32,6 +32,7 @@
#include <vcl/virdev.hxx>
#include <vcl/gdimtf.hxx>
#include <vcl/cursor.hxx>
+#include <vcl/vclptr.hxx>
#include <tools/fract.hxx>
#include <vcl/idle.hxx>
@@ -114,7 +115,7 @@ struct DragAndDropInfo
EditPaM aDropDest;
sal_Int32 nOutlinerDropDest;
ESelection aDropSel;
- VirtualDevice* pBackground;
+ VclPtr<VirtualDevice> pBackground;
const SvxFieldItem* pField;
bool bVisCursor : 1;
bool bDroppedInMe : 1;
@@ -223,7 +224,7 @@ private:
LibreOfficeKitCallback mpLibreOfficeKitCallback;
void* mpLibreOfficeKitData;
EditEngine* pEditEngine;
- vcl::Window* pOutWin;
+ VclPtr<vcl::Window> pOutWin;
Pointer* pPointer;
DragAndDropInfo* pDragAndDropInfo;
@@ -421,8 +422,8 @@ private:
SfxStyleSheetPool* pStylePool;
SfxItemPool* pTextObjectPool;
- VirtualDevice* pVirtDev;
- OutputDevice* pRefDev;
+ VclPtr< VirtualDevice> pVirtDev;
+ VclPtr< OutputDevice > pRefDev;
svtools::ColorConfig* pColorConfig;
mutable SvtCTLOptions* pCTLOptions;
@@ -663,7 +664,7 @@ private:
bool IsForceAutoColor() const { return bForceAutoColor; }
inline VirtualDevice* GetVirtualDevice( const MapMode& rMapMode, sal_uLong nDrawMode );
- inline void EraseVirtualDevice();
+ inline void EraseVirtualDevice() { pVirtDev.disposeAndClear(); }
DECL_LINK(StatusTimerHdl, void *);
DECL_LINK(IdleFormatHdl, void *);
@@ -874,7 +875,7 @@ public:
void UpdateParagraphsWithStyleSheet( SfxStyleSheet* pStyle );
void RemoveStyleFromParagraphs( SfxStyleSheet* pStyle );
- OutputDevice* GetRefDevice() const { return pRefDev; }
+ OutputDevice* GetRefDevice() const { return pRefDev.get(); }
void SetRefDevice( OutputDevice* pRefDef );
const MapMode& GetRefMapMode() { return pRefDev->GetMapMode(); }
@@ -1084,12 +1085,6 @@ inline VirtualDevice* ImpEditEngine::GetVirtualDevice( const MapMode& rMapMode,
return pVirtDev;
}
-inline void ImpEditEngine::EraseVirtualDevice()
-{
- delete pVirtDev;
- pVirtDev = 0;
-}
-
inline void ImpEditEngine::IdleFormatAndUpdate( EditView* pCurView )
{
aIdleFormatter.DoIdleFormat( pCurView );
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 732264986921..975da67f5500 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -172,7 +172,7 @@ ImpEditEngine::~ImpEditEngine()
bDowning = true;
SetUpdateMode( false );
- delete pVirtDev;
+ pVirtDev.disposeAndClear();
delete pEmptyItemSet;
delete pUndoManager;
delete pTextRanger;
@@ -180,14 +180,14 @@ ImpEditEngine::~ImpEditEngine()
delete pColorConfig;
delete pCTLOptions;
if ( bOwnerOfRefDev )
- delete pRefDev;
+ pRefDev.disposeAndClear();
delete pSpellInfo;
}
void ImpEditEngine::SetRefDevice( OutputDevice* pRef )
{
if ( bOwnerOfRefDev )
- delete pRefDev;
+ pRefDev.disposeAndClear();
if ( !pRef )
{
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 427f333bb285..915cced1e8c8 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -2811,7 +2811,7 @@ void ImpEditEngine::RecalcFormatterFontMetrics( FormatterFontMetric& rCurMetrics
if ( ( nIntLeading == 0 ) && ( pRefDev->GetOutDevType() == OUTDEV_PRINTER ) )
{
// Lets see what Leading one gets on the screen
- VirtualDevice* pVDev = GetVirtualDevice( pRefDev->GetMapMode(), pRefDev->GetDrawMode() );
+ VclPtr<VirtualDevice> pVDev = GetVirtualDevice( pRefDev->GetMapMode(), pRefDev->GetDrawMode() );
rFont.SetPhysFont( pVDev );
aMetric = pVDev->GetFontMetric();
diff --git a/editeng/source/editeng/textconv.hxx b/editeng/source/editeng/textconv.hxx
index 012811c457c8..50cbbcf0bc07 100644
--- a/editeng/source/editeng/textconv.hxx
+++ b/editeng/source/editeng/textconv.hxx
@@ -24,6 +24,7 @@
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/Sequence.hxx>
#include <editeng/hangulhanja.hxx>
+#include <vcl/vclptr.hxx>
class EditView;
@@ -39,7 +40,7 @@ class TextConvWrapper : public editeng::HangulHanjaConversion
// starts from the cursor position
EditView * m_pEditView;
- vcl::Window * m_pWin;
+ VclPtr<vcl::Window> m_pWin;
bool m_bStartChk;
bool m_bStartDone;
diff --git a/editeng/source/items/svxfont.cxx b/editeng/source/items/svxfont.cxx
index e93edd42e372..da7e9183e4ad 100644
--- a/editeng/source/items/svxfont.cxx
+++ b/editeng/source/items/svxfont.cxx
@@ -163,7 +163,7 @@ OUString SvxFont::CalcCaseMap(const OUString &rTxt) const
class SvxDoCapitals
{
protected:
- OutputDevice *pOut;
+ VclPtr<OutputDevice> pOut;
const OUString &rTxt;
const sal_Int32 nIdx;
const sal_Int32 nLen;
diff --git a/editeng/source/misc/hangulhanja.cxx b/editeng/source/misc/hangulhanja.cxx
index ea6c1f0eee61..72d695da51f6 100644
--- a/editeng/source/misc/hangulhanja.cxx
+++ b/editeng/source/misc/hangulhanja.cxx
@@ -69,7 +69,7 @@ namespace editeng
// general
AbstractHangulHanjaConversionDialog*
m_pConversionDialog; // the dialog to display for user interaction
- vcl::Window* m_pUIParent; // the parent window for any UI we raise
+ VclPtr<vcl::Window> m_pUIParent; // the parent window for any UI we raise
Reference< XComponentContext >
m_xContext; // the service factory to use
Reference< XExtendedTextConversion >
diff --git a/editeng/source/misc/splwrap.cxx b/editeng/source/misc/splwrap.cxx
index 69d2fc2d555a..c5a81952fe38 100644
--- a/editeng/source/misc/splwrap.cxx
+++ b/editeng/source/misc/splwrap.cxx
@@ -39,9 +39,9 @@
#include <editeng/editerr.hxx>
#include <boost/scoped_ptr.hpp>
-#define WAIT_ON() if(pWin != NULL) { pWin->EnterWait(); }
+#define WAIT_ON() if(pWin != nullptr) { pWin->EnterWait(); }
-#define WAIT_OFF() if(pWin != NULL) { pWin->LeaveWait(); }
+#define WAIT_OFF() if(pWin != nullptr) { pWin->LeaveWait(); }
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -411,8 +411,8 @@ bool SvxSpellWrapper::SpellNext( )
WAIT_OFF();
sal_uInt16 nResId = bReverse ? RID_SVXSTR_QUERY_BW_CONTINUE : RID_SVXSTR_QUERY_CONTINUE;
- MessageDialog aBox(pWin, EditResId(nResId), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
- if ( aBox.Execute() != RET_YES )
+ ScopedVclPtrInstance< MessageDialog > aBox(pWin, EditResId(nResId), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ if ( aBox->Execute() != RET_YES )
{
// sacrifice the other area if necessary ask for special area
WAIT_ON();
diff --git a/extensions/source/abpilot/abpfinalpage.cxx b/extensions/source/abpilot/abpfinalpage.cxx
index 1cf24b87a2ac..bb9e12a31d8d 100644
--- a/extensions/source/abpilot/abpfinalpage.cxx
+++ b/extensions/source/abpilot/abpfinalpage.cxx
@@ -64,7 +64,19 @@ namespace abp
FinalPage::~FinalPage()
{
+ disposeOnce();
+ }
+
+ void FinalPage::dispose()
+ {
delete m_pLocationController;
+ m_pLocation.clear();
+ m_pBrowse.clear();
+ m_pRegisterName.clear();
+ m_pNameLabel.clear();
+ m_pName.clear();
+ m_pDuplicateNameError.clear();
+ AddressBookSourcePage::dispose();
}
bool FinalPage::isValidName() const
diff --git a/extensions/source/abpilot/abpfinalpage.hxx b/extensions/source/abpilot/abpfinalpage.hxx
index 821f39f62525..eedeac43b25d 100644
--- a/extensions/source/abpilot/abpfinalpage.hxx
+++ b/extensions/source/abpilot/abpfinalpage.hxx
@@ -26,6 +26,7 @@
#include <svtools/urlcontrol.hxx>
#include <svx/databaselocationinput.hxx>
#include <vcl/edit.hxx>
+#include <vcl/vclptr.hxx>
namespace abp
@@ -38,12 +39,12 @@ namespace abp
class FinalPage : public AddressBookSourcePage
{
protected:
- ::svt::OFileURLControl* m_pLocation;
- PushButton* m_pBrowse;
- CheckBox* m_pRegisterName;
- FixedText* m_pNameLabel;
- Edit* m_pName;
- FixedText* m_pDuplicateNameError;
+ VclPtr<::svt::OFileURLControl> m_pLocation;
+ VclPtr<PushButton> m_pBrowse;
+ VclPtr<CheckBox> m_pRegisterName;
+ VclPtr<FixedText> m_pNameLabel;
+ VclPtr<Edit> m_pName;
+ VclPtr<FixedText> m_pDuplicateNameError;
::svx::DatabaseLocationInputController*
m_pLocationController;
@@ -53,6 +54,7 @@ namespace abp
public:
FinalPage( OAddessBookSourcePilot* _pParent );
virtual ~FinalPage();
+ virtual void dispose() SAL_OVERRIDE;
protected:
// OWizardPage overridables
diff --git a/extensions/source/abpilot/abspilot.cxx b/extensions/source/abpilot/abspilot.cxx
index 45abc6bf7036..f06fa97156f9 100644
--- a/extensions/source/abpilot/abspilot.cxx
+++ b/extensions/source/abpilot/abspilot.cxx
@@ -130,11 +130,6 @@ namespace abp
SetHelpId(HID_ABSPILOT);
}
- OAddessBookSourcePilot::~OAddessBookSourcePilot()
- {
- }
-
-
OUString OAddessBookSourcePilot::getStateDisplayName( WizardState _nState ) const
{
sal_uInt16 nResId = 0;
@@ -413,24 +408,24 @@ namespace abp
}
- OWizardPage* OAddessBookSourcePilot::createPage(WizardState _nState)
+ VclPtr<TabPage> OAddessBookSourcePilot::createPage(WizardState _nState)
{
switch (_nState)
{
case STATE_SELECT_ABTYPE:
- return new TypeSelectionPage( this );
+ return VclPtr<TypeSelectionPage>::Create( this );
case STATE_INVOKE_ADMIN_DIALOG:
- return new AdminDialogInvokationPage( this );
+ return VclPtr<AdminDialogInvokationPage>::Create( this );
case STATE_TABLE_SELECTION:
- return new TableSelectionPage( this );
+ return VclPtr<TableSelectionPage>::Create( this );
case STATE_MANUAL_FIELD_MAPPING:
- return new FieldMappingPage( this );
+ return VclPtr<FieldMappingPage>::Create( this );
case STATE_FINAL_CONFIRM:
- return new FinalPage( this );
+ return VclPtr<FinalPage>::Create( this );
default:
OSL_FAIL("OAddessBookSourcePilot::createPage: invalid state!");
diff --git a/extensions/source/abpilot/abspilot.hxx b/extensions/source/abpilot/abspilot.hxx
index de7a5895b627..5b24ff244e45 100644
--- a/extensions/source/abpilot/abspilot.hxx
+++ b/extensions/source/abpilot/abspilot.hxx
@@ -49,8 +49,6 @@ namespace abp
OAddessBookSourcePilot(
vcl::Window* _pParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB);
- /// dtor
- virtual ~OAddessBookSourcePilot();
/// get the service factory which was used to create the dialog
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&
@@ -69,7 +67,7 @@ namespace abp
protected:
// OWizardMachine overridables
- virtual ::svt::OWizardPage* createPage( WizardState _nState ) SAL_OVERRIDE;
+ virtual VclPtr<TabPage> createPage( WizardState _nState ) SAL_OVERRIDE;
virtual void enterState( WizardState _nState ) SAL_OVERRIDE;
virtual bool prepareLeaveCurrentState( CommitPageReason _eReason ) SAL_OVERRIDE;
virtual bool onFinish() SAL_OVERRIDE;
diff --git a/extensions/source/abpilot/admininvokationimpl.hxx b/extensions/source/abpilot/admininvokationimpl.hxx
index 486223ca30c0..9dc5d3b0cb8a 100644
--- a/extensions/source/abpilot/admininvokationimpl.hxx
+++ b/extensions/source/abpilot/admininvokationimpl.hxx
@@ -22,6 +22,7 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <vcl/vclptr.hxx>
namespace vcl { class Window; }
@@ -36,7 +37,7 @@ namespace abp
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
m_xContext;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xDataSource;
- vcl::Window* m_pMessageParent;
+ VclPtr<vcl::Window> m_pMessageParent;
public:
OAdminDialogInvokation(
diff --git a/extensions/source/abpilot/admininvokationpage.cxx b/extensions/source/abpilot/admininvokationpage.cxx
index a92e90d7eb1e..57bb822c076f 100644
--- a/extensions/source/abpilot/admininvokationpage.cxx
+++ b/extensions/source/abpilot/admininvokationpage.cxx
@@ -34,7 +34,16 @@ namespace abp
get(m_pErrorMessage, "warning");
m_pInvokeAdminDialog->SetClickHdl( LINK(this, AdminDialogInvokationPage, OnInvokeAdminDialog) );
}
-
+ AdminDialogInvokationPage::~AdminDialogInvokationPage()
+ {
+ disposeOnce();
+ }
+ void AdminDialogInvokationPage::dispose()
+ {
+ m_pInvokeAdminDialog.clear();
+ m_pErrorMessage.clear();
+ AddressBookSourcePage::dispose();
+ }
void AdminDialogInvokationPage::ActivatePage()
{
AddressBookSourcePage::ActivatePage();
diff --git a/extensions/source/abpilot/admininvokationpage.hxx b/extensions/source/abpilot/admininvokationpage.hxx
index 4b264274f290..7e2e7efce8c2 100644
--- a/extensions/source/abpilot/admininvokationpage.hxx
+++ b/extensions/source/abpilot/admininvokationpage.hxx
@@ -29,14 +29,15 @@ namespace abp
class AdminDialogInvokationPage : public AddressBookSourcePage
{
protected:
- PushButton* m_pInvokeAdminDialog;
- FixedText* m_pErrorMessage;
+ VclPtr<PushButton> m_pInvokeAdminDialog;
+ VclPtr<FixedText> m_pErrorMessage;
bool m_bSuccessfullyExecutedDialog;
public:
AdminDialogInvokationPage( OAddessBookSourcePilot* _pParent );
-
+ virtual ~AdminDialogInvokationPage();
+ virtual void dispose() SAL_OVERRIDE;
protected:
// TabDialog overridables
virtual void ActivatePage() SAL_OVERRIDE;
diff --git a/extensions/source/abpilot/fieldmappingpage.cxx b/extensions/source/abpilot/fieldmappingpage.cxx
index c30bf82265c6..9ad8a3b0f11d 100644
--- a/extensions/source/abpilot/fieldmappingpage.cxx
+++ b/extensions/source/abpilot/fieldmappingpage.cxx
@@ -37,6 +37,18 @@ namespace abp
m_pInvokeDialog->SetClickHdl( LINK( this, FieldMappingPage, OnInvokeDialog ) );
}
+ FieldMappingPage::~FieldMappingPage()
+ {
+ disposeOnce();
+ }
+
+ void FieldMappingPage::dispose()
+ {
+ m_pInvokeDialog.clear();
+ m_pHint.clear();
+ AddressBookSourcePage::dispose();
+ }
+
void FieldMappingPage::ActivatePage()
{
AddressBookSourcePage::ActivatePage();
diff --git a/extensions/source/abpilot/fieldmappingpage.hxx b/extensions/source/abpilot/fieldmappingpage.hxx
index 35ce8a2fcc3b..6adaf511800a 100644
--- a/extensions/source/abpilot/fieldmappingpage.hxx
+++ b/extensions/source/abpilot/fieldmappingpage.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_EXTENSIONS_SOURCE_ABPILOT_FIELDMAPPINGPAGE_HXX
#include "abspage.hxx"
+#include <vcl/vclptr.hxx>
namespace abp
@@ -33,12 +34,13 @@ namespace abp
class FieldMappingPage : public AddressBookSourcePage
{
protected:
- PushButton* m_pInvokeDialog;
- FixedText* m_pHint;
+ VclPtr<PushButton> m_pInvokeDialog;
+ VclPtr<FixedText> m_pHint;
public:
FieldMappingPage( OAddessBookSourcePilot* _pParent );
-
+ virtual ~FieldMappingPage();
+ virtual void dispose() SAL_OVERRIDE;
protected:
// OWizardPage overridables
virtual void initializePage() SAL_OVERRIDE;
diff --git a/extensions/source/abpilot/tableselectionpage.cxx b/extensions/source/abpilot/tableselectionpage.cxx
index 61ac27d8f1ce..537ef7b2b73e 100644
--- a/extensions/source/abpilot/tableselectionpage.cxx
+++ b/extensions/source/abpilot/tableselectionpage.cxx
@@ -41,6 +41,16 @@ namespace abp
m_pTableList->SetDoubleClickHdl( LINK( this, TableSelectionPage, OnTableDoubleClicked ) );
}
+ TableSelectionPage::~TableSelectionPage()
+ {
+ disposeOnce();
+ }
+
+ void TableSelectionPage::dispose()
+ {
+ m_pTableList.clear();
+ AddressBookSourcePage::dispose();
+ }
void TableSelectionPage::ActivatePage()
{
diff --git a/extensions/source/abpilot/tableselectionpage.hxx b/extensions/source/abpilot/tableselectionpage.hxx
index c9fcd755920d..7abcf547af45 100644
--- a/extensions/source/abpilot/tableselectionpage.hxx
+++ b/extensions/source/abpilot/tableselectionpage.hxx
@@ -22,6 +22,7 @@
#include "abspage.hxx"
#include <vcl/lstbox.hxx>
+#include <vcl/vclptr.hxx>
namespace abp
@@ -34,11 +35,12 @@ namespace abp
class TableSelectionPage : public AddressBookSourcePage
{
protected:
- ListBox* m_pTableList;
+ VclPtr<ListBox> m_pTableList;
public:
TableSelectionPage( OAddessBookSourcePilot* _pParent );
-
+ virtual ~TableSelectionPage();
+ virtual void dispose() SAL_OVERRIDE;
protected:
// OWizardPage overridables
virtual void initializePage() SAL_OVERRIDE;
diff --git a/extensions/source/abpilot/typeselectionpage.cxx b/extensions/source/abpilot/typeselectionpage.cxx
index 79361869e8b7..f732eff901b4 100644
--- a/extensions/source/abpilot/typeselectionpage.cxx
+++ b/extensions/source/abpilot/typeselectionpage.cxx
@@ -151,11 +151,28 @@ namespace abp
TypeSelectionPage::~TypeSelectionPage()
{
+ disposeOnce();
+ }
+
+ void TypeSelectionPage::dispose()
+ {
for ( ::std::vector< ButtonItem >::iterator loop = m_aAllTypes.begin();
loop != m_aAllTypes.end(); ++loop )
{
loop->m_bVisible = false;
}
+ m_pEvolution.clear();
+ m_pEvolutionGroupwise.clear();
+ m_pEvolutionLdap.clear();
+ m_pMORK.clear();
+ m_pThunderbird.clear();
+ m_pKab.clear();
+ m_pMacab.clear();
+ m_pLDAP.clear();
+ m_pOutlook.clear();
+ m_pOE.clear();
+ m_pOther.clear();
+ AddressBookSourcePage::dispose();
}
@@ -226,8 +243,8 @@ namespace abp
if (AST_INVALID == getSelectedType( ))
{
- MessageDialog aError(this, ModuleRes(RID_STR_NEEDTYPESELECTION));
- aError.Execute();
+ ScopedVclPtrInstance< MessageDialog > aError(this, ModuleRes(RID_STR_NEEDTYPESELECTION));
+ aError->Execute();
return false;
}
diff --git a/extensions/source/abpilot/typeselectionpage.hxx b/extensions/source/abpilot/typeselectionpage.hxx
index 2e4437e285f8..b7c628f884c1 100644
--- a/extensions/source/abpilot/typeselectionpage.hxx
+++ b/extensions/source/abpilot/typeselectionpage.hxx
@@ -23,6 +23,7 @@
#include "abspage.hxx"
#include "addresssettings.hxx"
#include <vcl/edit.hxx>
+#include <vcl/vclptr.hxx>
namespace abp
@@ -35,20 +36,20 @@ namespace abp
class TypeSelectionPage : public AddressBookSourcePage
{
protected:
- RadioButton* m_pEvolution;
- RadioButton* m_pEvolutionGroupwise;
- RadioButton* m_pEvolutionLdap;
- RadioButton* m_pMORK;
- RadioButton* m_pThunderbird;
- RadioButton* m_pKab;
- RadioButton* m_pMacab;
- RadioButton* m_pLDAP;
- RadioButton* m_pOutlook;
- RadioButton* m_pOE;
- RadioButton* m_pOther;
+ VclPtr<RadioButton> m_pEvolution;
+ VclPtr<RadioButton> m_pEvolutionGroupwise;
+ VclPtr<RadioButton> m_pEvolutionLdap;
+ VclPtr<RadioButton> m_pMORK;
+ VclPtr<RadioButton> m_pThunderbird;
+ VclPtr<RadioButton> m_pKab;
+ VclPtr<RadioButton> m_pMacab;
+ VclPtr<RadioButton> m_pLDAP;
+ VclPtr<RadioButton> m_pOutlook;
+ VclPtr<RadioButton> m_pOE;
+ VclPtr<RadioButton> m_pOther;
struct ButtonItem {
- RadioButton *m_pItem;
+ VclPtr<RadioButton> m_pItem;
AddressSourceType m_eType;
bool m_bVisible;
@@ -66,6 +67,7 @@ namespace abp
public:
TypeSelectionPage( OAddessBookSourcePilot* _pParent );
virtual ~TypeSelectionPage();
+ virtual void dispose() SAL_OVERRIDE;
// retrieves the currently selected type
AddressSourceType getSelectedType() const;
diff --git a/extensions/source/abpilot/unodialogabp.cxx b/extensions/source/abpilot/unodialogabp.cxx
index f8afef08c385..fdf27d8a7609 100644
--- a/extensions/source/abpilot/unodialogabp.cxx
+++ b/extensions/source/abpilot/unodialogabp.cxx
@@ -152,9 +152,9 @@ namespace abp
}
- Dialog* OABSPilotUno::createDialog(vcl::Window* _pParent)
+ VclPtr<Dialog> OABSPilotUno::createDialog(vcl::Window* _pParent)
{
- return new OAddessBookSourcePilot(_pParent, m_aContext );
+ return VclPtr<OAddessBookSourcePilot>::Create(_pParent, m_aContext );
}
@@ -179,7 +179,7 @@ namespace abp
{
if ( _nExecutionResult == RET_OK )
{
- const AddressSettings& aSettings = static_cast<OAddessBookSourcePilot*>(m_pDialog)->getSettings();
+ const AddressSettings& aSettings = static_cast<OAddessBookSourcePilot*>(m_pDialog.get())->getSettings();
m_sDataSourceName = aSettings.bRegisterDataSource ? aSettings.sRegisteredDataSourceName : aSettings.sDataSourceName;
}
}
diff --git a/extensions/source/abpilot/unodialogabp.hxx b/extensions/source/abpilot/unodialogabp.hxx
index b444095823a5..efd84acdfb11 100644
--- a/extensions/source/abpilot/unodialogabp.hxx
+++ b/extensions/source/abpilot/unodialogabp.hxx
@@ -84,7 +84,7 @@ namespace abp
using OABSPilotUno_DBase::execute;
protected:
// OGenericUnoDialog overridables
- virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
+ virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
virtual void executedDialog(sal_Int16 _nExecutionResult) SAL_OVERRIDE;
};
diff --git a/extensions/source/bibliography/bibbeam.cxx b/extensions/source/bibliography/bibbeam.cxx
index 72120f8d36ce..9e6235055801 100644
--- a/extensions/source/bibliography/bibbeam.cxx
+++ b/extensions/source/bibliography/bibbeam.cxx
@@ -29,6 +29,7 @@
#include <vcl/edit.hxx>
#include <tools/debug.hxx>
#include "bibbeam.hxx"
+#include "bibview.hxx"
#include "toolbar.hrc"
#include "bibresid.hxx"
#include "datman.hxx"
@@ -87,6 +88,7 @@ namespace bib
BibGridwin(vcl::Window* pParent, WinBits nStyle = WB_3DLOOK );
virtual ~BibGridwin();
+ virtual void dispose() SAL_OVERRIDE;
void createGridWin(const Reference< awt::XControlModel > & xDbForm);
void disposeGridWin();
@@ -107,9 +109,15 @@ namespace bib
BibGridwin::~BibGridwin()
{
+ disposeOnce();
+ }
+
+ void BibGridwin::dispose()
+ {
RemoveFromTaskPaneList( this );
disposeGridWin();
+ vcl::Window::dispose();
}
void BibGridwin::Resize()
@@ -195,6 +203,11 @@ namespace bib
BibBeamer::~BibBeamer()
{
+ disposeOnce();
+ }
+
+ void BibBeamer::dispose()
+ {
if ( isFormConnected() )
disconnectForm();
@@ -202,25 +215,16 @@ namespace bib
m_xToolBarRef->dispose();
if ( pToolBar )
- {
pDatMan->SetToolbar(0);
- DELETEZ( pToolBar );
- }
-
- if( pGridWin )
- {
- BibGridwin* pDel = pGridWin;
- pGridWin = NULL;
- pDel->disposeGridWin();
- delete pDel;
- }
-
+ pToolBar.disposeAndClear();
+ pGridWin.disposeAndClear();
+ BibSplitWindow::dispose();
}
void BibBeamer::createToolBar()
{
- pToolBar= new BibToolBar(this, LINK( this, BibBeamer, RecalcLayout_Impl ));
+ pToolBar= VclPtr<BibToolBar>::Create(this, LINK( this, BibBeamer, RecalcLayout_Impl ));
::Size aSize=pToolBar->GetSizePixel();
InsertItem(ID_TOOLBAR, pToolBar, aSize.Height(), 0, 0, SWIB_FIXED );
if ( m_xController.is() )
@@ -229,7 +233,7 @@ namespace bib
void BibBeamer::createGridWin()
{
- pGridWin = new BibGridwin(this,0);
+ pGridWin = VclPtr<BibGridwin>::Create(this,0);
InsertItem(ID_GRIDWIN, pGridWin, 40, 1, 0, SWIB_RELATIVESIZE );
diff --git a/extensions/source/bibliography/bibbeam.hxx b/extensions/source/bibliography/bibbeam.hxx
index bfecf435ecb5..aea7d49db079 100644
--- a/extensions/source/bibliography/bibbeam.hxx
+++ b/extensions/source/bibliography/bibbeam.hxx
@@ -52,8 +52,8 @@ namespace bib
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xGridWin;
BibDataManager* pDatMan;
- BibToolBar* pToolBar;
- BibGridwin* pGridWin;
+ VclPtr<BibToolBar> pToolBar;
+ VclPtr<BibGridwin> pGridWin;
DECL_LINK( RecalcLayout_Impl, void* );
@@ -72,6 +72,7 @@ namespace bib
BibBeamer(vcl::Window* pParent,BibDataManager* pDatMan, WinBits nStyle = WB_3DLOOK );
virtual ~BibBeamer();
+ virtual void dispose() SAL_OVERRIDE;
void SetXController(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > &);
diff --git a/extensions/source/bibliography/bibcont.cxx b/extensions/source/bibliography/bibcont.cxx
index 954700c24277..5eba4bac1bbc 100644
--- a/extensions/source/bibliography/bibcont.cxx
+++ b/extensions/source/bibliography/bibcont.cxx
@@ -31,6 +31,7 @@
#include "datman.hxx"
#include "bibcont.hxx"
+#include "bibview.hxx"
BibShortCutHandler::~BibShortCutHandler()
@@ -56,20 +57,11 @@ BibSplitWindow::BibSplitWindow( vcl::Window* pParent, WinBits nStyle ) : SplitWi
{
}
-BibSplitWindow::~BibSplitWindow()
-{
-}
-
BibTabPage::BibTabPage( vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription ) :
TabPage( pParent, rID, rUIXMLDescription ), BibShortCutHandler( this )
{
}
-BibTabPage::~BibTabPage()
-{
-}
-
-
using namespace osl;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -94,12 +86,18 @@ BibWindowContainer::BibWindowContainer( vcl::Window* pParent, BibShortCutHandler
BibWindowContainer::~BibWindowContainer()
{
+ disposeOnce();
+}
+
+void BibWindowContainer::dispose()
+{
if( pChild )
{
- vcl::Window* pDel = GetChild();
+ VclPtr<vcl::Window> pDel = GetChild();
pChild = NULL; // prevents GetFocus for child while deleting!
- delete pDel;
+ pDel.disposeAndClear();
}
+ vcl::Window::dispose();
}
void BibWindowContainer::Resize()
@@ -132,6 +130,11 @@ BibBookContainer::BibBookContainer(vcl::Window* pParent, WinBits nStyle):
BibBookContainer::~BibBookContainer()
{
+ disposeOnce();
+}
+
+void BibBookContainer::dispose()
+{
if( xTopFrameRef.is() )
xTopFrameRef->dispose();
if( xBottomFrameRef.is() )
@@ -139,19 +142,22 @@ BibBookContainer::~BibBookContainer()
if( pTopWin )
{
- vcl::Window* pDel = pTopWin;
+ VclPtr<vcl::Window> pDel = pTopWin;
pTopWin = NULL; // prevents GetFocus for child while deleting!
- delete pDel;
+ pDel.disposeAndClear();
}
if( pBottomWin )
{
- vcl::Window* pDel = pBottomWin;
+ VclPtr<vcl::Window> pDel = pBottomWin;
pBottomWin = NULL; // prevents GetFocus for child while deleting!
- delete pDel;
+ pDel.disposeAndClear();
}
CloseBibModul( pBibMod );
+ pTopWin.clear();
+ pBottomWin.clear();
+ BibSplitWindow::dispose();
}
void BibBookContainer::Split()
@@ -175,9 +181,9 @@ void BibBookContainer::createTopFrame( BibShortCutHandler* pWin )
if(pTopWin)
{
RemoveItem(TOP_WINDOW);
- delete pTopWin;
+ pTopWin.disposeAndClear();
}
- pTopWin=new BibWindowContainer(this,pWin);
+ pTopWin=VclPtr<BibWindowContainer>::Create(this,pWin);
pTopWin->Show();
BibConfig* pConfig = BibModul::GetConfig();
long nSize = pConfig->getBeamerSize();
@@ -192,10 +198,10 @@ void BibBookContainer::createBottomFrame( BibShortCutHandler* pWin )
if(pBottomWin)
{
RemoveItem(BOTTOM_WINDOW);
- delete pBottomWin;
+ pBottomWin.disposeAndClear();
}
- pBottomWin=new BibWindowContainer(this,pWin);
+ pBottomWin=VclPtr<BibWindowContainer>::Create(this,pWin);
BibConfig* pConfig = BibModul::GetConfig();
long nSize = pConfig->getViewSize();
diff --git a/extensions/source/bibliography/bibcont.hxx b/extensions/source/bibliography/bibcont.hxx
index af6a78839900..3488c2ee27ee 100644
--- a/extensions/source/bibliography/bibcont.hxx
+++ b/extensions/source/bibliography/bibcont.hxx
@@ -43,8 +43,9 @@ class BibWindowContainer : public BibWindow //Window
public:
BibWindowContainer( vcl::Window* pParent, BibShortCutHandler* pChild, WinBits nStyle = WB_3DLOOK);
virtual ~BibWindowContainer();
+ virtual void dispose() SAL_OVERRIDE;
- inline vcl::Window* GetChild();
+ inline vcl::Window* GetChild();
virtual void GetFocus() SAL_OVERRIDE;
@@ -55,7 +56,7 @@ class BibWindowContainer : public BibWindow //Window
inline vcl::Window* BibWindowContainer::GetChild()
{
- return pChild? pChild->GetWindow() : NULL;
+ return pChild ? pChild->GetWindow() : NULL;
}
@@ -69,8 +70,8 @@ class BibBookContainer: public BibSplitWindow
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > xTopPeerRef;
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > xBottomPeerRef;
- BibWindowContainer* pTopWin;
- BibWindowContainer* pBottomWin;
+ VclPtr<BibWindowContainer> pTopWin;
+ VclPtr<BibWindowContainer> pBottomWin;
HdlBibModul pBibMod;
Idle aIdle;
@@ -86,6 +87,7 @@ class BibBookContainer: public BibSplitWindow
BibBookContainer(vcl::Window* pParent, WinBits nStyle = WB_3DLOOK );
virtual ~BibBookContainer();
+ virtual void dispose() SAL_OVERRIDE;
inline BibWindow* GetTopWin() {return pTopWin;}
inline BibWindow* GetBottomWin() {return pBottomWin;}
diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx
index 97ad1f1fa9e8..afa6cb083076 100644
--- a/extensions/source/bibliography/bibload.cxx
+++ b/extensions/source/bibliography/bibload.cxx
@@ -273,7 +273,7 @@ void BibliographyLoader::loadView(const Reference< XFrame > & rFrame, const OUSt
vcl::Window* pParent = VCLUnoHelper::GetWindow( aWindow );
- BibBookContainer *pMyWindow = new BibBookContainer( pParent );
+ VclPtrInstance<BibBookContainer> pMyWindow( pParent );
pMyWindow->Show();
::bib::BibView* pView = new ::bib::BibView( pMyWindow, m_pDatMan, WB_VSCROLL | WB_HSCROLL | WB_3DLOOK );
diff --git a/extensions/source/bibliography/bibmod.cxx b/extensions/source/bibliography/bibmod.cxx
index 4336c1a54461..cda8769d0204 100644
--- a/extensions/source/bibliography/bibmod.cxx
+++ b/extensions/source/bibliography/bibmod.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/lang/XLocalizable.hpp>
#include "bibmod.hxx"
+#include "bibview.hxx"
#include "bibresid.hxx"
#include "datman.hxx"
#include "bibconfig.hxx"
diff --git a/extensions/source/bibliography/bibshortcuthandler.hxx b/extensions/source/bibliography/bibshortcuthandler.hxx
index 45bf279df404..d6310f549629 100644
--- a/extensions/source/bibliography/bibshortcuthandler.hxx
+++ b/extensions/source/bibliography/bibshortcuthandler.hxx
@@ -31,7 +31,7 @@
class BibShortCutHandler
{
private:
- vcl::Window* pBaseClass; // in cases, where BibShortCutHandler also has to be a window
+ VclPtr<vcl::Window> pBaseClass; // in cases, where BibShortCutHandler also has to be a window
protected:
inline BibShortCutHandler( vcl::Window* pBaseClass );
@@ -63,14 +63,12 @@ class BibSplitWindow : public SplitWindow, public BibShortCutHandler
{
public:
BibSplitWindow( vcl::Window* pParent,WinBits nStyle = WB_3DLOOK);
- virtual ~BibSplitWindow();
};
class BibTabPage : public TabPage, public BibShortCutHandler
{
public:
BibTabPage( vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription );
- virtual ~BibTabPage();
};
#endif
diff --git a/extensions/source/bibliography/bibview.cxx b/extensions/source/bibliography/bibview.cxx
index 2d715d040d5a..dd13a1e2453d 100644
--- a/extensions/source/bibliography/bibview.cxx
+++ b/extensions/source/bibliography/bibview.cxx
@@ -52,16 +52,22 @@ namespace bib
,m_pDatMan( _pManager )
,m_xDatMan( _pManager )
,m_pGeneralPage( NULL )
+ ,m_aFormControlContainer(this)
{
if ( m_xDatMan.is() )
- connectForm( m_xDatMan );
+ m_aFormControlContainer.connectForm( m_xDatMan );
}
BibView::~BibView()
{
+ disposeOnce();
+ }
+
+ void BibView::dispose()
+ {
BibGeneralPage* pGeneralPage = m_pGeneralPage;
- m_pGeneralPage = NULL;
+ m_pGeneralPage.clear();
pGeneralPage->CommitActiveControl();
Reference< XForm > xForm = m_pDatMan->getForm();
@@ -92,11 +98,12 @@ namespace bib
}
}
- if ( isFormConnected() )
- disconnectForm();
+ if ( m_aFormControlContainer.isFormConnected() )
+ m_aFormControlContainer.disconnectForm();
pGeneralPage->RemoveListeners();
m_xGeneralPage = NULL;
+ BibWindow::dispose();
}
void BibView::UpdatePages()
@@ -112,7 +119,8 @@ namespace bib
m_xGeneralPage = 0;
}
- m_xGeneralPage = m_pGeneralPage = new BibGeneralPage( this, m_pDatMan );
+ m_pGeneralPage = VclPtr<BibGeneralPage>::Create( this, m_pDatMan );
+ m_xGeneralPage = &m_pGeneralPage->GetFocusListener();
m_pGeneralPage->Show();
if( HasFocus() )
@@ -133,11 +141,11 @@ namespace bib
{
sErrorString += "\n";
sErrorString += BIB_RESSTR(RID_MAP_QUESTION);
- QueryBox aQuery( this, WB_YES_NO, sErrorString );
- aQuery.SetDefaultCheckBoxText();
- short nResult = aQuery.Execute();
+ ScopedVclPtrInstance< QueryBox > aQuery(this, WB_YES_NO, sErrorString);
+ aQuery->SetDefaultCheckBoxText();
+ short nResult = aQuery->Execute();
BibModul::GetConfig()->SetShowColumnAssignmentWarning(
- !aQuery.GetCheckBoxState());
+ !aQuery->GetCheckBoxState());
if( RET_YES != nResult )
{
bExecute = false;
@@ -150,18 +158,20 @@ namespace bib
}
}
- void BibView::_loaded( const EventObject& _rEvent )
+ BibViewFormControlContainer::BibViewFormControlContainer(BibView *pBibView) : mpBibView(pBibView) {}
+
+ void BibViewFormControlContainer::_loaded( const EventObject& _rEvent )
{
- UpdatePages();
+ mpBibView->UpdatePages();
FormControlContainer::_loaded( _rEvent );
- Resize();
+ mpBibView->Resize();
}
- void BibView::_reloaded( const EventObject& _rEvent )
+ void BibViewFormControlContainer::_reloaded( const EventObject& _rEvent )
{
- UpdatePages();
+ mpBibView->UpdatePages();
FormControlContainer::_loaded( _rEvent );
- Resize();
+ mpBibView->Resize();
}
IMPL_STATIC_LINK( BibView, CallMappingHdl, BibView*, EMPTYARG )
@@ -180,6 +190,11 @@ namespace bib
Window::Resize();
}
+ Reference< awt::XControlContainer > BibViewFormControlContainer::getControlContainer()
+ {
+ return mpBibView->getControlContainer();
+ }
+
Reference< awt::XControlContainer > BibView::getControlContainer()
{
Reference< awt::XControlContainer > xReturn;
diff --git a/extensions/source/bibliography/bibview.hxx b/extensions/source/bibliography/bibview.hxx
index add53d7c2bbe..1f797c6e990f 100644
--- a/extensions/source/bibliography/bibview.hxx
+++ b/extensions/source/bibliography/bibview.hxx
@@ -34,35 +34,48 @@ namespace bib
{
+ class BibView;
+ class BibViewFormControlContainer : public FormControlContainer
+ {
+ private:
+ VclPtr<BibView> mpBibView;
+ protected:
+ // FormControlContainer
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >
+ getControlContainer() SAL_OVERRIDE;
+ // XLoadListener equivalents
+ virtual void _loaded( const ::com::sun::star::lang::EventObject& _rEvent ) SAL_OVERRIDE;
+ virtual void _reloaded( const ::com::sun::star::lang::EventObject& _rEvent ) SAL_OVERRIDE;
+ public:
+ using FormControlContainer::connectForm;
+ using FormControlContainer::disconnectForm;
+ using FormControlContainer::isFormConnected;
+ BibViewFormControlContainer(BibView *pBibView);
+ };
- class BibView : public BibWindow, public FormControlContainer
+ class BibView : public BibWindow
{
private:
BibDataManager* m_pDatMan;
::com::sun::star::uno::Reference< ::com::sun::star::form::XLoadable> m_xDatMan;
::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener> m_xGeneralPage;
- BibGeneralPage* m_pGeneralPage;
+ VclPtr<BibGeneralPage> m_pGeneralPage;
+ BibViewFormControlContainer m_aFormControlContainer;
private:
DECL_STATIC_LINK(BibView, CallMappingHdl, BibView*);
- protected:
+ public:
// Window overridables
- virtual void Resize() SAL_OVERRIDE;
-
- // FormControlContainer
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >
- getControlContainer() SAL_OVERRIDE;
-
- // XLoadListener equivalents
- virtual void _loaded( const ::com::sun::star::lang::EventObject& _rEvent ) SAL_OVERRIDE;
- virtual void _reloaded( const ::com::sun::star::lang::EventObject& _rEvent ) SAL_OVERRIDE;
+ virtual void Resize() SAL_OVERRIDE;
public:
BibView( vcl::Window* _pParent, BibDataManager* _pDatMan, WinBits nStyle = WB_3DLOOK );
virtual ~BibView();
+ virtual void dispose() SAL_OVERRIDE;
void UpdatePages();
+ css::uno::Reference< css::awt::XControlContainer > getControlContainer();
virtual void GetFocus() SAL_OVERRIDE;
diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx
index 257d08d189e0..b6681c756320 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -197,39 +197,39 @@ Reference< XNameAccess > getColumns(const Reference< XForm > & _rxForm)
class MappingDialog_Impl : public ModalDialog
{
BibDataManager* pDatMan;
- OKButton* pOKBT;
- ListBox* pIdentifierLB;
- ListBox* pAuthorityTypeLB;
- ListBox* pAuthorLB;
- ListBox* pTitleLB;
- ListBox* pMonthLB;
- ListBox* pYearLB;
- ListBox* pISBNLB;
- ListBox* pBooktitleLB;
- ListBox* pChapterLB;
- ListBox* pEditionLB;
- ListBox* pEditorLB;
- ListBox* pHowpublishedLB;
- ListBox* pInstitutionLB;
- ListBox* pJournalLB;
- ListBox* pNoteLB;
- ListBox* pAnnoteLB;
- ListBox* pNumberLB;
- ListBox* pOrganizationsLB;
- ListBox* pPagesLB;
- ListBox* pPublisherLB;
- ListBox* pAddressLB;
- ListBox* pSchoolLB;
- ListBox* pSeriesLB;
- ListBox* pReportTypeLB;
- ListBox* pVolumeLB;
- ListBox* pURLLB;
- ListBox* pCustom1LB;
- ListBox* pCustom2LB;
- ListBox* pCustom3LB;
- ListBox* pCustom4LB;
- ListBox* pCustom5LB;
- ListBox* aListBoxes[COLUMN_COUNT];
+ VclPtr<OKButton> pOKBT;
+ VclPtr<ListBox> pIdentifierLB;
+ VclPtr<ListBox> pAuthorityTypeLB;
+ VclPtr<ListBox> pAuthorLB;
+ VclPtr<ListBox> pTitleLB;
+ VclPtr<ListBox> pMonthLB;
+ VclPtr<ListBox> pYearLB;
+ VclPtr<ListBox> pISBNLB;
+ VclPtr<ListBox> pBooktitleLB;
+ VclPtr<ListBox> pChapterLB;
+ VclPtr<ListBox> pEditionLB;
+ VclPtr<ListBox> pEditorLB;
+ VclPtr<ListBox> pHowpublishedLB;
+ VclPtr<ListBox> pInstitutionLB;
+ VclPtr<ListBox> pJournalLB;
+ VclPtr<ListBox> pNoteLB;
+ VclPtr<ListBox> pAnnoteLB;
+ VclPtr<ListBox> pNumberLB;
+ VclPtr<ListBox> pOrganizationsLB;
+ VclPtr<ListBox> pPagesLB;
+ VclPtr<ListBox> pPublisherLB;
+ VclPtr<ListBox> pAddressLB;
+ VclPtr<ListBox> pSchoolLB;
+ VclPtr<ListBox> pSeriesLB;
+ VclPtr<ListBox> pReportTypeLB;
+ VclPtr<ListBox> pVolumeLB;
+ VclPtr<ListBox> pURLLB;
+ VclPtr<ListBox> pCustom1LB;
+ VclPtr<ListBox> pCustom2LB;
+ VclPtr<ListBox> pCustom3LB;
+ VclPtr<ListBox> pCustom4LB;
+ VclPtr<ListBox> pCustom5LB;
+ VclPtr<ListBox> aListBoxes[COLUMN_COUNT];
OUString sNone;
bool bModified;
@@ -242,6 +242,7 @@ class MappingDialog_Impl : public ModalDialog
public:
MappingDialog_Impl(vcl::Window* pParent, BibDataManager* pDatMan);
virtual ~MappingDialog_Impl();
+ virtual void dispose() SAL_OVERRIDE;
void SetModified() {bModified = true;}
@@ -378,7 +379,48 @@ MappingDialog_Impl::MappingDialog_Impl(vcl::Window* pParent, BibDataManager* pMa
}
MappingDialog_Impl::~MappingDialog_Impl()
-{}
+{
+ disposeOnce();
+}
+
+void MappingDialog_Impl::dispose()
+{
+ pOKBT.clear();
+ pIdentifierLB.clear();
+ pAuthorityTypeLB.clear();
+ pAuthorLB.clear();
+ pTitleLB.clear();
+ pMonthLB.clear();
+ pYearLB.clear();
+ pISBNLB.clear();
+ pBooktitleLB.clear();
+ pChapterLB.clear();
+ pEditionLB.clear();
+ pEditorLB.clear();
+ pHowpublishedLB.clear();
+ pInstitutionLB.clear();
+ pJournalLB.clear();
+ pNoteLB.clear();
+ pAnnoteLB.clear();
+ pNumberLB.clear();
+ pOrganizationsLB.clear();
+ pPagesLB.clear();
+ pPublisherLB.clear();
+ pAddressLB.clear();
+ pSchoolLB.clear();
+ pSeriesLB.clear();
+ pReportTypeLB.clear();
+ pVolumeLB.clear();
+ pURLLB.clear();
+ pCustom1LB.clear();
+ pCustom2LB.clear();
+ pCustom3LB.clear();
+ pCustom4LB.clear();
+ pCustom5LB.clear();
+ for(auto & a : aListBoxes)
+ a.clear();
+ ModalDialog::dispose();
+}
IMPL_LINK(MappingDialog_Impl, ListBoxSelectHdl, ListBox*, pListBox)
{
@@ -428,7 +470,7 @@ IMPL_LINK_NOARG(MappingDialog_Impl, OkHdl)
class DBChangeDialog_Impl : public ModalDialog
{
- ListBox* m_pSelectionLB;
+ VclPtr<ListBox> m_pSelectionLB;
DBChangeDialogConfig_Impl aConfig;
BibDataManager* pDatMan;
@@ -437,6 +479,7 @@ class DBChangeDialog_Impl : public ModalDialog
public:
DBChangeDialog_Impl(vcl::Window* pParent, BibDataManager* pMan );
virtual ~DBChangeDialog_Impl();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetCurrentURL()const;
};
@@ -479,6 +522,13 @@ IMPL_LINK(DBChangeDialog_Impl, DoubleClickHdl, SvTabListBox*, /*pLB*/)
DBChangeDialog_Impl::~DBChangeDialog_Impl()
{
+ disposeOnce();
+}
+
+void DBChangeDialog_Impl::dispose()
+{
+ m_pSelectionLB.clear();
+ ModalDialog::dispose();
}
OUString DBChangeDialog_Impl::GetCurrentURL()const
@@ -1492,7 +1542,7 @@ void BibDataManager::RemoveMeAsUidListener()
void BibDataManager::CreateMappingDialog(vcl::Window* pParent)
{
- boost::scoped_ptr<MappingDialog_Impl> pDlg(new MappingDialog_Impl(pParent, this));
+ VclPtrInstance< MappingDialog_Impl > pDlg(pParent, this);
if(RET_OK == pDlg->Execute() && pBibView)
{
reload();
@@ -1502,7 +1552,7 @@ void BibDataManager::CreateMappingDialog(vcl::Window* pParent)
OUString BibDataManager::CreateDBChangeDialog(vcl::Window* pParent)
{
OUString uRet;
- boost::scoped_ptr<DBChangeDialog_Impl> pDlg(new DBChangeDialog_Impl(pParent, this ));
+ VclPtrInstance< DBChangeDialog_Impl > pDlg(pParent, this );
if(RET_OK == pDlg->Execute())
{
OUString sNewURL = pDlg->GetCurrentURL();
diff --git a/extensions/source/bibliography/datman.hxx b/extensions/source/bibliography/datman.hxx
index 655644ed07fa..366c81f952d5 100644
--- a/extensions/source/bibliography/datman.hxx
+++ b/extensions/source/bibliography/datman.hxx
@@ -33,6 +33,7 @@
#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
#include <com/sun/star/frame/XDispatchProviderInterception.hpp>
#include <cppuhelper/implbase1.hxx>
+#include <vcl/vclptr.hxx>
namespace vcl { class Window; }
@@ -100,8 +101,8 @@ private:
::cppu::OInterfaceContainerHelper m_aLoadListeners;
- ::bib::BibView* pBibView;
- BibToolBar* pToolbar;
+ VclPtr<::bib::BibView> pBibView;
+ VclPtr<BibToolBar> pToolbar;
OUString sIdentifierMapping;
protected:
diff --git a/extensions/source/bibliography/framectr.cxx b/extensions/source/bibliography/framectr.cxx
index a586fe69aa4c..563aa8a57067 100644
--- a/extensions/source/bibliography/framectr.cxx
+++ b/extensions/source/bibliography/framectr.cxx
@@ -25,6 +25,7 @@
#include <comphelper/sequence.hxx>
#include "framectr.hxx"
#include "datman.hxx"
+#include "bibview.hxx"
#include "bibresid.hxx"
#include "bib.hrc"
#include <toolkit/helper/vclunohelper.hxx>
diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx
index 238b1606d1e6..f84ab5855411 100644
--- a/extensions/source/bibliography/general.cxx
+++ b/extensions/source/bibliography/general.cxx
@@ -35,6 +35,7 @@
#include "bibprop.hrc"
#include "bib.hrc"
#include "bibmod.hxx"
+#include "bibview.hxx"
#include "bibtools.hxx"
#include "bibliography.hrc"
#include <tools/debug.hxx>
@@ -69,7 +70,7 @@ static OUString lcl_GetColumnName( const Mapping* pMapping, sal_uInt16 nIndexPos
class BibPosListener :public cppu::WeakImplHelper1 <sdbc::XRowSetListener>
{
- BibGeneralPage* pParentPage;
+ VclPtr<BibGeneralPage> pParentPage;
public:
BibPosListener(BibGeneralPage* pParent);
@@ -167,6 +168,7 @@ void BibPosListener::disposing(const lang::EventObject& /*Source*/) throw( uno::
BibGeneralPage::BibGeneralPage(vcl::Window* pParent, BibDataManager* pMan):
BibTabPage(pParent, "GeneralPage", "modules/sbibliography/ui/generalpage.ui"),
sErrorPrefix(BIB_RESSTR(ST_ERROR_PREFIX)),
+ maBibGeneralPageFocusListener(this),
pDatMan(pMan)
{
get(pIdentifierFT, "shortname");
@@ -340,12 +342,52 @@ BibGeneralPage::BibGeneralPage(vcl::Window* pParent, BibDataManager* pMan):
BibGeneralPage::~BibGeneralPage()
{
+ disposeOnce();
+}
+
+void BibGeneralPage::dispose()
+{
if (pDatMan && xPosListener.is())
{
uno::Reference< sdbc::XRowSet > xRowSet(pDatMan->getForm(), UNO_QUERY);
if(xRowSet.is())
xRowSet->removeRowSetListener(xPosListener);
}
+ pGrid.clear();
+ pScrolledWindow.clear();
+ pIdentifierFT.clear();
+ pAuthTypeFT.clear();
+ pYearFT.clear();
+ pAuthorFT.clear();
+ pTitleFT.clear();
+ pPublisherFT.clear();
+ pAddressFT.clear();
+ pISBNFT.clear();
+ pChapterFT.clear();
+ pPagesFT.clear();
+ pEditorFT.clear();
+ pEditionFT.clear();
+ pBooktitleFT.clear();
+ pVolumeFT.clear();
+ pHowpublishedFT.clear();
+ pOrganizationsFT.clear();
+ pInstitutionFT.clear();
+ pSchoolFT.clear();
+ pReportTypeFT.clear();
+ pMonthFT.clear();
+ pJournalFT.clear();
+ pNumberFT.clear();
+ pSeriesFT.clear();
+ pAnnoteFT.clear();
+ pNoteFT.clear();
+ pURLFT.clear();
+ pCustom1FT.clear();
+ pCustom2FT.clear();
+ pCustom3FT.clear();
+ pCustom4FT.clear();
+ pCustom5FT.clear();
+ for (auto & a: aFixedTexts) a.clear();
+ BibTabPage::dispose();
}
void BibGeneralPage::RemoveListeners()
@@ -355,7 +397,7 @@ void BibGeneralPage::RemoveListeners()
if(aControls[i].is())
{
uno::Reference< awt::XWindow > xCtrWin(aControls[i], uno::UNO_QUERY );
- xCtrWin->removeFocusListener( this );
+ xCtrWin->removeFocusListener( &maBibGeneralPageFocusListener );
aControls[i] = 0;
}
}
@@ -446,7 +488,7 @@ uno::Reference< awt::XControlModel > BibGeneralPage::AddXControl(
// Peer as Child to the FrameWindow
xCtrlContnr->addControl(rName, xControl);
uno::Reference< awt::XWindow > xCtrWin(xControl, UNO_QUERY );
- xCtrWin->addFocusListener( this );
+ xCtrWin->addFocusListener( &maBibGeneralPageFocusListener );
rIndex = -1; // -> implies, that not found
for(sal_uInt16 i = 0; i < FIELD_COUNT; i++)
if(!aControls[i].is())
@@ -567,10 +609,6 @@ void BibGeneralPage::focusLost(const awt::FocusEvent& ) throw( uno::RuntimeExcep
CommitActiveControl();
}
-void BibGeneralPage::disposing(const lang::EventObject& /*Source*/) throw( uno::RuntimeException, std::exception )
-{
-}
-
void BibGeneralPage::GetFocus()
{
Reference< awt::XWindow >* pxControl = aControls;
@@ -653,4 +691,20 @@ bool BibGeneralPage::HandleShortCutKey( const KeyEvent& rKeyEvent )
return bHandled;
}
+BibGeneralPageFocusListener::BibGeneralPageFocusListener(BibGeneralPage *pBibGeneralPage): mpBibGeneralPage(pBibGeneralPage)
+{}
+
+void BibGeneralPageFocusListener::focusGained( const ::com::sun::star::awt::FocusEvent& e ) throw( com::sun::star::uno::RuntimeException, std::exception )
+{
+ mpBibGeneralPage->focusGained(e);
+}
+
+void BibGeneralPageFocusListener::focusLost( const ::com::sun::star::awt::FocusEvent& e ) throw( com::sun::star::uno::RuntimeException, std::exception )
+{
+ mpBibGeneralPage->focusLost(e);
+}
+
+void BibGeneralPageFocusListener::disposing( const ::com::sun::star::lang::EventObject& ) throw( com::sun::star::uno::RuntimeException, std::exception )
+{}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/bibliography/general.hxx b/extensions/source/bibliography/general.hxx
index 2c0c17aaf5fe..e566c9f15e81 100644
--- a/extensions/source/bibliography/general.hxx
+++ b/extensions/source/bibliography/general.hxx
@@ -41,56 +41,70 @@ class BibDataManager;
#define TYPE_COUNT 22
#define FIELD_COUNT 31
-typedef cppu::WeakAggImplHelper1 < ::com::sun::star::awt::XFocusListener > BibGeneralPageBaseClass;
+/**
+ * We need to split off the listener because both it and the vcl::Window baseclass are ref-counted
+ */
+class BibGeneralPage;
+class BibGeneralPageFocusListener : public cppu::WeakAggImplHelper1 < ::com::sun::star::awt::XFocusListener >
+{
+private:
+ VclPtr<BibGeneralPage> mpBibGeneralPage;
+public:
+ BibGeneralPageFocusListener(BibGeneralPage *pBibGeneralPage);
+ virtual void SAL_CALL focusGained( const ::com::sun::star::awt::FocusEvent& e ) throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
+ virtual void SAL_CALL focusLost( const ::com::sun::star::awt::FocusEvent& e ) throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
-class BibGeneralPage: public BibGeneralPageBaseClass, public BibTabPage
+};
+
+class BibGeneralPage: public BibTabPage
{
- VclGrid* pGrid;
- VclScrolledWindow* pScrolledWindow;
+ VclPtr<VclGrid> pGrid;
+ VclPtr<VclScrolledWindow> pScrolledWindow;
- FixedText* pIdentifierFT;
- FixedText* pAuthTypeFT;
- FixedText* pYearFT;
+ VclPtr<FixedText> pIdentifierFT;
+ VclPtr<FixedText> pAuthTypeFT;
+ VclPtr<FixedText> pYearFT;
- FixedText* pAuthorFT;
- FixedText* pTitleFT;
+ VclPtr<FixedText> pAuthorFT;
+ VclPtr<FixedText> pTitleFT;
- FixedText* pPublisherFT;
- FixedText* pAddressFT;
- FixedText* pISBNFT;
+ VclPtr<FixedText> pPublisherFT;
+ VclPtr<FixedText> pAddressFT;
+ VclPtr<FixedText> pISBNFT;
- FixedText* pChapterFT;
- FixedText* pPagesFT;
+ VclPtr<FixedText> pChapterFT;
+ VclPtr<FixedText> pPagesFT;
- FixedText* pEditorFT;
- FixedText* pEditionFT;
+ VclPtr<FixedText> pEditorFT;
+ VclPtr<FixedText> pEditionFT;
- FixedText* pBooktitleFT;
- FixedText* pVolumeFT;
- FixedText* pHowpublishedFT;
+ VclPtr<FixedText> pBooktitleFT;
+ VclPtr<FixedText> pVolumeFT;
+ VclPtr<FixedText> pHowpublishedFT;
- FixedText* pOrganizationsFT;
- FixedText* pInstitutionFT;
- FixedText* pSchoolFT;
+ VclPtr<FixedText> pOrganizationsFT;
+ VclPtr<FixedText> pInstitutionFT;
+ VclPtr<FixedText> pSchoolFT;
- FixedText* pReportTypeFT;
- FixedText* pMonthFT;
+ VclPtr<FixedText> pReportTypeFT;
+ VclPtr<FixedText> pMonthFT;
- FixedText* pJournalFT;
- FixedText* pNumberFT;
- FixedText* pSeriesFT;
+ VclPtr<FixedText> pJournalFT;
+ VclPtr<FixedText> pNumberFT;
+ VclPtr<FixedText> pSeriesFT;
- FixedText* pAnnoteFT;
- FixedText* pNoteFT;
- FixedText* pURLFT;
+ VclPtr<FixedText> pAnnoteFT;
+ VclPtr<FixedText> pNoteFT;
+ VclPtr<FixedText> pURLFT;
- FixedText* pCustom1FT;
- FixedText* pCustom2FT;
- FixedText* pCustom3FT;
- FixedText* pCustom4FT;
- FixedText* pCustom5FT;
+ VclPtr<FixedText> pCustom1FT;
+ VclPtr<FixedText> pCustom2FT;
+ VclPtr<FixedText> pCustom3FT;
+ VclPtr<FixedText> pCustom4FT;
+ VclPtr<FixedText> pCustom5FT;
- FixedText* aFixedTexts[ FIELD_COUNT ];
+ VclPtr<FixedText> aFixedTexts[ FIELD_COUNT ];
sal_Int16 nFT2CtrlMap[ FIELD_COUNT ];
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >
@@ -113,6 +127,7 @@ class BibGeneralPage: public BibGeneralPageBaseClass, public BibTabPage
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSetListener >
xPosListener;
+ BibGeneralPageFocusListener maBibGeneralPageFocusListener;
BibDataManager* pDatMan;
@@ -130,6 +145,7 @@ protected:
public:
BibGeneralPage(vcl::Window* pParent, BibDataManager* pDatMan);
virtual ~BibGeneralPage();
+ virtual void dispose() SAL_OVERRIDE;
inline const OUString& GetErrorString() const;
@@ -142,16 +158,17 @@ public:
void CommitActiveControl();
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
-
- void SAL_CALL focusGained( const ::com::sun::star::awt::FocusEvent& e ) throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
- void SAL_CALL focusLost( const ::com::sun::star::awt::FocusEvent& e ) throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
-
void RemoveListeners();
virtual void GetFocus() SAL_OVERRIDE;
virtual bool HandleShortCutKey( const KeyEvent& rKeyEvent ) SAL_OVERRIDE; // returns true, if key was handled
+
+ inline BibGeneralPageFocusListener& GetFocusListener() { return maBibGeneralPageFocusListener; }
+
+ void focusGained(const css::awt::FocusEvent& rEvent) throw( css::uno::RuntimeException, std::exception );
+ void focusLost(const css::awt::FocusEvent& rEvent) throw( css::uno::RuntimeException, std::exception );
+
};
diff --git a/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx
index 66ed1ca4bea9..f6db18010275 100644
--- a/extensions/source/bibliography/toolbar.cxx
+++ b/extensions/source/bibliography/toolbar.cxx
@@ -31,6 +31,7 @@
#include <vcl/settings.hxx>
#include <vcl/mnemonic.hxx>
#include "bibbeam.hxx"
+#include "bibview.hxx"
#include "toolbar.hrc"
#include "bibresid.hxx"
@@ -179,10 +180,10 @@ BibToolBar::BibToolBar(vcl::Window* pParent, Link aLink, WinBits nStyle):
ToolBox(pParent,BibResId(RID_BIB_TOOLBAR)),
aImgLst(BibResId( RID_TOOLBAR_IMGLIST )),
aBigImgLst(BibResId( RID_TOOLBAR_BIGIMGLIST )),
- aFtSource(this,WB_VCENTER),
- aLBSource(this,WB_DROPDOWN),
- aFtQuery(this,WB_VCENTER),
- aEdQuery(this),
+ aFtSource(VclPtr<FixedText>::Create(this,WB_VCENTER)),
+ aLBSource(VclPtr<ListBox>::Create(this,WB_DROPDOWN)),
+ aFtQuery(VclPtr<FixedText>::Create(this,WB_VCENTER)),
+ aEdQuery(VclPtr<Edit>::Create(this)),
nMenuId(0),
nSelMenuItem(0),
aLayoutManager( aLink ),
@@ -198,10 +199,10 @@ BibToolBar::BibToolBar(vcl::Window* pParent, Link aLink, WinBits nStyle):
SetOutStyle(TOOLBOX_STYLE_FLAT);
Size a2Size(GetOutputSizePixel());
a2Size.Width()=100;
- aLBSource.SetSizePixel(a2Size);
- aLBSource.SetDropDownLineCount(9);
- aLBSource.Show();
- aLBSource.SetSelectHdl(LINK( this, BibToolBar, SelHdl));
+ aLBSource->SetSizePixel(a2Size);
+ aLBSource->SetDropDownLineCount(9);
+ aLBSource->Show();
+ aLBSource->SetSelectHdl(LINK( this, BibToolBar, SelHdl));
SvtMiscOptions().AddListenerLink( LINK( this, BibToolBar, OptionsChanged_Impl ) );
Application::AddEventListener( LINK( this, BibToolBar, SettingsChanged_Impl ) );
@@ -211,32 +212,42 @@ BibToolBar::BibToolBar(vcl::Window* pParent, Link aLink, WinBits nStyle):
SetDropdownClickHdl( LINK( this, BibToolBar, MenuHdl));
- aEdQuery.SetSizePixel(aLBSource.GetSizePixel());
- aEdQuery.Show();
+ aEdQuery->SetSizePixel(aLBSource->GetSizePixel());
+ aEdQuery->Show();
OUString aStr=GetItemText(TBC_FT_SOURCE);
- aFtSource.SetText(aStr);
- aFtSource.SetSizePixel(aFtSource.get_preferred_size());
- aFtSource.SetBackground(Wallpaper( COL_TRANSPARENT ));
+ aFtSource->SetText(aStr);
+ aFtSource->SetSizePixel(aFtSource->get_preferred_size());
+ aFtSource->SetBackground(Wallpaper( COL_TRANSPARENT ));
aStr=GetItemText(TBC_FT_QUERY);
- aFtQuery.SetText(aStr);
- aFtQuery.SetSizePixel(aFtQuery.get_preferred_size());
- aFtQuery.SetBackground(Wallpaper( COL_TRANSPARENT ));
+ aFtQuery->SetText(aStr);
+ aFtQuery->SetSizePixel(aFtQuery->get_preferred_size());
+ aFtQuery->SetBackground(Wallpaper( COL_TRANSPARENT ));
- SetItemWindow(TBC_FT_SOURCE,&aFtSource);
- SetItemWindow(TBC_LB_SOURCE,&aLBSource);
- SetItemWindow(TBC_FT_QUERY ,&aFtQuery);
- SetItemWindow(TBC_ED_QUERY ,&aEdQuery);
+ SetItemWindow(TBC_FT_SOURCE, aFtSource.get());
+ SetItemWindow(TBC_LB_SOURCE, aLBSource.get());
+ SetItemWindow(TBC_FT_QUERY , aFtQuery.get());
+ SetItemWindow(TBC_ED_QUERY , aEdQuery.get());
::bib::AddToTaskPaneList( this );
}
BibToolBar::~BibToolBar()
{
+ disposeOnce();
+}
+
+void BibToolBar::dispose()
+{
SvtMiscOptions().RemoveListenerLink( LINK( this, BibToolBar, OptionsChanged_Impl ) );
Application::RemoveEventListener( LINK( this, BibToolBar, SettingsChanged_Impl ) );
::bib::RemoveFromTaskPaneList( this );
+ aFtSource.disposeAndClear();
+ aFtQuery.disposeAndClear();
+ aEdQuery.disposeAndClear();
+ aLBSource.disposeAndClear();
+ ToolBox::dispose();
}
void BibToolBar::InitListener()
@@ -308,7 +319,7 @@ void BibToolBar::Select()
Sequence<PropertyValue> aPropVal(2);
PropertyValue* pPropertyVal = const_cast<PropertyValue*>(aPropVal.getConstArray());
pPropertyVal[0].Name="QueryText";
- OUString aSelection = aEdQuery.GetText();
+ OUString aSelection = aEdQuery->GetText();
pPropertyVal[0].Value <<= aSelection;
pPropertyVal[1].Name="QueryField";
@@ -386,39 +397,39 @@ void BibToolBar::SelectFilterItem(sal_uInt16 nId)
void BibToolBar::EnableSourceList(bool bFlag)
{
- aFtSource.Enable(bFlag);
- aLBSource.Enable(bFlag);
+ aFtSource->Enable(bFlag);
+ aLBSource->Enable(bFlag);
}
void BibToolBar::ClearSourceList()
{
- aLBSource.Clear();
+ aLBSource->Clear();
}
void BibToolBar::UpdateSourceList(bool bFlag)
{
- aLBSource.SetUpdateMode(bFlag);
+ aLBSource->SetUpdateMode(bFlag);
}
void BibToolBar::InsertSourceEntry(const OUString& aEntry, sal_Int32 nPos)
{
- aLBSource.InsertEntry(aEntry, nPos);
+ aLBSource->InsertEntry(aEntry, nPos);
}
void BibToolBar::SelectSourceEntry(const OUString& aStr)
{
- aLBSource.SelectEntry(aStr);
+ aLBSource->SelectEntry(aStr);
}
void BibToolBar::EnableQuery(bool bFlag)
{
- aFtQuery.Enable(bFlag);
- aEdQuery.Enable(bFlag);
+ aFtQuery->Enable(bFlag);
+ aEdQuery->Enable(bFlag);
}
void BibToolBar::SetQueryString(const OUString& aStr)
{
- aEdQuery.SetText(aStr);
+ aEdQuery->SetText(aStr);
}
@@ -427,7 +438,7 @@ bool BibToolBar::PreNotify( NotifyEvent& rNEvt )
bool nResult = true;
MouseNotifyEvent nSwitch=rNEvt.GetType();
- if(aEdQuery.HasFocus() && nSwitch==MouseNotifyEvent::KEYINPUT)
+ if(aEdQuery->HasFocus() && nSwitch==MouseNotifyEvent::KEYINPUT)
{
const vcl::KeyCode& aKeyCode=rNEvt.GetKeyEvent()->GetKeyCode();
sal_uInt16 nKey = aKeyCode.GetCode();
@@ -436,7 +447,7 @@ bool BibToolBar::PreNotify( NotifyEvent& rNEvt )
Sequence<PropertyValue> aPropVal(2);
PropertyValue* pPropertyVal = const_cast<PropertyValue*>(aPropVal.getConstArray());
pPropertyVal[0].Name = "QueryText";
- OUString aSelection = aEdQuery.GetText();
+ OUString aSelection = aEdQuery->GetText();
pPropertyVal[0].Value <<= aSelection;
pPropertyVal[1].Name="QueryField";
pPropertyVal[1].Value <<= aQueryField;
@@ -462,7 +473,7 @@ IMPL_LINK( BibToolBar, SendSelHdl, Timer*,/*pT*/)
Sequence<PropertyValue> aPropVal(1);
PropertyValue* pPropertyVal = const_cast<PropertyValue*>(aPropVal.getConstArray());
pPropertyVal[0].Name = "DataSourceName";
- OUString aEntry( MnemonicGenerator::EraseAllMnemonicChars( aLBSource.GetSelectEntry() ) );
+ OUString aEntry( MnemonicGenerator::EraseAllMnemonicChars( aLBSource->GetSelectEntry() ) );
OUString aSelection = aEntry;
pPropertyVal[0].Value <<= aSelection;
SendDispatch(TBC_LB_SOURCE,aPropVal);
@@ -490,7 +501,7 @@ IMPL_LINK( BibToolBar, MenuHdl, ToolBox*, /*pToolbox*/)
Sequence<PropertyValue> aPropVal(2);
PropertyValue* pPropertyVal = const_cast<PropertyValue*>(aPropVal.getConstArray());
pPropertyVal[0].Name = "QueryText";
- OUString aSelection = aEdQuery.GetText();
+ OUString aSelection = aEdQuery->GetText();
pPropertyVal[0].Value <<= aSelection;
pPropertyVal[1].Name="QueryField";
pPropertyVal[1].Value <<= aQueryField;
diff --git a/extensions/source/bibliography/toolbar.hxx b/extensions/source/bibliography/toolbar.hxx
index 177fc0b195df..f7eef64155bd 100644
--- a/extensions/source/bibliography/toolbar.hxx
+++ b/extensions/source/bibliography/toolbar.hxx
@@ -39,12 +39,12 @@ class BibToolBarListener: public cppu::WeakImplHelper1 < ::com::sun::star::frame
{
private:
- sal_uInt16 nIndex;
+ sal_uInt16 nIndex;
OUString aCommand;
protected:
- BibToolBar *pToolBar;
+ VclPtr<BibToolBar> pToolBar;
public:
@@ -109,20 +109,20 @@ class BibToolBar: public ToolBox
private:
BibToolBarListenerArr aListenerArr;
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > xController;
+ css::uno::Reference< css::frame::XController > xController;
Idle aIdle;
ImageList aImgLst;
ImageList aImgLstHC;
ImageList aBigImgLst;
ImageList aBigImgLstHC;
- FixedText aFtSource;
- ListBox aLBSource;
- FixedText aFtQuery;
- Edit aEdQuery;
+ VclPtr<FixedText> aFtSource;
+ VclPtr<ListBox> aLBSource;
+ VclPtr<FixedText> aFtQuery;
+ VclPtr<Edit> aEdQuery;
PopupMenu aPopupMenu;
sal_uInt16 nMenuId;
sal_uInt16 nSelMenuItem;
- OUString aQueryField;
+ OUString aQueryField;
Link aLayoutManager;
sal_Int16 nSymbolsSize;
sal_Int16 nOutStyle;
@@ -150,6 +150,7 @@ class BibToolBar: public ToolBox
BibToolBar(vcl::Window* pParent, Link aLink, WinBits nStyle = WB_3DLOOK );
virtual ~BibToolBar();
+ virtual void dispose() SAL_OVERRIDE;
void SetXController(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > &);
diff --git a/extensions/source/dbpilots/commonpagesdbp.cxx b/extensions/source/dbpilots/commonpagesdbp.cxx
index 5a9817164ca0..5c730601a17c 100644
--- a/extensions/source/dbpilots/commonpagesdbp.cxx
+++ b/extensions/source/dbpilots/commonpagesdbp.cxx
@@ -77,6 +77,19 @@ namespace dbp
m_pDatasource->SetDropDownLineCount(10);
}
+ OTableSelectionPage::~OTableSelectionPage()
+ {
+ disposeOnce();
+ }
+
+ void OTableSelectionPage::dispose()
+ {
+ m_pDatasourceLabel.clear();
+ m_pDatasource.clear();
+ m_pSearchDatabase.clear();
+ m_pTable.clear();
+ OControlWizardPage::dispose();
+ }
void OTableSelectionPage::ActivatePage()
{
@@ -383,6 +396,19 @@ namespace dbp
{
}
+ OMaybeListSelectionPage::~OMaybeListSelectionPage()
+ {
+ disposeOnce();
+ }
+
+ void OMaybeListSelectionPage::dispose()
+ {
+ m_pYes.clear();
+ m_pNo.clear();
+ m_pList.clear();
+ OControlWizardPage::dispose();
+ }
+
void OMaybeListSelectionPage::announceControls(RadioButton& _rYesButton, RadioButton& _rNoButton, ListBox& _rSelection)
{
m_pYes = &_rYesButton;
@@ -453,6 +479,19 @@ namespace dbp
m_pStoreWhere->SetDropDownLineCount(10);
}
+ ODBFieldPage::~ODBFieldPage()
+ {
+ disposeOnce();
+ }
+
+ void ODBFieldPage::dispose()
+ {
+ m_pDescription.clear();
+ m_pStoreYes.clear();
+ m_pStoreNo.clear();
+ m_pStoreWhere.clear();
+ OMaybeListSelectionPage::dispose();
+ }
void ODBFieldPage::initializePage()
{
diff --git a/extensions/source/dbpilots/commonpagesdbp.hxx b/extensions/source/dbpilots/commonpagesdbp.hxx
index 8d9d9c801d3f..1ff1d51b4601 100644
--- a/extensions/source/dbpilots/commonpagesdbp.hxx
+++ b/extensions/source/dbpilots/commonpagesdbp.hxx
@@ -36,16 +36,18 @@ namespace dbp
class OTableSelectionPage : public OControlWizardPage
{
protected:
- FixedText *m_pDatasourceLabel;
- ListBox *m_pDatasource;
- PushButton *m_pSearchDatabase;
- ListBox *m_pTable;
+ VclPtr<FixedText> m_pDatasourceLabel;
+ VclPtr<ListBox> m_pDatasource;
+ VclPtr<PushButton> m_pSearchDatabase;
+ VclPtr<ListBox> m_pTable;
::com::sun::star::uno::Reference< ::com::sun::star::sdb::XDatabaseContext >
m_xDSContext;
public:
OTableSelectionPage(OControlWizard* _pParent);
+ virtual ~OTableSelectionPage();
+ virtual void dispose() SAL_OVERRIDE;
protected:
// TabPage overridables
@@ -74,12 +76,14 @@ namespace dbp
class OMaybeListSelectionPage : public OControlWizardPage
{
protected:
- RadioButton* m_pYes;
- RadioButton* m_pNo;
- ListBox* m_pList;
+ VclPtr<RadioButton> m_pYes;
+ VclPtr<RadioButton> m_pNo;
+ VclPtr<ListBox> m_pList;
public:
OMaybeListSelectionPage( OControlWizard* _pParent, const OString& _rID, const OUString& _rUIXMLDescription );
+ virtual ~OMaybeListSelectionPage();
+ virtual void dispose() SAL_OVERRIDE;
protected:
DECL_LINK( OnRadioSelected, RadioButton* );
@@ -105,13 +109,15 @@ namespace dbp
class ODBFieldPage : public OMaybeListSelectionPage
{
protected:
- FixedText* m_pDescription;
- RadioButton* m_pStoreYes;
- RadioButton* m_pStoreNo;
- ListBox* m_pStoreWhere;
+ VclPtr<FixedText> m_pDescription;
+ VclPtr<RadioButton> m_pStoreYes;
+ VclPtr<RadioButton> m_pStoreNo;
+ VclPtr<ListBox> m_pStoreWhere;
public:
ODBFieldPage( OControlWizard* _pParent );
+ virtual ~ODBFieldPage();
+ virtual void dispose() SAL_OVERRIDE;
protected:
void setDescriptionText(const OUString& _rDesc) { m_pDescription->SetText(_rDesc); }
diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx
index c3f8c025d20c..9128bbbf4589 100644
--- a/extensions/source/dbpilots/controlwizard.cxx
+++ b/extensions/source/dbpilots/controlwizard.cxx
@@ -86,6 +86,18 @@ namespace dbp
OControlWizardPage::~OControlWizardPage()
{
+ disposeOnce();
+ }
+
+ void OControlWizardPage::dispose()
+ {
+ m_pFormDatasourceLabel.clear();
+ m_pFormDatasource.clear();
+ m_pFormContentTypeLabel.clear();
+ m_pFormContentType.clear();
+ m_pFormTableLabel.clear();
+ m_pFormTable.clear();
+ OControlWizardPage_Base::dispose();
}
OControlWizard* OControlWizardPage::getDialog()
diff --git a/extensions/source/dbpilots/controlwizard.hxx b/extensions/source/dbpilots/controlwizard.hxx
index 879520db1c99..529e94bb25c4 100644
--- a/extensions/source/dbpilots/controlwizard.hxx
+++ b/extensions/source/dbpilots/controlwizard.hxx
@@ -57,12 +57,12 @@ namespace dbp
class OControlWizardPage : public OControlWizardPage_Base
{
protected:
- FixedText* m_pFormDatasourceLabel;
- FixedText* m_pFormDatasource;
- FixedText* m_pFormContentTypeLabel;
- FixedText* m_pFormContentType;
- FixedText* m_pFormTableLabel;
- FixedText* m_pFormTable;
+ VclPtr<FixedText> m_pFormDatasourceLabel;
+ VclPtr<FixedText> m_pFormDatasource;
+ VclPtr<FixedText> m_pFormContentTypeLabel;
+ VclPtr<FixedText> m_pFormContentType;
+ VclPtr<FixedText> m_pFormTableLabel;
+ VclPtr<FixedText> m_pFormTable;
protected:
OControlWizard* getDialog();
@@ -75,6 +75,7 @@ namespace dbp
public:
OControlWizardPage( OControlWizard* _pParent, const OString& rID, const OUString& rUIXMLDescription );
virtual ~OControlWizardPage();
+ virtual void dispose() SAL_OVERRIDE;
protected:
static void fillListBox(
diff --git a/extensions/source/dbpilots/gridwizard.cxx b/extensions/source/dbpilots/gridwizard.cxx
index 882847b0f99f..aec86cd649ca 100644
--- a/extensions/source/dbpilots/gridwizard.cxx
+++ b/extensions/source/dbpilots/gridwizard.cxx
@@ -228,17 +228,16 @@ namespace dbp
}
- OWizardPage* OGridWizard::createPage(WizardState _nState)
+ VclPtr<TabPage> OGridWizard::createPage(WizardState _nState)
{
switch (_nState)
{
case GW_STATE_DATASOURCE_SELECTION:
- return new OTableSelectionPage(this);
+ return VclPtr<OTableSelectionPage>::Create(this);
case GW_STATE_FIELDSELECTION:
- return new OGridFieldsSelection(this);
+ return VclPtr<OGridFieldsSelection>::Create(this);
}
-
- return NULL;
+ return VclPtr<TabPage>();
}
@@ -319,6 +318,21 @@ namespace dbp
m_pSelFields->SetDoubleClickHdl(LINK(this, OGridFieldsSelection, OnEntryDoubleClicked));
}
+ OGridFieldsSelection::~OGridFieldsSelection()
+ {
+ disposeOnce();
+ }
+
+ void OGridFieldsSelection::dispose()
+ {
+ m_pExistFields.clear();
+ m_pSelectOne.clear();
+ m_pSelectAll.clear();
+ m_pDeselectOne.clear();
+ m_pDeselectAll.clear();
+ m_pSelFields.clear();
+ OGridPage::dispose();
+ }
void OGridFieldsSelection::ActivatePage()
{
diff --git a/extensions/source/dbpilots/gridwizard.hxx b/extensions/source/dbpilots/gridwizard.hxx
index 91da2fd5bee7..9c66ae9e72cd 100644
--- a/extensions/source/dbpilots/gridwizard.hxx
+++ b/extensions/source/dbpilots/gridwizard.hxx
@@ -56,7 +56,7 @@ namespace dbp
protected:
// OWizardMachine overridables
- virtual ::svt::OWizardPage* createPage( WizardState _nState ) SAL_OVERRIDE;
+ virtual VclPtr<TabPage> createPage( WizardState _nState ) SAL_OVERRIDE;
virtual WizardState determineNextState( WizardState _nCurrentState ) const SAL_OVERRIDE;
virtual void enterState( WizardState _nState ) SAL_OVERRIDE;
virtual bool leaveState( WizardState _nState ) SAL_OVERRIDE;
@@ -82,15 +82,17 @@ namespace dbp
class OGridFieldsSelection : public OGridPage
{
protected:
- ListBox *m_pExistFields;
- PushButton *m_pSelectOne;
- PushButton *m_pSelectAll;
- PushButton *m_pDeselectOne;
- PushButton *m_pDeselectAll;
- ListBox *m_pSelFields;
+ VclPtr<ListBox> m_pExistFields;
+ VclPtr<PushButton> m_pSelectOne;
+ VclPtr<PushButton> m_pSelectAll;
+ VclPtr<PushButton> m_pDeselectOne;
+ VclPtr<PushButton> m_pDeselectAll;
+ VclPtr<ListBox> m_pSelFields;
public:
OGridFieldsSelection( OGridWizard* _pParent );
+ virtual ~OGridFieldsSelection();
+ virtual void dispose() SAL_OVERRIDE;
protected:
// TabPage overridables
diff --git a/extensions/source/dbpilots/groupboxwiz.cxx b/extensions/source/dbpilots/groupboxwiz.cxx
index 2f165addf0cf..fbcaa668990b 100644
--- a/extensions/source/dbpilots/groupboxwiz.cxx
+++ b/extensions/source/dbpilots/groupboxwiz.cxx
@@ -69,24 +69,24 @@ namespace dbp
}
- OWizardPage* OGroupBoxWizard::createPage(::svt::WizardTypes::WizardState _nState)
+ VclPtr<TabPage> OGroupBoxWizard::createPage(::svt::WizardTypes::WizardState _nState)
{
switch (_nState)
{
case GBW_STATE_OPTIONLIST:
- return new ORadioSelectionPage(this);
+ return VclPtr<ORadioSelectionPage>::Create(this);
case GBW_STATE_DEFAULTOPTION:
- return new ODefaultFieldSelectionPage(this);
+ return VclPtr<ODefaultFieldSelectionPage>::Create(this);
case GBW_STATE_OPTIONVALUES:
- return new OOptionValuesPage(this);
+ return VclPtr<OOptionValuesPage>::Create(this);
case GBW_STATE_DBFIELD:
- return new OOptionDBFieldPage(this);
+ return VclPtr<OOptionDBFieldPage>::Create(this);
case GBW_STATE_FINALIZE:
- return new OFinalizeGBWPage(this);
+ return VclPtr<OFinalizeGBWPage>::Create(this);
}
return NULL;
@@ -207,11 +207,24 @@ namespace dbp
implCheckMoveButtons();
m_pExistingRadios->EnableMultiSelection(true);
- getDialog()->defaultButton(m_pMoveRight);
+ getDialog()->defaultButton(m_pMoveRight.get());
m_pExistingRadios->SetAccessibleRelationMemberOf(m_pExistingRadios);
}
+ ORadioSelectionPage::~ORadioSelectionPage()
+ {
+ disposeOnce();
+ }
+
+ void ORadioSelectionPage::dispose()
+ {
+ m_pRadioName.clear();
+ m_pMoveRight.clear();
+ m_pMoveLeft.clear();
+ m_pExistingRadios.clear();
+ OGBWPage::dispose();
+ }
void ORadioSelectionPage::ActivatePage()
{
@@ -315,7 +328,7 @@ namespace dbp
if (bUnfinishedInput)
{
if (0 == (m_pMoveRight->GetStyle() & WB_DEFBUTTON))
- getDialog()->defaultButton(m_pMoveRight);
+ getDialog()->defaultButton(m_pMoveRight.get());
}
else
{
@@ -341,6 +354,18 @@ namespace dbp
m_pDefSelection->SetStyle(WB_DROPDOWN);
}
+ ODefaultFieldSelectionPage::~ODefaultFieldSelectionPage()
+ {
+ disposeOnce();
+ }
+
+ void ODefaultFieldSelectionPage::dispose()
+ {
+ m_pDefSelYes.clear();
+ m_pDefSelNo.clear();
+ m_pDefSelection.clear();
+ OMaybeListSelectionPage::dispose();
+ }
void ODefaultFieldSelectionPage::initializePage()
{
@@ -388,6 +413,17 @@ namespace dbp
m_pOptions->SetAccessibleRelationMemberOf(m_pOptions);
}
+ OOptionValuesPage::~OOptionValuesPage()
+ {
+ disposeOnce();
+ }
+
+ void OOptionValuesPage::dispose()
+ {
+ m_pValue.clear();
+ m_pOptions.clear();
+ OGBWPage::dispose();
+ }
IMPL_LINK( OOptionValuesPage, OnOptionSelected, ListBox*, /*NOTINTERESTEDIN*/ )
{
@@ -486,6 +522,16 @@ namespace dbp
get(m_pName, "nameit");
}
+ OFinalizeGBWPage::~OFinalizeGBWPage()
+ {
+ disposeOnce();
+ }
+
+ void OFinalizeGBWPage::dispose()
+ {
+ m_pName.clear();
+ OGBWPage::dispose();
+ }
void OFinalizeGBWPage::ActivatePage()
{
diff --git a/extensions/source/dbpilots/groupboxwiz.hxx b/extensions/source/dbpilots/groupboxwiz.hxx
index e37840f88216..9413628bcc88 100644
--- a/extensions/source/dbpilots/groupboxwiz.hxx
+++ b/extensions/source/dbpilots/groupboxwiz.hxx
@@ -62,7 +62,7 @@ namespace dbp
protected:
// OWizardMachine overridables
- virtual ::svt::OWizardPage* createPage( WizardState _nState ) SAL_OVERRIDE;
+ virtual VclPtr<TabPage> createPage( WizardState _nState ) SAL_OVERRIDE;
virtual WizardState determineNextState( WizardState _nCurrentState ) const SAL_OVERRIDE;
virtual void enterState( WizardState _nState ) SAL_OVERRIDE;
virtual bool onFinish() SAL_OVERRIDE;
@@ -94,13 +94,15 @@ namespace dbp
class ORadioSelectionPage : public OGBWPage
{
protected:
- Edit *m_pRadioName;
- PushButton *m_pMoveRight;
- PushButton *m_pMoveLeft;
- ListBox *m_pExistingRadios;
+ VclPtr<Edit> m_pRadioName;
+ VclPtr<PushButton> m_pMoveRight;
+ VclPtr<PushButton> m_pMoveLeft;
+ VclPtr<ListBox> m_pExistingRadios;
public:
ORadioSelectionPage( OControlWizard* _pParent );
+ virtual ~ORadioSelectionPage();
+ virtual void dispose() SAL_OVERRIDE;
protected:
// TabPage overridables
@@ -124,12 +126,14 @@ namespace dbp
class ODefaultFieldSelectionPage : public OMaybeListSelectionPage
{
protected:
- RadioButton *m_pDefSelYes;
- RadioButton *m_pDefSelNo;
- ListBox *m_pDefSelection;
+ VclPtr<RadioButton> m_pDefSelYes;
+ VclPtr<RadioButton> m_pDefSelNo;
+ VclPtr<ListBox> m_pDefSelection;
public:
ODefaultFieldSelectionPage( OControlWizard* _pParent );
+ virtual ~ODefaultFieldSelectionPage();
+ virtual void dispose() SAL_OVERRIDE;
protected:
// OWizardPage overridables
@@ -145,8 +149,8 @@ namespace dbp
class OOptionValuesPage : public OGBWPage
{
protected:
- Edit *m_pValue;
- ListBox *m_pOptions;
+ VclPtr<Edit> m_pValue;
+ VclPtr<ListBox> m_pOptions;
StringArray m_aUncommittedValues;
::svt::WizardTypes::WizardState
@@ -154,6 +158,8 @@ namespace dbp
public:
OOptionValuesPage( OControlWizard* _pParent );
+ virtual ~OOptionValuesPage();
+ virtual void dispose() SAL_OVERRIDE;
protected:
// TabPage overridables
@@ -189,10 +195,12 @@ namespace dbp
class OFinalizeGBWPage : public OGBWPage
{
protected:
- Edit *m_pName;
+ VclPtr<Edit> m_pName;
public:
OFinalizeGBWPage( OControlWizard* _pParent );
+ virtual ~OFinalizeGBWPage();
+ virtual void dispose() SAL_OVERRIDE;
protected:
// TabPage overridables
diff --git a/extensions/source/dbpilots/listcombowizard.cxx b/extensions/source/dbpilots/listcombowizard.cxx
index 6349c0796c58..0173584e3455 100644
--- a/extensions/source/dbpilots/listcombowizard.cxx
+++ b/extensions/source/dbpilots/listcombowizard.cxx
@@ -88,23 +88,23 @@ namespace dbp
}
- OWizardPage* OListComboWizard::createPage(WizardState _nState)
+ VclPtr<TabPage> OListComboWizard::createPage(WizardState _nState)
{
switch (_nState)
{
case LCW_STATE_DATASOURCE_SELECTION:
- return new OTableSelectionPage(this);
+ return VclPtr<OTableSelectionPage>::Create(this);
case LCW_STATE_TABLESELECTION:
- return new OContentTableSelection(this);
+ return VclPtr<OContentTableSelection>::Create(this);
case LCW_STATE_FIELDSELECTION:
- return new OContentFieldSelection(this);
+ return VclPtr<OContentFieldSelection>::Create(this);
case LCW_STATE_FIELDLINK:
- return new OLinkFieldsPage(this);
+ return VclPtr<OLinkFieldsPage>::Create(this);
case LCW_STATE_COMBODBFIELD:
- return new OComboDBFieldPage(this);
+ return VclPtr<OComboDBFieldPage>::Create(this);
}
- return NULL;
+ return VclPtr<TabPage>();
}
@@ -285,6 +285,16 @@ namespace dbp
m_pSelectTable->SetSelectHdl(LINK(this, OContentTableSelection, OnTableSelected));
}
+ OContentTableSelection::~OContentTableSelection()
+ {
+ disposeOnce();
+ }
+
+ void OContentTableSelection::dispose()
+ {
+ m_pSelectTable.clear();
+ OLCPage::dispose();
+ }
void OContentTableSelection::ActivatePage()
{
@@ -369,6 +379,18 @@ namespace dbp
m_pSelectTableField->SetDoubleClickHdl(LINK(this, OContentFieldSelection, OnTableDoubleClicked));
}
+ OContentFieldSelection::~OContentFieldSelection()
+ {
+ disposeOnce();
+ }
+
+ void OContentFieldSelection::dispose()
+ {
+ m_pSelectTableField.clear();
+ m_pDisplayedField.clear();
+ m_pInfo.clear();
+ OLCPage::dispose();
+ }
void OContentFieldSelection::ActivatePage()
{
@@ -439,6 +461,17 @@ namespace dbp
m_pTableField->SetSelectHdl(LINK(this, OLinkFieldsPage, OnSelectionModified));
}
+ OLinkFieldsPage::~OLinkFieldsPage()
+ {
+ disposeOnce();
+ }
+
+ void OLinkFieldsPage::dispose()
+ {
+ m_pValueListField.clear();
+ m_pTableField.clear();
+ OLCPage::dispose();
+ }
void OLinkFieldsPage::ActivatePage()
{
diff --git a/extensions/source/dbpilots/listcombowizard.hxx b/extensions/source/dbpilots/listcombowizard.hxx
index 6d4908cdda5c..ec28093479ce 100644
--- a/extensions/source/dbpilots/listcombowizard.hxx
+++ b/extensions/source/dbpilots/listcombowizard.hxx
@@ -68,7 +68,7 @@ namespace dbp
protected:
// OWizardMachine overridables
- virtual ::svt::OWizardPage* createPage( WizardState _nState ) SAL_OVERRIDE;
+ virtual VclPtr<TabPage> createPage( WizardState _nState ) SAL_OVERRIDE;
virtual WizardState determineNextState( WizardState _nCurrentState ) const SAL_OVERRIDE;
virtual void enterState( WizardState _nState ) SAL_OVERRIDE;
virtual bool leaveState( WizardState _nState ) SAL_OVERRIDE;
@@ -108,10 +108,12 @@ namespace dbp
class OContentTableSelection : public OLCPage
{
protected:
- ListBox *m_pSelectTable;
+ VclPtr<ListBox> m_pSelectTable;
public:
OContentTableSelection( OListComboWizard* _pParent );
+ virtual ~OContentTableSelection();
+ virtual void dispose() SAL_OVERRIDE;
protected:
// TabPage overridables
@@ -133,13 +135,15 @@ namespace dbp
class OContentFieldSelection : public OLCPage
{
protected:
- ListBox *m_pSelectTableField;
- Edit *m_pDisplayedField;
- FixedText *m_pInfo;
+ VclPtr<ListBox> m_pSelectTableField;
+ VclPtr<Edit> m_pDisplayedField;
+ VclPtr<FixedText> m_pInfo;
public:
OContentFieldSelection( OListComboWizard* _pParent );
+ virtual ~OContentFieldSelection();
+ virtual void dispose() SAL_OVERRIDE;
protected:
DECL_LINK( OnFieldSelected, ListBox* );
@@ -160,12 +164,14 @@ namespace dbp
class OLinkFieldsPage : public OLCPage
{
protected:
- ComboBox *m_pValueListField;
- ComboBox *m_pTableField;
+ VclPtr<ComboBox> m_pValueListField;
+ VclPtr<ComboBox> m_pTableField;
public:
OLinkFieldsPage( OListComboWizard* _pParent );
+ virtual ~OLinkFieldsPage();
+ virtual void dispose() SAL_OVERRIDE;
protected:
// TabPage overridables
diff --git a/extensions/source/dbpilots/unoautopilot.hxx b/extensions/source/dbpilots/unoautopilot.hxx
index c70597fca7d5..0e669efb8af9 100644
--- a/extensions/source/dbpilots/unoautopilot.hxx
+++ b/extensions/source/dbpilots/unoautopilot.hxx
@@ -85,7 +85,7 @@ namespace dbp
protected:
// OGenericUnoDialog overridables
- virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
+ virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
virtual void implInitialize(const com::sun::star::uno::Any& _rValue) SAL_OVERRIDE;
};
diff --git a/extensions/source/dbpilots/unoautopilot.inl b/extensions/source/dbpilots/unoautopilot.inl
index 77f3cf6e795d..55e5861f3595 100644
--- a/extensions/source/dbpilots/unoautopilot.inl
+++ b/extensions/source/dbpilots/unoautopilot.inl
@@ -96,9 +96,9 @@ template <class TYPE, class SERVICEINFO>
template <class TYPE, class SERVICEINFO>
-Dialog* OUnoAutoPilot<TYPE, SERVICEINFO>::createDialog(::vcl::Window* _pParent)
+VclPtr<Dialog> OUnoAutoPilot<TYPE, SERVICEINFO>::createDialog(::vcl::Window* _pParent)
{
- return new TYPE(_pParent, m_xObjectModel, m_aContext);
+ return VclPtr<TYPE>::Create(_pParent, m_xObjectModel, m_aContext);
}
diff --git a/extensions/source/plugin/base/plctrl.cxx b/extensions/source/plugin/base/plctrl.cxx
index 6ad9fdd5aa5b..4276ba98eb01 100644
--- a/extensions/source/plugin/base/plctrl.cxx
+++ b/extensions/source/plugin/base/plctrl.cxx
@@ -169,7 +169,7 @@ void PluginControl_Impl::createPeer( const Reference< ::com::sun::star::awt::XTo
vcl::Window* pImpl = VCLUnoHelper::GetWindow( xParentPeer );
if (pImpl)
{
- _pSysChild = new SystemChildWindow( pImpl, WB_CLIPCHILDREN );
+ _pSysChild = VclPtr<SystemChildWindow>::Create( pImpl, WB_CLIPCHILDREN );
if (pImpl->HasFocus())
_pSysChild->GrabFocus();
diff --git a/extensions/source/plugin/inc/plugin/plctrl.hxx b/extensions/source/plugin/inc/plugin/plctrl.hxx
index 0684a9a6fe20..2a0db6ff7bda 100644
--- a/extensions/source/plugin/inc/plugin/plctrl.hxx
+++ b/extensions/source/plugin/inc/plugin/plctrl.hxx
@@ -60,6 +60,7 @@
#include <com/sun/star/awt/PosSize.hpp>
#include <cppuhelper/implbase4.hxx>
+#include <vcl/vclptr.hxx>
#include <list>
@@ -152,9 +153,9 @@ protected:
protected:
::std::list< Reference< ::com::sun::star::lang::XEventListener > > _aDisposeListeners;
- MRCListenerMultiplexerHelper* _pMultiplexer;
+ MRCListenerMultiplexerHelper* _pMultiplexer;
- Reference< XInterface > _xContext;
+ Reference< XInterface > _xContext;
sal_Int32 _nX;
sal_Int32 _nY;
@@ -162,11 +163,11 @@ protected:
sal_Int32 _nHeight;
sal_Int16 _nFlags;
- bool _bVisible;
- bool _bInDesignMode;
- bool _bEnable;
+ bool _bVisible;
+ bool _bInDesignMode;
+ bool _bEnable;
- SystemChildWindow* _pSysChild;
+ VclPtr<SystemChildWindow> _pSysChild;
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > _xPeer;
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > _xPeerWindow;
diff --git a/extensions/source/propctrlr/MasterDetailLinkDialog.cxx b/extensions/source/propctrlr/MasterDetailLinkDialog.cxx
index 8f7f24b9d5cd..7803b2951f20 100644
--- a/extensions/source/propctrlr/MasterDetailLinkDialog.cxx
+++ b/extensions/source/propctrlr/MasterDetailLinkDialog.cxx
@@ -103,9 +103,9 @@ namespace pcr
}
- Dialog* MasterDetailLinkDialog::createDialog(vcl::Window* _pParent)
+ VclPtr<Dialog> MasterDetailLinkDialog::createDialog(vcl::Window* _pParent)
{
- return new FormLinkDialog(_pParent,m_xDetail,m_xMaster, m_aContext
+ return VclPtr<FormLinkDialog>::Create(_pParent,m_xDetail,m_xMaster, m_aContext
,m_sExplanation,m_sDetailLabel,m_sMasterLabel);
}
diff --git a/extensions/source/propctrlr/MasterDetailLinkDialog.hxx b/extensions/source/propctrlr/MasterDetailLinkDialog.hxx
index 28a6ddfa7875..a00f852028b2 100644
--- a/extensions/source/propctrlr/MasterDetailLinkDialog.hxx
+++ b/extensions/source/propctrlr/MasterDetailLinkDialog.hxx
@@ -60,7 +60,7 @@ namespace pcr
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const SAL_OVERRIDE;
// OGenericUnoDialog overridables
- virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
+ virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
virtual void implInitialize(const com::sun::star::uno::Any& _rValue) SAL_OVERRIDE;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> m_xDetail;
diff --git a/extensions/source/propctrlr/browserline.cxx b/extensions/source/propctrlr/browserline.cxx
index bd0b335f6af7..174c01eef667 100644
--- a/extensions/source/propctrlr/browserline.cxx
+++ b/extensions/source/propctrlr/browserline.cxx
@@ -55,7 +55,7 @@ namespace pcr
OBrowserLine::OBrowserLine( const OUString& _rEntryName, vcl::Window* pParent )
:m_sEntryName( _rEntryName )
- ,m_aFtTitle(pParent)
+ ,m_aFtTitle(VclPtr<FixedText>::Create(pParent))
,m_pControlWindow( NULL )
,m_pBrowseButton(NULL)
,m_pAdditionalBrowseButton( NULL )
@@ -66,7 +66,7 @@ namespace pcr
,m_bIndentTitle( false )
,m_bReadOnly( false )
{
- m_aFtTitle.Show();
+ m_aFtTitle->Show();
}
@@ -109,7 +109,7 @@ namespace pcr
void OBrowserLine::setControl( const Reference< XPropertyControl >& _rxControl )
{
m_xControl = _rxControl;
- m_pControlWindow = m_xControl.is() ? VCLUnoHelper::GetWindow( _rxControl->getControlWindow() ) : NULL;
+ m_pControlWindow = m_xControl.is() ? VCLUnoHelper::GetWindow( _rxControl->getControlWindow() ) : VclPtr<vcl::Window>();
DBG_ASSERT( m_pControlWindow, "OBrowserLine::setControl: setting NULL controls/windows is not allowed!" );
if ( m_pControlWindow )
@@ -123,7 +123,7 @@ namespace pcr
vcl::Window* OBrowserLine::GetRefWindow()
{
- vcl::Window* pRefWindow=&m_aFtTitle;
+ vcl::Window* pRefWindow = m_aFtTitle.get();
if(m_pBrowseButton)
{
@@ -139,9 +139,9 @@ namespace pcr
void OBrowserLine::SetTabOrder(vcl::Window* pRefWindow, sal_uInt16 nFlags )
{
- m_aFtTitle.SetZOrder(pRefWindow,nFlags);
+ m_aFtTitle->SetZOrder(pRefWindow,nFlags);
if ( m_pControlWindow )
- m_pControlWindow->SetZOrder( (vcl::Window*)&m_aFtTitle, WINDOW_ZORDER_BEHIND );
+ m_pControlWindow->SetZOrder( m_aFtTitle.get(), WINDOW_ZORDER_BEHIND );
if ( m_pBrowseButton && m_pControlWindow )
m_pBrowseButton->SetZOrder( m_pControlWindow, WINDOW_ZORDER_BEHIND );
@@ -185,7 +185,7 @@ namespace pcr
void OBrowserLine::Show(bool bFlag)
{
- m_aFtTitle.Show(bFlag);
+ m_aFtTitle->Show(bFlag);
if ( m_pControlWindow )
m_pControlWindow->Show( bFlag );
if ( m_pBrowseButton )
@@ -203,7 +203,7 @@ namespace pcr
bool OBrowserLine::IsVisible()
{
- return m_aFtTitle.IsVisible();
+ return m_aFtTitle->IsVisible();
}
@@ -219,7 +219,7 @@ namespace pcr
aTitlePos.X() += aIndent.Width();
aTitleSize.Width() -= aIndent.Width();
}
- m_aFtTitle.SetPosSizePixel( aTitlePos, aTitleSize );
+ m_aFtTitle->SetPosSizePixel( aTitlePos, aTitleSize );
}
sal_Int32 nBrowseButtonSize = m_aOutputSize.Height() - 4;
@@ -255,7 +255,7 @@ namespace pcr
if ( GetTitle() == _rNewTtile )
return;
// #99102# --------------
- m_aFtTitle.SetText( _rNewTtile );
+ m_aFtTitle->SetText( _rNewTtile );
if ( m_pControlWindow )
m_pControlWindow->SetAccessibleName( _rNewTtile );
if ( m_pBrowseButton )
@@ -268,7 +268,7 @@ namespace pcr
{
if( m_pTheParent )
{
- OUStringBuffer aText( m_aFtTitle.GetText() );
+ OUStringBuffer aText( m_aFtTitle->GetText() );
while( m_pTheParent->GetTextWidth( aText.toString() ) < m_nNameWidth )
aText.append("...........");
@@ -280,14 +280,14 @@ namespace pcr
aText.append( OUString(cRTL_mark) );
}
- m_aFtTitle.SetText( aText.makeStringAndClear() );
+ m_aFtTitle->SetText( aText.makeStringAndClear() );
}
}
OUString OBrowserLine::GetTitle() const
{
- OUString sDisplayName = m_aFtTitle.GetText();
+ OUString sDisplayName = m_aFtTitle->GetText();
// for Issue 69452
if (AllSettings::GetLayoutRTL())
@@ -341,7 +341,7 @@ namespace pcr
void OBrowserLine::implUpdateEnabledDisabled()
{
- implEnable( &m_aFtTitle, m_nEnableFlags, PropertyLineElement::CompleteLine );
+ implEnable( m_aFtTitle.get(), m_nEnableFlags, PropertyLineElement::CompleteLine );
if ( m_pControlWindow )
implEnable( m_pControlWindow, m_nEnableFlags, PropertyLineElement::CompleteLine | PropertyLineElement::InputControl );
@@ -376,11 +376,11 @@ namespace pcr
PushButton& OBrowserLine::impl_ensureButton( bool _bPrimary )
{
- PushButton*& rpButton = _bPrimary ? m_pBrowseButton : m_pAdditionalBrowseButton;
+ VclPtr<PushButton>& rpButton = _bPrimary ? m_pBrowseButton : m_pAdditionalBrowseButton;
if ( !rpButton )
{
- rpButton = new PushButton( m_pTheParent, WB_NOPOINTERFOCUS );
+ rpButton = VclPtr<PushButton>::Create( m_pTheParent, WB_NOPOINTERFOCUS );
rpButton->SetGetFocusHdl( LINK( this, OBrowserLine, OnButtonFocus ) );
rpButton->SetClickHdl( LINK( this, OBrowserLine, OnButtonClicked ) );
rpButton->SetText(OUString("..."));
@@ -443,13 +443,12 @@ namespace pcr
void OBrowserLine::implHideBrowseButton( bool _bPrimary, bool _bReLayout )
{
- PushButton*& rpButton = _bPrimary ? m_pBrowseButton : m_pAdditionalBrowseButton;
+ VclPtr<PushButton>& rpButton = _bPrimary ? m_pBrowseButton : m_pAdditionalBrowseButton;
if ( rpButton )
{
rpButton->Hide();
- delete rpButton;
- rpButton = NULL;
+ rpButton.disposeAndClear();
}
if ( _bReLayout )
diff --git a/extensions/source/propctrlr/browserline.hxx b/extensions/source/propctrlr/browserline.hxx
index 1fa64a89a47c..9f39ec6277f3 100644
--- a/extensions/source/propctrlr/browserline.hxx
+++ b/extensions/source/propctrlr/browserline.hxx
@@ -50,17 +50,17 @@ namespace pcr
class OBrowserLine
{
private:
- OUString m_sEntryName;
- FixedText m_aFtTitle;
+ OUString m_sEntryName;
+ VclPtr<FixedText> m_aFtTitle;
Size m_aOutputSize;
Point m_aLinePos;
::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >
m_xControl;
- vcl::Window* m_pControlWindow;
- PushButton* m_pBrowseButton;
- PushButton* m_pAdditionalBrowseButton;
+ VclPtr<vcl::Window> m_pControlWindow;
+ VclPtr<PushButton> m_pBrowseButton;
+ VclPtr<PushButton> m_pAdditionalBrowseButton;
IButtonClickListener* m_pClickListener;
- vcl::Window* m_pTheParent;
+ VclPtr<vcl::Window> m_pTheParent;
sal_uInt16 m_nNameWidth;
sal_uInt16 m_nEnableFlags;
bool m_bIndentTitle;
diff --git a/extensions/source/propctrlr/browserlistbox.cxx b/extensions/source/propctrlr/browserlistbox.cxx
index f31fd5de1a82..13b2df89e334 100644
--- a/extensions/source/propctrlr/browserlistbox.cxx
+++ b/extensions/source/propctrlr/browserlistbox.cxx
@@ -345,9 +345,9 @@ namespace pcr
OBrowserListBox::OBrowserListBox( vcl::Window* pParent, WinBits nWinStyle)
:Control(pParent, nWinStyle| WB_CLIPCHILDREN)
- ,m_aLinesPlayground(this,WB_DIALOGCONTROL | WB_CLIPCHILDREN)
- ,m_aVScroll(this,WB_VSCROLL|WB_REPEAT|WB_DRAG)
- ,m_pHelpWindow( new InspectorHelpWindow( this ) )
+ ,m_aLinesPlayground(VclPtr<vcl::Window>::Create(this,WB_DIALOGCONTROL | WB_CLIPCHILDREN))
+ ,m_aVScroll(VclPtr<ScrollBar>::Create(this,WB_VSCROLL|WB_REPEAT|WB_DRAG))
+ ,m_pHelpWindow( VclPtr<InspectorHelpWindow>::Create( this ) )
,m_pLineListener(NULL)
,m_pControlObserver( NULL )
,m_nYOffset(0)
@@ -357,23 +357,27 @@ namespace pcr
,m_bUpdate(true)
,m_pControlContextImpl( new PropertyControlContext_Impl( *this ) )
{
-
- ListBox aListBox(this,WB_DROPDOWN);
- aListBox.SetPosSizePixel(Point(0,0),Size(100,100));
- m_nRowHeight = aListBox.GetSizePixel().Height()+2;
+ ScopedVclPtrInstance< ListBox > aListBox(this,WB_DROPDOWN);
+ aListBox->SetPosSizePixel(Point(0,0),Size(100,100));
+ m_nRowHeight = aListBox->GetSizePixel().Height()+2;
SetBackground( pParent->GetBackground() );
- m_aLinesPlayground.SetBackground( GetBackground() );
+ m_aLinesPlayground->SetBackground( GetBackground() );
- m_aLinesPlayground.SetPosPixel(Point(0,0));
- m_aLinesPlayground.SetPaintTransparent(true);
- m_aLinesPlayground.Show();
- m_aVScroll.Hide();
- m_aVScroll.SetScrollHdl(LINK(this, OBrowserListBox, ScrollHdl));
+ m_aLinesPlayground->SetPosPixel(Point(0,0));
+ m_aLinesPlayground->SetPaintTransparent(true);
+ m_aLinesPlayground->Show();
+ m_aVScroll->Hide();
+ m_aVScroll->SetScrollHdl(LINK(this, OBrowserListBox, ScrollHdl));
}
OBrowserListBox::~OBrowserListBox()
{
+ disposeOnce();
+ }
+
+ void OBrowserListBox::dispose()
+ {
OSL_ENSURE( !IsModified(), "OBrowserListBox::~OBrowserListBox: still modified - should have been committed before!" );
// doing the commit here, while we, as well as our owner, as well as some other components,
// are already "half dead" (means within their dtor) is potentially dangerous.
@@ -384,7 +388,10 @@ namespace pcr
Hide();
Clear();
-
+ m_aLinesPlayground.disposeAndClear();
+ m_aVScroll.disposeAndClear();
+ m_pHelpWindow.disposeAndClear();
+ Control::dispose();
}
@@ -425,7 +432,7 @@ namespace pcr
if (m_bIsActive)
{
// TODO: what's the sense of this?
- m_aVScroll.SetThumbPos(100);
+ m_aVScroll->SetThumbPos(100);
MoveThumbTo(0);
Resize();
}
@@ -452,31 +459,31 @@ namespace pcr
aLinesArea.Bottom() -= nHelpWindowHeight;
aLinesArea.Bottom() -= aHelpWindowDistance.Height();
}
- m_aLinesPlayground.SetPosSizePixel( aLinesArea.TopLeft(), aLinesArea.GetSize() );
+ m_aLinesPlayground->SetPosSizePixel( aLinesArea.TopLeft(), aLinesArea.GetSize() );
UpdateVScroll();
bool bNeedScrollbar = m_aLines.size() > (sal_uInt32)CalcVisibleLines();
if ( !bNeedScrollbar )
{
- if ( m_aVScroll.IsVisible() )
- m_aVScroll.Hide();
+ if ( m_aVScroll->IsVisible() )
+ m_aVScroll->Hide();
// scroll to top
m_nYOffset = 0;
- m_aVScroll.SetThumbPos( 0 );
+ m_aVScroll->SetThumbPos( 0 );
}
else
{
- Size aVScrollSize( m_aVScroll.GetSizePixel() );
+ Size aVScrollSize( m_aVScroll->GetSizePixel() );
// adjust the playground's width
aLinesArea.Right() -= aVScrollSize.Width();
- m_aLinesPlayground.SetPosSizePixel( aLinesArea.TopLeft(), aLinesArea.GetSize() );
+ m_aLinesPlayground->SetPosSizePixel( aLinesArea.TopLeft(), aLinesArea.GetSize() );
// position the scrollbar
aVScrollSize.Height() = aLinesArea.GetHeight();
Point aVScrollPos( aLinesArea.GetWidth(), 0 );
- m_aVScroll.SetPosSizePixel( aVScrollPos, aVScrollSize );
+ m_aVScroll->SetPosSizePixel( aVScrollPos, aVScrollSize );
}
for ( sal_uInt16 i = 0; i < m_aLines.size(); ++i )
@@ -489,7 +496,7 @@ namespace pcr
// show the scrollbar
if ( bNeedScrollbar )
- m_aVScroll.Show();
+ m_aVScroll->Show();
// position the help window
if ( bPositionHelpWindow )
@@ -543,7 +550,7 @@ namespace pcr
sal_uInt16 OBrowserListBox::CalcVisibleLines()
{
- Size aSize(m_aLinesPlayground.GetOutputSizePixel());
+ Size aSize(m_aLinesPlayground->GetOutputSizePixel());
sal_uInt16 nResult = 0;
if (0 != m_nRowHeight)
nResult = (sal_uInt16) aSize.Height()/m_nRowHeight;
@@ -555,18 +562,18 @@ namespace pcr
void OBrowserListBox::UpdateVScroll()
{
sal_uInt16 nLines = CalcVisibleLines();
- m_aVScroll.SetPageSize(nLines-1);
- m_aVScroll.SetVisibleSize(nLines-1);
+ m_aVScroll->SetPageSize(nLines-1);
+ m_aVScroll->SetVisibleSize(nLines-1);
size_t nCount = m_aLines.size();
if (nCount>0)
{
- m_aVScroll.SetRange(Range(0,nCount-1));
- m_nYOffset = -m_aVScroll.GetThumbPos()*m_nRowHeight;
+ m_aVScroll->SetRange(Range(0,nCount-1));
+ m_nYOffset = -m_aVScroll->GetThumbPos()*m_nRowHeight;
}
else
{
- m_aVScroll.SetRange(Range(0,0));
+ m_aVScroll->SetRange(Range(0,0));
m_nYOffset = 0;
}
}
@@ -574,7 +581,7 @@ namespace pcr
void OBrowserListBox::PositionLine( sal_uInt16 _nIndex )
{
- Size aSize(m_aLinesPlayground.GetOutputSizePixel());
+ Size aSize(m_aLinesPlayground->GetOutputSizePixel());
Point aPos(0, m_nYOffset);
aSize.Height() = m_nRowHeight;
@@ -612,7 +619,7 @@ namespace pcr
void OBrowserListBox::UpdatePlayGround()
{
- sal_Int32 nThumbPos = m_aVScroll.GetThumbPos();
+ sal_Int32 nThumbPos = m_aVScroll->GetThumbPos();
sal_Int32 nLines = CalcVisibleLines();
sal_uInt16 nEnd = (sal_uInt16)(nThumbPos + nLines);
@@ -729,7 +736,7 @@ namespace pcr
sal_uInt16 OBrowserListBox::InsertEntry(const OLineDescriptor& _rPropertyData, sal_uInt16 _nPos)
{
// create a new line
- BrowserLinePointer pBrowserLine( new OBrowserLine( _rPropertyData.sName, &m_aLinesPlayground ) );
+ BrowserLinePointer pBrowserLine( new OBrowserLine( _rPropertyData.sName, m_aLinesPlayground.get() ) );
// check that the name is unique
ListBoxLines::iterator it = m_aLines.begin();
@@ -794,7 +801,7 @@ namespace pcr
{
if ( _nPos < m_aLines.size() )
{
- sal_Int32 nThumbPos = m_aVScroll.GetThumbPos();
+ sal_Int32 nThumbPos = m_aVScroll->GetThumbPos();
if (_nPos < nThumbPos)
MoveThumbTo(_nPos);
@@ -812,19 +819,19 @@ namespace pcr
void OBrowserListBox::MoveThumbTo(sal_Int32 _nNewThumbPos)
{
// disable painting to prevent flicker
- m_aLinesPlayground.EnablePaint(false);
+ m_aLinesPlayground->EnablePaint(false);
- sal_Int32 nDelta = _nNewThumbPos - m_aVScroll.GetThumbPos();
+ sal_Int32 nDelta = _nNewThumbPos - m_aVScroll->GetThumbPos();
// adjust the scrollbar
- m_aVScroll.SetThumbPos(_nNewThumbPos);
+ m_aVScroll->SetThumbPos(_nNewThumbPos);
sal_Int32 nThumbPos = _nNewThumbPos;
- m_nYOffset = -m_aVScroll.GetThumbPos() * m_nRowHeight;
+ m_nYOffset = -m_aVScroll->GetThumbPos() * m_nRowHeight;
sal_Int32 nLines = CalcVisibleLines();
sal_uInt16 nEnd = (sal_uInt16)(nThumbPos + nLines);
- m_aLinesPlayground.Scroll(0, -nDelta * m_nRowHeight, SCROLL_CHILDREN);
+ m_aLinesPlayground->Scroll(0, -nDelta * m_nRowHeight, SCROLL_CHILDREN);
if (1 == nDelta)
{
@@ -841,27 +848,27 @@ namespace pcr
UpdatePlayGround();
}
- m_aLinesPlayground.EnablePaint(true);
- m_aLinesPlayground.Invalidate(INVALIDATE_CHILDREN);
+ m_aLinesPlayground->EnablePaint(true);
+ m_aLinesPlayground->Invalidate(INVALIDATE_CHILDREN);
}
IMPL_LINK(OBrowserListBox, ScrollHdl, ScrollBar*, _pScrollBar )
{
- DBG_ASSERT(_pScrollBar == &m_aVScroll, "OBrowserListBox::ScrollHdl: where does this come from?");
+ DBG_ASSERT(_pScrollBar == m_aVScroll.get(), "OBrowserListBox::ScrollHdl: where does this come from?");
(void)_pScrollBar;
// disable painting to prevent flicker
- m_aLinesPlayground.EnablePaint(false);
+ m_aLinesPlayground->EnablePaint(false);
- sal_Int32 nThumbPos = m_aVScroll.GetThumbPos();
+ sal_Int32 nThumbPos = m_aVScroll->GetThumbPos();
- sal_Int32 nDelta = m_aVScroll.GetDelta();
+ sal_Int32 nDelta = m_aVScroll->GetDelta();
m_nYOffset = -nThumbPos * m_nRowHeight;
sal_uInt16 nEnd = (sal_uInt16)(nThumbPos + CalcVisibleLines());
- m_aLinesPlayground.Scroll(0, -nDelta * m_nRowHeight, SCROLL_CHILDREN);
+ m_aLinesPlayground->Scroll(0, -nDelta * m_nRowHeight, SCROLL_CHILDREN);
if (1 == nDelta)
{
@@ -872,12 +879,12 @@ namespace pcr
{
PositionLine((sal_uInt16)nThumbPos);
}
- else if (nDelta!=0 || m_aVScroll.GetType() == SCROLL_DONTKNOW)
+ else if (nDelta!=0 || m_aVScroll->GetType() == SCROLL_DONTKNOW)
{
UpdatePlayGround();
}
- m_aLinesPlayground.EnablePaint(true);
+ m_aLinesPlayground->EnablePaint(true);
return 0;
}
@@ -1129,7 +1136,7 @@ namespace pcr
rLine.pLine->SetTitle(_rPropertyData.DisplayName);
rLine.xHandler = _rPropertyData.xPropertyHandler;
- sal_uInt16 nTextWidth = (sal_uInt16)m_aLinesPlayground.GetTextWidth(_rPropertyData.DisplayName);
+ sal_uInt16 nTextWidth = (sal_uInt16)m_aLinesPlayground->GetTextWidth(_rPropertyData.DisplayName);
if (m_nTheNameSize< nTextWidth)
m_nTheNameSize = nTextWidth;
@@ -1216,21 +1223,21 @@ namespace pcr
break;
long nScrollOffset = 0;
- if ( m_aVScroll.IsVisible() )
+ if ( m_aVScroll->IsVisible() )
{
if ( pKeyEvent->GetKeyCode().GetCode() == KEY_PAGEUP )
- nScrollOffset = -m_aVScroll.GetPageSize();
+ nScrollOffset = -m_aVScroll->GetPageSize();
else if ( pKeyEvent->GetKeyCode().GetCode() == KEY_PAGEDOWN )
- nScrollOffset = m_aVScroll.GetPageSize();
+ nScrollOffset = m_aVScroll->GetPageSize();
}
if ( nScrollOffset )
{
- long nNewThumbPos = m_aVScroll.GetThumbPos() + nScrollOffset;
- nNewThumbPos = ::std::max( nNewThumbPos, m_aVScroll.GetRangeMin() );
- nNewThumbPos = ::std::min( nNewThumbPos, m_aVScroll.GetRangeMax() );
- m_aVScroll.DoScroll( nNewThumbPos );
- nNewThumbPos = m_aVScroll.GetThumbPos();
+ long nNewThumbPos = m_aVScroll->GetThumbPos() + nScrollOffset;
+ nNewThumbPos = ::std::max( nNewThumbPos, m_aVScroll->GetRangeMin() );
+ nNewThumbPos = ::std::min( nNewThumbPos, m_aVScroll->GetRangeMax() );
+ m_aVScroll->DoScroll( nNewThumbPos );
+ nNewThumbPos = m_aVScroll->GetThumbPos();
sal_uInt16 nFocusControlPos = 0;
sal_uInt16 nActiveControlPos = impl_getControlPos( m_xActiveControl );
@@ -1271,9 +1278,9 @@ namespace pcr
)
{
// interested in scroll events if we have a scrollbar
- if ( m_aVScroll.IsVisible() )
+ if ( m_aVScroll->IsVisible() )
{
- HandleScrollCommand( *pCommand, NULL, &m_aVScroll );
+ HandleScrollCommand( *pCommand, NULL, m_aVScroll.get() );
}
}
}
diff --git a/extensions/source/propctrlr/browserlistbox.hxx b/extensions/source/propctrlr/browserlistbox.hxx
index 3b50d467c943..f8b3c754839f 100644
--- a/extensions/source/propctrlr/browserlistbox.hxx
+++ b/extensions/source/propctrlr/browserlistbox.hxx
@@ -93,10 +93,9 @@ namespace pcr
,public PcrClient
{
protected:
- Window m_aLinesPlayground;
- ScrollBar m_aVScroll;
- ::std::unique_ptr< InspectorHelpWindow >
- m_pHelpWindow;
+ VclPtr<Window> m_aLinesPlayground;
+ VclPtr<ScrollBar> m_aVScroll;
+ VclPtr<InspectorHelpWindow> m_pHelpWindow;
ListBoxLines m_aLines;
IPropertyLineListener* m_pLineListener;
IPropertyControlObserver* m_pControlObserver;
@@ -125,6 +124,7 @@ namespace pcr
OBrowserListBox( vcl::Window* pParent, WinBits nWinStyle = WB_DIALOGCONTROL );
virtual ~OBrowserListBox();
+ virtual void dispose() SAL_OVERRIDE;
void UpdateAll();
diff --git a/extensions/source/propctrlr/browserpage.cxx b/extensions/source/propctrlr/browserpage.cxx
index 2e733a9ed727..dfb0236317fd 100644
--- a/extensions/source/propctrlr/browserpage.cxx
+++ b/extensions/source/propctrlr/browserpage.cxx
@@ -35,25 +35,31 @@ namespace pcr
OBrowserPage::OBrowserPage(vcl::Window* pParent,WinBits nWinStyle)
:TabPage(pParent,nWinStyle)
- ,m_aListBox(this)
+ ,m_aListBox(VclPtr<OBrowserListBox>::Create(this))
{
- m_aListBox.SetBackground(GetBackground());
- m_aListBox.SetPaintTransparent( true );
- m_aListBox.Show();
+ m_aListBox->SetBackground(GetBackground());
+ m_aListBox->SetPaintTransparent( true );
+ m_aListBox->Show();
}
OBrowserPage::~OBrowserPage()
{
+ disposeOnce();
}
+ void OBrowserPage::dispose()
+ {
+ m_aListBox.disposeAndClear();
+ TabPage::dispose();
+ }
void OBrowserPage::Resize()
{
Size aSize( GetOutputSizePixel() );
aSize.Width() -= LAYOUT_BORDER_LEFT + LAYOUT_BORDER_RIGHT;
aSize.Height() -= LAYOUT_BORDER_TOP + LAYOUT_BORDER_BOTTOM;
- m_aListBox.SetPosSizePixel( Point( LAYOUT_BORDER_LEFT, LAYOUT_BORDER_TOP ), aSize );
+ m_aListBox->SetPosSizePixel( Point( LAYOUT_BORDER_LEFT, LAYOUT_BORDER_TOP ), aSize );
}
@@ -65,19 +71,19 @@ namespace pcr
{
Window::StateChanged( nType);
if (StateChangedType::VISIBLE == nType)
- m_aListBox.ActivateListBox(IsVisible());
+ m_aListBox->ActivateListBox(IsVisible());
}
sal_Int32 OBrowserPage::getMinimumWidth()
{
- return m_aListBox.GetMinimumWidth() + LAYOUT_BORDER_LEFT + LAYOUT_BORDER_RIGHT;
+ return m_aListBox->GetMinimumWidth() + LAYOUT_BORDER_LEFT + LAYOUT_BORDER_RIGHT;
}
sal_Int32 OBrowserPage::getMinimumHeight()
{
- return m_aListBox.GetMinimumHeight() + LAYOUT_BORDER_TOP + LAYOUT_BORDER_BOTTOM;
+ return m_aListBox->GetMinimumHeight() + LAYOUT_BORDER_TOP + LAYOUT_BORDER_BOTTOM;
}
diff --git a/extensions/source/propctrlr/browserpage.hxx b/extensions/source/propctrlr/browserpage.hxx
index 6ef6ef80bce9..8ce0b50cd8fe 100644
--- a/extensions/source/propctrlr/browserpage.hxx
+++ b/extensions/source/propctrlr/browserpage.hxx
@@ -34,7 +34,7 @@ namespace pcr
class OBrowserPage : public TabPage
{
private:
- OBrowserListBox m_aListBox;
+ VclPtr<OBrowserListBox> m_aListBox;
protected:
virtual void Resize() SAL_OVERRIDE;
@@ -43,12 +43,13 @@ namespace pcr
public:
OBrowserPage(vcl::Window* pParent, WinBits nWinStyle = 0);
virtual ~OBrowserPage();
+ virtual void dispose() SAL_OVERRIDE;
sal_Int32 getMinimumWidth();
sal_Int32 getMinimumHeight();
- OBrowserListBox& getListBox() { return m_aListBox; }
- const OBrowserListBox& getListBox() const { return m_aListBox; }
+ OBrowserListBox& getListBox() { return *m_aListBox.get(); }
+ const OBrowserListBox& getListBox() const { return *m_aListBox.get(); }
};
diff --git a/extensions/source/propctrlr/browserview.cxx b/extensions/source/propctrlr/browserview.cxx
index 4179cbe8e3ed..ab512b46eccc 100644
--- a/extensions/source/propctrlr/browserview.cxx
+++ b/extensions/source/propctrlr/browserview.cxx
@@ -21,6 +21,7 @@
#include "propertyeditor.hxx"
#include "propctrlr.hrc"
#include <boost/scoped_ptr.hpp>
+#include <vcl/tabpage.hxx>
namespace pcr
{
@@ -34,7 +35,7 @@ namespace pcr
:Window(_pParent, nBits | WB_3DLOOK)
,m_nActivePage(0)
{
- m_pPropBox = new OPropertyEditor( this );
+ m_pPropBox = VclPtr<OPropertyEditor>::Create( this );
m_pPropBox->SetHelpId(HID_FM_PROPDLG_TABCTR);
m_pPropBox->setPageActivationHandler(LINK(this, OPropertyBrowserView, OnPageActivation));
@@ -53,15 +54,19 @@ namespace pcr
OPropertyBrowserView::~OPropertyBrowserView()
{
+ disposeOnce();
+ }
+
+ void OPropertyBrowserView::dispose()
+ {
if(m_pPropBox)
{
sal_uInt16 nTmpPage = m_pPropBox->GetCurPage();
if (nTmpPage)
m_nActivePage = nTmpPage;
- boost::scoped_ptr<vcl::Window> aTemp(m_pPropBox);
- m_pPropBox = NULL;
}
-
+ m_pPropBox.disposeAndClear();
+ vcl::Window::dispose();
}
diff --git a/extensions/source/propctrlr/browserview.hxx b/extensions/source/propctrlr/browserview.hxx
index c87dd55b3c0a..9ae97d364295 100644
--- a/extensions/source/propctrlr/browserview.hxx
+++ b/extensions/source/propctrlr/browserview.hxx
@@ -37,7 +37,7 @@ namespace pcr
class OPropertyBrowserView : public vcl::Window
{
- OPropertyEditor* m_pPropBox;
+ VclPtr<OPropertyEditor> m_pPropBox;
sal_uInt16 m_nActivePage;
Link m_aPageActivationHandler;
@@ -50,6 +50,7 @@ namespace pcr
OPropertyBrowserView( vcl::Window* pParent, WinBits nBits = 0);
virtual ~OPropertyBrowserView();
+ virtual void dispose() SAL_OVERRIDE;
OPropertyEditor& getPropertyBox() { return *m_pPropBox; }
diff --git a/extensions/source/propctrlr/commoncontrol.cxx b/extensions/source/propctrlr/commoncontrol.cxx
index ac33ace00daa..e337ccf7a0dc 100644
--- a/extensions/source/propctrlr/commoncontrol.cxx
+++ b/extensions/source/propctrlr/commoncontrol.cxx
@@ -47,7 +47,7 @@ namespace pcr
,m_pModifyListener( _pModifyListener )
,m_bModified( false )
{
- DBG_ASSERT( m_pControlWindow != NULL, "ControlHelper::ControlHelper: invalid window!" );
+ DBG_ASSERT( m_pControlWindow != nullptr, "ControlHelper::ControlHelper: invalid window!" );
}
@@ -55,11 +55,6 @@ namespace pcr
{
}
-
-
-
-
-
void SAL_CALL ControlHelper::setControlContext( const Reference< XPropertyControlContext >& _controlcontext ) throw (RuntimeException)
{
m_xContext = _controlcontext;
@@ -93,7 +88,7 @@ namespace pcr
void SAL_CALL ControlHelper::dispose()
{
- DELETEZ( m_pControlWindow );
+ m_pControlWindow.disposeAndClear();
}
@@ -103,9 +98,9 @@ namespace pcr
if ( !m_pControlWindow )
return;
- ComboBox aComboBox(m_pControlWindow, WB_DROPDOWN);
- aComboBox.SetPosSizePixel(Point(0,0), Size(100,100));
- m_pControlWindow->SetSizePixel(aComboBox.GetSizePixel());
+ ScopedVclPtrInstance< ComboBox > aComboBox(m_pControlWindow, WB_DROPDOWN);
+ aComboBox->SetPosSizePixel(Point(0,0), Size(100,100));
+ m_pControlWindow->SetSizePixel(aComboBox->GetSizePixel());
// TODO/UNOize: why do the controls this themselves? Shouldn't this be the task
// of the browser listbox/line?
diff --git a/extensions/source/propctrlr/commoncontrol.hxx b/extensions/source/propctrlr/commoncontrol.hxx
index 629660eda8d7..cbe825f32156 100644
--- a/extensions/source/propctrlr/commoncontrol.hxx
+++ b/extensions/source/propctrlr/commoncontrol.hxx
@@ -86,7 +86,7 @@ namespace pcr
class ControlHelper
{
private:
- vcl::Window* m_pControlWindow;
+ VclPtr<vcl::Window> m_pControlWindow;
sal_Int16 m_nControlType;
::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControlContext >
m_xContext;
diff --git a/extensions/source/propctrlr/controlfontdialog.cxx b/extensions/source/propctrlr/controlfontdialog.cxx
index 675f2aa74739..54ae2733d633 100644
--- a/extensions/source/propctrlr/controlfontdialog.cxx
+++ b/extensions/source/propctrlr/controlfontdialog.cxx
@@ -141,7 +141,7 @@ namespace pcr
}
- Dialog* OControlFontDialog::createDialog(vcl::Window* _pParent)
+ VclPtr<Dialog> OControlFontDialog::createDialog(vcl::Window* _pParent)
{
ControlCharacterDialog::createItemSet(m_pFontItems, m_pItemPool, m_pItemPoolDefaults);
@@ -152,8 +152,7 @@ namespace pcr
// sets a new introspectee and re-executes us. In this case, the dialog returned here (upon the first
// execute) will be re-used upon the second execute, and thus it won't be initialized correctly.
- ControlCharacterDialog* pDialog = new ControlCharacterDialog(_pParent, *m_pFontItems);
- return pDialog;
+ return VclPtr<ControlCharacterDialog>::Create(_pParent, *m_pFontItems);
}
@@ -169,7 +168,7 @@ namespace pcr
OSL_ENSURE(m_pDialog, "OControlFontDialog::executedDialog: no dialog anymore?!!");
if (m_pDialog && (RET_OK == _nExecutionResult) && m_xControlModel.is())
{
- const SfxItemSet* pOutput = static_cast<ControlCharacterDialog*>(m_pDialog)->GetOutputItemSet();
+ const SfxItemSet* pOutput = static_cast<ControlCharacterDialog*>(m_pDialog.get())->GetOutputItemSet();
if (pOutput)
ControlCharacterDialog::translateItemsToProperties( *pOutput, m_xControlModel );
}
diff --git a/extensions/source/propctrlr/controlfontdialog.hxx b/extensions/source/propctrlr/controlfontdialog.hxx
index 3df0b46fcdc5..e9d30f4c67d0 100644
--- a/extensions/source/propctrlr/controlfontdialog.hxx
+++ b/extensions/source/propctrlr/controlfontdialog.hxx
@@ -82,7 +82,7 @@ namespace pcr
protected:
// OGenericUnoDialog overridables
- virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
+ virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
virtual void destroyDialog() SAL_OVERRIDE;
virtual void executedDialog(sal_Int16 _nExecutionResult) SAL_OVERRIDE;
};
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index e45398145741..a13fd939a3dc 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -2608,9 +2608,9 @@ namespace pcr
OSL_PRECOND( m_pInfoService.get(), "FormComponentPropertyHandler::impl_dialogListSelection_nothrow: no property meta data!" );
OUString sPropertyUIName( m_pInfoService->getPropertyTranslation( m_pInfoService->getPropertyId( _rProperty ) ) );
- ListSelectionDialog aDialog( impl_getDefaultDialogParent_nothrow(), m_xComponent, _rProperty, sPropertyUIName );
+ ScopedVclPtrInstance< ListSelectionDialog > aDialog( impl_getDefaultDialogParent_nothrow(), m_xComponent, _rProperty, sPropertyUIName );
_rClearBeforeDialog.clear();
- return ( RET_OK == aDialog.Execute() );
+ return ( RET_OK == aDialog->Execute() );
}
@@ -2685,9 +2685,9 @@ namespace pcr
return false;
- FormLinkDialog aDialog( impl_getDefaultDialogParent_nothrow(), m_xComponent, xMasterProp, m_xContext );
+ ScopedVclPtrInstance< FormLinkDialog > aDialog( impl_getDefaultDialogParent_nothrow(), m_xComponent, xMasterProp, m_xContext );
_rClearBeforeDialog.clear();
- return ( RET_OK == aDialog.Execute() );
+ return ( RET_OK == aDialog->Execute() );
}
@@ -2722,9 +2722,8 @@ namespace pcr
aCoreSet.Put( aFormatter );
// a tab dialog with a single page
- boost::scoped_ptr< SfxSingleTabDialog > xDialog(new SfxSingleTabDialog(
- impl_getDefaultDialogParent_nothrow(), aCoreSet,
- "FormatNumberDialog", "cui/ui/formatnumberdialog.ui"));
+ ScopedVclPtrInstance< SfxSingleTabDialog > xDialog( impl_getDefaultDialogParent_nothrow(), aCoreSet,
+ "FormatNumberDialog", "cui/ui/formatnumberdialog.ui");
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
DBG_ASSERT( pFact, "CreateFactory fail!" );
::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT );
@@ -2871,11 +2870,11 @@ namespace pcr
{ // do this in an own block. The dialog needs to be destroyed before we call
// destroyItemSet
- ControlCharacterDialog aDlg( impl_getDefaultDialogParent_nothrow(), *pSet );
+ ScopedVclPtrInstance< ControlCharacterDialog > aDlg( impl_getDefaultDialogParent_nothrow(), *pSet );
_rClearBeforeDialog.clear();
- if ( RET_OK == aDlg.Execute() )
+ if ( RET_OK == aDlg->Execute() )
{
- const SfxItemSet* pOut = aDlg.GetOutputItemSet();
+ const SfxItemSet* pOut = aDlg->GetOutputItemSet();
if ( pOut )
{
Sequence< NamedValue > aFontPropertyValues;
@@ -2942,11 +2941,11 @@ namespace pcr
bool FormComponentPropertyHandler::impl_dialogChooseLabelControl_nothrow( Any& _out_rNewValue, ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const
{
- OSelectLabelDialog dlgSelectLabel( impl_getDefaultDialogParent_nothrow(), m_xComponent );
+ ScopedVclPtrInstance< OSelectLabelDialog > dlgSelectLabel( impl_getDefaultDialogParent_nothrow(), m_xComponent );
_rClearBeforeDialog.clear();
- bool bSuccess = ( RET_OK == dlgSelectLabel.Execute() );
+ bool bSuccess = ( RET_OK == dlgSelectLabel->Execute() );
if ( bSuccess )
- _out_rNewValue <<= dlgSelectLabel.GetSelected();
+ _out_rNewValue <<= dlgSelectLabel->GetSelected();
return bSuccess;
}
@@ -2965,14 +2964,14 @@ namespace pcr
OSL_PRECOND( impl_getContextControlContainer_nothrow().is(), "FormComponentPropertyHandler::impl_dialogChangeTabOrder_nothrow: invalid control context!" );
Reference< XTabControllerModel > xTabControllerModel( impl_getRowSet_nothrow(), UNO_QUERY );
- TabOrderDialog aDialog(
+ ScopedVclPtrInstance<TabOrderDialog> aDialog(
impl_getDefaultDialogParent_nothrow(),
xTabControllerModel,
impl_getContextControlContainer_nothrow(),
m_xContext
);
_rClearBeforeDialog.clear();
- return ( RET_OK == aDialog.Execute() );
+ return ( RET_OK == aDialog->Execute() );
}
diff --git a/extensions/source/propctrlr/formlinkdialog.cxx b/extensions/source/propctrlr/formlinkdialog.cxx
index 3a7d97003c6d..3689a775c961 100644
--- a/extensions/source/propctrlr/formlinkdialog.cxx
+++ b/extensions/source/propctrlr/formlinkdialog.cxx
@@ -65,13 +65,15 @@ namespace pcr
class FieldLinkRow : public TabPage
{
private:
- ComboBox* m_pDetailColumn;
- ComboBox* m_pMasterColumn;
+ VclPtr<ComboBox> m_pDetailColumn;
+ VclPtr<ComboBox> m_pMasterColumn;
Link m_aLinkChangeHandler;
public:
FieldLinkRow( vcl::Window* _pParent );
+ virtual ~FieldLinkRow();
+ virtual void dispose() SAL_OVERRIDE;
inline void SetLinkChangeHandler( const Link& _rHdl ) { m_aLinkChangeHandler = _rHdl; }
@@ -106,6 +108,17 @@ namespace pcr
m_pMasterColumn->SetModifyHdl( LINK( this, FieldLinkRow, OnFieldNameChanged ) );
}
+ FieldLinkRow::~FieldLinkRow()
+ {
+ disposeOnce();
+ }
+
+ void FieldLinkRow::dispose()
+ {
+ m_pDetailColumn.clear();
+ m_pMasterColumn.clear();
+ TabPage::dispose();
+ }
void FieldLinkRow::fillList( LinkParticipant _eWhich, const Sequence< OUString >& _rFieldNames )
{
@@ -156,10 +169,10 @@ namespace pcr
const OUString& _sDetailLabel,
const OUString& _sMasterLabel)
:ModalDialog( _pParent, "FormLinks", "modules/spropctrlr/ui/formlinksdialog.ui" )
- ,m_aRow1 ( new FieldLinkRow( get<VclVBox>("box") ) )
- ,m_aRow2 ( new FieldLinkRow( get<VclVBox>("box") ) )
- ,m_aRow3 ( new FieldLinkRow( get<VclVBox>("box") ) )
- ,m_aRow4 ( new FieldLinkRow( get<VclVBox>("box") ) )
+ ,m_aRow1 ( VclPtr<FieldLinkRow>::Create( get<VclVBox>("box") ) )
+ ,m_aRow2 ( VclPtr<FieldLinkRow>::Create( get<VclVBox>("box") ) )
+ ,m_aRow3 ( VclPtr<FieldLinkRow>::Create( get<VclVBox>("box") ) )
+ ,m_aRow4 ( VclPtr<FieldLinkRow>::Create( get<VclVBox>("box") ) )
,m_xContext ( _rxContext )
,m_xDetailForm( _rxDetailForm )
,m_xMasterForm( _rxMasterForm )
@@ -194,8 +207,24 @@ namespace pcr
FormLinkDialog::~FormLinkDialog( )
{
+ disposeOnce();
}
+ void FormLinkDialog::dispose( )
+ {
+ m_pExplanation.clear();
+ m_pDetailLabel.clear();
+ m_pMasterLabel.clear();
+ m_pOK.clear();
+ m_pSuggest.clear();
+
+ m_aRow1.disposeAndClear();
+ m_aRow2.disposeAndClear();
+ m_aRow3.disposeAndClear();
+ m_aRow4.disposeAndClear();
+
+ ModalDialog::dispose();
+ }
void FormLinkDialog::commitLinkPairs()
{
diff --git a/extensions/source/propctrlr/formlinkdialog.hxx b/extensions/source/propctrlr/formlinkdialog.hxx
index 6dd94e915dd4..9ce65e8377ce 100644
--- a/extensions/source/propctrlr/formlinkdialog.hxx
+++ b/extensions/source/propctrlr/formlinkdialog.hxx
@@ -44,15 +44,15 @@ namespace pcr
class FormLinkDialog : public ModalDialog
{
private:
- FixedText* m_pExplanation;
- FixedText* m_pDetailLabel;
- FixedText* m_pMasterLabel;
- ::std::unique_ptr< FieldLinkRow > m_aRow1;
- ::std::unique_ptr< FieldLinkRow > m_aRow2;
- ::std::unique_ptr< FieldLinkRow > m_aRow3;
- ::std::unique_ptr< FieldLinkRow > m_aRow4;
- OKButton* m_pOK;
- PushButton* m_pSuggest;
+ VclPtr<FixedText> m_pExplanation;
+ VclPtr<FixedText> m_pDetailLabel;
+ VclPtr<FixedText> m_pMasterLabel;
+ VclPtr<FieldLinkRow> m_aRow1;
+ VclPtr<FieldLinkRow> m_aRow2;
+ VclPtr<FieldLinkRow> m_aRow3;
+ VclPtr<FieldLinkRow> m_aRow4;
+ VclPtr<OKButton> m_pOK;
+ VclPtr<PushButton> m_pSuggest;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
m_xContext;
@@ -80,6 +80,7 @@ namespace pcr
const OUString& _sMasterLabel = OUString()
);
virtual ~FormLinkDialog( );
+ virtual void dispose() SAL_OVERRIDE;
// Dialog overridables
virtual short Execute() SAL_OVERRIDE;
diff --git a/extensions/source/propctrlr/inspectorhelpwindow.cxx b/extensions/source/propctrlr/inspectorhelpwindow.cxx
index b62010cf6cd9..b174b69bd6c2 100644
--- a/extensions/source/propctrlr/inspectorhelpwindow.cxx
+++ b/extensions/source/propctrlr/inspectorhelpwindow.cxx
@@ -29,27 +29,38 @@ namespace pcr
InspectorHelpWindow::InspectorHelpWindow( vcl::Window* _pParent )
:Window( _pParent, WB_DIALOGCONTROL )
- ,m_aSeparator( this )
- ,m_aHelpText( this, WB_LEFT | WB_READONLY | WB_AUTOVSCROLL )
+ ,m_aSeparator( VclPtr<FixedLine>::Create(this) )
+ ,m_aHelpText( VclPtr<MultiLineEdit>::Create(this, WB_LEFT | WB_READONLY | WB_AUTOVSCROLL) )
,m_nMinLines( 3 )
,m_nMaxLines( 8 )
{
SetBackground();
SetPaintTransparent(true);
- m_aSeparator.SetText( PcrRes(RID_STR_HELP_SECTION_LABEL).toString() );
- m_aSeparator.SetBackground();
- m_aSeparator.Show();
-
- m_aHelpText.SetControlBackground( /*m_aSeparator.GetBackground().GetColor() */);
- m_aHelpText.SetBackground();
- m_aHelpText.SetPaintTransparent(true);
- m_aHelpText.Show();
+ m_aSeparator->SetText( PcrRes(RID_STR_HELP_SECTION_LABEL).toString() );
+ m_aSeparator->SetBackground();
+ m_aSeparator->Show();
+
+ m_aHelpText->SetControlBackground( /*m_aSeparator->GetBackground().GetColor() */);
+ m_aHelpText->SetBackground();
+ m_aHelpText->SetPaintTransparent(true);
+ m_aHelpText->Show();
}
+ InspectorHelpWindow::~InspectorHelpWindow()
+ {
+ disposeOnce();
+ }
+
+ void InspectorHelpWindow::dispose()
+ {
+ m_aSeparator.disposeAndClear();
+ m_aHelpText.disposeAndClear();
+ vcl::Window::dispose();
+ }
void InspectorHelpWindow::SetText( const OUString& _rStr )
{
- m_aHelpText.SetText( _rStr );
+ m_aHelpText->SetText( _rStr );
}
@@ -63,7 +74,7 @@ namespace pcr
long InspectorHelpWindow::impl_getHelpTextBorderHeight()
{
sal_Int32 nTop(0), nBottom(0), nDummy(0);
- m_aHelpText.GetBorder( nDummy, nTop, nDummy, nBottom );
+ m_aHelpText->GetBorder( nDummy, nTop, nDummy, nBottom );
return nTop + nBottom;
}
@@ -84,13 +95,13 @@ namespace pcr
long InspectorHelpWindow::impl_getMinimalTextWindowHeight()
{
- return impl_getHelpTextBorderHeight() + m_aHelpText.GetTextHeight() * m_nMinLines;
+ return impl_getHelpTextBorderHeight() + m_aHelpText->GetTextHeight() * m_nMinLines;
}
long InspectorHelpWindow::impl_getMaximalTextWindowHeight()
{
- return impl_getHelpTextBorderHeight() + m_aHelpText.GetTextHeight() * m_nMaxLines;
+ return impl_getHelpTextBorderHeight() + m_aHelpText->GetTextHeight() * m_nMaxLines;
}
@@ -100,8 +111,8 @@ namespace pcr
long nMinTextWindowHeight = impl_getMinimalTextWindowHeight();
long nMaxTextWindowHeight = impl_getMaximalTextWindowHeight();
- Rectangle aTextRect( Point( 0, 0 ), m_aHelpText.GetOutputSizePixel() );
- aTextRect = m_aHelpText.GetTextRect( aTextRect, m_aHelpText.GetText(),
+ Rectangle aTextRect( Point( 0, 0 ), m_aHelpText->GetOutputSizePixel() );
+ aTextRect = m_aHelpText->GetTextRect( aTextRect, m_aHelpText->GetText(),
TEXT_DRAW_LEFT | TEXT_DRAW_TOP | TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
long nActTextWindowHeight = impl_getHelpTextBorderHeight() + aTextRect.GetHeight();
@@ -120,11 +131,11 @@ namespace pcr
Rectangle aSeparatorArea( aPlayground );
aSeparatorArea.Bottom() = aSeparatorArea.Top() + LogicToPixel( Size( 0, 8 ), MAP_APPFONT ).Height();
- m_aSeparator.SetPosSizePixel( aSeparatorArea.TopLeft(), aSeparatorArea.GetSize() );
+ m_aSeparator->SetPosSizePixel( aSeparatorArea.TopLeft(), aSeparatorArea.GetSize() );
Rectangle aTextArea( aPlayground );
aTextArea.Top() = aSeparatorArea.Bottom() + a3AppFont.Height();
- m_aHelpText.SetPosSizePixel( aTextArea.TopLeft(), aTextArea.GetSize() );
+ m_aHelpText->SetPosSizePixel( aTextArea.TopLeft(), aTextArea.GetSize() );
}
diff --git a/extensions/source/propctrlr/inspectorhelpwindow.hxx b/extensions/source/propctrlr/inspectorhelpwindow.hxx
index 9419a72ec7a9..0159cff96ca6 100644
--- a/extensions/source/propctrlr/inspectorhelpwindow.hxx
+++ b/extensions/source/propctrlr/inspectorhelpwindow.hxx
@@ -33,14 +33,16 @@ namespace pcr
class InspectorHelpWindow : public vcl::Window
{
private:
- FixedLine m_aSeparator;
- MultiLineEdit m_aHelpText;
+ VclPtr<FixedLine> m_aSeparator;
+ VclPtr<MultiLineEdit> m_aHelpText;
sal_Int32 m_nMinLines;
sal_Int32 m_nMaxLines;
public:
InspectorHelpWindow( vcl::Window* _pParent );
+ virtual ~InspectorHelpWindow();
+ virtual void dispose() SAL_OVERRIDE;
virtual void SetText( const OUString& rStr ) SAL_OVERRIDE;
diff --git a/extensions/source/propctrlr/listselectiondlg.cxx b/extensions/source/propctrlr/listselectiondlg.cxx
index fdb6229dc370..9b2bbedcb368 100644
--- a/extensions/source/propctrlr/listselectiondlg.cxx
+++ b/extensions/source/propctrlr/listselectiondlg.cxx
@@ -48,6 +48,17 @@ namespace pcr
initialize( );
}
+ ListSelectionDialog::~ListSelectionDialog()
+ {
+ disposeOnce();
+ }
+
+ void ListSelectionDialog::dispose()
+ {
+ m_pEntries.clear();
+ ModalDialog::dispose();
+ }
+
short ListSelectionDialog::Execute()
{
short nResult = ModalDialog::Execute();
diff --git a/extensions/source/propctrlr/listselectiondlg.hxx b/extensions/source/propctrlr/listselectiondlg.hxx
index aaccb0754ec2..ca9a118c06f9 100644
--- a/extensions/source/propctrlr/listselectiondlg.hxx
+++ b/extensions/source/propctrlr/listselectiondlg.hxx
@@ -31,7 +31,7 @@ namespace pcr
class ListSelectionDialog : public ModalDialog
{
private:
- ListBox* m_pEntries;
+ VclPtr<ListBox> m_pEntries;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
m_xListBox;
@@ -44,6 +44,8 @@ namespace pcr
const OUString& _rPropertyName,
const OUString& _rPropertyUIName
);
+ virtual ~ListSelectionDialog();
+ virtual void dispose() SAL_OVERRIDE;
// Dialog overridables
virtual short Execute() SAL_OVERRIDE;
diff --git a/extensions/source/propctrlr/newdatatype.cxx b/extensions/source/propctrlr/newdatatype.cxx
index 62cc6da9c247..50f85e22489b 100644
--- a/extensions/source/propctrlr/newdatatype.cxx
+++ b/extensions/source/propctrlr/newdatatype.cxx
@@ -67,6 +67,17 @@ namespace pcr
OnNameModified( NULL );
}
+ NewDataTypeDialog::~NewDataTypeDialog()
+ {
+ disposeOnce();
+ }
+
+ void NewDataTypeDialog::dispose()
+ {
+ m_pName.clear();
+ m_pOK.clear();
+ ModalDialog::dispose();
+ }
IMPL_LINK( NewDataTypeDialog, OnNameModified, void*, /*_pNotInterestedIn*/ )
{
diff --git a/extensions/source/propctrlr/newdatatype.hxx b/extensions/source/propctrlr/newdatatype.hxx
index 135514aaa271..abccb19bd1f9 100644
--- a/extensions/source/propctrlr/newdatatype.hxx
+++ b/extensions/source/propctrlr/newdatatype.hxx
@@ -35,14 +35,16 @@ namespace pcr
class NewDataTypeDialog : public ModalDialog
{
private:
- Edit* m_pName;
- OKButton* m_pOK;
+ VclPtr<Edit> m_pName;
+ VclPtr<OKButton> m_pOK;
::std::set< OUString > m_aProhibitedNames;
public:
NewDataTypeDialog(vcl::Window* _pParent, const OUString& _rNameBase,
const ::std::vector< OUString >& _rProhibitedNames );
+ virtual ~NewDataTypeDialog();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetName() const { return m_pName->GetText(); }
diff --git a/extensions/source/propctrlr/pcrunodialogs.cxx b/extensions/source/propctrlr/pcrunodialogs.cxx
index 2f2d56086fb6..98c4b49ad590 100644
--- a/extensions/source/propctrlr/pcrunodialogs.cxx
+++ b/extensions/source/propctrlr/pcrunodialogs.cxx
@@ -130,9 +130,9 @@ namespace pcr
}
- Dialog* OTabOrderDialog::createDialog( vcl::Window* _pParent )
+ VclPtr<Dialog> OTabOrderDialog::createDialog( vcl::Window* _pParent )
{
- return new TabOrderDialog( _pParent, m_xTabbingModel, m_xControlContext, m_aContext );
+ return VclPtr<TabOrderDialog>::Create( _pParent, m_xTabbingModel, m_xControlContext, m_aContext );
}
void OTabOrderDialog::initialize( const Sequence< Any >& aArguments ) throw(Exception, RuntimeException, std::exception)
diff --git a/extensions/source/propctrlr/pcrunodialogs.hxx b/extensions/source/propctrlr/pcrunodialogs.hxx
index e0e6e4325e22..35663f1e6b7b 100644
--- a/extensions/source/propctrlr/pcrunodialogs.hxx
+++ b/extensions/source/propctrlr/pcrunodialogs.hxx
@@ -78,7 +78,7 @@ namespace pcr
protected:
// OGenericUnoDialog overridables
- virtual Dialog* createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
+ virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) SAL_OVERRIDE;
};
diff --git a/extensions/source/propctrlr/propcontroller.cxx b/extensions/source/propctrlr/propcontroller.cxx
index 77b518878526..dc85415a63fa 100644
--- a/extensions/source/propctrlr/propcontroller.cxx
+++ b/extensions/source/propctrlr/propcontroller.cxx
@@ -44,6 +44,7 @@
#include <comphelper/property.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/svapp.hxx>
+#include <vcl/tabpage.hxx>
#include <osl/mutex.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/component_context.hxx>
@@ -374,7 +375,7 @@ namespace pcr
// announcement is responsible for calling setComponent, too.
Reference< XWindow > xContainerWindow = m_xFrame->getContainerWindow();
VCLXWindow* pContainerWindow = VCLXWindow::GetImplementation(xContainerWindow);
- vcl::Window* pParentWin = pContainerWindow ? pContainerWindow->GetWindow() : NULL;
+ VclPtr<vcl::Window> pParentWin = pContainerWindow ? pContainerWindow->GetWindow() : VclPtr<vcl::Window>();
if (!pParentWin)
throw RuntimeException("The frame is invalid. Unable to extract the container window.",*this);
@@ -702,7 +703,7 @@ namespace pcr
DBG_ASSERT(!haveView(), "OPropertyBrowserController::Construct: already have a view!");
DBG_ASSERT(_pParentWin, "OPropertyBrowserController::Construct: invalid parent window!");
- m_pView = new OPropertyBrowserView(_pParentWin);
+ m_pView = VclPtr<OPropertyBrowserView>::Create(_pParentWin);
m_pView->setPageActivationHandler(LINK(this, OPropertyBrowserController, OnPageActivation));
// add as dispose listener for our view. The view is disposed by the frame we're plugged into,
diff --git a/extensions/source/propctrlr/propcontroller.hxx b/extensions/source/propctrlr/propcontroller.hxx
index af943de01f13..f204a86c8735 100644
--- a/extensions/source/propctrlr/propcontroller.hxx
+++ b/extensions/source/propctrlr/propcontroller.hxx
@@ -105,7 +105,7 @@ namespace pcr
::cppu::OInterfaceContainerHelper m_aDisposeListeners;
::cppu::OInterfaceContainerHelper m_aControlObservers;
// meta data about the properties
- OPropertyBrowserView* m_pView;
+ VclPtr<OPropertyBrowserView> m_pView;
OUString m_sPageSelection;
OUString m_sLastValidPageSelection;
@@ -242,7 +242,7 @@ namespace pcr
// stop the inspection
void stopInspection( bool _bCommitModified );
- bool haveView() const { return NULL != m_pView; }
+ bool haveView() const { return nullptr != m_pView; }
OPropertyEditor& getPropertyBox() { return m_pView->getPropertyBox(); }
// does the inspection of the objects as indicated by our model
diff --git a/extensions/source/propctrlr/propertyeditor.cxx b/extensions/source/propctrlr/propertyeditor.cxx
index 5fcafaf92c64..daa9e8c965f6 100644
--- a/extensions/source/propctrlr/propertyeditor.cxx
+++ b/extensions/source/propctrlr/propertyeditor.cxx
@@ -43,7 +43,7 @@ namespace pcr
OPropertyEditor::OPropertyEditor( vcl::Window* pParent, WinBits nWinStyle)
:Control(pParent, nWinStyle)
- ,m_aTabControl( this )
+ ,m_aTabControl( VclPtr<TabControl>::Create(this) )
,m_pListener(NULL)
,m_pObserver(NULL)
,m_nNextId(1)
@@ -52,37 +52,44 @@ namespace pcr
,m_nMaxHelpLines( 0 )
{
- m_aTabControl.Show();
- m_aTabControl.SetDeactivatePageHdl(LINK(this, OPropertyEditor, OnPageDeactivate));
- m_aTabControl.SetActivatePageHdl(LINK(this, OPropertyEditor, OnPageActivate));
- m_aTabControl.SetBackground(GetBackground());
- m_aTabControl.SetPaintTransparent(true);
+ m_aTabControl->Show();
+ m_aTabControl->SetDeactivatePageHdl(LINK(this, OPropertyEditor, OnPageDeactivate));
+ m_aTabControl->SetActivatePageHdl(LINK(this, OPropertyEditor, OnPageActivate));
+ m_aTabControl->SetBackground(GetBackground());
+ m_aTabControl->SetPaintTransparent(true);
}
OPropertyEditor::~OPropertyEditor()
{
+ disposeOnce();
+ }
+
+ void OPropertyEditor::dispose()
+ {
Hide();
ClearAll();
+ m_aTabControl.disposeAndClear();
+ Control::dispose();
}
void OPropertyEditor::ClearAll()
{
m_nNextId=1;
- sal_uInt16 nCount = m_aTabControl.GetPageCount();
+ sal_uInt16 nCount = m_aTabControl->GetPageCount();
for(long i = nCount-1; i >= 0; --i)
{
- sal_uInt16 nID = m_aTabControl.GetPageId((sal_uInt16)i);
- OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl.GetTabPage(nID));
+ sal_uInt16 nID = m_aTabControl->GetPageId((sal_uInt16)i);
+ VclPtr<OBrowserPage> pPage = static_cast<OBrowserPage*>(m_aTabControl->GetTabPage(nID));
if (pPage)
{
pPage->EnableInput(false);
- m_aTabControl.RemovePage(nID);
- delete pPage;
+ m_aTabControl->RemovePage(nID);
+ pPage.disposeAndClear();
}
}
- m_aTabControl.Clear();
+ m_aTabControl->Clear();
{
MapStringToPageId aEmpty;
@@ -91,9 +98,10 @@ namespace pcr
while ( !m_aHiddenPages.empty() )
{
- delete m_aHiddenPages.begin()->second.pPage;
+ m_aHiddenPages.begin()->second.pPage.disposeAndClear();
m_aHiddenPages.erase( m_aHiddenPages.begin() );
}
+ m_aHiddenPages.clear();
}
@@ -101,16 +109,16 @@ namespace pcr
{
sal_Int32 nMinHeight( LAYOUT_BORDER_TOP + LAYOUT_BORDER_BOTTOM );
- if ( m_aTabControl.GetPageCount() > 0 )
+ if ( m_aTabControl->GetPageCount() > 0 )
{
- sal_uInt16 nFirstID = m_aTabControl.GetPageId( 0 );
+ sal_uInt16 nFirstID = m_aTabControl->GetPageId( 0 );
// reserve space for the tabs themself
- Rectangle aTabArea( m_aTabControl.GetTabBounds( nFirstID ) );
+ Rectangle aTabArea( m_aTabControl->GetTabBounds( nFirstID ) );
nMinHeight += aTabArea.GetHeight();
// ask the page how much it requires
- OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( nFirstID ) );
+ OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl->GetTabPage( nFirstID ) );
if ( pPage )
nMinHeight += pPage->getMinimumHeight();
}
@@ -123,12 +131,12 @@ namespace pcr
sal_Int32 OPropertyEditor::getMinimumWidth()
{
- sal_uInt16 nCount = m_aTabControl.GetPageCount();
+ sal_uInt16 nCount = m_aTabControl->GetPageCount();
sal_Int32 nPageMinWidth = 0;
for(long i = nCount-1; i >= 0; --i)
{
- sal_uInt16 nID = m_aTabControl.GetPageId((sal_uInt16)i);
- OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl.GetTabPage(nID));
+ sal_uInt16 nID = m_aTabControl->GetPageId((sal_uInt16)i);
+ OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl->GetTabPage(nID));
if (pPage)
{
sal_Int32 nCurPageMinWidth = pPage->getMinimumWidth();
@@ -144,11 +152,11 @@ namespace pcr
{
// commit all of my pages, if necessary
- sal_uInt16 nCount = m_aTabControl.GetPageCount();
+ sal_uInt16 nCount = m_aTabControl->GetPageCount();
for ( sal_uInt16 i=0; i<nCount; ++i )
{
- sal_uInt16 nID = m_aTabControl.GetPageId( i );
- OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( nID ) );
+ sal_uInt16 nID = m_aTabControl->GetPageId( i );
+ OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl->GetTabPage( nID ) );
if ( pPage && pPage->getListBox().IsModified() )
pPage->getListBox().CommitModified();
@@ -158,7 +166,7 @@ namespace pcr
void OPropertyEditor::GetFocus()
{
- m_aTabControl.GrabFocus();
+ m_aTabControl->GrabFocus();
}
@@ -167,7 +175,7 @@ namespace pcr
OBrowserPage* pPage = NULL;
MapStringToPageId::const_iterator aPropertyPageIdPos = m_aPropertyPageIds.find( _rPropertyName );
if ( aPropertyPageIdPos != m_aPropertyPageIds.end() )
- pPage = static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( aPropertyPageIdPos->second ) );
+ pPage = static_cast< OBrowserPage* >( m_aTabControl->GetTabPage( aPropertyPageIdPos->second ) );
return pPage;
}
@@ -180,7 +188,7 @@ namespace pcr
OBrowserPage* OPropertyEditor::getPage( sal_uInt16& _rPageId )
{
- return static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( _rPageId ) );
+ return static_cast< OBrowserPage* >( m_aTabControl->GetTabPage( _rPageId ) );
}
@@ -201,7 +209,7 @@ namespace pcr
);
Rectangle aTabArea( aPlayground );
- m_aTabControl.SetPosSizePixel( aTabArea.TopLeft(), aTabArea.GetSize() );
+ m_aTabControl->SetPosSizePixel( aTabArea.TopLeft(), aTabArea.GetSize() );
}
@@ -210,13 +218,13 @@ namespace pcr
// obtain a new id
sal_uInt16 nId = m_nNextId++;
// insert the id
- m_aTabControl.InsertPage(nId, _rText);
+ m_aTabControl->InsertPage(nId, _rText);
// create a new page
- OBrowserPage* pPage = new OBrowserPage(&m_aTabControl);
+ VclPtrInstance<OBrowserPage> pPage(m_aTabControl.get());
pPage->SetText( _rText );
// some knittings
- pPage->SetSizePixel(m_aTabControl.GetTabPageSizePixel());
+ pPage->SetSizePixel(m_aTabControl->GetTabPageSizePixel());
pPage->getListBox().SetListener(m_pListener);
pPage->getListBox().SetObserver(m_pObserver);
pPage->getListBox().EnableHelpSection( m_bHasHelpSection );
@@ -224,8 +232,8 @@ namespace pcr
pPage->SetHelpId( _rHelpId );
// immediately activate the page
- m_aTabControl.SetTabPage(nId, pPage);
- m_aTabControl.SetCurPageId(nId);
+ m_aTabControl->SetTabPage(nId, pPage);
+ m_aTabControl->SetCurPageId(nId);
return nId;
}
@@ -234,32 +242,31 @@ namespace pcr
void OPropertyEditor::SetHelpId( const OString& rHelpId )
{
Control::SetHelpId("");
- m_aTabControl.SetHelpId(rHelpId);
+ m_aTabControl->SetHelpId(rHelpId);
}
void OPropertyEditor::RemovePage(sal_uInt16 nID)
{
- OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl.GetTabPage(nID));
+ VclPtr<OBrowserPage> pPage = static_cast<OBrowserPage*>(m_aTabControl->GetTabPage(nID));
if (pPage)
pPage->EnableInput(false);
- m_aTabControl.RemovePage(nID);
- if (pPage)
- delete pPage;
+ m_aTabControl->RemovePage(nID);
+ pPage.disposeAndClear();
}
void OPropertyEditor::SetPage(sal_uInt16 nId)
{
- m_aTabControl.SetCurPageId(nId);
+ m_aTabControl->SetCurPageId(nId);
}
sal_uInt16 OPropertyEditor::GetCurPage()
{
- if(m_aTabControl.GetPageCount()>0)
- return m_aTabControl.GetCurPageId();
+ if(m_aTabControl->GetPageCount()>0)
+ return m_aTabControl->GetCurPageId();
else
return 0;
}
@@ -268,11 +275,11 @@ namespace pcr
void OPropertyEditor::Update(const ::std::mem_fun_t<void,OBrowserListBox>& _aUpdateFunction)
{
// forward this to all our pages
- sal_uInt16 nCount = m_aTabControl.GetPageCount();
+ sal_uInt16 nCount = m_aTabControl->GetPageCount();
for (sal_uInt16 i=0;i<nCount;++i)
{
- sal_uInt16 nID = m_aTabControl.GetPageId(i);
- OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl.GetTabPage(nID));
+ sal_uInt16 nID = m_aTabControl->GetPageId(i);
+ OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl->GetTabPage(nID));
if (pPage)
_aUpdateFunction(&pPage->getListBox());
}
@@ -291,11 +298,11 @@ namespace pcr
void OPropertyEditor::forEachPage( PageOperation _pOperation, const void* _pArgument )
{
- sal_uInt16 nCount = m_aTabControl.GetPageCount();
+ sal_uInt16 nCount = m_aTabControl->GetPageCount();
for ( sal_uInt16 i=0; i<nCount; ++i )
{
- sal_uInt16 nID = m_aTabControl.GetPageId(i);
- OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( nID ) );
+ sal_uInt16 nID = m_aTabControl->GetPageId(i);
+ OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl->GetTabPage( nID ) );
if ( !pPage )
continue;
(this->*_pOperation)( *pPage, _pArgument );
@@ -340,11 +347,11 @@ namespace pcr
void OPropertyEditor::SetHelpText( const OUString& _rHelpText )
{
- sal_uInt16 nCount = m_aTabControl.GetPageCount();
+ sal_uInt16 nCount = m_aTabControl->GetPageCount();
for ( sal_uInt16 i=0; i<nCount; ++i )
{
- sal_uInt16 nID = m_aTabControl.GetPageId(i);
- OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( nID ) );
+ sal_uInt16 nID = m_aTabControl->GetPageId(i);
+ OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl->GetTabPage( nID ) );
if ( !pPage )
continue;
setHelpSectionText( *pPage, &_rHelpText );
@@ -445,13 +452,13 @@ namespace pcr
{
if ( !_bShow )
{
- sal_uInt16 nPagePos = m_aTabControl.GetPagePos( _nPageId );
+ sal_uInt16 nPagePos = m_aTabControl->GetPagePos( _nPageId );
if ( TAB_PAGE_NOTFOUND == nPagePos )
return;
DBG_ASSERT( m_aHiddenPages.find( _nPageId ) == m_aHiddenPages.end(), "OPropertyEditor::ShowPropertyPage: page already hidden!" );
- m_aHiddenPages[ _nPageId ] = HiddenPage( nPagePos, m_aTabControl.GetTabPage( _nPageId ) );
- m_aTabControl.RemovePage( _nPageId );
+ m_aHiddenPages[ _nPageId ] = HiddenPage( nPagePos, m_aTabControl->GetTabPage( _nPageId ) );
+ m_aTabControl->RemovePage( _nPageId );
}
else
{
@@ -459,9 +466,9 @@ namespace pcr
if ( aPagePos == m_aHiddenPages.end() )
return;
- aPagePos->second.pPage->SetSizePixel( m_aTabControl.GetTabPageSizePixel() );
- m_aTabControl.InsertPage( aPagePos->first, aPagePos->second.pPage->GetText(), aPagePos->second.nPos );
- m_aTabControl.SetTabPage( aPagePos->first, aPagePos->second.pPage );
+ aPagePos->second.pPage->SetSizePixel( m_aTabControl->GetTabPageSizePixel() );
+ m_aTabControl->InsertPage( aPagePos->first, aPagePos->second.pPage->GetText(), aPagePos->second.nPos );
+ m_aTabControl->SetTabPage( aPagePos->first, aPagePos->second.pPage );
m_aHiddenPages.erase( aPagePos );
}
@@ -470,9 +477,9 @@ namespace pcr
void OPropertyEditor::EnablePropertyControls( const OUString& _rEntryName, sal_Int16 _nControls, bool _bEnable )
{
- for ( sal_uInt16 i = 0; i < m_aTabControl.GetPageCount(); ++i )
+ for ( sal_uInt16 i = 0; i < m_aTabControl->GetPageCount(); ++i )
{
- OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( m_aTabControl.GetPageId( i ) ) );
+ OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl->GetTabPage( m_aTabControl->GetPageId( i ) ) );
if ( pPage )
pPage->getListBox().EnablePropertyControls( _rEntryName, _nControls, _bEnable );
}
@@ -481,9 +488,9 @@ namespace pcr
void OPropertyEditor::EnablePropertyLine( const OUString& _rEntryName, bool _bEnable )
{
- for ( sal_uInt16 i = 0; i < m_aTabControl.GetPageCount(); ++i )
+ for ( sal_uInt16 i = 0; i < m_aTabControl->GetPageCount(); ++i )
{
- OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl.GetTabPage( m_aTabControl.GetPageId( i ) ) );
+ OBrowserPage* pPage = static_cast< OBrowserPage* >( m_aTabControl->GetTabPage( m_aTabControl->GetPageId( i ) ) );
if ( pPage )
pPage->getListBox().EnablePropertyLine( _rEntryName, _bEnable );
}
@@ -494,7 +501,7 @@ namespace pcr
{
Reference< XPropertyControl > xControl;
// let the current page handle this
- OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl.GetTabPage(m_aTabControl.GetCurPageId()));
+ OBrowserPage* pPage = static_cast<OBrowserPage*>(m_aTabControl->GetTabPage(m_aTabControl->GetCurPageId()));
if (pPage)
xControl = pPage->getListBox().GetPropertyControl(rEntryName);
return xControl;
@@ -513,8 +520,8 @@ namespace pcr
{
// commit the data on the current (to-be-decativated) tab page
// (79404)
- sal_Int32 nCurrentId = m_aTabControl.GetCurPageId();
- OBrowserPage* pCurrentPage = static_cast<OBrowserPage*>(m_aTabControl.GetTabPage((sal_uInt16)nCurrentId));
+ sal_Int32 nCurrentId = m_aTabControl->GetCurPageId();
+ OBrowserPage* pCurrentPage = static_cast<OBrowserPage*>(m_aTabControl->GetTabPage((sal_uInt16)nCurrentId));
if ( !pCurrentPage )
return 1L;
diff --git a/extensions/source/propctrlr/propertyeditor.hxx b/extensions/source/propctrlr/propertyeditor.hxx
index 18861826ed7a..3a868386d7b0 100644
--- a/extensions/source/propctrlr/propertyeditor.hxx
+++ b/extensions/source/propctrlr/propertyeditor.hxx
@@ -24,13 +24,13 @@
#include <com/sun/star/inspection/XPropertyControl.hpp>
#include <vcl/tabctrl.hxx>
+#include <vcl/vclptr.hxx>
+#include <boost/mem_fn.hpp>
#include <map>
-
namespace pcr
{
-
class IPropertyLineListener;
class IPropertyControlObserver;
class OBrowserPage;
@@ -47,13 +47,13 @@ namespace pcr
struct HiddenPage
{
sal_uInt16 nPos;
- TabPage* pPage;
+ VclPtr<TabPage> pPage;
HiddenPage() : nPos( 0 ), pPage( NULL ) { }
HiddenPage( sal_uInt16 _nPos, TabPage* _pPage ) : nPos( _nPos ), pPage( _pPage ) { }
};
private:
- TabControl m_aTabControl;
+ VclPtr<TabControl> m_aTabControl;
IPropertyLineListener* m_pListener;
IPropertyControlObserver* m_pObserver;
sal_uInt16 m_nNextId;
@@ -73,6 +73,7 @@ namespace pcr
OPropertyEditor (vcl::Window* pParent, WinBits nWinStyle = WB_DIALOGCONTROL);
virtual ~OPropertyEditor();
+ virtual void dispose() SAL_OVERRIDE;
void EnableUpdate();
void DisableUpdate();
diff --git a/extensions/source/propctrlr/selectlabeldialog.cxx b/extensions/source/propctrlr/selectlabeldialog.cxx
index 27ed6d5d1799..43f372deecc1 100644
--- a/extensions/source/propctrlr/selectlabeldialog.cxx
+++ b/extensions/source/propctrlr/selectlabeldialog.cxx
@@ -145,6 +145,11 @@ namespace pcr
OSelectLabelDialog::~OSelectLabelDialog()
{
+ disposeOnce();
+ }
+
+ void OSelectLabelDialog::dispose()
+ {
// delete the entry datas of the listbox entries
SvTreeListEntry* pLoop = m_pControlTree->First();
while (pLoop)
@@ -154,7 +159,10 @@ namespace pcr
delete static_cast<Reference< XPropertySet > *>(pData);
pLoop = m_pControlTree->Next(pLoop);
}
-
+ m_pMainDesc.clear();
+ m_pControlTree.clear();
+ m_pNoAssignment.clear();
+ ModalDialog::dispose();
}
sal_Int32 OSelectLabelDialog::InsertEntries(const Reference< XInterface > & _xContainer, SvTreeListEntry* pContainerEntry)
diff --git a/extensions/source/propctrlr/selectlabeldialog.hxx b/extensions/source/propctrlr/selectlabeldialog.hxx
index abb138248f97..45144c646738 100644
--- a/extensions/source/propctrlr/selectlabeldialog.hxx
+++ b/extensions/source/propctrlr/selectlabeldialog.hxx
@@ -40,9 +40,9 @@ namespace pcr
:public ModalDialog
,public PcrClient
{
- FixedText *m_pMainDesc;
- SvTreeListBox *m_pControlTree;
- CheckBox *m_pNoAssignment;
+ VclPtr<FixedText> m_pMainDesc;
+ VclPtr<SvTreeListBox> m_pControlTree;
+ VclPtr<CheckBox> m_pNoAssignment;
ImageList m_aModelImages;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xControlModel;
@@ -58,6 +58,7 @@ namespace pcr
public:
OSelectLabelDialog(vcl::Window* pParent, ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > _xControlModel);
virtual ~OSelectLabelDialog();
+ virtual void dispose() SAL_OVERRIDE;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > GetSelected() const { return m_pNoAssignment->IsChecked() ? ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > () : m_xSelectedControl; }
diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx
index af4d001dc784..240b3f51131c 100644
--- a/extensions/source/propctrlr/standardcontrol.cxx
+++ b/extensions/source/propctrlr/standardcontrol.cxx
@@ -959,14 +959,16 @@ namespace pcr
class OMultilineFloatingEdit : public FloatingWindow
{
private:
- MultiLineEdit m_aImplEdit;
+ VclPtr<MultiLineEdit> m_aImplEdit;
protected:
virtual void Resize() SAL_OVERRIDE;
public:
OMultilineFloatingEdit(vcl::Window* _pParen);
- MultiLineEdit& getEdit() { return m_aImplEdit; }
+ virtual ~OMultilineFloatingEdit();
+ virtual void dispose() SAL_OVERRIDE;
+ MultiLineEdit& getEdit() { return *m_aImplEdit.get(); }
protected:
virtual bool PreNotify(NotifyEvent& _rNEvt) SAL_OVERRIDE;
@@ -975,15 +977,25 @@ namespace pcr
OMultilineFloatingEdit::OMultilineFloatingEdit(vcl::Window* _pParent)
:FloatingWindow(_pParent, WB_BORDER)
- ,m_aImplEdit(this, WB_VSCROLL|WB_IGNORETAB|WB_NOBORDER)
+ ,m_aImplEdit(VclPtr<MultiLineEdit>::Create(this, WB_VSCROLL|WB_IGNORETAB|WB_NOBORDER))
{
- m_aImplEdit.Show();
+ m_aImplEdit->Show();
}
+ OMultilineFloatingEdit::~OMultilineFloatingEdit()
+ {
+ disposeOnce();
+ }
+
+ void OMultilineFloatingEdit::dispose()
+ {
+ m_aImplEdit.disposeAndClear();
+ FloatingWindow::dispose();
+ }
void OMultilineFloatingEdit::Resize()
{
- m_aImplEdit.SetSizePixel(GetOutputSizePixel());
+ m_aImplEdit->SetSizePixel(GetOutputSizePixel());
}
@@ -1023,26 +1035,25 @@ namespace pcr
DropDownEditControl::DropDownEditControl( vcl::Window* _pParent, WinBits _nStyle )
:DropDownEditControl_Base( _pParent, _nStyle )
,m_pFloatingEdit( NULL )
- ,m_pImplEdit( NULL )
,m_pDropdownButton( NULL )
,m_nOperationMode( eStringList )
,m_bDropdown( false )
{
SetCompoundControl( true );
- m_pImplEdit = new MultiLineEdit( this, WB_TABSTOP | WB_IGNORETAB | WB_NOBORDER | (_nStyle & WB_READONLY) );
+ m_pImplEdit = VclPtr<MultiLineEdit>::Create( this, WB_TABSTOP | WB_IGNORETAB | WB_NOBORDER | (_nStyle & WB_READONLY) );
SetSubEdit( m_pImplEdit );
m_pImplEdit->Show();
if ( _nStyle & WB_DROPDOWN )
{
- m_pDropdownButton = new PushButton( this, WB_NOLIGHTBORDER | WB_RECTSTYLE | WB_NOTABSTOP);
+ m_pDropdownButton = VclPtr<PushButton>::Create( this, WB_NOLIGHTBORDER | WB_RECTSTYLE | WB_NOTABSTOP);
m_pDropdownButton->SetSymbol(SymbolType::SPIN_DOWN);
m_pDropdownButton->SetClickHdl( LINK( this, DropDownEditControl, DropDownHdl ) );
m_pDropdownButton->Show();
}
- m_pFloatingEdit = new OMultilineFloatingEdit(this); //FloatingWindow
+ m_pFloatingEdit = VclPtr<OMultilineFloatingEdit>::Create(this);
m_pFloatingEdit->SetPopupModeEndHdl( LINK( this, DropDownEditControl, ReturnHdl ) );
m_pFloatingEdit->getEdit().SetReadOnly( ( _nStyle & WB_READONLY ) != 0 );
@@ -1061,19 +1072,16 @@ namespace pcr
DropDownEditControl::~DropDownEditControl()
{
- {
- boost::scoped_ptr<vcl::Window> aTemp(m_pFloatingEdit);
- m_pFloatingEdit = NULL;
- }
- {
- boost::scoped_ptr<vcl::Window> aTemp(m_pImplEdit);
- SetSubEdit( NULL );
- m_pImplEdit = NULL;
- }
- {
- boost::scoped_ptr<vcl::Window> aTemp(m_pDropdownButton);
- m_pDropdownButton = NULL;
- }
+ disposeOnce();
+ }
+
+ void DropDownEditControl::dispose()
+ {
+ SetSubEdit(nullptr);
+ m_pImplEdit.disposeAndClear();
+ m_pFloatingEdit.disposeAndClear();
+ m_pDropdownButton.disposeAndClear();
+ DropDownEditControl_Base::dispose();
}
@@ -1081,7 +1089,7 @@ namespace pcr
{
::Size aOutSz = GetOutputSizePixel();
- if (m_pDropdownButton!=NULL)
+ if (m_pDropdownButton!=nullptr)
{
long nSBWidth = GetSettings().GetStyleSettings().GetScrollBarSize();
nSBWidth = CalcZoom( nSBWidth );
@@ -1106,7 +1114,7 @@ namespace pcr
{
if ( m_pHelper )
{
- m_pHelper->LoseFocusHdl( m_pImplEdit );
+ m_pHelper->LoseFocusHdl( m_pImplEdit.get() );
m_pHelper->activateNextControl();
}
}
diff --git a/extensions/source/propctrlr/standardcontrol.hxx b/extensions/source/propctrlr/standardcontrol.hxx
index 8c80714bc3d5..9eb99354abda 100644
--- a/extensions/source/propctrlr/standardcontrol.hxx
+++ b/extensions/source/propctrlr/standardcontrol.hxx
@@ -374,15 +374,16 @@ namespace pcr
class DropDownEditControl : public DropDownEditControl_Base
{
private:
- OMultilineFloatingEdit* m_pFloatingEdit;
- MultiLineEdit* m_pImplEdit;
- PushButton* m_pDropdownButton;
+ VclPtr<OMultilineFloatingEdit> m_pFloatingEdit;
+ VclPtr<MultiLineEdit> m_pImplEdit;
+ VclPtr<PushButton> m_pDropdownButton;
MultiLineOperationMode m_nOperationMode;
bool m_bDropdown : 1;
public:
DropDownEditControl( vcl::Window* _pParent, WinBits _nStyle );
virtual ~DropDownEditControl();
+ virtual void dispose() SAL_OVERRIDE;
void setOperationMode( MultiLineOperationMode _eMode ) { m_nOperationMode = _eMode; }
MultiLineOperationMode getOperationMode() const { return m_nOperationMode; }
diff --git a/extensions/source/propctrlr/taborder.cxx b/extensions/source/propctrlr/taborder.cxx
index 8c64920aad01..8189fca44a92 100644
--- a/extensions/source/propctrlr/taborder.cxx
+++ b/extensions/source/propctrlr/taborder.cxx
@@ -118,10 +118,20 @@ namespace pcr
TabOrderDialog::~TabOrderDialog()
{
+ disposeOnce();
+ }
+
+ void TabOrderDialog::dispose()
+ {
m_pLB_Controls->Hide();
// delete pLB_Controls;
delete pImageList;
-
+ m_pLB_Controls.clear();
+ m_pPB_OK.clear();
+ m_pPB_MoveUp.clear();
+ m_pPB_MoveDown.clear();
+ m_pPB_AutoOrder.clear();
+ ModalDialog::dispose();
}
diff --git a/extensions/source/propctrlr/taborder.hxx b/extensions/source/propctrlr/taborder.hxx
index d70e60cce47f..f56d4b45bc01 100644
--- a/extensions/source/propctrlr/taborder.hxx
+++ b/extensions/source/propctrlr/taborder.hxx
@@ -73,13 +73,13 @@ namespace pcr
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
m_xORB;
- TabOrderListBox* m_pLB_Controls;
+ VclPtr<TabOrderListBox> m_pLB_Controls;
- OKButton* m_pPB_OK;
+ VclPtr<OKButton> m_pPB_OK;
- PushButton* m_pPB_MoveUp;
- PushButton* m_pPB_MoveDown;
- PushButton* m_pPB_AutoOrder;
+ VclPtr<PushButton> m_pPB_MoveUp;
+ VclPtr<PushButton> m_pPB_MoveDown;
+ VclPtr<PushButton> m_pPB_AutoOrder;
ImageList* pImageList;
@@ -102,6 +102,7 @@ namespace pcr
);
virtual ~TabOrderDialog();
+ virtual void dispose() SAL_OVERRIDE;
void SetModified();
};
diff --git a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx
index 99df0140e250..5d01cc891db5 100644
--- a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx
+++ b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx
@@ -496,11 +496,11 @@ namespace pcr
::std::vector< OUString > aExistentNames;
m_pHelper->getAvailableDataTypeNames( aExistentNames );
- NewDataTypeDialog aDialog( NULL, pType->getName(), aExistentNames ); // TODO/eForms: proper parent
- if ( aDialog.Execute() != RET_OK )
+ ScopedVclPtrInstance<NewDataTypeDialog> aDialog( nullptr, pType->getName(), aExistentNames ); // TODO/eForms: proper parent
+ if ( aDialog->Execute() != RET_OK )
return false;
- _rNewName = aDialog.GetName();
+ _rNewName = aDialog->GetName();
return true;
}
@@ -535,8 +535,8 @@ namespace pcr
// confirmation message
OUString sConfirmation( PcrRes( RID_STR_CONFIRM_DELETE_DATA_TYPE ).toString() );
sConfirmation = sConfirmation.replaceFirst( "#type#", pType->getName() );
- QueryBox aQuery( NULL, WB_YES_NO, sConfirmation ); // TODO/eForms: proper parent
- if ( aQuery.Execute() != RET_YES )
+ ScopedVclPtrInstance<QueryBox> aQuery( nullptr, WB_YES_NO, sConfirmation ); // TODO/eForms: proper parent
+ if ( aQuery->Execute() != RET_YES )
return false;
return true;
diff --git a/extensions/source/scanner/grid.cxx b/extensions/source/scanner/grid.cxx
index 1056a1474c9b..346715b4bc28 100644
--- a/extensions/source/scanner/grid.cxx
+++ b/extensions/source/scanner/grid.cxx
@@ -120,6 +120,7 @@ public:
GridWindow(vcl::Window* pParent);
void Init(double* pXValues, double* pYValues, int nValues, bool bCutValues, const BitmapEx &rMarkerBitmap);
virtual ~GridWindow();
+ virtual void dispose() SAL_OVERRIDE;
void setBoundings( double fMinX, double fMinY, double fMaxX, double fMaxY );
@@ -212,9 +213,29 @@ GridDialog::GridDialog(double* pXValues, double* pYValues, int nValues, vcl::Win
m_pResetButton->SetClickHdl( LINK( this, GridDialog, ClickButtonHdl ) );
}
+GridDialog::~GridDialog()
+{
+ disposeOnce();
+}
+
+void GridDialog::dispose()
+{
+ m_pOKButton.clear();
+ m_pResetTypeBox.clear();
+ m_pResetButton.clear();
+ m_pGridWindow.clear();
+ ModalDialog::dispose();
+}
+
GridWindow::~GridWindow()
{
+ disposeOnce();
+}
+
+void GridWindow::dispose()
+{
delete [] m_pNewYValues;
+ vcl::Window::dispose();
}
double GridWindow::findMinX()
diff --git a/extensions/source/scanner/grid.hxx b/extensions/source/scanner/grid.hxx
index 6fca647facd5..940dec60097e 100644
--- a/extensions/source/scanner/grid.hxx
+++ b/extensions/source/scanner/grid.hxx
@@ -37,19 +37,20 @@ enum resetType
class GridDialog : public ModalDialog
{
- OKButton* m_pOKButton;
+ VclPtr<OKButton> m_pOKButton;
- ListBox* m_pResetTypeBox;
- PushButton* m_pResetButton;
+ VclPtr<ListBox> m_pResetTypeBox;
+ VclPtr<PushButton> m_pResetButton;
- GridWindow* m_pGridWindow;
+ VclPtr<GridWindow> m_pGridWindow;
DECL_LINK( ClickButtonHdl, Button* );
public:
GridDialog(double* pXValues, double* pYValues, int nValues,
vcl::Window* pParent, bool bCutValues = true);
-
+ virtual ~GridDialog();
+ virtual void dispose() SAL_OVERRIDE;
void setBoundings(double fMinX, double fMinY, double fMaxX, double fMaxY);
double* getNewYValues();
};
diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx
index ae9c4d5cc00d..384be4d3371d 100644
--- a/extensions/source/scanner/sanedlg.cxx
+++ b/extensions/source/scanner/sanedlg.cxx
@@ -43,7 +43,7 @@ private:
Rectangle maPreviewRect;
Point maTopLeft, maBottomRight;
Point maMinTopLeft, maMaxBottomRight;
- SaneDlg* mpParentDialog;
+ VclPtr<SaneDlg> mpParentDialog;
DragDirection meDragDirection;
bool mbDragEnable;
bool mbDragDrawn;
@@ -61,6 +61,12 @@ public:
, mbIsDragging(false)
{
}
+ virtual ~ScanPreview() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE
+ {
+ mpParentDialog.clear();
+ vcl::Window::dispose();
+ }
void Init(SaneDlg *pParent)
{
mpParentDialog = pParent;
@@ -151,8 +157,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeScanPreview(vcl::Windo
OString sBorder = VclBuilder::extractCustomProperty(rMap);
if (!sBorder.isEmpty())
nWinStyle |= WB_BORDER;
- ScanPreview *pWindow = new ScanPreview(pParent, nWinStyle);
- return pWindow;
+ return new ScanPreview(pParent, nWinStyle);
}
SaneDlg::SaneDlg( vcl::Window* pParent, Sane& rSane, bool bScanEnabled ) :
@@ -239,7 +244,37 @@ SaneDlg::SaneDlg( vcl::Window* pParent, Sane& rSane, bool bScanEnabled ) :
SaneDlg::~SaneDlg()
{
+ disposeOnce();
+}
+
+void SaneDlg::dispose()
+{
mrSane.SetReloadOptionsHdl( maOldLink );
+ mpOKButton.clear();
+ mpCancelButton.clear();
+ mpDeviceInfoButton.clear();
+ mpPreviewButton.clear();
+ mpScanButton.clear();
+ mpButtonOption.clear();
+ mpOptionTitle.clear();
+ mpOptionDescTxt.clear();
+ mpVectorTxt.clear();
+ mpLeftField.clear();
+ mpTopField.clear();
+ mpRightField.clear();
+ mpBottomField.clear();
+ mpDeviceBox.clear();
+ mpReslBox.clear();
+ mpAdvancedBox.clear();
+ mpVectorBox.clear();
+ mpQuantumRangeBox.clear();
+ mpStringRangeBox.clear();
+ mpBoolCheckBox.clear();
+ mpStringEdit.clear();
+ mpNumericEdit.clear();
+ mpOptionBox.clear();
+ mpPreview.clear();
+ ModalDialog::dispose();
}
namespace {
@@ -256,8 +291,8 @@ short SaneDlg::Execute()
{
if( ! Sane::IsSane() )
{
- MessageDialog aErrorBox(NULL, SaneResId(STR_COULD_NOT_BE_INIT));
- aErrorBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(nullptr, SaneResId(STR_COULD_NOT_BE_INIT));
+ aErrorBox->Execute();
return RET_CANCEL;
}
LoadState();
@@ -539,8 +574,8 @@ IMPL_LINK( SaneDlg, ClickBtnHdl, Button*, pButton )
aString = aString.replaceFirst( "%s", Sane::GetVendor( mrSane.GetDeviceNumber() ) );
aString = aString.replaceFirst( "%s", Sane::GetModel( mrSane.GetDeviceNumber() ) );
aString = aString.replaceFirst( "%s", Sane::GetType( mrSane.GetDeviceNumber() ) );
- MessageDialog aInfoBox(this, aString, VCL_MESSAGE_INFO);
- aInfoBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aInfoBox(this, aString, VCL_MESSAGE_INFO);
+ aInfoBox->Execute();
}
else if( pButton == mpPreviewButton )
AcquirePreview();
@@ -568,11 +603,11 @@ IMPL_LINK( SaneDlg, ClickBtnHdl, Button*, pButton )
x[ i ] = (double)i;
mrSane.GetOptionValue( mnCurrentOption, y.get() );
- GridDialog aGrid( x.get(), y.get(), nElements, this );
- aGrid.SetText( mrSane.GetOptionName( mnCurrentOption ) );
- aGrid.setBoundings( 0, mfMin, nElements, mfMax );
- if( aGrid.Execute() && aGrid.getNewYValues() )
- mrSane.SetOptionValue( mnCurrentOption, aGrid.getNewYValues() );
+ ScopedVclPtrInstance< GridDialog > aGrid( x.get(), y.get(), nElements, this );
+ aGrid->SetText( mrSane.GetOptionName( mnCurrentOption ) );
+ aGrid->setBoundings( 0, mfMin, nElements, mfMax );
+ if( aGrid->Execute() && aGrid->getNewYValues() )
+ mrSane.SetOptionValue( mnCurrentOption, aGrid->getNewYValues() );
}
break;
case SANE_TYPE_BOOL:
@@ -820,8 +855,8 @@ void SaneDlg::AcquirePreview()
if( nOption == -1 )
{
OUString aString(SaneResId(STR_SLOW_PREVIEW));
- MessageDialog aBox(this, aString, VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL);
- if (aBox.Execute() == RET_CANCEL)
+ ScopedVclPtrInstance< MessageDialog > aBox(this, aString, VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL);
+ if (aBox->Execute() == RET_CANCEL)
return;
}
else
@@ -830,8 +865,8 @@ void SaneDlg::AcquirePreview()
BitmapTransporter aTransporter;
if( ! mrSane.Start( aTransporter ) )
{
- MessageDialog aErrorBox(this, SaneResId(STR_ERROR_SCAN));
- aErrorBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(this, SaneResId(STR_ERROR_SCAN));
+ aErrorBox->Execute();
}
else
{
diff --git a/extensions/source/scanner/sanedlg.hxx b/extensions/source/scanner/sanedlg.hxx
index 57eaa54b0cb3..6aca2733c3a7 100644
--- a/extensions/source/scanner/sanedlg.hxx
+++ b/extensions/source/scanner/sanedlg.hxx
@@ -40,38 +40,38 @@ private:
Link maOldLink;
- OKButton* mpOKButton;
- CancelButton* mpCancelButton;
- PushButton* mpDeviceInfoButton;
- PushButton* mpPreviewButton;
- PushButton* mpScanButton;
- PushButton* mpButtonOption;
+ VclPtr<OKButton> mpOKButton;
+ VclPtr<CancelButton> mpCancelButton;
+ VclPtr<PushButton> mpDeviceInfoButton;
+ VclPtr<PushButton> mpPreviewButton;
+ VclPtr<PushButton> mpScanButton;
+ VclPtr<PushButton> mpButtonOption;
- FixedText* mpOptionTitle;
- FixedText* mpOptionDescTxt;
- FixedText* mpVectorTxt;
+ VclPtr<FixedText> mpOptionTitle;
+ VclPtr<FixedText> mpOptionDescTxt;
+ VclPtr<FixedText> mpVectorTxt;
- MetricField* mpLeftField;
- MetricField* mpTopField;
- MetricField* mpRightField;
- MetricField* mpBottomField;
+ VclPtr<MetricField> mpLeftField;
+ VclPtr<MetricField> mpTopField;
+ VclPtr<MetricField> mpRightField;
+ VclPtr<MetricField> mpBottomField;
- ListBox* mpDeviceBox;
- NumericBox* mpReslBox;
- CheckBox* mpAdvancedBox;
+ VclPtr<ListBox> mpDeviceBox;
+ VclPtr<NumericBox> mpReslBox;
+ VclPtr<CheckBox> mpAdvancedBox;
- NumericField* mpVectorBox;
- ListBox* mpQuantumRangeBox;
- ListBox* mpStringRangeBox;
+ VclPtr<NumericField> mpVectorBox;
+ VclPtr<ListBox> mpQuantumRangeBox;
+ VclPtr<ListBox> mpStringRangeBox;
- CheckBox* mpBoolCheckBox;
+ VclPtr<CheckBox> mpBoolCheckBox;
- Edit* mpStringEdit;
- Edit* mpNumericEdit;
+ VclPtr<Edit> mpStringEdit;
+ VclPtr<Edit> mpNumericEdit;
- SvTreeListBox* mpOptionBox;
+ VclPtr<SvTreeListBox> mpOptionBox;
- ScanPreview* mpPreview;
+ VclPtr<ScanPreview> mpPreview;
int mnCurrentOption;
int mnCurrentElement;
@@ -105,6 +105,7 @@ private:
public:
SaneDlg( vcl::Window*, Sane&, bool );
virtual ~SaneDlg();
+ virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
void UpdateScanArea( bool );
diff --git a/extensions/source/scanner/scanunx.cxx b/extensions/source/scanner/scanunx.cxx
index a66d797587dc..7d4da1f523fe 100644
--- a/extensions/source/scanner/scanunx.cxx
+++ b/extensions/source/scanner/scanunx.cxx
@@ -299,9 +299,9 @@ sal_Bool ScannerManager::configureScannerAndScan( ScannerContext& scanner_contex
);
pHolder->m_bBusy = true;
- SaneDlg aDlg( NULL, pHolder->m_aSane, listener.is() );
- bRet = aDlg.Execute();
- bScan = aDlg.getDoScan();
+ ScopedVclPtrInstance< SaneDlg > aDlg(nullptr, pHolder->m_aSane, listener.is());
+ bRet = aDlg->Execute();
+ bScan = aDlg->getDoScan();
pHolder->m_bBusy = false;
}
if ( bScan )
diff --git a/extensions/workben/testframecontrol.cxx b/extensions/workben/testframecontrol.cxx
index bb22d173db05..5cfa08c2c2a5 100644
--- a/extensions/workben/testframecontrol.cxx
+++ b/extensions/workben/testframecontrol.cxx
@@ -239,7 +239,7 @@ void FrameControlApplication::init()
XInterfaceRef xInst = xMgr->createInstance( L"stardiv.one.frame.FrameControl" );
if (xInst->queryInterface( XControl::getSmartUik(), _xControl ))
{
- _pWorkWin = new WorkWindow( NULL, WB_APP | WB_STDWORK );
+ _pWorkWin = VclPtr<WorkWindow>::Create( nullptr, WB_APP | WB_STDWORK );
_pWorkWin->Show();
XWindowPeerRef xParent( _pWorkWin->GetComponentInterface() );
diff --git a/filter/source/flash/impswfdialog.cxx b/filter/source/flash/impswfdialog.cxx
index fe6b7fe7c485..bbe0bfbb7f98 100644
--- a/filter/source/flash/impswfdialog.cxx
+++ b/filter/source/flash/impswfdialog.cxx
@@ -60,8 +60,21 @@ ImpSWFDialog::ImpSWFDialog( vcl::Window* pParent, Sequence< PropertyValue >& rFi
ImpSWFDialog::~ImpSWFDialog()
{
+ disposeOnce();
}
+void ImpSWFDialog::dispose()
+{
+ mpNumFldQuality.clear();
+ mpCheckExportAll.clear();
+ mpCheckExportBackgrounds.clear();
+ mpCheckExportBackgroundObjects.clear();
+ mpCheckExportSlideContents.clear();
+ mpCheckExportSound.clear();
+ mpCheckExportOLEAsJPEG.clear();
+ mpCheckExportMultipleFiles.clear();
+ ModalDialog::dispose();
+}
Sequence< PropertyValue > ImpSWFDialog::GetFilterData()
diff --git a/filter/source/flash/impswfdialog.hxx b/filter/source/flash/impswfdialog.hxx
index cb128448112e..aae9ecf7f1c2 100644
--- a/filter/source/flash/impswfdialog.hxx
+++ b/filter/source/flash/impswfdialog.hxx
@@ -41,14 +41,14 @@ namespace vcl { class Window; }
class ImpSWFDialog : public ModalDialog
{
private:
- NumericField * mpNumFldQuality;
- CheckBox * mpCheckExportAll;
- CheckBox * mpCheckExportBackgrounds;
- CheckBox * mpCheckExportBackgroundObjects;
- CheckBox * mpCheckExportSlideContents;
- CheckBox * mpCheckExportSound;
- CheckBox * mpCheckExportOLEAsJPEG;
- CheckBox * mpCheckExportMultipleFiles;
+ VclPtr<NumericField> mpNumFldQuality;
+ VclPtr<CheckBox> mpCheckExportAll;
+ VclPtr<CheckBox> mpCheckExportBackgrounds;
+ VclPtr<CheckBox> mpCheckExportBackgroundObjects;
+ VclPtr<CheckBox> mpCheckExportSlideContents;
+ VclPtr<CheckBox> mpCheckExportSound;
+ VclPtr<CheckBox> mpCheckExportOLEAsJPEG;
+ VclPtr<CheckBox> mpCheckExportMultipleFiles;
FilterConfigItem maConfigItem;
@@ -58,6 +58,7 @@ public:
ImpSWFDialog( vcl::Window* pParent,
com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rFilterData );
virtual ~ImpSWFDialog();
+ virtual void dispose() SAL_OVERRIDE;
com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > GetFilterData();
};
diff --git a/filter/source/flash/swfdialog.cxx b/filter/source/flash/swfdialog.cxx
index 64a182f47db3..dcfac419788c 100644
--- a/filter/source/flash/swfdialog.cxx
+++ b/filter/source/flash/swfdialog.cxx
@@ -146,9 +146,9 @@ Sequence< OUString > SAL_CALL SWFDialog::getSupportedServiceNames()
-Dialog* SWFDialog::createDialog( vcl::Window* pParent )
+VclPtr<Dialog> SWFDialog::createDialog( vcl::Window* pParent )
{
- Dialog* pRet = NULL;
+ VclPtr<Dialog> pRet;
if (mxSrcDoc.is())
{
@@ -172,8 +172,7 @@ Dialog* SWFDialog::createDialog( vcl::Window* pParent )
{
}
*/
- ImpSWFDialog* pDlg = new ImpSWFDialog( pParent, maFilterData );
- pRet = pDlg;
+ pRet.reset( VclPtr<ImpSWFDialog>::Create( pParent, maFilterData ) );
}
return pRet;
@@ -184,7 +183,7 @@ Dialog* SWFDialog::createDialog( vcl::Window* pParent )
void SWFDialog::executedDialog( sal_Int16 nExecutionResult )
{
if( nExecutionResult && m_pDialog )
- maFilterData = static_cast< ImpSWFDialog* >( m_pDialog )->GetFilterData();
+ maFilterData = static_cast< ImpSWFDialog* >( m_pDialog.get() )->GetFilterData();
destroyDialog();
}
diff --git a/filter/source/flash/swfdialog.hxx b/filter/source/flash/swfdialog.hxx
index 931432e33c4c..2130f79f38b2 100644
--- a/filter/source/flash/swfdialog.hxx
+++ b/filter/source/flash/swfdialog.hxx
@@ -54,7 +54,7 @@ protected:
virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual OUString SAL_CALL getImplementationName() throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
- virtual Dialog* createDialog( vcl::Window* pParent ) SAL_OVERRIDE;
+ virtual VclPtr<Dialog> createDialog( vcl::Window* pParent ) SAL_OVERRIDE;
virtual void executedDialog( sal_Int16 nExecutionResult ) SAL_OVERRIDE;
virtual com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() SAL_OVERRIDE;
diff --git a/filter/source/flash/swfwriter.cxx b/filter/source/flash/swfwriter.cxx
index 4e2021264605..9f80ca9afaeb 100644
--- a/filter/source/flash/swfwriter.cxx
+++ b/filter/source/flash/swfwriter.cxx
@@ -49,7 +49,6 @@ Writer::Writer( sal_Int32 nTWIPWidthOutput, sal_Int32 nTWIPHeightOutput, sal_Int
mnGlobalTransparency(0),
mnJPEGCompressMode(nJPEGcompressMode)
{
- mpVDev = new VirtualDevice;
mpVDev->EnableOutput( false );
maMovieTempFile.EnableKillingFile();
@@ -100,7 +99,7 @@ Writer::Writer( sal_Int32 nTWIPWidthOutput, sal_Int32 nTWIPHeightOutput, sal_Int
Writer::~Writer()
{
- delete mpVDev;
+ mpVDev.disposeAndClear();
delete mpSprite;
delete mpTag;
}
diff --git a/filter/source/flash/swfwriter.hxx b/filter/source/flash/swfwriter.hxx
index 218459b00f6e..786410259559 100644
--- a/filter/source/flash/swfwriter.hxx
+++ b/filter/source/flash/swfwriter.hxx
@@ -25,6 +25,7 @@
#include <com/sun/star/i18n/XBreakIterator.hpp>
#include <vcl/font.hxx>
#include <vcl/gradient.hxx>
+#include <vcl/vclptr.hxx>
#include <unotools/tempfile.hxx>
#include <tools/color.hxx>
#include <tools/poly.hxx>
@@ -395,7 +396,7 @@ private:
sal_uInt16 mnWhiteBackgroundShapeId;
sal_uInt16 mnPageButtonId;
- VirtualDevice* mpVDev;
+ VclPtrInstance<VirtualDevice> mpVDev;
const tools::PolyPolygon* mpClipPolyPolygon;
diff --git a/filter/source/graphic/GraphicExportDialog.cxx b/filter/source/graphic/GraphicExportDialog.cxx
index ca98685e20ab..94f02c58e62d 100644
--- a/filter/source/graphic/GraphicExportDialog.cxx
+++ b/filter/source/graphic/GraphicExportDialog.cxx
@@ -107,10 +107,10 @@ void GraphicExportDialog::setTitle( const OUString& aTitle )
sal_Int16 GraphicExportDialog::execute() throw ( RuntimeException, std::exception )
{
sal_Int16 nReturn = ui::dialogs::ExecutableDialogResults::CANCEL;
- GraphicExportOptionsDialog graphicExportOptionsDialog( Application::GetDefDialogParent(), mxSourceDocument );
- if (graphicExportOptionsDialog.Execute() == RET_OK )
+ ScopedVclPtrInstance< GraphicExportOptionsDialog > graphicExportOptionsDialog( Application::GetDefDialogParent(), mxSourceDocument );
+ if (graphicExportOptionsDialog->Execute() == RET_OK )
{
- maFilterDataSequence = graphicExportOptionsDialog.getFilterData();
+ maFilterDataSequence = graphicExportOptionsDialog->getFilterData();
nReturn = ui::dialogs::ExecutableDialogResults::OK;
}
return nReturn;
diff --git a/filter/source/graphicfilter/eos2met/eos2met.cxx b/filter/source/graphicfilter/eos2met/eos2met.cxx
index 501a9a8ac31d..ef7b1307e1bf 100644
--- a/filter/source/graphicfilter/eos2met/eos2met.cxx
+++ b/filter/source/graphicfilter/eos2met/eos2met.cxx
@@ -156,8 +156,8 @@ private:
sal_uInt32 nWrittenBitmaps; // number of already written Bitmaps
sal_uInt32 nActBitmapPercent; // percentage of the next bitmap that's already written
- ::std::unique_ptr< VirtualDevice > apDummyVDev;
- OutputDevice* pCompDev;
+ ScopedVclPtr<VirtualDevice> apDummyVDev;
+ VclPtr<OutputDevice> pCompDev;
com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > xStatusIndicator;
@@ -261,6 +261,7 @@ public:
pCompDev = reinterpret_cast< OutputDevice* >( Application::GetAppWindow() );
if( !pCompDev )
{
+ apDummyVDev.disposeAndClear();
apDummyVDev.reset( new VirtualDevice );
pCompDev = apDummyVDev.get();
}
@@ -1850,12 +1851,12 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF )
if( aGDIFont.GetAlign() != ALIGN_BASELINE)
{
- VirtualDevice aVDev;
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
if( aGDIFont.GetAlign()==ALIGN_TOP )
- aPt.Y()+=(long)aVDev.GetFontMetric( aGDIFont ).GetAscent();
+ aPt.Y()+=(long)pVDev->GetFontMetric( aGDIFont ).GetAscent();
else
- aPt.Y()-=(long)aVDev.GetFontMetric( aGDIFont ).GetDescent();
+ aPt.Y()-=(long)pVDev->GetFontMetric( aGDIFont ).GetDescent();
}
METSetMix(eGDIRasterOp);
@@ -1879,11 +1880,11 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF )
if( aGDIFont.GetAlign() != ALIGN_BASELINE )
{
- VirtualDevice aVDev;
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
if( aGDIFont.GetAlign() == ALIGN_TOP )
- aPt.Y()+=(long)aVDev.GetFontMetric(aGDIFont).GetAscent();
+ aPt.Y()+=(long)pVDev->GetFontMetric(aGDIFont).GetAscent();
else
- aPt.Y()-=(long)aVDev.GetFontMetric(aGDIFont).GetDescent();
+ aPt.Y()-=(long)pVDev->GetFontMetric(aGDIFont).GetDescent();
}
METSetMix(eGDIRasterOp);
@@ -1922,7 +1923,7 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF )
case META_STRETCHTEXT_ACTION:
{
const MetaStretchTextAction* pA = static_cast<const MetaStretchTextAction*>(pMA);
- VirtualDevice aVDev;
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
sal_uInt16 i;
sal_Int32 nNormSize;
OUString aStr;
@@ -1931,14 +1932,14 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF )
Point aPt( pA->GetPoint() );
Point aPt2;
- aVDev.SetFont( aGDIFont );
+ pVDev->SetFont( aGDIFont );
if( aGDIFont.GetAlign() != ALIGN_BASELINE)
{
if( aGDIFont.GetAlign() == ALIGN_TOP )
- aPt.Y()+=(long)aVDev.GetFontMetric().GetAscent();
+ aPt.Y()+=(long)pVDev->GetFontMetric().GetAscent();
else
- aPt.Y()-=(long)aVDev.GetFontMetric().GetDescent();
+ aPt.Y()-=(long)pVDev->GetFontMetric().GetDescent();
}
METSetMix(eGDIRasterOp);
@@ -1949,7 +1950,7 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF )
METSetChrSet(FindChrSet(aGDIFont));
aStr = pA->GetText().copy(pA->GetIndex(),pA->GetLen());
boost::scoped_array<long> pDXAry(new long[aStr.getLength()]);
- nNormSize = aVDev.GetTextArray( aStr, pDXAry.get() );
+ nNormSize = pVDev->GetTextArray( aStr, pDXAry.get() );
for ( i = 0; i < aStr.getLength(); i++ )
{
@@ -2067,24 +2068,24 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF )
case META_GRADIENT_ACTION:
{
- VirtualDevice aVDev;
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
GDIMetaFile aTmpMtf;
const MetaGradientAction* pA = static_cast<const MetaGradientAction*>(pMA);
- aVDev.SetMapMode( aTargetMapMode );
- aVDev.AddGradientActions( pA->GetRect(), pA->GetGradient(), aTmpMtf );
+ pVDev->SetMapMode( aTargetMapMode );
+ pVDev->AddGradientActions( pA->GetRect(), pA->GetGradient(), aTmpMtf );
WriteOrders( &aTmpMtf );
}
break;
case META_HATCH_ACTION:
{
- VirtualDevice aVDev;
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
GDIMetaFile aTmpMtf;
const MetaHatchAction* pA = static_cast<const MetaHatchAction*>(pMA);
- aVDev.SetMapMode( aTargetMapMode );
- aVDev.AddHatchActions( pA->GetPolyPolygon(), pA->GetHatch(), aTmpMtf );
+ pVDev->SetMapMode( aTargetMapMode );
+ pVDev->AddHatchActions( pA->GetPolyPolygon(), pA->GetHatch(), aTmpMtf );
WriteOrders( &aTmpMtf );
}
break;
diff --git a/filter/source/graphicfilter/epict/epict.cxx b/filter/source/graphicfilter/epict/epict.cxx
index 6631bdfc3671..9bf395375689 100644
--- a/filter/source/graphicfilter/epict/epict.cxx
+++ b/filter/source/graphicfilter/epict/epict.cxx
@@ -1699,12 +1699,11 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF )
if ( aSrcFont.GetAlign() != ALIGN_BASELINE )
{
- VirtualDevice aVirDev;
-
+ ScopedVclPtrInstance< VirtualDevice > pVirDev;
if (aSrcFont.GetAlign()==ALIGN_TOP)
- aPt.Y()+=(long)aVirDev.GetFontMetric(aSrcFont).GetAscent();
+ aPt.Y()+=(long)pVirDev->GetFontMetric(aSrcFont).GetAscent();
else
- aPt.Y()-=(long)aVirDev.GetFontMetric(aSrcFont).GetDescent();
+ aPt.Y()-=(long)pVirDev->GetFontMetric(aSrcFont).GetDescent();
}
SetAttrForText();
@@ -1720,12 +1719,12 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF )
if (aSrcFont.GetAlign()!=ALIGN_BASELINE)
{
- VirtualDevice aVirDev;
+ ScopedVclPtrInstance< VirtualDevice > pVirDev;
if (aSrcFont.GetAlign()==ALIGN_TOP)
- aPt.Y()+=(long)aVirDev.GetFontMetric(aSrcFont).GetAscent();
+ aPt.Y()+=(long)pVirDev->GetFontMetric(aSrcFont).GetAscent();
else
- aPt.Y()-=(long)aVirDev.GetFontMetric(aSrcFont).GetDescent();
+ aPt.Y()-=(long)pVirDev->GetFontMetric(aSrcFont).GetDescent();
}
SetAttrForText();
OUString aStr = pA->GetText().copy( pA->GetIndex(),pA->GetLen() );
@@ -1738,16 +1737,16 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF )
const MetaStretchTextAction* pA = static_cast<const MetaStretchTextAction*>(pMA);
Point aPt( pA->GetPoint() );
OUString aStr = pA->GetText().copy( pA->GetIndex(),pA->GetLen() );
- VirtualDevice aVirDev;
+ ScopedVclPtrInstance< VirtualDevice > pVirDev;
boost::scoped_array<long> pDXAry(new long[ aStr.getLength() ]);
- sal_Int32 nNormSize( aVirDev.GetTextArray( aStr,pDXAry.get() ) );
+ sal_Int32 nNormSize( pVirDev->GetTextArray( aStr,pDXAry.get() ) );
if (aSrcFont.GetAlign()!=ALIGN_BASELINE)
{
if (aSrcFont.GetAlign()==ALIGN_TOP)
- aPt.Y()+=(long)aVirDev.GetFontMetric(aSrcFont).GetAscent();
+ aPt.Y()+=(long)pVirDev->GetFontMetric(aSrcFont).GetAscent();
else
- aPt.Y()-=(long)aVirDev.GetFontMetric(aSrcFont).GetDescent();
+ aPt.Y()-=(long)pVirDev->GetFontMetric(aSrcFont).GetDescent();
}
sal_Int32 nLength = aStr.getLength() - 1;
@@ -1774,9 +1773,9 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF )
{
const MetaBmpAction* pA = static_cast<const MetaBmpAction*>(pMA);
const Bitmap aBmp( pA->GetBitmap() );
- VirtualDevice aVirDev;
+ ScopedVclPtrInstance< VirtualDevice > pVirDev;
- WriteOpcode_BitsRect( pA->GetPoint(), aVirDev.PixelToLogic( aBmp.GetSizePixel(), aSrcMapMode ), aBmp );
+ WriteOpcode_BitsRect( pA->GetPoint(), pVirDev->PixelToLogic( aBmp.GetSizePixel(), aSrcMapMode ), aBmp );
}
break;
@@ -1801,9 +1800,9 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF )
{
const MetaBmpExAction* pA = static_cast<const MetaBmpExAction*>(pMA);
const Bitmap aBmp( Graphic( pA->GetBitmapEx() ).GetBitmap() );
- VirtualDevice aVirDev;
+ ScopedVclPtrInstance< VirtualDevice > pVirDev;
- WriteOpcode_BitsRect( pA->GetPoint(), aVirDev.PixelToLogic( aBmp.GetSizePixel(), aSrcMapMode ), aBmp );
+ WriteOpcode_BitsRect( pA->GetPoint(), pVirDev->PixelToLogic( aBmp.GetSizePixel(), aSrcMapMode ), aBmp );
}
break;
@@ -1855,24 +1854,24 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF )
case META_GRADIENT_ACTION:
{
- VirtualDevice aVDev;
+ ScopedVclPtrInstance<VirtualDevice> aVDev;
GDIMetaFile aTmpMtf;
const MetaGradientAction* pA = static_cast<const MetaGradientAction*>(pMA);
- aVDev.SetMapMode( aTargetMapMode );
- aVDev.AddGradientActions( pA->GetRect(), pA->GetGradient(), aTmpMtf );
+ aVDev->SetMapMode( aTargetMapMode );
+ aVDev->AddGradientActions( pA->GetRect(), pA->GetGradient(), aTmpMtf );
WriteOpcodes( aTmpMtf );
}
break;
case META_HATCH_ACTION:
{
- VirtualDevice aVDev;
+ ScopedVclPtrInstance<VirtualDevice> aVDev;
GDIMetaFile aTmpMtf;
const MetaHatchAction* pA = static_cast<const MetaHatchAction*>(pMA);
- aVDev.SetMapMode( aTargetMapMode );
- aVDev.AddHatchActions( pA->GetPolyPolygon(), pA->GetHatch(), aTmpMtf );
+ aVDev->SetMapMode( aTargetMapMode );
+ aVDev->AddHatchActions( pA->GetPolyPolygon(), pA->GetHatch(), aTmpMtf );
WriteOpcodes( aTmpMtf );
}
break;
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index cfe790a290f3..20f6a2f9d1d3 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -116,7 +116,7 @@ private:
SvStream* mpPS;
const GDIMetaFile* pMTF;
GDIMetaFile* pAMTF; // only created if Graphics is not a Metafile
- VirtualDevice aVDev;
+ ScopedVclPtr<VirtualDevice> pVDev;
double nBoundingX1; // this represents the bounding box
double nBoundingY1;
@@ -257,7 +257,7 @@ PSWriter::PSWriter()
, mpPS(NULL)
, pMTF(NULL)
, pAMTF(NULL)
- , aVDev()
+ , pVDev()
, nBoundingX1(0)
, nBoundingY1(0)
, nBoundingX2(0)
@@ -418,14 +418,14 @@ bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Filter
{
Bitmap aBmp( rGraphic.GetBitmap() );
pAMTF = new GDIMetaFile();
- VirtualDevice aTmpVDev;
- pAMTF->Record( &aTmpVDev );
- aTmpVDev.DrawBitmap( Point(), aBmp );
+ ScopedVclPtrInstance< VirtualDevice > pTmpVDev;
+ pAMTF->Record( pTmpVDev );
+ pTmpVDev->DrawBitmap( Point(), aBmp );
pAMTF->Stop();
pAMTF->SetPrefSize( aBmp.GetSizePixel() );
pMTF = pAMTF;
}
- aVDev.SetMapMode( pMTF->GetPrefMapMode() );
+ pVDev->SetMapMode( pMTF->GetPrefMapMode() );
nBoundingX1 = nBoundingY1 = 0;
nBoundingX2 = pMTF->GetPrefSize().Width();
nBoundingY2 = pMTF->GetPrefSize().Height();
@@ -454,7 +454,7 @@ bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Filter
{
ImplWriteProlog( ( mnPreview & EPS_PREVIEW_EPSI ) ? &rGraphic : NULL );
mnCursorPos = 0;
- ImplWriteActions( *pMTF, aVDev );
+ ImplWriteActions( *pMTF, *pVDev.get() );
ImplWriteEpilog();
if ( mnPreview & EPS_PREVIEW_TIFF )
{
@@ -486,8 +486,8 @@ bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Filter
pResMgr = ResMgr::CreateResMgr( "eps", Application::GetSettings().GetUILanguageTag() );
if( pResMgr )
{
- InfoBox aInfoBox( NULL, ResId(KEY_VERSION_CHECK, *pResMgr).toString() );
- aInfoBox.Execute();
+ ScopedVclPtrInstance< InfoBox > aInfoBox( nullptr, ResId(KEY_VERSION_CHECK, *pResMgr).toString() );
+ aInfoBox->Execute();
delete pResMgr;
}
}
@@ -940,12 +940,12 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev )
case META_HATCH_ACTION :
{
- VirtualDevice l_aVDev;
+ ScopedVclPtrInstance< VirtualDevice > l_pVirDev;
GDIMetaFile aTmpMtf;
- l_aVDev.SetMapMode( rVDev.GetMapMode() );
- l_aVDev.AddHatchActions( static_cast<const MetaHatchAction*>(pMA)->GetPolyPolygon(),
- static_cast<const MetaHatchAction*>(pMA)->GetHatch(), aTmpMtf );
+ l_pVirDev->SetMapMode( rVDev.GetMapMode() );
+ l_pVirDev->AddHatchActions( static_cast<const MetaHatchAction*>(pMA)->GetPolyPolygon(),
+ static_cast<const MetaHatchAction*>(pMA)->GetHatch(), aTmpMtf );
ImplWriteActions( aTmpMtf, rVDev );
}
break;
@@ -1608,10 +1608,10 @@ void PSWriter::ImplIntersect( const tools::PolyPolygon& rPolyPoly )
void PSWriter::ImplWriteGradient( const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient, VirtualDevice& rVDev )
{
- VirtualDevice l_aVDev;
+ ScopedVclPtrInstance< VirtualDevice > l_pVDev;
GDIMetaFile aTmpMtf;
- l_aVDev.SetMapMode( rVDev.GetMapMode() );
- l_aVDev.AddGradientActions( rPolyPoly.GetBoundRect(), rGradient, aTmpMtf );
+ l_pVDev->SetMapMode( rVDev.GetMapMode() );
+ l_pVDev->AddGradientActions( rPolyPoly.GetBoundRect(), rGradient, aTmpMtf );
ImplWriteActions( aTmpMtf, rVDev );
}
@@ -2141,10 +2141,10 @@ void PSWriter::ImplText( const OUString& rUniString, const Point& rPos, const lo
vcl::Font aNotRotatedFont( maFont );
aNotRotatedFont.SetOrientation( 0 );
- VirtualDevice aVirDev( 1 );
- aVirDev.SetMapMode( rVDev.GetMapMode() );
- aVirDev.SetFont( aNotRotatedFont );
- aVirDev.SetTextAlign( eTextAlign );
+ ScopedVclPtrInstance< VirtualDevice > pVirDev( 1 );
+ pVirDev->SetMapMode( rVDev.GetMapMode() );
+ pVirDev->SetFont( aNotRotatedFont );
+ pVirDev->SetTextAlign( eTextAlign );
sal_Int16 nRotation = maFont.GetOrientation();
Polygon aPolyDummy( 1 );
@@ -2159,7 +2159,7 @@ void PSWriter::ImplText( const OUString& rUniString, const Point& rPos, const lo
bool bOldLineColor = bLineColor;
bLineColor = false;
std::vector<tools::PolyPolygon> aPolyPolyVec;
- if ( aVirDev.GetTextOutlines( aPolyPolyVec, rUniString, 0, 0, -1, true, nWidth, pDXArry ) )
+ if ( pVirDev->GetTextOutlines( aPolyPolyVec, rUniString, 0, 0, -1, true, nWidth, pDXArry ) )
{
// always adjust text position to match baseline alignment
ImplWriteLine( "pum" );
diff --git a/filter/source/graphicfilter/icgm/cgm.cxx b/filter/source/graphicfilter/icgm/cgm.cxx
index 55a6158e8b46..30c8c474f7ee 100644
--- a/filter/source/graphicfilter/icgm/cgm.cxx
+++ b/filter/source/graphicfilter/icgm/cgm.cxx
@@ -80,7 +80,7 @@ CGM::~CGM()
mpGDIMetaFile->Stop();
mpGDIMetaFile->SetPrefMapMode( MapMode() );
mpGDIMetaFile->SetPrefSize( Size( static_cast< long >( mnOutdx ), static_cast< long >( mnOutdy ) ) );
- delete mpVirDev;
+ mpVirDev.disposeAndClear();
*mpGraphic = Graphic( *mpGDIMetaFile );
}
for( size_t i = 0, n = maDefRepList.size(); i < n; ++i )
diff --git a/filter/source/graphicfilter/icgm/cgm.hxx b/filter/source/graphicfilter/icgm/cgm.hxx
index 1ee13eaf9a6b..f9e6fa455325 100644
--- a/filter/source/graphicfilter/icgm/cgm.hxx
+++ b/filter/source/graphicfilter/icgm/cgm.hxx
@@ -28,6 +28,7 @@
#include <rtl/ustring.hxx>
#include <vector>
+#include <vcl/vclptr.hxx>
#include "cgmtypes.hxx"
class Graphic;
@@ -138,7 +139,7 @@ class CGM
~CGM();
CGM( sal_uInt32 nMode, ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > const & rModel );
- VirtualDevice* mpVirDev;
+ VclPtr<VirtualDevice> mpVirDev;
GDIMetaFile* mpGDIMetaFile;
sal_uInt32 GetBackGroundColor();
bool IsValid() const { return mbStatus; };
diff --git a/filter/source/graphicfilter/idxf/dxf2mtf.cxx b/filter/source/graphicfilter/idxf/dxf2mtf.cxx
index bacd08189425..ffca879871cb 100644
--- a/filter/source/graphicfilter/idxf/dxf2mtf.cxx
+++ b/filter/source/graphicfilter/idxf/dxf2mtf.cxx
@@ -885,7 +885,7 @@ bool DXF2GDIMetaFile::Convert(const DXFRepresentation & rDXF, GDIMetaFile & rMTF
rMTF.SetPrefMapMode( MapMode( MAP_100TH_MM ) );
}
- delete pVirDev;
+ pVirDev.disposeAndClear();
return bStatus;
}
diff --git a/filter/source/graphicfilter/idxf/dxf2mtf.hxx b/filter/source/graphicfilter/idxf/dxf2mtf.hxx
index 3adc4eee9aff..e88fcc3c9f27 100644
--- a/filter/source/graphicfilter/idxf/dxf2mtf.hxx
+++ b/filter/source/graphicfilter/idxf/dxf2mtf.hxx
@@ -34,7 +34,7 @@ enum BrushStyle { BRUSH_NULL, BRUSH_SOLID, BRUSH_HORZ, BRUSH_VERT,
class DXF2GDIMetaFile {
private:
- VirtualDevice * pVirDev;
+ VclPtr<VirtualDevice> pVirDev;
const DXFRepresentation * pDXF;
bool bStatus;
diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx
index b933574f4ed8..503606dd4977 100644
--- a/filter/source/graphicfilter/ieps/ieps.cxx
+++ b/filter/source/graphicfilter/ieps/ieps.cxx
@@ -125,7 +125,7 @@ static int ImplGetLen( sal_uInt8* pBuf, int nMax )
static void MakeAsMeta(Graphic &rGraphic)
{
- VirtualDevice aVDev;
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
GDIMetaFile aMtf;
Bitmap aBmp( rGraphic.GetBitmap() );
Size aSize = aBmp.GetPrefSize();
@@ -137,9 +137,9 @@ static void MakeAsMeta(Graphic &rGraphic)
aSize = OutputDevice::LogicToLogic( aSize,
aBmp.GetPrefMapMode(), MAP_100TH_MM );
- aVDev.EnableOutput( false );
- aMtf.Record( &aVDev );
- aVDev.DrawBitmap( Point(), aSize, rGraphic.GetBitmap() );
+ pVDev->EnableOutput( false );
+ aMtf.Record( pVDev );
+ pVDev->DrawBitmap( Point(), aSize, rGraphic.GetBitmap() );
aMtf.Stop();
aMtf.WindStart();
aMtf.SetPrefMapMode( MAP_100TH_MM );
@@ -442,22 +442,22 @@ void MakePreview(sal_uInt8* pBuf, sal_uInt32 nBytesRead,
long nWidth, long nHeight, Graphic &rGraphic)
{
GDIMetaFile aMtf;
- VirtualDevice aVDev;
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
vcl::Font aFont;
- aVDev.EnableOutput( false );
- aMtf.Record( &aVDev );
- aVDev.SetLineColor( Color( COL_RED ) );
- aVDev.SetFillColor();
+ pVDev->EnableOutput( false );
+ aMtf.Record( pVDev );
+ pVDev->SetLineColor( Color( COL_RED ) );
+ pVDev->SetFillColor();
aFont.SetColor( COL_LIGHTRED );
// aFont.SetSize( Size( 0, 32 ) );
- aVDev.Push( PushFlags::FONT );
- aVDev.SetFont( aFont );
+ pVDev->Push( PushFlags::FONT );
+ pVDev->SetFont( aFont );
Rectangle aRect( Point( 1, 1 ), Size( nWidth - 2, nHeight - 2 ) );
- aVDev.DrawRect( aRect );
+ pVDev->DrawRect( aRect );
OUString aString;
int nLen;
@@ -511,8 +511,8 @@ void MakePreview(sal_uInt8* pBuf, sal_uInt32 nBytesRead,
aString += " LanguageLevel:" + OUString::number( nNumber );
}
}
- aVDev.DrawText( aRect, aString, TEXT_DRAW_CLIP | TEXT_DRAW_MULTILINE );
- aVDev.Pop();
+ pVDev->DrawText( aRect, aString, TEXT_DRAW_CLIP | TEXT_DRAW_MULTILINE );
+ pVDev->Pop();
aMtf.Stop();
aMtf.WindStart();
aMtf.SetPrefMapMode( MAP_POINT );
@@ -679,17 +679,17 @@ GraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* )
}
if ( bIsValid )
{
- VirtualDevice aVDev;
+ ScopedVclPtrInstance<VirtualDevice> pVDev;
GDIMetaFile aMtf;
Size aSize;
- aVDev.EnableOutput( false );
- aMtf.Record( &aVDev );
+ pVDev->EnableOutput( false );
+ aMtf.Record( pVDev );
aSize = aBitmap.GetPrefSize();
if( !aSize.Width() || !aSize.Height() )
aSize = Application::GetDefaultDevice()->PixelToLogic( aBitmap.GetSizePixel(), MAP_100TH_MM );
else
aSize = OutputDevice::LogicToLogic( aSize, aBitmap.GetPrefMapMode(), MAP_100TH_MM );
- aVDev.DrawBitmap( Point(), aSize, aBitmap );
+ pVDev->DrawBitmap( Point(), aSize, aBitmap );
aMtf.Stop();
aMtf.WindStart();
aMtf.SetPrefMapMode( MAP_100TH_MM );
diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx
index 435a6e164597..7b024ae84eb3 100644
--- a/filter/source/graphicfilter/ios2met/ios2met.cxx
+++ b/filter/source/graphicfilter/ios2met/ios2met.cxx
@@ -345,7 +345,7 @@ private:
long ErrorCode;
SvStream * pOS2MET; // the OS2MET file to be read
- VirtualDevice * pVirDev; // here the drawing methods are being called
+ VclPtr<VirtualDevice> pVirDev; // here the drawing methods are being called
// While doing this a recording in the GDIMetaFile
// will take place.
sal_uLong nOrigPos; // initial position in pOS2MET
@@ -2601,7 +2601,7 @@ void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaF
pOrdFile=NULL;
- pVirDev = new VirtualDevice();
+ pVirDev = VclPtr<VirtualDevice>::Create();
pVirDev->EnableOutput(false);
rGDIMetaFile.Record(pVirDev);
@@ -2657,7 +2657,7 @@ void OS2METReader::ReadOS2MET( SvStream & rStreamOS2MET, GDIMetaFile & rGDIMetaF
}
rGDIMetaFile.Stop();
- delete pVirDev;
+ pVirDev.disposeAndClear();
rGDIMetaFile.SetPrefMapMode( aGlobMapMode );
diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx
index badebaf82c3a..6621eddd3c60 100644
--- a/filter/source/graphicfilter/ipict/ipict.cxx
+++ b/filter/source/graphicfilter/ipict/ipict.cxx
@@ -146,7 +146,7 @@ class PictReader {
private:
SvStream * pPict; // The Pict file to read.
- VirtualDevice * pVirDev; // Here the drawing methos will be called.
+ VclPtr<VirtualDevice> pVirDev; // Here the drawing methos will be called.
// A recording into the GDIMetaFile will take place.
sal_uLong nOrigPos; // Initial position in pPict.
@@ -1881,7 +1881,7 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile )
aHRes = aVRes = Fraction( 1, 1 );
- pVirDev = new VirtualDevice();
+ pVirDev = VclPtr<VirtualDevice>::Create();
pVirDev->EnableOutput(false);
rGDIMetaFile.Record(pVirDev);
@@ -1942,7 +1942,7 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile )
pVirDev->SetClipRegion();
rGDIMetaFile.Stop();
- delete pVirDev;
+ pVirDev.disposeAndClear();
rGDIMetaFile.SetPrefMapMode( MapMode( MAP_INCH, Point(), aHRes, aVRes ) );
rGDIMetaFile.SetPrefSize( aBoundingRect.GetSize() );
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index c7444bfceb1e..dc1e3705d72e 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -1387,18 +1387,18 @@ GraphicObject lclDrawHatch( const ::com::sun::star::drawing::Hatch& rHatch, cons
// do not create a bitmap in page size, that would explode file sizes (and have no good quality).
// Better use a MetaFile graphic in page size; thus we have good quality due to vector format and
// no bit file sizes.
- VirtualDevice aOut;
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
GDIMetaFile aMtf;
- aOut.SetOutputSizePixel(Size(2, 2));
- aOut.EnableOutput(false);
- aOut.SetMapMode(MapMode(MAP_100TH_MM));
+ pVDev->SetOutputSizePixel(Size(2, 2));
+ pVDev->EnableOutput(false);
+ pVDev->SetMapMode(MapMode(MAP_100TH_MM));
aMtf.Clear();
- aMtf.Record(&aOut);
- aOut.SetLineColor();
- aOut.SetFillColor(bFillBackground ? rBackColor : Color(COL_TRANSPARENT));
- aOut.DrawRect(rRect);
- aOut.DrawHatch(tools::PolyPolygon(rRect), Hatch((HatchStyle)rHatch.Style, Color(rHatch.Color), rHatch.Distance, (sal_uInt16)rHatch.Angle));
+ aMtf.Record(pVDev);
+ pVDev->SetLineColor();
+ pVDev->SetFillColor(bFillBackground ? rBackColor : Color(COL_TRANSPARENT));
+ pVDev->DrawRect(rRect);
+ pVDev->DrawHatch(tools::PolyPolygon(rRect), Hatch((HatchStyle)rHatch.Style, Color(rHatch.Color), rHatch.Distance, (sal_uInt16)rHatch.Angle));
aMtf.Stop();
aMtf.WindStart();
aMtf.SetPrefMapMode(MapMode(MAP_100TH_MM));
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 0dce7915648e..6dfba0986eee 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -4397,8 +4397,8 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
rOutliner.SetStyleSheetPool( static_cast<SfxStyleSheetPool*>(pModel->GetStyleSheetPool()) );
rOutliner.SetUpdateMode( false );
rOutliner.SetText( *pParaObj );
- VirtualDevice aVirDev( 1 );
- aVirDev.SetMapMode( MAP_100TH_MM );
+ ScopedVclPtrInstance< VirtualDevice > pVirDev( 1 );
+ pVirDev->SetMapMode( MAP_100TH_MM );
sal_Int32 i, nParagraphs = rOutliner.GetParagraphCount();
if ( nParagraphs )
{
@@ -4406,7 +4406,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
for ( i = 0; i < nParagraphs; i++ )
{
OUString aString(rOutliner.GetText(rOutliner.GetParagraph(i)));
- bool bIsRTL = aVirDev.GetTextIsRTL(aString, 0, aString.getLength());
+ bool bIsRTL = pVirDev->GetTextIsRTL(aString, 0, aString.getLength());
if ( bIsRTL )
{
SfxItemSet aSet2( rOutliner.GetParaAttribs( i ) );
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 9851aa811a7c..af2e7e7c8a73 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -312,6 +312,11 @@ IMPL_LINK_NOARG(ImpPDFTabDialog, CancelHdl)
ImpPDFTabDialog::~ImpPDFTabDialog()
{
+ disposeOnce();
+}
+
+void ImpPDFTabDialog::dispose()
+{
//delete the pages, needed because otherwise the child tab pages
//don't get destroyed
RemoveTabPage(mnGeneralPageId);
@@ -320,6 +325,7 @@ ImpPDFTabDialog::~ImpPDFTabDialog()
RemoveTabPage(mnLinksPage);
RemoveTabPage(mnSecurityPageId);
RemoveTabPage(mnSigningPageId);
+ SfxTabDialog::dispose();
}
@@ -546,10 +552,42 @@ ImpPDFTabGeneralPage::ImpPDFTabGeneralPage(vcl::Window* pParent, const SfxItemSe
ImpPDFTabGeneralPage::~ImpPDFTabGeneralPage()
{
+ disposeOnce();
}
+void ImpPDFTabGeneralPage::dispose()
+{
+ mpRbAll.clear();
+ mpRbRange.clear();
+ mpRbSelection.clear();
+ mpEdPages.clear();
+ mpRbLosslessCompression.clear();
+ mpRbJPEGCompression.clear();
+ mpQualityFrame.clear();
+ mpNfQuality.clear();
+ mpCbReduceImageResolution.clear();
+ mpCoReduceImageResolution.clear();
+ mpCbPDFA1b.clear();
+ mpCbTaggedPDF.clear();
+ mpCbExportFormFields.clear();
+ mpFormsFrame.clear();
+ mpLbFormsFormat.clear();
+ mpCbAllowDuplicateFieldNames.clear();
+ mpCbExportBookmarks.clear();
+ mpCbExportHiddenSlides.clear();
+ mpCbExportNotes.clear();
+ mpCbViewPDF.clear();
+ mpCbExportNotesPages.clear();
+ mpCbExportEmptyPages.clear();
+ mpCbAddStream.clear();
+ mpCbWatermark.clear();
+ mpFtWatermark.clear();
+ mpEdWatermark.clear();
+ mpaParent.clear();
+ SfxTabPage::dispose();
+}
-void ImpPDFTabGeneralPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent )
+void ImpPDFTabGeneralPage::SetFilterConfigItem( ImpPDFTabDialog* paParent )
{
mpaParent = paParent;
@@ -696,10 +734,10 @@ void ImpPDFTabGeneralPage::GetFilterConfigItem( ImpPDFTabDialog* paParent )
}
-SfxTabPage* ImpPDFTabGeneralPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet)
+VclPtr<SfxTabPage> ImpPDFTabGeneralPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet)
{
- return ( new ImpPDFTabGeneralPage( pParent, *rAttrSet ) );
+ return VclPtr<ImpPDFTabGeneralPage>::Create( pParent, *rAttrSet );
}
@@ -806,8 +844,8 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, ToggleExportPDFAHdl)
// if a password was set, inform the user that this will not be used in PDF/A case
if( mpCbPDFA1b->IsChecked() && pSecPage && pSecPage->hasPassword() )
{
- MessageDialog aBox(this, PDFFilterResId(STR_WARN_PASSWORD_PDFA), VCL_MESSAGE_WARNING);
- aBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aBox(this, PDFFilterResId(STR_WARN_PASSWORD_PDFA), VCL_MESSAGE_WARNING);
+ aBox->Execute();
}
return 0;
@@ -844,13 +882,33 @@ ImpPDFTabOpnFtrPage::ImpPDFTabOpnFtrPage(vcl::Window* pParent, const SfxItemSet&
ImpPDFTabOpnFtrPage::~ImpPDFTabOpnFtrPage()
{
+ disposeOnce();
}
+void ImpPDFTabOpnFtrPage::dispose()
+{
+ mpRbOpnPageOnly.clear();
+ mpRbOpnOutline.clear();
+ mpRbOpnThumbs.clear();
+ mpNumInitialPage.clear();
+ mpRbMagnDefault.clear();
+ mpRbMagnFitWin.clear();
+ mpRbMagnFitWidth.clear();
+ mpRbMagnFitVisible.clear();
+ mpRbMagnZoom.clear();
+ mpNumZoom.clear();
+ mpRbPgLyDefault.clear();
+ mpRbPgLySinglePage.clear();
+ mpRbPgLyContinue.clear();
+ mpRbPgLyContinueFacing.clear();
+ mpCbPgLyFirstOnLeft.clear();
+ SfxTabPage::dispose();
+}
-SfxTabPage* ImpPDFTabOpnFtrPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet)
+VclPtr<SfxTabPage> ImpPDFTabOpnFtrPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet)
{
- return ( new ImpPDFTabOpnFtrPage( pParent, *rAttrSet ) );
+ return VclPtr<ImpPDFTabOpnFtrPage>::Create( pParent, *rAttrSet );
}
@@ -999,6 +1057,23 @@ ImpPDFTabViewerPage::ImpPDFTabViewerPage( vcl::Window* pParent,
ImpPDFTabViewerPage::~ImpPDFTabViewerPage()
{
+ disposeOnce();
+}
+
+void ImpPDFTabViewerPage::dispose()
+{
+ m_pCbResWinInit.clear();
+ m_pCbCenterWindow.clear();
+ m_pCbOpenFullScreen.clear();
+ m_pCbDispDocTitle.clear();
+ m_pCbHideViewerMenubar.clear();
+ m_pCbHideViewerToolbar.clear();
+ m_pCbHideViewerWindowControls.clear();
+ m_pCbTransitionEffects.clear();
+ m_pRbAllBookmarkLevels.clear();
+ m_pRbVisibleBookmarkLevels.clear();
+ m_pNumBookmarkLevels.clear();
+ SfxTabPage::dispose();
}
IMPL_LINK( ImpPDFTabViewerPage, ToggleRbBookmarksHdl, void*, )
@@ -1007,10 +1082,10 @@ IMPL_LINK( ImpPDFTabViewerPage, ToggleRbBookmarksHdl, void*, )
return 0;
}
-SfxTabPage* ImpPDFTabViewerPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet)
+VclPtr<SfxTabPage> ImpPDFTabViewerPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet)
{
- return ( new ImpPDFTabViewerPage( pParent, *rAttrSet ) );
+ return VclPtr<ImpPDFTabViewerPage>::Create( pParent, *rAttrSet );
}
@@ -1096,13 +1171,38 @@ ImpPDFTabSecurityPage::ImpPDFTabSecurityPage(vcl::Window* i_pParent, const SfxIt
ImpPDFTabSecurityPage::~ImpPDFTabSecurityPage()
{
+ disposeOnce();
}
+void ImpPDFTabSecurityPage::dispose()
+{
+ mpPbSetPwd.clear();
+ mpUserPwdSet.clear();
+ mpUserPwdUnset.clear();
+ mpUserPwdPdfa.clear();
+ mpOwnerPwdSet.clear();
+ mpOwnerPwdUnset.clear();
+ mpOwnerPwdPdfa.clear();
+ mpPrintPermissions.clear();
+ mpRbPrintNone.clear();
+ mpRbPrintLowRes.clear();
+ mpRbPrintHighRes.clear();
+ mpChangesAllowed.clear();
+ mpRbChangesNone.clear();
+ mpRbChangesInsDel.clear();
+ mpRbChangesFillForm.clear();
+ mpRbChangesComment.clear();
+ mpRbChangesAnyNoCopy.clear();
+ mpContent.clear();
+ mpCbEnableCopy.clear();
+ mpCbEnableAccessibility.clear();
+ SfxTabPage::dispose();
+}
-SfxTabPage* ImpPDFTabSecurityPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet)
+VclPtr<SfxTabPage> ImpPDFTabSecurityPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet)
{
- return ( new ImpPDFTabSecurityPage( pParent, *rAttrSet ) );
+ return VclPtr<ImpPDFTabSecurityPage>::Create( pParent, *rAttrSet );
}
@@ -1191,17 +1291,17 @@ void ImpPDFTabSecurityPage::SetFilterConfigItem( const ImpPDFTabDialog* paParen
IMPL_LINK_NOARG(ImpPDFTabSecurityPage, ClickmaPbSetPwdHdl)
{
- SfxPasswordDialog aPwdDialog( this, &msUserPwdTitle );
- aPwdDialog.SetMinLen( 0 );
- aPwdDialog.ShowMinLengthText(false);
- aPwdDialog.ShowExtras( SfxShowExtras::CONFIRM | SfxShowExtras::PASSWORD2 | SfxShowExtras::CONFIRM2 );
- aPwdDialog.SetText(msStrSetPwd);
- aPwdDialog.SetGroup2Text(msOwnerPwdTitle);
- aPwdDialog.AllowAsciiOnly();
- if( aPwdDialog.Execute() == RET_OK ) //OK issued get password and set it
+ ScopedVclPtrInstance< SfxPasswordDialog > aPwdDialog( this, &msUserPwdTitle );
+ aPwdDialog->SetMinLen( 0 );
+ aPwdDialog->ShowMinLengthText(false);
+ aPwdDialog->ShowExtras( SfxShowExtras::CONFIRM | SfxShowExtras::PASSWORD2 | SfxShowExtras::CONFIRM2 );
+ aPwdDialog->SetText(msStrSetPwd);
+ aPwdDialog->SetGroup2Text(msOwnerPwdTitle);
+ aPwdDialog->AllowAsciiOnly();
+ if( aPwdDialog->Execute() == RET_OK ) //OK issued get password and set it
{
- OUString aUserPW( aPwdDialog.GetPassword() );
- OUString aOwnerPW( aPwdDialog.GetPassword2() );
+ OUString aUserPW( aPwdDialog->GetPassword() );
+ OUString aOwnerPW( aPwdDialog->GetPassword2() );
mbHaveUserPassword = !aUserPW.isEmpty();
mbHaveOwnerPassword = !aOwnerPW.isEmpty();
@@ -1317,13 +1417,24 @@ ImpPDFTabLinksPage::ImpPDFTabLinksPage( vcl::Window* pParent,
ImpPDFTabLinksPage::~ImpPDFTabLinksPage()
{
+ disposeOnce();
}
+void ImpPDFTabLinksPage::dispose()
+{
+ m_pCbExprtBmkrToNmDst.clear();
+ m_pCbOOoToPDFTargets.clear();
+ m_pCbExportRelativeFsysLinks.clear();
+ m_pRbOpnLnksDefault.clear();
+ m_pRbOpnLnksLaunch.clear();
+ m_pRbOpnLnksBrowser.clear();
+ SfxTabPage::dispose();
+}
-SfxTabPage* ImpPDFTabLinksPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet)
+VclPtr<SfxTabPage> ImpPDFTabLinksPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet)
{
- return ( new ImpPDFTabLinksPage( pParent, *rAttrSet ) );
+ return VclPtr<ImpPDFTabLinksPage>::Create( pParent, *rAttrSet );
}
@@ -1511,9 +1622,17 @@ ImplErrorDialog::ImplErrorDialog(const std::set< vcl::PDFWriter::ErrorCode >& rE
ImplErrorDialog::~ImplErrorDialog()
{
+ disposeOnce();
+}
+
+void ImplErrorDialog::dispose()
+{
// free strings again
for( sal_uInt16 n = 0; n < m_pErrors->GetEntryCount(); n++ )
delete static_cast<OUString*>(m_pErrors->GetEntryData( n ));
+ m_pErrors.clear();
+ m_pExplanation.clear();
+ MessageDialog::dispose();
}
IMPL_LINK_NOARG(ImplErrorDialog, SelectHdl)
@@ -1548,6 +1667,19 @@ ImpPDFTabSigningPage::ImpPDFTabSigningPage(vcl::Window* pParent, const SfxItemSe
ImpPDFTabSigningPage::~ImpPDFTabSigningPage()
{
+ disposeOnce();
+}
+
+void ImpPDFTabSigningPage::dispose()
+{
+ mpEdSignCert.clear();
+ mpPbSignCertSelect.clear();
+ mpPbSignCertClear.clear();
+ mpEdSignPassword.clear();
+ mpEdSignLocation.clear();
+ mpEdSignContactInfo.clear();
+ mpEdSignReason.clear();
+ SfxTabPage::dispose();
}
IMPL_LINK_NOARG( ImpPDFTabSigningPage, ClickmaPbSignCertSelect )
@@ -1610,10 +1742,10 @@ IMPL_LINK_NOARG( ImpPDFTabSigningPage, SelectLBSignTSA )
return 0;
}
-SfxTabPage* ImpPDFTabSigningPage::Create( vcl::Window* pParent,
- const SfxItemSet* rAttrSet)
+VclPtr<SfxTabPage> ImpPDFTabSigningPage::Create( vcl::Window* pParent,
+ const SfxItemSet* rAttrSet)
{
- return ( new ImpPDFTabSigningPage( pParent, *rAttrSet ) );
+ return VclPtr<ImpPDFTabSigningPage>::Create( pParent, *rAttrSet );
}
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index dc4a78789ce3..dc2f9d35d0fa 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -56,13 +56,14 @@ public:
class ImplErrorDialog : public MessageDialog
{
- ListBox* m_pErrors;
- FixedText* m_pExplanation;
+ VclPtr<ListBox> m_pErrors;
+ VclPtr<FixedText> m_pExplanation;
DECL_LINK(SelectHdl, void *);
public:
ImplErrorDialog( const std::set< vcl::PDFWriter::ErrorCode >& );
virtual ~ImplErrorDialog();
+ virtual void dispose() SAL_OVERRIDE;
};
class ImpPDFTabSecurityPage;
@@ -171,6 +172,7 @@ public:
const css::uno::Reference< XComponent >& rDoc
);
virtual ~ImpPDFTabDialog();
+ virtual void dispose() SAL_OVERRIDE;
Sequence< PropertyValue > GetFilterData();
@@ -189,45 +191,45 @@ class ImpPDFTabGeneralPage : public SfxTabPage
{
friend class ImpPDFTabLinksPage;
- RadioButton* mpRbAll;
- RadioButton* mpRbRange;
- RadioButton* mpRbSelection;
- Edit* mpEdPages;
+ VclPtr<RadioButton> mpRbAll;
+ VclPtr<RadioButton> mpRbRange;
+ VclPtr<RadioButton> mpRbSelection;
+ VclPtr<Edit> mpEdPages;
- RadioButton* mpRbLosslessCompression;
- RadioButton* mpRbJPEGCompression;
- VclContainer* mpQualityFrame;
- MetricField* mpNfQuality;
- CheckBox* mpCbReduceImageResolution;
- ComboBox* mpCoReduceImageResolution;
+ VclPtr<RadioButton> mpRbLosslessCompression;
+ VclPtr<RadioButton> mpRbJPEGCompression;
+ VclPtr<VclContainer> mpQualityFrame;
+ VclPtr<MetricField> mpNfQuality;
+ VclPtr<CheckBox> mpCbReduceImageResolution;
+ VclPtr<ComboBox> mpCoReduceImageResolution;
- CheckBox* mpCbPDFA1b;
- CheckBox* mpCbTaggedPDF;
+ VclPtr<CheckBox> mpCbPDFA1b;
+ VclPtr<CheckBox> mpCbTaggedPDF;
bool mbTaggedPDFUserSelection;
- CheckBox* mpCbExportFormFields;
+ VclPtr<CheckBox> mpCbExportFormFields;
bool mbExportFormFieldsUserSelection;
- VclContainer* mpFormsFrame;
- ListBox* mpLbFormsFormat;
- CheckBox* mpCbAllowDuplicateFieldNames;
+ VclPtr<VclContainer> mpFormsFrame;
+ VclPtr<ListBox> mpLbFormsFormat;
+ VclPtr<CheckBox> mpCbAllowDuplicateFieldNames;
- CheckBox* mpCbExportBookmarks;
- CheckBox* mpCbExportHiddenSlides;
- CheckBox* mpCbExportNotes;
- CheckBox* mpCbViewPDF;
- CheckBox* mpCbExportNotesPages;
+ VclPtr<CheckBox> mpCbExportBookmarks;
+ VclPtr<CheckBox> mpCbExportHiddenSlides;
+ VclPtr<CheckBox> mpCbExportNotes;
+ VclPtr<CheckBox> mpCbViewPDF;
+ VclPtr<CheckBox> mpCbExportNotesPages;
- CheckBox* mpCbExportEmptyPages;
- CheckBox* mpCbAddStream;
+ VclPtr<CheckBox> mpCbExportEmptyPages;
+ VclPtr<CheckBox> mpCbAddStream;
- CheckBox* mpCbWatermark;
- FixedText* mpFtWatermark;
- Edit* mpEdWatermark;
+ VclPtr<CheckBox> mpCbWatermark;
+ VclPtr<FixedText> mpFtWatermark;
+ VclPtr<Edit> mpEdWatermark;
bool mbIsPresentation;
bool mbIsWriter;
- const ImpPDFTabDialog* mpaParent;
+ VclPtr<ImpPDFTabDialog> mpaParent;
DECL_LINK( TogglePagesHdl, void* );
DECL_LINK( ToggleCompressionHdl, void* );
@@ -241,36 +243,37 @@ public:
ImpPDFTabGeneralPage( vcl::Window* pParent,
const SfxItemSet& rSet );
-
virtual ~ImpPDFTabGeneralPage();
- static SfxTabPage* Create( vcl::Window* pParent,
+ virtual void dispose() SAL_OVERRIDE;
+
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet);
void GetFilterConfigItem(ImpPDFTabDialog* paParent);
- void SetFilterConfigItem(const ImpPDFTabDialog* paParent);
+ void SetFilterConfigItem(ImpPDFTabDialog* paParent);
bool IsPdfaSelected() const { return mpCbPDFA1b->IsChecked(); }
};
//class tab page viewer
class ImpPDFTabOpnFtrPage : public SfxTabPage
{
- RadioButton* mpRbOpnPageOnly;
- RadioButton* mpRbOpnOutline;
- RadioButton* mpRbOpnThumbs;
- NumericField* mpNumInitialPage;
-
- RadioButton* mpRbMagnDefault;
- RadioButton* mpRbMagnFitWin;
- RadioButton* mpRbMagnFitWidth;
- RadioButton* mpRbMagnFitVisible;
- RadioButton* mpRbMagnZoom;
- NumericField* mpNumZoom;
-
- RadioButton* mpRbPgLyDefault;
- RadioButton* mpRbPgLySinglePage;
- RadioButton* mpRbPgLyContinue;
- RadioButton* mpRbPgLyContinueFacing;
- CheckBox* mpCbPgLyFirstOnLeft;
+ VclPtr<RadioButton> mpRbOpnPageOnly;
+ VclPtr<RadioButton> mpRbOpnOutline;
+ VclPtr<RadioButton> mpRbOpnThumbs;
+ VclPtr<NumericField> mpNumInitialPage;
+
+ VclPtr<RadioButton> mpRbMagnDefault;
+ VclPtr<RadioButton> mpRbMagnFitWin;
+ VclPtr<RadioButton> mpRbMagnFitWidth;
+ VclPtr<RadioButton> mpRbMagnFitVisible;
+ VclPtr<RadioButton> mpRbMagnZoom;
+ VclPtr<NumericField> mpNumZoom;
+
+ VclPtr<RadioButton> mpRbPgLyDefault;
+ VclPtr<RadioButton> mpRbPgLySinglePage;
+ VclPtr<RadioButton> mpRbPgLyContinue;
+ VclPtr<RadioButton> mpRbPgLyContinueFacing;
+ VclPtr<CheckBox> mpCbPgLyFirstOnLeft;
bool mbUseCTLFont;
@@ -282,7 +285,8 @@ public:
const SfxItemSet& rSet );
virtual ~ImpPDFTabOpnFtrPage();
- static SfxTabPage* Create( vcl::Window* pParent,
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet );
void GetFilterConfigItem( ImpPDFTabDialog* paParent);
@@ -292,22 +296,22 @@ public:
//class tab page viewer
class ImpPDFTabViewerPage : public SfxTabPage
{
- CheckBox* m_pCbResWinInit;
- CheckBox* m_pCbCenterWindow;
- CheckBox* m_pCbOpenFullScreen;
- CheckBox* m_pCbDispDocTitle;
+ VclPtr<CheckBox> m_pCbResWinInit;
+ VclPtr<CheckBox> m_pCbCenterWindow;
+ VclPtr<CheckBox> m_pCbOpenFullScreen;
+ VclPtr<CheckBox> m_pCbDispDocTitle;
- CheckBox* m_pCbHideViewerMenubar;
- CheckBox* m_pCbHideViewerToolbar;
- CheckBox* m_pCbHideViewerWindowControls;
+ VclPtr<CheckBox> m_pCbHideViewerMenubar;
+ VclPtr<CheckBox> m_pCbHideViewerToolbar;
+ VclPtr<CheckBox> m_pCbHideViewerWindowControls;
- CheckBox* m_pCbTransitionEffects;
+ VclPtr<CheckBox> m_pCbTransitionEffects;
bool mbIsPresentation;
- RadioButton* m_pRbAllBookmarkLevels;
- RadioButton* m_pRbVisibleBookmarkLevels;
- NumericField* m_pNumBookmarkLevels;
+ VclPtr<RadioButton> m_pRbAllBookmarkLevels;
+ VclPtr<RadioButton> m_pRbVisibleBookmarkLevels;
+ VclPtr<NumericField> m_pNumBookmarkLevels;
DECL_LINK( ToggleRbBookmarksHdl, void* );
public:
@@ -315,7 +319,8 @@ public:
const SfxItemSet& rSet );
virtual ~ImpPDFTabViewerPage();
- static SfxTabPage* Create( vcl::Window* pParent,
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet );
void GetFilterConfigItem( ImpPDFTabDialog* paParent);
@@ -325,32 +330,32 @@ public:
//class security tab page
class ImpPDFTabSecurityPage : public SfxTabPage
{
- PushButton* mpPbSetPwd;
+ VclPtr<PushButton> mpPbSetPwd;
OUString msStrSetPwd;
- VclContainer* mpUserPwdSet;
- VclContainer* mpUserPwdUnset;
- VclContainer* mpUserPwdPdfa;
+ VclPtr<VclContainer> mpUserPwdSet;
+ VclPtr<VclContainer> mpUserPwdUnset;
+ VclPtr<VclContainer> mpUserPwdPdfa;
- VclContainer* mpOwnerPwdSet;
- VclContainer* mpOwnerPwdUnset;
- VclContainer* mpOwnerPwdPdfa;
+ VclPtr<VclContainer> mpOwnerPwdSet;
+ VclPtr<VclContainer> mpOwnerPwdUnset;
+ VclPtr<VclContainer> mpOwnerPwdPdfa;
- VclContainer* mpPrintPermissions;
- RadioButton* mpRbPrintNone;
- RadioButton* mpRbPrintLowRes;
- RadioButton* mpRbPrintHighRes;
+ VclPtr<VclContainer> mpPrintPermissions;
+ VclPtr<RadioButton> mpRbPrintNone;
+ VclPtr<RadioButton> mpRbPrintLowRes;
+ VclPtr<RadioButton> mpRbPrintHighRes;
- VclContainer* mpChangesAllowed;
- RadioButton* mpRbChangesNone;
- RadioButton* mpRbChangesInsDel;
- RadioButton* mpRbChangesFillForm;
- RadioButton* mpRbChangesComment;
- RadioButton* mpRbChangesAnyNoCopy;
+ VclPtr<VclContainer> mpChangesAllowed;
+ VclPtr<RadioButton> mpRbChangesNone;
+ VclPtr<RadioButton> mpRbChangesInsDel;
+ VclPtr<RadioButton> mpRbChangesFillForm;
+ VclPtr<RadioButton> mpRbChangesComment;
+ VclPtr<RadioButton> mpRbChangesAnyNoCopy;
- VclContainer* mpContent;
- CheckBox* mpCbEnableCopy;
- CheckBox* mpCbEnableAccessibility;
+ VclPtr<VclContainer> mpContent;
+ VclPtr<CheckBox> mpCbEnableCopy;
+ VclPtr<CheckBox> mpCbEnableAccessibility;
OUString msUserPwdTitle;
@@ -370,7 +375,8 @@ public:
const SfxItemSet& rSet );
virtual ~ImpPDFTabSecurityPage();
- static SfxTabPage* Create( vcl::Window* pParent,
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet );
void GetFilterConfigItem( ImpPDFTabDialog* paParent);
@@ -382,15 +388,15 @@ public:
//class to implement the relative link stuff
class ImpPDFTabLinksPage : public SfxTabPage
{
- CheckBox* m_pCbExprtBmkrToNmDst;
- CheckBox* m_pCbOOoToPDFTargets;
- CheckBox* m_pCbExportRelativeFsysLinks;
+ VclPtr<CheckBox> m_pCbExprtBmkrToNmDst;
+ VclPtr<CheckBox> m_pCbOOoToPDFTargets;
+ VclPtr<CheckBox> m_pCbExportRelativeFsysLinks;
- RadioButton* m_pRbOpnLnksDefault;
+ VclPtr<RadioButton> m_pRbOpnLnksDefault;
bool mbOpnLnksDefaultUserState;
- RadioButton* m_pRbOpnLnksLaunch;
+ VclPtr<RadioButton> m_pRbOpnLnksLaunch;
bool mbOpnLnksLaunchUserState;
- RadioButton* m_pRbOpnLnksBrowser;
+ VclPtr<RadioButton> m_pRbOpnLnksBrowser;
bool mbOpnLnksBrowserUserState;
DECL_LINK( ClickRbOpnLnksDefaultHdl, void* );
@@ -401,7 +407,8 @@ public:
const SfxItemSet& rSet );
virtual ~ImpPDFTabLinksPage();
- static SfxTabPage* Create( vcl::Window* pParent,
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet );
void GetFilterConfigItem( ImpPDFTabDialog* paParent);
@@ -413,14 +420,14 @@ public:
//class to implement the digital signing
class ImpPDFTabSigningPage : public SfxTabPage
{
- Edit* mpEdSignCert;
- PushButton* mpPbSignCertSelect;
- PushButton* mpPbSignCertClear;
- Edit* mpEdSignPassword;
- Edit* mpEdSignLocation;
- Edit* mpEdSignContactInfo;
- Edit* mpEdSignReason;
- ListBox* mpLBSignTSA;
+ VclPtr<Edit> mpEdSignCert;
+ VclPtr<PushButton> mpPbSignCertSelect;
+ VclPtr<PushButton> mpPbSignCertClear;
+ VclPtr<Edit> mpEdSignPassword;
+ VclPtr<Edit> mpEdSignLocation;
+ VclPtr<Edit> mpEdSignContactInfo;
+ VclPtr<Edit> mpEdSignReason;
+ VclPtr<ListBox> mpLBSignTSA;
com::sun::star::uno::Reference< com::sun::star::security::XCertificate > maSignCertificate;
DECL_LINK( ClickmaPbSignCertSelect, void* );
@@ -432,7 +439,8 @@ public:
const SfxItemSet& rSet );
virtual ~ImpPDFTabSigningPage();
- static SfxTabPage* Create( vcl::Window* pParent,
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet );
void GetFilterConfigItem( ImpPDFTabDialog* paParent);
diff --git a/filter/source/pdf/pdfdialog.cxx b/filter/source/pdf/pdfdialog.cxx
index 93de5b4e9bc7..02042739e549 100644
--- a/filter/source/pdf/pdfdialog.cxx
+++ b/filter/source/pdf/pdfdialog.cxx
@@ -107,17 +107,11 @@ Sequence< OUString > SAL_CALL PDFDialog::getSupportedServiceNames()
-Dialog* PDFDialog::createDialog( vcl::Window* pParent )
+VclPtr<Dialog> PDFDialog::createDialog( vcl::Window* pParent )
{
- Dialog* pRet = NULL;
-
if( mxSrcDoc.is() )
- {
- ImpPDFTabDialog* pDlg = new ImpPDFTabDialog( pParent, maFilterData, mxSrcDoc );
- pRet = pDlg;
- }
-
- return pRet;
+ return VclPtr<ImpPDFTabDialog>::Create( pParent, maFilterData, mxSrcDoc );
+ return VclPtr<Dialog>();
}
@@ -125,7 +119,7 @@ Dialog* PDFDialog::createDialog( vcl::Window* pParent )
void PDFDialog::executedDialog( sal_Int16 nExecutionResult )
{
if( nExecutionResult && m_pDialog )
- maFilterData = static_cast< ImpPDFTabDialog* >( m_pDialog )->GetFilterData();
+ maFilterData = static_cast< ImpPDFTabDialog* >( m_pDialog.get() )->GetFilterData();
destroyDialog();
}
diff --git a/filter/source/pdf/pdfdialog.hxx b/filter/source/pdf/pdfdialog.hxx
index 85135fa24079..e343902e2481 100644
--- a/filter/source/pdf/pdfdialog.hxx
+++ b/filter/source/pdf/pdfdialog.hxx
@@ -51,7 +51,7 @@ protected:
virtual Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(RuntimeException, std::exception) SAL_OVERRIDE;
virtual OUString SAL_CALL getImplementationName() throw (RuntimeException, std::exception) SAL_OVERRIDE;
virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (RuntimeException, std::exception) SAL_OVERRIDE;
- virtual Dialog* createDialog( vcl::Window* pParent ) SAL_OVERRIDE;
+ virtual VclPtr<Dialog> createDialog( vcl::Window* pParent ) SAL_OVERRIDE;
virtual void executedDialog( sal_Int16 nExecutionResult ) SAL_OVERRIDE;
virtual Reference< XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(RuntimeException, std::exception) SAL_OVERRIDE;
virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() SAL_OVERRIDE;
diff --git a/filter/source/pdf/pdffilter.cxx b/filter/source/pdf/pdffilter.cxx
index 3e1349bf54f2..9605032b0981 100644
--- a/filter/source/pdf/pdffilter.cxx
+++ b/filter/source/pdf/pdffilter.cxx
@@ -131,8 +131,8 @@ bool PDFFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
class FocusWindowWaitCursor
{
- vcl::Window* m_pFocusWindow;
- public:
+ VclPtr<vcl::Window> m_pFocusWindow;
+public:
FocusWindowWaitCursor() :
m_pFocusWindow( Application::GetFocusWindow() )
{
diff --git a/filter/source/pdf/pdfinteract.cxx b/filter/source/pdf/pdfinteract.cxx
index 579d9ef3fb40..d01281211ebf 100644
--- a/filter/source/pdf/pdfinteract.cxx
+++ b/filter/source/pdf/pdfinteract.cxx
@@ -53,8 +53,8 @@ sal_Bool SAL_CALL PDFInteractionHandler::handleInteractionRequest( const Referen
sal_Int32 nCodes = aExc.ErrorCodes.getLength();
for( sal_Int32 i = 0; i < nCodes; i++ )
aCodes.insert( (vcl::PDFWriter::ErrorCode)aExc.ErrorCodes.getConstArray()[i] );
- ImplErrorDialog aDlg( aCodes );
- aDlg.Execute();
+ ScopedVclPtrInstance< ImplErrorDialog > aDlg( aCodes );
+ aDlg->Execute();
bHandled = true;
}
return bHandled;
diff --git a/filter/source/svg/impsvgdialog.cxx b/filter/source/svg/impsvgdialog.cxx
index 5fd3e6d218b4..2e70390f4890 100644
--- a/filter/source/svg/impsvgdialog.cxx
+++ b/filter/source/svg/impsvgdialog.cxx
@@ -36,73 +36,86 @@ inline sal_Int32 implMap( vcl::Window& /*rWnd*/, sal_Int32 nVal )
ImpSVGDialog::ImpSVGDialog( vcl::Window* pParent, Sequence< PropertyValue >& rFilterData ) :
ModalDialog( pParent ),
- maFI( this ),
- maCBTinyProfile( this ),
- maCBEmbedFonts( this ),
- maCBUseNativeDecoration( this ),
- maBTOK( this, WB_DEF_OK ),
- maBTCancel( this ),
- maBTHelp( this ),
+ maFI( VclPtr<FixedLine>::Create(this) ),
+ maCBTinyProfile( VclPtr<CheckBox>::Create(this) ),
+ maCBEmbedFonts( VclPtr<CheckBox>::Create(this) ),
+ maCBUseNativeDecoration( VclPtr<CheckBox>::Create(this) ),
+ maBTOK( VclPtr<OKButton>::Create(this, WB_DEF_OK) ),
+ maBTCancel( VclPtr<CancelButton>::Create(this) ),
+ maBTHelp( VclPtr<HelpButton>::Create(this) ),
maConfigItem( SVG_EXPORTFILTER_CONFIGPATH, &rFilterData ),
mbOldNativeDecoration( false )
{
SetText( "SVG Export Options" );
SetOutputSizePixel( Size( implMap( *this, 177 ), implMap( *this, 77 ) ) );
- maFI.SetText( "Export" );
- maFI.SetPosSizePixel( Point( implMap( *this, 6 ), implMap( *this, 3 ) ),
+ maFI->SetText( "Export" );
+ maFI->SetPosSizePixel( Point( implMap( *this, 6 ), implMap( *this, 3 ) ),
Size( implMap( *this, 165 ), implMap( *this, 8 ) ) );
- maCBTinyProfile.SetText( "Use SVG Tiny profile" );
- maCBTinyProfile.SetPosSizePixel( Point( implMap( *this, 12 ), implMap( *this, 14 ) ),
+ maCBTinyProfile->SetText( "Use SVG Tiny profile" );
+ maCBTinyProfile->SetPosSizePixel( Point( implMap( *this, 12 ), implMap( *this, 14 ) ),
Size( implMap( *this, 142 ), implMap( *this, 10 ) ) );
- maCBEmbedFonts.SetText( "Embed fonts" );
- maCBEmbedFonts.SetPosSizePixel( Point( implMap( *this, 12 ), implMap( *this, 27 ) ),
+ maCBEmbedFonts->SetText( "Embed fonts" );
+ maCBEmbedFonts->SetPosSizePixel( Point( implMap( *this, 12 ), implMap( *this, 27 ) ),
Size( implMap( *this, 142 ), implMap( *this, 10 ) ) );
- maCBUseNativeDecoration.SetText( "Use SVG native text decoration" );
- maCBUseNativeDecoration.SetPosSizePixel( Point( implMap( *this, 12 ), implMap( *this, 41 ) ),
+ maCBUseNativeDecoration->SetText( "Use SVG native text decoration" );
+ maCBUseNativeDecoration->SetPosSizePixel( Point( implMap( *this, 12 ), implMap( *this, 41 ) ),
Size( implMap( *this, 142 ), implMap( *this, 10 ) ) );
- maCBTinyProfile.Check( maConfigItem.ReadBool( OUString( SVG_PROP_TINYPROFILE ), false ) );
- maCBEmbedFonts.Check( maConfigItem.ReadBool( OUString( SVG_PROP_EMBEDFONTS ), true ) );
- maCBUseNativeDecoration.Check( maConfigItem.ReadBool( OUString( SVG_PROP_NATIVEDECORATION ), true ) );
+ maCBTinyProfile->Check( maConfigItem.ReadBool( OUString( SVG_PROP_TINYPROFILE ), false ) );
+ maCBEmbedFonts->Check( maConfigItem.ReadBool( OUString( SVG_PROP_EMBEDFONTS ), true ) );
+ maCBUseNativeDecoration->Check( maConfigItem.ReadBool( OUString( SVG_PROP_NATIVEDECORATION ), true ) );
- maBTOK.SetPosSizePixel( Point( implMap( *this, 12 ), implMap( *this, 57 ) ),
+ maBTOK->SetPosSizePixel( Point( implMap( *this, 12 ), implMap( *this, 57 ) ),
Size( implMap( *this, 50 ), implMap( *this, 14 ) ) );
- maBTCancel.SetPosSizePixel( Point( implMap( *this, 65 ), implMap( *this, 57 ) ),
+ maBTCancel->SetPosSizePixel( Point( implMap( *this, 65 ), implMap( *this, 57 ) ),
Size( implMap( *this, 50 ), implMap( *this, 14 ) ) );
- maBTHelp.SetPosSizePixel( Point( implMap( *this, 121 ), implMap( *this, 57 ) ),
+ maBTHelp->SetPosSizePixel( Point( implMap( *this, 121 ), implMap( *this, 57 ) ),
Size( implMap( *this, 50 ), implMap( *this, 14 ) ) );
- maCBTinyProfile.SetToggleHdl( LINK( this, ImpSVGDialog, OnToggleCheckbox ) );
- OnToggleCheckbox( &maCBTinyProfile );
+ maCBTinyProfile->SetToggleHdl( LINK( this, ImpSVGDialog, OnToggleCheckbox ) );
+ OnToggleCheckbox( maCBTinyProfile.get() );
- maFI.Show();
+ maFI->Show();
- maCBTinyProfile.Show();
- maCBEmbedFonts.Show();
- maCBUseNativeDecoration.Show();
+ maCBTinyProfile->Show();
+ maCBEmbedFonts->Show();
+ maCBUseNativeDecoration->Show();
- maBTOK.Show();
- maBTCancel.Show();
- maBTHelp.Show();
+ maBTOK->Show();
+ maBTCancel->Show();
+ maBTHelp->Show();
}
ImpSVGDialog::~ImpSVGDialog()
{
+ disposeOnce();
+}
+
+void ImpSVGDialog::dispose()
+{
+ maFI.disposeAndClear();
+ maCBTinyProfile.disposeAndClear();
+ maCBEmbedFonts.disposeAndClear();
+ maCBUseNativeDecoration.disposeAndClear();
+ maBTOK.disposeAndClear();
+ maBTCancel.disposeAndClear();
+ maBTHelp.disposeAndClear();
+ ModalDialog::dispose();
}
Sequence< PropertyValue > ImpSVGDialog::GetFilterData()
{
- maConfigItem.WriteBool( OUString( SVG_PROP_TINYPROFILE ), maCBTinyProfile.IsChecked() );
- maConfigItem.WriteBool( OUString( SVG_PROP_EMBEDFONTS ), maCBEmbedFonts.IsChecked() );
- maConfigItem.WriteBool( OUString( SVG_PROP_NATIVEDECORATION ), maCBUseNativeDecoration.IsChecked() );
+ maConfigItem.WriteBool( OUString( SVG_PROP_TINYPROFILE ), maCBTinyProfile->IsChecked() );
+ maConfigItem.WriteBool( OUString( SVG_PROP_EMBEDFONTS ), maCBEmbedFonts->IsChecked() );
+ maConfigItem.WriteBool( OUString( SVG_PROP_NATIVEDECORATION ), maCBUseNativeDecoration->IsChecked() );
return( maConfigItem.GetFilterData() );
}
@@ -111,19 +124,19 @@ Sequence< PropertyValue > ImpSVGDialog::GetFilterData()
IMPL_LINK( ImpSVGDialog, OnToggleCheckbox, CheckBox*, pBox )
{
- if( pBox == &maCBTinyProfile )
+ if( pBox == maCBTinyProfile.get() )
{
if( pBox->IsChecked() )
{
- mbOldNativeDecoration = maCBUseNativeDecoration.IsChecked();
+ mbOldNativeDecoration = maCBUseNativeDecoration->IsChecked();
- maCBUseNativeDecoration.Check( false );
- maCBUseNativeDecoration.Disable();
+ maCBUseNativeDecoration->Check( false );
+ maCBUseNativeDecoration->Disable();
}
else
{
- maCBUseNativeDecoration.Enable();
- maCBUseNativeDecoration.Check( mbOldNativeDecoration );
+ maCBUseNativeDecoration->Enable();
+ maCBUseNativeDecoration->Check( mbOldNativeDecoration );
}
}
diff --git a/filter/source/svg/impsvgdialog.hxx b/filter/source/svg/impsvgdialog.hxx
index 657cd9a47bb9..ada5b71df1e3 100644
--- a/filter/source/svg/impsvgdialog.hxx
+++ b/filter/source/svg/impsvgdialog.hxx
@@ -48,17 +48,17 @@ class ImpSVGDialog : public ModalDialog
{
private:
- FixedLine maFI;
- CheckBox maCBTinyProfile;
- CheckBox maCBEmbedFonts;
- CheckBox maCBUseNativeDecoration;
+ VclPtr<FixedLine> maFI;
+ VclPtr<CheckBox> maCBTinyProfile;
+ VclPtr<CheckBox> maCBEmbedFonts;
+ VclPtr<CheckBox> maCBUseNativeDecoration;
- OKButton maBTOK;
- CancelButton maBTCancel;
- HelpButton maBTHelp;
+ VclPtr<OKButton> maBTOK;
+ VclPtr<CancelButton> maBTCancel;
+ VclPtr<HelpButton> maBTHelp;
- FilterConfigItem maConfigItem;
- bool mbOldNativeDecoration;
+ FilterConfigItem maConfigItem;
+ bool mbOldNativeDecoration;
DECL_LINK( OnToggleCheckbox, CheckBox* );
@@ -67,6 +67,7 @@ public:
ImpSVGDialog( vcl::Window* pParent, /*ResMgr& rResMgr,*/
com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rFilterData );
virtual ~ImpSVGDialog();
+ virtual void dispose() SAL_OVERRIDE;
com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > GetFilterData();
};
diff --git a/filter/source/svg/svgdialog.cxx b/filter/source/svg/svgdialog.cxx
index ccc9b45ee653..764fc89c99bb 100644
--- a/filter/source/svg/svgdialog.cxx
+++ b/filter/source/svg/svgdialog.cxx
@@ -143,11 +143,12 @@ Sequence< OUString > SAL_CALL SVGDialog::getSupportedServiceNames()
-Dialog* SVGDialog::createDialog( vcl::Window* pParent )
+VclPtr<Dialog> SVGDialog::createDialog( vcl::Window* pParent )
{
- return( ( /*KA: *mapResMgr.get() &&*/ mxSrcDoc.is() ) ?
- new ImpSVGDialog( pParent/*KA: , *mapResMgr*/, maFilterData ) :
- NULL );
+ if( mxSrcDoc.is() )
+ return VclPtr<ImpSVGDialog>::Create( pParent, maFilterData );
+ else
+ return VclPtr<Dialog>();
}
@@ -155,7 +156,7 @@ Dialog* SVGDialog::createDialog( vcl::Window* pParent )
void SVGDialog::executedDialog( sal_Int16 nExecutionResult )
{
if( nExecutionResult && m_pDialog )
- maFilterData = static_cast< ImpSVGDialog* >( m_pDialog )->GetFilterData();
+ maFilterData = static_cast< ImpSVGDialog* >( m_pDialog.get() )->GetFilterData();
destroyDialog();
}
diff --git a/filter/source/svg/svgdialog.hxx b/filter/source/svg/svgdialog.hxx
index 064240ff49c7..7c87789c2438 100644
--- a/filter/source/svg/svgdialog.hxx
+++ b/filter/source/svg/svgdialog.hxx
@@ -56,7 +56,7 @@ protected:
virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual OUString SAL_CALL getImplementationName() throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
- virtual Dialog* createDialog( vcl::Window* pParent ) SAL_OVERRIDE;
+ virtual VclPtr<Dialog> createDialog( vcl::Window* pParent ) SAL_OVERRIDE;
virtual void executedDialog( sal_Int16 nExecutionResult ) SAL_OVERRIDE;
virtual com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() SAL_OVERRIDE;
diff --git a/filter/source/svg/svgfontexport.cxx b/filter/source/svg/svgfontexport.cxx
index b65370a423cb..231639aac3c3 100644
--- a/filter/source/svg/svgfontexport.cxx
+++ b/filter/source/svg/svgfontexport.cxx
@@ -78,10 +78,10 @@ SVGFontExport::GlyphSet& SVGFontExport::implGetGlyphSet( const vcl::Font& rFont
void SVGFontExport::implCollectGlyphs()
{
- VirtualDevice aVDev;
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
ObjectVector::const_iterator aIter( maObjects.begin() );
- aVDev.EnableOutput( false );
+ pVDev->EnableOutput( false );
while( aIter != maObjects.end() )
{
@@ -89,7 +89,7 @@ void SVGFontExport::implCollectGlyphs()
{
const GDIMetaFile& rMtf = (*aIter).GetRepresentation();
- aVDev.Push();
+ pVDev->Push();
for( size_t i = 0, nCount = rMtf.GetActionSize(); i < nCount; ++i )
{
@@ -131,13 +131,13 @@ void SVGFontExport::implCollectGlyphs()
break;
default:
- pAction->Execute( &aVDev );
+ pAction->Execute( pVDev );
break;
}
if( !aText.isEmpty() )
{
- GlyphSet& rGlyphSet = implGetGlyphSet( aVDev.GetFont() );
+ GlyphSet& rGlyphSet = implGetGlyphSet( pVDev->GetFont() );
::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > xBI(
::vcl::unohelper::CreateBreakIterator() );
@@ -168,7 +168,7 @@ void SVGFontExport::implCollectGlyphs()
}
}
- aVDev.Pop();
+ pVDev->Pop();
}
++aIter;
@@ -192,14 +192,14 @@ void SVGFontExport::implEmbedFont( const vcl::Font& rFont )
SvXMLElementExport aExp( mrExport, XML_NAMESPACE_NONE, "defs", true, true );
OUString aCurIdStr( aEmbeddedFontStr );
OUString aUnitsPerEM( OUString::number( nFontEM ) );
- VirtualDevice aVDev;
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
vcl::Font aFont( rFont );
aFont.SetSize( Size( 0, nFontEM ) );
aFont.SetAlign( ALIGN_BASELINE );
- aVDev.SetMapMode( MAP_100TH_MM );
- aVDev.SetFont( aFont );
+ pVDev->SetMapMode( MAP_100TH_MM );
+ pVDev->SetFont( aFont );
mrExport.AddAttribute( XML_NAMESPACE_NONE, "id", aCurIdStr += OUString::number( ++mnCurFontId ) );
mrExport.AddAttribute( XML_NAMESPACE_NONE, "horiz-adv-x", aUnitsPerEM );
@@ -226,8 +226,8 @@ void SVGFontExport::implEmbedFont( const vcl::Font& rFont )
mrExport.AddAttribute( XML_NAMESPACE_NONE, "units-per-em", aUnitsPerEM );
mrExport.AddAttribute( XML_NAMESPACE_NONE, "font-weight", aFontWeight );
mrExport.AddAttribute( XML_NAMESPACE_NONE, "font-style", aFontStyle );
- mrExport.AddAttribute( XML_NAMESPACE_NONE, "ascent", OUString::number( aVDev.GetFontMetric().GetAscent() ) );
- mrExport.AddAttribute( XML_NAMESPACE_NONE, "descent", OUString::number( aVDev.GetFontMetric().GetDescent() ) );
+ mrExport.AddAttribute( XML_NAMESPACE_NONE, "ascent", OUString::number( pVDev->GetFontMetric().GetAscent() ) );
+ mrExport.AddAttribute( XML_NAMESPACE_NONE, "descent", OUString::number( pVDev->GetFontMetric().GetDescent() ) );
{
SvXMLElementExport aExp3( mrExport, XML_NAMESPACE_NONE, "font-face", true, true );
@@ -248,7 +248,7 @@ void SVGFontExport::implEmbedFont( const vcl::Font& rFont )
while( aIter != rGlyphSet.end() )
{
- implEmbedGlyph( aVDev, *aIter );
+ implEmbedGlyph( *pVDev.get(), *aIter );
++aIter;
}
}
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 5774dfda9f04..59437328cd73 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -1658,7 +1658,7 @@ SVGActionWriter::SVGActionWriter( SVGExport& rExport, SVGFontExport& rFontExport
SVGActionWriter::~SVGActionWriter()
{
DBG_ASSERT( !mpContext, "Not all contexts are closed" );
- delete mpVDev;
+ mpVDev.disposeAndClear();
}
long SVGActionWriter::ImplMap( sal_Int32 nVal ) const
diff --git a/filter/source/svg/svgwriter.hxx b/filter/source/svg/svgwriter.hxx
index a74ca3032de4..2de237a268b2 100644
--- a/filter/source/svg/svgwriter.hxx
+++ b/filter/source/svg/svgwriter.hxx
@@ -178,7 +178,7 @@ class SVGTextWriter
private:
SVGExport& mrExport;
SVGAttributeWriter* mpContext;
- VirtualDevice* mpVDev;
+ VclPtr<VirtualDevice> mpVDev;
bool mbIsTextShapeStarted;
Reference<XText> mrTextShape;
OUString msShapeId;
@@ -303,7 +303,7 @@ private:
SVGFontExport& mrFontExport;
SVGAttributeWriter* mpContext;
SVGTextWriter maTextWriter;
- VirtualDevice* mpVDev;
+ VclPtr<VirtualDevice> mpVDev;
MapMode maTargetMapMode;
sal_uInt32 mnInnerMtfCount;
bool mbClipAttrChanged;
diff --git a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
index 4ca2d999d1b6..5d710e5b8e5d 100644
--- a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
+++ b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
@@ -107,7 +107,7 @@ private:
com::sun::star::uno::Reference<com::sun::star::awt::XWindow> mxParent; /// parent window
com::sun::star::uno::Reference< XComponentContext > mxContext;
- XMLFilterSettingsDialog* mpDialog;
+ VclPtr<XMLFilterSettingsDialog> mpDialog;
};
@@ -266,11 +266,7 @@ void SAL_CALL XMLFilterDialogComponent::disposing()
{
::SolarMutexGuard aGuard;
- if( mpDialog )
- {
- delete mpDialog;
- mpDialog = NULL;
- }
+ mpDialog.disposeAndClear();
if (pXSLTResMgr)
{
@@ -328,14 +324,14 @@ sal_Int16 SAL_CALL XMLFilterDialogComponent::execute( ) throw(RuntimeException,
pXSLTResMgr = ResMgr::CreateResMgr( "xsltdlg", Application::GetSettings().GetUILanguageTag() );
}
- if( NULL == mpDialog )
+ if( nullptr == mpDialog )
{
vcl::Window* pParent = DIALOG_NO_PARENT;
if (mxParent.is())
pParent = VCLUnoHelper::GetWindow(mxParent);
Reference< XComponent > xComp( this );
- mpDialog = new XMLFilterSettingsDialog(pParent, mxContext);
+ mpDialog = VclPtr<XMLFilterSettingsDialog>::Create(pParent, mxContext);
mpDialog->Execute();
}
else if( !mpDialog->IsVisible() )
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
index ba832bfea60b..5865d812f555 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
@@ -103,7 +103,24 @@ XMLFilterSettingsDialog::XMLFilterSettingsDialog(vcl::Window* pParent,
}
}
+XMLFilterSettingsDialog::~XMLFilterSettingsDialog()
+{
+ disposeOnce();
+}
+void XMLFilterSettingsDialog::dispose()
+{
+ m_pFilterListBox.clear();
+ m_pCtrlFilterList.clear();
+ m_pPBNew.clear();
+ m_pPBEdit.clear();
+ m_pPBTest.clear();
+ m_pPBDelete.clear();
+ m_pPBSave.clear();
+ m_pPBOpen.clear();
+ m_pPBClose.clear();
+ ModelessDialog::dispose();
+}
IMPL_LINK(XMLFilterSettingsDialog, ClickHdl_Impl, PushButton *, pButton )
{
@@ -225,11 +242,11 @@ void XMLFilterSettingsDialog::onNew()
aTempInfo.maDocumentService = "com.sun.star.text.TextDocument";
// execute XML Filter Dialog
- XMLFilterTabDialog aDlg( this, *getXSLTDialogResMgr(), mxContext, &aTempInfo );
- if ( aDlg.Execute() == RET_OK )
+ ScopedVclPtrInstance< XMLFilterTabDialog > aDlg( this, *getXSLTDialogResMgr(), mxContext, &aTempInfo );
+ if ( aDlg->Execute() == RET_OK )
{
// insert the new filter
- insertOrEdit( aDlg.getNewFilterInfo() );
+ insertOrEdit( aDlg->getNewFilterInfo() );
}
}
@@ -246,10 +263,10 @@ void XMLFilterSettingsDialog::onEdit()
filter_info_impl* pOldInfo = static_cast<filter_info_impl*>(pEntry->GetUserData());
// execute XML Filter Dialog
- XMLFilterTabDialog aDlg( this, *getXSLTDialogResMgr(), mxContext, pOldInfo );
- if ( aDlg.Execute() == RET_OK )
+ ScopedVclPtrInstance< XMLFilterTabDialog > aDlg( this, *getXSLTDialogResMgr(), mxContext, pOldInfo );
+ if ( aDlg->Execute() == RET_OK )
{
- filter_info_impl* pNewInfo = aDlg.getNewFilterInfo();
+ filter_info_impl* pNewInfo = aDlg->getNewFilterInfo();
if( !(*pOldInfo == *pNewInfo) )
{
@@ -771,8 +788,8 @@ void XMLFilterSettingsDialog::onTest()
{
filter_info_impl* pInfo = static_cast<filter_info_impl*>(pEntry->GetUserData());
- XMLFilterTestDialog aDlg(this, mxContext);
- aDlg.test( *pInfo );
+ ScopedVclPtrInstance< XMLFilterTestDialog > aDlg(this, mxContext);
+ aDlg->test( *pInfo );
}
}
@@ -789,8 +806,8 @@ void XMLFilterSettingsDialog::onDelete()
OUString aMessage(RESIDSTR(STR_WARN_DELETE));
aMessage = aMessage.replaceFirst( aPlaceHolder, pInfo->maFilterName );
- WarningBox aWarnBox(this, (WinBits)(WB_YES_NO | WB_DEF_YES), aMessage );
- if( aWarnBox.Execute() == RET_YES )
+ ScopedVclPtrInstance< WarningBox > aWarnBox(this, (WinBits)(WB_YES_NO | WB_DEF_YES), aMessage );
+ if( aWarnBox->Execute() == RET_YES )
{
try
{
@@ -919,8 +936,8 @@ void XMLFilterSettingsDialog::onSave()
aMsg = aMsg.replaceFirst( sPlaceholder, aURL.GetName() );
}
- InfoBox aBox(this, aMsg );
- aBox.Execute();
+ ScopedVclPtrInstance< InfoBox > aBox(this, aMsg );
+ aBox->Execute();
}
}
@@ -985,8 +1002,8 @@ void XMLFilterSettingsDialog::onOpen()
aMsg = aMsg.replaceFirst( sPlaceholder, OUString::number( nFilters ) );
}
- InfoBox aBox(this, aMsg );
- aBox.Execute();
+ ScopedVclPtrInstance< InfoBox > aBox(this, aMsg );
+ aBox->Execute();
}
}
@@ -1339,12 +1356,12 @@ SvxPathControl::SvxPathControl(vcl::Window* pParent)
: Window(pParent, WB_HIDE | WB_CLIPCHILDREN | WB_TABSTOP | WB_DIALOGCONTROL | WB_BORDER)
, bHasBeenShown(false)
{
- m_pVBox = new VclVBox(this);
+ m_pVBox = VclPtr<VclVBox>::Create(this);
- m_pHeaderBar = new HeaderBar(m_pVBox, WB_BOTTOMBORDER);
+ m_pHeaderBar = VclPtr<HeaderBar>::Create(m_pVBox, WB_BOTTOMBORDER);
m_pHeaderBar->set_height_request(GetTextHeight() + 6);
- m_pFocusCtrl = new XMLFilterListBox(m_pVBox, this);
+ m_pFocusCtrl = VclPtr<XMLFilterListBox>::Create(m_pVBox, this);
m_pFocusCtrl->set_fill(true);
m_pFocusCtrl->set_expand(true);
@@ -1399,8 +1416,15 @@ Size SvxPathControl::GetOptimalSize() const
SvxPathControl::~SvxPathControl()
{
- delete m_pFocusCtrl;
- delete m_pHeaderBar;
+ disposeOnce();
+}
+
+void SvxPathControl::dispose()
+{
+ m_pFocusCtrl.disposeAndClear();
+ m_pHeaderBar.disposeAndClear();
+ m_pVBox.disposeAndClear();
+ vcl::Window::dispose();
}
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvxPathControl(vcl::Window *pParent, VclBuilder::stringmap &)
@@ -1446,7 +1470,16 @@ XMLFilterListBox::XMLFilterListBox(Window* pParent, SvxPathControl* pPathControl
m_pHeaderBar->Show();
}
+XMLFilterListBox::~XMLFilterListBox()
+{
+ disposeOnce();
+}
+void XMLFilterListBox::dispose()
+{
+ m_pHeaderBar.clear();
+ SvTabListBox::dispose();
+}
void XMLFilterListBox::Paint( const Rectangle& rRect )
{
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx
index 85bb4d79094a..df26aaf95685 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx
@@ -39,9 +39,9 @@ class SvxPathControl : public vcl::Window
{
private:
bool bHasBeenShown;
- VclVBox* m_pVBox;
- HeaderBar* m_pHeaderBar;
- XMLFilterListBox* m_pFocusCtrl;
+ VclPtr<VclVBox> m_pVBox;
+ VclPtr<HeaderBar> m_pHeaderBar;
+ VclPtr<XMLFilterListBox> m_pFocusCtrl;
protected:
virtual void Resize() SAL_OVERRIDE;
virtual Size GetOptimalSize() const SAL_OVERRIDE;
@@ -50,6 +50,7 @@ public:
HeaderBar* getHeaderBar() { return m_pHeaderBar; }
XMLFilterListBox* getListBox() { return m_pFocusCtrl; }
virtual ~SvxPathControl();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
};
@@ -59,7 +60,7 @@ class HeaderBar;
class XMLFilterListBox : public SvTabListBox
{
private:
- HeaderBar* m_pHeaderBar;
+ VclPtr<HeaderBar> m_pHeaderBar;
DECL_LINK( TabBoxScrollHdl_Impl, SvTabListBox* );
DECL_LINK( HeaderEndDrag_Impl, HeaderBar* );
@@ -68,6 +69,8 @@ private:
public:
XMLFilterListBox(Window* pParent, SvxPathControl* pPathControl);
+ virtual ~XMLFilterListBox();
+ virtual void dispose() SAL_OVERRIDE;
/** adds a new filter info entry to the ui filter list */
void addFilterEntry( const filter_info_impl* pInfo );
@@ -84,6 +87,8 @@ class XMLFilterSettingsDialog : public ModelessDialog
public:
XMLFilterSettingsDialog(vcl::Window* pParent,
const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext);
+ virtual ~XMLFilterSettingsDialog();
+ virtual void dispose() SAL_OVERRIDE;
DECL_LINK(ClickHdl_Impl, PushButton * );
DECL_LINK(SelectionChangedHdl_Impl, void * );
@@ -124,15 +129,15 @@ private:
std::vector< filter_info_impl* > maFilterVector;
- XMLFilterListBox* m_pFilterListBox;
- SvxPathControl* m_pCtrlFilterList;
- PushButton* m_pPBNew;
- PushButton* m_pPBEdit;
- PushButton* m_pPBTest;
- PushButton* m_pPBDelete;
- PushButton* m_pPBSave;
- PushButton* m_pPBOpen;
- CloseButton* m_pPBClose;
+ VclPtr<XMLFilterListBox> m_pFilterListBox;
+ VclPtr<SvxPathControl> m_pCtrlFilterList;
+ VclPtr<PushButton> m_pPBNew;
+ VclPtr<PushButton> m_pPBEdit;
+ VclPtr<PushButton> m_pPBTest;
+ VclPtr<PushButton> m_pPBDelete;
+ VclPtr<PushButton> m_pPBSave;
+ VclPtr<PushButton> m_pPBOpen;
+ VclPtr<CloseButton> m_pPBClose;
bool m_bIsClosable;
diff --git a/filter/source/xsltdialog/xmlfiltertabdialog.cxx b/filter/source/xsltdialog/xmlfiltertabdialog.cxx
index 4494a74ba799..ff725cc040fe 100644
--- a/filter/source/xsltdialog/xmlfiltertabdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltertabdialog.cxx
@@ -56,13 +56,13 @@ XMLFilterTabDialog::XMLFilterTabDialog(vcl::Window *pParent, ResMgr& rResMgr,
m_pTabCtrl->SetActivatePageHdl( LINK( this, XMLFilterTabDialog, ActivatePageHdl ) );
m_pTabCtrl->SetDeactivatePageHdl( LINK( this, XMLFilterTabDialog, DeactivatePageHdl ) );
- mpBasicPage = new XMLFilterTabPageBasic(m_pTabCtrl);
+ mpBasicPage = VclPtr<XMLFilterTabPageBasic>::Create(m_pTabCtrl);
mpBasicPage->SetInfo( mpNewInfo );
m_nBasicPageId = m_pTabCtrl->GetPageId("general");
m_pTabCtrl->SetTabPage(m_nBasicPageId, mpBasicPage);
- mpXSLTPage = new XMLFilterTabPageXSLT(m_pTabCtrl);
+ mpXSLTPage = VclPtr<XMLFilterTabPageXSLT>::Create(m_pTabCtrl);
mpXSLTPage->SetInfo( mpNewInfo );
m_nXSLTPageId = m_pTabCtrl->GetPageId("transformation");
@@ -75,9 +75,17 @@ XMLFilterTabDialog::XMLFilterTabDialog(vcl::Window *pParent, ResMgr& rResMgr,
XMLFilterTabDialog::~XMLFilterTabDialog()
{
- delete mpBasicPage;
- delete mpXSLTPage;
+ disposeOnce();
+}
+
+void XMLFilterTabDialog::dispose()
+{
+ mpBasicPage.disposeAndClear();
+ mpXSLTPage.disposeAndClear();
delete mpNewInfo;
+ m_pTabCtrl.clear();
+ m_pOKBtn.clear();
+ TabDialog::dispose();
}
@@ -257,8 +265,8 @@ bool XMLFilterTabDialog::onOk()
aMessage = aMessage.replaceAll( "%s", aReplace1 );
}
- MessageDialog aBox(this, aMessage);
- aBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aBox(this, aMessage);
+ aBox->Execute();
if( pFocusWindow )
pFocusWindow->GrabFocus();
diff --git a/filter/source/xsltdialog/xmlfiltertabdialog.hxx b/filter/source/xsltdialog/xmlfiltertabdialog.hxx
index 1ec8594ceac4..221b704bb050 100644
--- a/filter/source/xsltdialog/xmlfiltertabdialog.hxx
+++ b/filter/source/xsltdialog/xmlfiltertabdialog.hxx
@@ -36,6 +36,7 @@ class XMLFilterTabDialog: public TabDialog
public:
XMLFilterTabDialog(vcl::Window *pParent, ResMgr& rResMgr, const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, const filter_info_impl* pInfo);
virtual ~XMLFilterTabDialog();
+ virtual void dispose() SAL_OVERRIDE;
bool onOk();
@@ -53,14 +54,14 @@ private:
const filter_info_impl* mpOldInfo;
filter_info_impl* mpNewInfo;
- TabControl* m_pTabCtrl;
- OKButton* m_pOKBtn;
+ VclPtr<TabControl> m_pTabCtrl;
+ VclPtr<OKButton> m_pOKBtn;
sal_Int16 m_nBasicPageId;
sal_Int16 m_nXSLTPageId;
- XMLFilterTabPageBasic* mpBasicPage;
- XMLFilterTabPageXSLT* mpXSLTPage;
+ VclPtr<XMLFilterTabPageBasic> mpBasicPage;
+ VclPtr<XMLFilterTabPageXSLT> mpXSLTPage;
};
diff --git a/filter/source/xsltdialog/xmlfiltertabpagebasic.cxx b/filter/source/xsltdialog/xmlfiltertabpagebasic.cxx
index fb1d35ac2599..3f4d285a71a3 100644
--- a/filter/source/xsltdialog/xmlfiltertabpagebasic.cxx
+++ b/filter/source/xsltdialog/xmlfiltertabpagebasic.cxx
@@ -44,7 +44,19 @@ XMLFilterTabPageBasic::XMLFilterTabPageBasic(vcl::Window* pParent)
XMLFilterTabPageBasic::~XMLFilterTabPageBasic()
{
+ disposeOnce();
}
+
+void XMLFilterTabPageBasic::dispose()
+{
+ m_pEDFilterName.clear();
+ m_pCBApplication.clear();
+ m_pEDInterfaceName.clear();
+ m_pEDExtension.clear();
+ m_pEDDescription.clear();
+ TabPage::dispose();
+}
+
static OUString checkExtensions( const OUString& rExtensions )
{
const sal_Unicode* pSource = rExtensions.getStr();
diff --git a/filter/source/xsltdialog/xmlfiltertabpagebasic.hxx b/filter/source/xsltdialog/xmlfiltertabpagebasic.hxx
index 13d38d11e046..ac3876c868b8 100644
--- a/filter/source/xsltdialog/xmlfiltertabpagebasic.hxx
+++ b/filter/source/xsltdialog/xmlfiltertabpagebasic.hxx
@@ -34,6 +34,7 @@ class XMLFilterTabPageBasic : public TabPage
public:
XMLFilterTabPageBasic(vcl::Window* pParent);
virtual ~XMLFilterTabPageBasic();
+ virtual void dispose() SAL_OVERRIDE;
bool FillInfo( filter_info_impl* pInfo );
void SetInfo(const filter_info_impl* pInfo);
@@ -41,11 +42,11 @@ public:
static OUString decodeComment( const OUString& rComment );
static OUString encodeComment( const OUString& rComment );
- Edit* m_pEDFilterName;
- ComboBox* m_pCBApplication;
- Edit* m_pEDInterfaceName;
- Edit* m_pEDExtension;
- VclMultiLineEdit* m_pEDDescription;
+ VclPtr<Edit> m_pEDFilterName;
+ VclPtr<ComboBox> m_pCBApplication;
+ VclPtr<Edit> m_pEDInterfaceName;
+ VclPtr<Edit> m_pEDExtension;
+ VclPtr<VclMultiLineEdit> m_pEDDescription;
};
#endif
diff --git a/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx b/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx
index a9d1cae94360..717463bc5bc5 100644
--- a/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx
+++ b/filter/source/xsltdialog/xmlfiltertabpagexslt.cxx
@@ -58,6 +58,20 @@ XMLFilterTabPageXSLT::XMLFilterTabPageXSLT( vcl::Window* pParent) :
XMLFilterTabPageXSLT::~XMLFilterTabPageXSLT()
{
+ disposeOnce();
+}
+
+void XMLFilterTabPageXSLT::dispose()
+{
+ m_pEDDocType.clear();
+ m_pEDExportXSLT.clear();
+ m_pPBExprotXSLT.clear();
+ m_pEDImportXSLT.clear();
+ m_pPBImportXSLT.clear();
+ m_pEDImportTemplate.clear();
+ m_pPBImportTemplate.clear();
+ m_pCBNeedsXSLT2.clear();
+ TabPage::dispose();
}
bool XMLFilterTabPageXSLT::FillInfo( filter_info_impl* pInfo )
diff --git a/filter/source/xsltdialog/xmlfiltertabpagexslt.hxx b/filter/source/xsltdialog/xmlfiltertabpagexslt.hxx
index 01f36d518a7e..09c110fdb504 100644
--- a/filter/source/xsltdialog/xmlfiltertabpagexslt.hxx
+++ b/filter/source/xsltdialog/xmlfiltertabpagexslt.hxx
@@ -35,6 +35,7 @@ class XMLFilterTabPageXSLT : public TabPage
public:
XMLFilterTabPageXSLT( vcl::Window* pParent);
virtual ~XMLFilterTabPageXSLT();
+ virtual void dispose() SAL_OVERRIDE;
bool FillInfo( filter_info_impl* pInfo );
void SetInfo(const filter_info_impl* pInfo);
@@ -42,18 +43,18 @@ public:
DECL_LINK( ClickBrowseHdl_Impl, PushButton * );
- Edit* m_pEDDocType;
+ VclPtr<Edit> m_pEDDocType;
- SvtURLBox* m_pEDExportXSLT;
- PushButton* m_pPBExprotXSLT;
+ VclPtr<SvtURLBox> m_pEDExportXSLT;
+ VclPtr<PushButton> m_pPBExprotXSLT;
- SvtURLBox* m_pEDImportXSLT;
- PushButton* m_pPBImportXSLT;
+ VclPtr<SvtURLBox> m_pEDImportXSLT;
+ VclPtr<PushButton> m_pPBImportXSLT;
- SvtURLBox* m_pEDImportTemplate;
- PushButton* m_pPBImportTemplate;
+ VclPtr<SvtURLBox> m_pEDImportTemplate;
+ VclPtr<PushButton> m_pPBImportTemplate;
- CheckBox* m_pCBNeedsXSLT2;
+ VclPtr<CheckBox> m_pCBNeedsXSLT2;
private:
void SetURL( SvtURLBox *rURLBox, const OUString& rURL );
diff --git a/filter/source/xsltdialog/xmlfiltertestdialog.cxx b/filter/source/xsltdialog/xmlfiltertestdialog.cxx
index 359300e31ea9..2563cadada86 100644
--- a/filter/source/xsltdialog/xmlfiltertestdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltertestdialog.cxx
@@ -79,7 +79,7 @@ public:
// lang::XEventListener
virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw (RuntimeException, std::exception) SAL_OVERRIDE;
private:
- XMLFilterTestDialog* mpDialog;
+ VclPtr<XMLFilterTestDialog> mpDialog;
};
GlobalEventListenerImpl::GlobalEventListenerImpl( XMLFilterTestDialog* pDialog )
@@ -178,6 +178,11 @@ XMLFilterTestDialog::XMLFilterTestDialog(vcl::Window* pParent,
XMLFilterTestDialog::~XMLFilterTestDialog()
{
+ disposeOnce();
+}
+
+void XMLFilterTestDialog::dispose()
+{
try
{
if( mxGlobalBroadcaster.is() )
@@ -189,6 +194,21 @@ XMLFilterTestDialog::~XMLFilterTestDialog()
}
delete m_pFilterInfo;
+ m_pExport.clear();
+ m_pFTExportXSLTFile.clear();
+ m_pPBExportBrowse.clear();
+ m_pPBCurrentDocument.clear();
+ m_pFTNameOfCurrentFile.clear();
+ m_pImport.clear();
+ m_pFTImportXSLTFile.clear();
+ m_pFTImportTemplate.clear();
+ m_pFTImportTemplateFile.clear();
+ m_pCBXDisplaySource.clear();
+ m_pPBImportBrowse.clear();
+ m_pPBRecentFile.clear();
+ m_pFTNameOfRecentFile.clear();
+ m_pPBClose.clear();
+ ModalDialog::dispose();
}
void XMLFilterTestDialog::test( const filter_info_impl& rFilterInfo )
diff --git a/filter/source/xsltdialog/xmlfiltertestdialog.hxx b/filter/source/xsltdialog/xmlfiltertestdialog.hxx
index 45953483b43a..3d69341fec30 100644
--- a/filter/source/xsltdialog/xmlfiltertestdialog.hxx
+++ b/filter/source/xsltdialog/xmlfiltertestdialog.hxx
@@ -37,6 +37,7 @@ public:
XMLFilterTestDialog(vcl::Window* pParent,
const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext);
virtual ~XMLFilterTestDialog();
+ virtual void dispose() SAL_OVERRIDE;
void test( const filter_info_impl& rFilterInfo );
@@ -65,21 +66,21 @@ private:
OUString m_sImportRecentFile;
OUString m_sExportRecentFile;
- VclContainer* m_pExport;
- FixedText* m_pFTExportXSLTFile;
- PushButton* m_pPBExportBrowse;
- PushButton* m_pPBCurrentDocument;
- FixedText* m_pFTNameOfCurrentFile;
-
- VclContainer* m_pImport;
- FixedText* m_pFTImportXSLTFile;
- FixedText* m_pFTImportTemplate;
- FixedText* m_pFTImportTemplateFile;
- CheckBox* m_pCBXDisplaySource;
- PushButton* m_pPBImportBrowse;
- PushButton* m_pPBRecentFile;
- FixedText* m_pFTNameOfRecentFile;
- CloseButton* m_pPBClose;
+ VclPtr<VclContainer> m_pExport;
+ VclPtr<FixedText> m_pFTExportXSLTFile;
+ VclPtr<PushButton> m_pPBExportBrowse;
+ VclPtr<PushButton> m_pPBCurrentDocument;
+ VclPtr<FixedText> m_pFTNameOfCurrentFile;
+
+ VclPtr<VclContainer> m_pImport;
+ VclPtr<FixedText> m_pFTImportXSLTFile;
+ VclPtr<FixedText> m_pFTImportTemplate;
+ VclPtr<FixedText> m_pFTImportTemplateFile;
+ VclPtr<CheckBox> m_pCBXDisplaySource;
+ VclPtr<PushButton> m_pPBImportBrowse;
+ VclPtr<PushButton> m_pPBRecentFile;
+ VclPtr<FixedText> m_pFTNameOfRecentFile;
+ VclPtr<CloseButton> m_pPBClose;
filter_info_impl* m_pFilterInfo;
diff --git a/forms/source/richtext/richtextcontrol.cxx b/forms/source/richtext/richtextcontrol.cxx
index 39a29a2b9651..03d708752ae5 100644
--- a/forms/source/richtext/richtextcontrol.cxx
+++ b/forms/source/richtext/richtextcontrol.cxx
@@ -290,7 +290,7 @@ namespace frm
pPeer->acquire(); // by definition, the returned object is acquired once
// the VCL control for the peer
- RichTextControl* pRichTextControl = new RichTextControl( pEngine, _pParentWindow, _nStyle, NULL, pPeer );
+ VclPtrInstance<RichTextControl> pRichTextControl( pEngine, _pParentWindow, _nStyle, nullptr, pPeer );
// some knittings
pRichTextControl->SetComponentInterface( pPeer );
@@ -314,7 +314,7 @@ namespace frm
{
{
SolarMutexGuard aGuard;
- RichTextControl* pRichTextControl = static_cast< RichTextControl* >( GetWindow() );
+ VclPtr< RichTextControl > pRichTextControl = GetAs< RichTextControl >();
if ( pRichTextControl )
{
@@ -340,7 +340,7 @@ namespace frm
{
SolarMutexGuard aGuard;
- RichTextControl* pControl = static_cast< RichTextControl* >( GetWindow() );
+ VclPtr< RichTextControl > pControl = GetAs< RichTextControl >();
if ( !pControl )
return;
@@ -375,7 +375,7 @@ namespace frm
if ( _rPropertyName == PROPERTY_BACKGROUNDCOLOR )
{
- RichTextControl* pControl = static_cast< RichTextControl* >( GetWindow() );
+ VclPtr< RichTextControl > pControl = GetAs< RichTextControl >();
if ( !_rValue.hasValue() )
{
pControl->SetBackgroundColor( );
@@ -401,7 +401,7 @@ namespace frm
}
else if ( _rPropertyName == PROPERTY_READONLY )
{
- RichTextControl* pControl = static_cast< RichTextControl* >( GetWindow() );
+ VclPtr< RichTextControl > pControl = GetAs< RichTextControl >();
bool bReadOnly( pControl->IsReadOnly() );
OSL_VERIFY( _rValue >>= bReadOnly );
pControl->SetReadOnly( bReadOnly );
@@ -417,7 +417,7 @@ namespace frm
}
else if ( _rPropertyName == PROPERTY_HIDEINACTIVESELECTION )
{
- RichTextControl* pRichTextControl = static_cast< RichTextControl* >( GetWindow() );
+ VclPtr< RichTextControl > pRichTextControl = GetAs< RichTextControl >();
bool bHide = pRichTextControl->GetHideInactiveSelection();
OSL_VERIFY( _rValue >>= bHide );
pRichTextControl->SetHideInactiveSelection( bHide );
@@ -469,7 +469,7 @@ namespace frm
ORichTextPeer::SingleAttributeDispatcher ORichTextPeer::implCreateDispatcher( SfxSlotId _nSlotId, const ::com::sun::star::util::URL& _rURL )
{
- RichTextControl* pRichTextControl = static_cast< RichTextControl* >( GetWindow() );
+ VclPtr< RichTextControl > pRichTextControl = GetAs< RichTextControl >();
OSL_PRECOND( pRichTextControl, "ORichTextPeer::implCreateDispatcher: invalid window!" );
if ( !pRichTextControl )
return SingleAttributeDispatcher( NULL );
diff --git a/forms/source/richtext/richtextimplcontrol.cxx b/forms/source/richtext/richtextimplcontrol.cxx
index a29f626749af..50c483b97151 100644
--- a/forms/source/richtext/richtextimplcontrol.cxx
+++ b/forms/source/richtext/richtextimplcontrol.cxx
@@ -56,7 +56,7 @@ namespace frm
OSL_ENSURE( m_pAntiImpl, "RichTextControlImpl::RichTextControlImpl: invalid window!" );
OSL_ENSURE( m_pEngine, "RichTextControlImpl::RichTextControlImpl: invalid edit engine! This will *definitely* crash!" );
- m_pViewport = new RichTextViewPort( m_pAntiImpl );
+ m_pViewport = VclPtr<RichTextViewPort>::Create( m_pAntiImpl );
m_pViewport->setAttributeInvalidationHandler( LINK( this, RichTextControlImpl, OnInvalidateAllAttributes ) );
m_pViewport->Show();
@@ -91,10 +91,10 @@ namespace frm
m_pEngine->RemoveView( m_pView );
m_pEngine->revokeEngineStatusListener( this );
delete m_pView;
- delete m_pViewport;
- delete m_pHScroll;
- delete m_pVScroll;
- delete m_pScrollCorner;
+ m_pViewport.disposeAndClear();
+ m_pHScroll.disposeAndClear();
+ m_pVScroll.disposeAndClear();
+ m_pScrollCorner.disposeAndClear();
}
@@ -344,38 +344,35 @@ namespace frm
// create or delete the scrollbars, as necessary
if ( !bNeedVScroll )
{
- delete m_pVScroll;
- m_pVScroll = NULL;
+ m_pVScroll.disposeAndClear();
}
else
{
- m_pVScroll = new ScrollBar( m_pAntiImpl, WB_VSCROLL | WB_DRAG | WB_REPEAT );
+ m_pVScroll = VclPtr<ScrollBar>::Create( m_pAntiImpl, WB_VSCROLL | WB_DRAG | WB_REPEAT );
m_pVScroll->SetScrollHdl ( LINK( this, RichTextControlImpl, OnVScroll ) );
m_pVScroll->Show();
}
if ( !bNeedHScroll )
{
- delete m_pHScroll;
- m_pHScroll = NULL;
+ m_pHScroll.disposeAndClear();
}
else
{
- m_pHScroll = new ScrollBar( m_pAntiImpl, WB_HSCROLL | WB_DRAG | WB_REPEAT );
+ m_pHScroll = VclPtr<ScrollBar>::Create( m_pAntiImpl, WB_HSCROLL | WB_DRAG | WB_REPEAT );
m_pHScroll->SetScrollHdl ( LINK( this, RichTextControlImpl, OnHScroll ) );
m_pHScroll->Show();
}
if ( m_pHScroll && m_pVScroll )
{
- delete m_pScrollCorner;
- m_pScrollCorner = new ScrollBarBox( m_pAntiImpl );
+ m_pScrollCorner.disposeAndClear();
+ m_pScrollCorner = VclPtr<ScrollBarBox>::Create( m_pAntiImpl );
m_pScrollCorner->Show();
}
else
{
- delete m_pScrollCorner;
- m_pScrollCorner = NULL;
+ m_pScrollCorner.disposeAndClear();
}
layoutWindow();
diff --git a/forms/source/richtext/richtextimplcontrol.hxx b/forms/source/richtext/richtextimplcontrol.hxx
index 0b6c42cc63ad..2f0acb1da700 100644
--- a/forms/source/richtext/richtextimplcontrol.hxx
+++ b/forms/source/richtext/richtextimplcontrol.hxx
@@ -52,11 +52,11 @@ namespace frm
ESelection m_aLastKnownSelection;
- Control* m_pAntiImpl;
- RichTextViewPort* m_pViewport;
- ScrollBar* m_pHScroll;
- ScrollBar* m_pVScroll;
- ScrollBarBox* m_pScrollCorner;
+ VclPtr<Control> m_pAntiImpl;
+ VclPtr<RichTextViewPort> m_pViewport;
+ VclPtr<ScrollBar> m_pHScroll;
+ VclPtr<ScrollBar> m_pVScroll;
+ VclPtr<ScrollBarBox> m_pScrollCorner;
RichTextEngine* m_pEngine;
EditView* m_pView;
ITextAttributeListener* m_pTextAttrListener;
@@ -166,8 +166,8 @@ namespace frm
/// ensures that our "automatic line break" setting matches the current WinBits of the window
void ensureLineBreakSetting();
- inline bool hasVScrollBar( ) const { return m_pVScroll != NULL; }
- inline bool hasHScrollBar( ) const { return m_pHScroll != NULL; }
+ inline bool hasVScrollBar( ) const { return m_pVScroll != nullptr; }
+ inline bool hasHScrollBar( ) const { return m_pHScroll != nullptr; }
// IEngineStatusListener overridables
virtual void EditEngineStatusChanged( const EditStatus& _rStatus ) SAL_OVERRIDE;
diff --git a/forms/source/richtext/richtextvclcontrol.cxx b/forms/source/richtext/richtextvclcontrol.cxx
index 722bdefa52d7..d7286204921c 100644
--- a/forms/source/richtext/richtextvclcontrol.cxx
+++ b/forms/source/richtext/richtextvclcontrol.cxx
@@ -59,7 +59,13 @@ namespace frm
RichTextControl::~RichTextControl( )
{
+ disposeOnce();
+ }
+
+ void RichTextControl::dispose()
+ {
delete m_pImpl;
+ Control::dispose();
}
diff --git a/forms/source/richtext/richtextvclcontrol.hxx b/forms/source/richtext/richtextvclcontrol.hxx
index 4e3123d0b75a..b5532ca4bc0f 100644
--- a/forms/source/richtext/richtextvclcontrol.hxx
+++ b/forms/source/richtext/richtextvclcontrol.hxx
@@ -52,6 +52,7 @@ namespace frm
);
virtual ~RichTextControl( );
+ virtual void dispose() SAL_OVERRIDE;
/* enables the change notifications for a particular attribute
diff --git a/forms/source/runtime/formoperations.cxx b/forms/source/runtime/formoperations.cxx
index e6e831d27539..880fa0f405ba 100644
--- a/forms/source/runtime/formoperations.cxx
+++ b/forms/source/runtime/formoperations.cxx
@@ -445,8 +445,8 @@ namespace frm
if(needConfirmation)
{
// TODO: shouldn't this be done with an interaction handler?
- QueryBox aQuery( NULL, WB_YES_NO_CANCEL | WB_DEF_YES, FRM_RES_STRING( RID_STR_QUERY_SAVE_MODIFIED_ROW ) );
- switch ( aQuery.Execute() )
+ ScopedVclPtrInstance< QueryBox > aQuery( nullptr, WB_YES_NO_CANCEL | WB_DEF_YES, FRM_RES_STRING( RID_STR_QUERY_SAVE_MODIFIED_ROW ) );
+ switch ( aQuery->Execute() )
{
case RET_NO:
shouldCommit = false;
diff --git a/forms/source/solar/component/navbarcontrol.cxx b/forms/source/solar/component/navbarcontrol.cxx
index 3f2afea11653..6d335d9bf3de 100644
--- a/forms/source/solar/component/navbarcontrol.cxx
+++ b/forms/source/solar/component/navbarcontrol.cxx
@@ -223,7 +223,7 @@ namespace frm
// the VCL control for the peer
Reference< XModel > xContextDocument( getXModel( _rxModel ) );
- NavigationToolBar* pNavBar = new NavigationToolBar(
+ VclPtrInstance<NavigationToolBar> pNavBar(
_pParentWindow,
lcl_getWinBits_nothrow( _rxModel ),
createDocumentCommandImageProvider( _rxORB, xContextDocument ),
@@ -275,7 +275,7 @@ namespace frm
{
SolarMutexGuard aGuard;
- NavigationToolBar* pNavBar = static_cast< NavigationToolBar* >( GetWindow() );
+ VclPtr< NavigationToolBar > pNavBar = GetAs< NavigationToolBar >();
if ( !pNavBar )
{
VCLXWindow::setProperty( _rPropertyName, _rValue );
@@ -356,7 +356,7 @@ namespace frm
SolarMutexGuard aGuard;
Any aReturn;
- NavigationToolBar* pNavBar = static_cast< NavigationToolBar* >( GetWindow() );
+ VclPtr< NavigationToolBar > pNavBar = GetAs< NavigationToolBar >();
if ( _rPropertyName == PROPERTY_BACKGROUNDCOLOR )
{
@@ -408,7 +408,7 @@ namespace frm
void ONavigationBarPeer::featureStateChanged( sal_Int16 _nFeatureId, bool _bEnabled )
{
// enable this button on the toolbox
- NavigationToolBar* pNavBar = static_cast< NavigationToolBar* >( GetWindow() );
+ VclPtr< NavigationToolBar > pNavBar = GetAs< NavigationToolBar >();
if ( pNavBar )
{
pNavBar->enableFeature( _nFeatureId, _bEnabled );
@@ -436,7 +436,7 @@ namespace frm
void ONavigationBarPeer::allFeatureStatesChanged( )
{
// force the control to update it's states
- NavigationToolBar* pNavBar = static_cast< NavigationToolBar* >( GetWindow() );
+ VclPtr< NavigationToolBar > pNavBar = GetAs< NavigationToolBar >();
if ( pNavBar )
pNavBar->setDispatcher( this );
diff --git a/forms/source/solar/control/navtoolbar.cxx b/forms/source/solar/control/navtoolbar.cxx
index 3ccbf2eb8457..19bcd6937d5f 100644
--- a/forms/source/solar/control/navtoolbar.cxx
+++ b/forms/source/solar/control/navtoolbar.cxx
@@ -147,14 +147,16 @@ namespace frm
NavigationToolBar::~NavigationToolBar( )
{
- for ( ::std::vector< vcl::Window* >::iterator loopChildWins = m_aChildWins.begin();
- loopChildWins != m_aChildWins.end();
- ++loopChildWins
- )
- {
- delete *loopChildWins;
- }
- delete m_pToolbar;
+ disposeOnce();
+ }
+
+ void NavigationToolBar::dispose()
+ {
+ for (auto i = m_aChildWins.begin(); i != m_aChildWins.end(); ++i)
+ i->disposeAndClear();
+ m_aChildWins.clear();
+ m_pToolbar.disposeAndClear();
+ vcl::Window::dispose();
}
@@ -234,7 +236,7 @@ namespace frm
void NavigationToolBar::implInit( )
{
- m_pToolbar = new ImplNavToolBar( this );
+ m_pToolbar = VclPtr<ImplNavToolBar>::Create( this );
m_pToolbar->SetOutStyle( TOOLBOX_STYLE_FLAT );
m_pToolbar->Show();
@@ -299,17 +301,17 @@ namespace frm
vcl::Window* pItemWindow = NULL;
if ( FormFeature::MoveAbsolute == pSupportedFeatures->nId )
{
- pItemWindow = new RecordPositionInput( m_pToolbar );
+ pItemWindow = VclPtr<RecordPositionInput>::Create( m_pToolbar );
static_cast< RecordPositionInput* >( pItemWindow )->setDispatcher( m_pDispatcher );
}
else if ( LID_RECORD_FILLER == pSupportedFeatures->nId )
{
- pItemWindow = new FixedText( m_pToolbar, WB_CENTER | WB_VCENTER );
+ pItemWindow = VclPtr<FixedText>::Create( m_pToolbar, WB_CENTER | WB_VCENTER );
pItemWindow->SetBackground(Wallpaper(Color(COL_TRANSPARENT)));
}
else
{
- pItemWindow = new FixedText( m_pToolbar, WB_VCENTER );
+ pItemWindow = VclPtr<FixedText>::Create( m_pToolbar, WB_VCENTER );
pItemWindow->SetBackground();
pItemWindow->SetPaintTransparent(true);
}
@@ -658,11 +660,6 @@ namespace frm
}
- RecordPositionInput::~RecordPositionInput()
- {
- }
-
-
void RecordPositionInput::setDispatcher( const IFeatureDispatcher* _pDispatcher )
{
m_pDispatcher = _pDispatcher;
diff --git a/forms/source/solar/inc/navtoolbar.hxx b/forms/source/solar/inc/navtoolbar.hxx
index 5be47c86c5f1..79d126655a03 100644
--- a/forms/source/solar/inc/navtoolbar.hxx
+++ b/forms/source/solar/inc/navtoolbar.hxx
@@ -60,8 +60,8 @@ namespace frm
const ::boost::shared_ptr< const ICommandDescriptionProvider >
m_pDescriptionProvider;
ImageSize m_eImageSize;
- ImplNavToolBar* m_pToolbar;
- ::std::vector< vcl::Window* > m_aChildWins;
+ VclPtr<ImplNavToolBar> m_pToolbar;
+ ::std::vector< VclPtr<vcl::Window> > m_aChildWins;
public:
NavigationToolBar(
@@ -71,6 +71,7 @@ namespace frm
const ::boost::shared_ptr< const ICommandDescriptionProvider >& _pDescriptionProvider
);
virtual ~NavigationToolBar( );
+ virtual void dispose() SAL_OVERRIDE;
/** sets the dispatcher which is to be used for the features
@@ -158,7 +159,6 @@ namespace frm
public:
RecordPositionInput( vcl::Window* _pParent );
- virtual ~RecordPositionInput();
/** sets the dispatcher which is to be used for the features
*/
diff --git a/formula/source/ui/dlg/ControlHelper.hxx b/formula/source/ui/dlg/ControlHelper.hxx
index 4c7e56420c22..aba773361dcf 100644
--- a/formula/source/ui/dlg/ControlHelper.hxx
+++ b/formula/source/ui/dlg/ControlHelper.hxx
@@ -29,7 +29,7 @@ class EditBox : public Control
{
private:
- MultiLineEdit* pMEdit;
+ VclPtr<MultiLineEdit> pMEdit;
Link aSelChangedLink;
Selection aOldSel;
bool bMouseFlag;
@@ -48,6 +48,7 @@ public:
EditBox( vcl::Window* pParent, WinBits nBits );
virtual ~EditBox();
+ virtual void dispose() SAL_OVERRIDE;
MultiLineEdit* GetEdit() {return pMEdit;}
@@ -64,6 +65,8 @@ class ArgEdit : public RefEdit
{
public:
ArgEdit( vcl::Window* pParent, WinBits nBits );
+ virtual ~ArgEdit();
+ virtual void dispose() SAL_OVERRIDE;
void Init( ArgEdit* pPrevEdit, ArgEdit* pNextEdit,
ScrollBar& rArgSlider, sal_uInt16 nArgCount );
@@ -72,9 +75,9 @@ protected:
virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
private:
- ArgEdit* pEdPrev;
- ArgEdit* pEdNext;
- ScrollBar* pSlider;
+ VclPtr<ArgEdit> pEdPrev;
+ VclPtr<ArgEdit> pEdNext;
+ VclPtr<ScrollBar> pSlider;
sal_uInt16 nArgs;
};
@@ -93,10 +96,10 @@ private:
Link aEdFocusLink;
Link aEdModifyLink;
- FixedText* pFtArg;
- PushButton* pBtnFx;
- ArgEdit* pEdArg;
- RefButton* pRefBtn;
+ VclPtr<FixedText> pFtArg;
+ VclPtr<PushButton> pBtnFx;
+ VclPtr<ArgEdit> pEdArg;
+ VclPtr<RefButton> pRefBtn;
DECL_LINK( FxBtnClickHdl, ImageButton* );
DECL_LINK( RefBtnClickHdl,RefButton* );
diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx
index 15ca7bde9c9b..7f20431ab1bb 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -146,43 +146,43 @@ namespace formula
mutable const sheet::FormulaOpCodeMapEntry* m_pBinaryOpCodesEnd;
::std::map<FormulaToken*,sheet::FormulaToken> m_aTokenMap;
IFormulaEditorHelper* m_pHelper;
- Dialog* m_pParent;
+ VclPtr<Dialog> m_pParent;
IControlReferenceHandler* m_pDlg;
- TabControl *m_pTabCtrl;
- VclVBox *m_pParaWinBox;
- ParaWin* pParaWin;
- FixedText *m_pFtHeadLine;
- FixedText *m_pFtFuncName;
- FixedText *m_pFtFuncDesc;
+ VclPtr<TabControl> m_pTabCtrl;
+ VclPtr<VclVBox> m_pParaWinBox;
+ VclPtr<ParaWin> pParaWin;
+ VclPtr<FixedText> m_pFtHeadLine;
+ VclPtr<FixedText> m_pFtFuncName;
+ VclPtr<FixedText> m_pFtFuncDesc;
- FixedText *m_pFtEditName;
+ VclPtr<FixedText> m_pFtEditName;
- FixedText *m_pFtResult;
- Edit *m_pWndResult;
+ VclPtr<FixedText> m_pFtResult;
+ VclPtr<Edit> m_pWndResult;
- FixedText *m_pFtFormula;
- EditBox *m_pMEFormula;
+ VclPtr<FixedText> m_pFtFormula;
+ VclPtr<EditBox> m_pMEFormula;
- CheckBox *m_pBtnMatrix;
- CancelButton *m_pBtnCancel;
+ VclPtr<CheckBox> m_pBtnMatrix;
+ VclPtr<CancelButton> m_pBtnCancel;
- PushButton *m_pBtnBackward;
- PushButton *m_pBtnForward;
- OKButton *m_pBtnEnd;
+ VclPtr<PushButton> m_pBtnBackward;
+ VclPtr<PushButton> m_pBtnForward;
+ VclPtr<OKButton> m_pBtnEnd;
- RefEdit *m_pEdRef;
- RefButton *m_pRefBtn;
+ VclPtr<RefEdit> m_pEdRef;
+ VclPtr<RefButton> m_pRefBtn;
- FixedText *m_pFtFormResult;
- Edit *m_pWndFormResult;
+ VclPtr<FixedText> m_pFtFormResult;
+ VclPtr<Edit> m_pWndFormResult;
- RefEdit* pTheRefEdit;
- RefButton* pTheRefButton;
- FuncPage* pFuncPage;
- StructPage* pStructPage;
+ VclPtr<RefEdit> pTheRefEdit;
+ VclPtr<RefButton> pTheRefButton;
+ VclPtr<FuncPage> pFuncPage;
+ VclPtr<StructPage> pStructPage;
OUString aOldFormula;
bool bStructUpdate;
- MultiLineEdit* pMEdit;
+ VclPtr<MultiLineEdit> pMEdit;
bool bUserMatrixFlag;
Idle aIdle;
@@ -286,7 +286,7 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent
pParent->get(m_pRefBtn, "RB_REF");
m_pRefBtn->SetReferences(_pDlg, m_pEdRef);
- pParaWin = new ParaWin(m_pParaWinBox, _pDlg);
+ pParaWin = VclPtr<ParaWin>::Create(m_pParaWinBox, _pDlg);
pParaWin->Show();
m_pParaWinBox->Hide();
m_pFtEditName->Hide();
@@ -306,8 +306,8 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent
pParaWin->SetArgModifiedHdl(LINK( this, FormulaDlg_Impl, ModifyHdl ) );
pParaWin->SetFxHdl(LINK( this, FormulaDlg_Impl, FxHdl ) );
- pFuncPage= new FuncPage( m_pTabCtrl,_pFunctionMgr);
- pStructPage= new StructPage( m_pTabCtrl);
+ pFuncPage= VclPtr<FuncPage>::Create( m_pTabCtrl,_pFunctionMgr);
+ pStructPage= VclPtr<StructPage>::Create( m_pTabCtrl);
pFuncPage->Hide();
pStructPage->Hide();
m_pTabCtrl->SetTabPage( TP_FUNCTION, pFuncPage);
@@ -364,9 +364,9 @@ FormulaDlg_Impl::~FormulaDlg_Impl()
m_pTabCtrl->RemovePage(TP_FUNCTION);
m_pTabCtrl->RemovePage(TP_STRUCT);
- delete pStructPage;
- delete pFuncPage;
- delete pParaWin;
+ pStructPage.disposeAndClear();
+ pFuncPage.disposeAndClear();
+ pParaWin.disposeAndClear();
DeleteArgs();
}
@@ -1426,7 +1426,7 @@ void FormulaDlg_Impl::UpdateSelection()
m_pRefBtn->Show( pButton != NULL );
::std::pair<RefButton*,RefEdit*> aPair;
- aPair.first = pButton ? m_pRefBtn : NULL;
+ aPair.first = pButton ? m_pRefBtn.get() : NULL;
aPair.second = m_pEdRef;
return aPair;
}
@@ -1473,7 +1473,7 @@ void FormulaDlg_Impl::RefInputDoneAfter( bool bForced )
}
RefEdit* FormulaDlg_Impl::GetCurrRefEdit()
{
- return m_pEdRef->IsVisible() ? m_pEdRef : pParaWin->GetActiveEdit();
+ return m_pEdRef->IsVisible() ? m_pEdRef.get() : pParaWin->GetActiveEdit();
}
void FormulaDlg_Impl::Update()
{
@@ -1612,7 +1612,7 @@ bool FormulaDlg_Impl::UpdateParaWin(Selection& _rSelection)
OUString aStrEd;
Edit* pEd = GetCurrRefEdit();
- if(pEd!=NULL && pTheRefEdit==NULL)
+ if(pEd!=NULL && pTheRefEdit==nullptr)
{
_rSelection=pEd->GetSelection();
_rSelection.Justify();
@@ -1626,7 +1626,7 @@ bool FormulaDlg_Impl::UpdateParaWin(Selection& _rSelection)
_rSelection.Justify();
aStrEd= m_pEdRef->GetText();
}
- return pTheRefEdit == NULL;
+ return pTheRefEdit == nullptr;
}
void FormulaDlg_Impl::SetEdSelection()
diff --git a/formula/source/ui/dlg/funcpage.cxx b/formula/source/ui/dlg/funcpage.cxx
index a977b174d543..886cab46c063 100644
--- a/formula/source/ui/dlg/funcpage.cxx
+++ b/formula/source/ui/dlg/funcpage.cxx
@@ -91,6 +91,18 @@ FuncPage::FuncPage(vcl::Window* pParent,const IFunctionManager* _pFunctionManage
m_pLbFunction->SetDoubleClickHdl( LINK( this, FuncPage, DblClkHdl ) );
}
+FuncPage::~FuncPage()
+{
+ disposeOnce();
+}
+
+void FuncPage::dispose()
+{
+ m_pLbCategory.clear();
+ m_pLbFunction.clear();
+ TabPage::dispose();
+}
+
void FuncPage::impl_addFunctions(const IFunctionCategory* _pCategory)
{
const sal_uInt32 nCount = _pCategory->getCount();
diff --git a/formula/source/ui/dlg/funcpage.hxx b/formula/source/ui/dlg/funcpage.hxx
index 62d803dd8ed6..87a2799dcfac 100644
--- a/formula/source/ui/dlg/funcpage.hxx
+++ b/formula/source/ui/dlg/funcpage.hxx
@@ -64,8 +64,8 @@ private:
OModuleClient m_aModuleClient;
Link aDoubleClickLink;
Link aSelectionLink;
- ListBox *m_pLbCategory;
- FormulaListBox *m_pLbFunction;
+ VclPtr<ListBox> m_pLbCategory;
+ VclPtr<FormulaListBox> m_pLbFunction;
const IFunctionManager*
m_pFunctionManager;
@@ -86,6 +86,8 @@ protected:
public:
FuncPage( vcl::Window* pParent,const IFunctionManager* _pFunctionManager);
+ virtual ~FuncPage();
+ virtual void dispose() SAL_OVERRIDE;
void SetCategory(sal_Int32 nCat);
void SetFunction(sal_Int32 nFunc);
diff --git a/formula/source/ui/dlg/funcutl.cxx b/formula/source/ui/dlg/funcutl.cxx
index d6313d418a0a..271d8b83cafa 100644
--- a/formula/source/ui/dlg/funcutl.cxx
+++ b/formula/source/ui/dlg/funcutl.cxx
@@ -42,6 +42,19 @@ ArgEdit::ArgEdit( vcl::Window* pParent, WinBits nBits )
{
}
+ArgEdit::~ArgEdit()
+{
+ disposeOnce();
+}
+
+void ArgEdit::dispose()
+{
+ pEdPrev.clear();
+ pEdNext.clear();
+ pSlider.clear();
+ RefEdit::dispose();
+}
+
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeArgEdit(vcl::Window *pParent, VclBuilder::stringmap &)
{
return new ArgEdit(pParent, WB_BORDER);
@@ -149,17 +162,17 @@ void ArgInput::InitArgInput( FixedText* pftArg, PushButton* pbtnFx,
pEdArg =pedArg;
pRefBtn=prefBtn;
- if(pBtnFx!=NULL)
+ if(pBtnFx!=nullptr)
{
pBtnFx->SetClickHdl ( LINK( this, ArgInput, FxBtnClickHdl ) );
pBtnFx->SetGetFocusHdl( LINK( this, ArgInput, FxBtnFocusHdl ) );
}
- if(pRefBtn!=NULL)
+ if(pRefBtn!=nullptr)
{
pRefBtn->SetClickHdl ( LINK( this, ArgInput, RefBtnClickHdl ) );
pRefBtn->SetGetFocusHdl( LINK( this, ArgInput, RefBtnFocusHdl ) );
}
- if(pEdArg!=NULL)
+ if(pEdArg!=nullptr)
{
pEdArg->SetGetFocusHdl ( LINK( this, ArgInput, EdFocusHdl ) );
pEdArg->SetModifyHdl ( LINK( this, ArgInput, EdModifyHdl ) );
@@ -170,14 +183,14 @@ void ArgInput::InitArgInput( FixedText* pftArg, PushButton* pbtnFx,
// Sets the Name for the Argument
void ArgInput::SetArgName(const OUString &aArg)
{
- if(pFtArg !=NULL) pFtArg->SetText(aArg );
+ if(pFtArg !=nullptr) pFtArg->SetText(aArg );
}
// Returns the Name for the Argument
OUString ArgInput::GetArgName()
{
OUString aPrivArgName;
- if(pFtArg !=NULL)
+ if(pFtArg !=nullptr)
aPrivArgName=pFtArg->GetText();
return aPrivArgName;
@@ -186,19 +199,19 @@ OUString ArgInput::GetArgName()
//Sets the Name for the Argument
void ArgInput::SetArgNameFont (const vcl::Font &aFont)
{
- if(pFtArg !=NULL) pFtArg->SetFont(aFont);
+ if(pFtArg !=nullptr) pFtArg->SetFont(aFont);
}
//Sets up the Selection for the EditBox.
void ArgInput::SetArgSelection (const Selection& rSel )
{
- if(pEdArg !=NULL) pEdArg ->SetSelection(rSel );
+ if(pEdArg !=nullptr) pEdArg ->SetSelection(rSel );
}
//Sets the Value for the Argument
void ArgInput::SetArgVal(const OUString &rVal)
{
- if(pEdArg !=NULL)
+ if(pEdArg != nullptr)
{
pEdArg ->SetRefString(rVal);
}
@@ -208,7 +221,7 @@ void ArgInput::SetArgVal(const OUString &rVal)
OUString ArgInput::GetArgVal()
{
OUString aResult;
- if(pEdArg!=NULL)
+ if(pEdArg!=nullptr)
{
aResult=pEdArg->GetText();
}
@@ -340,7 +353,7 @@ EditBox::EditBox( vcl::Window* pParent, WinBits nBits )
WinBits nStyle=GetStyle();
SetStyle( nStyle| WB_DIALOGCONTROL);
- pMEdit=new MultiLineEdit(this,WB_LEFT | WB_VSCROLL | (nStyle & WB_TABSTOP) |
+ pMEdit=VclPtr<MultiLineEdit>::Create(this,WB_LEFT | WB_VSCROLL | (nStyle & WB_TABSTOP) |
WB_NOBORDER | WB_NOHIDESELECTION | WB_IGNORETAB);
pMEdit->Show();
aOldSel=pMEdit->GetSelection();
@@ -361,10 +374,14 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeEditBox(vcl::Window *p
EditBox::~EditBox()
{
- MultiLineEdit* pTheEdit=pMEdit;
+ disposeOnce();
+}
+
+void EditBox::dispose()
+{
pMEdit->Disable();
- pMEdit=NULL;
- delete pTheEdit;
+ pMEdit.disposeAndClear();
+ Control::dispose();
}
// When the selection is changed this function will be called
@@ -377,14 +394,14 @@ void EditBox::SelectionChanged()
void EditBox::Resize()
{
Size aSize=GetOutputSizePixel();
- if(pMEdit!=NULL) pMEdit->SetOutputSizePixel(aSize);
+ if(pMEdit!=nullptr) pMEdit->SetOutputSizePixel(aSize);
}
// When the Control is activated, the Selection is repealed
// and the Cursor set at the end.
void EditBox::GetFocus()
{
- if(pMEdit!=NULL)
+ if(pMEdit!=nullptr)
{
pMEdit->GrabFocus();
}
@@ -396,7 +413,7 @@ bool EditBox::PreNotify( NotifyEvent& rNEvt )
{
bool nResult = true;
- if(pMEdit==NULL) return nResult;
+ if(pMEdit==nullptr) return nResult;
MouseNotifyEvent nSwitch=rNEvt.GetType();
if(nSwitch==MouseNotifyEvent::KEYINPUT)// || nSwitch==MouseNotifyEvent::KEYUP)
@@ -431,7 +448,7 @@ bool EditBox::PreNotify( NotifyEvent& rNEvt )
//first called.
IMPL_LINK_NOARG(EditBox, ChangedHdl)
{
- if(pMEdit!=NULL)
+ if(pMEdit!=nullptr)
{
Selection aNewSel=pMEdit->GetSelection();
@@ -481,8 +498,15 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeRefEdit(vcl::Window *p
RefEdit::~RefEdit()
{
+ disposeOnce();
+}
+
+void RefEdit::dispose()
+{
aIdle.SetIdleHdl( Link() );
aIdle.Stop();
+ pLabelWidget.clear();
+ Edit::dispose();
}
void RefEdit::SetRefString( const OUString& rStr )
@@ -581,6 +605,17 @@ RefButton::RefButton( vcl::Window* _pParent, WinBits nStyle ) :
SetStartImage();
}
+RefButton::~RefButton()
+{
+ disposeOnce();
+}
+
+void RefButton::dispose()
+{
+ pRefEdit.clear();
+ ImageButton::dispose();
+}
+
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeRefButton(vcl::Window *pParent, VclBuilder::stringmap &)
{
return new RefButton(pParent, 0);
diff --git a/formula/source/ui/dlg/parawin.cxx b/formula/source/ui/dlg/parawin.cxx
index 9e3a647eed04..539661b05b1c 100644
--- a/formula/source/ui/dlg/parawin.cxx
+++ b/formula/source/ui/dlg/parawin.cxx
@@ -221,6 +221,11 @@ void ParaWin::UpdateArgInput( sal_uInt16 nOffset, sal_uInt16 i )
ParaWin::~ParaWin()
{
+ disposeOnce();
+}
+
+void ParaWin::dispose()
+{
// #i66422# if the focus changes during destruction of the controls,
// don't call the focus handlers
Link aEmptyLink;
@@ -228,6 +233,27 @@ ParaWin::~ParaWin()
m_pBtnFx2->SetGetFocusHdl( aEmptyLink );
m_pBtnFx3->SetGetFocusHdl( aEmptyLink );
m_pBtnFx4->SetGetFocusHdl( aEmptyLink );
+ m_pFtEditDesc.clear();
+ m_pFtArgName.clear();
+ m_pFtArgDesc.clear();
+ m_pBtnFx1.clear();
+ m_pFtArg1.clear();
+ m_pEdArg1.clear();
+ m_pRefBtn1.clear();
+ m_pBtnFx2.clear();
+ m_pFtArg2.clear();
+ m_pEdArg2.clear();
+ m_pRefBtn2.clear();
+ m_pBtnFx3.clear();
+ m_pFtArg3.clear();
+ m_pEdArg3.clear();
+ m_pRefBtn3.clear();
+ m_pBtnFx4.clear();
+ m_pFtArg4.clear();
+ m_pEdArg4.clear();
+ m_pRefBtn4.clear();
+ m_pSlider.clear();
+ TabPage::dispose();
}
diff --git a/formula/source/ui/dlg/parawin.hxx b/formula/source/ui/dlg/parawin.hxx
index 5bf159b4f5d4..6a83c4d59218 100644
--- a/formula/source/ui/dlg/parawin.hxx
+++ b/formula/source/ui/dlg/parawin.hxx
@@ -56,31 +56,31 @@ private:
vcl::Font aFntBold;
vcl::Font aFntLight;
- FixedText *m_pFtEditDesc;
- FixedText *m_pFtArgName;
- FixedText *m_pFtArgDesc;
-
- PushButton *m_pBtnFx1;
- FixedText *m_pFtArg1;
- ArgEdit *m_pEdArg1;
- RefButton *m_pRefBtn1;
-
- PushButton *m_pBtnFx2;
- FixedText *m_pFtArg2;
- ArgEdit *m_pEdArg2;
- RefButton *m_pRefBtn2;
-
- PushButton *m_pBtnFx3;
- FixedText *m_pFtArg3;
- ArgEdit *m_pEdArg3;
- RefButton *m_pRefBtn3;
-
- PushButton *m_pBtnFx4;
- FixedText *m_pFtArg4;
- ArgEdit *m_pEdArg4;
- RefButton *m_pRefBtn4;
-
- ScrollBar *m_pSlider;
+ VclPtr<FixedText> m_pFtEditDesc;
+ VclPtr<FixedText> m_pFtArgName;
+ VclPtr<FixedText> m_pFtArgDesc;
+
+ VclPtr<PushButton> m_pBtnFx1;
+ VclPtr<FixedText> m_pFtArg1;
+ VclPtr<ArgEdit> m_pEdArg1;
+ VclPtr<RefButton> m_pRefBtn1;
+
+ VclPtr<PushButton> m_pBtnFx2;
+ VclPtr<FixedText> m_pFtArg2;
+ VclPtr<ArgEdit> m_pEdArg2;
+ VclPtr<RefButton> m_pRefBtn2;
+
+ VclPtr<PushButton> m_pBtnFx3;
+ VclPtr<FixedText> m_pFtArg3;
+ VclPtr<ArgEdit> m_pEdArg3;
+ VclPtr<RefButton> m_pRefBtn3;
+
+ VclPtr<PushButton> m_pBtnFx4;
+ VclPtr<FixedText> m_pFtArg4;
+ VclPtr<ArgEdit> m_pEdArg4;
+ VclPtr<RefButton> m_pRefBtn4;
+
+ VclPtr<ScrollBar> m_pSlider;
OUString m_sOptional;
OUString m_sRequired;
bool bRefMode;
@@ -125,6 +125,7 @@ protected:
public:
ParaWin(vcl::Window* pParent,IControlReferenceHandler* _pDlg);
virtual ~ParaWin();
+ virtual void dispose() SAL_OVERRIDE;
void SetFunctionDesc(const IFunctionDescription* pFDesc);
void SetArgumentOffset(sal_uInt16 nOffset);
diff --git a/formula/source/ui/dlg/structpg.cxx b/formula/source/ui/dlg/structpg.cxx
index 4bcdc15e44b9..eb39a60e55d6 100644
--- a/formula/source/ui/dlg/structpg.cxx
+++ b/formula/source/ui/dlg/structpg.cxx
@@ -103,6 +103,17 @@ StructPage::StructPage(vcl::Window* pParent):
m_pTlbStruct->SetSelectHdl(LINK( this, StructPage, SelectHdl ) );
}
+StructPage::~StructPage()
+{
+ disposeOnce();
+}
+
+void StructPage::dispose()
+{
+ m_pTlbStruct.clear();
+ TabPage::dispose();
+}
+
void StructPage::ClearStruct()
{
m_pTlbStruct->SetActiveFlag(false);
diff --git a/formula/source/ui/dlg/structpg.hxx b/formula/source/ui/dlg/structpg.hxx
index bdd4fcd7d70d..d0a3b35066e9 100644
--- a/formula/source/ui/dlg/structpg.hxx
+++ b/formula/source/ui/dlg/structpg.hxx
@@ -73,7 +73,7 @@ private:
OModuleClient m_aModuleClient;
Link aSelLink;
- StructListBox *m_pTlbStruct;
+ VclPtr<StructListBox> m_pTlbStruct;
Image maImgEnd;
Image maImgError;
@@ -90,6 +90,8 @@ protected:
public:
StructPage( vcl::Window* pParent);
+ virtual ~StructPage();
+ virtual void dispose() SAL_OVERRIDE;
void ClearStruct();
virtual SvTreeListEntry* InsertEntry(const OUString& rText, SvTreeListEntry* pParent,
diff --git a/fpicker/source/office/OfficeControlAccess.hxx b/fpicker/source/office/OfficeControlAccess.hxx
index 3214ebe534b4..e1ff8050c23c 100644
--- a/fpicker/source/office/OfficeControlAccess.hxx
+++ b/fpicker/source/office/OfficeControlAccess.hxx
@@ -46,7 +46,7 @@ namespace svt
class OControlAccess
{
IFilePickerController* m_pFilePickerController;
- SvtFileView* m_pFileView;
+ VclPtr<SvtFileView> m_pFileView;
public:
OControlAccess( IFilePickerController* _pController, SvtFileView* _pFileView );
diff --git a/fpicker/source/office/OfficeFilePicker.cxx b/fpicker/source/office/OfficeFilePicker.cxx
index f9d755ac4fcc..6fd28edfd242 100644
--- a/fpicker/source/office/OfficeFilePicker.cxx
+++ b/fpicker/source/office/OfficeFilePicker.cxx
@@ -463,12 +463,12 @@ sal_Int16 SvtFilePicker::implExecutePicker( )
}
-SvtFileDialog* SvtFilePicker::implCreateDialog( vcl::Window* _pParent )
+VclPtr<SvtFileDialog> SvtFilePicker::implCreateDialog( vcl::Window* _pParent )
{
WinBits nExtraBits;
WinBits nBits = getWinBits( nExtraBits );
- SvtFileDialog* dialog = new SvtFileDialog( _pParent, nBits, nExtraBits );
+ VclPtrInstance<SvtFileDialog> dialog( _pParent, nBits, nExtraBits );
// Set StandardDir if present
if ( !m_aStandardDir.isEmpty())
diff --git a/fpicker/source/office/OfficeFilePicker.hxx b/fpicker/source/office/OfficeFilePicker.hxx
index 65e4eab4b970..fa8313e16a85 100644
--- a/fpicker/source/office/OfficeFilePicker.hxx
+++ b/fpicker/source/office/OfficeFilePicker.hxx
@@ -205,7 +205,7 @@ protected:
// OCommonPicker overridables
- virtual SvtFileDialog* implCreateDialog( vcl::Window* _pParent ) SAL_OVERRIDE;
+ virtual VclPtr<SvtFileDialog> implCreateDialog( vcl::Window* _pParent ) SAL_OVERRIDE;
virtual sal_Int16 implExecutePicker( ) SAL_OVERRIDE;
virtual bool implHandleInitializationArgument(
const OUString& _rName,
diff --git a/fpicker/source/office/OfficeFolderPicker.cxx b/fpicker/source/office/OfficeFolderPicker.cxx
index de062ac8e7cc..8f524856884c 100644
--- a/fpicker/source/office/OfficeFolderPicker.cxx
+++ b/fpicker/source/office/OfficeFolderPicker.cxx
@@ -69,9 +69,9 @@ void SAL_CALL SvtFolderPicker::startExecuteModal( const Reference< ::com::sun::s
getDialog()->StartExecuteModal( LINK( this, SvtFolderPicker, DialogClosedHdl ) );
}
-SvtFileDialog* SvtFolderPicker::implCreateDialog( vcl::Window* _pParent )
+VclPtr<SvtFileDialog> SvtFolderPicker::implCreateDialog( vcl::Window* _pParent )
{
- return new SvtFileDialog( _pParent, SFXWB_PATHDIALOG );
+ return VclPtr<SvtFileDialog>::Create( _pParent, SFXWB_PATHDIALOG );
}
sal_Int16 SvtFolderPicker::implExecutePicker( )
diff --git a/fpicker/source/office/OfficeFolderPicker.hxx b/fpicker/source/office/OfficeFolderPicker.hxx
index 6261c50f74f0..266c99cbef8a 100644
--- a/fpicker/source/office/OfficeFolderPicker.hxx
+++ b/fpicker/source/office/OfficeFolderPicker.hxx
@@ -99,7 +99,7 @@ protected:
// OCommonPicker overridables
- virtual SvtFileDialog* implCreateDialog( vcl::Window* _pParent ) SAL_OVERRIDE;
+ virtual VclPtr<SvtFileDialog> implCreateDialog( vcl::Window* _pParent ) SAL_OVERRIDE;
virtual sal_Int16 implExecutePicker( ) SAL_OVERRIDE;
};
diff --git a/fpicker/source/office/PlacesListBox.cxx b/fpicker/source/office/PlacesListBox.cxx
index d5baa25babdd..5d75edd0e095 100644
--- a/fpicker/source/office/PlacesListBox.cxx
+++ b/fpicker/source/office/PlacesListBox.cxx
@@ -24,7 +24,7 @@ PlacesListBox_Impl::PlacesListBox_Impl( PlacesListBox* pParent, const OUString&
mpParent( pParent )
{
Size aBoxSize = pParent->GetSizePixel( );
- mpHeaderBar = new HeaderBar( pParent, WB_BUTTONSTYLE | WB_BOTTOMBORDER );
+ mpHeaderBar = VclPtr<HeaderBar>::Create( pParent, WB_BUTTONSTYLE | WB_BOTTOMBORDER );
mpHeaderBar->SetPosSizePixel( Point( 0, 0 ), Size( 600, 16 ) );
long pTabs[] = { 2, 20, 600 };
@@ -43,8 +43,14 @@ PlacesListBox_Impl::PlacesListBox_Impl( PlacesListBox* pParent, const OUString&
PlacesListBox_Impl::~PlacesListBox_Impl( )
{
- delete mpHeaderBar;
- mpParent = NULL;
+ disposeOnce();
+}
+
+void PlacesListBox_Impl::dispose()
+{
+ mpHeaderBar.disposeAndClear();
+ mpParent.clear();
+ SvHeaderTabListBox::dispose();
}
void PlacesListBox_Impl::MouseButtonUp( const MouseEvent& rMEvt )
@@ -64,17 +70,17 @@ PlacesListBox::PlacesListBox( vcl::Window* pParent, SvtFileDialog* pFileDlg, con
mbUpdated( false ),
mbSelectionChanged( false )
{
- mpImpl = new PlacesListBox_Impl( this, rTitle );
+ mpImpl = VclPtr<PlacesListBox_Impl>::Create( this, rTitle );
mpImpl->SetSelectHdl( LINK( this, PlacesListBox, Selection ) );
mpImpl->SetDoubleClickHdl( LINK( this, PlacesListBox, DoubleClick ) ) ;
- mpAddBtn = new ImageButton( this, 0 );
+ mpAddBtn.reset( VclPtr<ImageButton>::Create( this, 0 ) );
mpAddBtn->SetText( OUString( "+" ) );
mpAddBtn->SetPosSizePixel( Point( 0, 0 ), Size( 22, 22 ) );
mpAddBtn->Show();
- mpDelBtn = new ImageButton( this, 0 );
+ mpDelBtn.reset( VclPtr<ImageButton>::Create( this, 0 ) );
mpDelBtn->SetText( OUString( "-" ) );
mpDelBtn->SetPosSizePixel( Point( 0, 0 ), Size( 22, 22 ) );
mpDelBtn->Show();
@@ -82,9 +88,16 @@ PlacesListBox::PlacesListBox( vcl::Window* pParent, SvtFileDialog* pFileDlg, con
PlacesListBox::~PlacesListBox( )
{
- delete mpImpl;
- delete mpAddBtn;
- delete mpDelBtn;
+ disposeOnce();
+}
+
+void PlacesListBox::dispose()
+{
+ mpImpl.disposeAndClear();
+ mpAddBtn.disposeAndClear();
+ mpDelBtn.disposeAndClear();
+ mpDlg.clear();
+ Control::dispose();
}
void PlacesListBox::AppendPlace( PlacePtr pPlace )
@@ -181,13 +194,13 @@ IMPL_LINK ( PlacesListBox, DoubleClick, void*, EMPTYARG )
PlacePtr pPlace = maPlaces[nSelected];
if ( pPlace->IsEditable() && !pPlace->IsLocal( ) )
{
- PlaceEditDialog aDlg( mpDlg, pPlace );
- short aRetCode = aDlg.Execute();
+ ScopedVclPtrInstance< PlaceEditDialog > aDlg(mpDlg, pPlace);
+ short aRetCode = aDlg->Execute();
switch(aRetCode) {
case RET_OK :
{
- pPlace->SetName ( aDlg.GetServerName() );
- pPlace->SetUrl( aDlg.GetServerUrl() );
+ pPlace->SetName ( aDlg->GetServerName() );
+ pPlace->SetUrl( aDlg->GetServerUrl() );
mbUpdated = true;
break;
}
diff --git a/fpicker/source/office/PlacesListBox.hxx b/fpicker/source/office/PlacesListBox.hxx
index 8fa24beb2907..0cf700d6b142 100644
--- a/fpicker/source/office/PlacesListBox.hxx
+++ b/fpicker/source/office/PlacesListBox.hxx
@@ -23,12 +23,13 @@ class PlacesListBox;
class PlacesListBox_Impl : public SvHeaderTabListBox
{
private:
- HeaderBar* mpHeaderBar;
- PlacesListBox* mpParent;
+ VclPtr<HeaderBar> mpHeaderBar;
+ VclPtr<PlacesListBox> mpParent;
public:
PlacesListBox_Impl( PlacesListBox* pParent, const OUString& rTitle );
virtual ~PlacesListBox_Impl( );
+ virtual void dispose() SAL_OVERRIDE;
virtual void MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
};
@@ -39,10 +40,10 @@ class PlacesListBox : public Control
{
private:
std::vector< PlacePtr > maPlaces;
- SvtFileDialog* mpDlg;
- PlacesListBox_Impl* mpImpl;
- PushButton* mpAddBtn;
- PushButton* mpDelBtn;
+ VclPtr<SvtFileDialog> mpDlg;
+ VclPtr<PlacesListBox_Impl> mpImpl;
+ VclPtr<PushButton> mpAddBtn;
+ VclPtr<PushButton> mpDelBtn;
sal_Int32 mnNbEditables;
bool mbUpdated;
bool mbSelectionChanged;
@@ -50,6 +51,7 @@ class PlacesListBox : public Control
public:
PlacesListBox( vcl::Window* pParent, SvtFileDialog* pFileDlg, const OUString& rTitle, WinBits nBits );
virtual ~PlacesListBox( );
+ virtual void dispose() SAL_OVERRIDE;
void AppendPlace( PlacePtr pPlace );
void RemovePlace( sal_uInt16 nPos );
diff --git a/fpicker/source/office/QueryFolderName.hxx b/fpicker/source/office/QueryFolderName.hxx
index 49733bbb46a4..cf864aff88ef 100644
--- a/fpicker/source/office/QueryFolderName.hxx
+++ b/fpicker/source/office/QueryFolderName.hxx
@@ -28,9 +28,9 @@
class QueryFolderNameDialog : public ModalDialog
{
private:
- Edit* m_pNameEdit;
- VclFrame* m_pNameLine;
- OKButton* m_pOKBtn;
+ VclPtr<Edit> m_pNameEdit;
+ VclPtr<VclFrame> m_pNameLine;
+ VclPtr<OKButton> m_pOKBtn;
DECL_LINK( OKHdl, void * );
DECL_LINK( NameHdl, void * );
@@ -38,6 +38,8 @@ private:
public:
QueryFolderNameDialog(vcl::Window* _pParent, const OUString& rTitle,
const OUString& rDefaultText, OUString* pGroupName = NULL);
+ virtual ~QueryFolderNameDialog();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetName() const { return m_pNameEdit->GetText(); }
};
diff --git a/fpicker/source/office/asyncfilepicker.hxx b/fpicker/source/office/asyncfilepicker.hxx
index a2dfa11c7076..2174eb50e6ca 100644
--- a/fpicker/source/office/asyncfilepicker.hxx
+++ b/fpicker/source/office/asyncfilepicker.hxx
@@ -25,6 +25,7 @@
#include <rtl/ustring.hxx>
#include <com/sun/star/uno/Sequence.h>
#include <salhelper/simplereferenceobject.hxx>
+#include <vcl/vclptr.hxx>
class SvtFileView;
class SvtFileDialog;
@@ -52,8 +53,8 @@ namespace svt
private:
Action m_eAction;
- SvtFileView* m_pView;
- SvtFileDialog* m_pDialog;
+ VclPtr<SvtFileView> m_pView;
+ VclPtr<SvtFileDialog> m_pDialog;
OUString m_sURL;
OUString m_sFileName;
bool m_bRunning;
diff --git a/fpicker/source/office/commonpicker.cxx b/fpicker/source/office/commonpicker.cxx
index c6da4db6ac26..b3192d2c419d 100644
--- a/fpicker/source/office/commonpicker.cxx
+++ b/fpicker/source/office/commonpicker.cxx
@@ -123,8 +123,7 @@ namespace svt
m_pDlg->EndDialog( RET_CANCEL );
}
- delete m_pDlg;
- m_pDlg = NULL;
+ m_pDlg.disposeAndClear();
m_xWindow = NULL;
m_xDialogParent = NULL;
}
@@ -150,9 +149,10 @@ namespace svt
stopWindowListening();
if ( !bDialogDying ) // it's the parent which is dying -> delete the dialog
- delete m_pDlg;
+ m_pDlg.disposeAndClear();
+ else
+ m_pDlg.clear();
- m_pDlg = NULL;
m_xWindow = NULL;
m_xDialogParent = NULL;
}
@@ -201,7 +201,7 @@ namespace svt
{
if ( !m_pDlg )
{
- m_pDlg = implCreateDialog( VCLUnoHelper::GetWindow( m_xDialogParent ) );
+ m_pDlg.reset( implCreateDialog( VCLUnoHelper::GetWindow( m_xDialogParent ) ) );
DBG_ASSERT( m_pDlg, "OCommonPicker::createPicker: invalid dialog returned!" );
if ( m_pDlg )
@@ -240,7 +240,7 @@ namespace svt
}
}
- return NULL != m_pDlg;
+ return nullptr != m_pDlg;
}
diff --git a/fpicker/source/office/commonpicker.hxx b/fpicker/source/office/commonpicker.hxx
index a0cb97896b4c..a08c31ee2ba0 100644
--- a/fpicker/source/office/commonpicker.hxx
+++ b/fpicker/source/office/commonpicker.hxx
@@ -33,6 +33,7 @@
#include <comphelper/proparrhlp.hxx>
#include <comphelper/uno3.hxx>
#include <tools/link.hxx>
+#include <vcl/vclptr.hxx>
class SvtFileDialog;
namespace vcl { class Window; }
@@ -64,7 +65,7 @@ namespace svt
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xWindow;
// </properties>
- SvtFileDialog* m_pDlg;
+ VclPtr<SvtFileDialog> m_pDlg;
ImplSVEvent * m_nCancelEvent;
bool m_bExecuting;
@@ -92,7 +93,7 @@ namespace svt
// overridables
// will be called with locked SolarMutex
- virtual SvtFileDialog* implCreateDialog( vcl::Window* _pParent ) = 0;
+ virtual VclPtr<SvtFileDialog> implCreateDialog( vcl::Window* _pParent ) = 0;
virtual sal_Int16 implExecutePicker( ) = 0;
// do NOT override XExecutableDialog::execute! We need to do some stuff there ourself ...
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index 93ace60721cd..fda0c56321b9 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -348,8 +348,8 @@ SvtFileDialog::SvtFileDialog ( vcl::Window* _pParent, WinBits nBits )
class CustomContainer : public vcl::Window
{
SvtExpFileDlg_Impl* _pImp;
- SvtFileView* _pFileView;
- Splitter* _pSplitter;
+ VclPtr<SvtFileView> _pFileView;
+ VclPtr<Splitter> _pSplitter;
public:
CustomContainer(vcl::Window *pParent)
@@ -359,6 +359,13 @@ public:
, _pSplitter(NULL)
{
}
+ virtual ~CustomContainer() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE
+ {
+ _pFileView.clear();
+ _pSplitter.clear();
+ vcl::Window::dispose();
+ }
void init(SvtExpFileDlg_Impl* pImp,
SvtFileView* pFileView,
@@ -404,6 +411,11 @@ public:
SvtFileDialog::~SvtFileDialog()
{
+ disposeOnce();
+}
+
+void SvtFileDialog::dispose()
+{
if ( !_pImp->_aIniKey.isEmpty() )
{
// save window state
@@ -437,10 +449,17 @@ SvtFileDialog::~SvtFileDialog()
}
delete _pImp;
- delete _pFileView;
- delete _pSplitter;
- delete _pContainer;
- delete _pPrevBmp;
+ _pFileView.disposeAndClear();
+ _pSplitter.disposeAndClear();
+ _pContainer.disposeAndClear();
+ _pPrevBmp.disposeAndClear();
+ _pCbReadOnly.clear();
+ _pCbLinkBox.clear();
+ _pCbPreviewBox.clear();
+ _pCbSelection.clear();
+ _pPbPlay.clear();
+ _pPrevWin.clear();
+ ModalDialog::dispose();
}
void SvtFileDialog::Init_Impl
@@ -480,7 +499,7 @@ void SvtFileDialog::Init_Impl
m_aImages = ImageList( SvtResId( RID_FILEPICKER_IMAGES ) );
vcl::Window *pUpContainer = get<vcl::Window>("up");
- _pImp->_pBtnUp = new SvtUpButton_Impl(pUpContainer, this, 0);
+ _pImp->_pBtnUp = VclPtr<SvtUpButton_Impl>::Create(pUpContainer, this, 0);
_pImp->_pBtnUp->SetHelpId( HID_FILEOPEN_LEVELUP );
_pImp->_pBtnUp->set_vexpand(true);
_pImp->_pBtnUp->Show();
@@ -522,7 +541,7 @@ void SvtFileDialog::Init_Impl
if ( ( nStyle & SFXWB_MULTISELECTION ) == SFXWB_MULTISELECTION )
_pImp->_bMultiSelection = true;
- _pContainer = new CustomContainer(get<vcl::Window>("container"));
+ _pContainer.reset(VclPtr<CustomContainer>::Create(get<vcl::Window>("container")));
Size aSize(LogicToPixel(Size(270, 85), MAP_APPFONT));
_pContainer->set_height_request(aSize.Height());
_pContainer->set_width_request(aSize.Width());
@@ -530,7 +549,7 @@ void SvtFileDialog::Init_Impl
_pContainer->set_vexpand(true);
_pContainer->SetStyle( _pContainer->GetStyle() | WB_TABSTOP );
- _pFileView = new SvtFileView( _pContainer, WB_BORDER,
+ _pFileView = VclPtr<SvtFileView>::Create( _pContainer, WB_BORDER,
FILEDLG_TYPE_PATHDLG == _pImp->_eDlgType,
_pImp->_bMultiSelection );
_pFileView->Show();
@@ -538,7 +557,7 @@ void SvtFileDialog::Init_Impl
_pFileView->SetHelpId( HID_FILEDLG_STANDARD );
_pFileView->SetStyle( _pFileView->GetStyle() | WB_TABSTOP );
- _pSplitter = new Splitter( _pContainer, WB_HSCROLL );
+ _pSplitter = VclPtr<Splitter>::Create( _pContainer, WB_HSCROLL );
_pSplitter->SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor() ));
_pSplitter->SetSplitHdl( LINK( this, SvtFileDialog, Split_Hdl ) );
@@ -662,17 +681,17 @@ IMPL_STATIC_LINK( SvtFileDialog, NewFolderHdl_Impl, PushButton*, EMPTYARG )
SmartContent aContent( pThis->_pFileView->GetViewURL( ) );
OUString aTitle;
aContent.getTitle( aTitle );
- QueryFolderNameDialog aDlg( pThis, aTitle, SVT_RESSTR(STR_SVT_NEW_FOLDER) );
+ ScopedVclPtrInstance< QueryFolderNameDialog > aDlg(pThis, aTitle, SVT_RESSTR(STR_SVT_NEW_FOLDER));
bool bHandled = false;
while ( !bHandled )
{
- if ( aDlg.Execute() == RET_OK )
+ if ( aDlg->Execute() == RET_OK )
{
- OUString aUrl = aContent.createFolder( aDlg.GetName( ) );
+ OUString aUrl = aContent.createFolder( aDlg->GetName( ) );
if ( !aUrl.isEmpty( ) )
{
- pThis->_pFileView->CreatedFolder( aUrl, aDlg.GetName() );
+ pThis->_pFileView->CreatedFolder( aUrl, aDlg->GetName() );
bHandled = true;
}
}
@@ -1046,8 +1065,8 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid )
"$filename$",
aFileObj.getName(INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET)
);
- MessageDialog aBox(pThis, aMsg, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
- if ( aBox.Execute() != RET_YES )
+ ScopedVclPtrInstance< MessageDialog > aBox(pThis, aMsg, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ if ( aBox->Execute() != RET_YES )
return 0;
}
else
@@ -1091,8 +1110,8 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid )
}
sError = sError.replaceFirst( "$name$", sInvalidFile );
- MessageDialog aError(pThis, sError);
- aError.Execute();
+ ScopedVclPtrInstance< MessageDialog > aError(pThis, sError);
+ aError->Execute();
return 0;
}
}
@@ -1244,13 +1263,13 @@ IMPL_STATIC_LINK ( SvtFileDialog, ConnectToServerPressed_Hdl, void*, EMPTYARG )
{
pThis->_pFileView->EndInplaceEditing( false );
- PlaceEditDialog aDlg( pThis );
- short aRetCode = aDlg.Execute();
+ ScopedVclPtrInstance< PlaceEditDialog > aDlg(pThis);
+ short aRetCode = aDlg->Execute();
switch (aRetCode) {
case RET_OK :
{
- PlacePtr newPlace = aDlg.GetPlace();
+ PlacePtr newPlace = aDlg->GetPlace();
pThis->_pImp->_pPlaces->AppendPlace(newPlace);
break;
@@ -1625,7 +1644,7 @@ bool SvtFileDialog::Notify( NotifyEvent& rNEvt )
class SvtDefModalDialogParent_Impl
{
private:
- vcl::Window* _pOld;
+ VclPtr<vcl::Window> _pOld;
public:
SvtDefModalDialogParent_Impl( vcl::Window *pNew ) :
@@ -1812,7 +1831,7 @@ void SvtFileDialog::EnableUI( bool _bEnable )
if ( _bEnable )
{
- for ( ::std::set< Control* >::iterator aLoop = m_aDisabledControls.begin();
+ for ( auto aLoop = m_aDisabledControls.begin();
aLoop != m_aDisabledControls.end();
++aLoop
)
@@ -1835,7 +1854,7 @@ void SvtFileDialog::EnableControl( Control* _pControl, bool _bEnable )
if ( _bEnable )
{
- ::std::set< Control* >::iterator aPos = m_aDisabledControls.find( _pControl );
+ auto aPos = m_aDisabledControls.find( _pControl );
if ( m_aDisabledControls.end() != aPos )
m_aDisabledControls.erase( aPos );
}
@@ -1880,8 +1899,8 @@ short SvtFileDialog::PrepareExecute()
if ( bEmpty )
{
- MessageDialog aBox(this, SVT_RESSTR(STR_SVT_NOREMOVABLEDEVICE));
- aBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aBox(this, SVT_RESSTR(STR_SVT_NOREMOVABLEDEVICE));
+ aBox->Execute();
return 0;
}
}
@@ -2528,7 +2547,7 @@ void SvtFileDialog::AddControls_Impl( )
_pPrevWin->SetOutputSizePixel(Size(200, 300));
_pPrevWin->Show();
- _pPrevBmp = new FixedBitmap( _pPrevWin, WinBits( WB_BORDER ) );
+ _pPrevBmp = VclPtr<FixedBitmap>::Create( _pPrevWin, WinBits( WB_BORDER ) );
_pPrevBmp->SetBackground( Wallpaper( Color( COL_WHITE ) ) );
_pPrevBmp->SetSizePixel(_pPrevWin->GetSizePixel());
_pPrevBmp->Show();
@@ -2593,7 +2612,7 @@ void SvtFileDialog::AddControls_Impl( )
_pImp->_pLbImageTemplates->Show();
}
- _pImp->_pPlaces = new PlacesListBox(_pContainer, this, SVT_RESSTR(STR_PLACES_TITLE), WB_BORDER);
+ _pImp->_pPlaces = VclPtr<PlacesListBox>::Create(_pContainer, this, SVT_RESSTR(STR_PLACES_TITLE), WB_BORDER);
_pImp->_pPlaces->SetHelpId("SVT_HID_FILESAVE_PLACES_LISTBOX");
Size aSize(LogicToPixel(Size(50, 85), MAP_APPFONT));
_pImp->_pPlaces->set_height_request(aSize.Height());
@@ -2829,6 +2848,18 @@ QueryFolderNameDialog::QueryFolderNameDialog(vcl::Window* _pParent,
m_pNameLine->set_label( *pGroupName );
};
+QueryFolderNameDialog::~QueryFolderNameDialog()
+{
+ disposeOnce();
+}
+
+void QueryFolderNameDialog::dispose()
+{
+ m_pNameEdit.clear();
+ m_pNameLine.clear();
+ m_pOKBtn.clear();
+ ModalDialog::dispose();
+}
IMPL_LINK_NOARG(QueryFolderNameDialog, OKHdl)
{
diff --git a/fpicker/source/office/iodlg.hxx b/fpicker/source/office/iodlg.hxx
index 1bb88689b353..d25ce831110e 100644
--- a/fpicker/source/office/iodlg.hxx
+++ b/fpicker/source/office/iodlg.hxx
@@ -82,16 +82,16 @@ class CustomContainer;
class SvtFileDialog : public ModalDialog, public ::svt::IFilePickerController
{
private:
- CheckBox* _pCbReadOnly;
- CheckBox* _pCbLinkBox;
- CheckBox* _pCbPreviewBox;
- CheckBox* _pCbSelection;
- PushButton* _pPbPlay;
- vcl::Window* _pPrevWin;
- FixedBitmap* _pPrevBmp;
- CustomContainer* _pContainer;
- SvtFileView* _pFileView;
- Splitter* _pSplitter;
+ VclPtr<CheckBox> _pCbReadOnly;
+ VclPtr<CheckBox> _pCbLinkBox;
+ VclPtr<CheckBox> _pCbPreviewBox;
+ VclPtr<CheckBox> _pCbSelection;
+ VclPtr<PushButton> _pPbPlay;
+ VclPtr<vcl::Window> _pPrevWin;
+ VclPtr<FixedBitmap> _pPrevBmp;
+ VclPtr<CustomContainer> _pContainer;
+ VclPtr<SvtFileView> _pFileView;
+ VclPtr<Splitter> _pSplitter;
::svt::IFilePickerListener* _pFileNotifier;
SvtExpFileDlg_Impl* _pImp;
WinBits _nExtraBits;
@@ -100,7 +100,7 @@ private:
ImageList m_aImages;
::svt::SmartContent m_aContent;
- ::std::set< Control* > m_aDisabledControls;
+ ::std::set< VclPtr<Control> > m_aDisabledControls;
::utl::OConfigurationNode m_aConfiguration;
::rtl::Reference< ::svt::AsyncPickerAction >
@@ -194,6 +194,7 @@ public:
SvtFileDialog( vcl::Window* _pParent, WinBits nBits, WinBits nExtraBits );
SvtFileDialog( vcl::Window* _pParent, WinBits nBits );
virtual ~SvtFileDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
virtual void StartExecuteModal( const Link& rEndDialogHdl ) SAL_OVERRIDE;
diff --git a/fpicker/source/office/iodlgimp.cxx b/fpicker/source/office/iodlgimp.cxx
index 8994f9a2c027..99cf5b0e8ea6 100644
--- a/fpicker/source/office/iodlgimp.cxx
+++ b/fpicker/source/office/iodlgimp.cxx
@@ -106,7 +106,14 @@ SvtFileDialogURLSelector::SvtFileDialogURLSelector( vcl::Window* _pParent, SvtFi
SvtFileDialogURLSelector::~SvtFileDialogURLSelector()
{
+ disposeOnce();
+}
+
+void SvtFileDialogURLSelector::dispose()
+{
delete m_pMenu;
+ m_pDlg.clear();
+ MenuButton::dispose();
}
@@ -244,10 +251,10 @@ SvtExpFileDlg_Impl::SvtExpFileDlg_Impl( WinBits ) :
SvtExpFileDlg_Impl::~SvtExpFileDlg_Impl()
{
- delete _pBtnUp;
+ _pBtnUp.disposeAndClear();
delete _pUserFilter;
delete _pFilter;
- delete _pPlaces;
+ _pPlaces.disposeAndClear();
}
diff --git a/fpicker/source/office/iodlgimp.hxx b/fpicker/source/office/iodlgimp.hxx
index 2af75e6cb7b1..04b986453a21 100644
--- a/fpicker/source/office/iodlgimp.hxx
+++ b/fpicker/source/office/iodlgimp.hxx
@@ -78,20 +78,19 @@ enum SvtFileDlgType
class SvtFileDialogURLSelector : public MenuButton
{
+public:
+ virtual ~SvtFileDialogURLSelector();
+ virtual void dispose() SAL_OVERRIDE;
private:
- SvtFileDialog* m_pDlg;
+ VclPtr<SvtFileDialog> m_pDlg;
PopupMenu* m_pMenu;
protected:
inline SvtFileDialog* GetDialogParent() { return m_pDlg; }
-protected:
-
virtual void FillURLMenu( PopupMenu* _pMenu ) = 0;
-protected:
SvtFileDialogURLSelector( vcl::Window* _pParent, SvtFileDialog* _pDlg, WinBits nBits, sal_uInt16 _nButtonId );
- virtual ~SvtFileDialogURLSelector();
virtual void Activate() SAL_OVERRIDE;
};
@@ -133,32 +132,32 @@ public:
SvtFileDialogFilterList_Impl* _pFilter;
SvtFileDialogFilter_Impl* _pUserFilter;
- FixedText* _pFtFileName;
- SvtURLBox* _pEdFileName;
+ VclPtr<FixedText> _pFtFileName;
+ VclPtr<SvtURLBox> _pEdFileName;
- FixedText* _pFtFileVersion;
- ListBox* _pLbFileVersion;
+ VclPtr<FixedText> _pFtFileVersion;
+ VclPtr<ListBox> _pLbFileVersion;
- FixedText* _pFtTemplates;
- ListBox* _pLbTemplates;
+ VclPtr<FixedText> _pFtTemplates;
+ VclPtr<ListBox> _pLbTemplates;
- FixedText* _pFtImageTemplates;
- ListBox* _pLbImageTemplates;
+ VclPtr<FixedText> _pFtImageTemplates;
+ VclPtr<ListBox> _pLbImageTemplates;
- FixedText* _pFtFileType;
- ListBox* _pLbFilter;
- PushButton* _pBtnFileOpen;
- PushButton* _pBtnCancel;
- HelpButton* _pBtnHelp;
- SvtUpButton_Impl* _pBtnUp;
- PushButton* _pBtnNewFolder;
- CheckBox* _pCbPassword;
- SvtURLBox* _pEdCurrentPath;
- CheckBox* _pCbAutoExtension;
- CheckBox* _pCbOptions;
+ VclPtr<FixedText> _pFtFileType;
+ VclPtr<ListBox> _pLbFilter;
+ VclPtr<PushButton> _pBtnFileOpen;
+ VclPtr<PushButton> _pBtnCancel;
+ VclPtr<HelpButton> _pBtnHelp;
+ VclPtr<SvtUpButton_Impl> _pBtnUp;
+ VclPtr<PushButton> _pBtnNewFolder;
+ VclPtr<CheckBox> _pCbPassword;
+ VclPtr<SvtURLBox> _pEdCurrentPath;
+ VclPtr<CheckBox> _pCbAutoExtension;
+ VclPtr<CheckBox> _pCbOptions;
- PlacesListBox* _pPlaces;
- PushButton* _pBtnConnectToServer;
+ VclPtr<PlacesListBox> _pPlaces;
+ VclPtr<PushButton> _pBtnConnectToServer;
SvtFileDlgMode _eMode;
SvtFileDlgType _eDlgType;
diff --git a/fpicker/test/svdem.cxx b/fpicker/test/svdem.cxx
index 1f4bc6b58e9f..61217a7c692a 100644
--- a/fpicker/test/svdem.cxx
+++ b/fpicker/test/svdem.cxx
@@ -185,9 +185,8 @@ IMPL_LINK( MyWin, Test, PushButton*, pBtn )
printf("Test\n");
if ( pBtn == &aOKBtn )
{
- SvtFileDialog* pDlg = new SvtFileDialog( this,SFXWB_PATHDIALOG);
+ ScopedVclPtrInstance<SvtFileDialog> pDlg(this,SFXWB_PATHDIALOG);
pDlg->Execute();
- delete pDlg;
printf("ok\n");
}
diff --git a/framework/inc/classes/fwktabwindow.hxx b/framework/inc/classes/fwktabwindow.hxx
index ebbac7fc80bb..ed3d82c80e2c 100644
--- a/framework/inc/classes/fwktabwindow.hxx
+++ b/framework/inc/classes/fwktabwindow.hxx
@@ -68,6 +68,7 @@ public:
const css::uno::Reference< css::awt::XContainerWindowProvider >& rProvider );
virtual ~FwkTabPage();
+ virtual void dispose() SAL_OVERRIDE;
virtual void ActivatePage() SAL_OVERRIDE;
virtual void DeactivatePage() SAL_OVERRIDE;
@@ -77,8 +78,8 @@ public:
struct TabEntry
{
sal_Int32 m_nIndex;
- FwkTabPage* m_pPage;
- OUString m_sPageURL;
+ ScopedVclPtr<FwkTabPage> m_pPage;
+ OUString m_sPageURL;
css::uno::Reference< css::awt::XContainerWindowEventHandler > m_xEventHdl;
TabEntry() :
@@ -86,8 +87,7 @@ struct TabEntry
TabEntry( sal_Int32 nIndex, const OUString& sURL, const css::uno::Reference< css::awt::XContainerWindowEventHandler > & rEventHdl ) :
m_nIndex( nIndex ), m_pPage( NULL ), m_sPageURL( sURL ), m_xEventHdl( rEventHdl ) {}
-
- ~TabEntry() { delete m_pPage; }
+ ~TabEntry() { m_pPage.disposeAndClear(); }
};
typedef std::vector< TabEntry* > TabEntryList;
@@ -95,8 +95,8 @@ typedef std::vector< TabEntry* > TabEntryList;
class FwkTabWindow : public vcl::Window
{
private:
- FwkTabControl m_aTabCtrl;
- TabEntryList m_TabList;
+ VclPtr<FwkTabControl> m_aTabCtrl;
+ TabEntryList m_TabList;
css::uno::Reference< css::awt::XContainerWindowProvider > m_xWinProvider;
@@ -110,6 +110,7 @@ private:
public:
FwkTabWindow( vcl::Window* pParent );
virtual ~FwkTabWindow();
+ virtual void dispose() SAL_OVERRIDE;
void AddEventListener( const Link& rEventListener );
void RemoveEventListener( const Link& rEventListener );
diff --git a/framework/inc/dispatch/closedispatcher.hxx b/framework/inc/dispatch/closedispatcher.hxx
index 25c19f107e6b..e8e9d0567927 100644
--- a/framework/inc/dispatch/closedispatcher.hxx
+++ b/framework/inc/dispatch/closedispatcher.hxx
@@ -39,6 +39,7 @@
#include <boost/scoped_ptr.hpp>
#include <cppuhelper/implbase2.hxx>
#include <vcl/evntpost.hxx>
+#include <vcl/vclptr.hxx>
class SystemWindow;
@@ -105,7 +106,7 @@ class CloseDispatcher : public ::cppu::WeakImplHelper2<
/** @short holded alive for internally asynchronous operations! */
css::uno::Reference< css::frame::XDispatchResultListener > m_xResultListener;
- SystemWindow* m_pSysWindow;
+ VclPtr<SystemWindow> m_pSysWindow;
// native interface
diff --git a/framework/inc/helper/vclstatusindicator.hxx b/framework/inc/helper/vclstatusindicator.hxx
index 4a68b79d8271..c5e115567a5e 100644
--- a/framework/inc/helper/vclstatusindicator.hxx
+++ b/framework/inc/helper/vclstatusindicator.hxx
@@ -52,7 +52,7 @@ class VCLStatusIndicator : public ::cppu::WeakImplHelper1< css::task::XStatusIn
Its guarded by the solarmutex only. Otherwise
we have to lock two of them, which can force a deadlock ...
*/
- StatusBar* m_pStatusBar;
+ VclPtr<StatusBar> m_pStatusBar;
/** knows the current info text of the progress. */
OUString m_sText;
diff --git a/framework/inc/uielement/buttontoolbarcontroller.hxx b/framework/inc/uielement/buttontoolbarcontroller.hxx
index 561ef253f587..8949b58e90c1 100644
--- a/framework/inc/uielement/buttontoolbarcontroller.hxx
+++ b/framework/inc/uielement/buttontoolbarcontroller.hxx
@@ -34,6 +34,7 @@
#include <comphelper/broadcasthelper.hxx>
#include <cppuhelper/weak.hxx>
+#include <vcl/vclptr.hxx>
class ToolBox;
@@ -84,13 +85,13 @@ class ButtonToolbarController : public ::com::sun::star::frame::XStatusListener,
virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createItemWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& Parent ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
private:
- bool m_bInitialized : 1,
+ bool m_bInitialized : 1,
m_bDisposed : 1;
- OUString m_aCommandURL;
+ OUString m_aCommandURL;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer;
- ToolBox* m_pToolbar;
+ VclPtr<ToolBox> m_pToolbar;
};
}
diff --git a/framework/inc/uielement/comboboxtoolbarcontroller.hxx b/framework/inc/uielement/comboboxtoolbarcontroller.hxx
index d04537495217..1850c45eb669 100644
--- a/framework/inc/uielement/comboboxtoolbarcontroller.hxx
+++ b/framework/inc/uielement/comboboxtoolbarcontroller.hxx
@@ -78,7 +78,7 @@ class ComboboxToolbarController : public IComboBoxListener,
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue> getExecuteArgs(sal_Int16 KeyModifier) const SAL_OVERRIDE;
private:
- ComboBoxControl* m_pComboBox;
+ VclPtr<ComboBoxControl> m_pComboBox;
};
}
diff --git a/framework/inc/uielement/complextoolbarcontroller.hxx b/framework/inc/uielement/complextoolbarcontroller.hxx
index 88084f8d1661..b24186f644bf 100644
--- a/framework/inc/uielement/complextoolbarcontroller.hxx
+++ b/framework/inc/uielement/complextoolbarcontroller.hxx
@@ -28,6 +28,7 @@
#include <svtools/toolboxcontroller.hxx>
#include <tools/link.hxx>
+#include <vcl/vclptr.hxx>
class ToolBox;
namespace vcl { class Window; }
@@ -87,9 +88,9 @@ class ComplexToolbarController : public svt::ToolboxController
void notifyFocusLost();
void notifyTextChanged( const OUString& aText );
- ToolBox* m_pToolbar;
+ VclPtr<ToolBox> m_pToolbar;
sal_uInt16 m_nID;
- bool m_bMadeInvisible;
+ bool m_bMadeInvisible;
mutable ::com::sun::star::util::URL m_aURL;
::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer;
};
diff --git a/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx b/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx
index e9e09f27e813..9b3703687dc4 100644
--- a/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx
+++ b/framework/inc/uielement/dropdownboxtoolbarcontroller.hxx
@@ -26,6 +26,7 @@
#include <uielement/complextoolbarcontroller.hxx>
#include <vcl/lstbox.hxx>
+#include <vcl/vclptr.hxx>
class ToolBox;
@@ -74,7 +75,7 @@ class DropdownToolbarController : public IListBoxListener,
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue> getExecuteArgs(sal_Int16 KeyModifier) const SAL_OVERRIDE;
private:
- ListBoxControl* m_pListBoxControl;
+ VclPtr<ListBoxControl> m_pListBoxControl;
};
}
diff --git a/framework/inc/uielement/edittoolbarcontroller.hxx b/framework/inc/uielement/edittoolbarcontroller.hxx
index 8ebdca95a37c..0b8f9b6c90dc 100644
--- a/framework/inc/uielement/edittoolbarcontroller.hxx
+++ b/framework/inc/uielement/edittoolbarcontroller.hxx
@@ -75,7 +75,7 @@ class EditToolbarController : public IEditListener,
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue> getExecuteArgs(sal_Int16 KeyModifier) const SAL_OVERRIDE;
private:
- EditControl* m_pEditControl;
+ VclPtr<EditControl> m_pEditControl;
};
}
diff --git a/framework/inc/uielement/generictoolbarcontroller.hxx b/framework/inc/uielement/generictoolbarcontroller.hxx
index c6d867b3b261..26ebeb61ab46 100644
--- a/framework/inc/uielement/generictoolbarcontroller.hxx
+++ b/framework/inc/uielement/generictoolbarcontroller.hxx
@@ -23,6 +23,7 @@
#include <svtools/toolboxcontroller.hxx>
#include <tools/link.hxx>
+#include <vcl/vclptr.hxx>
class PopupMenu;
class ToolBox;
@@ -53,11 +54,11 @@ class GenericToolbarController : public svt::ToolboxController
DECL_STATIC_LINK( GenericToolbarController, ExecuteHdl_Impl, ExecuteInfo* );
protected:
- ToolBox* m_pToolbar;
- sal_uInt16 m_nID;
- bool m_bEnumCommand : 1,
- m_bMadeInvisible : 1;
- OUString m_aEnumCommand;
+ VclPtr<ToolBox> m_pToolbar;
+ sal_uInt16 m_nID;
+ bool m_bEnumCommand : 1,
+ m_bMadeInvisible : 1;
+ OUString m_aEnumCommand;
};
class MenuToolbarController : public GenericToolbarController
diff --git a/framework/inc/uielement/spinfieldtoolbarcontroller.hxx b/framework/inc/uielement/spinfieldtoolbarcontroller.hxx
index ebef21894081..7d9a8e86eec7 100644
--- a/framework/inc/uielement/spinfieldtoolbarcontroller.hxx
+++ b/framework/inc/uielement/spinfieldtoolbarcontroller.hxx
@@ -26,6 +26,7 @@
#include <uielement/complextoolbarcontroller.hxx>
#include <vcl/spinfld.hxx>
+#include <vcl/vclptr.hxx>
class ToolBox;
@@ -97,7 +98,7 @@ class SpinfieldToolbarController : public ISpinfieldListener,
double m_nMin;
double m_nValue;
double m_nStep;
- SpinfieldControl* m_pSpinfieldControl;
+ VclPtr<SpinfieldControl> m_pSpinfieldControl;
OUString m_aOutFormat;
};
diff --git a/framework/inc/uielement/statusbar.hxx b/framework/inc/uielement/statusbar.hxx
index be957eaedfb7..c192d50b48b2 100644
--- a/framework/inc/uielement/statusbar.hxx
+++ b/framework/inc/uielement/statusbar.hxx
@@ -33,7 +33,6 @@ class FrameworkStatusBar : public StatusBar
FrameworkStatusBar( vcl::Window* pParent,
WinBits nWinBits );
- virtual ~FrameworkStatusBar();
void SetStatusBarManager( StatusBarManager* pStatusBarManager );
diff --git a/framework/inc/uielement/statusbaritem.hxx b/framework/inc/uielement/statusbaritem.hxx
index e5afc02c5480..e05cd37ded3c 100644
--- a/framework/inc/uielement/statusbaritem.hxx
+++ b/framework/inc/uielement/statusbaritem.hxx
@@ -22,6 +22,7 @@
#include <com/sun/star/ui/XStatusbarItem.hpp>
#include <cppuhelper/compbase1.hxx>
#include <cppuhelper/basemutex.hxx>
+#include <vcl/vclptr.hxx>
class StatusBar;
@@ -67,7 +68,7 @@ public:
virtual void SAL_CALL repaint( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
private:
- StatusBar *m_pStatusBar;
+ VclPtr<StatusBar> m_pStatusBar;
AddonStatusbarItemData *m_pItemData;
sal_uInt16 m_nId;
sal_uInt16 m_nStyle;
diff --git a/framework/inc/uielement/statusbarmanager.hxx b/framework/inc/uielement/statusbarmanager.hxx
index efbe5486b0db..2167b0cc9e3d 100644
--- a/framework/inc/uielement/statusbarmanager.hxx
+++ b/framework/inc/uielement/statusbarmanager.hxx
@@ -37,6 +37,7 @@
#include <cppuhelper/implbase3.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <vcl/status.hxx>
+#include <vcl/vclptr.hxx>
#include <map>
namespace framework
@@ -98,13 +99,13 @@ class StatusBarManager : public ::cppu::WeakImplHelper3<
protected:
typedef std::map< sal_uInt16, ::com::sun::star::uno::Reference< com::sun::star::frame::XStatusbarController > > StatusBarControllerMap;
- bool m_bDisposed : 1,
+ bool m_bDisposed : 1,
m_bFrameActionRegistered : 1,
m_bUpdateControllers : 1;
- bool m_bModuleIdentified;
- StatusBar* m_pStatusBar;
- OUString m_aModuleIdentifier;
- OUString m_aResourceName;
+ bool m_bModuleIdentified;
+ VclPtr<StatusBar> m_pStatusBar;
+ OUString m_aModuleIdentifier;
+ OUString m_aResourceName;
com::sun::star::uno::Reference< com::sun::star::frame::XFrame > m_xFrame;
com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > m_xUICommandLabels;
StatusBarControllerMap m_aControllerMap;
diff --git a/framework/inc/uielement/toolbarmanager.hxx b/framework/inc/uielement/toolbarmanager.hxx
index 90b68ac4a139..95381c3120a4 100644
--- a/framework/inc/uielement/toolbarmanager.hxx
+++ b/framework/inc/uielement/toolbarmanager.hxx
@@ -189,7 +189,7 @@ class ToolBarManager : public ToolbarManager_Base
long m_lImageRotation;
- ToolBox* m_pToolBar;
+ VclPtr<ToolBox> m_pToolBar;
OUString m_aModuleIdentifier;
OUString m_aResourceName;
diff --git a/framework/inc/uielement/toolbarmerger.hxx b/framework/inc/uielement/toolbarmerger.hxx
index 8a595a9878fa..0902ff36a9e1 100644
--- a/framework/inc/uielement/toolbarmerger.hxx
+++ b/framework/inc/uielement/toolbarmerger.hxx
@@ -61,7 +61,7 @@ typedef ::std::vector< AddonToolbarItem > AddonToolbarItemContainer;
struct ReferenceToolbarPathInfo
{
- ToolBox* pToolbar;
+ VclPtr<ToolBox> pToolbar;
sal_uInt16 nPos;
bool bResult;
};
diff --git a/framework/source/classes/fwktabwindow.cxx b/framework/source/classes/fwktabwindow.cxx
index b01cf418f48a..da2c187e9f68 100644
--- a/framework/source/classes/fwktabwindow.cxx
+++ b/framework/source/classes/fwktabwindow.cxx
@@ -81,8 +81,14 @@ FwkTabPage::FwkTabPage(
FwkTabPage::~FwkTabPage()
{
+ disposeOnce();
+}
+
+void FwkTabPage::dispose()
+{
Hide();
DeactivatePage();
+ TabPage::dispose();
}
void FwkTabPage::CreateDialog()
@@ -174,20 +180,27 @@ void FwkTabPage::Resize()
// class FwkTabWindow ---------------------------------------------
FwkTabWindow::FwkTabWindow( vcl::Window* pParent )
: Window(pParent)
- , m_aTabCtrl(this)
+ , m_aTabCtrl(VclPtr<FwkTabControl>::Create(this))
{
m_xWinProvider = awt::ContainerWindowProvider::create( ::comphelper::getProcessComponentContext() );
SetPaintTransparent(true);
- m_aTabCtrl.SetActivatePageHdl( LINK( this, FwkTabWindow, ActivatePageHdl ) );
- m_aTabCtrl.SetDeactivatePageHdl( LINK( this, FwkTabWindow, DeactivatePageHdl ) );
- m_aTabCtrl.Show();
+ m_aTabCtrl->SetActivatePageHdl( LINK( this, FwkTabWindow, ActivatePageHdl ) );
+ m_aTabCtrl->SetDeactivatePageHdl( LINK( this, FwkTabWindow, DeactivatePageHdl ) );
+ m_aTabCtrl->Show();
}
FwkTabWindow::~FwkTabWindow()
{
+ disposeOnce();
+}
+
+void FwkTabWindow::dispose()
+{
ClearEntryList();
+ m_aTabCtrl.disposeAndClear();
+ vcl::Window::dispose();
}
void FwkTabWindow::ClearEntryList()
@@ -245,40 +258,40 @@ TabEntry* FwkTabWindow::FindEntry( sal_Int32 nIndex ) const
IMPL_LINK_NOARG(FwkTabWindow, ActivatePageHdl)
{
- const sal_uInt16 nId = m_aTabCtrl.GetCurPageId();
- FwkTabPage* pTabPage = static_cast< FwkTabPage* >( m_aTabCtrl.GetTabPage( nId ) );
+ const sal_uInt16 nId = m_aTabCtrl->GetCurPageId();
+ FwkTabPage* pTabPage = static_cast< FwkTabPage* >( m_aTabCtrl->GetTabPage( nId ) );
if ( !pTabPage )
{
TabEntry* pEntry = FindEntry( nId );
if ( pEntry )
{
- pTabPage = new FwkTabPage( &m_aTabCtrl, pEntry->m_sPageURL, pEntry->m_xEventHdl, m_xWinProvider );
+ pTabPage = VclPtr<FwkTabPage>::Create( m_aTabCtrl.get(), pEntry->m_sPageURL, pEntry->m_xEventHdl, m_xWinProvider );
pEntry->m_pPage = pTabPage;
- m_aTabCtrl.SetTabPage( nId, pTabPage );
+ m_aTabCtrl->SetTabPage( nId, pTabPage );
pTabPage->Show();
pTabPage->ActivatePage();
}
} else {
pTabPage->ActivatePage();
}
- m_aTabCtrl.BroadcastEvent( VCLEVENT_TABPAGE_ACTIVATE );
+ m_aTabCtrl->BroadcastEvent( VCLEVENT_TABPAGE_ACTIVATE );
return 1;
}
IMPL_LINK_NOARG(FwkTabWindow, DeactivatePageHdl)
{
- m_aTabCtrl.BroadcastEvent( VCLEVENT_TABPAGE_DEACTIVATE );
+ m_aTabCtrl->BroadcastEvent( VCLEVENT_TABPAGE_DEACTIVATE );
return 1;
}
void FwkTabWindow::AddEventListener( const Link& rEventListener )
{
- m_aTabCtrl.AddEventListener( rEventListener );
+ m_aTabCtrl->AddEventListener( rEventListener );
}
void FwkTabWindow::RemoveEventListener( const Link& rEventListener )
{
- m_aTabCtrl.RemoveEventListener( rEventListener );
+ m_aTabCtrl->RemoveEventListener( rEventListener );
}
FwkTabPage* FwkTabWindow::AddTabPage( sal_Int32 nIndex, const uno::Sequence< beans::NamedValue >& rProperties )
@@ -311,20 +324,20 @@ FwkTabPage* FwkTabWindow::AddTabPage( sal_Int32 nIndex, const uno::Sequence< bea
TabEntry* pEntry = new TabEntry( nIndex, sPageURL, xEventHdl );
m_TabList.push_back( pEntry );
sal_uInt16 nIdx = static_cast< sal_uInt16 >( nIndex );
- m_aTabCtrl.InsertPage( nIdx, sTitle );
+ m_aTabCtrl->InsertPage( nIdx, sTitle );
if ( !sToolTip.isEmpty() )
- m_aTabCtrl.SetHelpText( nIdx, sToolTip );
+ m_aTabCtrl->SetHelpText( nIdx, sToolTip );
if ( xImage.is() )
- m_aTabCtrl.SetPageImage( nIdx, Image( xImage ) );
+ m_aTabCtrl->SetPageImage( nIdx, Image( xImage ) );
if ( bDisabled )
- m_aTabCtrl.EnablePage( nIdx, false );
+ m_aTabCtrl->EnablePage( nIdx, false );
return pEntry->m_pPage;
}
void FwkTabWindow::ActivatePage( sal_Int32 nIndex )
{
- m_aTabCtrl.SetCurPageId( static_cast< sal_uInt16 >( nIndex ) );
+ m_aTabCtrl->SetCurPageId( static_cast< sal_uInt16 >( nIndex ) );
ActivatePageHdl( &m_aTabCtrl );
}
@@ -333,7 +346,7 @@ void FwkTabWindow::RemovePage( sal_Int32 nIndex )
TabEntry* pEntry = FindEntry(nIndex);
if ( pEntry )
{
- m_aTabCtrl.RemovePage( static_cast< sal_uInt16 >( nIndex ) );
+ m_aTabCtrl->RemovePage( static_cast< sal_uInt16 >( nIndex ) );
if (RemoveEntry(nIndex))
delete pEntry;
}
@@ -342,7 +355,7 @@ void FwkTabWindow::RemovePage( sal_Int32 nIndex )
void FwkTabWindow::Resize()
{
Size aPageSize = GetSizePixel();
- m_aTabCtrl.SetTabPageSizePixel( aPageSize );
+ m_aTabCtrl->SetTabPageSizePixel( aPageSize );
}
} // namespace framework
diff --git a/framework/source/helper/vclstatusindicator.cxx b/framework/source/helper/vclstatusindicator.cxx
index e02c4e747ca9..18f08294d489 100644
--- a/framework/source/helper/vclstatusindicator.cxx
+++ b/framework/source/helper/vclstatusindicator.cxx
@@ -48,7 +48,7 @@ void SAL_CALL VCLStatusIndicator::start(const OUString& sText ,
vcl::Window* pParentWindow = VCLUnoHelper::GetWindow(m_xParentWindow);
if (!m_pStatusBar)
- m_pStatusBar = new StatusBar(pParentWindow, WB_3DLOOK|WB_BORDER);
+ m_pStatusBar = VclPtr<StatusBar>::Create(pParentWindow, WB_3DLOOK|WB_BORDER);
VCLStatusIndicator::impl_recalcLayout(m_pStatusBar, pParentWindow);
@@ -91,8 +91,7 @@ void SAL_CALL VCLStatusIndicator::end()
m_pStatusBar->EndProgressMode();
m_pStatusBar->Show(false);
- delete m_pStatusBar;
- m_pStatusBar = 0;
+ m_pStatusBar.disposeAndClear();
}
}
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index f3434b739541..6ccaf62f89e6 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -906,7 +906,7 @@ void LayoutManager::implts_createProgressBar()
vcl::Window* pWindow = VCLUnoHelper::GetWindow( xContainerWindow );
if ( pWindow )
{
- StatusBar* pStatusBar = new StatusBar( pWindow, WinBits( WB_LEFT | WB_3DLOOK ) );
+ VclPtrInstance<StatusBar> pStatusBar( pWindow, WinBits( WB_LEFT | WB_3DLOOK ) );
Reference< awt::XWindow > xStatusBarWindow2( VCLUnoHelper::GetInterface( pStatusBar ));
pWrapper->setStatusBar( xStatusBarWindow2, true );
}
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
index f40b98d068f2..1b1b9fc41948 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
@@ -1031,14 +1031,14 @@ void ToolbarLayoutManager::setParentWindow(
if ( xParentWindow.is() )
{
SolarMutexGuard aGuard;
- ::DockingAreaWindow* pWindow = dynamic_cast< ::DockingAreaWindow* >(VCLUnoHelper::GetWindow( xTopDockWindow ) );
+ VclPtr< ::DockingAreaWindow > pWindow = dynamic_cast< ::DockingAreaWindow* >(VCLUnoHelper::GetWindow( xTopDockWindow ).get() );
if( pWindow ) pWindow->SetAlign( WINDOWALIGN_TOP );
- pWindow = dynamic_cast< ::DockingAreaWindow* >(VCLUnoHelper::GetWindow( xBottomDockWindow ) );
- if( pWindow ) pWindow->SetAlign( WINDOWALIGN_BOTTOM );
- pWindow = dynamic_cast< ::DockingAreaWindow* >(VCLUnoHelper::GetWindow( xLeftDockWindow ) );
- if( pWindow ) pWindow->SetAlign( WINDOWALIGN_LEFT );
- pWindow = dynamic_cast< ::DockingAreaWindow* >(VCLUnoHelper::GetWindow( xRightDockWindow ) );
- if( pWindow ) pWindow->SetAlign( WINDOWALIGN_RIGHT );
+ pWindow = dynamic_cast< ::DockingAreaWindow* >(VCLUnoHelper::GetWindow( xBottomDockWindow ).get() );
+ if( pWindow ) pWindow->SetAlign( WINDOWALIGN_BOTTOM );
+ pWindow = dynamic_cast< ::DockingAreaWindow* >(VCLUnoHelper::GetWindow( xLeftDockWindow ).get() );
+ if( pWindow ) pWindow->SetAlign( WINDOWALIGN_LEFT );
+ pWindow = dynamic_cast< ::DockingAreaWindow* >(VCLUnoHelper::GetWindow( xRightDockWindow ).get() );
+ if( pWindow ) pWindow->SetAlign( WINDOWALIGN_RIGHT );
implts_reparentToolbars();
}
else
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index b235a624cd4e..0a23fa606e66 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -4205,11 +4205,11 @@ void AutoRecovery::impl_showFullDiscError()
if (sBackupPath.getLength() < 1)
sBackupPath = sBackupURL;
- ErrorBox dlgError(
- 0, WB_OK,
+ ScopedVclPtrInstance<ErrorBox> dlgError(
+ nullptr, WB_OK,
sMsg.replaceAll("%PATH", sBackupPath));
- dlgError.SetButtonText(dlgError.GetButtonId(0), sBtn);
- dlgError.Execute();
+ dlgError->SetButtonText(dlgError->GetButtonId(0), sBtn);
+ dlgError->Execute();
}
void AutoRecovery::impl_establishProgress(const AutoRecovery::TDocumentInfo& rInfo ,
diff --git a/framework/source/services/tabwindowservice.cxx b/framework/source/services/tabwindowservice.cxx
index dd9c46e58235..f93aee07ed9a 100644
--- a/framework/source/services/tabwindowservice.cxx
+++ b/framework/source/services/tabwindowservice.cxx
@@ -68,8 +68,8 @@ struct TTabPageInfo
public:
::sal_Int32 m_nIndex;
- bool m_bCreated;
- FwkTabPage* m_pPage;
+ bool m_bCreated;
+ VclPtr<FwkTabPage> m_pPage;
css::uno::Sequence< css::beans::NamedValue > m_lProperties;
};
@@ -159,7 +159,7 @@ private:
css::uno::Reference< css::awt::XWindow > m_xTabWin;
/// the VCL tab window
- FwkTabWindow* m_pTabWin;
+ VclPtr<FwkTabWindow> m_pTabWin;
/// container of inserted tab pages
TTabPageInfoHash m_lTabPageInfos;
@@ -356,7 +356,7 @@ void SAL_CALL TabWindowService::dispose()
if (m_pTabWin)
m_pTabWin->RemoveEventListener( LINK( this, TabWindowService, EventListener ) );
- m_pTabWin = NULL;
+ m_pTabWin.clear();
m_xTabWin.clear();
}
diff --git a/framework/source/uielement/addonstoolbarwrapper.cxx b/framework/source/uielement/addonstoolbarwrapper.cxx
index 77987fa3c279..35506a24e86c 100644
--- a/framework/source/uielement/addonstoolbarwrapper.cxx
+++ b/framework/source/uielement/addonstoolbarwrapper.cxx
@@ -114,7 +114,7 @@ void SAL_CALL AddonsToolBarWrapper::initialize( const Sequence< Any >& aArgument
{
sal_uLong nStyles = WB_LINESPACING | WB_BORDER | WB_SCROLL | WB_MOVEABLE | WB_3DLOOK | WB_DOCKABLE | WB_SIZEABLE | WB_CLOSEABLE;
- pToolBar = new ToolBox( pWindow, nStyles );
+ pToolBar = VclPtr<ToolBox>::Create( pWindow, nStyles );
pToolBarManager = new AddonsToolBarManager( m_xContext, xFrame, m_aResourceURL, pToolBar );
m_xToolBarManager = Reference< XComponent >( static_cast< OWeakObject *>( pToolBarManager ), UNO_QUERY );
}
diff --git a/framework/source/uielement/buttontoolbarcontroller.cxx b/framework/source/uielement/buttontoolbarcontroller.cxx
index 2219b5c6ff97..aaf068591354 100644
--- a/framework/source/uielement/buttontoolbarcontroller.cxx
+++ b/framework/source/uielement/buttontoolbarcontroller.cxx
@@ -152,7 +152,7 @@ void SAL_CALL ButtonToolbarController::dispose() throw (::com::sun::star::uno::R
m_xContext.clear();
m_xURLTransformer.clear();
m_xFrame.clear();
- m_pToolbar = 0;
+ m_pToolbar.clear();
m_bDisposed = true;
}
}
diff --git a/framework/source/uielement/comboboxtoolbarcontroller.cxx b/framework/source/uielement/comboboxtoolbarcontroller.cxx
index 2f3cefb4f4d0..15fb15cfd3a9 100644
--- a/framework/source/uielement/comboboxtoolbarcontroller.cxx
+++ b/framework/source/uielement/comboboxtoolbarcontroller.cxx
@@ -55,6 +55,7 @@ class ComboBoxControl : public ComboBox
public:
ComboBoxControl( vcl::Window* pParent, WinBits nStyle, IComboBoxListener* pComboBoxListener );
virtual ~ComboBoxControl();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Select() SAL_OVERRIDE;
virtual void DoubleClick() SAL_OVERRIDE;
@@ -76,7 +77,13 @@ ComboBoxControl::ComboBoxControl( vcl::Window* pParent, WinBits nStyle, IComboBo
ComboBoxControl::~ComboBoxControl()
{
+ disposeOnce();
+}
+
+void ComboBoxControl::dispose()
+{
m_pComboBoxListener = 0;
+ ComboBox::dispose();
}
void ComboBoxControl::Select()
@@ -142,7 +149,7 @@ ComboboxToolbarController::ComboboxToolbarController(
ComplexToolbarController( rxContext, rFrame, pToolbar, nID, aCommand )
, m_pComboBox( 0 )
{
- m_pComboBox = new ComboBoxControl( m_pToolbar, WB_DROPDOWN, this );
+ m_pComboBox = VclPtr<ComboBoxControl>::Create( m_pToolbar, WB_DROPDOWN, this );
if ( nWidth == 0 )
nWidth = 100;
@@ -164,11 +171,9 @@ throw ( RuntimeException, std::exception )
SolarMutexGuard aSolarMutexGuard;
m_pToolbar->SetItemWindow( m_nID, 0 );
- delete m_pComboBox;
+ m_pComboBox.disposeAndClear();
ComplexToolbarController::dispose();
-
- m_pComboBox = 0;
}
Sequence<PropertyValue> ComboboxToolbarController::getExecuteArgs(sal_Int16 KeyModifier) const
diff --git a/framework/source/uielement/complextoolbarcontroller.cxx b/framework/source/uielement/complextoolbarcontroller.cxx
index 871c7b2bba6a..05f1d1c27a44 100644
--- a/framework/source/uielement/complextoolbarcontroller.cxx
+++ b/framework/source/uielement/complextoolbarcontroller.cxx
@@ -76,7 +76,7 @@ throw ( RuntimeException, std::exception )
svt::ToolboxController::dispose();
m_xURLTransformer.clear();
- m_pToolbar = 0;
+ m_pToolbar.clear();
m_nID = 0;
}
diff --git a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx
index 5eb339284cb9..7d00fbcd70d9 100644
--- a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx
+++ b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx
@@ -54,6 +54,7 @@ class ListBoxControl : public ListBox
public:
ListBoxControl( vcl::Window* pParent, WinBits nStyle, IListBoxListener* pListBoxListener );
virtual ~ListBoxControl();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Select() SAL_OVERRIDE;
virtual void DoubleClick() SAL_OVERRIDE;
@@ -73,7 +74,13 @@ ListBoxControl::ListBoxControl( vcl::Window* pParent, WinBits nStyle, IListBoxLi
ListBoxControl::~ListBoxControl()
{
+ disposeOnce();
+}
+
+void ListBoxControl::dispose()
+{
m_pListBoxListener = 0;
+ ListBox::dispose();
}
void ListBoxControl::Select()
@@ -125,7 +132,7 @@ DropdownToolbarController::DropdownToolbarController(
ComplexToolbarController( rxContext, rFrame, pToolbar, nID, aCommand )
, m_pListBoxControl( 0 )
{
- m_pListBoxControl = new ListBoxControl( m_pToolbar, WB_DROPDOWN|WB_AUTOHSCROLL|WB_BORDER, this );
+ m_pListBoxControl = VclPtr<ListBoxControl>::Create( m_pToolbar, WB_DROPDOWN|WB_AUTOHSCROLL|WB_BORDER, this );
if ( nWidth == 0 )
nWidth = 100;
@@ -148,11 +155,9 @@ throw ( RuntimeException, std::exception )
SolarMutexGuard aSolarMutexGuard;
m_pToolbar->SetItemWindow( m_nID, 0 );
- delete m_pListBoxControl;
+ m_pListBoxControl.disposeAndClear();
ComplexToolbarController::dispose();
-
- m_pListBoxControl = 0;
}
Sequence<PropertyValue> DropdownToolbarController::getExecuteArgs(sal_Int16 KeyModifier) const
diff --git a/framework/source/uielement/edittoolbarcontroller.cxx b/framework/source/uielement/edittoolbarcontroller.cxx
index 67cdcb1e2e3d..41403fd9f7e7 100644
--- a/framework/source/uielement/edittoolbarcontroller.cxx
+++ b/framework/source/uielement/edittoolbarcontroller.cxx
@@ -53,6 +53,7 @@ class EditControl : public Edit
public:
EditControl( vcl::Window* pParent, WinBits nStyle, IEditListener* pEditListener );
virtual ~EditControl();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Modify() SAL_OVERRIDE;
virtual void KeyInput( const ::KeyEvent& rKEvt ) SAL_OVERRIDE;
@@ -72,7 +73,13 @@ EditControl::EditControl( vcl::Window* pParent, WinBits nStyle, IEditListener* p
EditControl::~EditControl()
{
+ disposeOnce();
+}
+
+void EditControl::dispose()
+{
m_pEditListener = 0;
+ Edit::dispose();
}
void EditControl::Modify()
@@ -124,7 +131,7 @@ EditToolbarController::EditToolbarController(
ComplexToolbarController( rxContext, rFrame, pToolbar, nID, aCommand )
, m_pEditControl( 0 )
{
- m_pEditControl = new EditControl( m_pToolbar, WB_BORDER, this );
+ m_pEditControl = VclPtr<EditControl>::Create( m_pToolbar, WB_BORDER, this );
if ( nWidth == 0 )
nWidth = 100;
@@ -145,11 +152,9 @@ throw ( RuntimeException, std::exception )
SolarMutexGuard aSolarMutexGuard;
m_pToolbar->SetItemWindow( m_nID, 0 );
- delete m_pEditControl;
+ m_pEditControl.disposeAndClear();
ComplexToolbarController::dispose();
-
- m_pEditControl = 0;
}
Sequence<PropertyValue> EditToolbarController::getExecuteArgs(sal_Int16 KeyModifier) const
diff --git a/framework/source/uielement/fontsizemenucontroller.cxx b/framework/source/uielement/fontsizemenucontroller.cxx
index 3e097655c9ab..7ad43146d4cc 100644
--- a/framework/source/uielement/fontsizemenucontroller.cxx
+++ b/framework/source/uielement/fontsizemenucontroller.cxx
@@ -135,7 +135,7 @@ void FontSizeMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r
if ( pVCLPopupMenu )
{
boost::scoped_ptr<FontList> pFontList;
- boost::scoped_ptr<Printer> pInfoPrinter;
+ ScopedVclPtr<Printer> pInfoPrinter;
OUString aPrinterName;
SolarMutexGuard aSolarMutexGuard;
@@ -144,7 +144,7 @@ void FontSizeMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r
aPrinterName = retrievePrinterName( m_xFrame );
if ( !aPrinterName.isEmpty() )
{
- pInfoPrinter.reset(new Printer( aPrinterName ));
+ pInfoPrinter.reset(VclPtr<Printer>::Create( aPrinterName ));
if ( pInfoPrinter && pInfoPrinter->GetDevFontCount() > 0 )
pFontList.reset(new FontList( pInfoPrinter.get() ));
}
diff --git a/framework/source/uielement/generictoolbarcontroller.cxx b/framework/source/uielement/generictoolbarcontroller.cxx
index c2cdf4058fe4..7bf96258312d 100644
--- a/framework/source/uielement/generictoolbarcontroller.cxx
+++ b/framework/source/uielement/generictoolbarcontroller.cxx
@@ -125,7 +125,7 @@ throw ( RuntimeException, std::exception )
svt::ToolboxController::dispose();
- m_pToolbar = 0;
+ m_pToolbar.clear();
m_nID = 0;
}
diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx
index 259601ea8855..c2e324717825 100644
--- a/framework/source/uielement/popuptoolbarcontroller.cxx
+++ b/framework/source/uielement/popuptoolbarcontroller.cxx
@@ -146,7 +146,7 @@ throw ( css::uno::Exception, css::uno::RuntimeException, std::exception )
}
SolarMutexGuard aSolarLock;
- ToolBox* pToolBox = static_cast< ToolBox* >( VCLUnoHelper::GetWindow( getParent() ) );
+ VclPtr< ToolBox > pToolBox = static_cast< ToolBox* >( VCLUnoHelper::GetWindow( getParent() ).get() );
if ( pToolBox )
{
ToolBoxItemBits nCurStyle( pToolBox->GetItemBits( m_nToolBoxId ) );
@@ -181,7 +181,7 @@ PopupMenuToolbarController::createPopupWindow()
createPopupMenuController();
SolarMutexGuard aSolarLock;
- ToolBox* pToolBox = static_cast< ToolBox* >( VCLUnoHelper::GetWindow( getParent() ) );
+ VclPtr< ToolBox > pToolBox = static_cast< ToolBox* >( VCLUnoHelper::GetWindow( getParent() ).get() );
if ( !pToolBox )
return xRet;
@@ -540,7 +540,7 @@ static bool Impl_ExistURLInMenu(
void NewToolbarController::setItemImage( const OUString &rCommand )
{
SolarMutexGuard aSolarLock;
- ToolBox* pToolBox = static_cast< ToolBox* >( VCLUnoHelper::GetWindow( getParent() ) );
+ VclPtr< ToolBox> pToolBox = static_cast< ToolBox* >( VCLUnoHelper::GetWindow( getParent() ).get() );
if ( !pToolBox )
return;
diff --git a/framework/source/uielement/spinfieldtoolbarcontroller.cxx b/framework/source/uielement/spinfieldtoolbarcontroller.cxx
index efe6a711877f..3d60f613e000 100644
--- a/framework/source/uielement/spinfieldtoolbarcontroller.cxx
+++ b/framework/source/uielement/spinfieldtoolbarcontroller.cxx
@@ -59,6 +59,7 @@ class SpinfieldControl : public SpinField
public:
SpinfieldControl( vcl::Window* pParent, WinBits nStyle, ISpinfieldListener* pSpinFieldListener );
virtual ~SpinfieldControl();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Up() SAL_OVERRIDE;
virtual void Down() SAL_OVERRIDE;
@@ -84,7 +85,13 @@ SpinfieldControl::SpinfieldControl( vcl::Window* pParent, WinBits nStyle, ISpinf
SpinfieldControl::~SpinfieldControl()
{
+ disposeOnce();
+}
+
+void SpinfieldControl::dispose()
+{
m_pSpinFieldListener = 0;
+ SpinField::dispose();
}
void SpinfieldControl::Up()
@@ -185,7 +192,7 @@ SpinfieldToolbarController::SpinfieldToolbarController(
, m_nStep( 0.0 )
, m_pSpinfieldControl( 0 )
{
- m_pSpinfieldControl = new SpinfieldControl( m_pToolbar, WB_SPIN|WB_BORDER, this );
+ m_pSpinfieldControl = VclPtr<SpinfieldControl>::Create( m_pToolbar, WB_SPIN|WB_BORDER, this );
if ( nWidth == 0 )
nWidth = 100;
@@ -206,11 +213,9 @@ throw ( RuntimeException, std::exception )
SolarMutexGuard aSolarMutexGuard;
m_pToolbar->SetItemWindow( m_nID, 0 );
- delete m_pSpinfieldControl;
+ m_pSpinfieldControl.disposeAndClear();
ComplexToolbarController::dispose();
-
- m_pSpinfieldControl = 0;
}
Sequence<PropertyValue> SpinfieldToolbarController::getExecuteArgs(sal_Int16 KeyModifier) const
diff --git a/framework/source/uielement/statusbar.cxx b/framework/source/uielement/statusbar.cxx
index 9358efe228b2..2f520ec46d95 100644
--- a/framework/source/uielement/statusbar.cxx
+++ b/framework/source/uielement/statusbar.cxx
@@ -34,10 +34,6 @@ FrameworkStatusBar::FrameworkStatusBar(
SetOutputSizePixel( CalcWindowSizePixel() );
}
-FrameworkStatusBar::~FrameworkStatusBar()
-{
-}
-
void FrameworkStatusBar::SetStatusBarManager( StatusBarManager* pStatusBarManager )
{
SolarMutexGuard aSolarMutexGuard;
diff --git a/framework/source/uielement/statusbarmanager.cxx b/framework/source/uielement/statusbarmanager.cxx
index d04529352636..f6bfb7eaf03e 100644
--- a/framework/source/uielement/statusbarmanager.cxx
+++ b/framework/source/uielement/statusbarmanager.cxx
@@ -200,40 +200,39 @@ void SAL_CALL StatusBarManager::dispose() throw( uno::RuntimeException, std::exc
{
SolarMutexGuard g;
- if ( !m_bDisposed )
+ if ( m_bDisposed )
+ return;
+
+ RemoveControllers();
+
+ // destroy the item data
+ for ( sal_uInt16 n = 0; n < m_pStatusBar->GetItemCount(); n++ )
{
- RemoveControllers();
+ AddonStatusbarItemData *pUserData = static_cast< AddonStatusbarItemData *>(
+ m_pStatusBar->GetItemData( m_pStatusBar->GetItemId( n ) ) );
+ if ( pUserData )
+ delete pUserData;
+ }
- // destroy the item data
- for ( sal_uInt16 n = 0; n < m_pStatusBar->GetItemCount(); n++ )
+ m_pStatusBar.disposeAndClear();
+
+ if ( m_bFrameActionRegistered && m_xFrame.is() )
+ {
+ try
{
- AddonStatusbarItemData *pUserData = static_cast< AddonStatusbarItemData *>(
- m_pStatusBar->GetItemData( m_pStatusBar->GetItemId( n ) ) );
- if ( pUserData )
- delete pUserData;
+ m_xFrame->removeFrameActionListener( uno::Reference< frame::XFrameActionListener >(
+ static_cast< ::cppu::OWeakObject *>( this ),
+ uno::UNO_QUERY ));
}
-
- delete m_pStatusBar;
- m_pStatusBar = 0;
-
- if ( m_bFrameActionRegistered && m_xFrame.is() )
+ catch ( const uno::Exception& )
{
- try
- {
- m_xFrame->removeFrameActionListener( uno::Reference< frame::XFrameActionListener >(
- static_cast< ::cppu::OWeakObject *>( this ),
- uno::UNO_QUERY ));
- }
- catch ( const uno::Exception& )
- {
- }
}
+ }
- m_xFrame.clear();
- m_xContext.clear();
+ m_xFrame.clear();
+ m_xContext.clear();
- m_bDisposed = true;
- }
+ m_bDisposed = true;
}
}
diff --git a/framework/source/uielement/statusbarwrapper.cxx b/framework/source/uielement/statusbarwrapper.cxx
index 7d5322f12e8a..2f1f74028a0c 100644
--- a/framework/source/uielement/statusbarwrapper.cxx
+++ b/framework/source/uielement/statusbarwrapper.cxx
@@ -110,7 +110,7 @@ void SAL_CALL StatusBarWrapper::initialize( const Sequence< Any >& aArguments )
{
sal_uLong nStyles = WinBits( WB_LEFT | WB_3DLOOK );
- pStatusBar = new FrameworkStatusBar( pWindow, nStyles );
+ pStatusBar = VclPtr<FrameworkStatusBar>::Create( pWindow, nStyles );
pStatusBarManager = new StatusBarManager( m_xContext, xFrame, m_aResourceURL, pStatusBar );
static_cast<FrameworkStatusBar*>(pStatusBar)->SetStatusBarManager( pStatusBarManager );
m_xStatusBarManager = Reference< XComponent >( static_cast< OWeakObject *>( pStatusBarManager ), UNO_QUERY );
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index 4de9df463d66..aca1580fef76 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -1,4 +1,3 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
@@ -250,7 +249,7 @@ ToolBarManager::~ToolBarManager()
void ToolBarManager::Destroy()
{
- OSL_ASSERT( m_pToolBar != 0 );
+ OSL_ASSERT( m_pToolBar != nullptr );
SolarMutexGuard g;
if ( m_bAddedToTaskPaneList )
{
@@ -288,7 +287,7 @@ void ToolBarManager::Destroy()
m_pToolBar->SetDataChangedHdl( aEmpty );
m_pToolBar->SetCommandHdl( aEmpty );
- m_pToolBar = 0;
+ m_pToolBar.clear();
SvtMiscOptions().RemoveListenerLink( LINK( this, ToolBarManager, MiscOptionsChanged ) );
}
@@ -599,6 +598,7 @@ void SAL_CALL ToolBarManager::dispose() throw( RuntimeException, std::exception
// We have to destroy our toolbar instance now.
Destroy();
+ m_pToolBar.clear();
if ( m_bFrameActionRegistered && m_xFrame.is() )
{
@@ -727,7 +727,7 @@ void ToolBarManager::setToolBarImage(const Image& _aImage,const CommandToInfoMap
{
const ::std::vector< sal_uInt16 >& _rIDs = _pIter->second.aIds;
m_pToolBar->SetItemImage( _pIter->second.nId, _aImage );
- ::std::for_each(_rIDs.begin(),_rIDs.end(),::boost::bind(&ToolBox::SetItemImage,m_pToolBar,_1,_aImage));
+ ::std::for_each(_rIDs.begin(),_rIDs.end(),::boost::bind(&ToolBox::SetItemImage,m_pToolBar.get(),_1,_aImage));
}
void SAL_CALL ToolBarManager::elementReplaced( const ::com::sun::star::ui::ConfigurationEvent& Event ) throw (::com::sun::star::uno::RuntimeException, std::exception)
diff --git a/framework/source/uielement/toolbarwrapper.cxx b/framework/source/uielement/toolbarwrapper.cxx
index ad609a20cca8..36f9909a250b 100644
--- a/framework/source/uielement/toolbarwrapper.cxx
+++ b/framework/source/uielement/toolbarwrapper.cxx
@@ -150,7 +150,7 @@ void SAL_CALL ToolBarWrapper::initialize( const Sequence< Any >& aArguments ) th
{
sal_uLong nStyles = WB_LINESPACING | WB_BORDER | WB_SCROLL | WB_MOVEABLE | WB_3DLOOK | WB_DOCKABLE | WB_SIZEABLE | WB_CLOSEABLE;
- pToolBar = new ToolBox( pWindow, nStyles );
+ pToolBar = VclPtr<ToolBox>::Create( pWindow, nStyles );
pToolBarManager = new ToolBarManager( m_xContext, xFrame, m_aResourceURL, pToolBar );
m_xToolBarManager = Reference< XComponent >( static_cast< OWeakObject *>( pToolBarManager ), UNO_QUERY );
pToolBar->WillUsePopupMode( bPopupMode );
diff --git a/include/avmedia/mediaplayer.hxx b/include/avmedia/mediaplayer.hxx
index 101c6c623dfc..bb24bd08ff0a 100644
--- a/include/avmedia/mediaplayer.hxx
+++ b/include/avmedia/mediaplayer.hxx
@@ -45,6 +45,7 @@ public:
MediaFloater( SfxBindings* pBindings, SfxChildWindow* pCW, vcl::Window* pParent );
virtual ~MediaFloater();
+ virtual void dispose() SAL_OVERRIDE;
void setURL( const OUString& rURL, const OUString& rReferer, bool bPlayImmediately );
diff --git a/include/avmedia/mediatoolbox.hxx b/include/avmedia/mediatoolbox.hxx
index 4c512979288a..fb61d33b865f 100644
--- a/include/avmedia/mediatoolbox.hxx
+++ b/include/avmedia/mediatoolbox.hxx
@@ -45,7 +45,7 @@ public:
virtual ~MediaToolBoxControl();
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) SAL_OVERRIDE;
- virtual vcl::Window* CreateItemWindow( vcl::Window* pParent ) SAL_OVERRIDE;
+ virtual VclPtr<vcl::Window> CreateItemWindow( vcl::Window* pParent ) SAL_OVERRIDE;
private:
diff --git a/include/avmedia/mediawindow.hxx b/include/avmedia/mediawindow.hxx
index b17ffe4afbc8..3eeb7078552b 100644
--- a/include/avmedia/mediawindow.hxx
+++ b/include/avmedia/mediawindow.hxx
@@ -28,6 +28,7 @@
#include <com/sun/star/graphic/XGraphic.hpp>
#include <com/sun/star/uno/XInterface.hpp>
#include <vcl/bitmapex.hxx>
+#include <vcl/vclptr.hxx>
#include <avmedia/avmediadllapi.h>
#define AVMEDIA_FRAMEGRABBER_DEFAULTFRAME -1.0
@@ -115,7 +116,7 @@ namespace avmedia
MediaWindow& operator =( const MediaWindow& ) SAL_DELETED_FUNCTION;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxIFace;
- std::unique_ptr<priv::MediaWindowImpl> mpImpl;
+ VclPtr<priv::MediaWindowImpl> mpImpl;
};
}
diff --git a/include/dbaccess/ToolBoxHelper.hxx b/include/dbaccess/ToolBoxHelper.hxx
index 4757c8ffb802..d9671b45fe3b 100644
--- a/include/dbaccess/ToolBoxHelper.hxx
+++ b/include/dbaccess/ToolBoxHelper.hxx
@@ -23,6 +23,7 @@
#include <sal/types.h>
#include <tools/link.hxx>
#include <vcl/image.hxx>
+#include <vcl/vclptr.hxx>
#include <dbaccess/dbaccessdllapi.h>
class SvtMiscOptions;
@@ -34,7 +35,7 @@ namespace dbaui
class DBACCESS_DLLPUBLIC OToolBoxHelper
{
sal_Int16 m_nSymbolsSize; // shows the toolbox large or small bitmaps
- ToolBox* m_pToolBox; // our toolbox (may be NULL)
+ VclPtr<ToolBox> m_pToolBox; // our toolbox (may be NULL)
public:
OToolBoxHelper();
virtual ~OToolBoxHelper();
diff --git a/include/dbaccess/dataview.hxx b/include/dbaccess/dataview.hxx
index 8189cc93a4f0..4dabda021210 100644
--- a/include/dbaccess/dataview.hxx
+++ b/include/dbaccess/dataview.hxx
@@ -37,8 +37,8 @@ namespace dbaui
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; // the service factory to work with
protected:
- IController& m_rController; // the controller in where we resides in
- FixedLine m_aSeparator;
+ rtl::Reference<IController> m_xController; // the controller in where we resides in
+ VclPtr<FixedLine> m_aSeparator;
::std::unique_ptr< ::svt::AcceleratorExecute> m_pAccel;
public:
@@ -47,6 +47,7 @@ namespace dbaui
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& ,
WinBits nStyle = 0 );
virtual ~ODataView();
+ virtual void dispose() SAL_OVERRIDE;
/// late construction
virtual void Construct();
@@ -57,7 +58,7 @@ namespace dbaui
virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
- inline IController& getCommandController() const { return m_rController; }
+ inline IController& getCommandController() const { return *m_xController.get(); }
/** will be called when the controls need to be resized.
*/
diff --git a/include/dbaccess/genericcontroller.hxx b/include/dbaccess/genericcontroller.hxx
index 4dffac9b87f7..c98af7393b5e 100644
--- a/include/dbaccess/genericcontroller.hxx
+++ b/include/dbaccess/genericcontroller.hxx
@@ -59,6 +59,7 @@
#include <boost/optional.hpp>
#include <sfx2/userinputinterception.hxx>
+#include <vcl/vclptr.hxx>
namespace dbtools
{
@@ -212,7 +213,7 @@ namespace dbaui
::std::unique_ptr< OGenericUnoController_Data >
m_pData;
- ODataView* m_pView; // our (VCL) "main window"
+ VclPtr<ODataView> m_pView; // our (VCL) "main window"
#ifdef DBG_UTIL
bool m_bDescribingSupportedFeatures;
@@ -407,8 +408,8 @@ namespace dbaui
public:
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > getORB() const { return m_xContext; }
ODataView* getView() const { return m_pView; }
- void setView( ODataView& i_rView ) { m_pView = &i_rView; }
- void clearView() { m_pView = NULL; }
+ void setView( const VclPtr<ODataView>& i_rView );
+ void clearView();
// shows a error box if the SQLExceptionInfo is valid
void showError(const ::dbtools::SQLExceptionInfo& _rInfo);
diff --git a/include/drawinglayer/processor2d/canvasprocessor.hxx b/include/drawinglayer/processor2d/canvasprocessor.hxx
index d928a84a5d35..fb10ad339e0b 100644
--- a/include/drawinglayer/processor2d/canvasprocessor.hxx
+++ b/include/drawinglayer/processor2d/canvasprocessor.hxx
@@ -71,7 +71,7 @@ namespace drawinglayer
{
private:
// the (current) destination OutDev and canvas
- OutputDevice* mpOutputDevice;
+ VclPtr<OutputDevice> mpOutputDevice;
com::sun::star::uno::Reference< com::sun::star::rendering::XCanvas > mxCanvas;
com::sun::star::rendering::ViewState maViewState;
com::sun::star::rendering::RenderState maRenderState;
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index 12bb7792fe13..9bfb4b4552c8 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -30,6 +30,7 @@
#include <tools/color.hxx>
#include <tools/contnr.hxx>
#include <vcl/graph.hxx>
+#include <vcl/outdev.hxx>
#include <tools/link.hxx>
#include <rsc/rscsfx.hxx>
#include <editeng/editengdllapi.h>
@@ -476,7 +477,7 @@ struct EDITENG_DLLPUBLIC PaintFirstLineInfo
long mnBaseLineY;
const Point& mrOrigin;
short mnOrientation;
- OutputDevice* mpOutDev;
+ VclPtr<OutputDevice> mpOutDev;
PaintFirstLineInfo( sal_Int32 nPara, const Point& rStartPos, long nBaseLineY, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev )
: mnPara( nPara ), mrStartPos( rStartPos ), mnBaseLineY( nBaseLineY ), mrOrigin( rOrigin ), mnOrientation( nOrientation ), mpOutDev( pOutDev )
diff --git a/include/editeng/splwrap.hxx b/include/editeng/splwrap.hxx
index 6c77e530e1e9..5e879f453381 100644
--- a/include/editeng/splwrap.hxx
+++ b/include/editeng/splwrap.hxx
@@ -23,6 +23,7 @@
#include <editeng/svxenum.hxx>
#include <rtl/ustring.hxx>
#include <com/sun/star/uno/Reference.hxx>
+#include <vcl/vclptr.hxx>
// forward ---------------------------------------------------------------
@@ -48,7 +49,7 @@ private:
friend class SvxHyphenWordDialog;
friend struct SvxHyphenWordDialog_Impl;
- vcl::Window* pWin;
+ VclPtr<vcl::Window> pWin;
::com::sun::star::uno::Reference<
::com::sun::star::uno::XInterface > xLast; // result of last spelling/hyphenation attempt
::com::sun::star::uno::Reference<
diff --git a/include/formula/funcutl.hxx b/include/formula/funcutl.hxx
index bc407057d183..400a49b79876 100644
--- a/include/formula/funcutl.hxx
+++ b/include/formula/funcutl.hxx
@@ -34,7 +34,7 @@ class FORMULA_DLLPUBLIC RefEdit : public Edit
private:
Idle aIdle;
IControlReferenceHandler* pAnyRefDlg; // parent dialog
- vcl::Window* pLabelWidget;
+ VclPtr<vcl::Window> pLabelWidget;
DECL_LINK( UpdateHdl, void* );
@@ -48,6 +48,7 @@ public:
RefEdit( vcl::Window* _pParent, vcl::Window* pShrinkModeLabel, WinBits nStyle = WB_BORDER );
virtual ~RefEdit();
+ virtual void dispose() SAL_OVERRIDE;
void SetRefString( const OUString& rStr );
@@ -86,7 +87,7 @@ private:
OUString aShrinkQuickHelp;
OUString aExpandQuickHelp;
IControlReferenceHandler* pAnyRefDlg; // parent dialog
- RefEdit* pRefEdit; // zugeordnetes Edit-Control
+ VclPtr<RefEdit> pRefEdit; // zugeordnetes Edit-Control
protected:
virtual void Click() SAL_OVERRIDE;
@@ -96,6 +97,8 @@ protected:
public:
RefButton(vcl::Window* _pParent, WinBits nStyle = 0);
+ virtual ~RefButton();
+ virtual void dispose() SAL_OVERRIDE;
void SetReferences( IControlReferenceHandler* pDlg, RefEdit* pEdit );
void SetStartImage();
void SetEndImage();
diff --git a/include/rtl/ref.hxx b/include/rtl/ref.hxx
index 942923ad6819..097584b1a276 100644
--- a/include/rtl/ref.hxx
+++ b/include/rtl/ref.hxx
@@ -49,6 +49,13 @@ public:
/** Constructor...
*/
+ inline Reference (reference_type * pBody, __sal_NoAcquire)
+ : m_pBody (pBody)
+ {
+ }
+
+ /** Constructor...
+ */
inline Reference (reference_type * pBody)
: m_pBody (pBody)
{
@@ -56,7 +63,6 @@ public:
m_pBody->acquire();
}
-
/** Copy constructor...
*/
inline Reference (const Reference<reference_type> & handle)
diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx
index 5a19603bdca8..99feed27df20 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;
@@ -161,16 +164,12 @@ public:
struct SingleTabDlgImpl
{
- SfxTabPage* m_pSfxPage;
- FixedLine* m_pLine;
+ VclPtr<SfxTabPage> m_pSfxPage;
+ VclPtr<FixedLine> m_pLine;
OUString m_sInfoURL;
Link m_aInfoLink;
- SingleTabDlgImpl()
- : m_pSfxPage(NULL)
- , m_pLine(NULL)
- {
- }
+ SingleTabDlgImpl();
};
typedef const sal_uInt16* (*GetTabPageRanges)(); // liefert internationale Which-Werte
@@ -187,6 +186,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; }
@@ -197,9 +197,9 @@ public:
protected:
GetTabPageRanges fnGetRanges;
- OKButton* pOKBtn;
- CancelButton* pCancelBtn;
- HelpButton* pHelpBtn;
+ VclPtr<OKButton> pOKBtn;
+ VclPtr<CancelButton> pCancelBtn;
+ VclPtr<HelpButton> pHelpBtn;
SingleTabDlgImpl* pImpl;
diff --git a/include/sfx2/checkin.hxx b/include/sfx2/checkin.hxx
index c5d93f68846d..54d2dffa2174 100644
--- a/include/sfx2/checkin.hxx
+++ b/include/sfx2/checkin.hxx
@@ -16,15 +16,17 @@
class SfxCheckinDialog : public ModalDialog
{
private:
- Edit* m_pCommentED;
- CheckBox* m_pMajorCB;
+ VclPtr<Edit> m_pCommentED;
+ VclPtr<CheckBox> m_pMajorCB;
- OKButton* m_pOKBtn;
+ VclPtr<OKButton> m_pOKBtn;
DECL_DLLPRIVATE_LINK(OKHdl, void *);
public:
SfxCheckinDialog( vcl::Window* pParent );
+ virtual ~SfxCheckinDialog();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetComment( );
bool IsMajor( );
diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
index a74b236a3f63..eb43f8e38343 100644
--- a/include/sfx2/childwin.hxx
+++ b/include/sfx2/childwin.hxx
@@ -124,7 +124,7 @@ struct SfxChildWindow_Impl;
class SFX2_DLLPUBLIC SfxChildWindowContext
{
friend class SfxChildWindow;
- vcl::Window* pWindow;
+ VclPtr<vcl::Window> pWindow;
sal_uInt16 nContextId;
protected:
@@ -148,12 +148,12 @@ public:
class SFX2_DLLPUBLIC SfxChildWindow
{
- vcl::Window* pParent; // parent window ( Topwindow )
- sal_uInt16 nType; // ChildWindow-Id
+ VclPtr<vcl::Window> pParent; // parent window ( Topwindow )
+ sal_uInt16 nType; // ChildWindow-Id
protected:
SfxChildAlignment eChildAlignment; // Current ::com::sun::star::drawing::Alignment
- vcl::Window* pWindow; // actual contents
+ VclPtr<vcl::Window> pWindow; // actual contents
SfxChildWindow_Impl* pImp; // Implementation data
private:
diff --git a/include/sfx2/ctrlitem.hxx b/include/sfx2/ctrlitem.hxx
index aa38dc0e54b9..24f64d9a73c1 100644
--- a/include/sfx2/ctrlitem.hxx
+++ b/include/sfx2/ctrlitem.hxx
@@ -56,6 +56,7 @@ public:
SfxControllerItem(); // for arrays
SfxControllerItem( sal_uInt16 nId, SfxBindings & );
virtual ~SfxControllerItem();
+ virtual void dispose();
void Bind( sal_uInt16 nNewId, SfxBindings * = 0); // Register in SfxBindings
void UnBind();
diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx
index 58c874cba363..babea564b5df 100644
--- a/include/sfx2/dinfdlg.hxx
+++ b/include/sfx2/dinfdlg.hxx
@@ -180,27 +180,27 @@ public:
class SfxDocumentPage : public SfxTabPage
{
private:
- FixedImage* m_pBmp;
- SelectableFixedText* m_pNameED;
- PushButton* m_pChangePassBtn;
+ VclPtr<FixedImage> m_pBmp;
+ VclPtr<SelectableFixedText> m_pNameED;
+ VclPtr<PushButton> m_pChangePassBtn;
- SelectableFixedText* m_pShowTypeFT;
- Edit* m_pFileValEd;
- SelectableFixedText* m_pShowSizeFT;
+ VclPtr<SelectableFixedText> m_pShowTypeFT;
+ VclPtr<Edit> m_pFileValEd;
+ VclPtr<SelectableFixedText> m_pShowSizeFT;
- SelectableFixedText* m_pCreateValFt;
- SelectableFixedText* m_pChangeValFt;
- SelectableFixedText* m_pSignedValFt;
- PushButton* m_pSignatureBtn;
- SelectableFixedText* m_pPrintValFt;
- SelectableFixedText* m_pTimeLogValFt;
- SelectableFixedText* m_pDocNoValFt;
+ VclPtr<SelectableFixedText> m_pCreateValFt;
+ VclPtr<SelectableFixedText> m_pChangeValFt;
+ VclPtr<SelectableFixedText> m_pSignedValFt;
+ VclPtr<PushButton> m_pSignatureBtn;
+ VclPtr<SelectableFixedText> m_pPrintValFt;
+ VclPtr<SelectableFixedText> m_pTimeLogValFt;
+ VclPtr<SelectableFixedText> m_pDocNoValFt;
- CheckBox* m_pUseUserDataCB;
- PushButton* m_pDeleteBtn;
+ VclPtr<CheckBox> m_pUseUserDataCB;
+ VclPtr<PushButton> m_pDeleteBtn;
- FixedText* m_pTemplFt;
- SelectableFixedText* m_pTemplValFt;
+ VclPtr<FixedText> m_pTemplFt;
+ VclPtr<SelectableFixedText> m_pTemplValFt;
OUString m_aUnknownSize;
OUString m_aMultiSignedStr;
@@ -215,13 +215,15 @@ private:
void ImplCheckPasswordState();
protected:
- SfxDocumentPage( vcl::Window* pParent, const SfxItemSet& );
+ virtual ~SfxDocumentPage();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* ) SAL_OVERRIDE;
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* );
+ SfxDocumentPage( vcl::Window* pParent, const SfxItemSet& );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* );
void EnableUseUserData();
};
@@ -231,20 +233,22 @@ public:
class SfxDocumentDescPage : public SfxTabPage
{
private:
- Edit* m_pTitleEd;
- Edit* m_pThemaEd;
- Edit* m_pKeywordsEd;
- VclMultiLineEdit* m_pCommentEd;
- SfxDocumentInfoItem* m_pInfoItem;
+ VclPtr<Edit> m_pTitleEd;
+ VclPtr<Edit> m_pThemaEd;
+ VclPtr<Edit> m_pKeywordsEd;
+ VclPtr<VclMultiLineEdit> m_pCommentEd;
+ SfxDocumentInfoItem* m_pInfoItem;
protected:
- SfxDocumentDescPage( vcl::Window* pParent, const SfxItemSet& );
+ virtual ~SfxDocumentDescPage();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* ) SAL_OVERRIDE;
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* );
+ SfxDocumentDescPage( vcl::Window* pParent, const SfxItemSet& );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* );
};
// class SfxDocumentInfoDialog -------------------------------------------
@@ -335,7 +339,6 @@ protected:
virtual void RequestHelp(const HelpEvent& rEvt) SAL_OVERRIDE;
public:
CustomPropertiesDurationField(vcl::Window* pParent, WinBits nStyle, CustomPropertyLine* pLine);
- virtual ~CustomPropertiesDurationField();
void SetDuration( const com::sun::star::util::Duration& rDuration );
const com::sun::star::util::Duration& GetDuration() const { return m_aDuration; }
@@ -347,7 +350,6 @@ class CustomPropertiesEditButton : public PushButton
public:
CustomPropertiesEditButton(vcl::Window* pParent, WinBits nStyle, CustomPropertyLine* pLine);
- virtual ~CustomPropertiesEditButton();
DECL_LINK(ClickHdl, void *);
};
@@ -370,33 +372,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;
@@ -412,19 +416,19 @@ struct CustomPropertyLine
class CustomPropertiesWindow : public vcl::Window
{
private:
- FixedText* m_pHeaderAccName;
- 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<FixedText> m_pHeaderAccName;
+ VclPtr<FixedText> m_pHeaderAccType;
+ VclPtr<FixedText> m_pHeaderAccValue;
+
+ 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 +458,7 @@ public:
FixedText *pHeaderAccType,
FixedText *pHeaderAccValue);
virtual ~CustomPropertiesWindow();
+ virtual void dispose() SAL_OVERRIDE;
bool InitControls( HeaderBar* pHeaderBar, const ScrollBar* pScrollBar );
sal_uInt16 GetVisibleLineCount() const;
@@ -476,11 +481,11 @@ public:
class CustomPropertiesControl : public vcl::Window
{
private:
- VclVBox* m_pVBox;
- HeaderBar* m_pHeaderBar;
- VclHBox* m_pBody;
- CustomPropertiesWindow* m_pPropertiesWin;
- ScrollBar* m_pVertScroll;
+ VclPtr<VclVBox> m_pVBox;
+ VclPtr<HeaderBar> m_pHeaderBar;
+ VclPtr<VclHBox> m_pBody;
+ VclPtr<CustomPropertiesWindow> m_pPropertiesWin;
+ VclPtr<ScrollBar> m_pVertScroll;
sal_Int32 m_nThumbPos;
@@ -490,6 +495,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 );
@@ -507,42 +513,44 @@ public:
class SfxCustomPropertiesPage : public SfxTabPage
{
private:
- CustomPropertiesControl* m_pPropertiesCtrl;
+ VclPtr<CustomPropertiesControl> m_pPropertiesCtrl;
DECL_LINK(AddHdl, void *);
using TabPage::DeactivatePage;
protected:
- SfxCustomPropertiesPage( vcl::Window* pParent, const SfxItemSet& );
+ virtual ~SfxCustomPropertiesPage();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* ) SAL_OVERRIDE;
virtual sfxpg DeactivatePage( SfxItemSet* pSet = NULL ) SAL_OVERRIDE;
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* );
+ SfxCustomPropertiesPage( vcl::Window* pParent, const SfxItemSet& );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* );
};
struct CmisValue : public VclBuilderContainer
{
- Edit* m_aValueEdit;
+ VclPtr<Edit> m_aValueEdit;
CmisValue( vcl::Window* pParent, const OUString& aStr );
};
struct CmisDateTime : public VclBuilderContainer
{
- DateField* m_aDateField;
- TimeField* m_aTimeField;
+ VclPtr<DateField> m_aDateField;
+ VclPtr<TimeField> m_aTimeField;
CmisDateTime( vcl::Window* pParent, const ::com::sun::star::util::DateTime& aDateTime );
};
struct CmisYesNo : public VclBuilderContainer
{
- RadioButton* m_aYesButton;
- RadioButton* m_aNoButton;
+ VclPtr<RadioButton> m_aYesButton;
+ VclPtr<RadioButton> m_aNoButton;
CmisYesNo( vcl::Window* pParent, bool bValue);
};
@@ -551,15 +559,15 @@ struct CmisYesNo : public VclBuilderContainer
struct CmisPropertyLine : public VclBuilderContainer
{
- VclFrame* m_pFrame;
+ VclPtr<VclFrame> m_pFrame;
OUString m_sId;
OUString m_sType;
bool m_bUpdatable;
bool m_bRequired;
bool m_bMultiValued;
bool m_bOpenChoice;
- FixedText* m_aName;
- FixedText* m_aType;
+ VclPtr<FixedText> m_aName;
+ VclPtr<FixedText> m_aType;
std::vector< CmisValue* > m_aValues;
std::vector< CmisDateTime* > m_aDateTimes;
std::vector< CmisYesNo* > m_aYesNos;
@@ -574,7 +582,7 @@ struct CmisPropertyLine : public VclBuilderContainer
class CmisPropertiesWindow
{
private:
- VclBox* m_pBox;
+ VclPtr<VclBox> m_pBox;
sal_Int32 m_nItemHeight;
SvNumberFormatter m_aNumberFormatter;
std::vector< CmisPropertyLine* > m_aCmisPropertiesLines;
@@ -636,14 +644,13 @@ private:
DECL_LINK(UpdateHdl, void *);
protected:
- SfxCmisPropertiesPage( vcl::Window* pParent, const SfxItemSet& );
-
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* ) SAL_OVERRIDE;
virtual sfxpg DeactivatePage( SfxItemSet* pSet = NULL ) SAL_OVERRIDE;
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* );
+ SfxCmisPropertiesPage( vcl::Window* pParent, const SfxItemSet& );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* );
};
#endif // #ifndef _ INCLUDED_SFX2_DINFDLG_HXX
diff --git a/include/sfx2/dockwin.hxx b/include/sfx2/dockwin.hxx
index 57f256707658..e5a5ff8a704b 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/fcontnr.hxx b/include/sfx2/fcontnr.hxx
index 7e66740176ac..1c325b92f628 100644
--- a/include/sfx2/fcontnr.hxx
+++ b/include/sfx2/fcontnr.hxx
@@ -57,14 +57,13 @@ public:
class SfxFrameWindow
{
- vcl::Window* pWindow;
+ ScopedVclPtr<vcl::Window> pWindow;
public:
SfxFrameWindow( vcl::Window *pWin )
: pWindow( pWin )
{}
- virtual ~SfxFrameWindow()
- { delete pWindow; }
+ virtual ~SfxFrameWindow() {}
vcl::Window* GetWindow() const
{ return pWindow; }
void SetWindow( vcl::Window *pWin )
diff --git a/include/sfx2/frame.hxx b/include/sfx2/frame.hxx
index fcd6c46c748b..d9c3620ee1eb 100644
--- a/include/sfx2/frame.hxx
+++ b/include/sfx2/frame.hxx
@@ -29,6 +29,7 @@
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
+#include <vcl/vclptr.hxx>
namespace com
{
@@ -103,7 +104,7 @@ private:
SfxFrame* pParentFrame;
SfxFrameArr_Impl* pChildArr;
SfxFrame_Impl* pImp;
- vcl::Window* pWindow;
+ VclPtr<vcl::Window> pWindow;
protected:
bool Close();
diff --git a/include/sfx2/infobar.hxx b/include/sfx2/infobar.hxx
index eb0c4c6dcb8c..7a89267b3bc5 100644
--- a/include/sfx2/infobar.hxx
+++ b/include/sfx2/infobar.hxx
@@ -43,16 +43,16 @@ class SFX2_DLLPUBLIC SfxInfoBarContainerChild : public SfxChildWindow
class SfxInfoBarWindow : public vcl::Window
{
private:
- OUString m_sId;
-
- std::unique_ptr<FixedText> m_pMessage;
- std::unique_ptr<Button> m_pCloseBtn;
-
- boost::ptr_vector<PushButton> m_aActionBtns;
+ OUString m_sId;
+ VclPtr<FixedText> m_pMessage;
+ VclPtr<Button> m_pCloseBtn;
+ std::vector< VclPtr<PushButton> > m_aActionBtns;
public:
- SfxInfoBarWindow(vcl::Window* parent, const OUString& sId, const OUString& sMessage);
+ 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;
@@ -71,12 +71,13 @@ class SfxInfoBarWindow : public vcl::Window
class SfxInfoBarContainerWindow : public vcl::Window
{
private:
- SfxInfoBarContainerChild* m_pChildWin;
- boost::ptr_vector<SfxInfoBarWindow> m_pInfoBars;
+ SfxInfoBarContainerChild* m_pChildWin;
+ std::vector< VclPtr<SfxInfoBarWindow> > m_pInfoBars;
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/ipclient.hxx b/include/sfx2/ipclient.hxx
index 10ab174bbdbd..9022f73573c7 100644
--- a/include/sfx2/ipclient.hxx
+++ b/include/sfx2/ipclient.hxx
@@ -29,11 +29,11 @@
#include <tools/gen.hxx>
#include <sfx2/objsh.hxx>
+#include <vcl/window.hxx>
class SfxInPlaceClient_Impl;
class SfxViewShell;
class SfxObjectShell;
-namespace vcl { class Window; }
class Fraction;
@@ -44,7 +44,7 @@ friend class SfxInPlaceClient_Impl;
SfxInPlaceClient_Impl* m_pImp;
SfxViewShell* m_pViewSh;
- vcl::Window* m_pEditWin;
+ VclPtr<vcl::Window> m_pEditWin;
// called after the requested new object area was negotiated
SAL_DLLPRIVATE virtual void ObjectAreaChanged();
diff --git a/include/sfx2/mgetempl.hxx b/include/sfx2/mgetempl.hxx
index 6b5ba434c562..f8f4b5556be6 100644
--- a/include/sfx2/mgetempl.hxx
+++ b/include/sfx2/mgetempl.hxx
@@ -36,23 +36,23 @@ class SfxStyleSheetBase;
class SfxManageStyleSheetPage : public SfxTabPage
{
- VclMultiLineEdit* m_pNameRo;
- Edit* m_pNameRw;
+ VclPtr<VclMultiLineEdit> m_pNameRo;
+ VclPtr<Edit> m_pNameRw;
- CheckBox* m_pAutoCB;
+ VclPtr<CheckBox> m_pAutoCB;
- FixedText* m_pFollowFt;
- ListBox* m_pFollowLb;
- PushButton* m_pEditStyleBtn;
+ VclPtr<FixedText> m_pFollowFt;
+ VclPtr<ListBox> m_pFollowLb;
+ VclPtr<PushButton> m_pEditStyleBtn;
- FixedText* m_pBaseFt;
- ListBox* m_pBaseLb;
- PushButton* m_pEditLinkStyleBtn;
+ VclPtr<FixedText> m_pBaseFt;
+ VclPtr<ListBox> m_pBaseLb;
+ VclPtr<PushButton> m_pEditLinkStyleBtn;
- FixedText* m_pFilterFt;
- ListBox* m_pFilterLb;
+ VclPtr<FixedText> m_pFilterFt;
+ VclPtr<ListBox> m_pFilterLb;
- FixedText *m_pDescFt;
+ VclPtr<FixedText> m_pDescFt;
SfxStyleSheetBase *pStyle;
SfxStyleFamilies *pFamilies;
@@ -79,10 +79,10 @@ friend class SfxStyleDialog;
void UpdateName_Impl(ListBox *, const OUString &rNew);
void SetDescriptionText_Impl();
- SfxManageStyleSheetPage(vcl::Window *pParent, const SfxItemSet &rAttrSet );
virtual ~SfxManageStyleSheetPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create(vcl::Window *pParent, const SfxItemSet *rAttrSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* );
protected:
virtual bool FillItemSet(SfxItemSet *) SAL_OVERRIDE;
@@ -95,6 +95,9 @@ protected:
virtual void ActivatePage(const SfxItemSet &) SAL_OVERRIDE;
using TabPage::DeactivatePage;
virtual sfxpg DeactivatePage(SfxItemSet * = 0) SAL_OVERRIDE;
+
+public:
+ SfxManageStyleSheetPage(vcl::Window *pParent, const SfxItemSet &rAttrSet );
};
#endif
diff --git a/include/sfx2/module.hxx b/include/sfx2/module.hxx
index 4c30e4f2cac4..d98b5c9c190d 100644
--- a/include/sfx2/module.hxx
+++ b/include/sfx2/module.hxx
@@ -83,7 +83,7 @@ public:
void RegisterStatusBarControl(SfxStbCtrlFactory*);
void RegisterMenuControl(SfxMenuCtrlFactory*);
- virtual SfxTabPage* CreateTabPage( sal_uInt16 nId,
+ virtual VclPtr<SfxTabPage> CreateTabPage( sal_uInt16 nId,
vcl::Window* pParent,
const SfxItemSet& rSet );
virtual void Invalidate(sal_uInt16 nId = 0) SAL_OVERRIDE;
diff --git a/include/sfx2/new.hxx b/include/sfx2/new.hxx
index 48b6dab5cc38..05482a4e1027 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 f0f47e26bb15..1a23a8d78683 100644
--- a/include/sfx2/newstyle.hxx
+++ b/include/sfx2/newstyle.hxx
@@ -33,10 +33,10 @@ class SfxStyleSheetBasePool;
class SFX2_DLLPUBLIC SfxNewStyleDlg : public ModalDialog
{
private:
- ComboBox* m_pColBox;
- OKButton* m_pOKBtn;
+ VclPtr<ComboBox> m_pColBox;
+ VclPtr<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/objsh.hxx b/include/sfx2/objsh.hxx
index 041631e3aa01..b9d20fe2d6a1 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -37,6 +37,7 @@
#include <com/sun/star/document/CmisVersion.hpp>
#include <vcl/timer.hxx>
+#include <vcl/vclptr.hxx>
#include <svl/poolitem.hxx>
#include <vcl/bitmap.hxx>
#include <sot/storage.hxx>
@@ -370,7 +371,7 @@ public:
SignatureState GetScriptingSignatureState();
void SignScriptingContent();
- virtual SfxDocumentInfoDialog* CreateDocumentInfoDialog(
+ virtual VclPtr<SfxDocumentInfoDialog> CreateDocumentInfoDialog(
vcl::Window *pParent, const SfxItemSet& );
ErrCode CallBasic( const OUString& rMacro, const OUString& rBasicName,
diff --git a/include/sfx2/passwd.hxx b/include/sfx2/passwd.hxx
index 4b241d0a243c..647776241eaa 100644
--- a/include/sfx2/passwd.hxx
+++ b/include/sfx2/passwd.hxx
@@ -50,23 +50,23 @@ namespace o3tl
class SFX2_DLLPUBLIC SfxPasswordDialog : public ModalDialog
{
private:
- VclFrame* mpPassword1Box;
- FixedText* mpUserFT;
- Edit* mpUserED;
- FixedText* mpPassword1FT;
- Edit* mpPassword1ED;
- FixedText* mpConfirm1FT;
- Edit* mpConfirm1ED;
+ VclPtr<VclFrame> mpPassword1Box;
+ VclPtr<FixedText> mpUserFT;
+ VclPtr<Edit> mpUserED;
+ VclPtr<FixedText> mpPassword1FT;
+ VclPtr<Edit> mpPassword1ED;
+ VclPtr<FixedText> mpConfirm1FT;
+ VclPtr<Edit> mpConfirm1ED;
- VclFrame* mpPassword2Box;
- FixedText* mpPassword2FT;
- Edit* mpPassword2ED;
- FixedText* mpConfirm2FT;
- Edit* mpConfirm2ED;
+ VclPtr<VclFrame> mpPassword2Box;
+ VclPtr<FixedText> mpPassword2FT;
+ VclPtr<Edit> mpPassword2ED;
+ VclPtr<FixedText> mpConfirm2FT;
+ VclPtr<Edit> mpConfirm2ED;
- FixedText* mpMinLengthFT;
+ VclPtr<FixedText> mpMinLengthFT;
- OKButton* mpOKBtn;
+ VclPtr<OKButton> mpOKBtn;
OUString maMinLenPwdStr;
OUString maMinLenPwdStr1;
@@ -83,6 +83,8 @@ private:
public:
SfxPasswordDialog(vcl::Window* pParent, const OUString* pGroupText = NULL);
+ virtual ~SfxPasswordDialog();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetUser() const
{
diff --git a/include/sfx2/printer.hxx b/include/sfx2/printer.hxx
index f07a135c8ece..d419b356507d 100644
--- a/include/sfx2/printer.hxx
+++ b/include/sfx2/printer.hxx
@@ -51,10 +51,11 @@ public:
const JobSetup &rTheOrigJobSetup );
SfxPrinter( const SfxPrinter &rPrinter );
virtual ~SfxPrinter();
+ virtual void dispose() SAL_OVERRIDE;
- SfxPrinter* Clone() const;
+ VclPtr<SfxPrinter> Clone() const;
- static SfxPrinter* Create( SvStream &rStream, SfxItemSet *pOptions );
+ static VclPtr<SfxPrinter> Create( SvStream &rStream, SfxItemSet *pOptions );
SvStream& Store( SvStream &rStream ) const;
const JobSetup& GetOrigJobSetup() const { return aOrigJobSetup; }
diff --git a/include/sfx2/printopt.hxx b/include/sfx2/printopt.hxx
index 3fcf7a0fdd4e..f969b5ff645f 100644
--- a/include/sfx2/printopt.hxx
+++ b/include/sfx2/printopt.hxx
@@ -41,32 +41,32 @@ class SFX2_DLLPUBLIC SfxCommonPrintOptionsTabPage : public SfxTabPage
{
private:
- RadioButton* m_pPrinterOutputRB;
- RadioButton* m_pPrintFileOutputRB;
+ VclPtr<RadioButton> m_pPrinterOutputRB;
+ VclPtr<RadioButton> m_pPrintFileOutputRB;
- CheckBox* m_pReduceTransparencyCB;
- RadioButton* m_pReduceTransparencyAutoRB;
- RadioButton* m_pReduceTransparencyNoneRB;
+ VclPtr<CheckBox> m_pReduceTransparencyCB;
+ VclPtr<RadioButton> m_pReduceTransparencyAutoRB;
+ VclPtr<RadioButton> m_pReduceTransparencyNoneRB;
- CheckBox* m_pReduceGradientsCB;
- RadioButton* m_pReduceGradientsStripesRB;
- RadioButton* m_pReduceGradientsColorRB;
- NumericField* m_pReduceGradientsStepCountNF;
+ VclPtr<CheckBox> m_pReduceGradientsCB;
+ VclPtr<RadioButton> m_pReduceGradientsStripesRB;
+ VclPtr<RadioButton> m_pReduceGradientsColorRB;
+ VclPtr<NumericField> m_pReduceGradientsStepCountNF;
- CheckBox* m_pReduceBitmapsCB;
- RadioButton* m_pReduceBitmapsOptimalRB;
- RadioButton* m_pReduceBitmapsNormalRB;
- RadioButton* m_pReduceBitmapsResolutionRB;
- ListBox* m_pReduceBitmapsResolutionLB;
- CheckBox* m_pReduceBitmapsTransparencyCB;
+ VclPtr<CheckBox> m_pReduceBitmapsCB;
+ VclPtr<RadioButton> m_pReduceBitmapsOptimalRB;
+ VclPtr<RadioButton> m_pReduceBitmapsNormalRB;
+ VclPtr<RadioButton> m_pReduceBitmapsResolutionRB;
+ VclPtr<ListBox> m_pReduceBitmapsResolutionLB;
+ VclPtr<CheckBox> m_pReduceBitmapsTransparencyCB;
- CheckBox* m_pConvertToGreyscalesCB;
+ VclPtr<CheckBox> m_pConvertToGreyscalesCB;
- CheckBox* m_pPDFCB;
+ VclPtr<CheckBox> m_pPDFCB;
- CheckBox* m_pPaperSizeCB;
- CheckBox* m_pPaperOrientationCB;
- CheckBox* m_pTransparencyCB;
+ VclPtr<CheckBox> m_pPaperSizeCB;
+ VclPtr<CheckBox> m_pPaperOrientationCB;
+ VclPtr<CheckBox> m_pTransparencyCB;
private:
@@ -94,14 +94,14 @@ protected:
public:
SfxCommonPrintOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
- virtual ~SfxCommonPrintOptionsTabPage();
-
+ virtual ~SfxCommonPrintOptionsTabPage();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
virtual vcl::Window* GetParentLabeledBy( const vcl::Window* pLabel ) const SAL_OVERRIDE;
virtual vcl::Window* GetParentLabelFor( const vcl::Window* pLabel ) const SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* );
};
#endif // INCLUDED_SFX2_PRINTOPT_HXX
diff --git a/include/sfx2/prnmon.hxx b/include/sfx2/prnmon.hxx
index 1468ee81fe82..ff42cb0253df 100644
--- a/include/sfx2/prnmon.hxx
+++ b/include/sfx2/prnmon.hxx
@@ -38,13 +38,14 @@ private:
SfxPrintOptDlg_Impl* pDlgImpl;
SfxViewShell* pViewSh;
SfxItemSet* pOptions;
- SfxTabPage* pPage;
+ VclPtr<SfxTabPage> pPage;
public:
SfxPrintOptionsDialog( vcl::Window *pParent,
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 68176cf8a7eb..1affc2e23b58 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 2777088ddc60..84ad9dc0e609 100644
--- a/include/sfx2/securitypage.hxx
+++ b/include/sfx2/securitypage.hxx
@@ -33,14 +33,12 @@ class SfxSecurityPage : public SfxTabPage
std::unique_ptr< SfxSecurityPage_Impl > m_pImpl;
protected:
- SfxSecurityPage( vcl::Window* pParent, const SfxItemSet& );
- virtual ~SfxSecurityPage();
-
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* ) SAL_OVERRIDE;
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* );
+ SfxSecurityPage( vcl::Window* pParent, const SfxItemSet& );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* );
};
diff --git a/include/sfx2/sidebar/ControlFactory.hxx b/include/sfx2/sidebar/ControlFactory.hxx
index a078e00c20c2..142f249c4627 100644
--- a/include/sfx2/sidebar/ControlFactory.hxx
+++ b/include/sfx2/sidebar/ControlFactory.hxx
@@ -22,6 +22,7 @@
#include <sfx2/dllapi.h>
#include <sfx2/sidebar/SidebarToolBox.hxx>
#include <vcl/button.hxx>
+#include <vcl/vclptr.hxx>
#include <com/sun/star/frame/XFrame.hpp>
class ToolBox;
@@ -39,9 +40,9 @@ class SFX2_DLLPUBLIC ControlFactory
public:
/** Create the menu button for the task bar.
*/
- static CheckBox* CreateMenuButton (vcl::Window* pParentWindow);
+ static VclPtr<CheckBox> CreateMenuButton (vcl::Window* pParentWindow);
- static ImageRadioButton* CreateTabItem (vcl::Window* pParentWindow);
+ static VclPtr<ImageRadioButton> CreateTabItem (vcl::Window* pParentWindow);
};
diff --git a/include/sfx2/sidebar/ControllerItem.hxx b/include/sfx2/sidebar/ControllerItem.hxx
index 7210dea31c3d..ef1a6db600fa 100644
--- a/include/sfx2/sidebar/ControllerItem.hxx
+++ b/include/sfx2/sidebar/ControllerItem.hxx
@@ -80,6 +80,9 @@ public:
SfxBindings &rBindings,
ItemUpdateReceiverInterface& rItemUpdateReceiver);
+ /// releases our action listener
+ virtual void dispose() SAL_OVERRIDE;
+
virtual ~ControllerItem();
/** Returns </TRUE> when the slot/command has not been disabled.
diff --git a/include/sfx2/sidebar/SidebarPanelBase.hxx b/include/sfx2/sidebar/SidebarPanelBase.hxx
index 2f34065a8480..a60f951b618f 100644
--- a/include/sfx2/sidebar/SidebarPanelBase.hxx
+++ b/include/sfx2/sidebar/SidebarPanelBase.hxx
@@ -33,6 +33,7 @@
#include <boost/noncopyable.hpp>
#include <boost/function.hpp>
+#include <vcl/vclptr.hxx>
namespace vcl { class Window; }
@@ -111,7 +112,7 @@ protected:
throw (css::uno::RuntimeException) SAL_OVERRIDE;
private:
- vcl::Window* mpControl;
+ VclPtr<vcl::Window> mpControl;
const ::rtl::OUString msResourceURL;
const css::ui::LayoutSize maLayoutSize;
};
diff --git a/include/sfx2/sidebar/SidebarToolBox.hxx b/include/sfx2/sidebar/SidebarToolBox.hxx
index a19e182f648a..129940de2ccf 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();
+ virtual void dispose() SAL_OVERRIDE;
using ToolBox::InsertItem;
virtual void InsertItem(const OUString& rCommand,
diff --git a/include/sfx2/stbitem.hxx b/include/sfx2/stbitem.hxx
index 835fcff98b46..9e4850a46e15 100644
--- a/include/sfx2/stbitem.hxx
+++ b/include/sfx2/stbitem.hxx
@@ -59,9 +59,9 @@ class UserDrawEvent;
class SFX2_DLLPUBLIC SfxStatusBarControl: public svt::StatusbarController
{
- sal_uInt16 nSlotId;
- sal_uInt16 nId;
- StatusBar* pBar;
+ sal_uInt16 nSlotId;
+ sal_uInt16 nId;
+ VclPtr<StatusBar> pBar;
protected:
// new controller API
diff --git a/include/sfx2/styledlg.hxx b/include/sfx2/styledlg.hxx
index 9e9bef903aeb..e837c87d6ae1 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 b54d974f306e..88a05b95ea30 100644
--- a/include/sfx2/tabdlg.hxx
+++ b/include/sfx2/tabdlg.hxx
@@ -37,7 +37,7 @@ class SfxViewFrame;
class SfxTabPage;
class SfxBindings;
-typedef SfxTabPage* (*CreateTabPage)(vcl::Window *pParent, const SfxItemSet *rAttrSet);
+typedef VclPtr<SfxTabPage> (*CreateTabPage)(vcl::Window *pParent, const SfxItemSet *rAttrSet);
typedef const sal_uInt16* (*GetTabPageRanges)(); // provides international Which-value
struct TabPageImpl;
@@ -64,16 +64,16 @@ friend class SfxTabDialogController;
SfxViewFrame* pFrame;
- VclBox *m_pBox;
- TabControl *m_pTabCtrl;
+ VclPtr<VclBox> m_pBox;
+ VclPtr<TabControl> m_pTabCtrl;
- PushButton* m_pOKBtn;
- PushButton* m_pApplyBtn;
- PushButton* m_pUserBtn;
- CancelButton* m_pCancelBtn;
- HelpButton* m_pHelpBtn;
- PushButton* m_pResetBtn;
- PushButton* m_pBaseFmtBtn;
+ VclPtr<PushButton> m_pOKBtn;
+ VclPtr<PushButton> m_pApplyBtn;
+ VclPtr<PushButton> m_pUserBtn;
+ VclPtr<CancelButton> m_pCancelBtn;
+ VclPtr<HelpButton> m_pHelpBtn;
+ VclPtr<PushButton> m_pResetBtn;
+ VclPtr<PushButton> m_pBaseFmtBtn;
bool m_bOwnsOKBtn;
bool m_bOwnsCancelBtn;
@@ -106,7 +106,7 @@ protected:
virtual void RefreshInputSet();
virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
- VclButtonBox* m_pActionArea;
+ VclPtr<VclButtonBox> m_pActionArea;
SfxItemSet* pExampleSet;
SfxItemSet* GetInputSetImpl();
SfxTabPage* GetTabPage( sal_uInt16 nPageId ) const;
@@ -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 dadbdf1d300f..21556961e85f 100644
--- a/include/sfx2/taskpane.hxx
+++ b/include/sfx2/taskpane.hxx
@@ -163,6 +163,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 +177,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 b76a9d06980b..402d0c1df6e6 100644
--- a/include/sfx2/tbxctrl.hxx
+++ b/include/sfx2/tbxctrl.hxx
@@ -151,8 +151,9 @@ public:
vcl::Window* pParentWindow,
WinBits nBits );
virtual ~SfxPopupWindow();
+ virtual void dispose() SAL_OVERRIDE;
- virtual SfxPopupWindow* Clone() const;
+ virtual VclPtr<SfxPopupWindow> Clone() const;
virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
void StartCascading();
@@ -200,9 +201,9 @@ protected:
virtual void DoubleClick();
virtual void Click();
virtual SfxPopupWindowType GetPopupWindowType() const;
- virtual SfxPopupWindow* CreatePopupWindow();
+ virtual VclPtr<SfxPopupWindow> CreatePopupWindow();
virtual SfxPopupWindow* CreatePopupWindowCascading();
- virtual vcl::Window* CreateItemWindow( vcl::Window *pParent );
+ virtual VclPtr<vcl::Window> CreateItemWindow( vcl::Window *pParent );
// Must be called by subclass to set a new popup window instance
void SetPopupWindow( SfxPopupWindow* pWindow );
@@ -305,7 +306,7 @@ class SfxDragToolBoxControl_Impl : public SfxToolBoxControl
public:
SFX_DECL_TOOLBOX_CONTROL();
SfxDragToolBoxControl_Impl( sal_uInt16 nId, ToolBox& rBox );
- virtual vcl::Window* CreateItemWindow( vcl::Window *pParent ) SAL_OVERRIDE;
+ virtual VclPtr<vcl::Window> CreateItemWindow( vcl::Window *pParent ) SAL_OVERRIDE;
virtual void Select(sal_uInt16 nSelectModifier) SAL_OVERRIDE;
};
@@ -329,7 +330,7 @@ public:
virtual ~SfxRecentFilesToolBoxControl();
protected:
- virtual SfxPopupWindow* CreatePopupWindow() SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> CreatePopupWindow() SAL_OVERRIDE;
};
class SfxReloadToolBoxControl_Impl : public SfxToolBoxControl
diff --git a/include/sfx2/templateabstractview.hxx b/include/sfx2/templateabstractview.hxx
index 5509374c25b2..41979ca0dfc6 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 005201b364d7..205083554d52 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 17ba13a0b432..f26792bb0a04 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();
@@ -142,16 +143,16 @@ private:
private:
- TabControl *mpTabControl;
+ VclPtr<TabControl> mpTabControl;
- Edit *mpSearchEdit;
- ToolBox *mpViewBar;
- ToolBox *mpActionBar;
- ToolBox *mpTemplateBar;
- TemplateSearchView *mpSearchView;
- TemplateAbstractView *mpCurView;
- TemplateLocalView *mpLocalView;
- TemplateRemoteView *mpRemoteView;
+ VclPtr<Edit> mpSearchEdit;
+ VclPtr<ToolBox> mpViewBar;
+ VclPtr<ToolBox> mpActionBar;
+ VclPtr<ToolBox> mpTemplateBar;
+ VclPtr<TemplateSearchView> mpSearchView;
+ VclPtr<TemplateAbstractView> mpCurView;
+ VclPtr<TemplateLocalView> mpLocalView;
+ VclPtr<TemplateRemoteView> mpRemoteView;
PopupMenu *mpActionMenu;
PopupMenu *mpRepositoryMenu;
PopupMenu *mpTemplateDefaultMenu;
diff --git a/include/sfx2/templateinfodlg.hxx b/include/sfx2/templateinfodlg.hxx
index 9f5d9dfd2965..97a711c58028 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);
@@ -37,11 +38,11 @@ protected:
private:
- PushButton* mpBtnClose;
- VclBox* mpBox;
+ VclPtr<PushButton> mpBtnClose;
+ VclPtr<VclBox> mpBox;
- vcl::Window *mpPreviewView; // gets released when xWindows get destroyed (dont delete in constructor)
- svtools::ODocumentInfoPreview *mpInfoView;
+ VclPtr<vcl::Window> mpPreviewView; // gets released when xWindows get destroyed (dont delete in constructor)
+ VclPtr<svtools::ODocumentInfoPreview> mpInfoView;
::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame2 > m_xFrame;
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > xWindow;
diff --git a/include/sfx2/templatelocalview.hxx b/include/sfx2/templatelocalview.hxx
index 6d2e1d044dcf..123a6f6f13b5 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 6c64e9a6dcaf..ada041dcb85e 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 280610ff3e14..4e9ada86b359 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;
@@ -50,7 +51,7 @@ public:
void FreeResource();
private:
- const std::unique_ptr<SfxTemplateDialog_Impl> pImpl;
+ std::unique_ptr<SfxTemplateDialog_Impl> pImpl;
SfxBindings* mpBindings;
};
diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx
index 2c9967b601da..0e4a7e0af1cf 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;
@@ -308,7 +309,7 @@ protected:
ThumbnailValueItemList mItemList;
ThumbnailValueItemList mFilteredItemList; ///< Cache to store the filtered items
ThumbnailValueItemList::iterator mpStartSelRange;
- ScrollBar* mpScrBar;
+ VclPtr<ScrollBar> mpScrBar;
long mnHeaderHeight;
long mnItemWidth;
long mnItemHeight;
diff --git a/include/sfx2/thumbnailviewitem.hxx b/include/sfx2/thumbnailviewitem.hxx
index 9136a5688476..a4c7bbcdb920 100644
--- a/include/sfx2/thumbnailviewitem.hxx
+++ b/include/sfx2/thumbnailviewitem.hxx
@@ -138,7 +138,7 @@ protected:
Rectangle maDrawArea;
Link maClickHdl;
bool mbEditTitle;
- VclMultiLineEdit* mpTitleED;
+ VclPtr<VclMultiLineEdit> mpTitleED;
Rectangle maTextEditMaxArea;
};
diff --git a/include/sfx2/titledockwin.hxx b/include/sfx2/titledockwin.hxx
index 61db702d236c..44d8a68c511a 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/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index c0f38d1fe436..39effbb31caf 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -37,6 +37,8 @@
#include <tools/errcode.hxx>
#include <vcl/jobset.hxx>
#include <o3tl/typed_flags_set.hxx>
+#include <vcl/vclptr.hxx>
+#include <sfx2/tabdlg.hxx>
class SfxBaseController;
class Size;
@@ -51,7 +53,6 @@ class SfxMedium;
class SfxModule;
class SfxViewFrame;
class SfxItemPool;
-class SfxTabPage;
class SfxFrameSetDescriptor;
class Printer;
class SfxPrinter;
@@ -145,7 +146,7 @@ friend class SfxPrinterController;
struct SfxViewShell_Impl* pImp;
SfxViewFrame* pFrame;
SfxShell* pSubShell;
- vcl::Window* pWindow;
+ VclPtr<vcl::Window> pWindow;
bool bNoNewWindow;
protected:
@@ -233,7 +234,7 @@ public:
virtual SfxPrinter* GetPrinter( bool bCreate = false );
virtual sal_uInt16 SetPrinter( SfxPrinter *pNewPrinter, SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false );
virtual bool HasPrintOptionsPage() const;
- virtual SfxTabPage* CreatePrintOptionsPage( vcl::Window *pParent, const SfxItemSet &rOptions );
+ virtual VclPtr<SfxTabPage> CreatePrintOptionsPage( vcl::Window *pParent, const SfxItemSet &rOptions );
static JobSetup GetJobSetup();
Printer* GetActivePrinter() const;
@@ -294,7 +295,7 @@ public:
SAL_DLLPRIVATE void ResetAllClients_Impl( SfxInPlaceClient *pIP );
SAL_DLLPRIVATE void DiscardClients_Impl();
- SAL_DLLPRIVATE SfxPrinter* SetPrinter_Impl( SfxPrinter *pNewPrinter );
+ SAL_DLLPRIVATE SfxPrinter* SetPrinter_Impl( VclPtr<SfxPrinter>& pNewPrinter );
SAL_DLLPRIVATE bool IsShowView_Impl() const;
SAL_DLLPRIVATE bool HandleNotifyEvent_Impl( NotifyEvent& rEvent );
diff --git a/include/svtools/DocumentInfoPreview.hxx b/include/svtools/DocumentInfoPreview.hxx
index e75877588029..9eba310af05c 100644
--- a/include/svtools/DocumentInfoPreview.hxx
+++ b/include/svtools/DocumentInfoPreview.hxx
@@ -43,6 +43,7 @@ public:
ODocumentInfoPreview(vcl::Window * pParent, WinBits nBits);
virtual ~ODocumentInfoPreview();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
@@ -54,8 +55,8 @@ public:
OUString const & rURL);
private:
- ExtMultiLineEdit m_pEditWin;
- std::unique_ptr< SvtDocInfoTable_Impl > m_xInfoTable;
+ VclPtr<ExtMultiLineEdit> m_pEditWin;
+ boost::scoped_ptr< SvtDocInfoTable_Impl > m_xInfoTable;
LanguageTag m_aLanguageTag;
void insertEntry(OUString const & title, OUString const & value);
diff --git a/include/svtools/GraphicExportOptionsDialog.hxx b/include/svtools/GraphicExportOptionsDialog.hxx
index 1982aa1bc679..884e08b3e2a2 100644
--- a/include/svtools/GraphicExportOptionsDialog.hxx
+++ b/include/svtools/GraphicExportOptionsDialog.hxx
@@ -37,9 +37,9 @@
class SVT_DLLPUBLIC GraphicExportOptionsDialog : public ModalDialog
{
private:
- NumericField* mpWidth;
- NumericField* mpHeight;
- ComboBox* mpResolution;
+ VclPtr<NumericField> mpWidth;
+ VclPtr<NumericField> mpHeight;
+ VclPtr<ComboBox> mpResolution;
Size mSize100mm;
double mResolution;
@@ -63,7 +63,7 @@ private:
public:
GraphicExportOptionsDialog( vcl::Window* pWindow, const css::uno::Reference<css::lang::XComponent>& rxSourceDocument );
virtual ~GraphicExportOptionsDialog();
-
+ virtual void dispose() SAL_OVERRIDE;
css::uno::Sequence<css::beans::PropertyValue> getFilterData();
};
diff --git a/include/svtools/PlaceEditDialog.hxx b/include/svtools/PlaceEditDialog.hxx
index 5cdad02f1807..a3e4c2caa77b 100644
--- a/include/svtools/PlaceEditDialog.hxx
+++ b/include/svtools/PlaceEditDialog.hxx
@@ -27,16 +27,15 @@
class SVT_DLLPUBLIC PlaceEditDialog : public ModalDialog
{
private :
-
- Edit* m_pEDServerName;
- ListBox* m_pLBServerType;
+ VclPtr<Edit> m_pEDServerName;
+ VclPtr<ListBox> m_pLBServerType;
std::shared_ptr< DetailsContainer > m_xCurrentDetails;
- Edit* m_pEDUsername;
- OKButton* m_pBTOk;
- CancelButton* m_pBTCancel;
+ VclPtr<Edit> m_pEDUsername;
+ VclPtr<OKButton> m_pBTOk;
+ VclPtr<CancelButton> m_pBTCancel;
- PushButton* m_pBTDelete;
+ VclPtr<PushButton> m_pBTDelete;
/** Vector holding the details UI control for each server type.
@@ -51,11 +50,12 @@ public :
PlaceEditDialog( vcl::Window* pParent);
PlaceEditDialog(vcl::Window* pParent, const std::shared_ptr<Place> &rPlace );
virtual ~PlaceEditDialog();
+ virtual void dispose() SAL_OVERRIDE;
// Returns a place instance with given information
std::shared_ptr<Place> GetPlace();
- OUString GetServerName() { return m_pEDServerName->GetText(); }
+ OUString GetServerName() { return m_pEDServerName->GetText(); }
OUString GetServerUrl();
private:
diff --git a/include/svtools/ServerDetailsControls.hxx b/include/svtools/ServerDetailsControls.hxx
index a4997b3113c7..9c17ecea0191 100644
--- a/include/svtools/ServerDetailsControls.hxx
+++ b/include/svtools/ServerDetailsControls.hxx
@@ -25,7 +25,7 @@ class DetailsContainer
{
private:
Link m_aChangeHdl;
- VclFrame* m_pFrame;
+ VclPtr<VclFrame> m_pFrame;
public:
DetailsContainer( VclBuilderContainer* pBuilder, const OString& rFrame );
@@ -57,9 +57,9 @@ class HostDetailsContainer : public DetailsContainer
OUString m_sScheme;
protected:
- Edit* m_pEDHost;
- NumericField* m_pEDPort;
- Edit* m_pEDPath;
+ VclPtr<Edit> m_pEDHost;
+ VclPtr<NumericField> m_pEDPort;
+ VclPtr<Edit> m_pEDPath;
public:
HostDetailsContainer( VclBuilderContainer* pBuilder, sal_uInt16 nPort, const OUString& sScheme );
@@ -81,7 +81,7 @@ class HostDetailsContainer : public DetailsContainer
class DavDetailsContainer : public HostDetailsContainer
{
private:
- CheckBox* m_pCBDavs;
+ VclPtr<CheckBox> m_pCBDavs;
public:
DavDetailsContainer( VclBuilderContainer* pBuilder );
@@ -99,9 +99,9 @@ class DavDetailsContainer : public HostDetailsContainer
class SmbDetailsContainer : public DetailsContainer
{
private:
- Edit* m_pEDHost;
- Edit* m_pEDShare;
- Edit* m_pEDPath;
+ VclPtr<Edit> m_pEDHost;
+ VclPtr<Edit> m_pEDShare;
+ VclPtr<Edit> m_pEDPath;
public:
SmbDetailsContainer( VclBuilderContainer* pBuilder );
@@ -120,11 +120,11 @@ class CmisDetailsContainer : public DetailsContainer
std::vector< OUString > m_aRepoIds;
OUString m_sRepoId;
- Edit* m_pEDBinding;
- ListBox* m_pLBRepository;
- Button* m_pBTRepoRefresh;
- ListBox* m_pLBServerType;
- Edit* m_pEDPath;
+ VclPtr<Edit> m_pEDBinding;
+ VclPtr<ListBox> m_pLBRepository;
+ VclPtr<Button> m_pBTRepoRefresh;
+ VclPtr<ListBox> m_pLBServerType;
+ VclPtr<Edit> m_pEDPath;
public:
CmisDetailsContainer( VclBuilderContainer* pBuilder );
diff --git a/include/svtools/accessibleruler.hxx b/include/svtools/accessibleruler.hxx
index 0c286ee73cd2..b8811613da1b 100644
--- a/include/svtools/accessibleruler.hxx
+++ b/include/svtools/accessibleruler.hxx
@@ -38,6 +38,7 @@
#include <comphelper/broadcasthelper.hxx>
#include <cppuhelper/implbase5.hxx>
#include <comphelper/servicehelper.hxx>
+#include <vcl/vclptr.hxx>
namespace com { namespace sun { namespace star { namespace awt {
struct Point;
@@ -198,7 +199,7 @@ private:
mxParent;
/// pointer to internal representation
- Ruler* mpRepr;
+ VclPtr<Ruler> mpRepr;
/// client id in the AccessibleEventNotifier queue
sal_uInt32 mnClientId;
diff --git a/include/svtools/addresstemplate.hxx b/include/svtools/addresstemplate.hxx
index d771efb5e473..28bc7edfcc1d 100644
--- a/include/svtools/addresstemplate.hxx
+++ b/include/svtools/addresstemplate.hxx
@@ -48,10 +48,10 @@ namespace svt
{
private:
// Controls
- ComboBox* m_pDatasource;
- PushButton* m_pAdministrateDatasources;
- ComboBox* m_pTable;
- ScrollBar* m_pFieldScroller;
+ VclPtr<ComboBox> m_pDatasource;
+ VclPtr<PushButton> m_pAdministrateDatasources;
+ VclPtr<ComboBox> m_pTable;
+ VclPtr<ScrollBar> m_pFieldScroller;
// string to display for "no selection"
const OUString m_sNoFieldSelection;
@@ -100,6 +100,7 @@ namespace svt
);
virtual ~AddressBookSourceDialog();
+ virtual void dispose() SAL_OVERRIDE;
// to be used if the object was constructed for editing a field mapping only
void getFieldMapping(
diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx
index 8ad76b82caab..fb8fc3a63aa1 100644
--- a/include/svtools/brwbox.hxx
+++ b/include/svtools/brwbox.hxx
@@ -22,6 +22,7 @@
#include <svtools/svtdllapi.h>
#include <vcl/scrbar.hxx>
#include <vcl/ctrl.hxx>
+#include <vcl/vclptr.hxx>
#include <tools/multisel.hxx>
#include <svtools/headbar.hxx>
#include <svtools/transfer.hxx>
@@ -129,9 +130,9 @@ namespace o3tl
class BrowseEvent
{
- vcl::Window* pWin;
- long nRow;
- Rectangle aRect;
+ VclPtr<vcl::Window> pWin;
+ long nRow;
+ Rectangle aRect;
sal_uInt16 nCol;
sal_uInt16 nColId;
@@ -142,10 +143,10 @@ public:
sal_uInt16 nColumn, sal_uInt16 nColumnId,
const Rectangle& rRect );
- vcl::Window* GetWindow() const { return pWin; }
+ vcl::Window* GetWindow() const { return pWin; }
long GetRow() const { return nRow; }
- sal_uInt16 GetColumn() const { return nCol; }
- sal_uInt16 GetColumnId() const { return nColId; }
+ sal_uInt16 GetColumn() const { return nCol; }
+ sal_uInt16 GetColumnId() const { return nColId; }
const Rectangle& GetRect() const { return aRect; }
};
@@ -218,9 +219,9 @@ public:
static const sal_uInt16 HandleColumnId = 0;
private:
- vcl::Window* pDataWin; // window to display data rows
- ScrollBar* pVScroll; // vertical scrollbar
- ScrollBar aHScroll; // horizontal scrollbar
+ VclPtr<vcl::Window> pDataWin; // window to display data rows
+ VclPtr<ScrollBar> pVScroll; // vertical scrollbar
+ VclPtr<ScrollBar> aHScroll; // horizontal scrollbar
long nDataRowHeight; // height of a single data-row
sal_uInt16 nTitleLines; // number of lines in title row
@@ -391,7 +392,7 @@ protected:
void DoHideCursor( const char *pWhoLog );
short GetCursorHideCount() const;
- virtual BrowserHeader* CreateHeaderBar( BrowseBox* pParent );
+ virtual VclPtr<BrowserHeader> CreateHeaderBar( BrowseBox* pParent );
// HACK(virtual create is not called in Ctor)
void SetHeaderBar( BrowserHeader* );
@@ -423,7 +424,8 @@ public:
BrowserMode nMode = BrowserMode::NONE );
BrowseBox( vcl::Window* pParent, const ResId& rId,
BrowserMode nMode = BrowserMode::NONE );
- virtual ~BrowseBox();
+ virtual ~BrowseBox();
+ virtual void dispose() SAL_OVERRIDE;
// override inherited handler
virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
diff --git a/include/svtools/brwhead.hxx b/include/svtools/brwhead.hxx
index e60949100731..c82ccace0601 100644
--- a/include/svtools/brwhead.hxx
+++ b/include/svtools/brwhead.hxx
@@ -29,8 +29,11 @@ class BrowseBox;
class SVT_DLLPUBLIC BrowserHeader: public HeaderBar
{
- BrowseBox* _pBrowseBox;
+ VclPtr<BrowseBox> _pBrowseBox;
+public:
+ virtual ~BrowserHeader();
+ virtual void dispose() SAL_OVERRIDE;
protected:
virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE;
virtual void Select() SAL_OVERRIDE;
diff --git a/include/svtools/calendar.hxx b/include/svtools/calendar.hxx
index e970842480a7..48173a37003c 100644
--- a/include/svtools/calendar.hxx
+++ b/include/svtools/calendar.hxx
@@ -258,7 +258,8 @@ protected:
public:
Calendar( vcl::Window* pParent, WinBits nWinStyle = 0 );
- virtual ~Calendar();
+ virtual ~Calendar();
+ virtual void dispose() SAL_OVERRIDE;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
@@ -400,11 +401,11 @@ method in CalendarField and create an own calendar there ourselves.
class SVT_DLLPUBLIC CalendarField : public DateField
{
private:
- ImplCFieldFloatWin* mpFloatWin;
- Calendar* mpCalendar;
+ VclPtr<ImplCFieldFloatWin> mpFloatWin;
+ VclPtr<Calendar> mpCalendar;
WinBits mnCalendarStyle;
- PushButton* mpTodayBtn;
- PushButton* mpNoneBtn;
+ VclPtr<PushButton> mpTodayBtn;
+ VclPtr<PushButton> mpNoneBtn;
Date maDefaultDate;
bool mbToday;
bool mbNone;
@@ -416,12 +417,13 @@ private:
public:
CalendarField( vcl::Window* pParent, WinBits nWinStyle );
- virtual ~CalendarField();
+ virtual ~CalendarField();
+ virtual void dispose() SAL_OVERRIDE;
void Select();
virtual bool ShowDropDown( bool bShow ) SAL_OVERRIDE;
- Calendar* CreateCalendar( vcl::Window* pParent );
+ VclPtr<Calendar> CreateCalendar( vcl::Window* pParent );
Calendar* GetCalendar();
void SetDefaultDate( const Date& rDate ) { maDefaultDate = rDate; }
diff --git a/include/svtools/colrdlg.hxx b/include/svtools/colrdlg.hxx
index 1919ba0666c4..4fe31bfa1d8a 100644
--- a/include/svtools/colrdlg.hxx
+++ b/include/svtools/colrdlg.hxx
@@ -21,7 +21,7 @@
#define INCLUDED_SVTOOLS_COLRDLG_HXX
#include <svtools/svtdllapi.h>
-
+#include <vcl/vclptr.hxx>
#include <tools/color.hxx>
namespace vcl { class Window; }
@@ -50,9 +50,9 @@ public:
short Execute();
private:
- vcl::Window* mpParent;
- Color maColor;
- sal_Int16 meMode;
+ VclPtr<vcl::Window> mpParent;
+ Color maColor;
+ sal_Int16 meMode;
};
#endif // INCLUDED_SVTOOLS_COLRDLG_HXX
diff --git a/include/svtools/ctrlbox.hxx b/include/svtools/ctrlbox.hxx
index fe29ee120083..a38f00940fb2 100644
--- a/include/svtools/ctrlbox.hxx
+++ b/include/svtools/ctrlbox.hxx
@@ -155,6 +155,7 @@ public:
WinBits nWinStyle = WB_BORDER );
ColorListBox( vcl::Window* pParent, const ResId& rResId );
virtual ~ColorListBox();
+ virtual void dispose() SAL_OVERRIDE;
virtual void UserDraw( const UserDrawEvent& rUDEvt ) SAL_OVERRIDE;
@@ -287,7 +288,7 @@ class SVT_DLLPUBLIC LineListBox : public ListBox
long m_nWidth;
OUString m_sNone;
- VirtualDevice aVirDev;
+ ScopedVclPtr<VirtualDevice> aVirDev;
Size aTxtSize;
Color aColor;
Color maPaintCol;
@@ -311,6 +312,7 @@ public:
LineListBox( vcl::Window* pParent, WinBits nWinStyle = WB_BORDER );
virtual ~LineListBox();
+ virtual void dispose() SAL_OVERRIDE;
/** Set the width in Twips */
void SetWidth( long nWidth );
@@ -408,6 +410,7 @@ public:
FontNameBox( vcl::Window* pParent,
WinBits nWinStyle = WB_SORT );
virtual ~FontNameBox();
+ virtual void dispose() SAL_OVERRIDE;
virtual void UserDraw( const UserDrawEvent& rUDEvt ) SAL_OVERRIDE;
@@ -433,7 +436,6 @@ private:
using ComboBox::SetText;
public:
FontStyleBox( vcl::Window* pParent, WinBits nBits );
- virtual ~FontStyleBox();
virtual void Select() SAL_OVERRIDE;
virtual void LoseFocus() SAL_OVERRIDE;
@@ -477,7 +479,6 @@ protected:
public:
FontSizeBox( vcl::Window* pParent, WinBits nWinStyle = 0 );
- virtual ~FontSizeBox();
void Reformat() SAL_OVERRIDE;
void Modify() SAL_OVERRIDE;
diff --git a/include/svtools/ctrltool.hxx b/include/svtools/ctrltool.hxx
index 5ff6a2df5510..c6be1c49acf7 100644
--- a/include/svtools/ctrltool.hxx
+++ b/include/svtools/ctrltool.hxx
@@ -147,8 +147,8 @@ private:
OUString maBlack;
OUString maBlackItalic;
sal_IntPtr* mpSizeAry;
- OutputDevice* mpDev;
- OutputDevice* mpDev2;
+ VclPtr<OutputDevice> mpDev;
+ VclPtr<OutputDevice> mpDev2;
boost::ptr_vector<ImplFontListNameInfo> maEntries;
SVT_DLLPRIVATE ImplFontListNameInfo* ImplFind( const OUString& rSearchName, sal_uLong* pIndex ) const;
diff --git a/include/svtools/editbrowsebox.hxx b/include/svtools/editbrowsebox.hxx
index 43320ef78185..dbc921b58d80 100644
--- a/include/svtools/editbrowsebox.hxx
+++ b/include/svtools/editbrowsebox.hxx
@@ -85,7 +85,7 @@ namespace svt
friend class EditBrowseBox;
protected:
- Control* pWindow;
+ VclPtr<Control> pWindow;
bool bSuspended; // <true> if the window is hidden and disabled
public:
@@ -279,13 +279,14 @@ namespace svt
class SVT_DLLPUBLIC CheckBoxControl : public Control
{
- CheckBox* pBox;
+ VclPtr<CheckBox> pBox;
Rectangle aFocusRect;
Link m_aClickLink,m_aModifyLink;
public:
CheckBoxControl(vcl::Window* pParent, WinBits nWinStyle = 0);
virtual ~CheckBoxControl();
+ virtual void dispose() SAL_OVERRIDE;
virtual void GetFocus() SAL_OVERRIDE;
virtual bool PreNotify(NotifyEvent& rEvt) SAL_OVERRIDE;
@@ -479,7 +480,7 @@ namespace svt
aOldController;
ImplSVEvent * nStartEvent, * nEndEvent, * nCellModifiedEvent; // event ids
- vcl::Window* m_pFocusWhileRequest;
+ VclPtr<vcl::Window> m_pFocusWhileRequest;
// In ActivateCell, we grab the focus asynchronously, but if between requesting activation
// and the asynchornous event the focus has changed, we won't grab it for ourself.
@@ -491,14 +492,14 @@ namespace svt
mutable bool bPaintStatus : 1; // paint a status (image) in the handle column
bool bActiveBeforeTracking;
- CheckBoxControl* pCheckBoxPaint;
+ VclPtr<CheckBoxControl> pCheckBoxPaint;
EditBrowseBoxFlags m_nBrowserFlags;
ImageList m_aStatusImages;
::std::unique_ptr< EditBrowseBoxImpl> m_aImpl;
protected:
- BrowserHeader* pHeader;
+ VclPtr<BrowserHeader> pHeader;
bool isGetCellFocusPending() const { return nStartEvent != 0; }
void cancelGetCellFocus() { if (nStartEvent) Application::RemoveUserEvent(nStartEvent); nStartEvent = 0; }
@@ -509,10 +510,10 @@ namespace svt
protected:
BrowserHeader* GetHeaderBar() const {return pHeader;}
- virtual BrowserHeader* CreateHeaderBar(BrowseBox* pParent) SAL_OVERRIDE;
+ virtual VclPtr<BrowserHeader> CreateHeaderBar(BrowseBox* pParent) SAL_OVERRIDE;
// if you want to have an own header ...
- virtual BrowserHeader* imp_CreateHeaderBar(BrowseBox* pParent);
+ virtual VclPtr<BrowserHeader> imp_CreateHeaderBar(BrowseBox* pParent);
virtual void ColumnMoved(sal_uInt16 nId) SAL_OVERRIDE;
virtual void ColumnResized(sal_uInt16 nColId) SAL_OVERRIDE;
@@ -598,6 +599,7 @@ namespace svt
EditBrowseBox(vcl::Window* pParent, EditBrowseBoxFlags nBrowserFlags = EditBrowseBoxFlags::NONE, WinBits nBits = WB_TABSTOP, BrowserMode nMode = BrowserMode::NONE );
EditBrowseBox(vcl::Window* pParent, const ResId& rId, EditBrowseBoxFlags nBrowserFlags = EditBrowseBoxFlags::NONE, BrowserMode nMode = BrowserMode::NONE );
virtual ~EditBrowseBox();
+ virtual void dispose() SAL_OVERRIDE;
bool IsEditing() const {return aController.Is();}
void InvalidateStatusCell(long nRow) {RowModified(nRow, 0);}
diff --git a/include/svtools/editsyntaxhighlighter.hxx b/include/svtools/editsyntaxhighlighter.hxx
index 5099750026b2..be6da6e118e2 100644
--- a/include/svtools/editsyntaxhighlighter.hxx
+++ b/include/svtools/editsyntaxhighlighter.hxx
@@ -40,7 +40,6 @@ class SVT_DLLPUBLIC MultiLineEditSyntaxHighlight : public MultiLineEdit
public:
MultiLineEditSyntaxHighlight( vcl::Window* pParent, WinBits nWinStyle = WB_LEFT | WB_BORDER , HighlighterLanguage aLanguage = HIGHLIGHT_SQL);
- virtual ~MultiLineEditSyntaxHighlight();
virtual void UpdateData() SAL_OVERRIDE;
virtual void SetText(const OUString& rNewText) SAL_OVERRIDE;
diff --git a/include/svtools/filectrl.hxx b/include/svtools/filectrl.hxx
index 53486c0e4d35..20506dbd7b51 100644
--- a/include/svtools/filectrl.hxx
+++ b/include/svtools/filectrl.hxx
@@ -54,8 +54,8 @@ namespace o3tl
class SVT_DLLPUBLIC FileControl : public vcl::Window
{
private:
- Edit maEdit;
- PushButton maButton;
+ VclPtr<Edit> maEdit;
+ VclPtr<PushButton> maButton;
OUString maButtonText;
bool mbOpenDlg;
@@ -77,10 +77,11 @@ protected:
public:
FileControl( vcl::Window* pParent, WinBits nStyle, FileControlMode = FileControlMode::NONE );
- virtual ~FileControl();
+ virtual ~FileControl();
+ virtual void dispose() SAL_OVERRIDE;
- Edit& GetEdit() { return maEdit; }
- PushButton& GetButton() { return maButton; }
+ Edit& GetEdit() { return *maEdit.get(); }
+ PushButton& GetButton() { return *maButton.get(); }
void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags ) SAL_OVERRIDE;
@@ -89,13 +90,13 @@ public:
void SetText( const OUString& rStr ) SAL_OVERRIDE;
OUString GetText() const SAL_OVERRIDE;
- OUString GetSelectedText() const { return maEdit.GetSelected(); }
+ OUString GetSelectedText() const { return maEdit->GetSelected(); }
- void SetSelection( const Selection& rSelection ) { maEdit.SetSelection( rSelection ); }
- Selection GetSelection() const { return maEdit.GetSelection(); }
+ void SetSelection( const Selection& rSelection ) { maEdit->SetSelection( rSelection ); }
+ Selection GetSelection() const { return maEdit->GetSelection(); }
- void SetReadOnly( bool bReadOnly = true ) { maEdit.SetReadOnly( bReadOnly ); }
- bool IsReadOnly() const { return maEdit.IsReadOnly(); }
+ void SetReadOnly( bool bReadOnly = true ) { maEdit->SetReadOnly( bReadOnly ); }
+ bool IsReadOnly() const { return maEdit->IsReadOnly(); }
//use this to manipulate the dialog bevore executing it:
diff --git a/include/svtools/fileview.hxx b/include/svtools/fileview.hxx
index 27384412655a..690efd1aa076 100644
--- a/include/svtools/fileview.hxx
+++ b/include/svtools/fileview.hxx
@@ -76,6 +76,7 @@ protected:
public:
SvtFileView( vcl::Window* pParent, WinBits nBits, bool bOnlyFolder, bool bMultiSelection );
virtual ~SvtFileView();
+ virtual void dispose() SAL_OVERRIDE;
virtual Size GetOptimalSize() const SAL_OVERRIDE;
@@ -205,10 +206,12 @@ enum QueryDeleteResult_Impl
class SVT_DLLPUBLIC QueryDeleteDlg_Impl : public MessageDialog
{
private:
- PushButton* m_pAllButton;
+ VclPtr<PushButton> m_pAllButton;
public:
QueryDeleteDlg_Impl(vcl::Window* pParent, const OUString& rName);
+ virtual ~QueryDeleteDlg_Impl();
+ virtual void dispose() SAL_OVERRIDE;
void EnableAllButton() { m_pAllButton->Enable(true); }
};
diff --git a/include/svtools/fmtfield.hxx b/include/svtools/fmtfield.hxx
index 9e8eaf7fe4cb..562cf5ca14f5 100644
--- a/include/svtools/fmtfield.hxx
+++ b/include/svtools/fmtfield.hxx
@@ -95,7 +95,6 @@ protected:
public:
FormattedField(vcl::Window* pParent, WinBits nStyle = 0, SvNumberFormatter* pInitialFormatter = NULL, sal_Int32 nFormatKey = 0);
- virtual ~FormattedField();
// Min-/Max-management
bool HasMinValue() const { return m_bHasMin; }
@@ -270,6 +269,7 @@ public:
}
virtual ~DoubleNumericField();
+ virtual void dispose() SAL_OVERRIDE;
protected:
virtual bool CheckText(const OUString& sText) const SAL_OVERRIDE;
diff --git a/include/svtools/generictoolboxcontroller.hxx b/include/svtools/generictoolboxcontroller.hxx
index 15b542cc3458..d5bf7d7fc51d 100644
--- a/include/svtools/generictoolboxcontroller.hxx
+++ b/include/svtools/generictoolboxcontroller.hxx
@@ -50,8 +50,8 @@ class SVT_DLLPUBLIC GenericToolboxController : public svt::ToolboxController
DECL_STATIC_LINK( GenericToolboxController, ExecuteHdl_Impl, ExecuteInfo* );
private:
- ToolBox* m_pToolbox;
- sal_uInt16 m_nID;
+ VclPtr<ToolBox> m_pToolbox;
+ sal_uInt16 m_nID;
};
}
diff --git a/include/svtools/genericunodialog.hxx b/include/svtools/genericunodialog.hxx
index f0445ff96405..072516f3d5ce 100644
--- a/include/svtools/genericunodialog.hxx
+++ b/include/svtools/genericunodialog.hxx
@@ -38,6 +38,7 @@
#include <comphelper/propertycontainer.hxx>
#include <comphelper/broadcasthelper.hxx>
#include <tools/link.hxx>
+#include <vcl/vclptr.hxx>
class Dialog;
namespace vcl { class Window; }
@@ -73,7 +74,7 @@ namespace svt
::osl::Mutex m_aExecutionMutex; /// access safety for execute/cancel
protected:
- Dialog* m_pDialog; /// the dialog to execute
+ VclPtr<Dialog> m_pDialog; /// the dialog to execute
bool m_bExecuting : 1; /// we're currently executing the dialog
bool m_bCanceled : 1; /// endDialog was called while we were executing
bool m_bTitleAmbiguous : 1; /// m_sTitle has not been set yet
@@ -124,7 +125,7 @@ namespace svt
but the application-wide solar mutex is (to guard the not thread-safe ctor of the dialog).
@param pParent the parent window for the new dialog
*/
- virtual Dialog* createDialog(vcl::Window* _pParent) = 0;
+ virtual VclPtr<Dialog> createDialog(vcl::Window* _pParent) = 0;
/// called to destroy the dialog used. the default implementation just deletes m_pDialog and resets it to NULL
virtual void destroyDialog();
diff --git a/include/svtools/headbar.hxx b/include/svtools/headbar.hxx
index acdb018a59ae..27fd4e8f7865 100644
--- a/include/svtools/headbar.hxx
+++ b/include/svtools/headbar.hxx
@@ -288,6 +288,7 @@ private:
public:
HeaderBar( vcl::Window* pParent, WinBits nWinBits = WB_STDHEADERBAR );
virtual ~HeaderBar();
+ virtual void dispose() SAL_OVERRIDE;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
diff --git a/include/svtools/hyperlabel.hxx b/include/svtools/hyperlabel.hxx
index eacfe4896372..cdda74067bab 100644
--- a/include/svtools/hyperlabel.hxx
+++ b/include/svtools/hyperlabel.hxx
@@ -32,7 +32,7 @@ namespace svt
{
- class HyperLabelImpl;
+ class HyperLabelImpl;
class HyperLabel : public FixedText
{
@@ -54,6 +54,7 @@ namespace svt
public:
HyperLabel( vcl::Window* _pParent, WinBits _nWinStyle = 0 );
virtual ~HyperLabel( );
+ virtual void dispose() SAL_OVERRIDE;
virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
diff --git a/include/svtools/inettbc.hxx b/include/svtools/inettbc.hxx
index 7d2d4f5ccbee..35a0893ec09f 100644
--- a/include/svtools/inettbc.hxx
+++ b/include/svtools/inettbc.hxx
@@ -63,6 +63,7 @@ public:
SvtURLBox( vcl::Window* pParent, WinBits _nStyle, INetProtocol eSmart = INetProtocol::NotValid, bool bSetDefaultHelpID = true );
SvtURLBox( vcl::Window* pParent, const ResId& _rResId, INetProtocol eSmart = INetProtocol::NotValid, bool bSetDefaultHelpID = true );
virtual ~SvtURLBox();
+ virtual void dispose() SAL_OVERRIDE;
void SetBaseURL( const OUString& rURL );
const OUString& GetBaseURL() const { return aBaseURL; }
diff --git a/include/svtools/ivctrl.hxx b/include/svtools/ivctrl.hxx
index c48803c88ee9..d862e7d0b31c 100644
--- a/include/svtools/ivctrl.hxx
+++ b/include/svtools/ivctrl.hxx
@@ -268,6 +268,7 @@ public:
SvtIconChoiceCtrl( vcl::Window* pParent, WinBits nWinStyle = WB_ICON | WB_BORDER );
virtual ~SvtIconChoiceCtrl();
+ virtual void dispose() SAL_OVERRIDE;
void SetStyle( WinBits nWinStyle );
WinBits GetStyle() const;
diff --git a/include/svtools/popupwindowcontroller.hxx b/include/svtools/popupwindowcontroller.hxx
index d505e2f04dc2..a455670b8c95 100644
--- a/include/svtools/popupwindowcontroller.hxx
+++ b/include/svtools/popupwindowcontroller.hxx
@@ -25,6 +25,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <svtools/toolboxcontroller.hxx>
+#include <vcl/vclptr.hxx>
namespace vcl { class Window; }
@@ -40,7 +41,7 @@ public:
const OUString& aCommandURL );
virtual ~PopupWindowController();
- virtual vcl::Window* createPopupWindow( vcl::Window* pParent ) = 0;
+ virtual VclPtr<vcl::Window> createPopupWindow( vcl::Window* pParent ) = 0;
// XInterface
virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
diff --git a/include/svtools/prnsetup.hxx b/include/svtools/prnsetup.hxx
index b7ed0fd8f3dc..62d430a053c3 100644
--- a/include/svtools/prnsetup.hxx
+++ b/include/svtools/prnsetup.hxx
@@ -40,16 +40,16 @@ class QueueInfo;
class SVT_DLLPUBLIC PrinterSetupDialog : public ModalDialog
{
private:
- ListBox* m_pLbName;
- PushButton* m_pBtnProperties;
- PushButton* m_pBtnOptions;
- FixedText* m_pFiStatus;
- FixedText* m_pFiType;
- FixedText* m_pFiLocation;
- FixedText* m_pFiComment;
- AutoTimer maStatusTimer;
- Printer* mpPrinter;
- Printer* mpTempPrinter;
+ VclPtr<ListBox> m_pLbName;
+ VclPtr<PushButton> m_pBtnProperties;
+ VclPtr<PushButton> m_pBtnOptions;
+ VclPtr<FixedText> m_pFiStatus;
+ VclPtr<FixedText> m_pFiType;
+ VclPtr<FixedText> m_pFiLocation;
+ VclPtr<FixedText> m_pFiComment;
+ AutoTimer maStatusTimer;
+ VclPtr<Printer> mpPrinter;
+ VclPtr<Printer> mpTempPrinter;
SVT_DLLPRIVATE void ImplSetInfo();
@@ -60,7 +60,8 @@ private:
public:
PrinterSetupDialog( vcl::Window* pWindow );
- virtual ~PrinterSetupDialog();
+ virtual ~PrinterSetupDialog();
+ virtual void dispose() SAL_OVERRIDE;
void SetPrinter( Printer* pNewPrinter ) { mpPrinter = pNewPrinter; }
Printer* GetPrinter() const { return mpPrinter; }
diff --git a/include/svtools/roadmapwizard.hxx b/include/svtools/roadmapwizard.hxx
index 578ba284adb8..237d0f17d78b 100644
--- a/include/svtools/roadmapwizard.hxx
+++ b/include/svtools/roadmapwizard.hxx
@@ -36,7 +36,7 @@ namespace svt
public:
typedef sal_Int16 PathId;
typedef ::std::vector< WizardTypes::WizardState > WizardPath;
- typedef TabPage* (* RoadmapPageFactory)( RoadmapWizard& );
+ typedef VclPtr<TabPage> (* RoadmapPageFactory)( RoadmapWizard& );
};
@@ -77,6 +77,7 @@ namespace svt
sal_uInt32 _nButtonFlags = WZB_NEXT | WZB_PREVIOUS | WZB_FINISH | WZB_CANCEL | WZB_HELP
);
virtual ~RoadmapWizard( );
+ virtual void dispose() SAL_OVERRIDE;
void SetRoadmapHelpId( const OString& _rId );
@@ -89,7 +90,7 @@ namespace svt
virtual bool canAdvance() const SAL_OVERRIDE;
virtual void updateTravelUI() SAL_OVERRIDE;
-protected:
+ protected:
/** declares a valid path in the wizard
The very first path which is declared is automatically activated.
@@ -207,7 +208,7 @@ protected:
This member is inherited from OWizardMachine, and default-implemented in this class
for all states which have been described using describeState.
*/
- virtual TabPage* createPage( WizardState _nState ) SAL_OVERRIDE;
+ virtual VclPtr<TabPage> createPage( WizardState _nState ) SAL_OVERRIDE;
/** asks for a new label of the wizard page
diff --git a/include/svtools/ruler.hxx b/include/svtools/ruler.hxx
index 76a7bc57889d..0f9f68359533 100644
--- a/include/svtools/ruler.hxx
+++ b/include/svtools/ruler.hxx
@@ -606,7 +606,7 @@ class ImplRulerData;
class SVT_DLLPUBLIC Ruler : public vcl::Window
{
private:
- VirtualDevice maVirDev;
+ ScopedVclPtr<VirtualDevice> maVirDev;
MapMode maMapMode;
long mnBorderOff;
long mnWinOff;
@@ -708,6 +708,7 @@ protected:
public:
Ruler( vcl::Window* pParent, WinBits nWinStyle = WB_STDRULER );
virtual ~Ruler();
+ virtual void dispose() SAL_OVERRIDE;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
diff --git a/include/svtools/scrwin.hxx b/include/svtools/scrwin.hxx
index 4e034e69f82d..2396725af54c 100644
--- a/include/svtools/scrwin.hxx
+++ b/include/svtools/scrwin.hxx
@@ -23,6 +23,7 @@
#include <svtools/svtdllapi.h>
#include <vcl/scrbar.hxx>
#include <o3tl/typed_flags_set.hxx>
+#include <vcl/vclptr.hxx>
class DataChangedEvent;
@@ -54,9 +55,9 @@ private:
long nLinePixH; // size of a line/column (pixel)
long nColumnPixW;
- ScrollBar aVScroll; // the scrollbars
- ScrollBar aHScroll;
- ScrollBarBox aCornerWin; // window in the bottom right corner
+ VclPtr<ScrollBar> aVScroll; // the scrollbars
+ VclPtr<ScrollBar> aHScroll;
+ VclPtr<ScrollBarBox> aCornerWin; // window in the bottom right corner
bool bScrolling:1, // user controlled scrolling
bHandleDragging:1, // scroll window while dragging
bHCenter:1,
@@ -69,6 +70,8 @@ private:
public:
ScrollableWindow( vcl::Window* pParent, WinBits nBits = 0,
ScrollableWindowFlags = ScrollableWindowFlags::DEFAULT );
+ virtual ~ScrollableWindow();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE;
diff --git a/include/svtools/simptabl.hxx b/include/svtools/simptabl.hxx
index e3fc9f9cb929..07eb53d48e59 100644
--- a/include/svtools/simptabl.hxx
+++ b/include/svtools/simptabl.hxx
@@ -29,13 +29,15 @@ class SvSimpleTable;
class SVT_DLLPUBLIC SvSimpleTableContainer : public Control
{
private:
- SvSimpleTable* m_pTable;
+ VclPtr<SvSimpleTable> m_pTable;
protected:
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
public:
SvSimpleTableContainer( vcl::Window* pParent, WinBits nBits = WB_BORDER );
+ virtual ~SvSimpleTableContainer();
+ virtual void dispose() SAL_OVERRIDE;
void SetTable(SvSimpleTable* pTable);
@@ -53,7 +55,7 @@ private:
Link aHeaderBarDblClickLink;
Link aCommandLink;
CommandEvent aCEvt;
- HeaderBar aHeaderBar;
+ VclPtr<HeaderBar> aHeaderBar;
long nOldPos;
sal_uInt16 nHeaderItemId;
bool bPaintFlag;
@@ -89,6 +91,7 @@ public:
SvSimpleTable(SvSimpleTableContainer& rParent, WinBits nBits = WB_BORDER);
virtual ~SvSimpleTable();
+ virtual void dispose() SAL_OVERRIDE;
void UpdateViewSize();
@@ -126,9 +129,9 @@ public:
void SetHeaderBarDblClickHdl( const Link& rLink ) { aHeaderBarDblClickLink = rLink; }
const Link& GetHeaderBarDblClickHdl() const { return aHeaderBarDblClickLink; }
- void SetHeaderBarHelpId(const OString& rHelpId) {aHeaderBar.SetHelpId(rHelpId);}
+ void SetHeaderBarHelpId(const OString& rHelpId) { aHeaderBar->SetHelpId(rHelpId); }
- HeaderBar& GetTheHeaderBar() {return aHeaderBar;}
+ HeaderBar& GetTheHeaderBar() { return *aHeaderBar.get(); }
};
diff --git a/include/svtools/svmedit.hxx b/include/svtools/svmedit.hxx
index 33c2b90fe6f2..0c322f267e04 100644
--- a/include/svtools/svmedit.hxx
+++ b/include/svtools/svmedit.hxx
@@ -27,7 +27,6 @@
#include <svtools/colorcfg.hxx>
-
class SVT_DLLPUBLIC MultiLineEdit : public VclMultiLineEdit
{
public:
diff --git a/include/svtools/svmedit2.hxx b/include/svtools/svmedit2.hxx
index 2e17023629c9..d6c30d26872b 100644
--- a/include/svtools/svmedit2.hxx
+++ b/include/svtools/svmedit2.hxx
@@ -28,7 +28,6 @@ class SVT_DLLPUBLIC ExtMultiLineEdit : public MultiLineEdit
{
public:
ExtMultiLineEdit( vcl::Window* pParent, WinBits nWinStyle = WB_LEFT | WB_BORDER );
- virtual ~ExtMultiLineEdit();
// methods of TextView
void InsertText( const OUString& rNew, bool bSelect = false );
@@ -37,7 +36,7 @@ public:
// methods of TextEngine
void SetAttrib( const TextAttrib& rAttr, sal_uLong nPara, sal_uInt16 nStart, sal_uInt16 nEnd );
void SetLeftMargin( sal_uInt16 nLeftMargin );
- sal_uLong GetParagraphCount() const;
+ sal_uLong GetParagraphCount() const;
};
#endif
diff --git a/include/svtools/svtabbx.hxx b/include/svtools/svtabbx.hxx
index dcded33f9c90..5d1d9e1320b9 100644
--- a/include/svtools/svtabbx.hxx
+++ b/include/svtools/svtabbx.hxx
@@ -65,8 +65,9 @@ protected:
public:
SvTabListBox( vcl::Window* pParent, WinBits = WB_BORDER );
virtual ~SvTabListBox();
+ virtual void dispose() SAL_OVERRIDE;
void SetTabs(const long* pTabs, MapUnit = MAP_APPFONT);
- sal_uInt16 TabCount() const { return (sal_uInt16)nTabCount; }
+ sal_uInt16 TabCount() const { return (sal_uInt16)nTabCount; }
using SvTreeListBox::GetTab;
long GetTab( sal_uInt16 nTab ) const;
void SetTab( sal_uInt16 nTab, long nValue, MapUnit = MAP_APPFONT );
@@ -139,6 +140,7 @@ private:
public:
SvHeaderTabListBox( vcl::Window* pParent, WinBits nBits );
virtual ~SvHeaderTabListBox();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Paint( const Rectangle& ) SAL_OVERRIDE;
diff --git a/include/svtools/tabbar.hxx b/include/svtools/tabbar.hxx
index 7e5dc03e90ad..fc44b0f75d3b 100644
--- a/include/svtools/tabbar.hxx
+++ b/include/svtools/tabbar.hxx
@@ -315,6 +315,8 @@ class SVT_DLLPUBLIC TabBar : public vcl::Window
private:
std::unique_ptr<TabBar_Impl> mpImpl;
+ ImplTabBarList* mpItemList;
+
OUString maEditText;
Color maSelColor;
Color maSelTextColor;
@@ -384,6 +386,7 @@ public:
TabBar( vcl::Window* pParent, WinBits nWinStyle = WB_STDTABBAR );
virtual ~TabBar();
+ virtual void dispose() SAL_OVERRIDE;
virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
diff --git a/include/svtools/toolbarmenu.hxx b/include/svtools/toolbarmenu.hxx
index 2b20a31c5f2f..7c679ac5bdb3 100644
--- a/include/svtools/toolbarmenu.hxx
+++ b/include/svtools/toolbarmenu.hxx
@@ -51,6 +51,7 @@ public:
WinBits nBits );
virtual ~ToolbarMenu();
+ virtual void dispose() SAL_OVERRIDE;
virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
@@ -68,7 +69,7 @@ public:
void appendSeparator();
/** creates an empty ValueSet that is initialized and can be inserted with appendEntry. */
- ValueSet* createEmptyValueSetControl();
+ VclPtr<ValueSet> createEmptyValueSetControl();
void checkEntry( int nEntryId, bool bCheck = true );
diff --git a/include/svtools/toolpanel/drawerlayouter.hxx b/include/svtools/toolpanel/drawerlayouter.hxx
index cba7f020e735..e35d0dd211c9 100644
--- a/include/svtools/toolpanel/drawerlayouter.hxx
+++ b/include/svtools/toolpanel/drawerlayouter.hxx
@@ -29,12 +29,8 @@
namespace svt
{
-
-
class ToolPanelViewShell;
class ToolPanelDrawer;
- typedef std::shared_ptr< ToolPanelDrawer > PToolPanelDrawer;
-
//= ToolPanelDrawer
@@ -79,7 +75,7 @@ namespace svt
private:
vcl::Window& m_rParentWindow;
IToolPanelDeck& m_rPanelDeck;
- ::std::vector< PToolPanelDrawer > m_aDrawers;
+ ::std::vector< VclPtr<ToolPanelDrawer> > m_aDrawers;
::boost::optional< size_t > m_aLastKnownActivePanel;
};
diff --git a/include/svtools/toolpanel/paneltabbar.hxx b/include/svtools/toolpanel/paneltabbar.hxx
index 18e4d1ea1197..3e20b2dede70 100644
--- a/include/svtools/toolpanel/paneltabbar.hxx
+++ b/include/svtools/toolpanel/paneltabbar.hxx
@@ -52,6 +52,7 @@ namespace svt
public:
PanelTabBar( vcl::Window& i_rParentWindow, IToolPanelDeck& i_rPanelDeck, const TabAlignment i_eAlignment, const TabItemContent i_eItemContent );
virtual ~PanelTabBar();
+ virtual void dispose() SAL_OVERRIDE;
// attribute access
TabItemContent GetTabItemContent() const;
diff --git a/include/svtools/toolpanel/toolpaneldeck.hxx b/include/svtools/toolpanel/toolpaneldeck.hxx
index d9c06ced6771..211c099deb93 100644
--- a/include/svtools/toolpanel/toolpaneldeck.hxx
+++ b/include/svtools/toolpanel/toolpaneldeck.hxx
@@ -138,6 +138,7 @@ namespace svt
public:
ToolPanelDeck( vcl::Window& i_rParent, const WinBits i_nStyle = WB_DIALOGCONTROL );
virtual ~ToolPanelDeck();
+ virtual void dispose() SAL_OVERRIDE;
// attributes
PDeckLayouter GetLayouter() const;
diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx
index 3f74b4c7fa37..7d55c17ad403 100644
--- a/include/svtools/treelistbox.hxx
+++ b/include/svtools/treelistbox.hxx
@@ -373,6 +373,7 @@ public:
SvTreeListBox( vcl::Window* pParent, WinBits nWinStyle=0 );
SvTreeListBox( vcl::Window* pParent, const ResId& rResId );
virtual ~SvTreeListBox();
+ virtual void dispose() SAL_OVERRIDE;
SvTreeList* GetModel() const
{
@@ -385,11 +386,11 @@ public:
sal_uLong GetEntryCount() const
{
- return pModel->GetEntryCount();
+ return pModel ? pModel->GetEntryCount() : 0;
}
SvTreeListEntry* First() const
{
- return pModel->First();
+ return pModel ? pModel->First() : NULL;
}
SvTreeListEntry* Next( SvTreeListEntry* pEntry, sal_uInt16* pDepth = 0 ) const
{
@@ -401,7 +402,7 @@ public:
}
SvTreeListEntry* Last() const
{
- return pModel->Last();
+ return pModel ? pModel->Last() : NULL;
}
SvTreeListEntry* FirstChild( SvTreeListEntry* pParent ) const;
@@ -820,7 +821,7 @@ public:
struct SvLBoxDDInfo
{
Application* pApp;
- SvTreeListBox* pSource;
+ VclPtr<SvTreeListBox> pSource;
SvTreeListEntry* pDDStartEntry;
// Relative position in the Entry at DragBeginn (IconView)
long nMouseRelX,nMouseRelY;
@@ -833,7 +834,7 @@ class SvInplaceEdit2
Accelerator aAccReturn;
Accelerator aAccEscape;
Idle aIdle;
- Edit* pEdit;
+ VclPtr<Edit> pEdit;
bool bCanceled;
bool bAlreadyInCallBack;
diff --git a/include/svtools/valueset.hxx b/include/svtools/valueset.hxx
index baebae42db8c..a6a8e5e47ffc 100644
--- a/include/svtools/valueset.hxx
+++ b/include/svtools/valueset.hxx
@@ -197,11 +197,11 @@ class SVT_DLLPUBLIC ValueSet : public Control
{
private:
- VirtualDevice maVirDev;
+ ScopedVclPtr<VirtualDevice> maVirDev;
Timer maTimer;
ValueItemList mItemList;
ValueSetItemPtr mpNoneItem;
- std::unique_ptr<ScrollBar> mxScrollBar;
+ VclPtr<ScrollBar> mxScrollBar;
Rectangle maNoneItemRect;
Rectangle maItemListRect;
long mnItemWidth;
@@ -284,7 +284,8 @@ protected:
public:
ValueSet( vcl::Window* pParent, WinBits nWinStyle, bool bDisableTransientChildren = false );
ValueSet( vcl::Window* pParent, const ResId& rResId, bool bDisableTransientChildren = false );
- virtual ~ValueSet();
+ virtual ~ValueSet();
+ virtual void dispose() SAL_OVERRIDE;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
diff --git a/include/svtools/wizardmachine.hxx b/include/svtools/wizardmachine.hxx
index b5cd150dee07..6865c4e2e74a 100644
--- a/include/svtools/wizardmachine.hxx
+++ b/include/svtools/wizardmachine.hxx
@@ -100,6 +100,7 @@ namespace svt
*/
OWizardPage(vcl::Window *pParent, const OString& rID, const OUString& rUIXMLDescription);
virtual ~OWizardPage();
+ virtual void dispose() SAL_OVERRIDE;
// IWizardPageController overridables
virtual void initializePage() SAL_OVERRIDE;
@@ -154,15 +155,14 @@ namespace svt
// So use the travelXXX methods if you need to travel
protected:
- OKButton* m_pFinish;
- CancelButton* m_pCancel;
- PushButton* m_pNextPage;
- PushButton* m_pPrevPage;
- HelpButton* m_pHelp;
+ VclPtr<OKButton> m_pFinish;
+ VclPtr<CancelButton> m_pCancel;
+ VclPtr<PushButton> m_pNextPage;
+ VclPtr<PushButton> m_pPrevPage;
+ VclPtr<HelpButton> m_pHelp;
private:
- WizardMachineImplData*
- m_pImpl;
+ WizardMachineImplData* m_pImpl;
// hold members in this structure to allow keeping compatible when members are added
SVT_DLLPRIVATE void addButtons(vcl::Window* _pParent, sal_uInt32 _nButtonFlags);
@@ -175,6 +175,7 @@ namespace svt
OWizardMachine(vcl::Window* _pParent, const WinBits i_nStyle, sal_uInt32 _nButtonFlags );
OWizardMachine(vcl::Window* _pParent, sal_uInt32 _nButtonFlags );
virtual ~OWizardMachine();
+ virtual void dispose() SAL_OVERRIDE;
/// enable (or disable) buttons
void enableButtons(sal_uInt32 _nWizardButtonFlags, bool _bEnable);
@@ -205,7 +206,7 @@ namespace svt
// our own overridables
/// to override to create new pages
- virtual TabPage* createPage(WizardState _nState) = 0;
+ virtual VclPtr<TabPage> createPage(WizardState _nState) = 0;
/// will be called when a new page is about to be displayed
virtual void enterState(WizardState _nState);
diff --git a/include/svtools/wizdlg.hxx b/include/svtools/wizdlg.hxx
index a8c7e4e332f7..00f9d95b9db7 100644
--- a/include/svtools/wizdlg.hxx
+++ b/include/svtools/wizdlg.hxx
@@ -202,10 +202,10 @@ private:
Size maPageSize;
ImplWizPageData* mpFirstPage;
ImplWizButtonData* mpFirstBtn;
- TabPage* mpCurTabPage;
- PushButton* mpPrevBtn;
- PushButton* mpNextBtn;
- vcl::Window* mpViewWindow;
+ VclPtr<TabPage> mpCurTabPage;
+ VclPtr<PushButton> mpPrevBtn;
+ VclPtr<PushButton> mpNextBtn;
+ VclPtr<vcl::Window> mpViewWindow;
sal_uInt16 mnCurLevel;
WindowAlign meViewAlign;
Link maActivateHdl;
@@ -242,6 +242,7 @@ public:
WizardDialog( vcl::Window* pParent, WinBits nStyle = WB_STDTABDIALOG );
WizardDialog( vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription );
virtual ~WizardDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
@@ -272,7 +273,7 @@ public:
PushButton* GetNextButton() const { return mpNextBtn; }
void SetViewWindow( vcl::Window* pWindow ) { mpViewWindow = pWindow; }
- vcl::Window* GetViewWindow() const { return mpViewWindow; }
+ vcl::Window* GetViewWindow() const { return mpViewWindow; }
void SetViewAlign( WindowAlign eAlign ) { meViewAlign = eAlign; }
WindowAlign GetViewAlign() const { return meViewAlign; }
diff --git a/include/svx/AccessibleShapeTreeInfo.hxx b/include/svx/AccessibleShapeTreeInfo.hxx
index 65aae3bd00eb..aca3221ffc52 100644
--- a/include/svx/AccessibleShapeTreeInfo.hxx
+++ b/include/svx/AccessibleShapeTreeInfo.hxx
@@ -26,6 +26,7 @@
#include <com/sun/star/frame/XController.hpp>
#include <svx/IAccessibleViewForwarder.hxx>
#include <svx/svxdllapi.h>
+#include <vcl/vclptr.hxx>
class SdrView;
namespace vcl { class Window; }
@@ -176,7 +177,7 @@ private:
/** This window is necessary to construct an SvxTextEditSource which in
turn is used to create an accessible edit engine.
*/
- vcl::Window* mpWindow;
+ VclPtr<vcl::Window> mpWindow;
/** The view forwarder allows the transformation between internal
and pixel coordinates and can be asked for the visible area.
diff --git a/include/svx/ParaLineSpacingPopup.hxx b/include/svx/ParaLineSpacingPopup.hxx
index ba8cebc6e103..1460c744f384 100644
--- a/include/svx/ParaLineSpacingPopup.hxx
+++ b/include/svx/ParaLineSpacingPopup.hxx
@@ -39,7 +39,7 @@ public:
virtual ~ParaLineSpacingPopup();
virtual SfxPopupWindowType GetPopupWindowType() const SAL_OVERRIDE;
- virtual SfxPopupWindow* CreatePopupWindow() SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> CreatePopupWindow() SAL_OVERRIDE;
};
} // namespace svx
diff --git a/include/svx/bmpmask.hxx b/include/svx/bmpmask.hxx
index 7be37ee40177..81bdd06253cd 100644
--- a/include/svx/bmpmask.hxx
+++ b/include/svx/bmpmask.hxx
@@ -81,33 +81,33 @@ class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxBmpMask : public SfxDockingWindow
friend class MaskData;
friend class MaskSet;
- ToolBox* m_pTbxPipette;
- ColorWindow* m_pCtlPipette;
- PushButton* m_pBtnExec;
-
- CheckBox* m_pCbx1;
- MaskSet* m_pQSet1;
- MetricField* m_pSp1;
- ColorLB* m_pLbColor1;
-
- CheckBox* m_pCbx2;
- MaskSet* m_pQSet2;
- MetricField* m_pSp2;
- ColorLB* m_pLbColor2;
-
- CheckBox* m_pCbx3;
- MaskSet* m_pQSet3;
- MetricField* m_pSp3;
- ColorLB* m_pLbColor3;
-
- CheckBox* m_pCbx4;
- MaskSet* m_pQSet4;
- MetricField* m_pSp4;
- ColorLB* m_pLbColor4;
+ VclPtr<ToolBox> m_pTbxPipette;
+ VclPtr<ColorWindow> m_pCtlPipette;
+ VclPtr<PushButton> m_pBtnExec;
+
+ VclPtr<CheckBox> m_pCbx1;
+ VclPtr<MaskSet> m_pQSet1;
+ VclPtr<MetricField> m_pSp1;
+ VclPtr<ColorLB> m_pLbColor1;
+
+ VclPtr<CheckBox> m_pCbx2;
+ VclPtr<MaskSet> m_pQSet2;
+ VclPtr<MetricField> m_pSp2;
+ VclPtr<ColorLB> m_pLbColor2;
+
+ VclPtr<CheckBox> m_pCbx3;
+ VclPtr<MaskSet> m_pQSet3;
+ VclPtr<MetricField> m_pSp3;
+ VclPtr<ColorLB> m_pLbColor3;
+
+ VclPtr<CheckBox> m_pCbx4;
+ VclPtr<MaskSet> m_pQSet4;
+ VclPtr<MetricField> m_pSp4;
+ VclPtr<ColorLB> m_pLbColor4;
MaskData* pData;
- CheckBox* m_pCbxTrans;
- ColorLB* m_pLbColorTrans;
+ VclPtr<CheckBox> m_pCbxTrans;
+ VclPtr<ColorLB> m_pLbColorTrans;
XColorListRef pColLst;
Color aPipetteColor;
@@ -135,6 +135,7 @@ public:
SvxBmpMask(SfxBindings *pBindinx, SfxChildWindow *pCW, vcl::Window* pParent);
virtual ~SvxBmpMask();
+ virtual void dispose() SAL_OVERRIDE;
void SetColor( const Color& rColor );
void PipetteClicked();
diff --git a/include/svx/charmap.hxx b/include/svx/charmap.hxx
index fd9a1d00c15d..cf05bf2764a3 100644
--- a/include/svx/charmap.hxx
+++ b/include/svx/charmap.hxx
@@ -22,6 +22,8 @@
#include <vcl/ctrl.hxx>
#include <vcl/metric.hxx>
#include <vcl/scrbar.hxx>
+#include <vcl/vclptr.hxx>
+#include <boost/shared_ptr.hpp>
#include <map>
#include <memory>
#include <svx/svxdllapi.h>
@@ -44,6 +46,7 @@ class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxShowCharSet : public Control
public:
SvxShowCharSet( vcl::Window* pParent );
virtual ~SvxShowCharSet();
+ virtual void dispose() SAL_OVERRIDE;
void SetFont( const vcl::Font& rFont );
@@ -71,7 +74,7 @@ public:
static sal_uInt16 GetRowPos(sal_uInt16 _nPos);
static sal_uInt16 GetColumnPos(sal_uInt16 _nPos);
- ScrollBar& getScrollBar() { return aVscrollSB;}
+ ScrollBar& getScrollBar() { return *aVscrollSB.get();}
void ReleaseAccessible();
sal_Int32 getMaxCharCount() const;
@@ -112,7 +115,7 @@ private:
sal_Int32 nSelectedIndex;
FontCharMapPtr mpFontCharMap;
- ScrollBar aVscrollSB;
+ VclPtr<ScrollBar> aVscrollSB;
private:
void DrawChars_Impl( int n1, int n2);
diff --git a/include/svx/checklbx.hxx b/include/svx/checklbx.hxx
index dd15c8a66c07..63db8545c3bd 100644
--- a/include/svx/checklbx.hxx
+++ b/include/svx/checklbx.hxx
@@ -46,6 +46,7 @@ public:
SvxCheckListBox( vcl::Window* pParent, WinBits nWinStyle = 0 );
void SetNormalStaticImage(const Image& rNormalStaticImage);
virtual ~SvxCheckListBox();
+ virtual void dispose() SAL_OVERRIDE;
void InsertEntry ( const OUString& rStr,
sal_uLong nPos = TREELIST_APPEND,
diff --git a/include/svx/clipboardctl.hxx b/include/svx/clipboardctl.hxx
index 07c5bbb0dc70..64ed0d94e832 100644
--- a/include/svx/clipboardctl.hxx
+++ b/include/svx/clipboardctl.hxx
@@ -45,7 +45,7 @@ public:
virtual ~SvxClipBoardControl();
virtual SfxPopupWindowType GetPopupWindowType() const SAL_OVERRIDE;
- virtual SfxPopupWindow* CreatePopupWindow() SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> CreatePopupWindow() SAL_OVERRIDE;
virtual void StateChanged( sal_uInt16 nSID,
SfxItemState eState,
const SfxPoolItem* pState ) SAL_OVERRIDE;
diff --git a/include/svx/colrctrl.hxx b/include/svx/colrctrl.hxx
index 0987da9dea53..04e67f1f0a9f 100644
--- a/include/svx/colrctrl.hxx
+++ b/include/svx/colrctrl.hxx
@@ -26,6 +26,7 @@
#include <svl/lstner.hxx>
#include <svx/svxdllapi.h>
#include <svx/xtable.hxx>
+#include <vcl/vclptr.hxx>
class SvData;
@@ -75,7 +76,7 @@ friend class SvxColorChildWindow;
private:
XColorListRef pColorList;
- SvxColorValueSet_docking aColorSet;
+ VclPtr<SvxColorValueSet_docking> aColorSet;
sal_uInt16 nLeftSlot;
sal_uInt16 nRightSlot;
sal_uInt16 nCols;
@@ -103,6 +104,7 @@ public:
SfxChildWindow *pCW,
vcl::Window* pParent);
virtual ~SvxColorDockingWindow();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
diff --git a/include/svx/compressgraphicdialog.hxx b/include/svx/compressgraphicdialog.hxx
index 17aa10ad09a2..ba5e51aa52c1 100644
--- a/include/svx/compressgraphicdialog.hxx
+++ b/include/svx/compressgraphicdialog.hxx
@@ -33,22 +33,22 @@ class SdrGrafObj;
class SVX_DLLPUBLIC SAL_WARN_UNUSED CompressGraphicsDialog : public ModalDialog
{
private:
- FixedText* m_pLabelGraphicType;
- FixedText* m_pFixedText2;
- FixedText* m_pFixedText3;
- FixedText* m_pFixedText5;
- FixedText* m_pFixedText6;
-
- CheckBox* m_pReduceResolutionCB;
- NumericField* m_pMFNewWidth;
- NumericField* m_pMFNewHeight;
- ComboBox* m_pResolutionLB;
- RadioButton* m_pLosslessRB;
- RadioButton* m_pJpegCompRB;
- NumericField* m_pCompressionMF;
- NumericField* m_pQualityMF;
- PushButton* m_pBtnCalculate;
- ListBox* m_pInterpolationCombo;
+ VclPtr<FixedText> m_pLabelGraphicType;
+ VclPtr<FixedText> m_pFixedText2;
+ VclPtr<FixedText> m_pFixedText3;
+ VclPtr<FixedText> m_pFixedText5;
+ VclPtr<FixedText> m_pFixedText6;
+
+ VclPtr<CheckBox> m_pReduceResolutionCB;
+ VclPtr<NumericField> m_pMFNewWidth;
+ VclPtr<NumericField> m_pMFNewHeight;
+ VclPtr<ComboBox> m_pResolutionLB;
+ VclPtr<RadioButton> m_pLosslessRB;
+ VclPtr<RadioButton> m_pJpegCompRB;
+ VclPtr<NumericField> m_pCompressionMF;
+ VclPtr<NumericField> m_pQualityMF;
+ VclPtr<PushButton> m_pBtnCalculate;
+ VclPtr<ListBox> m_pInterpolationCombo;
SdrGrafObj* m_pGraphicObj;
Graphic m_aGraphic;
@@ -83,8 +83,8 @@ private:
public:
CompressGraphicsDialog( vcl::Window* pParent, SdrGrafObj* pGraphicObj, SfxBindings& rBindings );
CompressGraphicsDialog( vcl::Window* pParent, Graphic& rGraphic, Size rViewSize100mm, Rectangle& rCropRectangle, SfxBindings& rBindings );
-
virtual ~CompressGraphicsDialog();
+ virtual void dispose() SAL_OVERRIDE;
SdrGrafObj* GetCompressedSdrGrafObj();
Graphic GetCompressedGraphic();
diff --git a/include/svx/connctrl.hxx b/include/svx/connctrl.hxx
index 7febedffef35..1c037d88584c 100644
--- a/include/svx/connctrl.hxx
+++ b/include/svx/connctrl.hxx
@@ -46,6 +46,7 @@ private:
public:
SvxXConnectionPreview( vcl::Window* pParent, WinBits nStyle);
virtual ~SvxXConnectionPreview();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
diff --git a/include/svx/contdlg.hxx b/include/svx/contdlg.hxx
index 57080eb7da0f..de25491cb15c 100644
--- a/include/svx/contdlg.hxx
+++ b/include/svx/contdlg.hxx
@@ -47,18 +47,19 @@ class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxContourDlg : public SfxFloatingWindow
{
using Window::Update;
- SvxSuperContourDlg* pSuperClass;
+ VclPtr<SvxSuperContourDlg> pSuperClass;
protected:
- void SetSuperClass( SvxSuperContourDlg& rSuperClass ) { pSuperClass = &rSuperClass; }
+ void SetSuperClass( SvxSuperContourDlg& rSuperClass );
public:
SvxContourDlg(SfxBindings *pBindings, SfxChildWindow *pCW,
vcl::Window* pParent);
- virtual ~SvxContourDlg();
+ virtual ~SvxContourDlg();
+ virtual void dispose() SAL_OVERRIDE;
const Graphic& GetGraphic() const;
bool IsGraphicChanged() const;
diff --git a/include/svx/ctredlin.hxx b/include/svx/ctredlin.hxx
index 160ef1000237..83c590d57ac0 100644
--- a/include/svx/ctredlin.hxx
+++ b/include/svx/ctredlin.hxx
@@ -116,6 +116,7 @@ public:
SvxRedlinTable(SvSimpleTableContainer& rParent, WinBits nBits = WB_BORDER);
virtual ~SvxRedlinTable();
+ virtual void dispose() SAL_OVERRIDE;
// For FilterPage only {
void SetFilterDate(bool bFlag=true);
@@ -179,25 +180,25 @@ private:
Link aRefLink;
Link aModifyComLink;
- SvxRedlinTable* pRedlinTable;
- CheckBox* m_pCbDate;
- ListBox* m_pLbDate;
- DateField* m_pDfDate;
- TimeField* m_pTfDate;
- PushButton* m_pIbClock;
- FixedText* m_pFtDate2;
- DateField* m_pDfDate2;
- TimeField* m_pTfDate2;
- PushButton* m_pIbClock2;
- CheckBox* m_pCbAuthor;
- ListBox* m_pLbAuthor;
- CheckBox* m_pCbRange;
- Edit* m_pEdRange;
- PushButton* m_pBtnRange;
- CheckBox* m_pCbAction;
- ListBox* m_pLbAction;
- CheckBox* m_pCbComment;
- Edit* m_pEdComment;
+ VclPtr<SvxRedlinTable> pRedlinTable;
+ VclPtr<CheckBox> m_pCbDate;
+ VclPtr<ListBox> m_pLbDate;
+ VclPtr<DateField> m_pDfDate;
+ VclPtr<TimeField> m_pTfDate;
+ VclPtr<PushButton> m_pIbClock;
+ VclPtr<FixedText> m_pFtDate2;
+ VclPtr<DateField> m_pDfDate2;
+ VclPtr<TimeField> m_pTfDate2;
+ VclPtr<PushButton> m_pIbClock2;
+ VclPtr<CheckBox> m_pCbAuthor;
+ VclPtr<ListBox> m_pLbAuthor;
+ VclPtr<CheckBox> m_pCbRange;
+ VclPtr<Edit> m_pEdRange;
+ VclPtr<PushButton> m_pBtnRange;
+ VclPtr<CheckBox> m_pCbAction;
+ VclPtr<ListBox> m_pLbAction;
+ VclPtr<CheckBox> m_pCbComment;
+ VclPtr<Edit> m_pEdComment;
bool bModified;
DECL_LINK( SelDateHdl, ListBox* );
@@ -215,6 +216,8 @@ protected:
public:
SvxTPFilter( vcl::Window * pParent);
+ virtual ~SvxTPFilter();
+ virtual void dispose() SAL_OVERRIDE;
virtual void DeactivatePage() SAL_OVERRIDE;
void SetRedlinTable(SvxRedlinTable*);
@@ -304,12 +307,12 @@ private:
Link RejectAllClickLk;
Link UndoClickLk;
- SvxRedlinTable* m_pViewData;
- PushButton* m_pAccept;
- PushButton* m_pReject;
- PushButton* m_pAcceptAll;
- PushButton* m_pRejectAll;
- PushButton* m_pUndo;
+ VclPtr<SvxRedlinTable> m_pViewData;
+ VclPtr<PushButton> m_pAccept;
+ VclPtr<PushButton> m_pReject;
+ VclPtr<PushButton> m_pAcceptAll;
+ VclPtr<PushButton> m_pRejectAll;
+ VclPtr<PushButton> m_pUndo;
bool bEnableAccept;
bool bEnableAcceptAll;
@@ -322,6 +325,7 @@ private:
public:
SvxTPView(vcl::Window * pParent, VclBuilderContainer *pTopLevel);
virtual ~SvxTPView();
+ virtual void dispose() SAL_OVERRIDE;
void InsertWriterHeader();
void InsertCalcHeader();
@@ -370,8 +374,8 @@ class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxAcceptChgCtr
{
private:
- SvxTPFilter* pTPFilter;
- SvxTPView* pTPView;
+ VclPtr<SvxTPFilter> pTPFilter;
+ VclPtr<SvxTPView> pTPView;
sal_uInt16 m_nViewPageId;
sal_uInt16 m_nFilterPageId;
@@ -380,6 +384,7 @@ public:
SvxAcceptChgCtr(vcl::Window* pParent, VclBuilderContainer* pTopLevel);
virtual ~SvxAcceptChgCtr();
+ virtual void dispose() SAL_OVERRIDE;
void ShowFilterPage();
void ShowViewPage();
diff --git a/include/svx/dialcontrol.hxx b/include/svx/dialcontrol.hxx
index 36ac077369d9..9477de1f7a9b 100644
--- a/include/svx/dialcontrol.hxx
+++ b/include/svx/dialcontrol.hxx
@@ -80,8 +80,6 @@ class SVX_DLLPUBLIC SAL_WARN_UNUSED DialControl : public Control
public:
explicit DialControl( vcl::Window* pParent, WinBits nBits );
- virtual ~DialControl();
-
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
@@ -126,11 +124,11 @@ public:
protected:
struct DialControl_Impl
{
- std::unique_ptr<DialControlBmp> mxBmpEnabled;
- std::unique_ptr<DialControlBmp> mxBmpDisabled;
- std::unique_ptr<DialControlBmp> mxBmpBuffered;
+ ScopedVclPtr<DialControlBmp> mxBmpEnabled;
+ ScopedVclPtr<DialControlBmp> mxBmpDisabled;
+ ScopedVclPtr<DialControlBmp> mxBmpBuffered;
Link maModifyHdl;
- NumericField* mpLinkField;
+ VclPtr<NumericField> mpLinkField;
sal_Int32 mnLinkedFieldValueMultiplyer;
Size maWinSize;
vcl::Font maWinFont;
diff --git a/include/svx/dlgctl3d.hxx b/include/svx/dlgctl3d.hxx
index 09b1c52c55d1..a9eab331774b 100644
--- a/include/svx/dlgctl3d.hxx
+++ b/include/svx/dlgctl3d.hxx
@@ -51,6 +51,7 @@ protected:
public:
Svx3DPreviewControl(vcl::Window* pParent, WinBits nStyle = 0);
virtual ~Svx3DPreviewControl();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
@@ -104,7 +105,6 @@ class SVX_DLLPUBLIC SAL_WARN_UNUSED Svx3DLightControl : public Svx3DPreviewContr
public:
Svx3DLightControl(vcl::Window* pParent, WinBits nStyle = 0);
- virtual ~Svx3DLightControl();
virtual void Paint(const Rectangle& rRect) SAL_OVERRIDE;
virtual void MouseButtonDown(const MouseEvent& rMEvt) SAL_OVERRIDE;
@@ -145,18 +145,19 @@ class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxLightCtl3D : public Control
{
private:
// local controls
- Svx3DLightControl maLightControl;
- ScrollBar maHorScroller;
- ScrollBar maVerScroller;
- PushButton maSwitcher;
+ VclPtr<Svx3DLightControl> maLightControl;
+ VclPtr<ScrollBar> maHorScroller;
+ VclPtr<ScrollBar> maVerScroller;
+ VclPtr<PushButton> maSwitcher;
// callback for interactive changes
- Link maUserInteractiveChangeCallback;
- Link maUserSelectionChangeCallback;
+ Link maUserInteractiveChangeCallback;
+ Link maUserSelectionChangeCallback;
public:
SvxLightCtl3D(vcl::Window* pParent);
virtual ~SvxLightCtl3D();
+ virtual void dispose() SAL_OVERRIDE;
// react to size changes
virtual void Resize() SAL_OVERRIDE;
@@ -166,7 +167,7 @@ public:
void CheckSelection();
// bring further settings to the outside world
- Svx3DLightControl& GetSvx3DLightControl() { return maLightControl; }
+ Svx3DLightControl& GetSvx3DLightControl() { return *maLightControl.get(); }
// register user callback
void SetUserInteractiveChangeCallback(Link aNew) { maUserInteractiveChangeCallback = aNew; }
diff --git a/include/svx/dlgctrl.hxx b/include/svx/dlgctrl.hxx
index 95713734122a..119aafa84290 100644
--- a/include/svx/dlgctrl.hxx
+++ b/include/svx/dlgctrl.hxx
@@ -100,6 +100,7 @@ public:
void SetControlSettings(RECT_POINT eRpt = RP_MM, sal_uInt16 nBorder = 200,
sal_uInt16 nCircle = 80, CTL_STYLE eStyle = CS_RECT);
virtual ~SvxRectCtl();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
@@ -179,6 +180,7 @@ public:
SvxPixelCtl( vcl::Window* pParent, sal_uInt16 nNumber = 8 );
virtual ~SvxPixelCtl();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
@@ -322,7 +324,6 @@ private:
public:
LineLB(vcl::Window* pParent, WinBits aWB);
- virtual ~LineLB();
void Fill(const XDashListRef &pList);
bool getAddStandardFields() const { return mbAddStandardFields; }
@@ -341,7 +342,6 @@ class SVX_DLLPUBLIC SAL_WARN_UNUSED LineEndLB : public ListBox
public:
LineEndLB( vcl::Window* pParent, WinBits aWB );
- virtual ~LineEndLB();
void Fill( const XLineEndListRef &pList, bool bStart = true );
@@ -350,7 +350,6 @@ public:
};
-
class SdrObject;
class SdrPathObj;
class SdrModel;
@@ -358,8 +357,8 @@ class SdrModel;
class SAL_WARN_UNUSED SvxPreviewBase : public Control
{
private:
- SdrModel* mpModel;
- VirtualDevice* mpBufferDevice;
+ SdrModel* mpModel;
+ VclPtr<VirtualDevice> mpBufferDevice;
protected:
void InitSettings(bool bForeground, bool bBackground);
@@ -373,6 +372,7 @@ protected:
public:
SvxPreviewBase(vcl::Window* pParent);
virtual ~SvxPreviewBase();
+ virtual void dispose() SAL_OVERRIDE;
// change support
virtual void StateChanged(StateChangedType nStateChange) SAL_OVERRIDE;
@@ -403,6 +403,7 @@ private:
public:
SvxXLinePreview( vcl::Window* pParent );
virtual ~SvxXLinePreview();
+ virtual void dispose() SAL_OVERRIDE;
void SetLineAttributes(const SfxItemSet& rItemSet);
@@ -429,6 +430,7 @@ private:
public:
SvxXRectPreview(vcl::Window* pParent);
virtual ~SvxXRectPreview();
+ virtual void dispose() SAL_OVERRIDE;
void SetAttributes(const SfxItemSet& rItemSet);
@@ -454,6 +456,7 @@ public:
SvxXShadowPreview(vcl::Window *pParent);
virtual ~SvxXShadowPreview();
+ virtual void dispose() SAL_OVERRIDE;
void SetRectangleAttributes(const SfxItemSet& rItemSet);
void SetShadowAttributes(const SfxItemSet& rItemSet);
diff --git a/include/svx/fillctrl.hxx b/include/svx/fillctrl.hxx
index 60955a6a6219..d33c5e6c3739 100644
--- a/include/svx/fillctrl.hxx
+++ b/include/svx/fillctrl.hxx
@@ -50,9 +50,9 @@ private:
XFillHatchItem* mpHatchItem;
XFillBitmapItem* mpBitmapItem;
- FillControl* mpFillControl;
- SvxFillTypeBox* mpFillTypeLB;
- SvxFillAttrBox* mpFillAttrLB;
+ VclPtr<FillControl> mpFillControl;
+ VclPtr<SvxFillTypeBox> mpFillTypeLB;
+ VclPtr<SvxFillAttrBox> mpFillAttrLB;
css::drawing::FillStyle meLastXFS;
@@ -67,7 +67,7 @@ public:
virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState) SAL_OVERRIDE;
void Update(const SfxPoolItem* pState);
- virtual vcl::Window* CreateItemWindow(vcl::Window* pParent) SAL_OVERRIDE;
+ virtual VclPtr<vcl::Window> CreateItemWindow(vcl::Window* pParent) SAL_OVERRIDE;
};
@@ -77,8 +77,8 @@ class SAL_WARN_UNUSED FillControl : public vcl::Window
private:
friend class SvxFillToolBoxControl;
- SvxFillTypeBox* mpLbFillType;
- SvxFillAttrBox* mpLbFillAttr;
+ VclPtr<SvxFillTypeBox> mpLbFillType;
+ VclPtr<SvxFillAttrBox> mpLbFillAttr;
Size maLogicalFillSize;
Size maLogicalAttrSize;
@@ -101,6 +101,7 @@ private:
public:
FillControl(vcl::Window* pParent, WinBits nStyle = 0);
virtual ~FillControl();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
};
diff --git a/include/svx/float3d.hxx b/include/svx/float3d.hxx
index f538f7d53aed..04c166228a94 100644
--- a/include/svx/float3d.hxx
+++ b/include/svx/float3d.hxx
@@ -60,108 +60,108 @@ class SVX_DLLPUBLIC SAL_WARN_UNUSED Svx3DWin : public SfxDockingWindow
using Window::Update;
private:
- PushButton* m_pBtnGeo;
- PushButton* m_pBtnRepresentation;
- PushButton* m_pBtnLight;
- PushButton* m_pBtnTexture;
- PushButton* m_pBtnMaterial;
- PushButton* m_pBtnUpdate;
- PushButton* m_pBtnAssign;
+ VclPtr<PushButton> m_pBtnGeo;
+ VclPtr<PushButton> m_pBtnRepresentation;
+ VclPtr<PushButton> m_pBtnLight;
+ VclPtr<PushButton> m_pBtnTexture;
+ VclPtr<PushButton> m_pBtnMaterial;
+ VclPtr<PushButton> m_pBtnUpdate;
+ VclPtr<PushButton> m_pBtnAssign;
// geometry
- VclContainer* m_pFLGeometrie;
- FixedText* m_pFtPercentDiagonal;
- MetricField* m_pMtrPercentDiagonal;
- FixedText* m_pFtBackscale;
- MetricField* m_pMtrBackscale;
- FixedText* m_pFtEndAngle;
- MetricField* m_pMtrEndAngle;
- FixedText* m_pFtDepth;
- MetricField* m_pMtrDepth;
-
- VclContainer* m_pFLSegments;
- NumericField* m_pNumHorizontal;
- NumericField* m_pNumVertical;
-
- VclContainer* m_pFLNormals;
- PushButton* m_pBtnNormalsObj;
- PushButton* m_pBtnNormalsFlat;
- PushButton* m_pBtnNormalsSphere;
- PushButton* m_pBtnNormalsInvert;
- PushButton* m_pBtnTwoSidedLighting;
- PushButton* m_pBtnDoubleSided;
+ VclPtr<VclContainer> m_pFLGeometrie;
+ VclPtr<FixedText> m_pFtPercentDiagonal;
+ VclPtr<MetricField> m_pMtrPercentDiagonal;
+ VclPtr<FixedText> m_pFtBackscale;
+ VclPtr<MetricField> m_pMtrBackscale;
+ VclPtr<FixedText> m_pFtEndAngle;
+ VclPtr<MetricField> m_pMtrEndAngle;
+ VclPtr<FixedText> m_pFtDepth;
+ VclPtr<MetricField> m_pMtrDepth;
+
+ VclPtr<VclContainer> m_pFLSegments;
+ VclPtr<NumericField> m_pNumHorizontal;
+ VclPtr<NumericField> m_pNumVertical;
+
+ VclPtr<VclContainer> m_pFLNormals;
+ VclPtr<PushButton> m_pBtnNormalsObj;
+ VclPtr<PushButton> m_pBtnNormalsFlat;
+ VclPtr<PushButton> m_pBtnNormalsSphere;
+ VclPtr<PushButton> m_pBtnNormalsInvert;
+ VclPtr<PushButton> m_pBtnTwoSidedLighting;
+ VclPtr<PushButton> m_pBtnDoubleSided;
// presentation
- VclContainer* m_pFLRepresentation;
- ListBox* m_pLbShademode;
+ VclPtr<VclContainer> m_pFLRepresentation;
+ VclPtr<ListBox> m_pLbShademode;
- VclContainer* m_pFLShadow;
- PushButton* m_pBtnShadow3d;
- FixedText* m_pFtSlant;
- MetricField* m_pMtrSlant;
+ VclPtr<VclContainer> m_pFLShadow;
+ VclPtr<PushButton> m_pBtnShadow3d;
+ VclPtr<FixedText> m_pFtSlant;
+ VclPtr<MetricField> m_pMtrSlant;
- VclContainer* m_pFLCamera;
- MetricField* m_pMtrDistance;
- MetricField* m_pMtrFocalLength;
+ VclPtr<VclContainer> m_pFLCamera;
+ VclPtr<MetricField> m_pMtrDistance;
+ VclPtr<MetricField> m_pMtrFocalLength;
// lighting
- VclContainer* m_pFLLight;
- PushButton* m_pBtnLight1;
- PushButton* m_pBtnLight2;
- PushButton* m_pBtnLight3;
- PushButton* m_pBtnLight4;
- PushButton* m_pBtnLight5;
- PushButton* m_pBtnLight6;
- PushButton* m_pBtnLight7;
- PushButton* m_pBtnLight8;
- ColorLB* m_pLbLight1;
- ColorLB* m_pLbLight2;
- ColorLB* m_pLbLight3;
- ColorLB* m_pLbLight4;
- ColorLB* m_pLbLight5;
- ColorLB* m_pLbLight6;
- ColorLB* m_pLbLight7;
- ColorLB* m_pLbLight8;
- PushButton* m_pBtnLightColor;
- ColorLB* m_pLbAmbientlight; // ListBox
- PushButton* m_pBtnAmbientColor; // color button
+ VclPtr<VclContainer> m_pFLLight;
+ VclPtr<PushButton> m_pBtnLight1;
+ VclPtr<PushButton> m_pBtnLight2;
+ VclPtr<PushButton> m_pBtnLight3;
+ VclPtr<PushButton> m_pBtnLight4;
+ VclPtr<PushButton> m_pBtnLight5;
+ VclPtr<PushButton> m_pBtnLight6;
+ VclPtr<PushButton> m_pBtnLight7;
+ VclPtr<PushButton> m_pBtnLight8;
+ VclPtr<ColorLB> m_pLbLight1;
+ VclPtr<ColorLB> m_pLbLight2;
+ VclPtr<ColorLB> m_pLbLight3;
+ VclPtr<ColorLB> m_pLbLight4;
+ VclPtr<ColorLB> m_pLbLight5;
+ VclPtr<ColorLB> m_pLbLight6;
+ VclPtr<ColorLB> m_pLbLight7;
+ VclPtr<ColorLB> m_pLbLight8;
+ VclPtr<PushButton> m_pBtnLightColor;
+ VclPtr<ColorLB> m_pLbAmbientlight; // ListBox
+ VclPtr<PushButton> m_pBtnAmbientColor; // color button
// Textures
- VclContainer* m_pFLTexture;
- PushButton* m_pBtnTexLuminance;
- PushButton* m_pBtnTexColor;
- PushButton* m_pBtnTexReplace;
- PushButton* m_pBtnTexModulate;
- PushButton* m_pBtnTexBlend;
- PushButton* m_pBtnTexObjectX;
- PushButton* m_pBtnTexParallelX;
- PushButton* m_pBtnTexCircleX;
- PushButton* m_pBtnTexObjectY;
- PushButton* m_pBtnTexParallelY;
- PushButton* m_pBtnTexCircleY;
- PushButton* m_pBtnTexFilter;
+ VclPtr<VclContainer> m_pFLTexture;
+ VclPtr<PushButton> m_pBtnTexLuminance;
+ VclPtr<PushButton> m_pBtnTexColor;
+ VclPtr<PushButton> m_pBtnTexReplace;
+ VclPtr<PushButton> m_pBtnTexModulate;
+ VclPtr<PushButton> m_pBtnTexBlend;
+ VclPtr<PushButton> m_pBtnTexObjectX;
+ VclPtr<PushButton> m_pBtnTexParallelX;
+ VclPtr<PushButton> m_pBtnTexCircleX;
+ VclPtr<PushButton> m_pBtnTexObjectY;
+ VclPtr<PushButton> m_pBtnTexParallelY;
+ VclPtr<PushButton> m_pBtnTexCircleY;
+ VclPtr<PushButton> m_pBtnTexFilter;
// material
// material editor
- VclContainer* m_pFLMaterial;
- ListBox* m_pLbMatFavorites;
- ColorLB* m_pLbMatColor;
- PushButton* m_pBtnMatColor;
- ColorLB* m_pLbMatEmission;
- PushButton* m_pBtnEmissionColor;
+ VclPtr<VclContainer> m_pFLMaterial;
+ VclPtr<ListBox> m_pLbMatFavorites;
+ VclPtr<ColorLB> m_pLbMatColor;
+ VclPtr<PushButton> m_pBtnMatColor;
+ VclPtr<ColorLB> m_pLbMatEmission;
+ VclPtr<PushButton> m_pBtnEmissionColor;
- VclContainer* m_pFLMatSpecular;
- ColorLB* m_pLbMatSpecular;
- PushButton* m_pBtnSpecularColor;
- MetricField* m_pMtrMatSpecularIntensity;
+ VclPtr<VclContainer> m_pFLMatSpecular;
+ VclPtr<ColorLB> m_pLbMatSpecular;
+ VclPtr<PushButton> m_pBtnSpecularColor;
+ VclPtr<MetricField> m_pMtrMatSpecularIntensity;
- Svx3DPreviewControl* m_pCtlPreview;
- SvxLightCtl3D* m_pCtlLightPreview;
+ VclPtr<Svx3DPreviewControl> m_pCtlPreview;
+ VclPtr<SvxLightCtl3D> m_pCtlLightPreview;
// bottom part
- PushButton* m_pBtnConvertTo3D;
- PushButton* m_pBtnLatheObject;
- PushButton* m_pBtnPerspective;
+ VclPtr<PushButton> m_pBtnConvertTo3D;
+ VclPtr<PushButton> m_pBtnLatheObject;
+ VclPtr<PushButton> m_pBtnPerspective;
// the rest ...
Image aImgLightOn;
@@ -171,7 +171,7 @@ private:
// Model, Page, View etc. for favourites
FmFormModel* pModel;
- VirtualDevice* pVDev;
+ VclPtr<VirtualDevice> pVDev;
E3dView* p3DView;
SfxBindings* pBindings;
@@ -189,8 +189,6 @@ private:
bool bOnly3DChanged;
-
-
DECL_LINK( ClickViewTypeHdl, void * );
DECL_LINK( ClickUpdateHdl, void * );
DECL_LINK( ClickAssignHdl, void * );
@@ -220,6 +218,7 @@ public:
Svx3DWin( SfxBindings* pBindings, SfxChildWindow *pCW,
vcl::Window* pParent );
virtual ~Svx3DWin();
+ virtual void dispose() SAL_OVERRIDE;
void InitColorLB( const SdrModel* pDoc );
bool IsUpdateMode() const { return bUpdate; }
diff --git a/include/svx/fmgridcl.hxx b/include/svx/fmgridcl.hxx
index 0bcb6124e7ff..7bb356852b28 100644
--- a/include/svx/fmgridcl.hxx
+++ b/include/svx/fmgridcl.hxx
@@ -43,6 +43,7 @@ protected:
public:
FmGridHeader( BrowseBox* pParent, WinBits nWinBits = WB_STDHEADERBAR | WB_DRAG );
virtual ~FmGridHeader();
+ virtual void dispose() SAL_OVERRIDE;
public:
struct AccessControl { friend class FmGridControl; private: AccessControl() { } };
@@ -153,7 +154,7 @@ public:
protected:
virtual void Command(const CommandEvent& rEvt) SAL_OVERRIDE;
- virtual BrowserHeader* imp_CreateHeaderBar(BrowseBox* pParent) SAL_OVERRIDE;
+ virtual VclPtr<BrowserHeader> imp_CreateHeaderBar(BrowseBox* pParent) SAL_OVERRIDE;
virtual long QueryMinimumRowHeight() SAL_OVERRIDE;
virtual void RowHeightChanged() SAL_OVERRIDE;
virtual void ColumnResized(sal_uInt16 nId) SAL_OVERRIDE;
diff --git a/include/svx/fmgridif.hxx b/include/svx/fmgridif.hxx
index bb9d2fcfa18c..d752b881e064 100644
--- a/include/svx/fmgridif.hxx
+++ b/include/svx/fmgridif.hxx
@@ -501,7 +501,7 @@ public:
virtual void SAL_CALL removeSelectionChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
protected:
- virtual FmGridControl* imp_CreateControl(vcl::Window* pParent, WinBits nStyle);
+ virtual VclPtr<FmGridControl> imp_CreateControl(vcl::Window* pParent, WinBits nStyle);
static ::com::sun::star::uno::Sequence< ::com::sun::star::util::URL>& getSupportedURLs();
static ::com::sun::star::uno::Sequence<sal_uInt16>& getSupportedGridSlots();
diff --git a/include/svx/fmshell.hxx b/include/svx/fmshell.hxx
index 462c304590d1..8249ef9c46b7 100644
--- a/include/svx/fmshell.hxx
+++ b/include/svx/fmshell.hxx
@@ -88,7 +88,7 @@ class SVX_DLLPUBLIC FmFormShell : public SfxShell
class FormShellWaitObject
{
- vcl::Window* m_pWindow;
+ VclPtr<vcl::Window> m_pWindow;
public:
FormShellWaitObject(const FmFormShell* _pShell);
~FormShellWaitObject();
diff --git a/include/svx/fntctrl.hxx b/include/svx/fntctrl.hxx
index a9ad36d99855..2278f0c3f755 100644
--- a/include/svx/fntctrl.hxx
+++ b/include/svx/fntctrl.hxx
@@ -49,6 +49,7 @@ public:
SvxFontPrevWindow( vcl::Window* pParent, const ResId& rId );
SvxFontPrevWindow(vcl::Window* pParent, WinBits nStyle);
virtual ~SvxFontPrevWindow();
+ virtual void dispose() SAL_OVERRIDE;
virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
diff --git a/include/svx/fontwork.hxx b/include/svx/fontwork.hxx
index 6760ace56b0e..8905b76b9511 100644
--- a/include/svx/fontwork.hxx
+++ b/include/svx/fontwork.hxx
@@ -92,20 +92,22 @@ class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxFontWorkDialog : public SfxDockingWindow
SvxFontWorkControllerItem* pCtrlItems[CONTROLLER_COUNT];
- ToolBox* m_pTbxStyle;
- ToolBox* m_pTbxAdjust;
+ VclPtr<ToolBox> m_pTbxStyle;
+ VclPtr<ToolBox> m_pTbxAdjust;
- MetricField* m_pMtrFldDistance;
- MetricField* m_pMtrFldTextStart;
+ VclPtr<FixedImage> m_pFbDistance;
+ VclPtr<MetricField> m_pMtrFldDistance;
+ VclPtr<FixedImage> m_pFbTextStart;
+ VclPtr<MetricField> m_pMtrFldTextStart;
- ToolBox* m_pTbxShadow;
+ VclPtr<ToolBox> m_pTbxShadow;
- FixedImage* m_pFbShadowX;
- MetricField* m_pMtrFldShadowX;
- FixedImage* m_pFbShadowY;
- MetricField* m_pMtrFldShadowY;
+ VclPtr<FixedImage> m_pFbShadowX;
+ VclPtr<MetricField> m_pMtrFldShadowX;
+ VclPtr<FixedImage> m_pFbShadowY;
+ VclPtr<MetricField> m_pMtrFldShadowY;
- ColorLB* m_pShadowColorLB;
+ VclPtr<ColorLB> m_pShadowColorLB;
SfxBindings& rBindings;
Idle aInputIdle;
@@ -172,6 +174,7 @@ class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxFontWorkDialog : public SfxDockingWindow
SvxFontWorkDialog(SfxBindings *pBinding, SfxChildWindow *pCW,
vcl::Window* pParent);
virtual ~SvxFontWorkDialog();
+ virtual void dispose() SAL_OVERRIDE;
void SetColorList(const XColorListRef &pTable);
};
diff --git a/include/svx/fontworkgallery.hxx b/include/svx/fontworkgallery.hxx
index 56787ec3df65..dfae49d09336 100644
--- a/include/svx/fontworkgallery.hxx
+++ b/include/svx/fontworkgallery.hxx
@@ -57,23 +57,25 @@ public:
virtual void Select(sal_uInt16 nSelectModifier) SAL_OVERRIDE;
virtual SfxPopupWindowType GetPopupWindowType() const SAL_OVERRIDE;
- virtual SfxPopupWindow* CreatePopupWindow() SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> CreatePopupWindow() SAL_OVERRIDE;
};
class SAL_WARN_UNUSED FontworkCharacterSpacingDialog : public ModalDialog
{
- MetricField* m_pMtrScale;
+ VclPtr<MetricField> m_pMtrScale;
public:
FontworkCharacterSpacingDialog( vcl::Window* pParent, sal_Int32 nScale );
+ virtual ~FontworkCharacterSpacingDialog();
+ virtual void dispose() SAL_OVERRIDE;
sal_Int32 getScale() const;
};
class SVX_DLLPUBLIC SAL_WARN_UNUSED FontWorkGalleryDialog : public ModalDialog
{
- ValueSet* mpCtlFavorites;
- OKButton* mpOKButton;
+ VclPtr<ValueSet> mpCtlFavorites;
+ VclPtr<OKButton> mpOKButton;
sal_uInt16 mnThemeId;
@@ -96,6 +98,7 @@ class SVX_DLLPUBLIC SAL_WARN_UNUSED FontWorkGalleryDialog : public ModalDialog
public:
FontWorkGalleryDialog( SdrView* pView, vcl::Window* pParent, sal_uInt16 nSID );
virtual ~FontWorkGalleryDialog();
+ virtual void dispose() SAL_OVERRIDE;
// SJ: if the SdrObject** is set, the SdrObject is not inserted into the page when executing the dialog
void SetSdrObjectRef( SdrObject**, SdrModel* pModel );
diff --git a/include/svx/frmdirlbox.hxx b/include/svx/frmdirlbox.hxx
index d584acc91104..d4df82a607c8 100644
--- a/include/svx/frmdirlbox.hxx
+++ b/include/svx/frmdirlbox.hxx
@@ -40,7 +40,6 @@ class SVX_DLLPUBLIC SAL_WARN_UNUSED FrameDirectionListBox : public ListBox
{
public:
explicit FrameDirectionListBox( vcl::Window* pParent, WinBits nBits );
- virtual ~FrameDirectionListBox();
/** Inserts a string with corresponding direction enum into the listbox. */
void InsertEntryValue(
diff --git a/include/svx/frmsel.hxx b/include/svx/frmsel.hxx
index aa34ef62c504..48bb2f90d785 100644
--- a/include/svx/frmsel.hxx
+++ b/include/svx/frmsel.hxx
@@ -84,7 +84,7 @@ class SVX_DLLPUBLIC SAL_WARN_UNUSED FrameSelector : public Control
{
public:
FrameSelector(vcl::Window* pParent);
- virtual ~FrameSelector();
+ virtual ~FrameSelector();
/** Initializes the control, enables/disables frame borders according to flags. */
void Initialize( FrameSelFlags nFlags );
diff --git a/include/svx/galctrl.hxx b/include/svx/galctrl.hxx
index 4508e283cc6f..d0ccb6c62323 100644
--- a/include/svx/galctrl.hxx
+++ b/include/svx/galctrl.hxx
@@ -109,7 +109,6 @@ private:
public:
GalleryIconView( GalleryBrowser2* pParent, GalleryTheme* pTheme );
- virtual ~GalleryIconView();
};
class GalleryListView : public BrowseBox
@@ -144,7 +143,6 @@ private:
public:
GalleryListView( GalleryBrowser2* pParent, GalleryTheme* pTheme );
- virtual ~GalleryListView();
void SetSelectHdl( const Link& rSelectHdl ) { maSelectHdl = rSelectHdl; }
diff --git a/include/svx/grafctrl.hxx b/include/svx/grafctrl.hxx
index acfd5f356cfa..ba4124de41e1 100644
--- a/include/svx/grafctrl.hxx
+++ b/include/svx/grafctrl.hxx
@@ -54,7 +54,7 @@ public:
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) SAL_OVERRIDE;
virtual SfxPopupWindowType GetPopupWindowType() const SAL_OVERRIDE;
- virtual SfxPopupWindow* CreatePopupWindow() SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> CreatePopupWindow() SAL_OVERRIDE;
};
@@ -68,7 +68,7 @@ public:
virtual ~SvxGrafToolBoxControl();
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) SAL_OVERRIDE;
- virtual vcl::Window* CreateItemWindow( vcl::Window *pParent ) SAL_OVERRIDE;
+ virtual VclPtr<vcl::Window> CreateItemWindow( vcl::Window *pParent ) SAL_OVERRIDE;
};
@@ -160,7 +160,7 @@ public:
virtual ~SvxGrafModeToolBoxControl();
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) SAL_OVERRIDE;
- virtual vcl::Window* CreateItemWindow( vcl::Window *pParent ) SAL_OVERRIDE;
+ virtual VclPtr<vcl::Window> CreateItemWindow( vcl::Window *pParent ) SAL_OVERRIDE;
};
diff --git a/include/svx/graphctl.hxx b/include/svx/graphctl.hxx
index d941b6fbb581..3d646afa2baf 100644
--- a/include/svx/graphctl.hxx
+++ b/include/svx/graphctl.hxx
@@ -80,8 +80,9 @@ protected:
public:
- GraphCtrl( vcl::Window* pParent, WinBits nStyle );
- virtual ~GraphCtrl();
+ GraphCtrl( vcl::Window* pParent, WinBits nStyle );
+ virtual ~GraphCtrl();
+ virtual void dispose() SAL_OVERRIDE;
void SetWinStyle( WinBits nWinBits );
WinBits GetWinStyle() const { return nWinStyle; }
diff --git a/include/svx/gridctrl.hxx b/include/svx/gridctrl.hxx
index bf42c434ea13..94bbad044a2b 100644
--- a/include/svx/gridctrl.hxx
+++ b/include/svx/gridctrl.hxx
@@ -151,20 +151,20 @@ public:
friend class NavigationBar::AbsolutePos;
// zusaetzliche Controls
- FixedText m_aRecordText;
- AbsolutePos m_aAbsolute; // absolute positioning
- FixedText m_aRecordOf;
- FixedText m_aRecordCount;
+ VclPtr<FixedText> m_aRecordText;
+ VclPtr<AbsolutePos> m_aAbsolute; // absolute positioning
+ VclPtr<FixedText> m_aRecordOf;
+ VclPtr<FixedText> m_aRecordCount;
- ImageButton m_aFirstBtn; // ImageButton for 'go to the first record'
- ImageButton m_aPrevBtn; // ImageButton for 'go to the previous record'
- ImageButton m_aNextBtn; // ImageButton for 'go to the next record'
- ImageButton m_aLastBtn; // ImageButton for 'go to the last record'
- ImageButton m_aNewBtn; // ImageButton for 'go to a new record'
- sal_uInt16 m_nDefaultWidth;
- sal_Int32 m_nCurrentPos;
+ VclPtr<ImageButton> m_aFirstBtn; // ImageButton for 'go to the first record'
+ VclPtr<ImageButton> m_aPrevBtn; // ImageButton for 'go to the previous record'
+ VclPtr<ImageButton> m_aNextBtn; // ImageButton for 'go to the next record'
+ VclPtr<ImageButton> m_aLastBtn; // ImageButton for 'go to the last record'
+ VclPtr<ImageButton> m_aNewBtn; // ImageButton for 'go to a new record'
+ sal_uInt16 m_nDefaultWidth;
+ sal_Int32 m_nCurrentPos;
- bool m_bPositioning; // protect PositionDataSource against recursion
+ bool m_bPositioning; // protect PositionDataSource against recursion
public:
// StatusIds for Controls of the Bar
@@ -183,6 +183,8 @@ public:
};
NavigationBar(vcl::Window* pParent, WinBits nStyle = 0);
+ virtual ~NavigationBar();
+ virtual void dispose() SAL_OVERRIDE;
// Status methods for Controls
void InvalidateAll(sal_Int32 nCurrentPos = -1, bool bAll = false);
@@ -225,7 +227,7 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
DbGridColumns m_aColumns; // Column description
- NavigationBar m_aBar;
+ VclPtr<NavigationBar> m_aBar;
DbGridRowRef m_xDataRow; // Row which can be modified
// comes from the data cursor
DbGridRowRef m_xSeekRow, // Row to which the iterator can set
@@ -370,6 +372,7 @@ public:
WinBits nBits = WB_BORDER);
virtual ~DbGridControl();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Init() SAL_OVERRIDE;
virtual void InitColumnsByFields(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& xFields) = 0;
@@ -431,7 +434,7 @@ public:
bool HasNavigationBar() const {return m_bNavigationBar;}
sal_uInt16 GetOptions() const {return m_nOptions;}
- NavigationBar& GetNavigationBar() {return m_aBar;}
+ NavigationBar& GetNavigationBar() {return *m_aBar.get();}
sal_uInt16 SetOptions(sal_uInt16 nOpt);
// The new options are interpreted with respect to the current data source. If it is unable
// to update, to insert or to restore, the according options are ignored. If the grid isn't
diff --git a/include/svx/hdft.hxx b/include/svx/hdft.hxx
index 53450d36491a..7df23df2dc70 100644
--- a/include/svx/hdft.hxx
+++ b/include/svx/hdft.hxx
@@ -52,6 +52,7 @@ public:
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
virtual ~SvxHFPage();
+ virtual void dispose() SAL_OVERRIDE;
void DisableDeleteQueryBox() { mbDisableQueryBox = true; }
void EnableBackgroundSelector(bool bNew) { mbEnableBackgroundSelector = bNew; }
@@ -69,22 +70,22 @@ protected:
SvxHFPage( vcl::Window* pParent, const SfxItemSet& rSet, sal_uInt16 nSetId );
- FixedText* m_pPageLbl;
- CheckBox* m_pTurnOnBox;
- CheckBox* m_pCntSharedBox;
- CheckBox* m_pCntSharedFirstBox;
- FixedText* m_pLMLbl;
- MetricField* m_pLMEdit;
- FixedText* m_pRMLbl;
- MetricField* m_pRMEdit;
- FixedText* m_pDistFT;
- MetricField* m_pDistEdit;
- CheckBox* m_pDynSpacingCB;
- FixedText* m_pHeightFT;
- MetricField* m_pHeightEdit;
- CheckBox* m_pHeightDynBtn;
- SvxPageWindow* m_pBspWin;
- PushButton* m_pBackgroundBtn;
+ VclPtr<FixedText> m_pPageLbl;
+ VclPtr<CheckBox> m_pTurnOnBox;
+ VclPtr<CheckBox> m_pCntSharedBox;
+ VclPtr<CheckBox> m_pCntSharedFirstBox;
+ VclPtr<FixedText> m_pLMLbl;
+ VclPtr<MetricField> m_pLMEdit;
+ VclPtr<FixedText> m_pRMLbl;
+ VclPtr<MetricField> m_pRMEdit;
+ VclPtr<FixedText> m_pDistFT;
+ VclPtr<MetricField> m_pDistEdit;
+ VclPtr<CheckBox> m_pDynSpacingCB;
+ VclPtr<FixedText> m_pHeightFT;
+ VclPtr<MetricField> m_pHeightEdit;
+ VclPtr<CheckBox> m_pHeightDynBtn;
+ VclPtr<SvxPageWindow> m_pBspWin;
+ VclPtr<PushButton> m_pBackgroundBtn;
sal_uInt16 nId;
SfxItemSet* pBBSet;
@@ -112,12 +113,10 @@ private:
class SVX_DLLPUBLIC SvxHeaderPage : public SvxHFPage
{
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
// returns the Which values to the range
- static const sal_uInt16* GetRanges() { return pRanges; }
-
-private:
- SvxHeaderPage( vcl::Window* pParent, const SfxItemSet& rSet );
+ static const sal_uInt16* GetRanges() { return pRanges; }
+ SVX_DLLPRIVATE SvxHeaderPage( vcl::Window* pParent, const SfxItemSet& rSet );
};
// class SvxFooterPage ---------------------------------------------------
@@ -125,10 +124,8 @@ private:
class SVX_DLLPUBLIC SvxFooterPage : public SvxHFPage
{
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
- static const sal_uInt16* GetRanges() { return pRanges; }
-
-private:
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static const sal_uInt16* GetRanges() { return pRanges; }
SVX_DLLPRIVATE SvxFooterPage( vcl::Window* pParent, const SfxItemSet& rSet );
};
diff --git a/include/svx/imapdlg.hxx b/include/svx/imapdlg.hxx
index 7c288fed577a..fc0b758d3c37 100644
--- a/include/svx/imapdlg.hxx
+++ b/include/svx/imapdlg.hxx
@@ -82,14 +82,14 @@ class SVX_DLLPUBLIC SvxIMapDlg : public SfxModelessDialog // SfxFloatingWindow
friend class IMapOwnData;
friend class IMapWindow;
- ToolBox *m_pTbxIMapDlg1;
- FixedText *m_pFtURL;
- SvtURLBox *m_pURLBox;
- FixedText *m_pFtText;
- Edit *m_pEdtText;
- FixedText *m_pFtTarget;
- ComboBox *m_pCbbTarget;
- StatusBar *m_pStbStatus;
+ VclPtr<ToolBox> m_pTbxIMapDlg1;
+ VclPtr<FixedText> m_pFtURL;
+ VclPtr<SvtURLBox> m_pURLBox;
+ VclPtr<FixedText> m_pFtText;
+ VclPtr<Edit> m_pEdtText;
+ VclPtr<FixedText> m_pFtTarget;
+ VclPtr<ComboBox> m_pCbbTarget;
+ VclPtr<StatusBar> m_pStbStatus;
sal_uInt16 mnApplyId;
sal_uInt16 mnOpenId;
@@ -110,7 +110,7 @@ class SVX_DLLPUBLIC SvxIMapDlg : public SfxModelessDialog // SfxFloatingWindow
sal_uInt16 mnPropertyId;
Size aLastSize;
- IMapWindow* pIMapWnd;
+ VclPtr<IMapWindow> pIMapWnd;
IMapOwnData* pOwnData;
void* pCheckObj;
SvxIMapDlgItem aIMapItem;
@@ -136,6 +136,7 @@ public:
SvxIMapDlg( SfxBindings *pBindings, SfxChildWindow *pCW,
vcl::Window* pParent );
virtual ~SvxIMapDlg();
+ virtual void dispose() SAL_OVERRIDE;
void SetExecState( bool bEnable );
diff --git a/include/svx/itemwin.hxx b/include/svx/itemwin.hxx
index a71d9bcb0026..8d2c1bfb6726 100644
--- a/include/svx/itemwin.hxx
+++ b/include/svx/itemwin.hxx
@@ -49,7 +49,6 @@ public:
SvxLineBox( vcl::Window* pParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
WinBits nBits = WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL );
- virtual ~SvxLineBox();
void FillControl();
@@ -87,7 +86,6 @@ public:
SvxMetricField( vcl::Window* pParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
WinBits nBits = WB_BORDER | WB_SPIN | WB_REPEAT );
- virtual ~SvxMetricField();
void Update( const XLineWidthItem* pItem );
void SetCoreUnit( SfxMapUnit eUnit );
@@ -100,7 +98,6 @@ class SvxFillTypeBox : public FillTypeLB
{
public:
SvxFillTypeBox( vcl::Window* pParent, WinBits nBits = WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL );
- virtual ~SvxFillTypeBox();
void Selected() { bSelect = true; }
bool IsRelease() { return bRelease;}
@@ -123,7 +120,6 @@ class SvxFillAttrBox : public FillAttrLB
{
public:
SvxFillAttrBox( vcl::Window* pParent, WinBits nBits = WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL );
- virtual ~SvxFillAttrBox();
bool IsRelease() { return bRelease;}
diff --git a/include/svx/langbox.hxx b/include/svx/langbox.hxx
index f804f32b0d33..7cc8a3e9afe5 100644
--- a/include/svx/langbox.hxx
+++ b/include/svx/langbox.hxx
@@ -116,7 +116,6 @@ class SVX_DLLPUBLIC SvxLanguageBox : public ListBox, public SvxLanguageBoxBase
{
public:
SvxLanguageBox( vcl::Window* pParent, WinBits nBits, bool bCheck = false );
- virtual ~SvxLanguageBox();
private:
SVX_DLLPRIVATE virtual sal_Int32 ImplInsertImgEntry( const OUString& rEntry, sal_Int32 nPos, bool bChecked ) SAL_OVERRIDE;
@@ -143,7 +142,6 @@ class SVX_DLLPUBLIC SvxLanguageComboBox : public ComboBox, public SvxLanguageBox
{
public:
SvxLanguageComboBox( vcl::Window* pParent, WinBits nBits, bool bCheck = false );
- virtual ~SvxLanguageComboBox();
enum EditedAndValid
{
diff --git a/include/svx/layctrl.hxx b/include/svx/layctrl.hxx
index 9652aea57322..05eaf5dec50d 100644
--- a/include/svx/layctrl.hxx
+++ b/include/svx/layctrl.hxx
@@ -31,7 +31,7 @@ private:
public:
virtual SfxPopupWindowType GetPopupWindowType() const SAL_OVERRIDE;
- virtual SfxPopupWindow* CreatePopupWindow() SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> CreatePopupWindow() SAL_OVERRIDE;
virtual SfxPopupWindow* CreatePopupWindowCascading() SAL_OVERRIDE;
virtual void StateChanged( sal_uInt16 nSID,
SfxItemState eState,
@@ -50,7 +50,7 @@ class SVX_DLLPUBLIC SvxColumnsToolBoxControl : public SfxToolBoxControl
bool bEnabled;
public:
virtual SfxPopupWindowType GetPopupWindowType() const SAL_OVERRIDE;
- virtual SfxPopupWindow* CreatePopupWindow() SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> CreatePopupWindow() SAL_OVERRIDE;
virtual SfxPopupWindow* CreatePopupWindowCascading() SAL_OVERRIDE;
SFX_DECL_TOOLBOX_CONTROL();
diff --git a/include/svx/lboxctrl.hxx b/include/svx/lboxctrl.hxx
index 30a21b37f71a..fe3062d18a40 100644
--- a/include/svx/lboxctrl.hxx
+++ b/include/svx/lboxctrl.hxx
@@ -34,7 +34,7 @@ class SvxListBoxControl : public SfxToolBoxControl
{
protected:
OUString aActionStr;
- SvxPopupWindowListBox * pPopupWin;
+ VclPtr<SvxPopupWindowListBox> pPopupWin;
void Impl_SetInfo( sal_uInt16 nCount );
@@ -46,7 +46,7 @@ public:
virtual ~SvxListBoxControl();
virtual SfxPopupWindowType GetPopupWindowType() const SAL_OVERRIDE;
- virtual SfxPopupWindow* CreatePopupWindow() SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> CreatePopupWindow() SAL_OVERRIDE;
virtual void StateChanged( sal_uInt16 nSID,
SfxItemState eState,
const SfxPoolItem* pState ) SAL_OVERRIDE;
@@ -69,7 +69,7 @@ public:
SfxItemState eState,
const SfxPoolItem* pState ) SAL_OVERRIDE;
- virtual SfxPopupWindow* CreatePopupWindow() SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> CreatePopupWindow() SAL_OVERRIDE;
};
#endif
diff --git a/include/svx/linectrl.hxx b/include/svx/linectrl.hxx
index 1c3a90ee50ca..a6576387bef5 100644
--- a/include/svx/linectrl.hxx
+++ b/include/svx/linectrl.hxx
@@ -52,7 +52,7 @@ public:
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState ) SAL_OVERRIDE;
void Update( const SfxPoolItem* pState );
- virtual vcl::Window* CreateItemWindow( vcl::Window *pParent ) SAL_OVERRIDE;
+ virtual VclPtr<vcl::Window> CreateItemWindow( vcl::Window *pParent ) SAL_OVERRIDE;
};
@@ -69,7 +69,7 @@ public:
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState ) SAL_OVERRIDE;
- virtual vcl::Window* CreateItemWindow( vcl::Window *pParent ) SAL_OVERRIDE;
+ virtual VclPtr<vcl::Window> CreateItemWindow( vcl::Window *pParent ) SAL_OVERRIDE;
};
@@ -82,7 +82,7 @@ class SvxLineEndWindow : public SfxPopupWindow
private:
XLineEndListRef pLineEndList;
- ValueSet aLineEndSet;
+ VclPtr<ValueSet> aLineEndSet;
sal_uInt16 nCols;
sal_uInt16 nLines;
sal_uIntPtr nLineEndWidth;
@@ -118,12 +118,13 @@ public:
vcl::Window* pParentWindow,
const OUString& rWndTitle );
virtual ~SvxLineEndWindow();
+ virtual void dispose() SAL_OVERRIDE;
void StartSelection();
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState ) SAL_OVERRIDE;
- virtual SfxPopupWindow* Clone() const SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> Clone() const SAL_OVERRIDE;
};
@@ -140,7 +141,7 @@ public:
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState ) SAL_OVERRIDE;
virtual SfxPopupWindowType GetPopupWindowType() const SAL_OVERRIDE;
- virtual SfxPopupWindow* CreatePopupWindow() SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> CreatePopupWindow() SAL_OVERRIDE;
};
diff --git a/include/svx/linkwarn.hxx b/include/svx/linkwarn.hxx
index 8fc66afffb18..b832637fc8b9 100644
--- a/include/svx/linkwarn.hxx
+++ b/include/svx/linkwarn.hxx
@@ -27,11 +27,12 @@
class SVX_DLLPUBLIC SvxLinkWarningDialog : public MessageDialog
{
private:
- CheckBox* m_pWarningOnBox;
+ VclPtr<CheckBox> m_pWarningOnBox;
public:
SvxLinkWarningDialog(vcl::Window* pParent, const OUString& _rFileName);
virtual ~SvxLinkWarningDialog();
+ virtual void dispose() SAL_OVERRIDE;
};
#endif // INCLUDED_SVX_LINKWARN_HXX
diff --git a/include/svx/measctrl.hxx b/include/svx/measctrl.hxx
index 83161ca627ed..4753ab17a671 100644
--- a/include/svx/measctrl.hxx
+++ b/include/svx/measctrl.hxx
@@ -43,6 +43,7 @@ private:
public:
SvxXMeasurePreview(vcl::Window* pParent, WinBits nStyle);
virtual ~SvxXMeasurePreview();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Paint(const Rectangle& rRect) SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
diff --git a/include/svx/numvset.hxx b/include/svx/numvset.hxx
index f5e3781e6642..d4a13cb1d3b8 100644
--- a/include/svx/numvset.hxx
+++ b/include/svx/numvset.hxx
@@ -53,7 +53,7 @@ class SVX_DLLPUBLIC SvxNumValueSet : public ValueSet
sal_uInt16 nPageType;
bool bHTMLMode;
Rectangle aOrgRect;
- VirtualDevice* pVDev;
+ VclPtr<VirtualDevice> pVDev;
com::sun::star::uno::Reference<com::sun::star::text::XNumberingFormatter> xFormatter;
com::sun::star::lang::Locale aLocale;
@@ -66,27 +66,26 @@ class SVX_DLLPUBLIC SvxNumValueSet : public ValueSet
com::sun::star::uno::Reference<
com::sun::star::container::XIndexAccess> > aOutlineSettings;
- public:
+public:
SvxNumValueSet(vcl::Window* pParent, WinBits nWinBits = WB_TABSTOP);
void init(sal_uInt16 nType);
virtual ~SvxNumValueSet();
+ virtual void dispose() SAL_OVERRIDE;
virtual void UserDraw( const UserDrawEvent& rUDEvt ) SAL_OVERRIDE;
void SetHTMLMode(bool bSet) {bHTMLMode = bSet;}
void SetNumberingSettings(
- const com::sun::star::uno::Sequence<
- com::sun::star::uno::Sequence<
- com::sun::star::beans::PropertyValue> >& aNum,
- com::sun::star::uno::Reference<com::sun::star::text::XNumberingFormatter>& xFormatter,
- const com::sun::star::lang::Locale& rLocale );
+ const css::uno::Sequence<
+ css::uno::Sequence<css::beans::PropertyValue> >& aNum,
+ css::uno::Reference<css::text::XNumberingFormatter>& xFormatter,
+ const css::lang::Locale& rLocale );
void SetOutlineNumberingSettings(
- com::sun::star::uno::Sequence<
- com::sun::star::uno::Reference<
- com::sun::star::container::XIndexAccess> >& rOutline,
- com::sun::star::uno::Reference<com::sun::star::text::XNumberingFormatter>& xFormatter,
- const com::sun::star::lang::Locale& rLocale);
+ css::uno::Sequence<
+ css::uno::Reference<css::container::XIndexAccess> >& rOutline,
+ css::uno::Reference<css::text::XNumberingFormatter>& xFormatter,
+ const css::lang::Locale& rLocale);
};
class SVX_DLLPUBLIC SvxBmpNumValueSet : public SvxNumValueSet
@@ -96,7 +95,7 @@ class SVX_DLLPUBLIC SvxBmpNumValueSet : public SvxNumValueSet
void init();
- protected:
+protected:
DECL_LINK(FormatHdl_Impl, void *);
void SetGrfNotFound(bool bSet) {bGrfNotFound = bSet;}
@@ -104,9 +103,10 @@ class SVX_DLLPUBLIC SvxBmpNumValueSet : public SvxNumValueSet
Idle& GetFormatIdle() {return aFormatIdle;}
- public:
+public:
SvxBmpNumValueSet(vcl::Window* pParent, WinBits nWinBits = WB_TABSTOP);
virtual ~SvxBmpNumValueSet();
+ virtual void dispose() SAL_OVERRIDE;
virtual void UserDraw( const UserDrawEvent& rUDEvt ) SAL_OVERRIDE;
diff --git a/include/svx/optgrid.hxx b/include/svx/optgrid.hxx
index 02c74ca42b05..9aeee8d1c8c1 100644
--- a/include/svx/optgrid.hxx
+++ b/include/svx/optgrid.hxx
@@ -101,8 +101,10 @@ class SVX_DLLPUBLIC SvxGridTabPage : public SfxTabPage
public:
SvxGridTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
+ virtual ~SvxGridTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet& rAttrSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet& rAttrSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
@@ -111,30 +113,30 @@ public:
virtual sfxpg DeactivatePage( SfxItemSet* pSet ) SAL_OVERRIDE;
private:
- CheckBox* pCbxUseGridsnap;
- CheckBox* pCbxGridVisible;
+ VclPtr<CheckBox> pCbxUseGridsnap;
+ VclPtr<CheckBox> pCbxGridVisible;
- MetricField* pMtrFldDrawX;
- MetricField* pMtrFldDrawY;
+ VclPtr<MetricField> pMtrFldDrawX;
+ VclPtr<MetricField> pMtrFldDrawY;
- NumericField* pNumFldDivisionX;
- NumericField* pNumFldDivisionY;
+ VclPtr<NumericField> pNumFldDivisionX;
+ VclPtr<NumericField> pNumFldDivisionY;
- CheckBox* pCbxSynchronize;
+ VclPtr<CheckBox> pCbxSynchronize;
protected:
//these controls are used in draw and impress
- VclContainer* pSnapFrames;
- CheckBox* pCbxSnapHelplines;
- CheckBox* pCbxSnapBorder;
- CheckBox* pCbxSnapFrame;
- CheckBox* pCbxSnapPoints;
- MetricField* pMtrFldSnapArea;
-
- CheckBox* pCbxOrtho;
- CheckBox* pCbxBigOrtho;
- CheckBox* pCbxRotate;
- MetricField* pMtrFldAngle;
- MetricField* pMtrFldBezAngle;
+ VclPtr<VclContainer> pSnapFrames;
+ VclPtr<CheckBox> pCbxSnapHelplines;
+ VclPtr<CheckBox> pCbxSnapBorder;
+ VclPtr<CheckBox> pCbxSnapFrame;
+ VclPtr<CheckBox> pCbxSnapPoints;
+ VclPtr<MetricField> pMtrFldSnapArea;
+
+ VclPtr<CheckBox> pCbxOrtho;
+ VclPtr<CheckBox> pCbxBigOrtho;
+ VclPtr<CheckBox> pCbxRotate;
+ VclPtr<MetricField> pMtrFldAngle;
+ VclPtr<MetricField> pMtrFldBezAngle;
private:
bool bAttrModified;
diff --git a/include/svx/pagectrl.hxx b/include/svx/pagectrl.hxx
index 8b6da4dd29f0..007d4caf5634 100644
--- a/include/svx/pagectrl.hxx
+++ b/include/svx/pagectrl.hxx
@@ -89,6 +89,7 @@ protected:
public:
SvxPageWindow( vcl::Window* pParent );
virtual ~SvxPageWindow();
+ virtual void dispose() SAL_OVERRIDE;
//UUUU
void setHeaderFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes) { maHeaderFillAttributes = rFillAttributes; }
diff --git a/include/svx/passwd.hxx b/include/svx/passwd.hxx
index 920fa19c7c68..89fbbded5221 100644
--- a/include/svx/passwd.hxx
+++ b/include/svx/passwd.hxx
@@ -33,12 +33,12 @@
class SVX_DLLPUBLIC SvxPasswordDialog : public SfxModalDialog
{
private:
- FixedText* m_pOldFL;
- FixedText* m_pOldPasswdFT;
- Edit* m_pOldPasswdED;
- Edit* m_pNewPasswdED;
- Edit* m_pRepeatPasswdED;
- OKButton* m_pOKBtn;
+ VclPtr<FixedText> m_pOldFL;
+ VclPtr<FixedText> m_pOldPasswdFT;
+ VclPtr<Edit> m_pOldPasswdED;
+ VclPtr<Edit> m_pNewPasswdED;
+ VclPtr<Edit> m_pRepeatPasswdED;
+ VclPtr<OKButton> m_pOKBtn;
OUString aOldPasswdErrStr;
OUString aRepeatPasswdErrStr;
@@ -52,7 +52,8 @@ private:
public:
SvxPasswordDialog( vcl::Window* pParent, bool bAllowEmptyPasswords = false, bool bDisableOldPassword = false );
- virtual ~SvxPasswordDialog();
+ virtual ~SvxPasswordDialog();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetOldPassword() const { return m_pOldPasswdED->GetText(); }
OUString GetNewPassword() const { return m_pNewPasswdED->GetText(); }
diff --git a/include/svx/prtqry.hxx b/include/svx/prtqry.hxx
index afe6b9b6d85a..a2f4e9298262 100644
--- a/include/svx/prtqry.hxx
+++ b/include/svx/prtqry.hxx
@@ -26,7 +26,6 @@ class SVX_DLLPUBLIC SvxPrtQryBox : public MessBox
{
public:
SvxPrtQryBox(vcl::Window* pParent);
- virtual ~SvxPrtQryBox();
};
#endif
diff --git a/include/svx/rubydialog.hxx b/include/svx/rubydialog.hxx
index d0e9429501a2..4ea04bcd041d 100644
--- a/include/svx/rubydialog.hxx
+++ b/include/svx/rubydialog.hxx
@@ -44,10 +44,12 @@ class RubyPreview : public vcl::Window
{
protected:
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
- SvxRubyDialog* m_pParentDlg;
+ VclPtr<SvxRubyDialog> m_pParentDlg;
public:
RubyPreview(vcl::Window *pParent);
+ virtual ~RubyPreview();
+ virtual void dispose() SAL_OVERRIDE;
void setRubyDialog(SvxRubyDialog* pParentDlg)
{
m_pParentDlg = pParentDlg;
@@ -89,33 +91,33 @@ class SvxRubyDialog : public SfxModelessDialog
{
friend class RubyPreview;
- FixedText* m_pLeftFT;
- FixedText* m_pRightFT;
- RubyEdit* m_pLeft1ED;
- RubyEdit* m_pRight1ED;
- RubyEdit* m_pLeft2ED;
- RubyEdit* m_pRight2ED;
- RubyEdit* m_pLeft3ED;
- RubyEdit* m_pRight3ED;
- RubyEdit* m_pLeft4ED;
- RubyEdit* m_pRight4ED;
+ VclPtr<FixedText> m_pLeftFT;
+ VclPtr<FixedText> m_pRightFT;
+ VclPtr<RubyEdit> m_pLeft1ED;
+ VclPtr<RubyEdit> m_pRight1ED;
+ VclPtr<RubyEdit> m_pLeft2ED;
+ VclPtr<RubyEdit> m_pRight2ED;
+ VclPtr<RubyEdit> m_pLeft3ED;
+ VclPtr<RubyEdit> m_pRight3ED;
+ VclPtr<RubyEdit> m_pLeft4ED;
+ VclPtr<RubyEdit> m_pRight4ED;
- RubyEdit* aEditArr[8];
- VclScrolledWindow* m_pScrolledWindow;
- ScrollBar* m_pScrollSB;
+ VclPtr<RubyEdit> aEditArr[8];
+ VclPtr<VclScrolledWindow> m_pScrolledWindow;
+ VclPtr<ScrollBar> m_pScrollSB;
- ListBox* m_pAdjustLB;
+ VclPtr<ListBox> m_pAdjustLB;
- ListBox* m_pPositionLB;
+ VclPtr<ListBox> m_pPositionLB;
- FixedText* m_pCharStyleFT;
- ListBox* m_pCharStyleLB;
- PushButton* m_pStylistPB;
+ VclPtr<FixedText> m_pCharStyleFT;
+ VclPtr<ListBox> m_pCharStyleLB;
+ VclPtr<PushButton> m_pStylistPB;
- RubyPreview* m_pPreviewWin;
+ VclPtr<RubyPreview> m_pPreviewWin;
- PushButton* m_pApplyPB;
- PushButton* m_pClosePB;
+ VclPtr<PushButton> m_pApplyPB;
+ VclPtr<PushButton> m_pClosePB;
long nLastPos;
long nCurrentEdit;
@@ -143,7 +145,7 @@ class SvxRubyDialog : public SfxModelessDialog
void AssertOneEntry();
void Update();
- virtual bool Close() SAL_OVERRIDE;
+ virtual bool Close() SAL_OVERRIDE;
long GetLastPos() const {return nLastPos;}
void SetLastPos(long nSet) {nLastPos = nSet;}
@@ -163,6 +165,7 @@ public:
SvxRubyDialog(SfxBindings *pBindings, SfxChildWindow *pCW,
vcl::Window* pParent);
virtual ~SvxRubyDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Activate() SAL_OVERRIDE;
virtual void Deactivate() SAL_OVERRIDE;
diff --git a/include/svx/ruler.hxx b/include/svx/ruler.hxx
index 2cef64f3691d..007f4d89c378 100644
--- a/include/svx/ruler.hxx
+++ b/include/svx/ruler.hxx
@@ -57,7 +57,7 @@ class SVX_DLLPUBLIC SvxRuler: public Ruler, public SfxListener
std::unique_ptr<SvxColumnItem> mxColumnItem; // columns
std::unique_ptr<SvxObjectItem> mxObjectItem; // object
- vcl::Window* pEditWin;
+ VclPtr<vcl::Window> pEditWin;
std::unique_ptr<SvxRuler_Impl> mxRulerImpl;
@@ -254,6 +254,7 @@ public:
SvxRuler(vcl::Window* pParent, vcl::Window *pEditWin, sal_uInt16 nRulerFlags,
SfxBindings &rBindings, WinBits nWinStyle = WB_STDRULER);
virtual ~SvxRuler();
+ virtual void dispose() SAL_OVERRIDE;
void SetMinFrameSize(long lSize);
long GetMinFrameSize() const ;
diff --git a/include/svx/sdrpaintwindow.hxx b/include/svx/sdrpaintwindow.hxx
index 3a1f1ef7f986..d8f091885c95 100644
--- a/include/svx/sdrpaintwindow.hxx
+++ b/include/svx/sdrpaintwindow.hxx
@@ -50,10 +50,10 @@ PaintTransparentChildren(vcl::Window & rWindow, Rectangle const& rPixelRect);
class SdrPreRenderDevice
{
// The original OutputDevice
- OutputDevice& mrOutputDevice;
+ OutputDevice& mrOutputDevice;
// The VirtualDevice for PreRendering
- VirtualDevice maPreRenderDevice;
+ VclPtr<VirtualDevice> mpPreRenderDevice;
public:
explicit SdrPreRenderDevice(OutputDevice& rOriginal);
@@ -63,7 +63,7 @@ public:
void OutputPreRenderDevice(const vcl::Region& rExpandedRegion);
OutputDevice& GetOriginalOutputDevice() const { return mrOutputDevice; }
- OutputDevice& GetPreRenderDevice() { return maPreRenderDevice; }
+ OutputDevice& GetPreRenderDevice() { return *mpPreRenderDevice.get(); }
};
diff --git a/include/svx/sidebar/PanelLayout.hxx b/include/svx/sidebar/PanelLayout.hxx
index 6eac3d3eef90..82790a402e62 100644
--- a/include/svx/sidebar/PanelLayout.hxx
+++ b/include/svx/sidebar/PanelLayout.hxx
@@ -16,6 +16,7 @@
#include <vcl/ctrl.hxx>
#include <vcl/timer.hxx>
#include <vcl/idle.hxx>
+#include <vcl/vclptr.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/frame/XFrame.hpp>
@@ -34,6 +35,7 @@ public:
PanelLayout(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription,
const com::sun::star::uno::Reference<com::sun::star::frame::XFrame> &rFrame);
virtual ~PanelLayout();
+ virtual void dispose() SAL_OVERRIDE;
virtual Size GetOptimalSize() const SAL_OVERRIDE;
virtual void setPosSizePixel(long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags = WINDOW_POSSIZE_ALL) SAL_OVERRIDE;
diff --git a/include/svx/sidebar/Popup.hxx b/include/svx/sidebar/Popup.hxx
index 7f0d804f78c2..4fd74d14db8a 100644
--- a/include/svx/sidebar/Popup.hxx
+++ b/include/svx/sidebar/Popup.hxx
@@ -22,6 +22,9 @@
#include <svx/svxdllapi.h>
#include <rtl/ustring.hxx>
#include <tools/link.hxx>
+#include <vcl/vclptr.hxx>
+#include <svx/sidebar/PopupContainer.hxx>
+#include <svx/sidebar/PopupControl.hxx>
#include <boost/function.hpp>
@@ -30,9 +33,6 @@ class ToolBox;
namespace svx { namespace sidebar {
-class PopupContainer;
-class PopupControl;
-
/** A wrapper around a PopupContainer and a PopupControl object.
Usually used as drop down for a toolbox. Use Show() to start
drop down mode and Hide() to end it.
@@ -76,7 +76,7 @@ public :
void SetPopupModeEndHandler (const ::boost::function<void()>& rCallback);
protected:
- std::unique_ptr<PopupControl> mxControl;
+ VclPtr<PopupControl> mxControl;
/** Make sure that both PopupContainer and PopupControl objects
exist. Calls the maControlCreator functor if necessary.
@@ -89,11 +89,11 @@ protected:
void CreateContainerAndControl();
private:
- vcl::Window* mpParent;
- ::boost::function<PopupControl*(PopupContainer*)> maControlCreator;
+ VclPtr<vcl::Window> mpParent;
+ ::boost::function<VclPtr<PopupControl>(PopupContainer*)> maControlCreator;
::boost::function<void()> maPopupModeEndCallback;
const ::rtl::OUString msAccessibleName;
- std::unique_ptr<PopupContainer> mxContainer;
+ VclPtr<PopupContainer> mxContainer;
DECL_LINK(PopupModeEndHandler, void*);
};
diff --git a/include/svx/sidebar/PopupControl.hxx b/include/svx/sidebar/PopupControl.hxx
index 32658b3ae4d7..626e7074501d 100644
--- a/include/svx/sidebar/PopupControl.hxx
+++ b/include/svx/sidebar/PopupControl.hxx
@@ -38,7 +38,6 @@ public :
PopupControl (
vcl::Window* pParent,
const ResId& rResId);
- virtual ~PopupControl();
virtual void Paint (const Rectangle& rect) SAL_OVERRIDE;
};
diff --git a/include/svx/sidebar/SidebarDialControl.hxx b/include/svx/sidebar/SidebarDialControl.hxx
index 1d829d27fe76..52d798e2ab89 100644
--- a/include/svx/sidebar/SidebarDialControl.hxx
+++ b/include/svx/sidebar/SidebarDialControl.hxx
@@ -29,7 +29,6 @@ class SVX_DLLPUBLIC SidebarDialControl : public svx::DialControl
{
public:
SidebarDialControl (vcl::Window* pParent, WinBits nBits = 0);
- virtual ~SidebarDialControl();
virtual Size GetOptimalSize() const SAL_OVERRIDE;
virtual void MouseButtonDown (const MouseEvent& rMEvt) SAL_OVERRIDE;
diff --git a/include/svx/sidebar/ValueSetWithTextControl.hxx b/include/svx/sidebar/ValueSetWithTextControl.hxx
index e6724b278c9c..e0c941d19645 100644
--- a/include/svx/sidebar/ValueSetWithTextControl.hxx
+++ b/include/svx/sidebar/ValueSetWithTextControl.hxx
@@ -52,8 +52,6 @@ public:
vcl::Window* pParent,
const ResId& rResId);
- virtual ~ValueSetWithTextControl();
-
// add item for control type IMAGE_TEXT
// if control type does not match IMAGE_TEXT no item is added.
// @param pSelectedItemImage
diff --git a/include/svx/srchdlg.hxx b/include/svx/srchdlg.hxx
index 5750ca0857da..ec241902877b 100644
--- a/include/svx/srchdlg.hxx
+++ b/include/svx/srchdlg.hxx
@@ -89,7 +89,7 @@ enum SearchLabel
class SvxSearchDialog;
class SVX_DLLPUBLIC SvxSearchDialogWrapper : public SfxChildWindow
{
- SvxSearchDialog *dialog;
+ VclPtr<SvxSearchDialog> dialog;
public:
SvxSearchDialogWrapper( vcl::Window*pParent, sal_uInt16 nId,
SfxBindings* pBindings, SfxChildWinInfo* pInfo );
@@ -120,6 +120,7 @@ friend class SvxJSearchOptionsDialog;
public:
SvxSearchDialog( vcl::Window* pParent, SfxChildWindow* pChildWin, SfxBindings& rBind );
virtual ~SvxSearchDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool Close() SAL_OVERRIDE;
@@ -150,57 +151,57 @@ public:
void SetSearchLabel(const OUString& rStr) { m_pSearchLabel->SetText(rStr); }
private:
- vcl::Window* mpDocWin;
+ VclPtr<vcl::Window> mpDocWin;
bool mbSuccess;
- VclFrame* m_pSearchFrame;
- ComboBox* m_pSearchLB;
- ListBox* m_pSearchTmplLB;
- FixedText* m_pSearchAttrText;
- FixedText* m_pSearchLabel;
-
- VclFrame* m_pReplaceFrame;
- ComboBox* m_pReplaceLB;
- ListBox* m_pReplaceTmplLB;
- FixedText* m_pReplaceAttrText;
-
- PushButton* m_pSearchBtn;
- PushButton* m_pSearchAllBtn;
- PushButton* m_pReplaceBtn;
- PushButton* m_pReplaceAllBtn;
-
- VclFrame* m_pComponentFrame;
- PushButton* m_pSearchComponent1PB;
- PushButton* m_pSearchComponent2PB;
-
- CheckBox* m_pMatchCaseCB;
- CheckBox* m_pWordBtn;
-
- PushButton* m_pCloseBtn;
- CheckBox* m_pIgnoreDiacritics;
- CheckBox* m_pIgnoreKashida;
- CheckBox* m_pSelectionBtn;
- CheckBox* m_pBackwardsBtn;
- CheckBox* m_pRegExpBtn;
- CheckBox* m_pSimilarityBox;
- PushButton* m_pSimilarityBtn;
- CheckBox* m_pLayoutBtn;
- CheckBox* m_pNotesBtn;
- CheckBox* m_pJapMatchFullHalfWidthCB;
- CheckBox* m_pJapOptionsCB;
- PushButton* m_pJapOptionsBtn;
-
- PushButton* m_pAttributeBtn;
- PushButton* m_pFormatBtn;
- PushButton* m_pNoFormatBtn;
-
- VclContainer* m_pCalcGrid;
- FixedText* m_pCalcSearchInFT;
- ListBox* m_pCalcSearchInLB;
- FixedText* m_pCalcSearchDirFT;
- RadioButton* m_pRowsBtn;
- RadioButton* m_pColumnsBtn;
- CheckBox* m_pAllSheetsCB;
+ VclPtr<VclFrame> m_pSearchFrame;
+ VclPtr<ComboBox> m_pSearchLB;
+ VclPtr<ListBox> m_pSearchTmplLB;
+ VclPtr<FixedText> m_pSearchAttrText;
+ VclPtr<FixedText> m_pSearchLabel;
+
+ VclPtr<VclFrame> m_pReplaceFrame;
+ VclPtr<ComboBox> m_pReplaceLB;
+ VclPtr<ListBox> m_pReplaceTmplLB;
+ VclPtr<FixedText> m_pReplaceAttrText;
+
+ VclPtr<PushButton> m_pSearchBtn;
+ VclPtr<PushButton> m_pSearchAllBtn;
+ VclPtr<PushButton> m_pReplaceBtn;
+ VclPtr<PushButton> m_pReplaceAllBtn;
+
+ VclPtr<VclFrame> m_pComponentFrame;
+ VclPtr<PushButton> m_pSearchComponent1PB;
+ VclPtr<PushButton> m_pSearchComponent2PB;
+
+ VclPtr<CheckBox> m_pMatchCaseCB;
+ VclPtr<CheckBox> m_pWordBtn;
+
+ VclPtr<PushButton> m_pCloseBtn;
+ VclPtr<CheckBox> m_pIgnoreDiacritics;
+ VclPtr<CheckBox> m_pIgnoreKashida;
+ VclPtr<CheckBox> m_pSelectionBtn;
+ VclPtr<CheckBox> m_pBackwardsBtn;
+ VclPtr<CheckBox> m_pRegExpBtn;
+ VclPtr<CheckBox> m_pSimilarityBox;
+ VclPtr<PushButton> m_pSimilarityBtn;
+ VclPtr<CheckBox> m_pLayoutBtn;
+ VclPtr<CheckBox> m_pNotesBtn;
+ VclPtr<CheckBox> m_pJapMatchFullHalfWidthCB;
+ VclPtr<CheckBox> m_pJapOptionsCB;
+ VclPtr<PushButton> m_pJapOptionsBtn;
+
+ VclPtr<PushButton> m_pAttributeBtn;
+ VclPtr<PushButton> m_pFormatBtn;
+ VclPtr<PushButton> m_pNoFormatBtn;
+
+ VclPtr<VclContainer> m_pCalcGrid;
+ VclPtr<FixedText> m_pCalcSearchInFT;
+ VclPtr<ListBox> m_pCalcSearchInLB;
+ VclPtr<FixedText> m_pCalcSearchDirFT;
+ VclPtr<RadioButton> m_pRowsBtn;
+ VclPtr<RadioButton> m_pColumnsBtn;
+ VclPtr<CheckBox> m_pAllSheetsCB;
SfxBindings& rBindings;
bool bWriter;
diff --git a/include/svx/stddlg.hxx b/include/svx/stddlg.hxx
index 85cdf46c5b52..a3e3df05f628 100644
--- a/include/svx/stddlg.hxx
+++ b/include/svx/stddlg.hxx
@@ -28,7 +28,6 @@ class SVX_DLLPUBLIC SvxStandardDialog: public SfxModalDialog
{
public:
SvxStandardDialog( vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription );
- virtual ~SvxStandardDialog();
short Execute() SAL_OVERRIDE;
diff --git a/include/svx/subtoolboxcontrol.hxx b/include/svx/subtoolboxcontrol.hxx
index e7f2904a456f..7921a270f405 100644
--- a/include/svx/subtoolboxcontrol.hxx
+++ b/include/svx/subtoolboxcontrol.hxx
@@ -36,7 +36,7 @@ public:
virtual ~SvxSubToolBoxControl();
virtual SfxPopupWindowType GetPopupWindowType() const SAL_OVERRIDE;
- virtual SfxPopupWindow* CreatePopupWindow() SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> CreatePopupWindow() SAL_OVERRIDE;
};
diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx
index 08231959c61f..ed0ce097989c 100644
--- a/include/svx/svdedxv.hxx
+++ b/include/svx/svdedxv.hxx
@@ -65,12 +65,12 @@ protected:
SdrPageView* pTextEditPV;
SdrOutliner* pTextEditOutliner; // outliner for the TextEdit
OutlinerView* pTextEditOutlinerView; // current view of the outliners
- vcl::Window* pTextEditWin; // matching window to pTextEditOutlinerView
+ VclPtr<vcl::Window> pTextEditWin; // matching window to pTextEditOutlinerView
vcl::Cursor* pTextEditCursorMerker; // to restore the cursor in each window
ImpSdrEditPara* pEditPara; // trashbin for everything else to stay compatible
SdrObject* pMacroObj;
SdrPageView* pMacroPV;
- vcl::Window* pMacroWin;
+ VclPtr<vcl::Window> pMacroWin;
Rectangle aTextEditArea;
Rectangle aMinTextEditArea;
diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx
index 917182aface2..ea9e4c222919 100644
--- a/include/svx/svdmodel.hxx
+++ b/include/svx/svdmodel.hxx
@@ -170,7 +170,7 @@ protected:
SdrOutliner* pDrawOutliner; // an Outliner for outputting text
SdrOutliner* pHitTestOutliner;// an Outliner for the HitTest
sal_uIntPtr nDefTextHgt; // Default text heigth in logical units
- OutputDevice* pRefOutDev; // ReferenceDevice for the EditEngine
+ VclPtr<OutputDevice> pRefOutDev; // ReferenceDevice for the EditEngine
/// Set if we are doing tiled rendering.
bool mbTiledRendering;
LibreOfficeKitCallback mpLibreOfficeKitCallback;
@@ -335,7 +335,7 @@ public:
// ReferenceDevice for the EditEngine
void SetRefDevice(OutputDevice* pDev);
- OutputDevice* GetRefDevice() const { return pRefOutDev; }
+ OutputDevice* GetRefDevice() const { return pRefOutDev.get(); }
/// Set if we are doing tiled rendering.
void setTiledRendering(bool bTiledRendering);
/// Are we doing tiled rendering?
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index ffa7f29ea5fb..74b5a18ee290 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -24,6 +24,7 @@
#include <com/sun/star/uno/Any.hxx>
#include <cppuhelper/weakref.hxx>
#include <rtl/ustring.hxx>
+#include <vcl/vclptr.hxx>
#include <svl/lstner.hxx>
#include <svl/poolitem.hxx>
#include <svx/svdtypes.hxx>
@@ -174,7 +175,7 @@ class SVX_DLLPUBLIC SdrObjMacroHitRec
public:
Point aPos;
Point aDownPos;
- OutputDevice* pOut;
+ VclPtr<OutputDevice> pOut;
const SetOfByte* pVisiLayer;
const SdrPageView* pPageView;
sal_uInt16 nTol;
diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx
index f228a1c308f1..cdb2ea62c7ba 100644
--- a/include/svx/svdpntv.hxx
+++ b/include/svx/svdpntv.hxx
@@ -134,10 +134,10 @@ class SVX_DLLPUBLIC SdrPaintView : public SfxListener, public SfxRepeatTarget, p
protected:
SdrModel* pMod;
#ifdef DBG_UTIL
- SdrItemBrowser* pItemBrowser;
+ VclPtr<SdrItemBrowser> pItemBrowser;
#endif
- const OutputDevice* pActualOutDev; // Nur zum vergleichen
- OutputDevice* pDragWin;
+ VclPtr<OutputDevice> pActualOutDev; // Nur zum vergleichen
+ VclPtr<OutputDevice> pDragWin;
SfxStyleSheet* pDefaultStyleSheet;
OUString aAktLayer; // Aktueller Zeichenlayer
@@ -517,7 +517,7 @@ public:
// bei bShow=sal_False wird der Browser destruiert
#ifdef DBG_UTIL
void ShowItemBrowser(bool bShow=true);
- bool IsItemBrowserVisible() const { return pItemBrowser!=NULL && GetItemBrowser()->IsVisible(); }
+ bool IsItemBrowserVisible() const { return pItemBrowser!=nullptr && GetItemBrowser()->IsVisible(); }
vcl::Window* GetItemBrowser() const;
#endif
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index 080c807aa562..87ada7aa6c11 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -42,8 +42,8 @@ namespace linguistic2{
}}}}
class SvxSpellWrapper;
-typedef SfxTabPage* (*CreateSvxDistributePage)(vcl::Window *pParent, const SfxItemSet &rAttrSet, SvxDistributeHorizontal eHor, SvxDistributeVertical eVer);
-typedef const sal_uInt16* (*DialogGetRanges)();
+typedef VclPtr<SfxTabPage> (*CreateSvxDistributePage)(vcl::Window *pParent, const SfxItemSet &rAttrSet, SvxDistributeHorizontal eHor, SvxDistributeVertical eVer);
+typedef const sal_uInt16* (*DialogGetRanges)();
struct ExchangeData;
class INetURLObject;
diff --git a/include/svx/swframeexample.hxx b/include/svx/swframeexample.hxx
index 45bb9098c83a..494c241f74e9 100644
--- a/include/svx/swframeexample.hxx
+++ b/include/svx/swframeexample.hxx
@@ -74,7 +74,6 @@ protected:
public:
SvxSwFrameExample(vcl::Window* pParent, WinBits nStyle);
- virtual ~SvxSwFrameExample();
inline void SetWrap(sal_uInt16 nW) { nWrap = nW; }
diff --git a/include/svx/tbcontrl.hxx b/include/svx/tbcontrl.hxx
index 329bb208145b..42c79454ee20 100644
--- a/include/svx/tbcontrl.hxx
+++ b/include/svx/tbcontrl.hxx
@@ -163,7 +163,7 @@ public:
SvxStyleToolBoxControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rToolBox);
virtual ~SvxStyleToolBoxControl();
- virtual vcl::Window* CreateItemWindow(vcl::Window* pParent) SAL_OVERRIDE;
+ virtual VclPtr<vcl::Window> CreateItemWindow(vcl::Window* pParent) SAL_OVERRIDE;
virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState) SAL_OVERRIDE;
@@ -210,7 +210,7 @@ public:
virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState) SAL_OVERRIDE;
- virtual vcl::Window* CreateItemWindow(vcl::Window* pParent) SAL_OVERRIDE;
+ virtual VclPtr<vcl::Window> CreateItemWindow(vcl::Window* pParent) SAL_OVERRIDE;
};
class BorderColorStatus
@@ -242,7 +242,7 @@ public:
virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState) SAL_OVERRIDE;
virtual SfxPopupWindowType GetPopupWindowType() const SAL_OVERRIDE;
- virtual SfxPopupWindow* CreatePopupWindow() SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> CreatePopupWindow() SAL_OVERRIDE;
virtual void Select(sal_uInt16 nSelectModifier) SAL_OVERRIDE;
};
@@ -253,7 +253,7 @@ public:
SvxFrameToolBoxControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rToolBox);
virtual SfxPopupWindowType GetPopupWindowType() const SAL_OVERRIDE;
- virtual SfxPopupWindow* CreatePopupWindow() SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> CreatePopupWindow() SAL_OVERRIDE;
virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState) SAL_OVERRIDE;
};
@@ -265,7 +265,7 @@ public:
SvxFrameLineStyleToolBoxControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rToolBox);
virtual SfxPopupWindowType GetPopupWindowType() const SAL_OVERRIDE;
- virtual SfxPopupWindow* CreatePopupWindow() SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> CreatePopupWindow() SAL_OVERRIDE;
virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState) SAL_OVERRIDE;
};
diff --git a/include/svx/tbxalign.hxx b/include/svx/tbxalign.hxx
index 00a98d1eaf80..71322ee67bcf 100644
--- a/include/svx/tbxalign.hxx
+++ b/include/svx/tbxalign.hxx
@@ -32,7 +32,7 @@ public:
virtual void SAL_CALL updateImage() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual SfxPopupWindowType GetPopupWindowType() const SAL_OVERRIDE;
- virtual SfxPopupWindow* CreatePopupWindow() SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> CreatePopupWindow() SAL_OVERRIDE;
SFX_DECL_TOOLBOX_CONTROL();
diff --git a/include/svx/tbxcolorupdate.hxx b/include/svx/tbxcolorupdate.hxx
index 343d0fe768f5..9f00d1386a64 100644
--- a/include/svx/tbxcolorupdate.hxx
+++ b/include/svx/tbxcolorupdate.hxx
@@ -24,6 +24,7 @@
#include <tools/gen.hxx>
#include <tools/color.hxx>
+#include <vcl/vclptr.hxx>
class ToolBox;
class VirtualDevice;
@@ -44,8 +45,8 @@ namespace svx
{
public:
ToolboxButtonColorUpdater( sal_uInt16 nSlotId,
- sal_uInt16 nTbxBtnId,
- ToolBox* ptrTbx);
+ sal_uInt16 nTbxBtnId,
+ ToolBox* ptrTbx);
~ToolboxButtonColorUpdater();
void Update( const Color& rColor );
@@ -53,7 +54,7 @@ namespace svx
private:
sal_uInt16 mnBtnId;
sal_uInt16 mnSlotId;
- ToolBox* mpTbx;
+ VclPtr<ToolBox> mpTbx;
Color maCurColor;
Rectangle maUpdRect;
Size maBmpSize;
diff --git a/include/svx/tbxcustomshapes.hxx b/include/svx/tbxcustomshapes.hxx
index c4ebc1b5dd9f..2be1ac8807c9 100644
--- a/include/svx/tbxcustomshapes.hxx
+++ b/include/svx/tbxcustomshapes.hxx
@@ -35,7 +35,7 @@ public:
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState ) SAL_OVERRIDE;
virtual SfxPopupWindowType GetPopupWindowType() const SAL_OVERRIDE;
- virtual SfxPopupWindow* CreatePopupWindow() SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> CreatePopupWindow() SAL_OVERRIDE;
SFX_DECL_TOOLBOX_CONTROL();
diff --git a/include/svx/txencbox.hxx b/include/svx/txencbox.hxx
index e0df5adeef38..43f028bcaae7 100644
--- a/include/svx/txencbox.hxx
+++ b/include/svx/txencbox.hxx
@@ -35,6 +35,7 @@ private:
public:
SvxTextEncodingBox( vcl::Window* pParent, WinBits nBits );
virtual ~SvxTextEncodingBox();
+ virtual void dispose() SAL_OVERRIDE;
/** Fill with all known encodings but exclude those matching one or more
given flags as defined in rtl/tencinfo.h
diff --git a/include/toolkit/awt/scrollabledialog.hxx b/include/toolkit/awt/scrollabledialog.hxx
index e75fac70b0ed..70e2b32be919 100644
--- a/include/toolkit/awt/scrollabledialog.hxx
+++ b/include/toolkit/awt/scrollabledialog.hxx
@@ -43,8 +43,8 @@ namespace toolkit
template < class T >
class ScrollableWrapper : public T, public ScrollableInterface
{
- ScrollBar maHScrollBar;
- ScrollBar maVScrollBar;
+ VclPtr<ScrollBar> maHScrollBar;
+ VclPtr<ScrollBar> maVScrollBar;
Size maScrollArea;
bool mbHasHoriBar;
bool mbHasVertBar;
@@ -59,6 +59,7 @@ namespace toolkit
public:
ScrollableWrapper( vcl::Window* pParent, WinBits nStyle = WB_STDDIALOG );
virtual ~ScrollableWrapper();
+ virtual void dispose() SAL_OVERRIDE;
virtual void SetScrollWidth( long nWidth ) SAL_OVERRIDE;
virtual long GetScrollWidth() SAL_OVERRIDE { return maScrollArea.Width(); }
virtual void SetScrollHeight( long nHeight ) SAL_OVERRIDE;
diff --git a/include/toolkit/awt/vclxaccessiblecomponent.hxx b/include/toolkit/awt/vclxaccessiblecomponent.hxx
index 62d167ba10f1..0fdc2a8f083f 100644
--- a/include/toolkit/awt/vclxaccessiblecomponent.hxx
+++ b/include/toolkit/awt/vclxaccessiblecomponent.hxx
@@ -33,6 +33,7 @@
#include <comphelper/accessiblecomponenthelper.hxx>
#include <tools/link.hxx>
+#include <vcl/vclptr.hxx>
namespace vcl { class Window; }
class VCLXWindow;
@@ -83,7 +84,11 @@ public:
virtual ~VCLXAccessibleComponent();
VCLXWindow* GetVCLXWindow() const { return mpVCLXindow; }
- vcl::Window* GetWindow() const;
+ VclPtr<vcl::Window> GetWindow() const;
+ template< class derived_type > VclPtr< derived_type > GetAs() const {
+ return VclPtr< derived_type >( static_cast< derived_type * >( GetWindow().get() ) ); }
+ template< class derived_type > VclPtr< derived_type > GetAsDynamic() const {
+ return VclPtr< derived_type >( dynamic_cast< derived_type * >( GetWindow().get() ) ); }
virtual void SAL_CALL disposing() SAL_OVERRIDE;
diff --git a/include/toolkit/awt/vclxdevice.hxx b/include/toolkit/awt/vclxdevice.hxx
index 61d568911b38..47a99ea1995e 100644
--- a/include/toolkit/awt/vclxdevice.hxx
+++ b/include/toolkit/awt/vclxdevice.hxx
@@ -27,43 +27,40 @@
#include <cppuhelper/weak.hxx>
#include <osl/mutex.hxx>
#include <vcl/virdev.hxx>
+#include <vcl/vclptr.hxx>
#include <com/sun/star/awt/XUnitConversion.hpp>
class OutputDevice;
class VirtualDevice;
-
-// class VCLXDevice
-
-
// For using nDummy, no incompatible update, add a sal_Bool bCreatedWithToolkitMember later...
#define FLAGS_CREATEDWITHTOOLKIT 0x00000001
-class TOOLKIT_DLLPUBLIC VCLXDevice : public ::com::sun::star::awt::XDevice,
+/// An UNO wrapper for the VCL OutputDevice
+class TOOLKIT_DLLPUBLIC VCLXDevice :
+ public ::com::sun::star::awt::XDevice,
public ::com::sun::star::lang::XTypeProvider,
public ::com::sun::star::lang::XUnoTunnel,
public ::com::sun::star::awt::XUnitConversion,
public ::cppu::OWeakObject
{
friend class VCLXGraphics;
+ friend class VCLXVirtualDevice;
private:
- OutputDevice* mpOutputDevice;
+ VclPtr<OutputDevice> mpOutputDevice;
public:
void* pDummy;
sal_uInt32 nFlags;
-protected:
- void DestroyOutputDevice();
-
public:
VCLXDevice();
virtual ~VCLXDevice();
- void SetOutputDevice( OutputDevice* pOutDev ) { mpOutputDevice = pOutDev; }
- OutputDevice* GetOutputDevice() const { return mpOutputDevice; }
+ void SetOutputDevice( const VclPtr<OutputDevice> &pOutDev ) { mpOutputDevice = pOutDev; }
+ VclPtr<OutputDevice> GetOutputDevice() const { return mpOutputDevice; }
void SetCreatedWithToolkit( bool bCreatedWithToolkit );
diff --git a/include/toolkit/awt/vclxgraphics.hxx b/include/toolkit/awt/vclxgraphics.hxx
index 627b6759f43b..89a568fe6fa9 100644
--- a/include/toolkit/awt/vclxgraphics.hxx
+++ b/include/toolkit/awt/vclxgraphics.hxx
@@ -31,6 +31,7 @@
#include <vcl/font.hxx>
#include <tools/color.hxx>
#include <vcl/vclenum.hxx>
+#include <vcl/vclptr.hxx>
class OutputDevice;
namespace vcl { class Region; }
@@ -55,7 +56,7 @@ private:
// used to return same reference on each call to getDevice()
::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice> mxDevice;
- OutputDevice* mpOutputDevice;
+ VclPtr<OutputDevice> mpOutputDevice;
vcl::Font maFont;
Color maTextColor;
Color maTextFillColor;
diff --git a/include/toolkit/awt/vclxprinter.hxx b/include/toolkit/awt/vclxprinter.hxx
index 892cc4cb0839..a63f7746911d 100644
--- a/include/toolkit/awt/vclxprinter.hxx
+++ b/include/toolkit/awt/vclxprinter.hxx
@@ -57,11 +57,11 @@ class VCLXPrinterPropertySet :public VCLXPrinterPropertySet_Base
,public ::cppu::OPropertySetHelper
{
protected:
- std::shared_ptr<Printer> mxPrinter;
+ VclPtr<Printer> mxPrinter;
::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > mxPrnDevice;
sal_Int16 mnOrientation;
- bool mbHorizontal;
+ bool mbHorizontal;
public:
VCLXPrinterPropertySet( const OUString& rPrinterName );
virtual ~VCLXPrinterPropertySet();
diff --git a/include/toolkit/awt/vclxwindow.hxx b/include/toolkit/awt/vclxwindow.hxx
index 6306ce6717e3..1ab1f9e8a8d2 100644
--- a/include/toolkit/awt/vclxwindow.hxx
+++ b/include/toolkit/awt/vclxwindow.hxx
@@ -128,8 +128,12 @@ public:
VCLXWindow( bool bWithDefaultProps = false );
virtual ~VCLXWindow();
- virtual void SetWindow( vcl::Window* pWindow );
- vcl::Window* GetWindow() const { return static_cast<vcl::Window*>(GetOutputDevice()); }
+ virtual void SetWindow( const VclPtr< vcl::Window > &pWindow );
+ template< class derived_type > VclPtr< derived_type > GetAs() const {
+ return VclPtr< derived_type >( static_cast< derived_type * >( GetOutputDevice().get() ) ); }
+ template< class derived_type > VclPtr< derived_type > GetAsDynamic() const {
+ return VclPtr< derived_type >( dynamic_cast< derived_type * >( GetOutputDevice().get() ) ); }
+ VclPtr<vcl::Window> GetWindow() const { return GetAs<vcl::Window>(); }
void suspendVclEventListening( );
void resumeVclEventListening( );
diff --git a/include/toolkit/controls/accessiblecontrolcontext.hxx b/include/toolkit/controls/accessiblecontrolcontext.hxx
index 78fdfe7cc4d8..b991b80793f3 100644
--- a/include/toolkit/controls/accessiblecontrolcontext.hxx
+++ b/include/toolkit/controls/accessiblecontrolcontext.hxx
@@ -26,6 +26,7 @@
#include <com/sun/star/lang/XEventListener.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/awt/XWindow.hpp>
+#include <vcl/vclptr.hxx>
namespace vcl { class Window; }
@@ -116,7 +117,7 @@ namespace toolkit
// stops listening at the control model
void stopModelListening( );
- vcl::Window* implGetWindow( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >* _pxUNOWindow = NULL ) const;
+ VclPtr< vcl::Window > implGetWindow( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >* _pxUNOWindow = NULL ) const;
};
diff --git a/include/toolkit/helper/vclunohelper.hxx b/include/toolkit/helper/vclunohelper.hxx
index dc1ae888476f..c902e5c9155c 100644
--- a/include/toolkit/helper/vclunohelper.hxx
+++ b/include/toolkit/helper/vclunohelper.hxx
@@ -56,11 +56,12 @@ namespace com { namespace sun { namespace star { namespace awt {
#include <vcl/bitmapex.hxx>
#include <vcl/region.hxx>
#include <vcl/metric.hxx>
+#include <vcl/vclptr.hxx>
+#include <vcl/window.hxx>
#include <tools/mapunit.hxx>
#include <tools/fldunit.hxx>
#include <tools/poly.hxx>
-namespace vcl { class Window; }
class OutputDevice;
class MouseEvent;
class KeyEvent;
@@ -79,9 +80,9 @@ public:
static ::com::sun::star::uno::Reference< ::com::sun::star::awt::XBitmap> CreateBitmap( const BitmapEx& rBitmap );
// Window
- static vcl::Window* GetWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow>& rxWindow );
- static vcl::Window* GetWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow2>& rxWindow2 );
- static vcl::Window* GetWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer>& rxWindowPeer );
+ static VclPtr< vcl::Window > GetWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow>& rxWindow );
+ static VclPtr< vcl::Window > GetWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow2>& rxWindow2 );
+ static VclPtr< vcl::Window > GetWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer>& rxWindowPeer );
static ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow> GetInterface( vcl::Window* pWindow );
// OutputDevice
diff --git a/include/tools/errinf.hxx b/include/tools/errinf.hxx
index a16b56a179f4..4a9f07a69d62 100644
--- a/include/tools/errinf.hxx
+++ b/include/tools/errinf.hxx
@@ -28,9 +28,11 @@
#include <tools/errcode.hxx>
#include <tools/toolsdllapi.h>
+// FIXME: horrible legacy dependency on VCL from tools.
+namespace vcl { class Window; }
+
class EDcr_Impl;
class ErrHdl_Impl;
-namespace vcl { class Window; }
class ErrorInfo
{
@@ -115,20 +117,20 @@ private:
OUString aArg;
};
+struct ErrorContextImpl;
class TOOLS_DLLPUBLIC ErrorContext
{
friend class ErrorHandler;
private:
- ErrorContext* pNext;
- vcl::Window* pWin;
+ ErrorContextImpl *pImpl;
public:
ErrorContext(vcl::Window *pWin=0);
virtual ~ErrorContext();
virtual bool GetString( sal_uIntPtr nErrId, OUString& rCtxStr ) = 0;
- vcl::Window* GetParent() { return pWin; }
+ vcl::Window* GetParent();
static ErrorContext* GetContext();
};
diff --git a/include/vcl/animate.hxx b/include/vcl/animate.hxx
index e966e3feac81..17d62a1a3d1a 100644
--- a/include/vcl/animate.hxx
+++ b/include/vcl/animate.hxx
@@ -23,6 +23,7 @@
#include <vcl/dllapi.h>
#include <vcl/timer.hxx>
#include <vcl/bitmapex.hxx>
+#include <vcl/vclptr.hxx>
#define ANIMATION_TIMEOUT_ON_CLICK 2147483647L
@@ -108,17 +109,13 @@ struct AInfo
Point aLastSavePoint;
Point aStartOrg;
Size aStartSize;
- OutputDevice* pOutDev;
+ VclPtr<OutputDevice> pOutDev;
void* pViewData;
long nExtraData;
bool bWithSize;
bool bPause;
- AInfo() : pOutDev( NULL ),
- pViewData( NULL ),
- nExtraData( 0L ),
- bWithSize( false ),
- bPause( false ) {}
+ AInfo();
};
class ImplAnimView;
diff --git a/include/vcl/btndlg.hxx b/include/vcl/btndlg.hxx
index fc51c15b95d1..c7fdab639d1b 100644
--- a/include/vcl/btndlg.hxx
+++ b/include/vcl/btndlg.hxx
@@ -40,6 +40,7 @@ class VCL_DLLPUBLIC ButtonDialog : public Dialog
public:
ButtonDialog( vcl::Window* pParent, WinBits nStyle = WB_STDDIALOG );
virtual ~ButtonDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx
index 011d45e14399..4b7683d467ae 100644
--- a/include/vcl/builder.hxx
+++ b/include/vcl/builder.hxx
@@ -17,6 +17,7 @@
#include <tools/fldunit.hxx>
#include <vcl/dllapi.h>
#include <vcl/window.hxx>
+#include <vcl/vclptr.hxx>
#include <map>
#include <set>
#include <stack>
@@ -45,6 +46,7 @@ class VCL_DLLPUBLIC VclBuilder
{
public:
typedef std::map<OString, OString> stringmap;
+ /// These functions return a vcl::Window with a reference count of one.
typedef vcl::Window* (*customMakeWidget)(vcl::Window *pParent, stringmap &rVec);
public:
@@ -56,8 +58,11 @@ public:
const css::uno::Reference<css::frame::XFrame> &rFrame = css::uno::Reference<css::frame::XFrame>());
~VclBuilder();
+ ///releases references and disposes all children.
+ void disposeBuilder();
+
//sID must exist and be of type T
- template <typename T> T* get(T*& ret, const OString& sID);
+ template <typename T> T* get(VclPtr<T>& ret, const OString& sID);
//sID may not exist, but must be of type T if it does
template <typename T /*= vcl::Window if we had c++11*/> T* get(const OString& sID);
@@ -73,7 +78,7 @@ public:
short get_response(const vcl::Window *pWindow) const;
OString get_by_window(const vcl::Window *pWindow) const;
- void delete_by_window(const vcl::Window *pWindow);
+ void delete_by_window(vcl::Window *pWindow);
//release ownership of pWindow, i.e. don't delete it
void drop_ownership(const vcl::Window *pWindow);
@@ -147,7 +152,7 @@ private:
struct WinAndId
{
OString m_sID;
- vcl::Window *m_pWindow;
+ VclPtr<vcl::Window> m_pWindow;
short m_nResponseId;
PackingData m_aPackingData;
WinAndId(const OString &rId, vcl::Window *pWindow, bool bVertical)
@@ -263,7 +268,7 @@ private:
}
};
- typedef std::map< vcl::Window*, stringmap> AtkMap;
+ typedef std::map< VclPtr<vcl::Window>, stringmap> AtkMap;
struct ParserState
{
@@ -290,7 +295,7 @@ private:
Translations m_aTranslations;
- std::map< vcl::Window*, vcl::Window*> m_aRedundantParentWidgets;
+ std::map< VclPtr<vcl::Window>, VclPtr<vcl::Window> > m_aRedundantParentWidgets;
std::vector<SizeGroup> m_aSizeGroups;
@@ -298,13 +303,11 @@ private:
std::vector<MnemonicWidgetMap> m_aMnemonicWidgetMaps;
- std::vector<VclExpander*> m_aExpanderWidgets;
+ std::vector< VclPtr<VclExpander> > m_aExpanderWidgets;
sal_uInt16 m_nLastToolbarId;
- ParserState()
- : m_nLastToolbarId(0)
- {}
+ ParserState();
};
void loadTranslations(const LanguageTag &rLanguageTag, const OUString &rUri);
@@ -313,7 +316,7 @@ private:
OString m_sID;
OString m_sHelpRoot;
ResHookProc m_pStringReplace;
- vcl::Window *m_pParent;
+ VclPtr<vcl::Window> m_pParent;
bool m_bToplevelHasDeferredInit;
bool m_bToplevelHasDeferredProperties;
bool m_bToplevelParentFound;
@@ -339,12 +342,12 @@ private:
css::uno::Reference<css::frame::XFrame> m_xFrame;
private:
- vcl::Window *insertObject(vcl::Window *pParent,
+ VclPtr<vcl::Window> insertObject(vcl::Window *pParent,
const OString &rClass, const OString &rID,
stringmap &rProps, stringmap &rPangoAttributes,
stringmap &rAtkProps);
- vcl::Window *makeObject(vcl::Window *pParent,
+ VclPtr<vcl::Window> makeObject(vcl::Window *pParent,
const OString &rClass, const OString &rID,
stringmap &rVec);
@@ -363,7 +366,7 @@ private:
void handleTranslations(xmlreader::XmlReader &reader);
void handleChild(vcl::Window *pParent, xmlreader::XmlReader &reader);
- vcl::Window* handleObject(vcl::Window *pParent, xmlreader::XmlReader &reader);
+ VclPtr<vcl::Window> handleObject(vcl::Window *pParent, xmlreader::XmlReader &reader);
void handlePacking(vcl::Window *pCurrent, vcl::Window *pParent, xmlreader::XmlReader &reader);
void applyPackingProperty(vcl::Window *pCurrent, vcl::Window *pParent, xmlreader::XmlReader &reader);
void collectProperty(xmlreader::XmlReader &reader, const OString &rID, stringmap &rVec);
@@ -405,7 +408,7 @@ private:
};
template <typename T>
-inline T* VclBuilder::get(T*& ret, const OString& sID)
+inline T* VclBuilder::get(VclPtr<T>& ret, const OString& sID)
{
vcl::Window *w = get_by_name(sID);
SAL_WARN_IF(!w, "vcl.layout", "widget \"" << sID.getStr() << "\" not found in .ui");
@@ -414,7 +417,7 @@ inline T* VclBuilder::get(T*& ret, const OString& sID)
assert(w);
assert(dynamic_cast<T*>(w));
ret = static_cast<T*>(w);
- return ret;
+ return ret.get();
}
//sID may not exist, but must be of type T if it does
@@ -446,19 +449,24 @@ inline PopupMenu* VclBuilder::get_menu(PopupMenu*& ret, const OString& sID)
//
//i.e. class Dialog : public SystemWindow, public VclBuilderContainer
//not class Dialog : public VclBuilderContainer, public SystemWindow
+//
+//With the new 'dispose' framework, it is necessary to force the builder
+//dispose before the Window dispose; so a Dialog::dispose() method would
+//finish: disposeBuilder(); SystemWindow::dispose() to capture this ordering.
class VCL_DLLPUBLIC VclBuilderContainer
{
public:
VclBuilderContainer();
virtual ~VclBuilderContainer();
+ void disposeBuilder();
static OUString getUIRootDir();
bool hasBuilder() const { return m_pUIBuilder != NULL; }
css::uno::Reference<css::frame::XFrame> getFrame() { return m_pUIBuilder->getFrame(); }
- template <typename T> T* get(T*& ret, const OString& sID)
+ template <typename T> T* get(VclPtr<T>& ret, const OString& sID)
{
return m_pUIBuilder->get<T>(ret, sID);
}
diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx
index 1a100c0f83dd..937c4ff75f48 100644
--- a/include/vcl/button.hxx
+++ b/include/vcl/button.hxx
@@ -28,7 +28,7 @@
#include <vcl/bitmap.hxx>
#include <vcl/salnativewidgets.hxx>
#include <rsc/rsc-vcl-shared-types.hxx>
-
+#include <vcl/vclptr.hxx>
#include <vector>
class UserDrawEvent;
@@ -37,7 +37,7 @@ class ImplCommonButtonData;
class VCL_DLLPUBLIC Button : public Control
{
private:
- ImplCommonButtonData *mpButtonData;
+ std::unique_ptr<ImplCommonButtonData> mpButtonData;
Link maClickHdl;
/// Command URL (like .uno:Save) in case the button should handle it.
@@ -64,6 +64,7 @@ protected:
public:
virtual ~Button();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Click();
@@ -153,7 +154,6 @@ protected:
public:
explicit PushButton( vcl::Window* pParent, WinBits nStyle = 0 );
explicit PushButton( vcl::Window* pParent, const ResId& );
- virtual ~PushButton();
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void Tracking( const TrackingEvent& rTEvt ) SAL_OVERRIDE;
@@ -226,7 +226,6 @@ public:
virtual void Click() SAL_OVERRIDE;
};
-
class VCL_DLLPUBLIC CancelButton : public PushButton
{
protected:
@@ -275,7 +274,7 @@ public:
class VCL_DLLPUBLIC RadioButton : public Button
{
private:
- std::shared_ptr< std::vector<RadioButton*> > m_xGroup;
+ std::shared_ptr< std::vector< VclPtr< RadioButton > > > m_xGroup;
Rectangle maStateRect;
Rectangle maMouseRect;
Image maImage;
@@ -336,6 +335,7 @@ public:
explicit RadioButton( vcl::Window* pParent, WinBits nWinStyle = 0 );
explicit RadioButton( vcl::Window* pParent, const ResId& );
virtual ~RadioButton();
+ virtual void dispose() SAL_OVERRIDE;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void Tracking( const TrackingEvent& rTEvt ) SAL_OVERRIDE;
@@ -389,7 +389,7 @@ public:
on return contains the <code>RadioButton</code>s
in the same group as this <code>RadioButton</code>.
*/
- std::vector<RadioButton*> GetRadioButtonGroup(bool bIncludeThis = true) const;
+ std::vector<VclPtr<RadioButton> > GetRadioButtonGroup(bool bIncludeThis = true) const;
virtual bool set_property(const OString &rKey, const OString &rValue) SAL_OVERRIDE;
@@ -518,9 +518,8 @@ private:
ImageButton & operator= ( const ImageButton & ) SAL_DELETED_FUNCTION;
public:
- ImageButton( vcl::Window* pParent, WinBits nStyle = 0 );
- ImageButton( vcl::Window* pParent, const ResId& rResId );
- virtual ~ImageButton();
+ ImageButton( vcl::Window* pParent, WinBits nStyle = 0 );
+ ImageButton( vcl::Window* pParent, const ResId& rResId );
};
class VCL_DLLPUBLIC ImageRadioButton : public RadioButton
@@ -530,7 +529,6 @@ class VCL_DLLPUBLIC ImageRadioButton : public RadioButton
public:
explicit ImageRadioButton( vcl::Window* pParent, WinBits nStyle = 0 );
- virtual ~ImageRadioButton();
};
class VCL_DLLPUBLIC TriStateBox : public CheckBox
@@ -540,7 +538,6 @@ class VCL_DLLPUBLIC TriStateBox : public CheckBox
public:
explicit TriStateBox( vcl::Window* pParent, WinBits nStyle = 0 );
- virtual ~TriStateBox();
};
class VCL_DLLPUBLIC DisclosureButton : public CheckBox
@@ -553,8 +550,6 @@ public:
virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
};
-typedef rtl::Reference<DisclosureButton> DisclosureButtonPtr;
-
#endif // INCLUDED_VCL_BUTTON_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/cairo.hxx b/include/vcl/cairo.hxx
index c8cc23e802b3..13983a84d63f 100644
--- a/include/vcl/cairo.hxx
+++ b/include/vcl/cairo.hxx
@@ -22,6 +22,7 @@
#include <sal/config.h>
#include <boost/shared_ptr.hpp>
+#include <vcl/vclptr.hxx>
typedef struct _cairo_surface cairo_surface_t;
typedef struct _cairo cairo_t;
@@ -49,7 +50,7 @@ namespace cairo {
virtual boost::shared_ptr<Surface> getSimilar(int cairo_content_type, int width, int height) const = 0;
/// factory for VirDev on this surface
- virtual boost::shared_ptr<VirtualDevice> createVirtualDevice() const = 0;
+ virtual VclPtr<VirtualDevice> createVirtualDevice() const = 0;
/// Resize the surface (possibly destroying content), only possible for X11 typically
/// so on failure caller must create a new surface instead
diff --git a/include/vcl/combobox.hxx b/include/vcl/combobox.hxx
index 95ec9bc9e215..a835a40d215f 100644
--- a/include/vcl/combobox.hxx
+++ b/include/vcl/combobox.hxx
@@ -32,23 +32,19 @@ class ImplListBoxFloatingWindow;
class ImplListBox;
class ImplBtn;
-
-// - ComboBox -
-
-
class VCL_DLLPUBLIC ComboBox : public Edit
{
private:
- Edit* mpSubEdit;
- ImplListBox* mpImplLB;
- ImplBtn* mpBtn;
- ImplListBoxFloatingWindow* mpFloatWin;
+ VclPtr<Edit> mpSubEdit;
+ VclPtr<ImplListBox> mpImplLB;
+ VclPtr<ImplBtn> mpBtn;
+ VclPtr<ImplListBoxFloatingWindow> mpFloatWin;
sal_uInt16 mnDDHeight;
sal_Unicode mcMultiSep;
bool mbDDAutoSize : 1;
bool mbSyntheticModify : 1;
bool mbMatchCase : 1;
- sal_Int32 m_nMaxWidthChars;
+ sal_Int32 m_nMaxWidthChars;
Link maSelectHdl;
Link maDoubleClickHdl;
boost::signals2::scoped_connection mAutocompleteConnection;
@@ -73,7 +69,7 @@ private:
DECL_DLLPRIVATE_LINK( ImplDoubleClickHdl, void* );
DECL_DLLPRIVATE_LINK( ImplPopupModeEndHdl, void* );
DECL_DLLPRIVATE_LINK( ImplSelectionChangedHdl, void* );
- DECL_DLLPRIVATE_LINK( ImplListItemSelectHdl , void* );
+ DECL_DLLPRIVATE_LINK( ImplListItemSelectHdl , void* );
SAL_DLLPRIVATE void ImplClickButtonHandler( ImplBtn* );
SAL_DLLPRIVATE void ImplUserDrawHandler( UserDrawEvent* );
@@ -90,11 +86,13 @@ protected:
protected:
bool IsDropDownBox() const { return mpFloatWin != nullptr; }
- virtual void FillLayoutData() const SAL_OVERRIDE;
+ virtual void FillLayoutData() const SAL_OVERRIDE;
+
public:
explicit ComboBox( vcl::Window* pParent, WinBits nStyle = 0 );
explicit ComboBox( vcl::Window* pParent, const ResId& );
virtual ~ComboBox();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags ) SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
@@ -117,12 +115,12 @@ public:
Rectangle GetDropDownPosSizePixel() const;
- void AdaptDropDownLineCountToMaximum();
+ void AdaptDropDownLineCountToMaximum();
void SetDropDownLineCount( sal_uInt16 nLines );
sal_uInt16 GetDropDownLineCount() const;
void EnableAutoSize( bool bAuto );
- bool IsAutoSizeEnabled() const { return mbDDAutoSize; }
+ bool IsAutoSizeEnabled() const { return mbDDAutoSize; }
void EnableDDAutoWidth( bool b );
diff --git a/include/vcl/controllayout.hxx b/include/vcl/controllayout.hxx
index 0856a69946b5..ea85d379a792 100644
--- a/include/vcl/controllayout.hxx
+++ b/include/vcl/controllayout.hxx
@@ -24,8 +24,7 @@
#include <tools/gen.hxx>
#include <vector>
#include <vcl/dllapi.h>
-
-class Control;
+#include <vcl/ctrl.hxx>
namespace vcl
{
@@ -42,9 +41,9 @@ struct VCL_DLLPUBLIC ControlLayoutData
// start indices of lines
std::vector< long > m_aLineIndices;
// notify parent control on destruction
- const Control* m_pParent;
+ VclPtr<const Control> m_pParent;
- ControlLayoutData() : m_pParent( NULL ) {}
+ ControlLayoutData();
~ControlLayoutData();
Rectangle GetCharacterBounds( long nIndex ) const;
diff --git a/include/vcl/ctrl.hxx b/include/vcl/ctrl.hxx
index d85c85885b2c..4d1f9030a074 100644
--- a/include/vcl/ctrl.hxx
+++ b/include/vcl/ctrl.hxx
@@ -127,6 +127,7 @@ public:
explicit Control( vcl::Window* pParent, WinBits nWinStyle = 0 );
explicit Control( vcl::Window* pParent, const ResId& );
virtual ~Control();
+ virtual void dispose() SAL_OVERRIDE;
virtual void EnableRTL ( bool bEnable = true ) SAL_OVERRIDE;
diff --git a/include/vcl/cursor.hxx b/include/vcl/cursor.hxx
index 2d3b83c0b119..eecbd0c0ca8a 100644
--- a/include/vcl/cursor.hxx
+++ b/include/vcl/cursor.hxx
@@ -23,6 +23,7 @@
#include <tools/gen.hxx>
#include <tools/link.hxx>
#include <vcl/dllapi.h>
+#include <vcl/vclptr.hxx>
struct ImplCursorData;
namespace vcl { class Window; }
@@ -40,7 +41,7 @@ class VCL_DLLPUBLIC Cursor
{
private:
ImplCursorData* mpData;
- vcl::Window* mpWindow; // only for shadow cursor
+ VclPtr<vcl::Window> mpWindow; // only for shadow cursor
long mnSlant;
Size maSize;
Point maPos;
diff --git a/include/vcl/decoview.hxx b/include/vcl/decoview.hxx
index 4094f693bca2..2de96a5941dd 100644
--- a/include/vcl/decoview.hxx
+++ b/include/vcl/decoview.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_VCL_DECOVIEW_HXX
#include <vcl/dllapi.h>
+#include <vcl/vclptr.hxx>
#include <rsc/rsc-vcl-shared-types.hxx>
class Rectangle;
@@ -70,7 +71,7 @@ class OutputDevice;
class VCL_DLLPUBLIC DecorationView
{
private:
- OutputDevice* mpOutDev;
+ VclPtr<OutputDevice> mpOutDev;
public:
DecorationView(OutputDevice* pOutDev);
diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx
index 3dbde87e371c..652a06965e27 100644
--- a/include/vcl/dialog.hxx
+++ b/include/vcl/dialog.hxx
@@ -24,6 +24,7 @@
#include <vcl/dllapi.h>
#include <vcl/syswin.hxx>
#include <vcl/timer.hxx>
+#include <vcl/vclptr.hxx>
// parameter to pass to the dialog constructor if really no parent is wanted
// whereas NULL chooses the default dialog parent
@@ -39,7 +40,7 @@ class VclButtonBox;
class VCL_DLLPUBLIC Dialog : public SystemWindow
{
private:
- Dialog* mpPrevExecuteDlg;
+ VclPtr<Dialog> mpPrevExecuteDlg;
DialogImpl* mpDialogImpl;
long mnMousePositioned;
bool mbInExecute;
@@ -47,8 +48,8 @@ private:
bool mbInClose;
bool mbModalMode;
- VclButtonBox* mpActionArea;
- VclBox* mpContentArea;
+ VclPtr<VclButtonBox> mpActionArea;
+ VclPtr<VclBox> mpContentArea;
SAL_DLLPRIVATE void ImplInitDialogData();
SAL_DLLPRIVATE void ImplInitSettings();
@@ -74,13 +75,14 @@ protected:
protected:
friend class VclBuilder;
- void set_action_area(VclButtonBox *pBox);
- void set_content_area(VclBox *pBox);
+ void set_action_area(VclButtonBox* pBox);
+ void set_content_area(VclBox* pBox);
public:
explicit Dialog( vcl::Window* pParent, WinBits nStyle = WB_STDDIALOG );
explicit Dialog( vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription );
virtual ~Dialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
@@ -88,8 +90,8 @@ public:
virtual void queue_resize(StateChangedType eReason = StateChangedType::LAYOUT) SAL_OVERRIDE;
virtual bool set_property(const OString &rKey, const OString &rValue) SAL_OVERRIDE;
- VclButtonBox* get_action_area() { return mpActionArea;}
- VclBox* get_content_area() { return mpContentArea;}
+ VclButtonBox* get_action_area() { return mpActionArea; }
+ VclBox* get_content_area() { return mpContentArea; }
virtual bool Close() SAL_OVERRIDE;
diff --git a/include/vcl/dockingarea.hxx b/include/vcl/dockingarea.hxx
index 7fa2ad55fec0..4bc2deff6b02 100644
--- a/include/vcl/dockingarea.hxx
+++ b/include/vcl/dockingarea.hxx
@@ -37,6 +37,7 @@ private:
public:
explicit DockingAreaWindow( vcl::Window* pParent );
virtual ~DockingAreaWindow();
+ virtual void dispose() SAL_OVERRIDE;
void SetAlign( WindowAlign eNewAlign );
WindowAlign GetAlign() const;
diff --git a/include/vcl/dockwin.hxx b/include/vcl/dockwin.hxx
index dac66c731c06..71c81818fa22 100644
--- a/include/vcl/dockwin.hxx
+++ b/include/vcl/dockwin.hxx
@@ -80,12 +80,12 @@ class ImplDockingWindowWrapper
private:
// the original 'Docking'window
- vcl::Window *mpDockingWindow;
+ VclPtr<vcl::Window> mpDockingWindow;
// the original DockingWindow members
- FloatingWindow* mpFloatWin;
- vcl::Window* mpOldBorderWin;
- vcl::Window* mpParent;
+ VclPtr<FloatingWindow> mpFloatWin;
+ VclPtr<vcl::Window> mpOldBorderWin;
+ VclPtr<vcl::Window> mpParent;
Point maFloatPos;
Point maDockPos;
Point maMouseOff;
@@ -225,8 +225,8 @@ class VCL_DLLPUBLIC DockingWindow
{
class ImplData;
private:
- FloatingWindow* mpFloatWin;
- vcl::Window* mpOldBorderWin;
+ VclPtr<FloatingWindow> mpFloatWin;
+ VclPtr<vcl::Window> mpOldBorderWin;
ImplData* mpImplData;
Point maFloatPos;
Point maDockPos;
@@ -261,7 +261,7 @@ private:
mbIsCalculatingInitialLayoutSize:1,
mbInitialLayoutDone:1;
- vcl::Window* mpDialogParent;
+ VclPtr<vcl::Window> mpDialogParent;
SAL_DLLPRIVATE void ImplInitDockingWindowData();
SAL_DLLPRIVATE void setPosSizeOnContainee(Size aSize, Window &rBox);
@@ -299,6 +299,7 @@ public:
DockingWindow(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription,
const css::uno::Reference<css::frame::XFrame> &rFrame = css::uno::Reference<css::frame::XFrame>());
virtual ~DockingWindow();
+ virtual void dispose() SAL_OVERRIDE;
virtual void StartDocking();
virtual bool Docking( const Point& rPos, Rectangle& rRect );
diff --git a/include/vcl/edit.hxx b/include/vcl/edit.hxx
index ec05923011b8..f32c93269f80 100644
--- a/include/vcl/edit.hxx
+++ b/include/vcl/edit.hxx
@@ -28,6 +28,7 @@
#include <vcl/ctrl.hxx>
#include <vcl/menu.hxx>
#include <vcl/dndhelp.hxx>
+#include <vcl/vclptr.hxx>
#include <com/sun/star/uno/Reference.h>
namespace com {
@@ -68,7 +69,7 @@ enum AutocompleteAction{ AUTOCOMPLETE_KEYINPUT, AUTOCOMPLETE_TABFORWARD, AUTOCOM
class VCL_DLLPUBLIC Edit : public Control, public vcl::unohelper::DragAndDropClient
{
private:
- Edit* mpSubEdit;
+ VclPtr<Edit> mpSubEdit;
Timer* mpUpdateDataTimer;
TextFilter* mpFilterText;
DDInfo* mpDDInfo;
@@ -85,7 +86,7 @@ private:
sal_Int32 mnMaxWidthChars;
AutocompleteAction meAutocompleteAction;
sal_Unicode mcEchoChar;
- bool mbModified:1,
+ bool mbModified:1,
mbInternModified:1,
mbReadOnly:1,
mbInsertMode:1,
@@ -164,6 +165,7 @@ public:
Edit( vcl::Window* pParent, WinBits nStyle = WB_BORDER );
Edit( vcl::Window* pParent, const ResId& rResId );
virtual ~Edit();
+ virtual void dispose() SAL_OVERRIDE;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
diff --git a/include/vcl/event.hxx b/include/vcl/event.hxx
index 05a54dc7dfc5..89929d085018 100644
--- a/include/vcl/event.hxx
+++ b/include/vcl/event.hxx
@@ -26,10 +26,11 @@
#include <vcl/keycod.hxx>
#include <vcl/cmdevt.hxx>
#include <vcl/settings.hxx>
+#include <vcl/vclptr.hxx>
+#include <vcl/outdev.hxx>
+#include <vcl/window.hxx>
class AllSettings;
-class OutputDevice;
-namespace vcl { class Window; }
struct IDataObject;
namespace com { namespace sun { namespace star { namespace awt {
@@ -302,7 +303,7 @@ inline HelpEvent::HelpEvent( HelpEventMode nHelpMode )
class VCL_DLLPUBLIC UserDrawEvent
{
private:
- OutputDevice* mpOutDev;
+ VclPtr<OutputDevice> mpOutDev;
Rectangle maOutRect;
sal_uInt16 mnItemId;
sal_uInt16 mnStyle;
@@ -411,7 +412,7 @@ enum class MouseNotifyEvent
class VCL_DLLPUBLIC NotifyEvent
{
private:
- vcl::Window* mpWindow;
+ VclPtr<vcl::Window> mpWindow;
void* mpData;
MouseNotifyEvent mnEventType;
long mnRetValue;
@@ -435,23 +436,6 @@ public:
const CommandEvent* GetCommandEvent() const;
};
-inline NotifyEvent::NotifyEvent()
-{
- mpWindow = NULL;
- mpData = NULL;
- mnEventType = MouseNotifyEvent::NONE;
- mnRetValue = 0;
-}
-
-inline NotifyEvent::NotifyEvent( MouseNotifyEvent nEventType, vcl::Window* pWindow,
- const void* pEvent, long nRet )
-{
- mpWindow = pWindow;
- mpData = const_cast<void*>(pEvent);
- mnEventType = nEventType;
- mnRetValue = nRet;
-}
-
inline const KeyEvent* NotifyEvent::GetKeyEvent() const
{
if ( (mnEventType == MouseNotifyEvent::KEYINPUT) || (mnEventType == MouseNotifyEvent::KEYUP) )
diff --git a/include/vcl/field.hxx b/include/vcl/field.hxx
index 179c16a974a1..cdc80d9cd31c 100644
--- a/include/vcl/field.hxx
+++ b/include/vcl/field.hxx
@@ -41,7 +41,7 @@ class LanguageTag;
class VCL_DLLPUBLIC FormatterBase
{
private:
- Edit* mpField;
+ VclPtr<Edit> mpField;
LocaleDataWrapper* mpLocaleDataWrapper;
Link maErrorLink;
bool mbReformat;
@@ -485,7 +485,6 @@ class VCL_DLLPUBLIC PatternField : public SpinField, public PatternFormatter
{
public:
explicit PatternField( vcl::Window* pParent, WinBits nWinStyle );
- virtual ~PatternField();
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -505,7 +504,6 @@ protected:
public:
explicit NumericField( vcl::Window* pParent, WinBits nWinStyle );
explicit NumericField( vcl::Window* pParent, const ResId& );
- virtual ~NumericField();
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -535,7 +533,6 @@ protected:
public:
explicit MetricField( vcl::Window* pParent, WinBits nWinStyle );
explicit MetricField( vcl::Window* pParent, const ResId& );
- virtual ~MetricField();
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -602,7 +599,6 @@ class VCL_DLLPUBLIC CurrencyField : public SpinField, public CurrencyFormatter
{
public:
CurrencyField( vcl::Window* pParent, WinBits nWinStyle );
- virtual ~CurrencyField();
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -632,7 +628,6 @@ protected:
public:
explicit DateField( vcl::Window* pParent, WinBits nWinStyle );
- virtual ~DateField();
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -666,7 +661,6 @@ protected:
public:
explicit TimeField( vcl::Window* pParent, WinBits nWinStyle );
- virtual ~TimeField();
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -696,7 +690,6 @@ class VCL_DLLPUBLIC PatternBox : public ComboBox, public PatternFormatter
{
public:
PatternBox( vcl::Window* pParent, WinBits nWinStyle );
- virtual ~PatternBox();
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -715,7 +708,6 @@ class VCL_DLLPUBLIC NumericBox : public ComboBox, public NumericFormatter
{
public:
explicit NumericBox( vcl::Window* pParent, WinBits nWinStyle );
- virtual ~NumericBox();
virtual Size CalcMinimumSize() const SAL_OVERRIDE;
@@ -739,7 +731,6 @@ class VCL_DLLPUBLIC MetricBox : public ComboBox, public MetricFormatter
{
public:
explicit MetricBox( vcl::Window* pParent, WinBits nWinStyle );
- virtual ~MetricBox();
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -772,7 +763,6 @@ class VCL_DLLPUBLIC CurrencyBox : public ComboBox, public CurrencyFormatter
{
public:
explicit CurrencyBox( vcl::Window* pParent, WinBits nWinStyle );
- virtual ~CurrencyBox();
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -793,7 +783,6 @@ class VCL_DLLPUBLIC DateBox : public ComboBox, public DateFormatter
{
public:
explicit DateBox( vcl::Window* pParent, WinBits nWinStyle );
- virtual ~DateBox();
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -813,7 +802,6 @@ class VCL_DLLPUBLIC TimeBox : public ComboBox, public TimeFormatter
{
public:
explicit TimeBox( vcl::Window* pParent, WinBits nWinStyle );
- virtual ~TimeBox();
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
diff --git a/include/vcl/fixed.hxx b/include/vcl/fixed.hxx
index 109cecfe812d..3ba8b2c9fa1c 100644
--- a/include/vcl/fixed.hxx
+++ b/include/vcl/fixed.hxx
@@ -38,7 +38,7 @@ class VCL_DLLPUBLIC FixedText : public Control
private:
sal_Int32 m_nMaxWidthChars;
sal_Int32 m_nMinWidthChars;
- vcl::Window *m_pMnemonicWindow;
+ VclPtr<vcl::Window> m_pMnemonicWindow;
using Control::ImplInitSettings;
using Window::ImplInit;
@@ -62,6 +62,7 @@ public:
explicit FixedText( vcl::Window* pParent, WinBits nStyle = 0 );
explicit FixedText( vcl::Window* pParent, const ResId& rResId );
virtual ~FixedText();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags ) SAL_OVERRIDE;
@@ -140,7 +141,6 @@ private:
public:
explicit FixedBitmap( vcl::Window* pParent, WinBits nStyle = 0 );
- virtual ~FixedBitmap();
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags ) SAL_OVERRIDE;
@@ -178,7 +178,6 @@ protected:
public:
explicit FixedImage( vcl::Window* pParent, WinBits nStyle = 0 );
explicit FixedImage( vcl::Window* pParent, const ResId& );
- virtual ~FixedImage();
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags ) SAL_OVERRIDE;
diff --git a/include/vcl/fixedhyper.hxx b/include/vcl/fixedhyper.hxx
index c85bd1cb6ac0..2fc8e2f95469 100644
--- a/include/vcl/fixedhyper.hxx
+++ b/include/vcl/fixedhyper.hxx
@@ -66,11 +66,6 @@ class VCL_DLLPUBLIC FixedHyperlink : public FixedText
*/
FixedHyperlink( vcl::Window* pParent, WinBits nWinStyle = 0 );
- /** dtor
-
- */
- virtual ~FixedHyperlink();
-
/** overwrites Window::GetFocus().
Changes the color of the text and shows a focus rectangle.
diff --git a/include/vcl/floatwin.hxx b/include/vcl/floatwin.hxx
index b000fb7940e5..a9033a22670b 100644
--- a/include/vcl/floatwin.hxx
+++ b/include/vcl/floatwin.hxx
@@ -73,8 +73,8 @@ class VCL_DLLPUBLIC FloatingWindow : public SystemWindow
{
class ImplData;
private:
- FloatingWindow* mpNextFloat;
- vcl::Window* mpFirstPopupModeWin;
+ VclPtr<FloatingWindow> mpNextFloat;
+ VclPtr<vcl::Window> mpFirstPopupModeWin;
ImplData* mpImplData;
Rectangle maFloatRect;
ImplSVEvent * mnPostId;
@@ -122,6 +122,7 @@ public:
explicit FloatingWindow(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription,
const css::uno::Reference<css::frame::XFrame> &rFrame = css::uno::Reference<css::frame::XFrame>());
virtual ~FloatingWindow();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual void StateChanged( StateChangedType nType ) SAL_OVERRIDE;
diff --git a/include/vcl/fltcall.hxx b/include/vcl/fltcall.hxx
index 6e7ab514ea5a..48f7ac973534 100644
--- a/include/vcl/fltcall.hxx
+++ b/include/vcl/fltcall.hxx
@@ -33,7 +33,7 @@ namespace vcl { class Window; }
struct FltCallDialogParameter
{
- vcl::Window* pWindow;
+ VclPtr<vcl::Window> pWindow;
ResMgr* pResMgr;
FieldUnit eFieldUnit;
OUString aFilterExt;
diff --git a/include/vcl/gdimtf.hxx b/include/vcl/gdimtf.hxx
index 05ab48ad2c98..e860dda464b1 100644
--- a/include/vcl/gdimtf.hxx
+++ b/include/vcl/gdimtf.hxx
@@ -25,6 +25,7 @@
#include <tools/link.hxx>
#include <vcl/mapmod.hxx>
#include <vcl/bitmap.hxx>
+#include <vcl/vclptr.hxx>
#include <vector>
class OutputDevice;
@@ -80,7 +81,7 @@ private:
Link aHookHdlLink;
GDIMetaFile* pPrev;
GDIMetaFile* pNext;
- OutputDevice* pOutDev;
+ VclPtr<OutputDevice> pOutDev;
bool bPause;
bool bRecord;
bool bUseCanvas;
diff --git a/include/vcl/introwin.hxx b/include/vcl/introwin.hxx
index 7b9fc1e837ea..8576ecda3e81 100644
--- a/include/vcl/introwin.hxx
+++ b/include/vcl/introwin.hxx
@@ -30,8 +30,10 @@ private:
SAL_DLLPRIVATE void ImplInitIntroWindowData();
public:
- IntroWindow();
- virtual ~IntroWindow();
+ IntroWindow();
+ virtual ~IntroWindow();
+ virtual void dispose() SAL_OVERRIDE;
+
};
#endif // INCLUDED_VCL_INTROWIN_HXX
diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index 24ad21732d4c..bec9976a7317 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -17,6 +17,7 @@
#include <vcl/scrbar.hxx>
#include <vcl/vclmedit.hxx>
#include <vcl/window.hxx>
+#include <vcl/vclptr.hxx>
#include <boost/multi_array.hpp>
#include <set>
@@ -353,7 +354,7 @@ private:
struct GridEntry
{
- vcl::Window *pChild;
+ VclPtr<vcl::Window> pChild;
sal_Int32 nSpanWidth;
sal_Int32 nSpanHeight;
GridEntry()
@@ -455,7 +456,7 @@ public:
class VCL_DLLPUBLIC VclFrame : public VclBin
{
private:
- vcl::Window *m_pLabel;
+ VclPtr<vcl::Window> m_pLabel;
private:
friend class VclBuilder;
void designate_label(vcl::Window *pWindow);
@@ -466,6 +467,8 @@ public:
, m_pLabel(NULL)
{
}
+ virtual ~VclFrame();
+ virtual void dispose() SAL_OVERRIDE;
void set_label(const OUString &rLabel);
OUString get_label() const;
virtual vcl::Window *get_child() SAL_OVERRIDE;
@@ -514,11 +517,13 @@ public:
VclExpander(vcl::Window *pParent)
: VclBin(pParent)
, m_bResizeTopLevel(true)
- , m_pDisclosureButton(new DisclosureButton(this))
+ , m_pDisclosureButton(VclPtr<DisclosureButton>::Create(this))
{
m_pDisclosureButton->SetToggleHdl(LINK(this, VclExpander, ClickHdl));
m_pDisclosureButton->Show();
}
+ virtual ~VclExpander() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE;
virtual vcl::Window *get_child() SAL_OVERRIDE;
virtual const vcl::Window *get_child() const SAL_OVERRIDE;
virtual bool set_property(const OString &rKey, const OString &rValue) SAL_OVERRIDE;
@@ -544,10 +549,9 @@ public:
protected:
virtual Size calculateRequisition() const SAL_OVERRIDE;
virtual void setAllocation(const Size &rAllocation) SAL_OVERRIDE;
- void dispose() SAL_OVERRIDE { m_pDisclosureButton.clear(); VclBin::dispose(); }
private:
bool m_bResizeTopLevel;
- DisclosureButtonPtr m_pDisclosureButton;
+ VclPtr<DisclosureButton> m_pDisclosureButton;
Link maExpandedHdl;
DECL_DLLPRIVATE_LINK(ClickHdl, DisclosureButton* pBtn);
};
@@ -556,11 +560,13 @@ class VCL_DLLPUBLIC VclScrolledWindow : public VclBin
{
public:
VclScrolledWindow(vcl::Window *pParent, WinBits nStyle = WB_HIDE | WB_CLIPCHILDREN | WB_AUTOHSCROLL | WB_AUTOVSCROLL);
+ virtual ~VclScrolledWindow() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE;
virtual vcl::Window *get_child() SAL_OVERRIDE;
virtual const vcl::Window *get_child() const SAL_OVERRIDE;
virtual bool set_property(const OString &rKey, const OString &rValue) SAL_OVERRIDE;
- ScrollBar& getVertScrollBar() { return *m_pVScroll.get(); }
- ScrollBar& getHorzScrollBar() { return *m_pHScroll.get(); }
+ ScrollBar& getVertScrollBar() { return *m_pVScroll; }
+ ScrollBar& getHorzScrollBar() { return *m_pHScroll; }
Size getVisibleChildSize() const;
//set to true to disable the built-in scrolling callbacks to allow the user
//to override it
@@ -571,12 +577,11 @@ protected:
DECL_LINK(ScrollBarHdl, void *);
void InitScrollBars(const Size &rRequest);
virtual bool Notify(NotifyEvent& rNEvt) SAL_OVERRIDE;
- void dispose() SAL_OVERRIDE { m_pVScroll.clear(); m_pHScroll.clear(); VclBin::dispose(); }
private:
bool m_bUserManagedScrolling;
- ScrollBarPtr m_pVScroll;
- ScrollBarPtr m_pHScroll;
- ScrollBarBox m_aScrollBarBox;
+ VclPtr<ScrollBar> m_pVScroll;
+ VclPtr<ScrollBar> m_pHScroll;
+ VclPtr<ScrollBarBox> m_aScrollBarBox;
};
class VCL_DLLPUBLIC VclViewport : public VclBin
@@ -618,13 +623,16 @@ private:
}
};
- EventBoxHelper m_aEventBoxHelper;
+ VclPtr<EventBoxHelper> m_aEventBoxHelper;
+protected:
+ virtual void dispose() SAL_OVERRIDE;
+ virtual ~VclEventBox();
public:
VclEventBox(vcl::Window* pParent)
: VclBin(pParent)
- , m_aEventBoxHelper(this)
+ , m_aEventBoxHelper(VclPtr<EventBoxHelper>::Create(this))
{
- m_aEventBoxHelper.Show();
+ m_aEventBoxHelper->Show();
}
virtual vcl::Window *get_child() SAL_OVERRIDE;
virtual const vcl::Window *get_child() const SAL_OVERRIDE;
@@ -645,7 +653,7 @@ enum VclSizeGroupMode
class VCL_DLLPUBLIC VclSizeGroup
{
private:
- std::set<vcl::Window*> m_aWindows;
+ std::set< VclPtr<vcl::Window> > m_aWindows;
bool m_bIgnoreHidden;
VclSizeGroupMode m_eMode;
@@ -658,17 +666,17 @@ public:
}
void insert(vcl::Window *pWindow)
{
- m_aWindows.insert(pWindow);
+ m_aWindows.insert(VclPtr<vcl::Window>(pWindow));
}
void erase(vcl::Window *pWindow)
{
- m_aWindows.erase(pWindow);
+ m_aWindows.erase(VclPtr<vcl::Window>(pWindow));
}
- const std::set<vcl::Window*>& get_widgets() const
+ const std::set< VclPtr<vcl::Window> >& get_widgets() const
{
return m_aWindows;
}
- std::set<vcl::Window*>& get_widgets()
+ std::set< VclPtr<vcl::Window> >& get_widgets()
{
return m_aWindows;
}
@@ -708,14 +716,14 @@ class VCL_DLLPUBLIC MessageDialog : public Dialog
private:
VclButtonsType m_eButtonsType;
VclMessageType m_eMessageType;
- VclBox *m_pOwnedContentArea;
- VclButtonBox *m_pOwnedActionArea;
- VclGrid* m_pGrid;
- FixedImage* m_pImage;
- VclMultiLineEdit* m_pPrimaryMessage;
- VclMultiLineEdit* m_pSecondaryMessage;
- std::vector<PushButton*> m_aOwnedButtons;
- std::map<const vcl::Window*, short> m_aResponses;
+ VclPtr<VclBox> m_pOwnedContentArea;
+ VclPtr<VclButtonBox> m_pOwnedActionArea;
+ VclPtr<VclGrid> m_pGrid;
+ VclPtr<FixedImage> m_pImage;
+ VclPtr<VclMultiLineEdit> m_pPrimaryMessage;
+ VclPtr<VclMultiLineEdit> m_pSecondaryMessage;
+ std::vector<VclPtr<PushButton> > m_aOwnedButtons;
+ std::map< VclPtr<const vcl::Window>, short> m_aResponses;
OUString m_sPrimaryString;
OUString m_sSecondaryString;
DECL_DLLPRIVATE_LINK(ButtonHdl, Button *);
@@ -742,6 +750,7 @@ public:
void set_primary_text(const OUString &rPrimaryString);
void set_secondary_text(const OUString &rSecondaryString);
virtual ~MessageDialog();
+ virtual void dispose() SAL_OVERRIDE;
static void SetMessagesWidths(vcl::Window *pParent, VclMultiLineEdit *pPrimaryMessage,
VclMultiLineEdit *pSecondaryMessage);
diff --git a/include/vcl/lazydelete.hxx b/include/vcl/lazydelete.hxx
index ad4e9cfaeb8e..08da855ac360 100644
--- a/include/vcl/lazydelete.hxx
+++ b/include/vcl/lazydelete.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_VCL_LAZYDELETE_HXX
#include <vcl/dllapi.h>
+#include <vcl/vclptr.hxx>
#include <unordered_map>
#include <vector>
@@ -101,8 +102,8 @@ namespace vcl
struct DeleteObjectEntry
{
- T* m_pObject;
- bool m_bDeleted;
+ VclPtr<T> m_pObject;
+ bool m_bDeleted;
DeleteObjectEntry() :
m_pObject( NULL ),
@@ -136,7 +137,7 @@ namespace vcl
// do the actual work
unsigned int nCount = m_aObjects.size();
- std::vector<T*> aRealDelete;
+ std::vector< VclPtr < T > > aRealDelete;
aRealDelete.reserve( nCount );
for( unsigned int i = 0; i < nCount; i++ )
{
@@ -158,8 +159,8 @@ namespace vcl
#endif
// check if the object to be deleted is not already destroyed
// as a side effect of a previous lazily destroyed object
- if( ! m_aObjects[ m_aPtrToIndex[ reinterpret_cast<sal_IntPtr>(aRealDelete[n]) ] ].m_bDeleted )
- delete aRealDelete[n];
+ if( ! m_aObjects[ m_aPtrToIndex[ reinterpret_cast<sal_IntPtr>(aRealDelete[n].get()) ] ].m_bDeleted )
+ aRealDelete[n].disposeAndClear();
}
}
diff --git a/include/vcl/longcurr.hxx b/include/vcl/longcurr.hxx
index 0c2d1a969de0..0dbe82ca401f 100644
--- a/include/vcl/longcurr.hxx
+++ b/include/vcl/longcurr.hxx
@@ -90,7 +90,6 @@ private:
public:
LongCurrencyField( vcl::Window* pParent, WinBits nWinStyle );
- virtual ~LongCurrencyField();
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -117,7 +116,6 @@ class VCL_DLLPUBLIC LongCurrencyBox : public ComboBox, public LongCurrencyFormat
{
public:
LongCurrencyBox( vcl::Window* pParent, WinBits nWinStyle );
- virtual ~LongCurrencyBox();
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
diff --git a/include/vcl/lstbox.hxx b/include/vcl/lstbox.hxx
index 3f03f63d1b55..5647f974f396 100644
--- a/include/vcl/lstbox.hxx
+++ b/include/vcl/lstbox.hxx
@@ -37,10 +37,10 @@ class ImplWin;
class VCL_DLLPUBLIC ListBox : public Control
{
private:
- ImplListBox* mpImplLB;
- ImplListBoxFloatingWindow* mpFloatWin;
- ImplWin* mpImplWin;
- ImplBtn* mpBtn;
+ VclPtr<ImplListBox> mpImplLB;
+ VclPtr<ImplListBoxFloatingWindow> mpFloatWin;
+ VclPtr<ImplWin> mpImplWin;
+ VclPtr<ImplBtn> mpBtn;
sal_uInt16 mnDDHeight;
sal_Int32 mnSaveValue;
sal_Int32 m_nMaxWidthChars;
@@ -83,6 +83,7 @@ public:
explicit ListBox( vcl::Window* pParent, WinBits nStyle = WB_BORDER );
explicit ListBox( vcl::Window* pParent, const ResId& );
virtual ~ListBox();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags ) SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx
index ef4f1eec5762..32dfd5a73d28 100644
--- a/include/vcl/menu.hxx
+++ b/include/vcl/menu.hxx
@@ -124,7 +124,7 @@ private:
MenuItemList* pItemList; // Liste mit den MenuItems
MenuLogo* pLogo;
Menu* pStartedFrom;
- vcl::Window* pWindow;
+ VclPtr<vcl::Window> pWindow;
Link aActivateHdl; // Active-Handler
Link aDeactivateHdl; // Deactivate-Handler
diff --git a/include/vcl/menubtn.hxx b/include/vcl/menubtn.hxx
index 41e03c6462f9..eb2c446a4a53 100644
--- a/include/vcl/menubtn.hxx
+++ b/include/vcl/menubtn.hxx
@@ -57,6 +57,7 @@ protected:
public:
explicit MenuButton( vcl::Window* pParent, WinBits nStyle = 0 );
virtual ~MenuButton();
+ virtual void dispose() SAL_OVERRIDE;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
diff --git a/include/vcl/morebtn.hxx b/include/vcl/morebtn.hxx
index 4dbd6da57736..936cbba77d9e 100644
--- a/include/vcl/morebtn.hxx
+++ b/include/vcl/morebtn.hxx
@@ -35,7 +35,7 @@ class VCL_DLLPUBLIC MoreButton : public PushButton
{
private:
ImplMoreButtonData* mpMBData;
- sal_uLong mnDelta;
+ sal_uLong mnDelta;
MapUnit meUnit;
bool mbState;
@@ -50,6 +50,7 @@ protected:
public:
explicit MoreButton( vcl::Window* pParent, WinBits nStyle = 0 );
virtual ~MoreButton();
+ virtual void dispose() SAL_OVERRIDE;
void Click() SAL_OVERRIDE;
diff --git a/include/vcl/msgbox.hxx b/include/vcl/msgbox.hxx
index 04ea155cb6d8..8147821280c1 100644
--- a/include/vcl/msgbox.hxx
+++ b/include/vcl/msgbox.hxx
@@ -32,14 +32,14 @@ class CheckBox;
class VCL_DLLPUBLIC MessBox : public ButtonDialog
{
protected:
- VclMultiLineEdit* mpVCLMultiLineEdit;
- FixedImage* mpFixedImage;
- OUString maMessText;
- Image maImage;
- bool mbHelpBtn;
- CheckBox* mpCheckBox;
- OUString maCheckBoxText;
- bool mbCheck;
+ VclPtr<VclMultiLineEdit> mpVCLMultiLineEdit;
+ VclPtr<FixedImage> mpFixedImage;
+ OUString maMessText;
+ Image maImage;
+ bool mbHelpBtn;
+ VclPtr<CheckBox> mpCheckBox;
+ OUString maCheckBoxText;
+ bool mbCheck;
SAL_DLLPRIVATE void ImplInitMessBoxData();
SAL_DLLPRIVATE void ImplInitButtons();
@@ -48,7 +48,8 @@ protected:
public:
MessBox( vcl::Window* pParent, WinBits nStyle,
const OUString& rTitle, const OUString& rMessage );
- virtual ~MessBox();
+ virtual ~MessBox();
+ virtual void dispose() SAL_OVERRIDE;
virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
diff --git a/include/vcl/oldprintadaptor.hxx b/include/vcl/oldprintadaptor.hxx
index 72d1163d67c4..987b58ff3aa3 100644
--- a/include/vcl/oldprintadaptor.hxx
+++ b/include/vcl/oldprintadaptor.hxx
@@ -29,7 +29,7 @@ namespace vcl
{
ImplOldStyleAdaptorData* mpData;
public:
- OldStylePrintAdaptor(const std::shared_ptr<Printer>&);
+ OldStylePrintAdaptor( const VclPtr< Printer >& );
virtual ~OldStylePrintAdaptor();
void StartPage();
diff --git a/include/vcl/opengl/OpenGLContext.hxx b/include/vcl/opengl/OpenGLContext.hxx
index d733560f2a2b..2d2ce8f823d5 100644
--- a/include/vcl/opengl/OpenGLContext.hxx
+++ b/include/vcl/opengl/OpenGLContext.hxx
@@ -249,10 +249,9 @@ private:
#endif
GLWindow m_aGLWin;
- std::unique_ptr<vcl::Window> m_xWindow;
- vcl::Window* mpWindow; //points to m_xWindow or the parent window, don't delete it
- SystemChildWindow* m_pChildWindow;
- std::unique_ptr<SystemChildWindow> m_xChildWindowGC;
+ VclPtr<vcl::Window> m_xWindow;
+ VclPtr<vcl::Window> mpWindow; //points to m_pWindow or the parent window, don't delete it
+ VclPtr<SystemChildWindow> m_pChildWindow;
bool mbInitialized;
int mnRefCount;
bool mbRequestLegacyContext;
diff --git a/include/vcl/openglwin.hxx b/include/vcl/openglwin.hxx
index dfeb95c076e6..e8c2a1e545a7 100644
--- a/include/vcl/openglwin.hxx
+++ b/include/vcl/openglwin.hxx
@@ -33,8 +33,10 @@ public:
class VCL_DLLPUBLIC OpenGLWindow : public vcl::Window
{
public:
- OpenGLWindow(vcl::Window* pParent);
- virtual ~OpenGLWindow();
+ OpenGLWindow(vcl::Window* pParent);
+ virtual ~OpenGLWindow();
+ virtual void dispose() SAL_OVERRIDE;
+
OpenGLContext& getContext();
void setRenderer(IRenderer* pRenderer);
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 4cf24545c928..16f44b8085f5 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -263,13 +263,34 @@ class VCL_DLLPUBLIC OutputDevice
friend class vcl::PDFWriterImpl;
friend void ImplHandleResize( vcl::Window* pWindow, long nNewWidth, long nNewHeight );
+ // All of this will need to be replicated in Window
+ // or a shared base-class as/when we can break the
+ // OutputDevice -> Window inheritance.
+private:
+ mutable int mnRefCnt; // reference count
+
+ template<typename T> friend class ::rtl::Reference;
+ template<typename T> friend class ::VclPtr;
+
+ inline void acquire() const
+ {
+ mnRefCnt++;
+ }
+
+ inline void release() const
+ {
+ assert(mnRefCnt>0);
+ if (!--mnRefCnt)
+ delete this;
+ }
+
private:
OutputDevice(const OutputDevice&) SAL_DELETED_FUNCTION;
OutputDevice& operator=(const OutputDevice&) SAL_DELETED_FUNCTION;
mutable SalGraphics* mpGraphics; ///< Graphics context to draw on
- mutable OutputDevice* mpPrevGraphics; ///< Previous output device in list
- mutable OutputDevice* mpNextGraphics; ///< Next output device in list
+ mutable VclPtr<OutputDevice> mpPrevGraphics; ///< Previous output device in list
+ mutable VclPtr<OutputDevice> mpNextGraphics; ///< Next output device in list
GDIMetaFile* mpMetaFile;
mutable ImplFontEntry* mpFontEntry;
mutable ImplFontCache* mpFontCache;
@@ -283,7 +304,7 @@ private:
vcl::ExtOutDevData* mpExtOutDevData;
// TEMP TEMP TEMP
- VirtualDevice* mpAlphaVDev;
+ VclPtr<VirtualDevice> mpAlphaVDev;
/// Additional output pixel offset, applied in LogicToPixel (used by SetPixelOffset/GetPixelOffset)
long mnOutOffOrigX;
@@ -352,6 +373,7 @@ private:
mutable bool mbTextSpecial : 1;
mutable bool mbRefPoint : 1;
mutable bool mbEnableRTL : 1;
+ mutable bool mbDisposed : 1;
/** @name Initialization and accessor functions
*/
@@ -359,10 +381,18 @@ private:
protected:
OutputDevice();
-
public:
virtual ~OutputDevice();
+protected:
+ /// release all references to other objects.
+ virtual void dispose();
+
+public:
+ /// call the dispose() method if we have not already been disposed.
+ void disposeOnce();
+ bool isDisposed() const { return mbDisposed; }
+
public:
/** Get the graphic context that the output device uses to draw on.
diff --git a/include/vcl/popupmenuwindow.hxx b/include/vcl/popupmenuwindow.hxx
index 266738a170c3..13d699f69542 100644
--- a/include/vcl/popupmenuwindow.hxx
+++ b/include/vcl/popupmenuwindow.hxx
@@ -30,6 +30,7 @@ private:
public:
PopupMenuFloatingWindow( vcl::Window* pParent, WinBits nStyle = (WB_SYSTEMFLOATWIN|WB_SYSTEMWINDOW|WB_NOBORDER) );
virtual ~PopupMenuFloatingWindow();
+ virtual void dispose() SAL_OVERRIDE;
sal_uInt16 GetMenuStackLevel() const;
void SetMenuStackLevel( sal_uInt16 nLevel );
diff --git a/include/vcl/prgsbar.hxx b/include/vcl/prgsbar.hxx
index 782b2c549a9a..43d340689d18 100644
--- a/include/vcl/prgsbar.hxx
+++ b/include/vcl/prgsbar.hxx
@@ -61,8 +61,8 @@ private:
Point maPos;
long mnPrgsWidth;
long mnPrgsHeight;
- sal_uInt16 mnPercent;
- sal_uInt16 mnPercentCount;
+ sal_uInt16 mnPercent;
+ sal_uInt16 mnPercentCount;
bool mbCalcNew;
using Window::ImplInit;
@@ -72,7 +72,6 @@ private:
public:
ProgressBar( vcl::Window* pParent, WinBits nWinBits = WB_STDPROGRESSBAR );
- virtual ~ProgressBar();
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx
index d74976981bd8..be18fd06bb6a 100644
--- a/include/vcl/print.hxx
+++ b/include/vcl/print.hxx
@@ -203,9 +203,9 @@ private:
SalInfoPrinter* mpInfoPrinter;
SalPrinter* mpPrinter;
SalGraphics* mpJobGraphics;
- Printer* mpPrev;
- Printer* mpNext;
- VirtualDevice* mpDisplayDev;
+ VclPtr<Printer> mpPrev;
+ VclPtr<Printer> mpNext;
+ VclPtr<VirtualDevice> mpDisplayDev;
PrinterOptions* mpPrinterOptions;
OUString maPrinterName;
OUString maDriver;
@@ -299,6 +299,7 @@ public:
Printer( const QueueInfo& rQueueInfo );
Printer( const OUString& rPrinterName );
virtual ~Printer();
+ virtual void dispose() SAL_OVERRIDE;
static const std::vector< OUString >& GetPrinterQueues();
static const QueueInfo* GetQueueInfo( const OUString& rPrinterName, bool bStatusUpdate );
@@ -309,7 +310,7 @@ public:
const OUString& GetName() const { return maPrinterName; }
const OUString& GetDriverName() const { return maDriver; }
bool IsDefPrinter() const { return mbDefPrinter; }
- bool IsDisplayPrinter() const { return mpDisplayDev != NULL; }
+ bool IsDisplayPrinter() const { return mpDisplayDev != nullptr; }
bool IsValid() const { return !IsDisplayPrinter(); }
sal_uLong GetCapabilities( sal_uInt16 nType ) const;
@@ -426,7 +427,7 @@ class VCL_DLLPUBLIC PrinterController
{
ImplPrinterControllerData* mpImplData;
protected:
- PrinterController( const std::shared_ptr<Printer>& );
+ PrinterController( const VclPtr<Printer>& );
public:
enum NupOrderType
{ LRTB, TBLR, TBRL, RLTB };
@@ -469,7 +470,7 @@ public:
virtual ~PrinterController();
- const std::shared_ptr<Printer>& getPrinter() const;
+ const VclPtr<Printer>& getPrinter() const;
/* for implementations: get current job properties as changed by e.g. print dialog
this gets the current set of properties initially told to Printer::PrintJob
@@ -550,7 +551,7 @@ public:
SAL_DLLPRIVATE PageSize getPageFile( int i_inUnfilteredPage, GDIMetaFile& rMtf, bool i_bMayUseCache = false );
VCL_PLUGIN_PUBLIC PageSize getFilteredPageFile( int i_nFilteredPage, GDIMetaFile& o_rMtf, bool i_bMayUseCache = false );
VCL_PLUGIN_PUBLIC void printFilteredPage( int i_nPage );
- SAL_DLLPRIVATE void setPrinter( const std::shared_ptr<Printer>& );
+ SAL_DLLPRIVATE void setPrinter( const VclPtr<Printer>& );
SAL_DLLPRIVATE void setOptionChangeHdl( const Link& );
VCL_PLUGIN_PUBLIC void createProgressDialog();
VCL_PLUGIN_PUBLIC bool isProgressCanceled() const;
diff --git a/include/vcl/scrbar.hxx b/include/vcl/scrbar.hxx
index da949dfdf8d2..27871afc2cb6 100644
--- a/include/vcl/scrbar.hxx
+++ b/include/vcl/scrbar.hxx
@@ -91,6 +91,7 @@ private:
public:
explicit ScrollBar( vcl::Window* pParent, WinBits nStyle = WB_VERT );
virtual ~ScrollBar();
+ virtual void dispose() SAL_OVERRIDE;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void Tracking( const TrackingEvent& rTEvt ) SAL_OVERRIDE;
@@ -141,8 +142,6 @@ public:
virtual Size GetOptimalSize() const SAL_OVERRIDE;
};
-typedef rtl::Reference<ScrollBar> ScrollBarPtr;
-
// - ScrollBarBox -
diff --git a/include/vcl/seleng.hxx b/include/vcl/seleng.hxx
index cbfd9c3a0970..781527157607 100644
--- a/include/vcl/seleng.hxx
+++ b/include/vcl/seleng.hxx
@@ -83,7 +83,7 @@ class VCL_DLLPUBLIC SelectionEngine
{
private:
FunctionSet* pFunctionSet;
- vcl::Window* pWin;
+ VclPtr<vcl::Window> pWin;
Rectangle aArea;
Timer aWTimer; // generate fake mouse moves
MouseEvent aLastMove;
diff --git a/include/vcl/spin.hxx b/include/vcl/spin.hxx
index 4fb25f31829f..ad261f2ef478 100644
--- a/include/vcl/spin.hxx
+++ b/include/vcl/spin.hxx
@@ -57,7 +57,6 @@ private:
public:
explicit SpinButton( vcl::Window* pParent, WinBits nStyle = 0 );
- virtual ~SpinButton();
void Up();
void Down();
diff --git a/include/vcl/spinfld.hxx b/include/vcl/spinfld.hxx
index fe5431be04b6..b0474b1685c9 100644
--- a/include/vcl/spinfld.hxx
+++ b/include/vcl/spinfld.hxx
@@ -26,13 +26,10 @@
#include <vcl/timer.hxx>
-// - SpinField -
-
-
class VCL_DLLPUBLIC SpinField : public Edit
{
protected:
- Edit* mpEdit;
+ VclPtr<Edit> mpEdit;
AutoTimer maRepeatTimer;
Rectangle maUpperRect;
Rectangle maLowerRect;
@@ -73,6 +70,7 @@ public:
explicit SpinField( vcl::Window* pParent, WinBits nWinStyle = 0 );
explicit SpinField( vcl::Window* pParent, const ResId& );
virtual ~SpinField();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool ShowDropDown( bool bShow );
diff --git a/include/vcl/split.hxx b/include/vcl/split.hxx
index fbc833272ce7..86df902692b4 100644
--- a/include/vcl/split.hxx
+++ b/include/vcl/split.hxx
@@ -28,7 +28,7 @@
class VCL_DLLPUBLIC Splitter : public vcl::Window
{
private:
- vcl::Window* mpRefWin;
+ VclPtr<vcl::Window> mpRefWin;
long mnSplitPos;
long mnLastSplitPos;
long mnStartSplitPos;
@@ -63,6 +63,7 @@ protected:
public:
explicit Splitter( vcl::Window* pParent, WinBits nStyle = WB_VSCROLL );
virtual ~Splitter();
+ virtual void dispose() SAL_OVERRIDE;
void StartSplit();
void EndSplit();
diff --git a/include/vcl/splitwin.hxx b/include/vcl/splitwin.hxx
index 157f0c23ed60..009f9e9fb274 100644
--- a/include/vcl/splitwin.hxx
+++ b/include/vcl/splitwin.hxx
@@ -123,7 +123,8 @@ private:
SplitWindow & operator= (const SplitWindow &) SAL_DELETED_FUNCTION;
public:
SplitWindow( vcl::Window* pParent, WinBits nStyle = 0 );
- virtual ~SplitWindow();
+ virtual ~SplitWindow();
+ virtual void dispose() SAL_OVERRIDE;
virtual void StartSplit();
virtual void Split();
diff --git a/include/vcl/status.hxx b/include/vcl/status.hxx
index a9ad080e8715..6824233e43d3 100644
--- a/include/vcl/status.hxx
+++ b/include/vcl/status.hxx
@@ -85,9 +85,9 @@ private:
long mnCalcHeight;
long mnTextY;
long mnItemY;
- sal_uInt16 mnCurItemId;
- sal_uInt16 mnPercent;
- sal_uInt16 mnPercentCount;
+ sal_uInt16 mnCurItemId;
+ sal_uInt16 mnPercent;
+ sal_uInt16 mnPercentCount;
bool mbVisibleItems;
bool mbFormat;
bool mbProgressMode;
@@ -113,7 +113,8 @@ private:
public:
StatusBar( vcl::Window* pParent,
WinBits nWinStyle = WB_BORDER | WB_RIGHT );
- virtual ~StatusBar();
+ virtual ~StatusBar();
+ virtual void dispose() SAL_OVERRIDE;
void AdjustItemWidthsForHiDPI(bool bAdjustHiDPI);
diff --git a/include/vcl/syschild.hxx b/include/vcl/syschild.hxx
index 87e16fcc183a..928c1861b52a 100644
--- a/include/vcl/syschild.hxx
+++ b/include/vcl/syschild.hxx
@@ -42,6 +42,7 @@ public:
// create a SystemChildWindow using the given SystemWindowData
explicit SystemChildWindow( vcl::Window* pParent, WinBits nStyle, SystemWindowData *pData, bool bShow = true );
virtual ~SystemChildWindow();
+ virtual void dispose() SAL_OVERRIDE;
const SystemEnvData* GetSystemData() const;
diff --git a/include/vcl/syswin.hxx b/include/vcl/syswin.hxx
index c313e2ff2c34..f90fb16bfeea 100644
--- a/include/vcl/syswin.hxx
+++ b/include/vcl/syswin.hxx
@@ -149,7 +149,7 @@ private:
Idle maLayoutIdle;
protected:
bool mbIsDefferedInit;
- vcl::Window* mpDialogParent;
+ VclPtr<vcl::Window> mpDialogParent;
public:
using Window::ImplIsInTaskPaneList;
SAL_DLLPRIVATE bool ImplIsInTaskPaneList( vcl::Window* pWin );
@@ -172,7 +172,9 @@ protected:
SAL_DLLPRIVATE void DoInitialLayout();
public:
- virtual ~SystemWindow();
+ virtual ~SystemWindow();
+ virtual void dispose() SAL_OVERRIDE;
+
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
diff --git a/include/vcl/tabctrl.hxx b/include/vcl/tabctrl.hxx
index 526bc25ddfec..a3b8aa0f0bec 100644
--- a/include/vcl/tabctrl.hxx
+++ b/include/vcl/tabctrl.hxx
@@ -42,13 +42,13 @@ private:
long mnLastHeight;
long mnBtnSize;
long mnMaxPageWidth;
- sal_uInt16 mnActPageId;
- sal_uInt16 mnCurPageId;
+ sal_uInt16 mnActPageId;
+ sal_uInt16 mnCurPageId;
bool mbFormat;
bool mbRestoreHelpId;
bool mbRestoreUnqId;
bool mbSmallInvalidate;
- bool mbLayoutDirty;
+ bool mbLayoutDirty;
Link maActivateHdl;
Link maDeactivateHdl;
@@ -83,6 +83,7 @@ public:
TabControl( vcl::Window* pParent,
WinBits nStyle = WB_STDTABCONTROL );
virtual ~TabControl();
+ virtual void dispose() SAL_OVERRIDE;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
diff --git a/include/vcl/tabdlg.hxx b/include/vcl/tabdlg.hxx
index f02efc726596..db3f592ea20b 100644
--- a/include/vcl/tabdlg.hxx
+++ b/include/vcl/tabdlg.hxx
@@ -29,8 +29,8 @@ class TabControl;
class VCL_DLLPUBLIC TabDialog : public Dialog
{
private:
- FixedLine* mpFixedLine;
- vcl::Window* mpViewWindow;
+ VclPtr<FixedLine> mpFixedLine;
+ VclPtr<vcl::Window> mpViewWindow;
WindowAlign meViewAlign;
bool mbPosControls;
@@ -41,7 +41,8 @@ public:
TabDialog( vcl::Window* pParent,
WinBits nStyle = WB_STDTABDIALOG );
TabDialog( vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription );
- virtual ~TabDialog();
+ virtual ~TabDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
diff --git a/include/vcl/tabpage.hxx b/include/vcl/tabpage.hxx
index c7361972ccb1..702a42c756b6 100644
--- a/include/vcl/tabpage.hxx
+++ b/include/vcl/tabpage.hxx
@@ -41,6 +41,8 @@ private:
public:
explicit TabPage( vcl::Window* pParent, WinBits nStyle = 0 );
explicit TabPage( vcl::Window *pParent, const OString& rID, const OUString& rUIXMLDescription );
+ virtual ~TabPage();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
virtual void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags ) SAL_OVERRIDE;
diff --git a/include/vcl/taskpanelist.hxx b/include/vcl/taskpanelist.hxx
index c8a6abd0e489..738f2b81f3a9 100644
--- a/include/vcl/taskpanelist.hxx
+++ b/include/vcl/taskpanelist.hxx
@@ -27,7 +27,7 @@
class VCL_DLLPUBLIC TaskPaneList
{
- ::std::vector<vcl::Window *> mTaskPanes;
+ ::std::vector< VclPtr<vcl::Window> > mTaskPanes;
vcl::Window *FindNextFloat( vcl::Window *pWindow, bool bForward = true );
vcl::Window *FindNextSplitter( vcl::Window *pWindow, bool bForward = true );
diff --git a/include/vcl/texteng.hxx b/include/vcl/texteng.hxx
index 3464b2460629..f5273d9d9b33 100644
--- a/include/vcl/texteng.hxx
+++ b/include/vcl/texteng.hxx
@@ -20,6 +20,7 @@
#define INCLUDED_VCL_TEXTENG_HXX
#include <vcl/dllapi.h>
+#include <vcl/vclptr.hxx>
class TextDoc;
class TextView;
@@ -91,7 +92,7 @@ class VCL_DLLPUBLIC TextEngine : public SfxBroadcaster
private:
TextDoc* mpDoc;
TEParaPortions* mpTEParaPortions;
- OutputDevice* mpRefDev;
+ VclPtr<OutputDevice> mpRefDev;
TextViews* mpViews;
TextView* mpActiveView;
diff --git a/include/vcl/throbber.hxx b/include/vcl/throbber.hxx
index aaf8edf5fba5..f7cbbedf62e2 100644
--- a/include/vcl/throbber.hxx
+++ b/include/vcl/throbber.hxx
@@ -48,6 +48,7 @@ public:
public:
Throbber(vcl::Window* i_parentWindow, WinBits i_style, const ImageSet i_imageSet = IMAGES_AUTO);
virtual ~Throbber();
+ virtual void dispose() SAL_OVERRIDE;
// Properties
void setStepTime( sal_Int32 nStepTime ) { mnStepTime = nStepTime; }
diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index d723e6ee3ab1..269c51883836 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -42,7 +42,7 @@ class PopupMenu;
class VCL_DLLPUBLIC ToolBoxCustomizeEvent
{
private:
- ToolBox* mpTargetBox;
+ VclPtr<ToolBox> mpTargetBox;
void* mpData;
sal_uInt16 mnIdFrom;
sal_uInt16 mnPosTo;
@@ -131,7 +131,7 @@ private:
Rectangle maOutDockRect;
Rectangle maInDockRect;
Rectangle maPaintRect;
- FloatingWindow* mpFloatWin;
+ VclPtr<FloatingWindow> mpFloatWin;
sal_uInt16 mnKeyModifier;
long mnDX;
long mnDY;
@@ -281,7 +281,8 @@ protected:
public:
ToolBox( vcl::Window* pParent, WinBits nStyle = 0 );
ToolBox( vcl::Window* pParent, const ResId& rResId );
- virtual ~ToolBox();
+ virtual ~ToolBox();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Click();
void DoubleClick();
diff --git a/include/vcl/vclevent.hxx b/include/vcl/vclevent.hxx
index 4e165a438643..99f329e8da65 100644
--- a/include/vcl/vclevent.hxx
+++ b/include/vcl/vclevent.hxx
@@ -24,13 +24,14 @@
#include <tools/rtti.hxx>
#include <vcl/dllapi.h>
#include <vcl/impdel.hxx>
+#include <vcl/vclptr.hxx>
+#include <vcl/window.hxx>
#include <com/sun/star/uno/Reference.hxx>
#include <list>
#include <vector>
-namespace vcl { class Window; }
class Menu;
namespace com { namespace sun { namespace star {
@@ -213,12 +214,12 @@ public:
class VCL_DLLPUBLIC VclWindowEvent : public VclSimpleEvent
{
private:
- vcl::Window* pWindow;
+ VclPtr<vcl::Window> pWindow;
void* pData;
public:
- VclWindowEvent( vcl::Window* pWin, sal_uLong n, void* pDat = NULL ) : VclSimpleEvent(n) { pWindow = pWin; pData = pDat; }
- virtual ~VclWindowEvent() {}
+ VclWindowEvent( vcl::Window* pWin, sal_uLong n, void* pDat = NULL );
+ virtual ~VclWindowEvent();
TYPEINFO_OVERRIDE();
vcl::Window* GetWindow() const { return pWindow; }
diff --git a/include/vcl/vclmedit.hxx b/include/vcl/vclmedit.hxx
index 649725b1c1f2..034c25412969 100644
--- a/include/vcl/vclmedit.hxx
+++ b/include/vcl/vclmedit.hxx
@@ -25,7 +25,6 @@
#include <vcl/edit.hxx>
#include <vcl/dllapi.h>
-
class ImpVclMEdit;
class Timer;
class ExtTextEngine;
@@ -58,8 +57,10 @@ protected:
ScrollBar* GetVScrollBar() const;
public:
- VclMultiLineEdit( vcl::Window* pParent, WinBits nWinStyle = WB_LEFT | WB_BORDER );
- virtual ~VclMultiLineEdit();
+ VclMultiLineEdit( vcl::Window* pParent,
+ WinBits nWinStyle = WB_LEFT | WB_BORDER );
+ virtual ~VclMultiLineEdit();
+ virtual void dispose() SAL_OVERRIDE;
void SelectionChanged();
void CaretChanged();
diff --git a/include/vcl/vclptr.hxx b/include/vcl/vclptr.hxx
new file mode 100644
index 000000000000..5ad0bdabfd2d
--- /dev/null
+++ b/include/vcl/vclptr.hxx
@@ -0,0 +1,357 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_VCL_PTR_HXX
+#define INCLUDED_VCL_PTR_HXX
+
+#include <rtl/ref.hxx>
+#include <cstddef>
+#include <utility>
+#include <type_traits>
+
+/// @cond INTERNAL
+namespace vcl { namespace detail {
+
+// A mechanism to enable up-casts, used by the VclReference conversion constructor,
+// heavily borrowed from boost::is_base_and_derived
+// (which manages to avoid compilation problems with ambiguous bases and cites
+// comp.lang.c++.moderated mail <http://groups.google.com/groups?
+// selm=df893da6.0301280859.522081f7%40posting.google.com> "SuperSubclass
+// (is_base_and_derived) complete implementation!" by Rani Sharoni and cites
+// Aleksey Gurtovoy for the workaround for MSVC), to avoid including Boost
+// headers in URE headers (could ultimately be based on C++11 std::is_base_of):
+
+template< typename T1, typename T2 > struct UpCast {
+private:
+ template< bool, typename U1, typename > struct C
+ { typedef U1 t; };
+
+ template< typename U1, typename U2 > struct C< false, U1, U2 >
+ { typedef U2 t; };
+
+ struct S { char c[2]; };
+
+#if defined _MSC_VER
+ static char f(T2 *, long);
+ static S f(T1 * const &, int);
+#else
+ template< typename U > static char f(T2 *, U);
+ static S f(T1 *, int);
+#endif
+
+ struct H {
+ H(); // avoid C2514 "class has no constructors" from MSVC 2008
+#if defined _MSC_VER
+ operator T1 * const & () const;
+#else
+ operator T1 * () const;
+#endif
+ operator T2 * ();
+ };
+
+public:
+ typedef typename C< sizeof (f(H(), 0)) == 1, void *, void >::t t;
+};
+
+}; }; // namespace detail, namespace vcl
+
+namespace vcl { class Window; }
+
+/**
+ * A thin wrapper around rtl::Reference to implement the acquire and dispose semantics we want for references to vcl::Window subclasses.
+ *
+ * For more details on the design please see vcl/README.lifecycle
+ *
+ * @param reference_type must be a subclass of vcl::Window
+ */
+template <class reference_type>
+class VclPtr
+{
+ ::rtl::Reference<reference_type> m_rInnerRef;
+
+public:
+ /** Constructor...
+ */
+ inline VclPtr()
+ : m_rInnerRef()
+ {}
+
+ /** Constructor...
+ */
+ inline VclPtr (reference_type * pBody)
+ : m_rInnerRef(pBody)
+ {}
+
+ /** Constructor... that doesn't take a ref.
+ */
+ inline VclPtr (reference_type * pBody, __sal_NoAcquire)
+ : m_rInnerRef(pBody, SAL_NO_ACQUIRE)
+ {}
+
+ /** Copy constructor...
+ */
+ inline VclPtr (const VclPtr<reference_type> & handle)
+ : m_rInnerRef (handle.m_rInnerRef)
+ {}
+
+ /** Up-casting conversion constructor: Copies interface reference.
+
+ Does not work for up-casts to ambiguous bases. For the special case of
+ up-casting to Reference< XInterface >, see the corresponding conversion
+ operator.
+
+ @param rRef another reference
+ */
+ template< class derived_type >
+ inline VclPtr(
+ const VclPtr< derived_type > & rRef,
+ typename ::vcl::detail::UpCast< reference_type, derived_type >::t = 0 )
+ : m_rInnerRef( static_cast<reference_type*>(rRef) )
+ {
+ }
+
+ /**
+ * A construction helper for VclPtr. Since VclPtr types are created
+ * with a reference-count of one - to help fit into the existing
+ * code-flow; this helps us to construct them easily.
+ *
+ * For more details on the design please see vcl/README.lifecycle
+ *
+ * @param reference_type must be a subclass of vcl::Window
+ */
+ template<typename... Arg> static VclPtr< reference_type > Create(Arg &&... arg)
+ {
+ return VclPtr< reference_type >( new reference_type(std::forward<Arg>(arg)...), SAL_NO_ACQUIRE );
+ }
+
+ /** Probably most common used: handle->someBodyOp().
+ */
+ inline reference_type * SAL_CALL operator->() const
+ {
+ return m_rInnerRef.get();
+ }
+
+ /** Get the body. Can be used instead of operator->().
+ I.e. handle->someBodyOp() and handle.get()->someBodyOp()
+ are the same.
+ */
+ inline reference_type * SAL_CALL get() const
+ {
+ return m_rInnerRef.get();
+ }
+
+ inline void SAL_CALL set(reference_type *pBody)
+ {
+ m_rInnerRef.set(pBody);
+ }
+
+ inline void SAL_CALL reset(reference_type *pBody)
+ {
+ m_rInnerRef.set(pBody);
+ }
+
+ /** Up-casting conversion constructor: Copies interface reference.
+
+ Does not work for up-casts to ambiguous bases. For the special case of
+ up-casting to Reference< XInterface >, see the corresponding conversion
+ operator.
+
+ @param rRef another reference
+ */
+ template< class derived_type, class = typename std::enable_if< ::vcl::detail::UpCast< reference_type, derived_type >::t >::type >
+ inline VclPtr<reference_type>& SAL_CALL operator= (derived_type * pBody)
+ {
+ m_rInnerRef.set(pBody);
+ return *this;
+ }
+
+ inline SAL_CALL operator reference_type * () const
+ {
+ return m_rInnerRef.get();
+ }
+
+ inline SAL_CALL operator bool () const
+ {
+ return m_rInnerRef.get() != NULL;
+ }
+
+ inline void SAL_CALL clear()
+ {
+ m_rInnerRef.clear();
+ }
+
+ inline void SAL_CALL reset()
+ {
+ m_rInnerRef.clear();
+ }
+
+ inline void disposeAndClear()
+ {
+ // hold it alive for the lifetime of this method
+ ::rtl::Reference<reference_type> aTmp(m_rInnerRef);
+ m_rInnerRef.clear(); // we should use some 'swap' method ideally ;-)
+ if (aTmp.get()) {
+ aTmp->disposeOnce();
+ }
+ }
+
+ /** Returns True if handle points to the same body.
+ */
+ template<class T>
+ inline bool SAL_CALL operator== (const VclPtr<T> & handle) const
+ {
+ return (get() == handle.get());
+ }
+
+ /** Needed to place VclPtr's into STL collection.
+ */
+ inline bool SAL_CALL operator!= (const VclPtr<reference_type> & handle) const
+ {
+ return (m_rInnerRef != handle.m_rInnerRef);
+ }
+
+ /** Makes comparing against NULL easier, resolves compile-time ambiguity */
+ inline bool SAL_CALL operator!= (::std::nullptr_t ) const
+ {
+ return (get() != nullptr);
+ }
+
+ /** Needed to place VclPtr's into STL collection.
+ */
+ inline bool SAL_CALL operator< (const VclPtr<reference_type> & handle) const
+ {
+ return (m_rInnerRef < handle.m_rInnerRef);
+ }
+
+ /** Needed to place VclPtr's into STL collection.
+ */
+ inline bool SAL_CALL operator> (const VclPtr<reference_type> & handle) const
+ {
+ return (m_rInnerRef > handle.m_rInnerRef);
+ }
+}; // class VclPtr
+
+/**
+ * A construction helper for a temporary VclPtr. Since VclPtr types
+ * are created with a reference-count of one - to help fit into
+ * the existing code-flow; this helps us to construct them easily.
+ * see also VclPtr::Create and ScopedVclPtr
+ *
+ * For more details on the design please see vcl/README.lifecycle
+ *
+ * @param reference_type must be a subclass of vcl::Window
+ */
+template <class reference_type>
+class VclPtrInstance : public VclPtr<reference_type>
+{
+public:
+ template<typename... Arg> VclPtrInstance(Arg &&... arg)
+ : VclPtr<reference_type>( new reference_type(std::forward<Arg>(arg)...), SAL_NO_ACQUIRE )
+ {
+ }
+};
+
+template <class reference_type>
+class ScopedVclPtr : public VclPtr<reference_type>
+{
+public:
+ /** Constructor...
+ */
+ inline ScopedVclPtr()
+ : VclPtr<reference_type>()
+ {}
+
+ /** Constructor
+ */
+ inline ScopedVclPtr (reference_type * pBody)
+ : VclPtr<reference_type>(pBody)
+ {}
+
+ /** Copy constructor...
+ */
+ inline ScopedVclPtr (const VclPtr<reference_type> & handle)
+ : VclPtr<reference_type>(handle)
+ {}
+
+ /**
+ Assignment that releases the last reference.
+ */
+ inline ScopedVclPtr<reference_type>& SAL_CALL operator= (reference_type * pBody)
+ {
+ VclPtr<reference_type>::disposeAndClear();
+ VclPtr<reference_type>::set(pBody);
+ return *this;
+ }
+
+ /** Up-casting conversion constructor: Copies interface reference.
+
+ Does not work for up-casts to ambiguous bases. For the special case of
+ up-casting to Reference< XInterface >, see the corresponding conversion
+ operator.
+
+ @param rRef another reference
+ */
+ template< class derived_type >
+ inline ScopedVclPtr(
+ const VclPtr< derived_type > & rRef,
+ typename ::vcl::detail::UpCast< reference_type, derived_type >::t = 0 )
+ : VclPtr<reference_type>( rRef )
+ {
+ }
+
+ ~ScopedVclPtr()
+ {
+ VclPtr<reference_type>::disposeAndClear();
+ assert(VclPtr<reference_type>::get() == nullptr); // make sure there are no lingering references
+ }
+
+private:
+ // Most likely we don't want this default copy-construtor.
+ ScopedVclPtr (const ScopedVclPtr<reference_type> &) SAL_DELETED_FUNCTION;
+ // And certainly we don't want a default assignment operator.
+ ScopedVclPtr<reference_type>& SAL_CALL operator= (const ScopedVclPtr<reference_type> &) SAL_DELETED_FUNCTION;
+
+protected:
+ inline ScopedVclPtr (reference_type * pBody, __sal_NoAcquire)
+ : VclPtr<reference_type>(pBody, SAL_NO_ACQUIRE)
+ {}
+};
+
+/**
+ * A construction helper for ScopedVclPtr. Since VclPtr types are created
+ * with a reference-count of one - to help fit into the existing
+ * code-flow; this helps us to construct them easily.
+ *
+ * For more details on the design please see vcl/README.lifecycle
+ *
+ * @param reference_type must be a subclass of vcl::Window
+ */
+template <class reference_type>
+class ScopedVclPtrInstance : public ScopedVclPtr<reference_type>
+{
+public:
+ template<typename... Arg> ScopedVclPtrInstance(Arg &&... arg)
+ : ScopedVclPtr<reference_type>( new reference_type(std::forward<Arg>(arg)...), SAL_NO_ACQUIRE )
+ {
+ }
+};
+
+#endif // INCLUDED_VCL_PTR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/virdev.hxx b/include/vcl/virdev.hxx
index 06dbae6ddffa..3720a19c98f3 100644
--- a/include/vcl/virdev.hxx
+++ b/include/vcl/virdev.hxx
@@ -35,8 +35,8 @@ class VCL_DLLPUBLIC VirtualDevice : public OutputDevice
private:
SalVirtualDevice* mpVirDev;
- VirtualDevice* mpPrev;
- VirtualDevice* mpNext;
+ VclPtr<VirtualDevice> mpPrev;
+ VclPtr<VirtualDevice> mpNext;
sal_uInt16 mnBitCount;
bool mbScreenComp;
sal_Int8 mnAlphaDepth;
@@ -118,6 +118,7 @@ public:
sal_uInt16 nBitCount);
virtual ~VirtualDevice();
+ virtual void dispose() SAL_OVERRIDE;
virtual void EnableRTL( bool bEnable = true ) SAL_OVERRIDE;
diff --git a/include/vcl/waitobj.hxx b/include/vcl/waitobj.hxx
index d6deecf33f29..daf0e2a68a4f 100644
--- a/include/vcl/waitobj.hxx
+++ b/include/vcl/waitobj.hxx
@@ -26,7 +26,7 @@
class VCL_DLLPUBLIC WaitObject
{
private:
- vcl::Window* mpWindow;
+ VclPtr<vcl::Window> mpWindow;
public:
WaitObject( vcl::Window* pWindow )
{
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index bc20cbe7550b..3134e5012258 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -31,9 +31,7 @@
#include <vcl/apptypes.hxx>
#include <vcl/cursor.hxx>
#include <vcl/inputctx.hxx>
-#include <vcl/vclevent.hxx>
-// Only for compatibility - because many people outside haven't included event.hxx
-#include <vcl/event.hxx>
+#include <vcl/keycodes.hxx>
#include <vcl/region.hxx>
#include <vcl/salnativewidgets.hxx>
#include <rtl/ustring.hxx>
@@ -63,6 +61,7 @@ class CommandEvent;
class TrackingEvent;
class HelpEvent;
class DataChangedEvent;
+class VclSimpleEvent;
class NotifyEvent;
class SystemWindow;
class SalFrame;
@@ -119,6 +118,8 @@ namespace vcl {
namespace svt { class PopupWindowControllerImpl; }
+template<class T> class VclPtr;
+
// - WindowTypes -
@@ -361,6 +362,8 @@ class VclBuilder;
class ImplDockingWindowWrapper;
class ImplPopupFloatWin;
class MenuFloatingWindow;
+class LifecycleTest;
+
namespace svt { class PopupWindowControllerImpl; }
struct WindowResHeader
@@ -390,6 +393,7 @@ class VCL_DLLPUBLIC Window : public ::OutputDevice, public Resource
friend class ::ImplBorderWindow;
friend class ::VclBuilder;
friend class ::PaintHelper;
+ friend class ::LifecycleTest;
// TODO: improve missing functionality
// only required because of SetFloatingMode()
@@ -411,12 +415,6 @@ private:
WindowImpl* mpWindowImpl;
- // This is a first attempt to start to remove the dependency of Window on
- // OutputDevice
- ::OutputDevice* mpOutputDevice;
-
- mutable int mnRefCnt; // reference count
-
#ifdef DBG_UTIL
friend const char* ::ImplDbgCheckWindow( const void* pObj );
#endif
@@ -495,24 +493,10 @@ public:
SAL_DLLPRIVATE static void ImplCalcSymbolRect( Rectangle& rRect );
-private:
- template<typename T> friend class ::rtl::Reference;
-
- inline void acquire() const
- {
- mnRefCnt++;
- }
-
- inline void release() const
- {
- if (!--mnRefCnt)
- delete this;
- }
-
protected:
/** This is intended to be used to clear any locally held references to other Window-subclass objects */
- virtual void dispose() {}
+ virtual void dispose() SAL_OVERRIDE;
SAL_DLLPRIVATE void ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* pSystemParentData );
@@ -656,7 +640,7 @@ private:
SAL_DLLPRIVATE long ImplGetUnmirroredOutOffX();
// retrieves the list of owner draw decorated windows for this window hiearchy
- SAL_DLLPRIVATE ::std::vector<vcl::Window *>& ImplGetOwnerDrawList();
+ SAL_DLLPRIVATE ::std::vector<VclPtr<vcl::Window> >& ImplGetOwnerDrawList();
SAL_DLLPRIVATE vcl::Window* ImplGetTopmostFrameWindow();
@@ -706,8 +690,8 @@ public:
Window( vcl::Window* pParent, const ResId& rResId );
virtual ~Window();
- ::OutputDevice const* GetOutDev() const { return mpOutputDevice; };
- ::OutputDevice* GetOutDev() { return mpOutputDevice; };
+ ::OutputDevice const* GetOutDev() const;
+ ::OutputDevice* GetOutDev();
virtual void EnableRTL ( bool bEnable = true ) SAL_OVERRIDE;
virtual void MouseMove( const MouseEvent& rMEvt );
@@ -765,6 +749,7 @@ public:
bool IsMenuFloatingWindow() const;
bool IsToolbarFloatingWindow() const;
bool IsTopWindow() const;
+ bool IsDisposed() const;
SystemWindow* GetSystemWindow() const;
void EnableAllResize( bool bEnable = true );
@@ -1424,7 +1409,7 @@ public:
*/
void add_mnemonic_label(FixedText *pLabel);
void remove_mnemonic_label(FixedText *pLabel);
- std::vector<FixedText*> list_mnemonic_labels() const;
+ std::vector<VclPtr<FixedText> > list_mnemonic_labels() const;
/*
* Move this widget to be the nNewPosition'd child of its parent
@@ -1468,6 +1453,11 @@ public:
}
+// Only for compatibility - because many people outside haven't included event.hxx
+// These require Window to be defined for VclPtr<Window>
+#include <vcl/vclevent.hxx>
+#include <vcl/event.hxx>
+
#endif // INCLUDED_VCL_WINDOW_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/wrkwin.hxx b/include/vcl/wrkwin.hxx
index 637bfc8779a6..9fa12281bc02 100644
--- a/include/vcl/wrkwin.hxx
+++ b/include/vcl/wrkwin.hxx
@@ -66,6 +66,7 @@ public:
explicit WorkWindow( vcl::Window* pParent, const ::com::sun::star::uno::Any& aSystemWorkWindowToken, WinBits nStyle = WB_STDWORK );
explicit WorkWindow( SystemParentData* pParent ); // Not in the REMOTE-Version
virtual ~WorkWindow();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool Close() SAL_OVERRIDE;
diff --git a/lotuswordpro/source/filter/lwppagelayout.cxx b/lotuswordpro/source/filter/lwppagelayout.cxx
index d5b22e58d834..08b76150a4ff 100644
--- a/lotuswordpro/source/filter/lwppagelayout.cxx
+++ b/lotuswordpro/source/filter/lwppagelayout.cxx
@@ -640,12 +640,12 @@ void LwpPageLayout::GetWidthAndHeight(double& fWidth, double& fHeight)
if(GetUsePrinterSettings())
{
//replaced by printer paper size
- Printer aPrinter;
- bool bScreen = aPrinter.IsDisplayPrinter();
+ ScopedVclPtrInstance< Printer > pPrinter;
+ bool bScreen = pPrinter->IsDisplayPrinter();
if (!bScreen)//Printer available
{
- Size aPaperSize = aPrinter.GetPaperSize();
- aPaperSize = aPrinter.PixelToLogic( aPaperSize, MapMode( MAP_10TH_MM ) );
+ Size aPaperSize = pPrinter->GetPaperSize();
+ aPaperSize = pPrinter->PixelToLogic( aPaperSize, MapMode( MAP_10TH_MM ) );
fWidth = static_cast<double>(aPaperSize.Width())/100; //cm unit
fHeight = static_cast<double>(aPaperSize.Height())/100;
}
diff --git a/mysqlc/source/mysqlc_connection.cxx b/mysqlc/source/mysqlc_connection.cxx
index d26558bae931..47ffd8d8e824 100644
--- a/mysqlc/source/mysqlc_connection.cxx
+++ b/mysqlc/source/mysqlc_connection.cxx
@@ -531,7 +531,7 @@ void SAL_CALL OConnection::close()
MutexGuard aGuard(m_aMutex);
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
}
- dispose();
+ disposeOnce();
}
// XWarningsSupplier
diff --git a/mysqlc/source/mysqlc_resultset.cxx b/mysqlc/source/mysqlc_resultset.cxx
index 2ef646c906f0..662cd458cf99 100644
--- a/mysqlc/source/mysqlc_resultset.cxx
+++ b/mysqlc/source/mysqlc_resultset.cxx
@@ -615,7 +615,7 @@ void SAL_CALL OResultSet::close() throw(SQLException, RuntimeException, std::exc
mysqlc_sdbc_driver::translateAndThrow(e, *this, m_encoding);
}
- dispose();
+ disposeOnce();
}
sal_Bool SAL_CALL OResultSet::first() throw(SQLException, RuntimeException, std::exception)
diff --git a/mysqlc/source/mysqlc_statement.cxx b/mysqlc/source/mysqlc_statement.cxx
index f2a15d38f7af..c645a815ee37 100644
--- a/mysqlc/source/mysqlc_statement.cxx
+++ b/mysqlc/source/mysqlc_statement.cxx
@@ -138,7 +138,7 @@ void SAL_CALL OCommonStatement::close()
MutexGuard aGuard(m_aMutex);
checkDisposed(rBHelper.bDisposed);
}
- dispose();
+ disposeOnce();
}
void SAL_CALL OStatement::clearBatch()
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.cxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.cxx
index 0530fedb2aec..2c535c924be0 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.cxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SConnection.cxx
@@ -318,7 +318,7 @@ void SAL_CALL OConnection::close( ) throw(SQLException, RuntimeException)
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
}
- dispose();
+ disposeOnce();
}
// XWarningsSupplier
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.cxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.cxx
index 40582fc07dd3..ece9cea5fb5e 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.cxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.cxx
@@ -410,7 +410,7 @@ void SAL_CALL OResultSet::close( ) throw(SQLException, RuntimeException)
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
}
- dispose();
+ disposeOnce();
}
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SStatement.cxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SStatement.cxx
index bc84cc43c9d5..57ac76492579 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SStatement.cxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SStatement.cxx
@@ -133,7 +133,7 @@ void SAL_CALL OStatement_Base::close( ) throw(SQLException, RuntimeException)
checkDisposed(OStatement_BASE::rBHelper.bDisposed);
}
- dispose();
+ disposeOnce();
}
diff --git a/reportdesign/source/ui/dlg/AddField.cxx b/reportdesign/source/ui/dlg/AddField.cxx
index d9c6e05b8608..7a7c03b0b331 100644
--- a/reportdesign/source/ui/dlg/AddField.cxx
+++ b/reportdesign/source/ui/dlg/AddField.cxx
@@ -62,11 +62,12 @@ using namespace ::svx;
class OAddFieldWindowListBox: public SvTreeListBox
{
- OAddFieldWindow* m_pTabWin;
+ VclPtr<OAddFieldWindow> m_pTabWin;
public:
OAddFieldWindowListBox( OAddFieldWindow* _pParent );
virtual ~OAddFieldWindowListBox();
+ virtual void dispose() SAL_OVERRIDE;
sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) SAL_OVERRIDE;
sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) SAL_OVERRIDE;
@@ -113,8 +114,14 @@ OAddFieldWindowListBox::OAddFieldWindowListBox( OAddFieldWindow* _pParent )
OAddFieldWindowListBox::~OAddFieldWindowListBox()
{
+ disposeOnce();
}
+void OAddFieldWindowListBox::dispose()
+{
+ m_pTabWin.clear();
+ SvTreeListBox::dispose();
+}
sal_Int8 OAddFieldWindowListBox::AcceptDrop( const AcceptDropEvent& /*rEvt*/ )
{
@@ -151,11 +158,11 @@ OAddFieldWindow::OAddFieldWindow(vcl::Window* pParent
,::comphelper::OPropertyChangeListener(m_aMutex)
,::comphelper::OContainerListener(m_aMutex)
,m_xRowSet(_xRowSet)
- ,m_aActions(this,ModuleRes(RID_TB_SORTING))
- ,m_pListBox(new OAddFieldWindowListBox( this ))
- ,m_aFixedLine(this, ModuleRes(ADDFIELD_FL_HELP_SEPARATOR) )
- ,m_aHelpText(this, ModuleRes(ADDFIELD_HELP_FIELD) )
- ,m_aInsertButton(this, WB_TABSTOP|WB_CENTER)
+ ,m_aActions(VclPtr<ToolBox>::Create(this,ModuleRes(RID_TB_SORTING)))
+ ,m_pListBox(VclPtr<OAddFieldWindowListBox>::Create( this ))
+ ,m_aFixedLine(VclPtr<FixedLine>::Create(this, ModuleRes(ADDFIELD_FL_HELP_SEPARATOR) ))
+ ,m_aHelpText(VclPtr<FixedText>::Create(this, ModuleRes(ADDFIELD_HELP_FIELD) ))
+ ,m_aInsertButton(VclPtr<PushButton>::Create(this, WB_TABSTOP|WB_CENTER))
,m_nCommandType(0)
,m_bEscapeProcessing(false)
,m_pChangeListener(NULL)
@@ -165,13 +172,13 @@ OAddFieldWindow::OAddFieldWindow(vcl::Window* pParent
SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) );
SetMinOutputSizePixel(Size(STD_WIN_SIZE_X,STD_WIN_SIZE_Y));
- m_aActions.SetStyle(m_aActions.GetStyle()|WB_LINESPACING);
- m_aActions.SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) );
+ m_aActions->SetStyle(m_aActions->GetStyle()|WB_LINESPACING);
+ m_aActions->SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) );
- m_aActions.SetSelectHdl(LINK(this, OAddFieldWindow, OnSortAction));
- setToolBox(&m_aActions);
- m_aActions.CheckItem(SID_FM_SORTUP);
- m_aActions.EnableItem(SID_ADD_CONTROL_PAIR, false);
+ m_aActions->SetSelectHdl(LINK(this, OAddFieldWindow, OnSortAction));
+ setToolBox(m_aActions.get());
+ m_aActions->CheckItem(SID_FM_SORTUP);
+ m_aActions->EnableItem(SID_ADD_CONTROL_PAIR, false);
m_pListBox->SetDoubleClickHdl(LINK( this, OAddFieldWindow, OnDoubleClickHdl ) );
m_pListBox->SetSelectHdl(LINK( this, OAddFieldWindow, OnSelectHdl ) );
@@ -179,12 +186,12 @@ OAddFieldWindow::OAddFieldWindow(vcl::Window* pParent
m_pListBox->SetDoubleClickHdl(LINK( this, OAddFieldWindow, OnDoubleClickHdl ) );
m_pListBox->Show();
const OUString sTitle(ModuleRes(RID_STR_INSERT));
- m_aInsertButton.SetText(sTitle);
- m_aInsertButton.SetClickHdl(LINK( this, OAddFieldWindow, OnDoubleClickHdl ) );
- m_aInsertButton.Show();
+ m_aInsertButton->SetText(sTitle);
+ m_aInsertButton->SetClickHdl(LINK( this, OAddFieldWindow, OnDoubleClickHdl ) );
+ m_aInsertButton->Show();
- m_aFixedLine.SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor() );
- m_aHelpText.SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor() );
+ m_aFixedLine->SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor() );
+ m_aHelpText->SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor() );
SetSizePixel(Size(STD_WIN_SIZE_X,STD_WIN_SIZE_Y));
@@ -209,6 +216,11 @@ OAddFieldWindow::OAddFieldWindow(vcl::Window* pParent
OAddFieldWindow::~OAddFieldWindow()
{
+ disposeOnce();
+}
+
+void OAddFieldWindow::dispose()
+{
if ( m_pListBox.get() )
{
SvTreeList* pModel = m_pListBox->GetModel();
@@ -222,6 +234,13 @@ OAddFieldWindow::~OAddFieldWindow()
m_pChangeListener->dispose();
if ( m_pContainerListener.is() )
m_pContainerListener->dispose();
+
+ m_aActions.disposeAndClear();
+ m_aFixedLine.disposeAndClear();
+ m_aHelpText.disposeAndClear();
+ m_aInsertButton.disposeAndClear();
+ m_pListBox.disposeAndClear();
+ FloatingWindow::dispose();
}
@@ -307,10 +326,10 @@ void OAddFieldWindow::Update()
{
// ListBox loeschen
m_pListBox->Clear();
- const sal_uInt16 nItemCount = m_aActions.GetItemCount();
+ const sal_uInt16 nItemCount = m_aActions->GetItemCount();
for (sal_uInt16 j = 0; j< nItemCount; ++j)
{
- m_aActions.EnableItem(m_aActions.GetItemId(j),false);
+ m_aActions->EnableItem(m_aActions->GetItemId(j),false);
}
OUString aTitle(ModuleRes(RID_STR_FIELDSELECTION));
@@ -356,7 +375,7 @@ void OAddFieldWindow::Update()
{
for (sal_uInt16 i = 0; i < nItemCount; ++i)
{
- m_aActions.EnableItem(m_aActions.GetItemId(i));
+ m_aActions->EnableItem(m_aActions->GetItemId(i));
}
}
OnSelectHdl(NULL);
@@ -380,15 +399,15 @@ void OAddFieldWindow::Resize()
const Size aFixedTextSize(LogicToPixel( Size( FIXEDTEXT_WIDTH, FIXEDTEXT_HEIGHT ), MAP_APPFONT ));
// ToolBar
- Size aToolbarSize( m_aActions.GetSizePixel() );
+ Size aToolbarSize( m_aActions->GetSizePixel() );
Point aToolbarPos( aRelated.Width(), aRelated.Height());
- m_aActions.SetPosPixel(Point(aToolbarPos.X(), aToolbarPos.Y()));
+ m_aActions->SetPosPixel(Point(aToolbarPos.X(), aToolbarPos.Y()));
Size aLBSize( aWindowSize );
aLBSize.Width() -= ( 2 * aRelated.Width() );
// help text
- const Size aHelpTextSize = m_aHelpText.CalcMinimumSize(aLBSize.Width());
+ const Size aHelpTextSize = m_aHelpText->CalcMinimumSize(aLBSize.Width());
// ListBox
Point aLBPos( aRelated.Width(), aRelated.Height() + aToolbarSize.Height() + aRelated.Height() );
@@ -402,11 +421,11 @@ void OAddFieldWindow::Resize()
// FixedLine
Size aFLSize( aLBSize.Width(),aFixedTextSize.Height() );
Point aFLPos( aRelated.Width(), aLBPos.Y() + aLBSize.Height() + aRelated.Height());
- m_aFixedLine.SetPosSizePixel( aFLPos, aFLSize );
+ m_aFixedLine->SetPosSizePixel( aFLPos, aFLSize );
// Help text
Point aFTPos( aRelated.Width(), aFLPos.Y() + aFLSize.Height() + aRelated.Height() );
- m_aHelpText.SetPosSizePixel( aFTPos, aHelpTextSize );
+ m_aHelpText->SetPosSizePixel( aFTPos, aHelpTextSize );
}
uno::Reference< sdbc::XConnection> OAddFieldWindow::getConnection() const
@@ -477,7 +496,7 @@ void OAddFieldWindow::_elementReplaced( const container::ContainerEvent& /*_rEve
IMPL_LINK( OAddFieldWindow, OnSelectHdl, void* ,/*_pAddFieldDlg*/)
{
- m_aActions.EnableItem(SID_ADD_CONTROL_PAIR, ( m_pListBox.get() && m_pListBox->GetSelectionCount() > 0 ));
+ m_aActions->EnableItem(SID_ADD_CONTROL_PAIR, ( m_pListBox.get() && m_pListBox->GetSelectionCount() > 0 ));
return 0L;
}
@@ -495,7 +514,7 @@ void OAddFieldWindow::setImageList(sal_Int16 _eBitmapSet)
sal_Int16 nN = IMG_ADDFIELD_DLG_SC;
if ( _eBitmapSet == SFX_SYMBOLS_SIZE_LARGE )
nN = IMG_ADDFIELD_DLG_LC;
- m_aActions.SetImageList(ImageList(ModuleRes(nN)));
+ m_aActions->SetImageList(ImageList(ModuleRes(nN)));
}
void OAddFieldWindow::resizeControls(const Size& _rDiff)
@@ -509,27 +528,27 @@ void OAddFieldWindow::resizeControls(const Size& _rDiff)
IMPL_LINK( OAddFieldWindow, OnSortAction, ToolBox*, /*NOTINTERESTEDIN*/ )
{
- const sal_uInt16 nCurItem = m_aActions.GetCurItemId();
+ const sal_uInt16 nCurItem = m_aActions->GetCurItemId();
if ( SID_ADD_CONTROL_PAIR == nCurItem )
OnDoubleClickHdl(NULL);
else
{
- if ( SID_FM_REMOVE_FILTER_SORT == nCurItem || !m_aActions.IsItemChecked(nCurItem) )
+ if ( SID_FM_REMOVE_FILTER_SORT == nCurItem || !m_aActions->IsItemChecked(nCurItem) )
{
- const sal_uInt16 nItemCount = m_aActions.GetItemCount();
+ const sal_uInt16 nItemCount = m_aActions->GetItemCount();
for (sal_uInt16 j = 0; j< nItemCount; ++j)
{
- const sal_uInt16 nItemId = m_aActions.GetItemId(j);
+ const sal_uInt16 nItemId = m_aActions->GetItemId(j);
if ( nCurItem != nItemId )
- m_aActions.CheckItem(nItemId,false);
+ m_aActions->CheckItem(nItemId,false);
}
SvSortMode eSortMode = SortNone;
if ( SID_FM_REMOVE_FILTER_SORT != nCurItem )
{
- m_aActions.CheckItem(nCurItem,!m_aActions.IsItemChecked(nCurItem));
- if ( m_aActions.IsItemChecked(SID_FM_SORTUP) )
+ m_aActions->CheckItem(nCurItem,!m_aActions->IsItemChecked(nCurItem));
+ if ( m_aActions->IsItemChecked(SID_FM_SORTUP) )
eSortMode = SortAscending;
- else if ( m_aActions.IsItemChecked(SID_FM_SORTDOWN) )
+ else if ( m_aActions->IsItemChecked(SID_FM_SORTDOWN) )
eSortMode = SortDescending;
}
diff --git a/reportdesign/source/ui/dlg/CondFormat.cxx b/reportdesign/source/ui/dlg/CondFormat.cxx
index 16aa8a31120e..24e2bce7782f 100644
--- a/reportdesign/source/ui/dlg/CondFormat.cxx
+++ b/reportdesign/source/ui/dlg/CondFormat.cxx
@@ -130,7 +130,16 @@ namespace rptui
ConditionalFormattingDialog::~ConditionalFormattingDialog()
{
+ disposeOnce();
+ }
+
+ void ConditionalFormattingDialog::dispose()
+ {
m_aConditions.clear();
+ m_pConditionPlayground.clear();
+ m_pScrollWindow.clear();
+ m_pCondScroll.clear();
+ ModalDialog::dispose();
}
void ConditionalFormattingDialog::impl_updateConditionIndicies()
@@ -183,7 +192,7 @@ namespace rptui
::comphelper::copyProperties(m_xCopy.get(),xCond.get());
m_xCopy->insertByIndex( _nNewCondIndex, makeAny( xCond ) );
- ConditionPtr pCon( new Condition( m_pConditionPlayground, *this, m_rController ) );
+ VclPtrInstance<Condition> pCon( m_pConditionPlayground, *this, m_rController );
pCon->setCondition( xCond );
pCon->reorderWithinParent(_nNewCondIndex);
m_aConditions.insert( m_aConditions.begin() + _nNewCondIndex, pCon );
@@ -264,7 +273,7 @@ namespace rptui
// do this in two steps, so we don't become inconsistent if any of the UNO actions fails
Any aMovedCondition;
- ConditionPtr pMovedCondition;
+ Condition *pMovedCondition;
try
{
aMovedCondition = m_xCopy->getByIndex( (sal_Int32)nOldConditionIndex );
@@ -342,7 +351,7 @@ namespace rptui
sal_Int32 nCount = m_xCopy->getCount();
for ( sal_Int32 i = 0; i < nCount ; ++i )
{
- ConditionPtr pCon( new Condition( m_pConditionPlayground, *this, m_rController ) );
+ VclPtrInstance<Condition> pCon( m_pConditionPlayground, *this, m_rController );
Reference< XFormatCondition > xCond( m_xCopy->getByIndex(i), UNO_QUERY );
pCon->reorderWithinParent(i);
pCon->setCondition( xCond );
diff --git a/reportdesign/source/ui/dlg/Condition.cxx b/reportdesign/source/ui/dlg/Condition.cxx
index 26e5989dce07..1ef8d1e7bf90 100644
--- a/reportdesign/source/ui/dlg/Condition.cxx
+++ b/reportdesign/source/ui/dlg/Condition.cxx
@@ -97,11 +97,13 @@ IMPL_LINK( ConditionField, OnFormula, Button*, _pClickedButton )
class OColorPopup : public FloatingWindow
{
DECL_LINK( SelectHdl, void * );
- Condition* m_pCondition;
+ VclPtr<Condition> m_pCondition;
sal_uInt16 m_nSlotId;
public:
OColorPopup(vcl::Window* _pParent,Condition* _pCondition);
- ValueSet m_aColorSet;
+ virtual ~OColorPopup();
+ virtual void dispose() SAL_OVERRIDE;
+ VclPtr<ValueSet> m_aColorSet;
virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
@@ -114,9 +116,9 @@ OColorPopup::OColorPopup(vcl::Window* _pParent,Condition* _pCondition)
:FloatingWindow(_pParent, WinBits( WB_BORDER | WB_STDFLOATWIN | WB_3DLOOK|WB_DIALOGCONTROL ))
,m_pCondition(_pCondition)
,m_nSlotId(0)
-,m_aColorSet( this, WinBits( WB_ITEMBORDER | WB_NAMEFIELD | WB_3DLOOK | WB_NO_DIRECTSELECT) )
+,m_aColorSet( VclPtr<ValueSet>::Create(this, WinBits( WB_ITEMBORDER | WB_NAMEFIELD | WB_3DLOOK | WB_NO_DIRECTSELECT)) )
{
- m_aColorSet.SetHelpId( HID_RPT_POPUP_COLOR_CTRL );
+ m_aColorSet->SetHelpId( HID_RPT_POPUP_COLOR_CTRL );
SetHelpId( HID_RPT_POPUP_COLOR );
const Size aSize12( 13, 13 );
short i = 0;
@@ -127,34 +129,47 @@ OColorPopup::OColorPopup(vcl::Window* _pParent,Condition* _pCondition)
if ( nCount > PALETTE_SIZE )
// Show scrollbar if more than PALLETTE_SIZE colors are available
- m_aColorSet.SetStyle( m_aColorSet.GetStyle() | WB_VSCROLL );
+ m_aColorSet->SetStyle( m_aColorSet->GetStyle() | WB_VSCROLL );
for ( i = 0; i < nCount; i++ )
{
XColorEntry* pEntry = pColorList->GetColor(i);
- m_aColorSet.InsertItem( i+1, pEntry->GetColor(), pEntry->GetName() );
+ m_aColorSet->InsertItem( i+1, pEntry->GetColor(), pEntry->GetName() );
}
while ( i < PALETTE_SIZE )
{
// fill empty elements if less then PALLETTE_SIZE colors are available
- m_aColorSet.InsertItem( i+1, aColWhite, aStrWhite );
+ m_aColorSet->InsertItem( i+1, aColWhite, aStrWhite );
i++;
}
- m_aColorSet.SetSelectHdl( LINK( this, OColorPopup, SelectHdl ) );
- m_aColorSet.SetColCount( PALETTE_X );
- m_aColorSet.SetLineCount( PALETTE_Y );
- Size aSize = m_aColorSet.CalcWindowSizePixel( aSize12 );
+ m_aColorSet->SetSelectHdl( LINK( this, OColorPopup, SelectHdl ) );
+ m_aColorSet->SetColCount( PALETTE_X );
+ m_aColorSet->SetLineCount( PALETTE_Y );
+ Size aSize = m_aColorSet->CalcWindowSizePixel( aSize12 );
aSize.Width() += 4;
aSize.Height() += 4;
SetOutputSizePixel( aSize );
- m_aColorSet.Show();
+ m_aColorSet->Show();
+}
+
+OColorPopup::~OColorPopup()
+{
+ disposeOnce();
+}
+
+void OColorPopup::dispose()
+{
+ disposeBuilder();
+ m_aColorSet.clear();
+ m_pCondition.clear();
+ FloatingWindow::dispose();
}
void OColorPopup::KeyInput( const KeyEvent& rKEvt )
{
- m_aColorSet.KeyInput(rKEvt);
+ m_aColorSet->KeyInput(rKEvt);
}
void OColorPopup::Resize()
@@ -162,12 +177,12 @@ void OColorPopup::Resize()
Size aSize = GetOutputSizePixel();
aSize.Width() -= 4;
aSize.Height() -= 4;
- m_aColorSet.SetPosSizePixel( Point(2,2), aSize );
+ m_aColorSet->SetPosSizePixel( Point(2,2), aSize );
}
void OColorPopup::StartSelection()
{
- m_aColorSet.StartSelection();
+ m_aColorSet->StartSelection();
}
void OColorPopup::SetSlotId(sal_uInt16 _nSlotId)
@@ -175,20 +190,20 @@ void OColorPopup::SetSlotId(sal_uInt16 _nSlotId)
m_nSlotId = _nSlotId;
if ( SID_ATTR_CHAR_COLOR_BACKGROUND == _nSlotId || SID_BACKGROUND_COLOR == _nSlotId )
{
- m_aColorSet.SetStyle( m_aColorSet.GetStyle() | WB_NONEFIELD );
- m_aColorSet.SetText( OUString(ModuleRes( STR_TRANSPARENT )) );
+ m_aColorSet->SetStyle( m_aColorSet->GetStyle() | WB_NONEFIELD );
+ m_aColorSet->SetText( OUString(ModuleRes( STR_TRANSPARENT )) );
}
}
IMPL_LINK_NOARG(OColorPopup, SelectHdl)
{
- sal_uInt16 nItemId = m_aColorSet.GetSelectItemId();
- Color aColor( nItemId == 0 ? Color( COL_TRANSPARENT ) : m_aColorSet.GetItemColor( nItemId ) );
+ sal_uInt16 nItemId = m_aColorSet->GetSelectItemId();
+ Color aColor( nItemId == 0 ? Color( COL_TRANSPARENT ) : m_aColorSet->GetItemColor( nItemId ) );
/* #i33380# Moved the following line above the Dispatch() calls.
This instance may be deleted in the meantime (i.e. when a dialog is opened
while in Dispatch()), accessing members will crash in this case. */
- m_aColorSet.SetNoSelection();
+ m_aColorSet->SetNoSelection();
if ( IsInPopupMode() )
EndPopupMode();
@@ -294,20 +309,36 @@ sal_uInt16 Condition::mapToolbarItemToSlotId(sal_uInt16 nItemId) const
Condition::~Condition()
{
+ disposeOnce();
+}
+
+void Condition::dispose()
+{
m_bInDestruction = true;
- delete m_pColorFloat;
delete m_pBtnUpdaterFontColor;
delete m_pCondLHS;
delete m_pCondRHS;
delete m_pBtnUpdaterBackgroundColor;
+ m_pHeader.clear();
+ m_pConditionType.clear();
+ m_pOperationList.clear();
+ m_pOperandGlue.clear();
+ m_pActions.clear();
+ m_pPreview.clear();
+ m_pMoveUp.clear();
+ m_pMoveDown.clear();
+ m_pAddCondition.clear();
+ m_pRemoveCondition.clear();
+ m_pColorFloat.disposeAndClear();
+ VclHBox::dispose();
}
IMPL_LINK( Condition, DropdownClick, ToolBox*, /*pToolBar*/ )
{
sal_uInt16 nId( m_pActions->GetCurItemId() );
if ( !m_pColorFloat )
- m_pColorFloat = new OColorPopup(m_pActions,this);
+ m_pColorFloat = VclPtr<OColorPopup>::Create(m_pActions,this);
sal_uInt16 nTextId = 0;
if (nId == m_nFontColorId)
diff --git a/reportdesign/source/ui/dlg/Condition.hxx b/reportdesign/source/ui/dlg/Condition.hxx
index 14fa15fba7cc..01a3b8cb29cf 100644
--- a/reportdesign/source/ui/dlg/Condition.hxx
+++ b/reportdesign/source/ui/dlg/Condition.hxx
@@ -49,9 +49,9 @@ namespace rptui
class ConditionField
{
- Condition* m_pParent;
- Edit* m_pSubEdit;
- PushButton* m_pFormula;
+ VclPtr<Condition> m_pParent;
+ VclPtr<Edit> m_pSubEdit;
+ VclPtr<PushButton> m_pFormula;
DECL_LINK( OnFormula, Button* );
public:
@@ -77,19 +77,19 @@ namespace rptui
::rptui::OReportController& m_rController;
IConditionalFormatAction& m_rAction;
- FixedText* m_pHeader;
- ListBox* m_pConditionType;
- ListBox* m_pOperationList;
- ConditionField* m_pCondLHS;
- FixedText* m_pOperandGlue;
- ConditionField* m_pCondRHS;
- ToolBox* m_pActions;
- SvxFontPrevWindow* m_pPreview;
- PushButton* m_pMoveUp;
- PushButton* m_pMoveDown;
- PushButton* m_pAddCondition;
- PushButton* m_pRemoveCondition;
- OColorPopup* m_pColorFloat;
+ VclPtr<FixedText> m_pHeader;
+ VclPtr<ListBox> m_pConditionType;
+ VclPtr<ListBox> m_pOperationList;
+ ConditionField* m_pCondLHS;
+ VclPtr<FixedText> m_pOperandGlue;
+ ConditionField* m_pCondRHS;
+ VclPtr<ToolBox> m_pActions;
+ VclPtr<SvxFontPrevWindow> m_pPreview;
+ VclPtr<PushButton> m_pMoveUp;
+ VclPtr<PushButton> m_pMoveDown;
+ VclPtr<PushButton> m_pAddCondition;
+ VclPtr<PushButton> m_pRemoveCondition;
+ VclPtr<OColorPopup> m_pColorFloat;
::svx::ToolboxButtonColorUpdater* m_pBtnUpdaterFontColor; // updates the color below the toolbar icon
::svx::ToolboxButtonColorUpdater* m_pBtnUpdaterBackgroundColor;
@@ -107,6 +107,7 @@ namespace rptui
public:
Condition( vcl::Window* _pParent, IConditionalFormatAction& _rAction, ::rptui::OReportController& _rController );
virtual ~Condition();
+ virtual void dispose() SAL_OVERRIDE;
/** will be called when the id of the image list needs to change.
@param _eBitmapSet
diff --git a/reportdesign/source/ui/dlg/DateTime.cxx b/reportdesign/source/ui/dlg/DateTime.cxx
index eaba66735718..caad1e3bf1aa 100644
--- a/reportdesign/source/ui/dlg/DateTime.cxx
+++ b/reportdesign/source/ui/dlg/DateTime.cxx
@@ -113,6 +113,19 @@ ODateTimeDialog::ODateTimeDialog( vcl::Window* _pParent
ODateTimeDialog::~ODateTimeDialog()
{
+ disposeOnce();
+}
+
+void ODateTimeDialog::dispose()
+{
+ m_pDate.clear();
+ m_pFTDateFormat.clear();
+ m_pDateListBox.clear();
+ m_pTime.clear();
+ m_pFTTimeFormat.clear();
+ m_pTimeListBox.clear();
+ m_pPB_OK.clear();
+ ModalDialog::dispose();
}
short ODateTimeDialog::Execute()
diff --git a/reportdesign/source/ui/dlg/Formula.cxx b/reportdesign/source/ui/dlg/Formula.cxx
index 4d7746303d45..0854653fb21c 100644
--- a/reportdesign/source/ui/dlg/Formula.cxx
+++ b/reportdesign/source/ui/dlg/Formula.cxx
@@ -87,16 +87,21 @@ void FormulaDialog::fill()
FormulaDialog::~FormulaDialog()
{
+ disposeOnce();
+}
+
+void FormulaDialog::dispose()
+{
if ( m_pAddField )
{
SvtViewOptions aDlgOpt( E_WINDOW, OUString( HID_RPT_FIELD_SEL_WIN ) );
aDlgOpt.SetWindowState(OStringToOUString(m_pAddField->GetWindowState((WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y | WINDOWSTATE_MASK_STATE | WINDOWSTATE_MASK_MINIMIZED)), RTL_TEXTENCODING_ASCII_US));
-
- boost::scoped_ptr<vcl::Window> aTemp2(m_pAddField);
- m_pAddField = NULL;
}
StoreFormEditData( m_pFormulaData );
+ m_pEdit.clear();
+ m_pAddField.clear();
+ formula::FormulaModalDialog::dispose();
}
@@ -199,7 +204,7 @@ void FormulaDialog::ToggleCollapsed( RefEdit* _pEdit, RefButton* _pButton)
if ( !m_pAddField )
{
- m_pAddField = new OAddFieldWindow(this,m_xRowSet);
+ m_pAddField = VclPtr<OAddFieldWindow>::Create(this,m_xRowSet);
m_pAddField->SetCreateHdl(LINK( this, FormulaDialog, OnClickHdl ) );
SvtViewOptions aDlgOpt( E_WINDOW, OUString( HID_RPT_FIELD_SEL_WIN ) );
if ( aDlgOpt.Exists() )
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx
index d420b3611531..5b65fc96568c 100644
--- a/reportdesign/source/ui/dlg/GroupsSorting.cxx
+++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx
@@ -76,34 +76,51 @@ using namespace ::comphelper;
}
}
-typedef ::svt::EditBrowseBox OFieldExpressionControl_Base;
-typedef ::cppu::WeakImplHelper1< container::XContainerListener > TContainerListenerBase;
-class OFieldExpressionControl : public TContainerListenerBase
- ,public OFieldExpressionControl_Base
+/**
+ * Separated out from OFieldExpressionControl to prevent collision of ref-counted base classes
+ */
+class OFieldExpressionControl;
+class OFieldExpressionControlContainerListener : public ::cppu::WeakImplHelper1< container::XContainerListener >
+{
+ VclPtr<OFieldExpressionControl> mpParent;
+public:
+ OFieldExpressionControlContainerListener(OFieldExpressionControl* pParent) : mpParent(pParent) {}
+
+ // XEventListener
+ virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
+ // XContainerListener
+ virtual void SAL_CALL elementInserted(const ::com::sun::star::container::ContainerEvent& rEvent) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual void SAL_CALL elementReplaced(const ::com::sun::star::container::ContainerEvent& rEvent) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual void SAL_CALL elementRemoved(const ::com::sun::star::container::ContainerEvent& rEvent) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+};
+
+class OFieldExpressionControl : public ::svt::EditBrowseBox
{
::osl::Mutex m_aMutex;
::std::vector<sal_Int32> m_aGroupPositions;
::std::vector<ColumnInfo> m_aColumnInfo;
- ::svt::ComboBoxControl* m_pComboCell;
+ VclPtr<::svt::ComboBoxControl> m_pComboCell;
sal_Int32 m_nDataPos;
sal_Int32 m_nCurrentPos;
ImplSVEvent * m_nPasteEvent;
ImplSVEvent * m_nDeleteEvent;
- OGroupsSortingDialog* m_pParent;
+ VclPtr<OGroupsSortingDialog> m_pParent;
bool m_bIgnoreEvent;
+ OFieldExpressionControlContainerListener aContainerListener;
bool SaveModified(bool _bAppend);
public:
OFieldExpressionControl(OGroupsSortingDialog* _pParentDialog, vcl::Window *_pParent);
virtual ~OFieldExpressionControl();
+ virtual void dispose() SAL_OVERRIDE;
// XEventListener
- virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
+ void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw( ::com::sun::star::uno::RuntimeException, std::exception );
// XContainerListener
- virtual void SAL_CALL elementInserted(const ::com::sun::star::container::ContainerEvent& rEvent) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
- virtual void SAL_CALL elementReplaced(const ::com::sun::star::container::ContainerEvent& rEvent) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
- virtual void SAL_CALL elementRemoved(const ::com::sun::star::container::ContainerEvent& rEvent) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ void SAL_CALL elementInserted(const ::com::sun::star::container::ContainerEvent& rEvent) throw(::com::sun::star::uno::RuntimeException, std::exception);
+ void SAL_CALL elementReplaced(const ::com::sun::star::container::ContainerEvent& rEvent) throw(::com::sun::star::uno::RuntimeException, std::exception);
+ void SAL_CALL elementRemoved(const ::com::sun::star::container::ContainerEvent& rEvent) throw(::com::sun::star::uno::RuntimeException, std::exception);
virtual Size GetOptimalSize() const SAL_OVERRIDE;
@@ -128,7 +145,7 @@ public:
void moveGroups(const uno::Sequence<uno::Any>& _aGroups,sal_Int32 _nRow,bool _bSelect = true);
virtual bool CursorMoving(long nNewRow, sal_uInt16 nNewCol) SAL_OVERRIDE;
- using OFieldExpressionControl_Base::GetRowCount;
+ using ::svt::EditBrowseBox::GetRowCount;
protected:
virtual bool IsTabAllowed(bool bForward) const SAL_OVERRIDE;
@@ -163,6 +180,20 @@ public:
};
+
+void OFieldExpressionControlContainerListener::disposing(const ::com::sun::star::lang::EventObject& Source) throw( ::com::sun::star::uno::RuntimeException, std::exception )
+{ mpParent->disposing(Source); }
+
+void OFieldExpressionControlContainerListener::elementInserted(const ::com::sun::star::container::ContainerEvent& rEvent) throw(::com::sun::star::uno::RuntimeException, std::exception)
+{ mpParent->elementInserted(rEvent); }
+
+void OFieldExpressionControlContainerListener::elementReplaced(const ::com::sun::star::container::ContainerEvent& rEvent) throw(::com::sun::star::uno::RuntimeException, std::exception)
+{ mpParent->elementReplaced(rEvent); }
+
+void OFieldExpressionControlContainerListener::elementRemoved(const ::com::sun::star::container::ContainerEvent& rEvent) throw(::com::sun::star::uno::RuntimeException, std::exception)
+{ mpParent->elementRemoved(rEvent); }
+
+
// class OFieldExpressionControl
OFieldExpressionControl::OFieldExpressionControl(OGroupsSortingDialog* _pParentDialog, vcl::Window *_pParent)
:EditBrowseBox( _pParent, EditBrowseBoxFlags::NONE, WB_TABSTOP,
@@ -176,6 +207,7 @@ OFieldExpressionControl::OFieldExpressionControl(OGroupsSortingDialog* _pParentD
,m_nDeleteEvent(0)
,m_pParent(_pParentDialog)
,m_bIgnoreEvent(false)
+ ,aContainerListener(this)
{
SetBorderStyle(WindowBorderStyle::MONO);
}
@@ -183,9 +215,15 @@ OFieldExpressionControl::OFieldExpressionControl(OGroupsSortingDialog* _pParentD
OFieldExpressionControl::~OFieldExpressionControl()
{
- WeakImplHelper1::acquire();
+ disposeOnce();
+}
+
+
+void OFieldExpressionControl::dispose()
+{
+ aContainerListener.WeakImplHelper1::acquire();
uno::Reference< report::XGroups > xGroups = m_pParent->getGroups();
- xGroups->removeContainerListener(this);
+ xGroups->removeContainerListener(&aContainerListener);
// delete events from queue
if( m_nPasteEvent )
@@ -193,7 +231,9 @@ OFieldExpressionControl::~OFieldExpressionControl()
if( m_nDeleteEvent )
Application::RemoveUserEvent( m_nDeleteEvent );
- delete m_pComboCell;
+ m_pComboCell.disposeAndClear();
+ m_pParent.clear();
+ ::svt::EditBrowseBox::dispose();
}
uno::Sequence<uno::Any> OFieldExpressionControl::fillSelectedGroups()
@@ -352,7 +392,7 @@ void OFieldExpressionControl::lateInit()
InsertHandleColumn(static_cast<sal_uInt16>(GetTextWidth(OUString('0')) * 4)/*, sal_True */);
InsertDataColumn( FIELD_EXPRESSION, OUString(ModuleRes(STR_RPT_EXPRESSION)), 100);
- m_pComboCell = new ComboBoxControl( &GetDataWindow() );
+ m_pComboCell = VclPtr<ComboBoxControl>::Create( &GetDataWindow() );
m_pComboCell->SetSelectHdl(LINK(this,OFieldExpressionControl,CBChangeHdl));
m_pComboCell->SetHelpId(HID_RPT_FIELDEXPRESSION);
@@ -370,7 +410,7 @@ void OFieldExpressionControl::lateInit()
if( m_pParent->isReadOnly() )
nMode |= BrowserMode::HIDECURSOR;
SetMode(nMode);
- xGroups->addContainerListener(this);
+ xGroups->addContainerListener(&aContainerListener);
}
else
// not the first call
@@ -936,7 +976,7 @@ OGroupsSortingDialog::OGroupsSortingDialog(vcl::Window* _pParent, bool _bReadOnl
get(m_pHelpWindow, "helptext");
m_pHelpWindow->set_height_request(GetTextHeight() * 4);
get(m_pProperties, "properties");
- m_pFieldExpression = new OFieldExpressionControl(this, get<vcl::Window>("box"));
+ m_pFieldExpression = VclPtr<OFieldExpressionControl>::Create(this, get<vcl::Window>("box"));
m_pFieldExpression->set_hexpand(true);
m_pFieldExpression->set_vexpand(true);
@@ -971,11 +1011,26 @@ OGroupsSortingDialog::OGroupsSortingDialog(vcl::Window* _pParent, bool _bReadOnl
OGroupsSortingDialog::~OGroupsSortingDialog()
{
- delete m_pFieldExpression;
+ disposeOnce();
+}
+
+void OGroupsSortingDialog::dispose()
+{
m_xColumns.clear();
m_pReportListener->dispose();
if ( m_pCurrentGroupListener.is() )
m_pCurrentGroupListener->dispose();
+ m_pToolBox.clear();
+ m_pProperties.clear();
+ m_pOrderLst.clear();
+ m_pHeaderLst.clear();
+ m_pFooterLst.clear();
+ m_pGroupOnLst.clear();
+ m_pGroupIntervalEd.clear();
+ m_pKeepTogetherLst.clear();
+ m_pHelpWindow.clear();
+ m_pFieldExpression.disposeAndClear();
+ FloatingWindow::dispose();
}
void OGroupsSortingDialog::UpdateData( )
diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx
index a85071eebd3f..dd4185ddab20 100644
--- a/reportdesign/source/ui/dlg/Navigator.cxx
+++ b/reportdesign/source/ui/dlg/Navigator.cxx
@@ -121,7 +121,7 @@ class NavigatorTree : public ::cppu::BaseMutex
uno::Reference< uno::XInterface > m_xContent;
::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pListener;
::rtl::Reference< comphelper::OContainerListenerAdapter> m_pContainerListener;
- NavigatorTree* m_pTree;
+ VclPtr<NavigatorTree> m_pTree;
public:
UserData(NavigatorTree* _pTree,const uno::Reference<uno::XInterface>& _xContent);
virtual ~UserData();
@@ -182,6 +182,7 @@ protected:
public:
NavigatorTree(vcl::Window* pParent,OReportController& _rController );
virtual ~NavigatorTree();
+ virtual void dispose() SAL_OVERRIDE;
DECL_LINK(OnEntrySelDesel, NavigatorTree*);
DECL_LINK( OnDropActionTimer, void* );
@@ -255,6 +256,11 @@ NavigatorTree::NavigatorTree( vcl::Window* pParent,OReportController& _rControll
NavigatorTree::~NavigatorTree()
{
+ disposeOnce();
+}
+
+void NavigatorTree::dispose()
+{
SvTreeListEntry* pCurrent = First();
while ( pCurrent )
{
@@ -263,6 +269,7 @@ NavigatorTree::~NavigatorTree()
}
m_pReportListener->dispose();
m_pSelectionListener->dispose();
+ SvTreeListBox::dispose();
}
void NavigatorTree::Command( const CommandEvent& rEvt )
@@ -875,13 +882,13 @@ public:
uno::Reference< report::XReportDefinition> m_xReport;
::rptui::OReportController& m_rController;
- ::std::unique_ptr<NavigatorTree> m_pNavigatorTree;
+ VclPtr<NavigatorTree> m_pNavigatorTree;
};
ONavigatorImpl::ONavigatorImpl(OReportController& _rController,ONavigator* _pParent)
:m_xReport(_rController.getReportDefinition())
,m_rController(_rController)
- ,m_pNavigatorTree(new NavigatorTree(_pParent->get<vcl::Window>("box"),_rController))
+ ,m_pNavigatorTree(VclPtr<NavigatorTree>::Create(_pParent->get<vcl::Window>("box"),_rController))
{
reportdesign::OReportVisitor aVisitor(m_pNavigatorTree.get());
aVisitor.start(m_xReport);
diff --git a/reportdesign/source/ui/dlg/PageNumber.cxx b/reportdesign/source/ui/dlg/PageNumber.cxx
index bc2419b412f2..f7a799a53832 100644
--- a/reportdesign/source/ui/dlg/PageNumber.cxx
+++ b/reportdesign/source/ui/dlg/PageNumber.cxx
@@ -63,6 +63,18 @@ OPageNumberDialog::OPageNumberDialog( vcl::Window* _pParent
OPageNumberDialog::~OPageNumberDialog()
{
+ disposeOnce();
+}
+
+void OPageNumberDialog::dispose()
+{
+ m_pPageN.clear();
+ m_pPageNofM.clear();
+ m_pTopPage.clear();
+ m_pBottomPage.clear();
+ m_pAlignmentLst.clear();
+ m_pShowNumberOnFirstPage.clear();
+ ModalDialog::dispose();
}
short OPageNumberDialog::Execute()
diff --git a/reportdesign/source/ui/inc/AddField.hxx b/reportdesign/source/ui/inc/AddField.hxx
index fba3c7abf59c..6a30ee88da2e 100644
--- a/reportdesign/source/ui/inc/AddField.hxx
+++ b/reportdesign/source/ui/inc/AddField.hxx
@@ -54,18 +54,18 @@ class OAddFieldWindow :public FloatingWindow
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xColumns;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xRowSet;
- ToolBox m_aActions;
+ VclPtr<ToolBox> m_aActions;
- ::std::unique_ptr<OAddFieldWindowListBox> m_pListBox;
- FixedLine m_aFixedLine;
- FixedText m_aHelpText;
+ VclPtr<OAddFieldWindowListBox> m_pListBox;
+ VclPtr<FixedLine> m_aFixedLine;
+ VclPtr<FixedText> m_aHelpText;
- PushButton m_aInsertButton;
+ VclPtr<PushButton> m_aInsertButton;
Link m_aCreateLink;
- OUString m_aCommandName;
- OUString m_sFilter;
+ OUString m_aCommandName;
+ OUString m_sFilter;
sal_Int32 m_nCommandType;
- bool m_bEscapeProcessing;
+ bool m_bEscapeProcessing;
::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pChangeListener;
::rtl::Reference< comphelper::OContainerListenerAdapter> m_pContainerListener;
@@ -80,6 +80,7 @@ public:
, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xRowSet);
virtual ~OAddFieldWindow();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
virtual void GetFocus() SAL_OVERRIDE;
virtual bool PreNotify( NotifyEvent& _rNEvt ) SAL_OVERRIDE;
diff --git a/reportdesign/source/ui/inc/ColorChanger.hxx b/reportdesign/source/ui/inc/ColorChanger.hxx
index 7a26c606e05b..247863a03211 100644
--- a/reportdesign/source/ui/inc/ColorChanger.hxx
+++ b/reportdesign/source/ui/inc/ColorChanger.hxx
@@ -27,7 +27,7 @@ namespace rptui
class ColorChanger
{
protected:
- OutputDevice* m_pDev;
+ VclPtr<OutputDevice> m_pDev;
public:
ColorChanger( OutputDevice* _pDev, const Color& _rNewLineColor)
diff --git a/reportdesign/source/ui/inc/ColorListener.hxx b/reportdesign/source/ui/inc/ColorListener.hxx
index e85da835e3df..c0ebffb83922 100644
--- a/reportdesign/source/ui/inc/ColorListener.hxx
+++ b/reportdesign/source/ui/inc/ColorListener.hxx
@@ -48,6 +48,7 @@ namespace rptui
public:
OColorListener(vcl::Window* _pParent,const OUString& _sColorEntry);
virtual ~OColorListener();
+ virtual void dispose() SAL_OVERRIDE;
using Window::Notify;
// SfxListener
diff --git a/reportdesign/source/ui/inc/CondFormat.hxx b/reportdesign/source/ui/inc/CondFormat.hxx
index 19c3cc24440e..e0ebc887027d 100644
--- a/reportdesign/source/ui/inc/CondFormat.hxx
+++ b/reportdesign/source/ui/inc/CondFormat.hxx
@@ -70,14 +70,13 @@ namespace rptui
class ConditionalFormattingDialog :public ModalDialog
,public IConditionalFormatAction
{
- typedef ::boost::shared_ptr< Condition > ConditionPtr;
- typedef ::std::vector< ConditionPtr > Conditions;
+ typedef ::std::vector< VclPtr<Condition> > Conditions;
- OModuleClient m_aModuleClient;
- vcl::Window* m_pConditionPlayground;
- Conditions m_aConditions;
- VclScrolledWindow* m_pScrollWindow;
- ScrollBar* m_pCondScroll;
+ OModuleClient m_aModuleClient;
+ VclPtr<vcl::Window> m_pConditionPlayground;
+ Conditions m_aConditions;
+ VclPtr<VclScrolledWindow> m_pScrollWindow;
+ VclPtr<ScrollBar> m_pCondScroll;
::rptui::OReportController& m_rController;
::com::sun::star::uno::Reference< ::com::sun::star::report::XReportControlModel >
@@ -95,7 +94,7 @@ namespace rptui
::rptui::OReportController& _rController
);
virtual ~ConditionalFormattingDialog();
-
+ virtual void dispose() SAL_OVERRIDE;
// Dialog overridables
virtual short Execute() SAL_OVERRIDE;
diff --git a/reportdesign/source/ui/inc/DateTime.hxx b/reportdesign/source/ui/inc/DateTime.hxx
index e03f3ed2b41c..66639a9cafd8 100644
--- a/reportdesign/source/ui/inc/DateTime.hxx
+++ b/reportdesign/source/ui/inc/DateTime.hxx
@@ -40,13 +40,13 @@ class OReportController;
\************************************************************************/
class ODateTimeDialog : public ModalDialog
{
- CheckBox* m_pDate;
- FixedText* m_pFTDateFormat;
- ListBox* m_pDateListBox;
- CheckBox* m_pTime;
- FixedText* m_pFTTimeFormat;
- ListBox* m_pTimeListBox;
- OKButton* m_pPB_OK;
+ VclPtr<CheckBox> m_pDate;
+ VclPtr<FixedText> m_pFTDateFormat;
+ VclPtr<ListBox> m_pDateListBox;
+ VclPtr<CheckBox> m_pTime;
+ VclPtr<FixedText> m_pFTTimeFormat;
+ VclPtr<ListBox> m_pTimeListBox;
+ VclPtr<OKButton> m_pPB_OK;
svt::ControlDependencyManager m_aDateControlling;
svt::ControlDependencyManager m_aTimeControlling;
@@ -81,6 +81,7 @@ public:
,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xHoldAlive
,::rptui::OReportController* _pController);
virtual ~ODateTimeDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
};
diff --git a/reportdesign/source/ui/inc/DesignView.hxx b/reportdesign/source/ui/inc/DesignView.hxx
index 0faeb693bd84..90faf2d78595 100644
--- a/reportdesign/source/ui/inc/DesignView.hxx
+++ b/reportdesign/source/ui/inc/DesignView.hxx
@@ -59,21 +59,21 @@ namespace rptui
class ODesignView : public dbaui::ODataView, public SfxBroadcaster, public IMarkedSection
{
private:
- SplitWindow m_aSplitWin;
+ VclPtr<SplitWindow> m_aSplitWin;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> m_xReportComponent;
OReportController& m_rReportController;
- OScrollWindowHelper m_aScrollWindow;
- vcl::Window* m_pTaskPane;
- PropBrw* m_pPropWin;
- OAddFieldWindow* m_pAddField;
+ VclPtr<OScrollWindowHelper> m_aScrollWindow;
+ VclPtr<vcl::Window> m_pTaskPane;
+ VclPtr<PropBrw> m_pPropWin;
+ VclPtr<OAddFieldWindow> m_pAddField;
OSectionView* m_pCurrentView;
- ONavigator* m_pReportExplorer;
+ VclPtr<ONavigator> m_pReportExplorer;
Idle m_aMarkIdle;
Point m_aScrollOffset;
DlgEdMode m_eMode;
- sal_uInt16 m_nCurrentPosition;
- sal_uInt16 m_eActObj;
+ sal_uInt16 m_nCurrentPosition;
+ sal_uInt16 m_eActObj;
bool m_bFirstDraw;
Size m_aGridSizeCoarse;
Size m_aGridSizeFine;
@@ -100,6 +100,7 @@ namespace rptui
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&,
OReportController& _rController);
virtual ~ODesignView();
+ virtual void dispose() SAL_OVERRIDE;
// Window overrides
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
@@ -212,8 +213,8 @@ namespace rptui
::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent > getCurrentControlModel() const;
// IMarkedSection
- ::boost::shared_ptr<OSectionWindow> getMarkedSection(NearSectionAccess nsa = CURRENT) const SAL_OVERRIDE;
- ::boost::shared_ptr<OSectionWindow> getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const;
+ OSectionWindow* getMarkedSection(NearSectionAccess nsa = CURRENT) const SAL_OVERRIDE;
+ OSectionWindow* getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const;
virtual void markSection(const sal_uInt16 _nPos) SAL_OVERRIDE;
/** fills the positions of all collapsed sections.
diff --git a/reportdesign/source/ui/inc/Formula.hxx b/reportdesign/source/ui/inc/Formula.hxx
index f6d686747f1e..499525178a25 100644
--- a/reportdesign/source/ui/inc/Formula.hxx
+++ b/reportdesign/source/ui/inc/Formula.hxx
@@ -46,12 +46,12 @@ class FormulaDialog : public formula::FormulaModalDialog,
public formula::IControlReferenceHandler
{
::boost::shared_ptr< formula::IFunctionManager > m_aFunctionManager;
- formula::FormEditData* m_pFormulaData;
- OAddFieldWindow* m_pAddField;
+ formula::FormEditData* m_pFormulaData;
+ VclPtr<OAddFieldWindow> m_pAddField;
::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > m_xRowSet;
::com::sun::star::uno::Reference< ::com::sun::star::report::meta::XFormulaParser> m_xParser;
::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaOpCodeMapper> m_xOpCodeMapper;
- formula::RefEdit* m_pEdit;
+ VclPtr<formula::RefEdit> m_pEdit;
OUString m_sFormula;
sal_Int32 m_nStart;
sal_Int32 m_nEnd;
@@ -68,6 +68,7 @@ public:
, svl::SharedStringPool& rStrPool );
virtual ~FormulaDialog();
+ virtual void dispose() SAL_OVERRIDE;
// IFormulaEditorHelper
virtual void notifyChange() SAL_OVERRIDE;
diff --git a/reportdesign/source/ui/inc/GroupsSorting.hxx b/reportdesign/source/ui/inc/GroupsSorting.hxx
index 49b6ad0843a7..b67c1285ba98 100644
--- a/reportdesign/source/ui/inc/GroupsSorting.hxx
+++ b/reportdesign/source/ui/inc/GroupsSorting.hxx
@@ -60,21 +60,21 @@ class OGroupsSortingDialog : public FloatingWindow
{
friend class OFieldExpressionControl;
- ToolBox* m_pToolBox;
+ VclPtr<ToolBox> m_pToolBox;
sal_uInt16 m_nMoveUpId;
sal_uInt16 m_nMoveDownId;
sal_uInt16 m_nDeleteId;
- VclContainer* m_pProperties;
- ListBox* m_pOrderLst;
- ListBox* m_pHeaderLst;
- ListBox* m_pFooterLst;
- ListBox* m_pGroupOnLst;
- NumericField* m_pGroupIntervalEd;
- ListBox* m_pKeepTogetherLst;
- FixedText* m_pHelpWindow;
+ VclPtr<VclContainer> m_pProperties;
+ VclPtr<ListBox> m_pOrderLst;
+ VclPtr<ListBox> m_pHeaderLst;
+ VclPtr<ListBox> m_pFooterLst;
+ VclPtr<ListBox> m_pGroupOnLst;
+ VclPtr<NumericField> m_pGroupIntervalEd;
+ VclPtr<ListBox> m_pKeepTogetherLst;
+ VclPtr<FixedText> m_pHelpWindow;
- OFieldExpressionControl* m_pFieldExpression;
+ VclPtr<OFieldExpressionControl> m_pFieldExpression;
::rptui::OReportController* m_pController;
::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pCurrentGroupListener;
::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pReportListener;
@@ -145,6 +145,7 @@ public:
,bool _bReadOnly
,::rptui::OReportController* _pController);
virtual ~OGroupsSortingDialog();
+ virtual void dispose() SAL_OVERRIDE;
/** sets the newe columns at the groups dialog.
@param _xColumns the new columns
diff --git a/reportdesign/source/ui/inc/MarkedSection.hxx b/reportdesign/source/ui/inc/MarkedSection.hxx
index 52ee1d3f62e8..84f9258809a2 100644
--- a/reportdesign/source/ui/inc/MarkedSection.hxx
+++ b/reportdesign/source/ui/inc/MarkedSection.hxx
@@ -38,7 +38,7 @@ namespace rptui
public:
/** returns the section which is currently marked.
*/
- virtual ::boost::shared_ptr<OSectionWindow> getMarkedSection(NearSectionAccess nsa) const =0;
+ virtual OSectionWindow* getMarkedSection(NearSectionAccess nsa) const =0;
/** mark the section on the given position .
*
diff --git a/reportdesign/source/ui/inc/PageNumber.hxx b/reportdesign/source/ui/inc/PageNumber.hxx
index fcf6d6b24fe0..43a1915d8e81 100644
--- a/reportdesign/source/ui/inc/PageNumber.hxx
+++ b/reportdesign/source/ui/inc/PageNumber.hxx
@@ -37,14 +37,14 @@ class OReportController;
\************************************************************************/
class OPageNumberDialog : public ModalDialog
{
- RadioButton* m_pPageN;
- RadioButton* m_pPageNofM;
+ VclPtr<RadioButton> m_pPageN;
+ VclPtr<RadioButton> m_pPageNofM;
- RadioButton* m_pTopPage;
- RadioButton* m_pBottomPage;
- ListBox* m_pAlignmentLst;
+ VclPtr<RadioButton> m_pTopPage;
+ VclPtr<RadioButton> m_pBottomPage;
+ VclPtr<ListBox> m_pAlignmentLst;
- CheckBox* m_pShowNumberOnFirstPage;
+ VclPtr<CheckBox> m_pShowNumberOnFirstPage;
::rptui::OReportController* m_pController;
::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition>
@@ -57,6 +57,7 @@ public:
,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition>& _xHoldAlive
,::rptui::OReportController* _pController);
virtual ~OPageNumberDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
};
diff --git a/reportdesign/source/ui/inc/ReportController.hxx b/reportdesign/source/ui/inc/ReportController.hxx
index aa749e833fd8..a902da39ccb2 100644
--- a/reportdesign/source/ui/inc/ReportController.hxx
+++ b/reportdesign/source/ui/inc/ReportController.hxx
@@ -93,7 +93,7 @@ namespace rptui
TransferableDataHelper m_aSystemClipboard; // content of the clipboard
TransferableClipboardListener*
m_pClipbordNotifier; /// notifier for changes in the clipboard
- OGroupsSortingDialog* m_pGroupsFloater;
+ VclPtr<OGroupsSortingDialog> m_pGroupsFloater;
OXReportControllerObserver* m_pReportControllerObserver;
@@ -457,7 +457,7 @@ namespace rptui
// cppu::OPropertySetHelper
virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() SAL_OVERRIDE;
- ::boost::shared_ptr<OSectionWindow> getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const;
+ OSectionWindow* getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const;
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > getColumns() const;
OUString getColumnLabel_throw(const OUString& i_sColumnName) const;
diff --git a/reportdesign/source/ui/inc/ReportSection.hxx b/reportdesign/source/ui/inc/ReportSection.hxx
index bef2ae1e2ea4..a34a4fc98322 100644
--- a/reportdesign/source/ui/inc/ReportSection.hxx
+++ b/reportdesign/source/ui/inc/ReportSection.hxx
@@ -45,7 +45,7 @@ namespace rptui
{
OReportPage* m_pPage;
OSectionView* m_pView;
- OSectionWindow* m_pParent;
+ VclPtr<OSectionWindow> m_pParent;
::std::unique_ptr<DlgEdFunc> m_pFunc;
::boost::shared_ptr<OReportModel> m_pModel;
::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pMulti;
@@ -81,6 +81,7 @@ namespace rptui
public:
OReportSection(OSectionWindow* _pParent,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection);
virtual ~OReportSection();
+ virtual void dispose() SAL_OVERRIDE;
// window overrides
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
diff --git a/reportdesign/source/ui/inc/ReportWindow.hxx b/reportdesign/source/ui/inc/ReportWindow.hxx
index a416b74a94bd..7c974bd0ad58 100644
--- a/reportdesign/source/ui/inc/ReportWindow.hxx
+++ b/reportdesign/source/ui/inc/ReportWindow.hxx
@@ -45,10 +45,10 @@ namespace rptui
, public ::cppu::BaseMutex
, public ::comphelper::OPropertyChangeListener
{
- Ruler m_aHRuler;
- ODesignView* m_pView;
- OScrollWindowHelper* m_pParent;
- OViewsWindow m_aViewsWindow;
+ VclPtr<Ruler> m_aHRuler;
+ VclPtr<ODesignView> m_pView;
+ VclPtr<OScrollWindowHelper> m_pParent;
+ VclPtr<OViewsWindow> m_aViewsWindow;
::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pReportListener;
::std::unique_ptr<DlgEdFactory>
m_pObjFac;
@@ -67,6 +67,7 @@ namespace rptui
public:
OReportWindow(OScrollWindowHelper* _pParent,ODesignView* _pView);
virtual ~OReportWindow();
+ virtual void dispose() SAL_OVERRIDE;
// Window overrides
virtual void Resize() SAL_OVERRIDE;
@@ -136,7 +137,7 @@ namespace rptui
*/
void showRuler(bool _bShow);
- inline sal_Int32 getRulerHeight() const { return m_aHRuler.GetSizePixel().Height(); }
+ inline sal_Int32 getRulerHeight() const { return m_aHRuler->GetSizePixel().Height(); }
/** returns the total width of the first section
*/
@@ -179,8 +180,8 @@ namespace rptui
void setMarked(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent> >& _xShape, bool _bMark);
// IMarkedSection
- ::boost::shared_ptr<OSectionWindow> getMarkedSection(NearSectionAccess nsa = CURRENT) const SAL_OVERRIDE;
- ::boost::shared_ptr<OSectionWindow> getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const;
+ OSectionWindow* getMarkedSection(NearSectionAccess nsa = CURRENT) const SAL_OVERRIDE;
+ OSectionWindow* getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const;
virtual void markSection(const sal_uInt16 _nPos) SAL_OVERRIDE;
diff --git a/reportdesign/source/ui/inc/ScrollHelper.hxx b/reportdesign/source/ui/inc/ScrollHelper.hxx
index ec5cc90d2439..e45d9daac713 100644
--- a/reportdesign/source/ui/inc/ScrollHelper.hxx
+++ b/reportdesign/source/ui/inc/ScrollHelper.hxx
@@ -48,14 +48,14 @@ namespace rptui
, public IMarkedSection
{
private:
- ScrollBar m_aHScroll;
- ScrollBar m_aVScroll;
- ScrollBarBox m_aCornerWin; // window in the bottom right corner
- Size m_aTotalPixelSize;
- ODesignView* m_pParent;
- OReportWindow m_aReportWindow;
+ VclPtr<ScrollBar> m_aHScroll;
+ VclPtr<ScrollBar> m_aVScroll;
+ VclPtr<ScrollBarBox> m_aCornerWin; // window in the bottom right corner
+ Size m_aTotalPixelSize;
+ VclPtr<ODesignView> m_pParent;
+ VclPtr<OReportWindow> m_aReportWindow;
::rtl::Reference<comphelper::OPropertyChangeMultiplexer >
- m_pReportDefintionMultiPlexer; // listener for property changes
+ m_pReportDefintionMultiPlexer; // listener for property changes
DECL_LINK( ScrollHdl, ScrollBar*);
Size ResizeScrollBars();
@@ -74,17 +74,18 @@ namespace rptui
public:
OScrollWindowHelper( ODesignView* _pReportDesignView);
virtual ~OScrollWindowHelper();
+ virtual void dispose() SAL_OVERRIDE;
/** late ctor
*/
void initialize();
- inline Point getThumbPos() const { return Point(m_aHScroll.GetThumbPos(),m_aVScroll.GetThumbPos())/*m_aScrollOffset*/; }
- inline const OReportWindow& getReportWindow() const { return m_aReportWindow; }
+ inline Point getThumbPos() const { return Point(m_aHScroll->GetThumbPos(),m_aVScroll->GetThumbPos())/*m_aScrollOffset*/; }
+ inline const OReportWindow& getReportWindow() const { return *m_aReportWindow.get(); }
void setTotalSize(sal_Int32 _nWidth, sal_Int32 _nHeight);
inline Size getTotalSize() const { return m_aTotalPixelSize; }
- inline ScrollBar& GetHScroll() { return m_aHScroll; }
- inline ScrollBar& GetVScroll() { return m_aVScroll; }
+ inline ScrollBar& GetHScroll() { return *m_aHScroll.get(); }
+ inline ScrollBar& GetVScroll() { return *m_aVScroll.get(); }
// forwards
void SetMode( DlgEdMode _eMode );
@@ -173,8 +174,8 @@ namespace rptui
void setMarked(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent> >& _xShape, bool _bMark);
// IMarkedSection
- ::boost::shared_ptr<OSectionWindow> getMarkedSection(NearSectionAccess nsa = CURRENT) const SAL_OVERRIDE;
- ::boost::shared_ptr<OSectionWindow> getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const;
+ OSectionWindow* getMarkedSection(NearSectionAccess nsa = CURRENT) const SAL_OVERRIDE;
+ OSectionWindow* getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const;
virtual void markSection(const sal_uInt16 _nPos) SAL_OVERRIDE;
diff --git a/reportdesign/source/ui/inc/SectionView.hxx b/reportdesign/source/ui/inc/SectionView.hxx
index 14de81adc63e..c8f14e26ee4b 100644
--- a/reportdesign/source/ui/inc/SectionView.hxx
+++ b/reportdesign/source/ui/inc/SectionView.hxx
@@ -34,8 +34,8 @@ class OReportSection;
class OSectionView : public SdrView
{
private:
- OReportWindow* m_pReportWindow;
- OReportSection* m_pSectionWindow;
+ VclPtr<OReportWindow> m_pReportWindow;
+ VclPtr<OReportSection> m_pSectionWindow;
void ObjectRemovedInAliveMode( const SdrObject* pObject );
OSectionView(const OSectionView&) SAL_DELETED_FUNCTION;
diff --git a/reportdesign/source/ui/inc/SectionWindow.hxx b/reportdesign/source/ui/inc/SectionWindow.hxx
index 79e184cb9d0b..166c25cd6a48 100644
--- a/reportdesign/source/ui/inc/SectionWindow.hxx
+++ b/reportdesign/source/ui/inc/SectionWindow.hxx
@@ -47,11 +47,11 @@ namespace rptui
, public ::cppu::BaseMutex
, public ::comphelper::OPropertyChangeListener
{
- OViewsWindow* m_pParent;
- OStartMarker m_aStartMarker;
- OReportSection m_aReportSection;
- Splitter m_aSplitter;
- OEndMarker m_aEndMarker;
+ VclPtr<OViewsWindow> m_pParent;
+ VclPtr<OStartMarker> m_aStartMarker;
+ VclPtr<OReportSection> m_aReportSection;
+ VclPtr<Splitter> m_aSplitter;
+ VclPtr<OEndMarker> m_aEndMarker;
::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pSectionMulti;
::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pGroupMulti;
@@ -98,10 +98,11 @@ namespace rptui
,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection
,const OUString& _sColorEntry);
virtual ~OSectionWindow();
+ virtual void dispose() SAL_OVERRIDE;
- inline OStartMarker& getStartMarker() { return m_aStartMarker; }
- inline OReportSection& getReportSection() { return m_aReportSection; }
- inline OEndMarker& getEndMarker() { return m_aEndMarker; }
+ inline OStartMarker& getStartMarker() { return *m_aStartMarker.get(); }
+ inline OReportSection& getReportSection() { return *m_aReportSection.get(); }
+ inline OEndMarker& getEndMarker() { return *m_aEndMarker.get(); }
inline OViewsWindow* getViewsWindow() { return m_pParent; }
void setCollapsed(bool _bCollapsed);
diff --git a/reportdesign/source/ui/inc/StartMarker.hxx b/reportdesign/source/ui/inc/StartMarker.hxx
index e390024f51a9..270939c266d0 100644
--- a/reportdesign/source/ui/inc/StartMarker.hxx
+++ b/reportdesign/source/ui/inc/StartMarker.hxx
@@ -31,10 +31,10 @@ namespace rptui
class OStartMarker : public OColorListener
{
- Ruler m_aVRuler;
- FixedText m_aText;
- FixedImage m_aImage;
- OSectionWindow* m_pParent;
+ VclPtr<Ruler> m_aVRuler;
+ VclPtr<FixedText> m_aText;
+ VclPtr<FixedImage> m_aImage;
+ VclPtr<OSectionWindow> m_pParent;
static Image* s_pDefCollapsed;
static Image* s_pDefExpanded;
static oslInterlockedCount s_nImageRefCount; /// When 0 all static images will be destroyed
@@ -50,6 +50,7 @@ namespace rptui
public:
OStartMarker(OSectionWindow* _pParent,const OUString& _sColorEntry);
virtual ~OStartMarker();
+ virtual void dispose() SAL_OVERRIDE;
// SfxListener
virtual void Notify(SfxBroadcaster & rBc, SfxHint const & rHint) SAL_OVERRIDE;
diff --git a/reportdesign/source/ui/inc/ViewsWindow.hxx b/reportdesign/source/ui/inc/ViewsWindow.hxx
index 8acd960804d1..f16fd59f2f77 100644
--- a/reportdesign/source/ui/inc/ViewsWindow.hxx
+++ b/reportdesign/source/ui/inc/ViewsWindow.hxx
@@ -32,7 +32,6 @@
#include <unotools/options.hxx>
#include <list>
#include <vector>
-#include <boost/shared_ptr.hpp>
#include "MarkedSection.hxx"
#include "SectionWindow.hxx"
@@ -75,7 +74,7 @@ namespace rptui
class OWindowPositionCorrector
{
- ::std::vector< ::std::pair<vcl::Window*,Point> > m_aChildren;
+ ::std::vector< ::std::pair<VclPtr<vcl::Window>,Point> > m_aChildren;
long m_nDeltaX;
long m_nDeltaY;
public:
@@ -91,8 +90,8 @@ namespace rptui
}
~OWindowPositionCorrector()
{
- ::std::vector< ::std::pair<vcl::Window*,Point> >::iterator aIter = m_aChildren.begin();
- ::std::vector< ::std::pair<vcl::Window*,Point> >::iterator aEnd = m_aChildren.end();
+ auto aIter = m_aChildren.begin();
+ auto aEnd = m_aChildren.end();
for (; aIter != aEnd; ++aIter)
{
const Point aPos = aIter->first->GetPosPixel();
@@ -108,7 +107,7 @@ namespace rptui
{
typedef ::std::multimap<Rectangle,::std::pair<SdrObject*,OSectionView*>,RectangleLess> TRectangleMap;
public:
- typedef ::std::vector< ::boost::shared_ptr<OSectionWindow> > TSectionsMap;
+ typedef ::std::vector< VclPtr<OSectionWindow> > TSectionsMap;
struct TReportPairHelper : public ::std::unary_function< TSectionsMap::value_type, OReportSection >
{
@@ -127,9 +126,9 @@ namespace rptui
private:
TSectionsMap m_aSections;
svtools::ColorConfig m_aColorConfig;
- OReportWindow* m_pParent;
- OUString m_sShapeType;
- bool m_bInUnmark;
+ VclPtr<OReportWindow> m_pParent;
+ OUString m_sShapeType;
+ bool m_bInUnmark;
void ImplInitSettings();
/** returns the iterator at pos _nPos or the end()
@@ -153,6 +152,7 @@ namespace rptui
OViewsWindow(
OReportWindow* _pReportWindow);
virtual ~OViewsWindow();
+ virtual void dispose() SAL_OVERRIDE;
// Window overrides
virtual void Resize() SAL_OVERRIDE;
@@ -181,7 +181,7 @@ namespace rptui
* \param _nPos
* \return the section at this pos or an empty section
*/
- ::boost::shared_ptr<OSectionWindow> getSectionWindow(const sal_uInt16 _nPos) const;
+ OSectionWindow* getSectionWindow(const sal_uInt16 _nPos) const;
/** turns the grid on or off
*
@@ -235,7 +235,7 @@ namespace rptui
/** returns the report section window for the given xsection
@param _xSection the section
*/
- ::boost::shared_ptr<OSectionWindow> getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const;
+ OSectionWindow* getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const;
/** checks if the keycode is known by the child windows
@param _rCode the keycode
@@ -252,7 +252,7 @@ namespace rptui
void setMarked(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent> >& _xShape, bool _bMark);
// IMarkedSection
- ::boost::shared_ptr<OSectionWindow> getMarkedSection(NearSectionAccess nsa = CURRENT) const SAL_OVERRIDE;
+ OSectionWindow* getMarkedSection(NearSectionAccess nsa = CURRENT) const SAL_OVERRIDE;
virtual void markSection(const sal_uInt16 _nPos) SAL_OVERRIDE;
/** align all marked objects in all sections
diff --git a/reportdesign/source/ui/inc/dlgedfunc.hxx b/reportdesign/source/ui/inc/dlgedfunc.hxx
index b9d0275ce673..8f8938b6f545 100644
--- a/reportdesign/source/ui/inc/dlgedfunc.hxx
+++ b/reportdesign/source/ui/inc/dlgedfunc.hxx
@@ -41,7 +41,7 @@ class DlgEdFunc /* : public LinkHdl */
DlgEdFunc(const DlgEdFunc&) SAL_DELETED_FUNCTION;
void operator =(const DlgEdFunc&) SAL_DELETED_FUNCTION;
protected:
- OReportSection* m_pParent;
+ VclPtr<OReportSection> m_pParent;
OSectionView& m_rView;
Timer aScrollTimer;
Point m_aMDPos;
diff --git a/reportdesign/source/ui/inc/propbrw.hxx b/reportdesign/source/ui/inc/propbrw.hxx
index 43ec71c790b2..67a48b248691 100644
--- a/reportdesign/source/ui/inc/propbrw.hxx
+++ b/reportdesign/source/ui/inc/propbrw.hxx
@@ -58,7 +58,7 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>
m_xLastSection; /// is the previously displayed section
OUString m_sLastActivePage;
- ODesignView* m_pDesignView;
+ VclPtr<ODesignView> m_pDesignView;
OSectionView* m_pView;
bool m_bInitialStateChange;
@@ -90,6 +90,7 @@ public:
,Window* pParent
,ODesignView* _pDesignView);
virtual ~PropBrw();
+ virtual void dispose() SAL_OVERRIDE;
virtual void LoseFocus() SAL_OVERRIDE;
diff --git a/reportdesign/source/ui/misc/ColorListener.cxx b/reportdesign/source/ui/misc/ColorListener.cxx
index 8bbd52dd88ad..abe070802e9b 100644
--- a/reportdesign/source/ui/misc/ColorListener.cxx
+++ b/reportdesign/source/ui/misc/ColorListener.cxx
@@ -40,7 +40,13 @@ OColorListener::OColorListener(vcl::Window* _pParent ,const OUString& _sColorEnt
OColorListener::~OColorListener()
{
+ disposeOnce();
+}
+
+void OColorListener::dispose()
+{
EndListening(m_aExtendedColorConfig);
+ vcl::Window::dispose();
}
void OColorListener::Notify(SfxBroadcaster & /*rBc*/, SfxHint const & rHint)
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
index 01533c7520ee..b5da44b8e31e 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -712,16 +712,16 @@ bool openCharDialog( const uno::Reference<report::XReportControlFormat >& _rxRep
lcl_CharPropertiesToItems( _rxReportControlFormat, *pDescriptor );
{ // want the dialog to be destroyed before our set
- ORptPageDialog aDlg(pParent, pDescriptor.get(), "CharDialog");
+ ScopedVclPtrInstance< ORptPageDialog > aDlg(pParent, pDescriptor.get(), "CharDialog");
uno::Reference< report::XShape > xShape( _rxReportControlFormat, uno::UNO_QUERY );
if ( xShape.is() )
- aDlg.RemoveTabPage("background");
- bSuccess = ( RET_OK == aDlg.Execute() );
+ aDlg->RemoveTabPage("background");
+ bSuccess = ( RET_OK == aDlg->Execute() );
if ( bSuccess )
{
lcl_itemsToCharProperties( lcl_getReportControlFont( _rxReportControlFormat,WESTERN ),
lcl_getReportControlFont( _rxReportControlFormat,ASIAN ),
- lcl_getReportControlFont( _rxReportControlFormat,COMPLEX ), *aDlg.GetOutputItemSet(), _out_rNewValues );
+ lcl_getReportControlFont( _rxReportControlFormat,COMPLEX ), *aDlg->GetOutputItemSet(), _out_rNewValues );
}
}
}
@@ -1027,13 +1027,14 @@ bool openDialogFormula_nothrow( OUString& _in_out_rFormula
CharClass aCC(_xContext, aLangTag);
svl::SharedStringPool aStringPool(&aCC);
- FormulaDialog aDlg(
- pParent, xServiceFactory, pFormulaManager, aFormula.getUndecoratedContent(), _xRowSet, aStringPool);
+ ScopedVclPtrInstance<FormulaDialog> aDlg(
+ pParent, xServiceFactory, pFormulaManager,
+ aFormula.getUndecoratedContent(), _xRowSet, aStringPool);
- bSuccess = aDlg.Execute() == RET_OK;
+ bSuccess = aDlg->Execute() == RET_OK;
if ( bSuccess )
{
- OUString sFormula = aDlg.getCurrentFormula();
+ OUString sFormula = aDlg->getCurrentFormula();
if ( sFormula[0] == '=' )
_in_out_rFormula = "rpt:" + sFormula.copy(1);
else
diff --git a/reportdesign/source/ui/misc/statusbarcontroller.cxx b/reportdesign/source/ui/misc/statusbarcontroller.cxx
index c59c587f0211..420f83f4b84b 100644
--- a/reportdesign/source/ui/misc/statusbarcontroller.cxx
+++ b/reportdesign/source/ui/misc/statusbarcontroller.cxx
@@ -86,7 +86,7 @@ void SAL_CALL OStatusbarController::initialize( const Sequence< Any >& _rArgumen
SolarMutexGuard aSolarMutexGuard;
::osl::MutexGuard aGuard(m_aMutex);
- StatusBar* pStatusBar = static_cast<StatusBar*>(VCLUnoHelper::GetWindow(m_xParentWindow));
+ VclPtr< StatusBar > pStatusBar = static_cast<StatusBar*>(VCLUnoHelper::GetWindow(m_xParentWindow).get());
if ( pStatusBar )
{
const sal_uInt16 nCount = pStatusBar->GetItemCount();
diff --git a/reportdesign/source/ui/misc/toolboxcontroller.cxx b/reportdesign/source/ui/misc/toolboxcontroller.cxx
index 788cc1fddfc6..aa9eb3f27672 100644
--- a/reportdesign/source/ui/misc/toolboxcontroller.cxx
+++ b/reportdesign/source/ui/misc/toolboxcontroller.cxx
@@ -127,7 +127,7 @@ void SAL_CALL OToolboxController::initialize( const Sequence< Any >& _rArguments
SolarMutexGuard aSolarMutexGuard;
::osl::MutexGuard aGuard(m_aMutex);
- ToolBox* pToolBox = static_cast<ToolBox*>(VCLUnoHelper::GetWindow(getParent()));
+ VclPtr< ToolBox > pToolBox = static_cast<ToolBox*>(VCLUnoHelper::GetWindow(getParent()).get());
if ( pToolBox )
{
const sal_uInt16 nCount = pToolBox->GetItemCount();
diff --git a/reportdesign/source/ui/report/DesignView.cxx b/reportdesign/source/ui/report/DesignView.cxx
index 96953d86019a..698b065796f6 100644
--- a/reportdesign/source/ui/report/DesignView.cxx
+++ b/reportdesign/source/ui/report/DesignView.cxx
@@ -59,9 +59,11 @@ using namespace container;
class OTaskWindow : public vcl::Window
{
- PropBrw* m_pPropWin;
+ VclPtr<PropBrw> m_pPropWin;
public:
OTaskWindow(vcl::Window* _pParent) : Window(_pParent),m_pPropWin(NULL){}
+ virtual ~OTaskWindow() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE { m_pPropWin.clear(); vcl::Window::dispose(); }
inline void setPropertyBrowser(PropBrw* _pPropWin)
{
@@ -84,9 +86,9 @@ ODesignView::ODesignView( vcl::Window* pParent,
const Reference< XComponentContext >& _rxOrb,
OReportController& _rController) :
ODataView( pParent, _rController, _rxOrb, WB_DIALOGCONTROL )
- ,m_aSplitWin(this)
+ ,m_aSplitWin(VclPtr<SplitWindow>::Create(this))
,m_rReportController( _rController )
- ,m_aScrollWindow(this)
+ ,m_aScrollWindow(VclPtr<rptui::OScrollWindowHelper>::Create(this))
,m_pPropWin(NULL)
,m_pAddField(NULL)
,m_pCurrentView(NULL)
@@ -107,16 +109,16 @@ ODesignView::ODesignView( vcl::Window* pParent,
SetMapMode( MapMode( MAP_100TH_MM ) );
// now create the task pane on the right side :-)
- m_pTaskPane = new OTaskWindow(this);
+ m_pTaskPane = VclPtr<OTaskWindow>::Create(this);
- m_aSplitWin.InsertItem( COLSET_ID,100,SPLITWINDOW_APPEND, 0, SWIB_PERCENTSIZE | SWIB_COLSET );
- m_aSplitWin.InsertItem( REPORT_ID, &m_aScrollWindow, 100, SPLITWINDOW_APPEND, COLSET_ID, SWIB_PERCENTSIZE);
+ m_aSplitWin->InsertItem( COLSET_ID,100,SPLITWINDOW_APPEND, 0, SWIB_PERCENTSIZE | SWIB_COLSET );
+ m_aSplitWin->InsertItem( REPORT_ID, m_aScrollWindow.get(), 100, SPLITWINDOW_APPEND, COLSET_ID, SWIB_PERCENTSIZE);
// Splitter einrichten
- m_aSplitWin.SetSplitHdl(LINK(this, ODesignView,SplitHdl));
- m_aSplitWin.ShowAutoHideButton();
- m_aSplitWin.SetAlign(WINDOWALIGN_LEFT);
- m_aSplitWin.Show();
+ m_aSplitWin->SetSplitHdl(LINK(this, ODesignView,SplitHdl));
+ m_aSplitWin->ShowAutoHideButton();
+ m_aSplitWin->SetAlign(WINDOWALIGN_LEFT);
+ m_aSplitWin->Show();
m_aMarkIdle.SetPriority( SchedulerPriority::LOW );
m_aMarkIdle.SetIdleHdl( LINK( this, ODesignView, MarkTimeout ) );
@@ -125,43 +127,46 @@ ODesignView::ODesignView( vcl::Window* pParent,
ODesignView::~ODesignView()
{
+ disposeOnce();
+}
+
+void ODesignView::dispose()
+{
m_bDeleted = true;
Hide();
- m_aScrollWindow.Hide();
+ m_aScrollWindow->Hide();
m_aMarkIdle.Stop();
if ( m_pPropWin )
{
notifySystemWindow(this,m_pPropWin,::comphelper::mem_fun(&TaskPaneList::RemoveWindow));
- ::std::unique_ptr<vcl::Window> aTemp2(m_pPropWin);
- m_pPropWin = NULL;
}
if ( m_pAddField )
{
SvtViewOptions aDlgOpt( E_WINDOW, OUString( UID_RPT_RPT_APP_VIEW ) );
aDlgOpt.SetWindowState(OStringToOUString(m_pAddField->GetWindowState(WINDOWSTATE_MASK_ALL), RTL_TEXTENCODING_ASCII_US));
notifySystemWindow(this,m_pAddField,::comphelper::mem_fun(&TaskPaneList::RemoveWindow));
- ::std::unique_ptr<vcl::Window> aTemp2(m_pAddField);
- m_pAddField = NULL;
}
if ( m_pReportExplorer )
{
SvtViewOptions aDlgOpt(E_WINDOW, OStringToOUString(m_pReportExplorer->GetHelpId(), RTL_TEXTENCODING_UTF8));
aDlgOpt.SetWindowState(OStringToOUString(m_pReportExplorer->GetWindowState(WINDOWSTATE_MASK_ALL), RTL_TEXTENCODING_ASCII_US));
notifySystemWindow(this,m_pReportExplorer,::comphelper::mem_fun(&TaskPaneList::RemoveWindow));
- ::std::unique_ptr<vcl::Window> aTemp2(m_pReportExplorer);
- m_pReportExplorer = NULL;
- }
- {
- ::std::unique_ptr<vcl::Window> aTemp2(m_pTaskPane);
- m_pTaskPane = NULL;
}
+
+ m_aSplitWin.disposeAndClear();
+ m_aScrollWindow.disposeAndClear();
+ m_pTaskPane.clear();
+ m_pReportExplorer.clear();
+ m_pPropWin.clear();
+ m_pAddField.clear();
+ dbaui::ODataView::dispose();
}
void ODesignView::initialize()
{
SetMapMode( MapMode( MAP_100TH_MM ) );
- m_aScrollWindow.initialize();
- m_aScrollWindow.Show();
+ m_aScrollWindow->initialize();
+ m_aScrollWindow->Show();
}
void ODesignView::DataChanged( const DataChangedEvent& rDCEvt )
@@ -197,7 +202,7 @@ bool ODesignView::PreNotify( NotifyEvent& rNEvt )
const vcl::KeyCode& rCode = pKeyEvent->GetKeyCode();
util::URL aUrl;
aUrl.Complete = m_pAccel->findCommand(svt::AcceleratorExecute::st_VCLKey2AWTKey(rCode));
- if ( aUrl.Complete.isEmpty() || !m_rController.isCommandEnabled( aUrl.Complete ) )
+ if ( aUrl.Complete.isEmpty() || !m_xController->isCommandEnabled( aUrl.Complete ) )
nRet = false;
}
}
@@ -231,7 +236,7 @@ void ODesignView::resizeDocumentView(Rectangle& _rPlayground)
}
}
- if ( m_aSplitWin.IsItemValid(TASKPANE_ID) )
+ if ( m_aSplitWin->IsItemValid(TASKPANE_ID) )
{
// normalize the split pos
const long nSplitterWidth = GetSettings().GetStyleSettings().GetSplitSize();
@@ -248,15 +253,15 @@ void ODesignView::resizeDocumentView(Rectangle& _rPlayground)
getController().setSplitPos(nSplitPos);
const long nTaskPaneSize = static_cast<long>((aPlaygroundSize.Width() - aTaskPanePos.X())*100/aPlaygroundSize.Width());
- if ( m_aSplitWin.GetItemSize( TASKPANE_ID ) != nTaskPaneSize )
+ if ( m_aSplitWin->GetItemSize( TASKPANE_ID ) != nTaskPaneSize )
{
- m_aSplitWin.SetItemSize( REPORT_ID, 99 - nTaskPaneSize );
- m_aSplitWin.SetItemSize( TASKPANE_ID, nTaskPaneSize );
+ m_aSplitWin->SetItemSize( REPORT_ID, 99 - nTaskPaneSize );
+ m_aSplitWin->SetItemSize( TASKPANE_ID, nTaskPaneSize );
}
}
}
// set the size of the report window
- m_aSplitWin.SetPosSizePixel( _rPlayground.TopLeft(),aPlaygroundSize );
+ m_aSplitWin->SetPosSizePixel( _rPlayground.TopLeft(),aPlaygroundSize );
}
// just for completeness: there is no space left, we occupied it all ...
_rPlayground.SetPos( _rPlayground.BottomRight() );
@@ -273,7 +278,7 @@ IMPL_LINK_NOARG(ODesignView, MarkTimeout)
if ( xProp.is() )
{
m_pPropWin->Update(xProp);
- static_cast<OTaskWindow*>(m_pTaskPane)->Resize();
+ static_cast<OTaskWindow*>(m_pTaskPane.get())->Resize();
}
Resize();
}
@@ -288,18 +293,18 @@ void ODesignView::SetMode( DlgEdMode _eNewMode )
if ( m_eMode == RPTUI_SELECT )
m_eActObj = OBJ_NONE;
- m_aScrollWindow.SetMode(_eNewMode);
+ m_aScrollWindow->SetMode(_eNewMode);
}
void ODesignView::SetInsertObj( sal_uInt16 eObj,const OUString& _sShapeType )
{
m_eActObj = eObj;
- m_aScrollWindow.SetInsertObj( eObj,_sShapeType );
+ m_aScrollWindow->SetInsertObj( eObj,_sShapeType );
}
OUString ODesignView::GetInsertObjString() const
{
- return m_aScrollWindow.GetInsertObjString();
+ return m_aScrollWindow->GetInsertObjString();
}
@@ -315,30 +320,30 @@ void ODesignView::Cut()
void ODesignView::Copy()
{
- m_aScrollWindow.Copy();
+ m_aScrollWindow->Copy();
}
void ODesignView::Paste()
{
- m_aScrollWindow.Paste();
+ m_aScrollWindow->Paste();
}
void ODesignView::Delete()
{
- m_aScrollWindow.Delete();
+ m_aScrollWindow->Delete();
}
bool ODesignView::HasSelection() const
{
- return m_aScrollWindow.HasSelection();
+ return m_aScrollWindow->HasSelection();
}
bool ODesignView::IsPasteAllowed() const
{
- return m_aScrollWindow.IsPasteAllowed();
+ return m_aScrollWindow->IsPasteAllowed();
}
@@ -347,10 +352,10 @@ void ODesignView::UpdatePropertyBrowserDelayed(OSectionView& _rView)
if ( m_pCurrentView != &_rView )
{
if ( m_pCurrentView )
- m_aScrollWindow.setMarked(m_pCurrentView,false);
+ m_aScrollWindow->setMarked(m_pCurrentView,false);
m_pCurrentView = &_rView;
if ( m_pCurrentView )
- m_aScrollWindow.setMarked(m_pCurrentView,true);
+ m_aScrollWindow->setMarked(m_pCurrentView,true);
m_xReportComponent.clear();
DlgEdHint aHint( RPTUI_HINT_SELECTIONCHANGED );
Broadcast( aHint );
@@ -361,27 +366,27 @@ void ODesignView::UpdatePropertyBrowserDelayed(OSectionView& _rView)
void ODesignView::toggleGrid(bool _bGridVisible)
{
- m_aScrollWindow.toggleGrid(_bGridVisible);
+ m_aScrollWindow->toggleGrid(_bGridVisible);
}
sal_uInt16 ODesignView::getSectionCount() const
{
- return m_aScrollWindow.getSectionCount();
+ return m_aScrollWindow->getSectionCount();
}
void ODesignView::showRuler(bool _bShow)
{
- m_aScrollWindow.showRuler(_bShow);
+ m_aScrollWindow->showRuler(_bShow);
}
void ODesignView::removeSection(sal_uInt16 _nPosition)
{
- m_aScrollWindow.removeSection(_nPosition);
+ m_aScrollWindow->removeSection(_nPosition);
}
void ODesignView::addSection(const uno::Reference< report::XSection >& _xSection,const OUString& _sColorEntry,sal_uInt16 _nPosition)
{
- m_aScrollWindow.addSection(_xSection,_sColorEntry,_nPosition);
+ m_aScrollWindow->addSection(_xSection,_sColorEntry,_nPosition);
}
void ODesignView::GetFocus()
@@ -390,7 +395,7 @@ void ODesignView::GetFocus()
if ( !m_bDeleted )
{
- ::boost::shared_ptr<OSectionWindow> pSectionWindow = m_aScrollWindow.getMarkedSection();
+ OSectionWindow* pSectionWindow = m_aScrollWindow->getMarkedSection();
if ( pSectionWindow )
pSectionWindow->GrabFocus();
}
@@ -406,12 +411,12 @@ void ODesignView::ImplInitSettings()
IMPL_LINK( ODesignView, SplitHdl, void*, )
{
const Size aOutputSize = GetOutputSizePixel();
- const long nTest = aOutputSize.Width() * m_aSplitWin.GetItemSize(TASKPANE_ID) / 100;
+ const long nTest = aOutputSize.Width() * m_aSplitWin->GetItemSize(TASKPANE_ID) / 100;
long nMinWidth = static_cast<long>(0.1*aOutputSize.Width());
if ( m_pPropWin && m_pPropWin->IsVisible() )
nMinWidth = m_pPropWin->GetMinOutputSizePixel().Width();
- if ( (aOutputSize.Width() - nTest) >= nMinWidth && nTest > m_aScrollWindow.getMaxMarkerWidth(false) )
+ if ( (aOutputSize.Width() - nTest) >= nMinWidth && nTest > m_aScrollWindow->getMaxMarkerWidth(false) )
{
long nOldSplitPos = getController().getSplitPos();
(void)nOldSplitPos;
@@ -423,21 +428,21 @@ IMPL_LINK( ODesignView, SplitHdl, void*, )
void ODesignView::SelectAll(const sal_uInt16 _nObjectType)
{
- m_aScrollWindow.SelectAll(_nObjectType);
+ m_aScrollWindow->SelectAll(_nObjectType);
}
void ODesignView::unmarkAllObjects(OSectionView* _pSectionView)
{
- m_aScrollWindow.unmarkAllObjects(_pSectionView);
+ m_aScrollWindow->unmarkAllObjects(_pSectionView);
}
void ODesignView::togglePropertyBrowser(bool _bToogleOn)
{
if ( !m_pPropWin && _bToogleOn )
{
- m_pPropWin = new PropBrw(getController().getORB(), m_pTaskPane,this);
+ m_pPropWin = VclPtr<PropBrw>::Create(getController().getORB(), m_pTaskPane,this);
m_pPropWin->Invalidate();
- static_cast<OTaskWindow*>(m_pTaskPane)->setPropertyBrowser(m_pPropWin);
+ static_cast<OTaskWindow*>(m_pTaskPane.get())->setPropertyBrowser(m_pPropWin);
notifySystemWindow(this,m_pPropWin,::comphelper::mem_fun(&TaskPaneList::AddWindow));
}
if ( m_pPropWin && _bToogleOn != m_pPropWin->IsVisible() )
@@ -451,9 +456,9 @@ void ODesignView::togglePropertyBrowser(bool _bToogleOn)
m_pTaskPane->Invalidate();
if ( bWillBeVisible )
- m_aSplitWin.InsertItem( TASKPANE_ID, m_pTaskPane,START_SIZE_TASKPANE, SPLITWINDOW_APPEND, COLSET_ID, SWIB_PERCENTSIZE);
+ m_aSplitWin->InsertItem( TASKPANE_ID, m_pTaskPane,START_SIZE_TASKPANE, SPLITWINDOW_APPEND, COLSET_ID, SWIB_PERCENTSIZE);
else
- m_aSplitWin.RemoveItem(TASKPANE_ID);
+ m_aSplitWin->RemoveItem(TASKPANE_ID);
if ( bWillBeVisible )
m_aMarkIdle.Start();
@@ -466,7 +471,7 @@ void ODesignView::showProperties(const uno::Reference< uno::XInterface>& _xRepor
{
m_xReportComponent = _xReportComponent;
if ( m_pCurrentView )
- m_aScrollWindow.setMarked(m_pCurrentView,false);
+ m_aScrollWindow->setMarked(m_pCurrentView,false);
m_pCurrentView = NULL;
m_aMarkIdle.Start();
}
@@ -482,7 +487,7 @@ void ODesignView::toggleReportExplorer()
if ( !m_pReportExplorer )
{
OReportController& rReportController = getController();
- m_pReportExplorer = new ONavigator(this,rReportController);
+ m_pReportExplorer = VclPtr<ONavigator>::Create(this,rReportController);
SvtViewOptions aDlgOpt(E_WINDOW, OStringToOUString(m_pReportExplorer->GetHelpId(), RTL_TEXTENCODING_UTF8));
if ( aDlgOpt.Exists() )
m_pReportExplorer->SetWindowState(OUStringToOString(aDlgOpt.GetWindowState(), RTL_TEXTENCODING_ASCII_US));
@@ -518,7 +523,7 @@ void ODesignView::toggleAddField()
xReport = xSection->getReportDefinition();
}
uno::Reference < beans::XPropertySet > xSet(rReportController.getRowSet(),uno::UNO_QUERY);
- m_pAddField = new OAddFieldWindow(this,xSet);
+ m_pAddField = VclPtr<OAddFieldWindow>::Create(this,xSet);
m_pAddField->SetCreateHdl(LINK( &rReportController, OReportController, OnCreateHdl ) );
SvtViewOptions aDlgOpt( E_WINDOW, OUString( UID_RPT_RPT_APP_VIEW ) );
if ( aDlgOpt.Exists() )
@@ -551,29 +556,29 @@ uno::Reference< report::XReportComponent > ODesignView::getCurrentControlModel()
return xModel;
}
-::boost::shared_ptr<OSectionWindow> ODesignView::getMarkedSection(NearSectionAccess nsa) const
+OSectionWindow* ODesignView::getMarkedSection(NearSectionAccess nsa) const
{
- return m_aScrollWindow.getMarkedSection(nsa);
+ return m_aScrollWindow->getMarkedSection(nsa);
}
-::boost::shared_ptr<OSectionWindow> ODesignView::getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const
+OSectionWindow* ODesignView::getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const
{
- return m_aScrollWindow.getSectionWindow(_xSection);
+ return m_aScrollWindow->getSectionWindow(_xSection);
}
void ODesignView::markSection(const sal_uInt16 _nPos)
{
- m_aScrollWindow.markSection(_nPos);
+ m_aScrollWindow->markSection(_nPos);
}
void ODesignView::fillCollapsedSections(::std::vector<sal_uInt16>& _rCollapsedPositions) const
{
- m_aScrollWindow.fillCollapsedSections(_rCollapsedPositions);
+ m_aScrollWindow->fillCollapsedSections(_rCollapsedPositions);
}
void ODesignView::collapseSections(const uno::Sequence< beans::PropertyValue>& _aCollpasedSections)
{
- m_aScrollWindow.collapseSections(_aCollpasedSections);
+ m_aScrollWindow->collapseSections(_aCollpasedSections);
}
OUString ODesignView::getCurrentPage() const
@@ -589,7 +594,7 @@ void ODesignView::setCurrentPage(const OUString& _sLastActivePage)
void ODesignView::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAlignAtSection, bool bBoundRects)
{
- m_aScrollWindow.alignMarkedObjects(_nControlModification, _bAlignAtSection,bBoundRects);
+ m_aScrollWindow->alignMarkedObjects(_nControlModification, _bAlignAtSection,bBoundRects);
}
bool ODesignView::handleKeyEvent(const KeyEvent& _rEvent)
@@ -600,12 +605,12 @@ bool ODesignView::handleKeyEvent(const KeyEvent& _rEvent)
return false;
if ( (m_pReportExplorer && m_pReportExplorer->HasChildPathFocus()) )
return false;
- return m_aScrollWindow.handleKeyEvent(_rEvent);
+ return m_aScrollWindow->handleKeyEvent(_rEvent);
}
void ODesignView::setMarked(const uno::Reference< report::XSection>& _xSection,bool _bMark)
{
- m_aScrollWindow.setMarked(_xSection,_bMark);
+ m_aScrollWindow->setMarked(_xSection,_bMark);
if ( _bMark )
UpdatePropertyBrowserDelayed(getMarkedSection()->getReportSection().getSectionView());
else
@@ -614,7 +619,7 @@ void ODesignView::setMarked(const uno::Reference< report::XSection>& _xSection,b
void ODesignView::setMarked(const uno::Sequence< uno::Reference< report::XReportComponent> >& _aShapes,bool _bMark)
{
- m_aScrollWindow.setMarked(_aShapes,_bMark);
+ m_aScrollWindow->setMarked(_aShapes,_bMark);
if ( _aShapes.hasElements() && _bMark )
showProperties(_aShapes[0]);
else
@@ -634,7 +639,7 @@ void ODesignView::MouseButtonDown( const MouseEvent& rMEvt )
uno::Any ODesignView::getCurrentlyShownProperty() const
{
uno::Any aRet;
- ::boost::shared_ptr<OSectionWindow> pSectionWindow = getMarkedSection();
+ OSectionWindow* pSectionWindow = getMarkedSection();
if ( pSectionWindow )
{
::std::vector< uno::Reference< uno::XInterface > > aSelection;
@@ -655,18 +660,18 @@ uno::Any ODesignView::getCurrentlyShownProperty() const
void ODesignView::fillControlModelSelection(::std::vector< uno::Reference< uno::XInterface > >& _rSelection) const
{
- m_aScrollWindow.fillControlModelSelection(_rSelection);
+ m_aScrollWindow->fillControlModelSelection(_rSelection);
}
void ODesignView::setGridSnap(bool bOn)
{
- m_aScrollWindow.setGridSnap(bOn);
+ m_aScrollWindow->setGridSnap(bOn);
}
void ODesignView::setDragStripes(bool bOn)
{
- m_aScrollWindow.setDragStripes(bOn);
+ m_aScrollWindow->setDragStripes(bOn);
}
bool ODesignView::isHandleEvent(sal_uInt16 /*_nId*/) const
@@ -676,17 +681,17 @@ bool ODesignView::isHandleEvent(sal_uInt16 /*_nId*/) const
sal_uInt32 ODesignView::getMarkedObjectCount() const
{
- return m_aScrollWindow.getMarkedObjectCount();
+ return m_aScrollWindow->getMarkedObjectCount();
}
void ODesignView::zoom(const Fraction& _aZoom)
{
- m_aScrollWindow.zoom(_aZoom);
+ m_aScrollWindow->zoom(_aZoom);
}
sal_uInt16 ODesignView::getZoomFactor(SvxZoomType _eType) const
{
- return m_aScrollWindow.getZoomFactor(_eType);
+ return m_aScrollWindow->getZoomFactor(_eType);
}
} // rptui
diff --git a/reportdesign/source/ui/report/FixedTextColor.cxx b/reportdesign/source/ui/report/FixedTextColor.cxx
index ca3029b0ad31..8ccfc48ac682 100644
--- a/reportdesign/source/ui/report/FixedTextColor.cxx
+++ b/reportdesign/source/ui/report/FixedTextColor.cxx
@@ -172,7 +172,7 @@ namespace rptui
OUnoObject* pUnoObj = dynamic_cast<OUnoObject*>(pObject);
if ( pUnoObj ) // this doesn't need to be done for shapes
{
- ::boost::shared_ptr<OSectionWindow> pSectionWindow = pController->getSectionWindow(xSection);
+ OSectionWindow* pSectionWindow = pController->getSectionWindow(xSection);
if (pSectionWindow != 0)
{
OReportSection& aOutputDevice = pSectionWindow->getReportSection(); // OutputDevice
diff --git a/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx b/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx
index a2ca68daba83..1255d686fe23 100644
--- a/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx
+++ b/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx
@@ -173,7 +173,7 @@ namespace rptui
OUnoObject* pUnoObj = dynamic_cast<OUnoObject*>(pObject);
if ( pUnoObj ) // this doesn't need to be done for shapes
{
- ::boost::shared_ptr<OSectionWindow> pSectionWindow = m_rReportController.getSectionWindow(xSection);
+ OSectionWindow* pSectionWindow = m_rReportController.getSectionWindow(xSection);
if (pSectionWindow != 0)
{
OReportSection& aOutputDevice = pSectionWindow->getReportSection(); // OutputDevice
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index bd7f17eb582a..24f274ee56dd 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -339,7 +339,6 @@ void OReportController::disposing()
{
SvtViewOptions aDlgOpt(E_WINDOW, OStringToOUString(m_pGroupsFloater->GetHelpId(), RTL_TEXTENCODING_UTF8));
aDlgOpt.SetWindowState(OStringToOUString(m_pGroupsFloater->GetWindowState(WINDOWSTATE_MASK_ALL), RTL_TEXTENCODING_ASCII_US));
- ::std::unique_ptr<FloatingWindow> aTemp(m_pGroupsFloater);
m_pGroupsFloater = NULL;
}
@@ -362,7 +361,7 @@ void OReportController::disposing()
{
try
{
- ::boost::shared_ptr<OSectionWindow> pSectionWindow;
+ OSectionWindow* pSectionWindow = NULL;
if ( getDesignView() )
pSectionWindow = getDesignView()->getMarkedSection();
if ( pSectionWindow )
@@ -583,7 +582,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const
aReturn.bEnabled = isEditable() && getDesignView()->HasSelection() && !getDesignView()->isHandleEvent(_nId);
if ( aReturn.bEnabled )
{
- ::boost::shared_ptr<OSectionWindow> pSectionWindow = getDesignView()->getMarkedSection();
+ OSectionWindow* pSectionWindow = getDesignView()->getMarkedSection();
if ( pSectionWindow )
aReturn.bEnabled = !pSectionWindow->getReportSection().isUiActive();
}
@@ -1135,7 +1134,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
break;
case SID_TERMINATE_INPLACEACTIVATION:
{
- ::boost::shared_ptr<OSectionWindow> pSection = getDesignView()->getMarkedSection();
+ OSectionWindow* pSection = getDesignView()->getMarkedSection();
if ( pSection )
pSection->getReportSection().deactivateOle();
}
@@ -1568,8 +1567,8 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
uno::Reference< report::XFormattedField> xFormattedField(getDesignView()->getCurrentControlModel(),uno::UNO_QUERY);
if ( xFormattedField.is() )
{
- ConditionalFormattingDialog aDlg( getView(), xFormattedField.get(), *this );
- aDlg.Execute();
+ ScopedVclPtrInstance< ConditionalFormattingDialog > aDlg( getView(), xFormattedField.get(), *this );
+ aDlg->Execute();
}
}
break;
@@ -1578,8 +1577,8 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
{
if ( !aArgs.getLength() )
{
- ODateTimeDialog aDlg(getView(),getDesignView()->getCurrentSection(),this);
- aDlg.Execute();
+ ScopedVclPtrInstance< ODateTimeDialog > aDlg(getView(),getDesignView()->getCurrentSection(),this);
+ aDlg->Execute();
}
else
createDateTime(aArgs);
@@ -1590,8 +1589,8 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
{
if ( !aArgs.getLength() )
{
- OPageNumberDialog aDlg(getView(),m_xReportDefinition,this);
- aDlg.Execute();
+ ScopedVclPtrInstance< OPageNumberDialog > aDlg(getView(),m_xReportDefinition,this);
+ aDlg->Execute();
}
else
createPageNumber(aArgs);
@@ -1783,9 +1782,9 @@ void OReportController::doOpenHelpAgent()
bool OReportController::Construct(vcl::Window* pParent)
{
- ODesignView* pMyOwnView = new ODesignView( pParent, m_xContext, *this );
+ VclPtrInstance<ODesignView> pMyOwnView( pParent, m_xContext, *this );
StartListening( *pMyOwnView );
- setView( *pMyOwnView );
+ setView( pMyOwnView );
// now that we have a view we can create the clipboard listener
m_aSystemClipboard = TransferableDataHelper::CreateFromSystemClipboard( getView() );
@@ -2481,15 +2480,16 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _
}
{ // want the dialog to be destroyed before our set
- ORptPageDialog aDlg(getView(), pDescriptor.get(),_xSection.is()
- ? OUString("BackgroundDialog")
- : OUString("PageDialog"));
- if (RET_OK == aDlg.Execute())
+ ScopedVclPtrInstance<ORptPageDialog> aDlg(
+ getView(), pDescriptor.get(),_xSection.is()
+ ? OUString("BackgroundDialog")
+ : OUString("PageDialog"));
+ if (RET_OK == aDlg->Execute())
{
// ItemSet->UNO
// UNO-properties
- const SfxItemSet* pSet = aDlg.GetOutputItemSet();
+ const SfxItemSet* pSet = aDlg->GetOutputItemSet();
if ( _xSection.is() )
{
const SfxPoolItem* pItem;
@@ -2578,7 +2578,7 @@ void OReportController::openSortingAndGroupingDialog()
return;
if ( !m_pGroupsFloater )
{
- m_pGroupsFloater = new OGroupsSortingDialog(getView(),!isEditable(),this);
+ m_pGroupsFloater = VclPtr<OGroupsSortingDialog>::Create(getView(),!isEditable(),this);
SvtViewOptions aDlgOpt(E_WINDOW, OStringToOUString(m_pGroupsFloater->GetHelpId(), RTL_TEXTENCODING_UTF8));
if ( aDlgOpt.Exists() )
m_pGroupsFloater->SetWindowState(OUStringToOString(aDlgOpt.GetWindowState(), RTL_TEXTENCODING_ASCII_US));
@@ -2791,8 +2791,8 @@ uno::Any SAL_CALL OReportController::getViewData() throw( uno::RuntimeException,
aViewData.put( "CollapsedSections", aCollapsedSections );
}
- ::boost::shared_ptr<OSectionWindow> pSectionWindow = getDesignView()->getMarkedSection();
- if ( pSectionWindow.get() )
+ OSectionWindow* pSectionWindow = getDesignView()->getMarkedSection();
+ if ( pSectionWindow )
{
aViewData.put( "MarkedSection", (sal_Int32)pSectionWindow->getReportSection().getPage()->GetPageNum() );
}
@@ -3159,7 +3159,7 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co
{
SequenceAsHashMap aMap(_aArgs);
getDesignView()->setMarked(_xSection, true);
- ::boost::shared_ptr<OSectionWindow> pSectionWindow = getDesignView()->getMarkedSection();
+ OSectionWindow* pSectionWindow = getDesignView()->getMarkedSection();
if ( !pSectionWindow )
return;
@@ -3337,7 +3337,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
getDesignView()->unmarkAllObjects(NULL);
// Anhand des FormatKeys wird festgestellt, welches Feld benoetigt wird
- ::boost::shared_ptr<OSectionWindow> pSectionWindow[2];
+ OSectionWindow* pSectionWindow[2];
pSectionWindow[0] = getDesignView()->getMarkedSection();
if ( !pSectionWindow[0] )
@@ -3651,8 +3651,8 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
OSectionView* OReportController::getCurrentSectionView() const
{
OSectionView* pSectionView = NULL;
- ::boost::shared_ptr<OSectionWindow> pSectionWindow = getDesignView()->getMarkedSection();
- if ( pSectionWindow.get() )
+ OSectionWindow* pSectionWindow = getDesignView()->getMarkedSection();
+ if ( pSectionWindow )
pSectionView = &pSectionWindow->getReportSection().getSectionView();
return pSectionView;
}
@@ -3966,7 +3966,7 @@ void OReportController::createGroupSection(const bool _bUndo,const bool _bHeader
void OReportController::collapseSection(const bool _bCollapse)
{
- ::boost::shared_ptr<OSectionWindow> pSection = getDesignView()->getMarkedSection();
+ OSectionWindow *pSection = getDesignView()->getMarkedSection();
if ( pSection )
{
pSection->setCollapsed(_bCollapse);
@@ -3975,10 +3975,10 @@ void OReportController::collapseSection(const bool _bCollapse)
void OReportController::markSection(const bool _bNext)
{
- ::boost::shared_ptr<OSectionWindow> pSection = getDesignView()->getMarkedSection();
+ OSectionWindow *pSection = getDesignView()->getMarkedSection();
if ( pSection )
{
- ::boost::shared_ptr<OSectionWindow> pPrevSection = getDesignView()->getMarkedSection(_bNext ? POST : PREVIOUS);
+ OSectionWindow *pPrevSection = getDesignView()->getMarkedSection(_bNext ? POST : PREVIOUS);
if ( pPrevSection != pSection && pPrevSection )
select(uno::makeAny(pPrevSection->getReportSection().getSection()));
else
@@ -4219,16 +4219,15 @@ void OReportController::impl_fillCustomShapeState_nothrow(const char* _pCustomSh
}
-::boost::shared_ptr<OSectionWindow> OReportController::getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const
+OSectionWindow* OReportController::getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const
{
if ( getDesignView() )
{
- return getDesignView()->getSectionWindow(_xSection);
+ return getDesignView()->getSectionWindow(_xSection);
}
// throw NullPointerException?
- ::boost::shared_ptr<OSectionWindow> pEmpty;
- return pEmpty;
+ return NULL;
}
diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx
index 1a70619ecc33..22a1d986e98d 100644
--- a/reportdesign/source/ui/report/ReportSection.cxx
+++ b/reportdesign/source/ui/report/ReportSection.cxx
@@ -111,6 +111,11 @@ OReportSection::OReportSection(OSectionWindow* _pParent,const uno::Reference< re
OReportSection::~OReportSection()
{
+ disposeOnce();
+}
+
+void OReportSection::dispose()
+{
m_pPage = NULL;
if ( m_pMulti.is() )
m_pMulti->dispose();
@@ -125,6 +130,8 @@ OReportSection::~OReportSection()
m_pView->EndListening( *m_pModel );
m_pView = NULL;
}
+ m_pParent.clear();
+ vcl::Window::dispose();
}
void OReportSection::Paint( const Rectangle& rRect )
diff --git a/reportdesign/source/ui/report/ReportWindow.cxx b/reportdesign/source/ui/report/ReportWindow.cxx
index 74148f6700f3..d43d5584fe8e 100644
--- a/reportdesign/source/ui/report/ReportWindow.cxx
+++ b/reportdesign/source/ui/report/ReportWindow.cxx
@@ -58,26 +58,26 @@ using namespace ::comphelper;
OReportWindow::OReportWindow(OScrollWindowHelper* _pParent,ODesignView* _pView)
: Window(_pParent,WB_DIALOGCONTROL)
, ::comphelper::OPropertyChangeListener(m_aMutex)
-,m_aHRuler(this)
+,m_aHRuler(VclPtr<Ruler>::Create(this))
,m_pView(_pView)
,m_pParent(_pParent)
-,m_aViewsWindow(this)
+,m_aViewsWindow(VclPtr<rptui::OViewsWindow>::Create(this))
,m_pObjFac( new DlgEdFactory() )
{
SetHelpId(UID_RPT_REPORTWINDOW);
SetMapMode( MapMode( MAP_100TH_MM ) );
- m_aViewsWindow.Show();
+ m_aViewsWindow->Show();
- m_aHRuler.Show();
- m_aHRuler.Activate();
- m_aHRuler.SetPagePos(0);
- m_aHRuler.SetBorders();
- m_aHRuler.SetIndents();
- m_aHRuler.SetMargin1();
- m_aHRuler.SetMargin2();
+ m_aHRuler->Show();
+ m_aHRuler->Activate();
+ m_aHRuler->SetPagePos(0);
+ m_aHRuler->SetBorders();
+ m_aHRuler->SetIndents();
+ m_aHRuler->SetMargin1();
+ m_aHRuler->SetMargin2();
const MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum();
- m_aHRuler.SetUnit(MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH);
+ m_aHRuler->SetUnit(MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH);
ImplInitSettings();
m_pReportListener = addStyleListener(_pView->getController().getReportDefinition(),this);
@@ -85,31 +85,40 @@ OReportWindow::OReportWindow(OScrollWindowHelper* _pParent,ODesignView* _pView)
OReportWindow::~OReportWindow()
{
+ disposeOnce();
+}
+
+void OReportWindow::dispose()
+{
if ( m_pReportListener.is() )
m_pReportListener->dispose();
+ m_aHRuler.disposeAndClear();
+ m_aViewsWindow.disposeAndClear();
+ m_pView.clear();
+ m_pParent.clear();
+ vcl::Window::dispose();
}
void OReportWindow::SetInsertObj( sal_uInt16 eObj,const OUString& _sShapeType )
{
- m_aViewsWindow.SetInsertObj( eObj,_sShapeType);
+ m_aViewsWindow->SetInsertObj( eObj,_sShapeType);
}
-
OUString OReportWindow::GetInsertObjString() const
{
- return m_aViewsWindow.GetInsertObjString();
+ return m_aViewsWindow->GetInsertObjString();
}
void OReportWindow::SetMode( DlgEdMode eNewMode )
{
- m_aViewsWindow.SetMode(eNewMode);
+ m_aViewsWindow->SetMode(eNewMode);
}
void OReportWindow::removeSection(sal_uInt16 _nPosition)
{
- m_aViewsWindow.removeSection(_nPosition);
+ m_aViewsWindow->removeSection(_nPosition);
m_pParent->setTotalSize(GetTotalWidth(),GetTotalHeight());
- m_aViewsWindow.Invalidate(INVALIDATE_TRANSPARENT);
+ m_aViewsWindow->Invalidate(INVALIDATE_TRANSPARENT);
}
void OReportWindow::addSection(const uno::Reference< report::XSection >& _xSection,const OUString& _sColorEntry,sal_uInt16 _nPosition)
@@ -117,27 +126,27 @@ void OReportWindow::addSection(const uno::Reference< report::XSection >& _xSecti
if ( !_xSection.is() )
return;
- m_aViewsWindow.addSection(_xSection,_sColorEntry,_nPosition);
+ m_aViewsWindow->addSection(_xSection,_sColorEntry,_nPosition);
m_pParent->setTotalSize(GetTotalWidth(),GetTotalHeight());
}
void OReportWindow::toggleGrid(bool _bVisible)
{
- m_aViewsWindow.toggleGrid(_bVisible);
+ m_aViewsWindow->toggleGrid(_bVisible);
}
void OReportWindow::showRuler(bool _bShow)
{
- m_aHRuler.Show(_bShow);
+ m_aHRuler->Show(_bShow);
- m_aViewsWindow.showRuler(_bShow);
+ m_aViewsWindow->showRuler(_bShow);
}
sal_Int32 OReportWindow::getMaxMarkerWidth(bool _bWithEnd) const
{
Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH));
- aStartWidth *= m_aViewsWindow.GetMapMode().GetScaleX();
+ aStartWidth *= m_aViewsWindow->GetMapMode().GetScaleX();
if ( _bWithEnd )
aStartWidth += Fraction(long(REPORT_ENDMARKER_WIDTH));
return sal_Int32((long)aStartWidth);
@@ -146,7 +155,7 @@ sal_Int32 OReportWindow::getMaxMarkerWidth(bool _bWithEnd) const
sal_Int32 OReportWindow::GetTotalWidth() const
{
sal_Int32 nWidth = 0;
- if ( !m_aViewsWindow.empty() )
+ if ( !m_aViewsWindow->empty() )
{
Fraction aStartWidth(long(REPORT_ENDMARKER_WIDTH + REPORT_STARTMARKER_WIDTH ));
const Fraction aZoom(m_pView->getController().getZoomValue(),100);
@@ -163,7 +172,7 @@ sal_Int32 OReportWindow::GetTotalWidth() const
void OReportWindow::Resize()
{
Window::Resize();
- if ( !m_aViewsWindow.empty() )
+ if ( !m_aViewsWindow->empty() )
{
const Size aTotalOutputSize = GetOutputSizePixel();
Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH)*m_pView->getController().getZoomValue(),100);
@@ -174,26 +183,26 @@ void OReportWindow::Resize()
const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(xReportDefinition,PROPERTY_PAPERSIZE).Width;
sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN);
sal_Int32 nRightMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_RIGHTMARGIN);
- Size aPageSize = m_aViewsWindow.LogicToPixel(Size(nPaperWidth ,0));
- nLeftMargin = m_aViewsWindow.LogicToPixel(Size(nLeftMargin,0)).Width();
- nRightMargin = m_aViewsWindow.LogicToPixel(Size(nRightMargin,0)).Width();
+ Size aPageSize = m_aViewsWindow->LogicToPixel(Size(nPaperWidth ,0));
+ nLeftMargin = m_aViewsWindow->LogicToPixel(Size(nLeftMargin,0)).Width();
+ nRightMargin = m_aViewsWindow->LogicToPixel(Size(nRightMargin,0)).Width();
- aPageSize.Height() = m_aHRuler.GetSizePixel().Height();
+ aPageSize.Height() = m_aHRuler->GetSizePixel().Height();
- const long nTermp(m_aViewsWindow.getTotalHeight() + aPageSize.Height());
+ const long nTermp(m_aViewsWindow->getTotalHeight() + aPageSize.Height());
long nSectionsHeight = ::std::max<long>(nTermp,aTotalOutputSize.Height());
- m_aHRuler.SetPosSizePixel(aStartPoint,aPageSize);
- m_aHRuler.SetNullOffset(nLeftMargin);
- m_aHRuler.SetMargin1(0);
- m_aHRuler.SetMargin2(aPageSize.Width() - nLeftMargin - nRightMargin);
+ m_aHRuler->SetPosSizePixel(aStartPoint,aPageSize);
+ m_aHRuler->SetNullOffset(nLeftMargin);
+ m_aHRuler->SetMargin1(0);
+ m_aHRuler->SetMargin2(aPageSize.Width() - nLeftMargin - nRightMargin);
aStartPoint.Y() += aPageSize.Height();
nSectionsHeight -= aStartPoint.Y();
aStartPoint.X() = aOffset.X();
- m_aViewsWindow.SetPosSizePixel(aStartPoint,Size(aTotalOutputSize.Width(),nSectionsHeight));
+ m_aViewsWindow->SetPosSizePixel(aStartPoint,Size(aTotalOutputSize.Width(),nSectionsHeight));
}
}
@@ -221,26 +230,26 @@ void OReportWindow::DataChanged( const DataChangedEvent& rDCEvt )
sal_Int32 OReportWindow::GetTotalHeight() const
{
- return m_aViewsWindow.getTotalHeight();
+ return m_aViewsWindow->getTotalHeight();
}
void OReportWindow::ScrollChildren(const Point& _aThumbPos)
{
- MapMode aMap = m_aHRuler.GetMapMode();
+ MapMode aMap = m_aHRuler->GetMapMode();
Point aOrg( aMap.GetOrigin() );
if ( aOrg.X() != (-_aThumbPos.X()) )
{
aMap.SetOrigin( Point(- _aThumbPos.X(), aOrg.Y()));
- m_aHRuler.SetMapMode( aMap );
- m_aHRuler.Scroll(-(aOrg.X() + _aThumbPos.X()),0);
+ m_aHRuler->SetMapMode( aMap );
+ m_aHRuler->Scroll(-(aOrg.X() + _aThumbPos.X()),0);
}
- m_aViewsWindow.scrollChildren(_aThumbPos);
+ m_aViewsWindow->scrollChildren(_aThumbPos);
}
sal_uInt16 OReportWindow::getSectionCount() const
{
- return m_aViewsWindow.getSectionCount();
+ return m_aViewsWindow->getSectionCount();
}
void OReportWindow::notifySizeChanged()
@@ -250,129 +259,129 @@ void OReportWindow::notifySizeChanged()
bool OReportWindow::HasSelection() const
{
- return m_aViewsWindow.HasSelection();
+ return m_aViewsWindow->HasSelection();
}
void OReportWindow::Delete()
{
- m_aViewsWindow.Delete();
+ m_aViewsWindow->Delete();
}
void OReportWindow::Copy()
{
- m_aViewsWindow.Copy();
+ m_aViewsWindow->Copy();
}
void OReportWindow::Paste()
{
- m_aViewsWindow.Paste();
+ m_aViewsWindow->Paste();
}
bool OReportWindow::IsPasteAllowed() const
{
- return m_aViewsWindow.IsPasteAllowed();
+ return m_aViewsWindow->IsPasteAllowed();
}
void OReportWindow::SelectAll(const sal_uInt16 _nObjectType)
{
- m_aViewsWindow.SelectAll(_nObjectType);
+ m_aViewsWindow->SelectAll(_nObjectType);
}
void OReportWindow::unmarkAllObjects(OSectionView* _pSectionView)
{
- m_aViewsWindow.unmarkAllObjects(_pSectionView);
+ m_aViewsWindow->unmarkAllObjects(_pSectionView);
}
void OReportWindow::showProperties(const uno::Reference< report::XSection>& _xReportComponent)
{
- ::boost::shared_ptr<OSectionWindow> pSectionWindow = m_aViewsWindow.getSectionWindow( _xReportComponent );
+ OSectionWindow* pSectionWindow = m_aViewsWindow->getSectionWindow( _xReportComponent );
m_pView->UpdatePropertyBrowserDelayed(pSectionWindow->getReportSection().getSectionView());
}
bool OReportWindow::handleKeyEvent(const KeyEvent& _rEvent)
{
- return m_aViewsWindow.handleKeyEvent(_rEvent);
+ return m_aViewsWindow->handleKeyEvent(_rEvent);
}
void OReportWindow::setMarked(OSectionView* _pSectionView, bool _bMark)
{
if ( _pSectionView )
- m_aViewsWindow.setMarked(_pSectionView,_bMark);
+ m_aViewsWindow->setMarked(_pSectionView,_bMark);
}
void OReportWindow::setMarked(const uno::Reference< report::XSection>& _xSection, bool _bMark)
{
- m_aViewsWindow.setMarked(_xSection,_bMark);
+ m_aViewsWindow->setMarked(_xSection,_bMark);
}
void OReportWindow::setMarked(const uno::Sequence< uno::Reference< report::XReportComponent> >& _xShape, bool _bMark)
{
- m_aViewsWindow.setMarked(_xShape,_bMark);
+ m_aViewsWindow->setMarked(_xShape,_bMark);
}
-::boost::shared_ptr<OSectionWindow> OReportWindow::getMarkedSection(NearSectionAccess nsa) const
+OSectionWindow* OReportWindow::getMarkedSection(NearSectionAccess nsa) const
{
- return m_aViewsWindow.getMarkedSection(nsa);
+ return m_aViewsWindow->getMarkedSection(nsa);
}
-::boost::shared_ptr<OSectionWindow> OReportWindow::getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const
+OSectionWindow* OReportWindow::getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const
{
- return m_aViewsWindow.getSectionWindow(_xSection);
+ return m_aViewsWindow->getSectionWindow(_xSection);
}
void OReportWindow::markSection(const sal_uInt16 _nPos)
{
- m_aViewsWindow.markSection(_nPos);
+ m_aViewsWindow->markSection(_nPos);
}
void OReportWindow::fillCollapsedSections(::std::vector<sal_uInt16>& _rCollapsedPositions) const
{
- m_aViewsWindow.fillCollapsedSections(_rCollapsedPositions);
+ m_aViewsWindow->fillCollapsedSections(_rCollapsedPositions);
}
void OReportWindow::collapseSections(const uno::Sequence< ::com::sun::star::beans::PropertyValue>& _aCollpasedSections)
{
- m_aViewsWindow.collapseSections(_aCollpasedSections);
+ m_aViewsWindow->collapseSections(_aCollpasedSections);
}
void OReportWindow::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAlignAtSection, bool bBoundRects)
{
- m_aViewsWindow.alignMarkedObjects(_nControlModification, _bAlignAtSection, bBoundRects);
+ m_aViewsWindow->alignMarkedObjects(_nControlModification, _bAlignAtSection, bBoundRects);
}
void OReportWindow::setGridSnap(bool bOn)
{
- m_aViewsWindow.setGridSnap(bOn);
+ m_aViewsWindow->setGridSnap(bOn);
}
void OReportWindow::setDragStripes(bool bOn)
{
- m_aViewsWindow.setDragStripes(bOn);
+ m_aViewsWindow->setDragStripes(bOn);
}
sal_uInt32 OReportWindow::getMarkedObjectCount() const
{
- return m_aViewsWindow.getMarkedObjectCount();
+ return m_aViewsWindow->getMarkedObjectCount();
}
void OReportWindow::zoom(const Fraction& _aZoom)
{
- m_aHRuler.SetZoom(_aZoom);
- m_aHRuler.Invalidate();
+ m_aHRuler->SetZoom(_aZoom);
+ m_aHRuler->Invalidate();
- m_aViewsWindow.zoom(_aZoom);
+ m_aViewsWindow->zoom(_aZoom);
notifySizeChanged();
const Point aNewThumbPos( m_pParent->getThumbPos() );
@@ -385,7 +394,7 @@ void OReportWindow::zoom(const Fraction& _aZoom)
void OReportWindow::fillControlModelSelection(::std::vector< uno::Reference< uno::XInterface > >& _rSelection) const
{
- m_aViewsWindow.fillControlModelSelection(_rSelection);
+ m_aViewsWindow->fillControlModelSelection(_rSelection);
}
sal_Int32 OReportWindow::impl_getRealPixelWidth() const
@@ -411,7 +420,7 @@ sal_uInt16 OReportWindow::getZoomFactor(SvxZoomType _eType) const
{
nZoom = (sal_uInt16)(long)Fraction(aSize.Width()*100,impl_getRealPixelWidth());
MapMode aMap( MAP_100TH_MM );
- const Size aHeight = m_aViewsWindow.LogicToPixel(m_aViewsWindow.PixelToLogic(Size(0,GetTotalHeight() + m_aHRuler.GetSizePixel().Height())),aMap);
+ const Size aHeight = m_aViewsWindow->LogicToPixel(m_aViewsWindow->PixelToLogic(Size(0,GetTotalHeight() + m_aHRuler->GetSizePixel().Height())),aMap);
nZoom = ::std::min(nZoom,(sal_uInt16)(long)Fraction(aSize.Height()*100,aHeight.Height()));
}
break;
@@ -429,7 +438,7 @@ void OReportWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent)
{
(void)_rEvent;
Resize();
- m_aViewsWindow.Resize();
+ m_aViewsWindow->Resize();
static sal_Int32 nIn = INVALIDATE_TRANSPARENT;
Invalidate(nIn);
}
diff --git a/reportdesign/source/ui/report/ScrollHelper.cxx b/reportdesign/source/ui/report/ScrollHelper.cxx
index d5cf903a4bac..ba789bc9f774 100644
--- a/reportdesign/source/ui/report/ScrollHelper.cxx
+++ b/reportdesign/source/ui/report/ScrollHelper.cxx
@@ -46,20 +46,20 @@ void lcl_setScrollBar(sal_Int32 _nNewValue,const Point& _aPos,const Size& _aSize
OScrollWindowHelper::OScrollWindowHelper( ODesignView* _pDesignView)
: OScrollWindowHelper_BASE( _pDesignView,WB_DIALOGCONTROL)
,OPropertyChangeListener(m_aMutex)
- ,m_aHScroll( this, WB_HSCROLL|WB_REPEAT|WB_DRAG )
- ,m_aVScroll( this, WB_VSCROLL|WB_REPEAT|WB_DRAG )
- ,m_aCornerWin( this )
+ ,m_aHScroll( VclPtr<ScrollBar>::Create(this, WB_HSCROLL|WB_REPEAT|WB_DRAG) )
+ ,m_aVScroll( VclPtr<ScrollBar>::Create(this, WB_VSCROLL|WB_REPEAT|WB_DRAG) )
+ ,m_aCornerWin( VclPtr<ScrollBarBox>::Create(this) )
,m_pParent(_pDesignView)
- ,m_aReportWindow(this,m_pParent)
+ ,m_aReportWindow(VclPtr<rptui::OReportWindow>::Create(this,m_pParent))
,m_pReportDefintionMultiPlexer(NULL)
{
SetMapMode( MapMode( MAP_100TH_MM ) );
- impl_initScrollBar( m_aHScroll );
- impl_initScrollBar( m_aVScroll );
+ impl_initScrollBar( *m_aHScroll.get() );
+ impl_initScrollBar( *m_aVScroll.get() );
- m_aReportWindow.SetMapMode( MapMode( MAP_100TH_MM ) );
- m_aReportWindow.Show();
+ m_aReportWindow->SetMapMode( MapMode( MAP_100TH_MM ) );
+ m_aReportWindow->Show();
// normally we should be SCROLL_PANE
SetAccessibleRole(css::accessibility::AccessibleRole::SCROLL_PANE);
@@ -69,8 +69,20 @@ OScrollWindowHelper::OScrollWindowHelper( ODesignView* _pDesignView)
OScrollWindowHelper::~OScrollWindowHelper()
{
+ disposeOnce();
+}
+
+void OScrollWindowHelper::dispose()
+{
if ( m_pReportDefintionMultiPlexer.is() )
m_pReportDefintionMultiPlexer->dispose();
+
+ m_aHScroll.disposeAndClear();
+ m_aVScroll.disposeAndClear();
+ m_aCornerWin.disposeAndClear();
+ m_aReportWindow.disposeAndClear();
+ m_pParent.clear();
+ OScrollWindowHelper_BASE::dispose();
}
@@ -101,8 +113,8 @@ void OScrollWindowHelper::setTotalSize(sal_Int32 _nWidth ,sal_Int32 _nHeight)
// now set the ranges without start marker
Fraction aStartWidth(REPORT_STARTMARKER_WIDTH * m_pParent->getController().getZoomValue(),100);
long nWidth = long(_nWidth - (double)aStartWidth);
- m_aHScroll.SetRangeMax( nWidth );
- m_aVScroll.SetRangeMax( m_aTotalPixelSize.Height() );
+ m_aHScroll->SetRangeMax( nWidth );
+ m_aVScroll->SetRangeMax( m_aTotalPixelSize.Height() );
Resize();
}
@@ -114,7 +126,7 @@ Size OScrollWindowHelper::ResizeScrollBars()
if ( aOutPixSz.Width() == 0 || aOutPixSz.Height() == 0 )
return aOutPixSz;
- aOutPixSz.Height() -= m_aReportWindow.getRulerHeight();
+ aOutPixSz.Height() -= m_aReportWindow->getRulerHeight();
// determine the size of the output-area and if we need scrollbars
const long nScrSize = GetSettings().GetStyleSettings().GetScrollBarSize();
bool bVVisible = false; // by default no vertical-ScrollBar
@@ -143,31 +155,31 @@ Size OScrollWindowHelper::ResizeScrollBars()
}
while ( bChanged ); // until no visibility has changed
- aOutPixSz.Height() += m_aReportWindow.getRulerHeight();
+ aOutPixSz.Height() += m_aReportWindow->getRulerHeight();
// show or hide scrollbars
- m_aVScroll.Show( bVVisible );
- m_aHScroll.Show( bHVisible );
+ m_aVScroll->Show( bVVisible );
+ m_aHScroll->Show( bHVisible );
// disable painting in the corner between the scrollbars
if ( bVVisible && bHVisible )
{
- m_aCornerWin.SetPosSizePixel(Point(aOutPixSz.Width(), aOutPixSz.Height()), Size(nScrSize, nScrSize) );
- m_aCornerWin.Show();
+ m_aCornerWin->SetPosSizePixel(Point(aOutPixSz.Width(), aOutPixSz.Height()), Size(nScrSize, nScrSize) );
+ m_aCornerWin->Show();
}
else
- m_aCornerWin.Hide();
+ m_aCornerWin->Hide();
const Point aOffset = LogicToPixel( Point( SECTION_OFFSET, SECTION_OFFSET ), MAP_APPFONT );
// resize scrollbars and set their ranges
{
Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH*m_pParent->getController().getZoomValue()),100);
const sal_Int32 nNewWidth = aOutPixSz.Width() - aOffset.X() - (long)aStartWidth;
- lcl_setScrollBar(nNewWidth,Point( (long)aStartWidth + aOffset.X(), aOutPixSz.Height() ),Size( nNewWidth, nScrSize ),m_aHScroll);
+ lcl_setScrollBar(nNewWidth,Point( (long)aStartWidth + aOffset.X(), aOutPixSz.Height() ), Size( nNewWidth, nScrSize ), *m_aHScroll.get());
}
{
- const sal_Int32 nNewHeight = aOutPixSz.Height() - m_aReportWindow.getRulerHeight();
- lcl_setScrollBar(nNewHeight,Point( aOutPixSz.Width(), m_aReportWindow.getRulerHeight() ),Size( nScrSize,nNewHeight),m_aVScroll);
+ const sal_Int32 nNewHeight = aOutPixSz.Height() - m_aReportWindow->getRulerHeight();
+ lcl_setScrollBar(nNewHeight,Point( aOutPixSz.Width(), m_aReportWindow->getRulerHeight() ), Size( nScrSize,nNewHeight), *m_aVScroll.get());
}
return aOutPixSz;
@@ -178,12 +190,12 @@ void OScrollWindowHelper::Resize()
OScrollWindowHelper_BASE::Resize();
const Size aTotalOutputSize = ResizeScrollBars();
- m_aReportWindow.SetPosSizePixel(Point( 0, 0 ),aTotalOutputSize);
+ m_aReportWindow->SetPosSizePixel(Point( 0, 0 ),aTotalOutputSize);
}
IMPL_LINK( OScrollWindowHelper, ScrollHdl, ScrollBar*, /*pScroll*/ )
{
- m_aReportWindow.ScrollChildren( getThumbPos() );
+ m_aReportWindow->ScrollChildren( getThumbPos() );
return 0;
}
@@ -191,127 +203,127 @@ void OScrollWindowHelper::addSection(const uno::Reference< report::XSection >& _
,const OUString& _sColorEntry
,sal_uInt16 _nPosition)
{
- m_aReportWindow.addSection(_xSection,_sColorEntry,_nPosition);
+ m_aReportWindow->addSection(_xSection,_sColorEntry,_nPosition);
}
void OScrollWindowHelper::removeSection(sal_uInt16 _nPosition)
{
- m_aReportWindow.removeSection(_nPosition);
+ m_aReportWindow->removeSection(_nPosition);
}
void OScrollWindowHelper::toggleGrid(bool _bVisible)
{
- m_aReportWindow.toggleGrid(_bVisible);
+ m_aReportWindow->toggleGrid(_bVisible);
}
sal_uInt16 OScrollWindowHelper::getSectionCount() const
{
- return m_aReportWindow.getSectionCount();
+ return m_aReportWindow->getSectionCount();
}
void OScrollWindowHelper::SetInsertObj( sal_uInt16 eObj,const OUString& _sShapeType )
{
- m_aReportWindow.SetInsertObj(eObj,_sShapeType);
+ m_aReportWindow->SetInsertObj(eObj,_sShapeType);
}
OUString OScrollWindowHelper::GetInsertObjString() const
{
- return m_aReportWindow.GetInsertObjString();
+ return m_aReportWindow->GetInsertObjString();
}
void OScrollWindowHelper::SetMode( DlgEdMode _eNewMode )
{
- m_aReportWindow.SetMode(_eNewMode);
+ m_aReportWindow->SetMode(_eNewMode);
}
bool OScrollWindowHelper::HasSelection() const
{
- return m_aReportWindow.HasSelection();
+ return m_aReportWindow->HasSelection();
}
void OScrollWindowHelper::Delete()
{
- m_aReportWindow.Delete();
+ m_aReportWindow->Delete();
}
void OScrollWindowHelper::Copy()
{
- m_aReportWindow.Copy();
+ m_aReportWindow->Copy();
}
void OScrollWindowHelper::Paste()
{
- m_aReportWindow.Paste();
+ m_aReportWindow->Paste();
}
bool OScrollWindowHelper::IsPasteAllowed() const
{
- return m_aReportWindow.IsPasteAllowed();
+ return m_aReportWindow->IsPasteAllowed();
}
void OScrollWindowHelper::SelectAll(const sal_uInt16 _nObjectType)
{
- m_aReportWindow.SelectAll(_nObjectType);
+ m_aReportWindow->SelectAll(_nObjectType);
}
void OScrollWindowHelper::unmarkAllObjects(OSectionView* _pSectionView)
{
- m_aReportWindow.unmarkAllObjects(_pSectionView);
+ m_aReportWindow->unmarkAllObjects(_pSectionView);
}
sal_Int32 OScrollWindowHelper::getMaxMarkerWidth(bool _bWithEnd) const
{
- return m_aReportWindow.getMaxMarkerWidth(_bWithEnd);
+ return m_aReportWindow->getMaxMarkerWidth(_bWithEnd);
}
void OScrollWindowHelper::showRuler(bool _bShow)
{
- m_aReportWindow.showRuler(_bShow);
+ m_aReportWindow->showRuler(_bShow);
}
bool OScrollWindowHelper::handleKeyEvent(const KeyEvent& _rEvent)
{
- return m_aReportWindow.handleKeyEvent(_rEvent);
+ return m_aReportWindow->handleKeyEvent(_rEvent);
}
void OScrollWindowHelper::setMarked(OSectionView* _pSectionView, bool _bMark)
{
- m_aReportWindow.setMarked(_pSectionView,_bMark);
+ m_aReportWindow->setMarked(_pSectionView,_bMark);
}
void OScrollWindowHelper::setMarked(const uno::Reference< report::XSection>& _xSection, bool _bMark)
{
- m_aReportWindow.setMarked(_xSection,_bMark);
+ m_aReportWindow->setMarked(_xSection,_bMark);
}
void OScrollWindowHelper::setMarked(const uno::Sequence< uno::Reference< report::XReportComponent> >& _xShape, bool _bMark)
{
- m_aReportWindow.setMarked(_xShape,_bMark);
+ m_aReportWindow->setMarked(_xShape,_bMark);
}
-::boost::shared_ptr<OSectionWindow> OScrollWindowHelper::getMarkedSection(NearSectionAccess nsa) const
+OSectionWindow* OScrollWindowHelper::getMarkedSection(NearSectionAccess nsa) const
{
- return m_aReportWindow.getMarkedSection(nsa);
+ return m_aReportWindow->getMarkedSection(nsa);
}
-::boost::shared_ptr<OSectionWindow> OScrollWindowHelper::getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const
+OSectionWindow* OScrollWindowHelper::getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const
{
- return m_aReportWindow.getSectionWindow(_xSection);
+ return m_aReportWindow->getSectionWindow(_xSection);
}
void OScrollWindowHelper::markSection(const sal_uInt16 _nPos)
{
- m_aReportWindow.markSection(_nPos);
+ m_aReportWindow->markSection(_nPos);
}
void OScrollWindowHelper::fillCollapsedSections(::std::vector<sal_uInt16>& _rCollapsedPositions) const
{
- m_aReportWindow.fillCollapsedSections(_rCollapsedPositions);
+ m_aReportWindow->fillCollapsedSections(_rCollapsedPositions);
}
void OScrollWindowHelper::collapseSections(const uno::Sequence< ::com::sun::star::beans::PropertyValue>& _aCollpasedSections)
{
- m_aReportWindow.collapseSections(_aCollpasedSections);
+ m_aReportWindow->collapseSections(_aCollpasedSections);
}
bool OScrollWindowHelper::Notify( NotifyEvent& rNEvt )
@@ -324,11 +336,11 @@ bool OScrollWindowHelper::Notify( NotifyEvent& rNEvt )
{
ScrollBar* pHScrBar = NULL;
ScrollBar* pVScrBar = NULL;
- if ( m_aHScroll.IsVisible() )
- pHScrBar = &m_aHScroll;
+ if ( m_aHScroll->IsVisible() )
+ pHScrBar = m_aHScroll.get();
- if ( m_aVScroll.IsVisible() )
- pVScrBar = &m_aVScroll;
+ if ( m_aVScroll->IsVisible() )
+ pVScrBar = m_aVScroll.get();
if ( HandleScrollCommand( *pCommandEvent, pHScrBar, pVScrBar ) )
return true;
@@ -338,7 +350,7 @@ bool OScrollWindowHelper::Notify( NotifyEvent& rNEvt )
void OScrollWindowHelper::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAlignAtSection, bool bBoundRects)
{
- m_aReportWindow.alignMarkedObjects(_nControlModification, _bAlignAtSection, bBoundRects);
+ m_aReportWindow->alignMarkedObjects(_nControlModification, _bAlignAtSection, bBoundRects);
}
void OScrollWindowHelper::ImplInitSettings()
@@ -363,39 +375,39 @@ void OScrollWindowHelper::DataChanged( const DataChangedEvent& rDCEvt )
void OScrollWindowHelper::_propertyChanged(const beans::PropertyChangeEvent& /*_rEvent*/)
throw (uno::RuntimeException, std::exception)
{
- m_aReportWindow.notifySizeChanged();
+ m_aReportWindow->notifySizeChanged();
}
void OScrollWindowHelper::setGridSnap(bool bOn)
{
- m_aReportWindow.setGridSnap(bOn);
+ m_aReportWindow->setGridSnap(bOn);
}
void OScrollWindowHelper::setDragStripes(bool bOn)
{
- m_aReportWindow.setDragStripes(bOn);
+ m_aReportWindow->setDragStripes(bOn);
}
sal_uInt32 OScrollWindowHelper::getMarkedObjectCount() const
{
- return m_aReportWindow.getMarkedObjectCount();
+ return m_aReportWindow->getMarkedObjectCount();
}
void OScrollWindowHelper::zoom(const Fraction& _aZoom)
{
- m_aReportWindow.zoom(_aZoom);
+ m_aReportWindow->zoom(_aZoom);
Resize();
Invalidate(INVALIDATE_NOCHILDREN|INVALIDATE_TRANSPARENT);
}
void OScrollWindowHelper::fillControlModelSelection(::std::vector< uno::Reference< uno::XInterface > >& _rSelection) const
{
- m_aReportWindow.fillControlModelSelection(_rSelection);
+ m_aReportWindow->fillControlModelSelection(_rSelection);
}
sal_uInt16 OScrollWindowHelper::getZoomFactor(SvxZoomType _eType) const
{
- return m_aReportWindow.getZoomFactor(_eType);
+ return m_aReportWindow->getZoomFactor(_eType);
}
} // rptui
diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx
index b3c50f17b7e6..bb37ceb4cdd4 100644
--- a/reportdesign/source/ui/report/SectionWindow.cxx
+++ b/reportdesign/source/ui/report/SectionWindow.cxx
@@ -48,35 +48,35 @@ OSectionWindow::OSectionWindow( OViewsWindow* _pParent,const uno::Reference< rep
: Window( _pParent,WB_DIALOGCONTROL)
,OPropertyChangeListener(m_aMutex)
,m_pParent(_pParent)
-,m_aStartMarker( this,_sColorEntry)
-,m_aReportSection( this,_xSection)
-,m_aSplitter(this)
-,m_aEndMarker( this,_sColorEntry)
+,m_aStartMarker( VclPtr<rptui::OStartMarker>::Create(this,_sColorEntry))
+,m_aReportSection( VclPtr<rptui::OReportSection>::Create(this,_xSection))
+,m_aSplitter(VclPtr<Splitter>::Create(this))
+,m_aEndMarker( VclPtr<rptui::OEndMarker>::Create(this,_sColorEntry))
{
SetUniqueId(UID_RPT_SECTIONSWINDOW);
const MapMode& rMapMode = _pParent->GetMapMode();
SetMapMode( rMapMode );
ImplInitSettings();
// TRY
- m_aSplitter.SetMapMode( MapMode( MAP_100TH_MM ) );
- m_aSplitter.SetStartSplitHdl(LINK(this, OSectionWindow,StartSplitHdl));
- m_aSplitter.SetSplitHdl(LINK(this, OSectionWindow,SplitHdl));
- m_aSplitter.SetEndSplitHdl(LINK(this, OSectionWindow,EndSplitHdl));
- m_aSplitter.SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor() ));
- m_aSplitter.SetSplitPosPixel(m_aSplitter.LogicToPixel(Size(0,_xSection->getHeight())).Height());
+ m_aSplitter->SetMapMode( MapMode( MAP_100TH_MM ) );
+ m_aSplitter->SetStartSplitHdl(LINK(this, OSectionWindow,StartSplitHdl));
+ m_aSplitter->SetSplitHdl(LINK(this, OSectionWindow,SplitHdl));
+ m_aSplitter->SetEndSplitHdl(LINK(this, OSectionWindow,EndSplitHdl));
+ m_aSplitter->SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor() ));
+ m_aSplitter->SetSplitPosPixel(m_aSplitter->LogicToPixel(Size(0,_xSection->getHeight())).Height());
- m_aStartMarker.setCollapsedHdl(LINK(this,OSectionWindow,Collapsed));
+ m_aStartMarker->setCollapsedHdl(LINK(this,OSectionWindow,Collapsed));
- m_aStartMarker.zoom(rMapMode.GetScaleX());
- setZoomFactor(rMapMode.GetScaleX(),m_aReportSection);
- setZoomFactor(rMapMode.GetScaleX(),m_aSplitter);
- setZoomFactor(rMapMode.GetScaleX(),m_aEndMarker);
+ m_aStartMarker->zoom(rMapMode.GetScaleX());
+ setZoomFactor(rMapMode.GetScaleX(), *m_aReportSection.get());
+ setZoomFactor(rMapMode.GetScaleX(), *m_aSplitter.get());
+ setZoomFactor(rMapMode.GetScaleX(), *m_aEndMarker.get());
- m_aSplitter.Show();
- m_aStartMarker.Show();
- m_aReportSection.Show();
- m_aEndMarker.Show();
+ m_aSplitter->Show();
+ m_aStartMarker->Show();
+ m_aReportSection->Show();
+ m_aEndMarker->Show();
Show();
m_pSectionMulti = new OPropertyChangeMultiplexer(this,_xSection.get());
@@ -100,6 +100,11 @@ OSectionWindow::OSectionWindow( OViewsWindow* _pParent,const uno::Reference< rep
OSectionWindow::~OSectionWindow()
{
+ disposeOnce();
+}
+
+void OSectionWindow::dispose()
+{
try
{
if ( m_pSectionMulti.is() )
@@ -110,6 +115,12 @@ OSectionWindow::~OSectionWindow()
catch (uno::Exception&)
{
}
+ m_aStartMarker.disposeAndClear();
+ m_aReportSection.disposeAndClear();
+ m_aSplitter.disposeAndClear();
+ m_aEndMarker.disposeAndClear();
+ m_pParent.clear();
+ vcl::Window::dispose();
}
void OSectionWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent)
@@ -119,7 +130,7 @@ void OSectionWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent)
const uno::Reference< report::XSection > xSection(_rEvent.Source,uno::UNO_QUERY);
if ( xSection.is() )
{
- const uno::Reference< report::XSection> xCurrentSection = m_aReportSection.getSection();
+ const uno::Reference< report::XSection> xCurrentSection = m_aReportSection->getSection();
if ( _rEvent.PropertyName == PROPERTY_HEIGHT )
{
m_pParent->getView()->SetUpdateMode(false);
@@ -137,13 +148,13 @@ void OSectionWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent)
|| setReportSectionTitle(xReport,RID_STR_PAGE_HEADER,::std::mem_fun(&OReportHelper::getPageHeader),::std::mem_fun(&OReportHelper::getPageHeaderOn))
|| setReportSectionTitle(xReport,RID_STR_PAGE_FOOTER,::std::mem_fun(&OReportHelper::getPageFooter),::std::mem_fun(&OReportHelper::getPageFooterOn)) )
{
- m_aStartMarker.Invalidate(INVALIDATE_NOERASE);
+ m_aStartMarker->Invalidate(INVALIDATE_NOERASE);
}
else
{
OUString sTitle = ModuleRes(RID_STR_DETAIL);
- m_aStartMarker.setTitle(sTitle);
- m_aStartMarker.Invalidate(INVALIDATE_CHILDREN);
+ m_aStartMarker->setTitle(sTitle);
+ m_aStartMarker->Invalidate(INVALIDATE_CHILDREN);
}
}
}
@@ -160,12 +171,12 @@ void OSectionWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent)
bool OSectionWindow::setReportSectionTitle(const uno::Reference< report::XReportDefinition>& _xReport,sal_uInt16 _nResId,::std::mem_fun_t<uno::Reference<report::XSection> , OReportHelper> _pGetSection, const ::std::mem_fun_t<bool,OReportHelper>& _pIsSectionOn)
{
OReportHelper aReportHelper(_xReport);
- const bool bRet = _pIsSectionOn(&aReportHelper) && _pGetSection(&aReportHelper) == m_aReportSection.getSection();
+ const bool bRet = _pIsSectionOn(&aReportHelper) && _pGetSection(&aReportHelper) == m_aReportSection->getSection();
if ( bRet )
{
OUString sTitle = ModuleRes(_nResId);
- m_aStartMarker.setTitle(sTitle);
- m_aStartMarker.Invalidate(INVALIDATE_CHILDREN);
+ m_aStartMarker->setTitle(sTitle);
+ m_aStartMarker->Invalidate(INVALIDATE_CHILDREN);
}
return bRet;
}
@@ -173,7 +184,7 @@ bool OSectionWindow::setReportSectionTitle(const uno::Reference< report::XReport
bool OSectionWindow::setGroupSectionTitle(const uno::Reference< report::XGroup>& _xGroup,sal_uInt16 _nResId,::std::mem_fun_t<uno::Reference<report::XSection> , OGroupHelper> _pGetSection, const ::std::mem_fun_t<bool,OGroupHelper>& _pIsSectionOn)
{
OGroupHelper aGroupHelper(_xGroup);
- const bool bRet = _pIsSectionOn(&aGroupHelper) && _pGetSection(&aGroupHelper) == m_aReportSection.getSection() ;
+ const bool bRet = _pIsSectionOn(&aGroupHelper) && _pGetSection(&aGroupHelper) == m_aReportSection->getSection() ;
if ( bRet )
{
OUString sExpression = _xGroup->getExpression();
@@ -185,8 +196,8 @@ bool OSectionWindow::setGroupSectionTitle(const uno::Reference< report::XGroup>&
OUString sTitle( ModuleRes(_nResId).toString() );
sTitle = sTitle.replaceFirst("#", sExpression);
- m_aStartMarker.setTitle( sTitle );
- m_aStartMarker.Invalidate(INVALIDATE_CHILDREN);
+ m_aStartMarker->setTitle( sTitle );
+ m_aStartMarker->Invalidate(INVALIDATE_CHILDREN);
}
return bRet;
}
@@ -225,12 +236,12 @@ void OSectionWindow::Resize()
const Point aThumbPos = m_pParent->getView()->getThumbPos();
aOutputSize.Width() -= aThumbPos.X();
- aOutputSize.Height() -= m_aSplitter.GetSizePixel().Height();
+ aOutputSize.Height() -= m_aSplitter->GetSizePixel().Height();
- if ( m_aStartMarker.isCollapsed() )
+ if ( m_aStartMarker->isCollapsed() )
{
Point aPos(0,0);
- m_aStartMarker.SetPosSizePixel(aPos,aOutputSize);
+ m_aStartMarker->SetPosSizePixel(aPos,aOutputSize);
}
else
{
@@ -240,49 +251,49 @@ void OSectionWindow::Resize()
aStartWidth *= GetMapMode().GetScaleX();
// set start marker
- m_aStartMarker.SetPosSizePixel(Point(0,0),Size(aStartWidth,aOutputSize.Height()));
+ m_aStartMarker->SetPosSizePixel(Point(0,0),Size(aStartWidth,aOutputSize.Height()));
// set report section
- const uno::Reference< report::XSection> xSection = m_aReportSection.getSection();
+ const uno::Reference< report::XSection> xSection = m_aReportSection->getSection();
Size aSectionSize = LogicToPixel( Size( 0,xSection->getHeight() ) );
Point aReportPos(aStartWidth,0);
aSectionSize.Width() = aOutputSize.Width() - (long)aStartWidth;
if ( bShowEndMarker )
aSectionSize.Width() -= (long)aEndWidth;
- m_aReportSection.SetPosSizePixel(aReportPos,aSectionSize);
+ m_aReportSection->SetPosSizePixel(aReportPos,aSectionSize);
// set splitter
aReportPos.Y() += aSectionSize.Height();
- m_aSplitter.SetPosSizePixel(aReportPos,Size(aSectionSize.Width(),m_aSplitter.GetSizePixel().Height()));
+ m_aSplitter->SetPosSizePixel(aReportPos,Size(aSectionSize.Width(),m_aSplitter->GetSizePixel().Height()));
aSectionSize.Height() = (long)(1000 * (double)GetMapMode().GetScaleY());
- m_aSplitter.SetDragRectPixel( Rectangle(Point(aStartWidth,0),aSectionSize));
+ m_aSplitter->SetDragRectPixel( Rectangle(Point(aStartWidth,0),aSectionSize));
// set end marker
aReportPos.X() += aSectionSize.Width();
aReportPos.Y() = 0;
- m_aEndMarker.Show(bShowEndMarker);
- m_aEndMarker.SetPosSizePixel(aReportPos,Size(aEndWidth,aOutputSize.Height()));
+ m_aEndMarker->Show(bShowEndMarker);
+ m_aEndMarker->SetPosSizePixel(aReportPos,Size(aEndWidth,aOutputSize.Height()));
}
}
void OSectionWindow::setCollapsed(bool _bCollapsed)
{
- if ( m_aStartMarker.isCollapsed() != _bCollapsed )
+ if ( m_aStartMarker->isCollapsed() != _bCollapsed )
{
- m_aStartMarker.setCollapsed(_bCollapsed);
+ m_aStartMarker->setCollapsed(_bCollapsed);
}
}
void OSectionWindow::showProperties()
{
- m_pParent->getView()->showProperties( m_aReportSection.getSection().get() );
+ m_pParent->getView()->showProperties( m_aReportSection->getSection().get() );
}
void OSectionWindow::setMarked(bool _bMark)
{
- m_aStartMarker.setMarked(_bMark);
- m_aEndMarker.setMarked(_bMark);
+ m_aStartMarker->setMarked(_bMark);
+ m_aEndMarker->setMarked(_bMark);
}
IMPL_LINK( OSectionWindow, Collapsed, OColorListener *, _pMarker )
@@ -290,9 +301,9 @@ IMPL_LINK( OSectionWindow, Collapsed, OColorListener *, _pMarker )
if ( _pMarker )
{
bool bShow = !_pMarker->isCollapsed();
- m_aReportSection.Show(bShow);
- m_aEndMarker.Show(bShow);
- m_aSplitter.Show(bShow);
+ m_aReportSection->Show(bShow);
+ m_aEndMarker->Show(bShow);
+ m_aSplitter->Show(bShow);
m_pParent->resize(*this);
}
@@ -302,11 +313,11 @@ IMPL_LINK( OSectionWindow, Collapsed, OColorListener *, _pMarker )
void OSectionWindow::zoom(const Fraction& _aZoom)
{
setZoomFactor(_aZoom,*this);
- m_aStartMarker.zoom(_aZoom);
+ m_aStartMarker->zoom(_aZoom);
- setZoomFactor(_aZoom,m_aReportSection);
- setZoomFactor(_aZoom,m_aSplitter);
- setZoomFactor(_aZoom,m_aEndMarker);
+ setZoomFactor(_aZoom, *m_aReportSection.get());
+ setZoomFactor(_aZoom, *m_aSplitter.get());
+ setZoomFactor(_aZoom, *m_aEndMarker.get());
Invalidate();
}
@@ -332,8 +343,8 @@ IMPL_LINK( OSectionWindow, SplitHdl, Splitter*, _pSplitter )
sal_Int32 nSplitPos = _pSplitter->GetSplitPosPixel();
- const uno::Reference< report::XSection> xSection = m_aReportSection.getSection();
- nSplitPos = m_aSplitter.PixelToLogic(Size(0,nSplitPos)).Height();
+ const uno::Reference< report::XSection> xSection = m_aReportSection->getSection();
+ nSplitPos = m_aSplitter->PixelToLogic(Size(0,nSplitPos)).Height();
const sal_Int32 nCount = xSection->getCount();
for (sal_Int32 i = 0; i < nCount; ++i)
@@ -349,7 +360,7 @@ IMPL_LINK( OSectionWindow, SplitHdl, Splitter*, _pSplitter )
nSplitPos = 0;
xSection->setHeight(nSplitPos);
- m_aSplitter.SetSplitPosPixel(m_aSplitter.LogicToPixel(Size(0,nSplitPos)).Height());
+ m_aSplitter->SetSplitPosPixel(m_aSplitter->LogicToPixel(Size(0,nSplitPos)).Height());
return 0L;
}
@@ -371,21 +382,21 @@ void OSectionWindow::scrollChildren(long _nX)
{
const Point aDelta( _nX,0 );
- MapMode aMapMode( m_aReportSection.GetMapMode() );
+ MapMode aMapMode( m_aReportSection->GetMapMode() );
const Point aOld = aMapMode.GetOrigin();
- lcl_setOrigin(m_aReportSection,aDelta.X(), 0);
+ lcl_setOrigin(*m_aReportSection.get(), aDelta.X(), 0);
- aMapMode = m_aReportSection.GetMapMode();
+ aMapMode = m_aReportSection->GetMapMode();
const Point aNew = aMapMode.GetOrigin();
const Point aDiff = aOld - aNew;
{
- lcl_scroll(m_aReportSection,aDiff);
+ lcl_scroll(*m_aReportSection.get(), aDiff);
}
- lcl_scroll(m_aEndMarker,m_aEndMarker.PixelToLogic(Point(_nX,0)));
+ lcl_scroll(*m_aEndMarker.get(), m_aEndMarker->PixelToLogic(Point(_nX,0)));
- lcl_setOrigin(m_aSplitter,_nX, 0);
- lcl_scroll(m_aSplitter,aDiff);
+ lcl_setOrigin(*m_aSplitter.get(),_nX, 0);
+ lcl_scroll(*m_aSplitter.get(),aDiff);
}
} // rptui
diff --git a/reportdesign/source/ui/report/StartMarker.cxx b/reportdesign/source/ui/report/StartMarker.cxx
index 37a1e7ce4608..a435b02a38ed 100644
--- a/reportdesign/source/ui/report/StartMarker.cxx
+++ b/reportdesign/source/ui/report/StartMarker.cxx
@@ -48,9 +48,9 @@ oslInterlockedCount OStartMarker::s_nImageRefCount = 0;
OStartMarker::OStartMarker(OSectionWindow* _pParent,const OUString& _sColorEntry)
: OColorListener(_pParent,_sColorEntry)
-,m_aVRuler(this,WB_VERT)
-,m_aText(this,WB_HYPHENATION)
-,m_aImage(this,WB_LEFT|WB_TOP|WB_SCALE)
+,m_aVRuler(VclPtr<Ruler>::Create(this,WB_VERT))
+,m_aText(VclPtr<FixedText>::Create(this,WB_HYPHENATION))
+,m_aImage(VclPtr<FixedImage>::Create(this,WB_LEFT|WB_TOP|WB_SCALE))
,m_pParent(_pParent)
,m_bShowRuler(true)
{
@@ -59,20 +59,20 @@ OStartMarker::OStartMarker(OSectionWindow* _pParent,const OUString& _sColorEntry
osl_atomic_increment(&s_nImageRefCount);
initDefaultNodeImages();
ImplInitSettings();
- m_aText.SetHelpId(HID_RPT_START_TITLE);
- m_aText.SetPaintTransparent(true);
- m_aImage.SetHelpId(HID_RPT_START_IMAGE);
- m_aText.Show();
- m_aImage.Show();
- m_aVRuler.Show();
- m_aVRuler.Activate();
- m_aVRuler.SetPagePos(0);
- m_aVRuler.SetBorders();
- m_aVRuler.SetIndents();
- m_aVRuler.SetMargin1();
- m_aVRuler.SetMargin2();
+ m_aText->SetHelpId(HID_RPT_START_TITLE);
+ m_aText->SetPaintTransparent(true);
+ m_aImage->SetHelpId(HID_RPT_START_IMAGE);
+ m_aText->Show();
+ m_aImage->Show();
+ m_aVRuler->Show();
+ m_aVRuler->Activate();
+ m_aVRuler->SetPagePos(0);
+ m_aVRuler->SetBorders();
+ m_aVRuler->SetIndents();
+ m_aVRuler->SetMargin1();
+ m_aVRuler->SetMargin2();
const MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum();
- m_aVRuler.SetUnit(MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH);
+ m_aVRuler->SetUnit(MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH);
EnableChildTransparentMode( true );
SetParentClipMode( PARENTCLIPMODE_NOCLIP );
SetPaintTransparent( true );
@@ -80,18 +80,28 @@ OStartMarker::OStartMarker(OSectionWindow* _pParent,const OUString& _sColorEntry
OStartMarker::~OStartMarker()
{
+ disposeOnce();
+}
+
+void OStartMarker::dispose()
+{
if ( osl_atomic_decrement(&s_nImageRefCount) == 0 )
{
DELETEZ(s_pDefCollapsed);
DELETEZ(s_pDefExpanded);
}
+ m_aVRuler.disposeAndClear();
+ m_aText.disposeAndClear();
+ m_aImage.disposeAndClear();
+ m_pParent.clear();
+ OColorListener::dispose();
}
sal_Int32 OStartMarker::getMinHeight() const
{
Fraction aExtraWidth(long(2*REPORT_EXTRA_SPACE));
aExtraWidth *= GetMapMode().GetScaleX();
- return LogicToPixel(Size(0,m_aText.GetTextHeight())).Height() + (long)aExtraWidth;
+ return LogicToPixel(Size(0,m_aText->GetTextHeight())).Height() + (long)aExtraWidth;
}
void OStartMarker::Paint( const Rectangle& rRect )
@@ -107,7 +117,7 @@ void OStartMarker::Paint( const Rectangle& rRect )
}
else
{
- const long nVRulerWidth = m_aVRuler.GetSizePixel().Width();
+ const long nVRulerWidth = m_aVRuler->GetSizePixel().Width();
nSize = aSize.Width() - nVRulerWidth;
aSize.Width() += nCornerWidth;
SetClipRegion(vcl::Region(PixelToLogic(Rectangle(Point(),Size(nSize,aSize.Height())))));
@@ -148,8 +158,8 @@ void OStartMarker::setColor()
Color aTextColor = GetTextColor();
if ( aColor.GetLuminance() < 128 )
aTextColor = COL_WHITE;
- m_aText.SetTextColor(aTextColor);
- m_aText.SetLineColor(m_nColor);
+ m_aText->SetTextColor(aTextColor);
+ m_aText->SetLineColor(m_nColor);
}
void OStartMarker::MouseButtonUp( const MouseEvent& rMEvt )
@@ -162,14 +172,14 @@ void OStartMarker::MouseButtonUp( const MouseEvent& rMEvt )
const Size aOutputSize = GetOutputSizePixel();
if( aPos.X() > aOutputSize.Width() || aPos.Y() > aOutputSize.Height() )
return;
- Rectangle aRect(m_aImage.GetPosPixel(),m_aImage.GetSizePixel());
+ Rectangle aRect(m_aImage->GetPosPixel(),m_aImage->GetSizePixel());
if ( rMEvt.GetClicks() == 2 || aRect.IsInside( aPos ) )
{
m_bCollapsed = !m_bCollapsed;
changeImage();
- m_aVRuler.Show(!m_bCollapsed && m_bShowRuler);
+ m_aVRuler->Show(!m_bCollapsed && m_bShowRuler);
if ( m_aCollapsedLink.IsSet() )
m_aCollapsedLink.Call(this);
}
@@ -180,7 +190,7 @@ void OStartMarker::MouseButtonUp( const MouseEvent& rMEvt )
void OStartMarker::changeImage()
{
Image* pImage = m_bCollapsed ? s_pDefCollapsed : s_pDefExpanded;
- m_aImage.SetImage(*pImage);
+ m_aImage->SetImage(*pImage);
}
void OStartMarker::initDefaultNodeImages()
@@ -192,11 +202,11 @@ void OStartMarker::initDefaultNodeImages()
}
Image* pImage = m_bCollapsed ? s_pDefCollapsed : s_pDefExpanded;
- m_aImage.SetImage(*pImage);
- m_aImage.SetMouseTransparent(true);
- m_aImage.SetBackground();
- m_aText.SetBackground();
- m_aText.SetMouseTransparent(true);
+ m_aImage->SetImage(*pImage);
+ m_aImage->SetMouseTransparent(true);
+ m_aImage->SetBackground();
+ m_aText->SetBackground();
+ m_aText->SetMouseTransparent(true);
}
void OStartMarker::ImplInitSettings()
@@ -212,11 +222,11 @@ void OStartMarker::Resize()
const long nOutputWidth = aOutputSize.Width();
const long nOutputHeight = aOutputSize.Height();
- const long nVRulerWidth = m_aVRuler.GetSizePixel().Width();
+ const long nVRulerWidth = m_aVRuler->GetSizePixel().Width();
const Point aRulerPos(nOutputWidth - nVRulerWidth,0);
- m_aVRuler.SetPosSizePixel(aRulerPos,Size(nVRulerWidth,nOutputHeight));
+ m_aVRuler->SetPosSizePixel(aRulerPos,Size(nVRulerWidth,nOutputHeight));
- Size aImageSize = m_aImage.GetImage().GetSizePixel();
+ Size aImageSize = m_aImage->GetImage().GetSizePixel();
const MapMode& rMapMode = GetMapMode();
aImageSize.Width() = long(aImageSize.Width() * (double)rMapMode.GetScaleX());
aImageSize.Height() = long(aImageSize.Height() * (double)rMapMode.GetScaleY());
@@ -225,17 +235,17 @@ void OStartMarker::Resize()
aExtraWidth *= rMapMode.GetScaleX();
Point aPos(aImageSize.Width() + (long)(aExtraWidth + aExtraWidth), aExtraWidth);
- const long nHeight = ::std::max<sal_Int32>(nOutputHeight - 2*aPos.Y(),LogicToPixel(Size(0,m_aText.GetTextHeight())).Height());
- m_aText.SetPosSizePixel(aPos,Size(aRulerPos.X() - aPos.X(),nHeight));
+ const long nHeight = ::std::max<sal_Int32>(nOutputHeight - 2*aPos.Y(),LogicToPixel(Size(0,m_aText->GetTextHeight())).Height());
+ m_aText->SetPosSizePixel(aPos,Size(aRulerPos.X() - aPos.X(),nHeight));
aPos.X() = aExtraWidth;
- aPos.Y() += static_cast<sal_Int32>((LogicToPixel(Size(0,m_aText.GetTextHeight())).Height() - aImageSize.Height()) * 0.5) ;
- m_aImage.SetPosSizePixel(aPos,aImageSize);
+ aPos.Y() += static_cast<sal_Int32>((LogicToPixel(Size(0,m_aText->GetTextHeight())).Height() - aImageSize.Height()) * 0.5) ;
+ m_aImage->SetPosSizePixel(aPos,aImageSize);
}
void OStartMarker::setTitle(const OUString& _sTitle)
{
- m_aText.SetText(_sTitle);
+ m_aText->SetText(_sTitle);
}
void OStartMarker::Notify(SfxBroadcaster & rBc, SfxHint const & rHint)
@@ -252,12 +262,12 @@ void OStartMarker::Notify(SfxBroadcaster & rBc, SfxHint const & rHint)
void OStartMarker::showRuler(bool _bShow)
{
m_bShowRuler = _bShow;
- m_aVRuler.Show(!m_bCollapsed && m_bShowRuler);
+ m_aVRuler->Show(!m_bCollapsed && m_bShowRuler);
}
void OStartMarker::RequestHelp( const HelpEvent& rHEvt )
{
- if( !m_aText.GetText().isEmpty())
+ if( !m_aText->GetText().isEmpty())
{
// Hilfe anzeigen
Rectangle aItemRect(rHEvt.GetMousePosPixel(),Size(GetSizePixel().Width(),getMinHeight()));
@@ -268,9 +278,9 @@ void OStartMarker::RequestHelp( const HelpEvent& rHEvt )
aItemRect.Right() = aPt.X();
aItemRect.Bottom() = aPt.Y();
if( rHEvt.GetMode() == HelpEventMode::BALLOON )
- Help::ShowBalloon( this, aItemRect.Center(), aItemRect, m_aText.GetText());
+ Help::ShowBalloon( this, aItemRect.Center(), aItemRect, m_aText->GetText());
else
- Help::ShowQuickHelp( this, aItemRect, m_aText.GetText() );
+ Help::ShowQuickHelp( this, aItemRect, m_aText->GetText() );
}
}
@@ -284,8 +294,8 @@ void OStartMarker::setCollapsed(bool _bCollapsed)
void OStartMarker::zoom(const Fraction& _aZoom)
{
setZoomFactor(_aZoom,*this);
- m_aVRuler.SetZoom(_aZoom);
- setZoomFactor(_aZoom,m_aText);
+ m_aVRuler->SetZoom(_aZoom);
+ setZoomFactor(_aZoom, *m_aText.get());
Resize();
Invalidate();
}
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx
index 9a7afeeae66c..49bf68956faf 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -185,8 +185,15 @@ OViewsWindow::OViewsWindow( OReportWindow* _pReportWindow)
OViewsWindow::~OViewsWindow()
{
+ disposeOnce();
+}
+
+void OViewsWindow::dispose()
+{
m_aColorConfig.RemoveListener(this);
m_aSections.clear();
+ m_pParent.clear();
+ vcl::Window::dispose();
}
void OViewsWindow::impl_resizeSectionWindow(OSectionWindow& _rSectionWindow,Point& _rStartPoint,bool _bSet)
@@ -219,8 +226,8 @@ void OViewsWindow::resize(const OSectionWindow& _rSectionWindow)
TSectionsMap::iterator aEnd = m_aSections.end();
for (;aIter != aEnd ; ++aIter)
{
- const ::boost::shared_ptr<OSectionWindow> pSectionWindow = (*aIter);
- if ( pSectionWindow.get() == &_rSectionWindow )
+ OSectionWindow* pSectionWindow = (*aIter);
+ if ( pSectionWindow == &_rSectionWindow )
{
aStartPoint = pSectionWindow->GetPosPixel();
bSet = true;
@@ -228,7 +235,7 @@ void OViewsWindow::resize(const OSectionWindow& _rSectionWindow)
if ( bSet )
{
- impl_resizeSectionWindow(*pSectionWindow.get(),aStartPoint,bSet);
+ impl_resizeSectionWindow(*pSectionWindow,aStartPoint,bSet);
static sal_Int32 nIn = INVALIDATE_UPDATE | INVALIDATE_TRANSPARENT;
pSectionWindow->getStartMarker().Invalidate( nIn ); // INVALIDATE_NOERASE |INVALIDATE_NOCHILDREN| INVALIDATE_TRANSPARENT
pSectionWindow->getEndMarker().Invalidate( nIn );
@@ -248,8 +255,8 @@ void OViewsWindow::Resize()
TSectionsMap::iterator aEnd = m_aSections.end();
for (;aIter != aEnd ; ++aIter)
{
- const ::boost::shared_ptr<OSectionWindow> pSectionWindow = (*aIter);
- impl_resizeSectionWindow(*pSectionWindow.get(),aStartPoint,true);
+ OSectionWindow* pSectionWindow = (*aIter);
+ impl_resizeSectionWindow(*pSectionWindow,aStartPoint,true);
}
}
}
@@ -292,7 +299,7 @@ void OViewsWindow::DataChanged( const DataChangedEvent& rDCEvt )
void OViewsWindow::addSection(const uno::Reference< report::XSection >& _xSection,const OUString& _sColorEntry,sal_uInt16 _nPosition)
{
- ::boost::shared_ptr<OSectionWindow> pSectionWindow( new OSectionWindow(this,_xSection,_sColorEntry) );
+ VclPtrInstance<OSectionWindow> pSectionWindow(this,_xSection,_sColorEntry);
m_aSections.insert(getIteratorAtPos(_nPosition) , TSectionsMap::value_type(pSectionWindow));
m_pParent->setMarked(&pSectionWindow->getReportSection().getSectionView(),m_aSections.size() == 1);
Resize();
@@ -392,17 +399,17 @@ void OViewsWindow::Paste()
::o3tl::compose1(::boost::bind(&OReportSection::Paste,_1,aCopies,false),TReportPairHelper()));
else
{
- ::boost::shared_ptr<OSectionWindow> pMarkedSection = getMarkedSection();
+ OSectionWindow* pMarkedSection = getMarkedSection();
if ( pMarkedSection )
pMarkedSection->getReportSection().Paste(aCopies,true);
}
}
-::boost::shared_ptr<OSectionWindow> OViewsWindow::getSectionWindow(const uno::Reference< report::XSection>& _xSection) const
+OSectionWindow* OViewsWindow::getSectionWindow(const uno::Reference< report::XSection>& _xSection) const
{
OSL_ENSURE(_xSection.is(),"Section is NULL!");
- ::boost::shared_ptr<OSectionWindow> pSectionWindow;
+ OSectionWindow* pSectionWindow = NULL;
TSectionsMap::const_iterator aIter = m_aSections.begin();
TSectionsMap::const_iterator aEnd = m_aSections.end();
for (; aIter != aEnd ; ++aIter)
@@ -418,9 +425,9 @@ void OViewsWindow::Paste()
}
-::boost::shared_ptr<OSectionWindow> OViewsWindow::getMarkedSection(NearSectionAccess nsa) const
+OSectionWindow* OViewsWindow::getMarkedSection(NearSectionAccess nsa) const
{
- ::boost::shared_ptr<OSectionWindow> pRet;
+ OSectionWindow* pRet = NULL;
TSectionsMap::const_iterator aIter = m_aSections.begin();
TSectionsMap::const_iterator aEnd = m_aSections.end();
sal_uInt32 nCurrentPosition = 0;
@@ -624,7 +631,7 @@ void OViewsWindow::setMarked(const uno::Sequence< uno::Reference< report::XRepor
bFirst = false;
m_pParent->setMarked(xSection,_bMark);
}
- ::boost::shared_ptr<OSectionWindow> pSectionWindow = getSectionWindow(xSection);
+ OSectionWindow* pSectionWindow = getSectionWindow(xSection);
if ( pSectionWindow )
{
SvxShape* pShape = SvxShape::getImplementation( *pIter );
@@ -881,7 +888,7 @@ void OViewsWindow::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAli
void OViewsWindow::createDefault()
{
- ::boost::shared_ptr<OSectionWindow> pMarkedSection = getMarkedSection();
+ OSectionWindow* pMarkedSection = getMarkedSection();
if ( pMarkedSection )
pMarkedSection->getReportSection().createDefault(m_sShapeType);
}
@@ -922,9 +929,9 @@ sal_uInt16 OViewsWindow::getPosition(const OSectionWindow* _pSectionWindow) cons
return nPosition;
}
-::boost::shared_ptr<OSectionWindow> OViewsWindow::getSectionWindow(const sal_uInt16 _nPos) const
+OSectionWindow* OViewsWindow::getSectionWindow(const sal_uInt16 _nPos) const
{
- ::boost::shared_ptr<OSectionWindow> aReturn;
+ OSectionWindow* aReturn = NULL;
if ( _nPos < m_aSections.size() )
aReturn = m_aSections[_nPos];
diff --git a/reportdesign/source/ui/report/propbrw.cxx b/reportdesign/source/ui/report/propbrw.cxx
index 0e8f7b6492c1..0fb2b0e62dfe 100644
--- a/reportdesign/source/ui/report/propbrw.cxx
+++ b/reportdesign/source/ui/report/propbrw.cxx
@@ -185,6 +185,11 @@ PropBrw::PropBrw(const Reference< XComponentContext >& _xORB, vcl::Window* pPare
PropBrw::~PropBrw()
{
+ disposeOnce();
+}
+
+void PropBrw::dispose()
+{
if (m_xBrowserController.is())
implDetachController();
@@ -204,6 +209,8 @@ PropBrw::~PropBrw()
{}
::rptui::notifySystemWindow(this,this,::comphelper::mem_fun(&TaskPaneList::RemoveWindow));
+ m_pDesignView.clear();
+ DockingWindow::dispose();
}
void PropBrw::setCurrentPage(const OUString& _sLastActivePage)
@@ -507,7 +514,7 @@ void PropBrw::Update( OSectionView* pNewView )
const sal_uInt16 nSectionCount = pViews->getSectionCount();
for (sal_uInt16 i = 0; i < nSectionCount; ++i)
{
- ::boost::shared_ptr<OSectionWindow> pSectionWindow = pViews->getSectionWindow(i);
+ OSectionWindow* pSectionWindow = pViews->getSectionWindow(i);
if ( pSectionWindow )
{
const SdrMarkList& rMarkList = pSectionWindow->getReportSection().getSectionView().GetMarkedObjectList();
diff --git a/sc/inc/AccessibleFilterMenu.hxx b/sc/inc/AccessibleFilterMenu.hxx
index 65da10f1e4f9..2fa0a383fd22 100644
--- a/sc/inc/AccessibleFilterMenu.hxx
+++ b/sc/inc/AccessibleFilterMenu.hxx
@@ -27,6 +27,7 @@
#include <com/sun/star/accessibility/XAccessibleText.hpp>
#include <com/sun/star/accessibility/XAccessibleTextAttributes.hpp>
#include <com/sun/star/accessibility/TextSegment.hpp>
+#include <vcl/vclptr.hxx>
#include <vector>
@@ -169,7 +170,7 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > mxStateSet;
size_t mnMenuPos;
- ScMenuFloatingWindow* mpWindow;
+ VclPtr<ScMenuFloatingWindow> mpWindow;
bool mbEnabled:1;
};
diff --git a/sc/inc/AccessibleFilterMenuItem.hxx b/sc/inc/AccessibleFilterMenuItem.hxx
index dc723e7e2091..7eb2e8a74efb 100644
--- a/sc/inc/AccessibleFilterMenuItem.hxx
+++ b/sc/inc/AccessibleFilterMenuItem.hxx
@@ -24,6 +24,7 @@
#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/accessibility/XAccessibleAction.hpp>
+#include <vcl/vclptr.hxx>
class ScMenuFloatingWindow;
@@ -104,7 +105,7 @@ private:
private:
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > mxStateSet;
- ScMenuFloatingWindow* mpWindow;
+ VclPtr<ScMenuFloatingWindow> mpWindow;
size_t mnMenuPos;
bool mbEnabled;
};
diff --git a/sc/inc/dociter.hxx b/sc/inc/dociter.hxx
index 838c100ce643..5b32930858b7 100644
--- a/sc/inc/dociter.hxx
+++ b/sc/inc/dociter.hxx
@@ -26,6 +26,7 @@
#include "scdllapi.h"
#include "cellvalue.hxx"
#include "mtvelements.hxx"
+#include <vcl/vclptr.hxx>
#include <memory>
@@ -588,7 +589,7 @@ private:
private:
ScDocument& mrDoc;
- OutputDevice* mpOutDev;
+ VclPtr<OutputDevice> mpOutDev;
double mfPPTX;
double mfPPTY;
const ::std::vector<TabRanges>* mpTabRangesArray;
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index bf9f078fbadd..8f2e65fae59e 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -24,7 +24,7 @@
#include <vcl/timer.hxx>
#include <vcl/idle.hxx>
#include <com/sun/star/uno/Reference.hxx>
-#include <rtl/ref.hxx>
+#include <vcl/vclptr.hxx>
#include "scdllapi.h"
#include "rangelst.hxx"
#include "rangenam.hxx"
@@ -286,8 +286,8 @@ private:
ScFieldEditEngine* pEditEngine; // uses pEditPool from xPoolHelper
ScNoteEditEngine* pNoteEngine; // uses pEditPool from xPoolHelper
SfxObjectShell* pShell;
- SfxPrinter* pPrinter;
- VirtualDevice* pVirtualDevice_100th_mm;
+ VclPtr<SfxPrinter> pPrinter;
+ VclPtr<VirtualDevice> pVirtualDevice_100th_mm;
ScDrawLayer* pDrawLayer; // SdrModel
rtl::Reference<XColorList> pColorList;
ScValidationDataList* pValidationList; // validity
diff --git a/sc/inc/editutil.hxx b/sc/inc/editutil.hxx
index 3b9b53a40d0e..5e3a12693b53 100644
--- a/sc/inc/editutil.hxx
+++ b/sc/inc/editutil.hxx
@@ -28,8 +28,8 @@
#include <tools/time.hxx>
#include <tools/gen.hxx>
#include <tools/fract.hxx>
+#include <vcl/outdev.hxx>
-class OutputDevice;
class ScDocument;
class ScPatternAttr;
class ScEditEngineDefaulter;
@@ -41,7 +41,7 @@ class ScEditUtil
SCROW nRow;
SCTAB nTab;
Point aScrPos;
- OutputDevice* pDev; // MapMode has to be set
+ VclPtr<OutputDevice> pDev; // MapMode has to be set
double nPPTX;
double nPPTY;
Fraction aZoomX;
@@ -80,10 +80,7 @@ public:
ScEditUtil( ScDocument* pDocument, SCCOL nX, SCROW nY, SCTAB nZ,
const Point& rScrPosPixel,
OutputDevice* pDevice, double nScaleX, double nScaleY,
- const Fraction& rX, const Fraction& rY ) :
- pDoc(pDocument),nCol(nX),nRow(nY),nTab(nZ),
- aScrPos(rScrPosPixel),pDev(pDevice),
- nPPTX(nScaleX),nPPTY(nScaleY),aZoomX(rX),aZoomY(rY) {}
+ const Fraction& rX, const Fraction& rY );
Rectangle GetEditArea( const ScPatternAttr* pPattern, bool bForceToTop );
};
diff --git a/sc/inc/rowheightcontext.hxx b/sc/inc/rowheightcontext.hxx
index a077bd0d3361..f801ee466f29 100644
--- a/sc/inc/rowheightcontext.hxx
+++ b/sc/inc/rowheightcontext.hxx
@@ -13,11 +13,11 @@
#include "scdllapi.h"
#include <tools/fract.hxx>
+#include <vcl/vclptr.hxx>
+#include <vcl/outdev.hxx>
#include <vector>
-class OutputDevice;
-
namespace sc {
class SC_DLLPUBLIC RowHeightContext
@@ -28,7 +28,7 @@ class SC_DLLPUBLIC RowHeightContext
double mfPPTY;
Fraction maZoomX;
Fraction maZoomY;
- OutputDevice* mpOutDev;
+ VclPtr<OutputDevice> mpOutDev;
sal_uInt16 mnExtraHeight;
bool mbForceAutoSize; /// whether to set height to optimal even when the manual height flag is set.
diff --git a/sc/inc/scmod.hxx b/sc/inc/scmod.hxx
index 2673e2f1ad7d..31d90b6b00d8 100644
--- a/sc/inc/scmod.hxx
+++ b/sc/inc/scmod.hxx
@@ -112,8 +112,8 @@ class ScModule: public SfxModule, public SfxListener, utl::ConfigurationListener
bool mbIsInSharedDocLoading:1;
bool mbIsInSharedDocSaving:1;
- std::map<sal_uInt16, std::list<vcl::Window*> > m_mapRefWindow;
- std::stack<ScAnyRefModalDlg*> maAnyRefDlgStack;
+ std::map<sal_uInt16, std::list<VclPtr<vcl::Window> > > m_mapRefWindow;
+ std::stack<VclPtr<ScAnyRefModalDlg> > maAnyRefDlgStack;
public:
SFX_DECL_INTERFACE(SCID_APP)
@@ -247,7 +247,7 @@ SC_DLLPUBLIC void SetAppOptions ( const ScAppOptions& rO
// virtual methods for the options dialog
virtual SfxItemSet* CreateItemSet( sal_uInt16 nId ) SAL_OVERRIDE;
virtual void ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) SAL_OVERRIDE;
- virtual SfxTabPage* CreateTabPage( sal_uInt16 nId, vcl::Window* pParent, const SfxItemSet& rSet ) SAL_OVERRIDE;
+ virtual VclPtr<SfxTabPage> CreateTabPage( sal_uInt16 nId, vcl::Window* pParent, const SfxItemSet& rSet ) SAL_OVERRIDE;
void SetInSharedDocLoading( bool bNew ) { mbIsInSharedDocLoading = bNew; }
bool IsInSharedDocLoading() const { return mbIsInSharedDocLoading; }
diff --git a/sc/inc/scopetools.hxx b/sc/inc/scopetools.hxx
index f0b7bf60e2e9..c246fa9171b8 100644
--- a/sc/inc/scopetools.hxx
+++ b/sc/inc/scopetools.hxx
@@ -11,6 +11,7 @@
#define INCLUDED_SC_INC_SCOPETOOLS_HXX
#include "scdllapi.h"
+#include <vcl/vclptr.hxx>
class ScDocument;
namespace vcl { class Window; }
@@ -58,7 +59,7 @@ public:
class WaitPointerSwitch
{
- vcl::Window* mpFrameWin;
+ VclPtr<vcl::Window> mpFrameWin;
public:
WaitPointerSwitch(vcl::Window* pWin);
~WaitPointerSwitch();
diff --git a/sc/inc/waitoff.hxx b/sc/inc/waitoff.hxx
index 0e7672022809..6c8b5f91bf7f 100644
--- a/sc/inc/waitoff.hxx
+++ b/sc/inc/waitoff.hxx
@@ -27,7 +27,7 @@ namespace vcl { class Window; }
class ScWaitCursorOff
{
private:
- vcl::Window* pWin;
+ VclPtr<vcl::Window> pWin;
sal_uInt32 nWaiters;
public:
ScWaitCursorOff( vcl::Window* pWin );
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 15a5a46066c8..05274b57691c 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -417,7 +417,7 @@ ScDocument::~ScDocument()
delete pChartCollection;
DeleteDrawLayer();
delete pFormatExchangeList;
- delete pPrinter;
+ pPrinter.disposeAndClear();
ImplDeleteOptions();
delete pConsolidateDlgData;
delete pClipData;
@@ -426,7 +426,7 @@ ScDocument::~ScDocument()
delete pEditEngine;
delete pNoteEngine;
delete pChangeViewSettings; // and delete
- delete pVirtualDevice_100th_mm;
+ pVirtualDevice_100th_mm.disposeAndClear();
delete pDPCollection;
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 4098c7e0d2ff..2bdfa30e3160 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -138,7 +138,7 @@ SfxPrinter* ScDocument::GetPrinter(bool bCreateIfNotExist)
pSet->Put( SfxFlagItem( SID_PRINTER_CHANGESTODOC, static_cast<int>(nFlags) ) );
pSet->Put( SfxBoolItem( SID_PRINTER_NOTFOUND_WARN, aMisc.IsNotFoundWarning() ) );
- pPrinter = new SfxPrinter( pSet );
+ pPrinter = VclPtr<SfxPrinter>::Create( pSet );
pPrinter->SetMapMode( MAP_100TH_MM );
UpdateDrawPrinter();
pPrinter->SetDigitLanguage( SC_MOD()->GetOptDigitLanguage() );
@@ -149,7 +149,7 @@ SfxPrinter* ScDocument::GetPrinter(bool bCreateIfNotExist)
void ScDocument::SetPrinter( SfxPrinter* pNewPrinter )
{
- if ( pNewPrinter == pPrinter )
+ if ( pNewPrinter == pPrinter.get() )
{
// #i6706# SetPrinter is called with the same printer again if
// the JobSetup has changed. In that case just call UpdateDrawPrinter
@@ -158,11 +158,10 @@ void ScDocument::SetPrinter( SfxPrinter* pNewPrinter )
}
else
{
- SfxPrinter* pOld = pPrinter;
+ ScopedVclPtr<SfxPrinter> pOld( pPrinter );
pPrinter = pNewPrinter;
UpdateDrawPrinter();
pPrinter->SetDigitLanguage( SC_MOD()->GetOptDigitLanguage() );
- delete pOld;
}
InvalidateTextWidth(NULL, NULL, false); // in both cases
}
@@ -194,9 +193,9 @@ VirtualDevice* ScDocument::GetVirtualDevice_100th_mm()
if (!pVirtualDevice_100th_mm)
{
#ifdef IOS
- pVirtualDevice_100th_mm = new VirtualDevice( 8 );
+ pVirtualDevice_100th_mm = VclPtr<VirtualDevice>::Create( 8 );
#else
- pVirtualDevice_100th_mm = new VirtualDevice( 1 );
+ pVirtualDevice_100th_mm = VclPtr<VirtualDevice>::Create( 1 );
#endif
pVirtualDevice_100th_mm->SetReferenceDevice(VirtualDevice::REFDEV_MODE_MSO1);
MapMode aMapMode( pVirtualDevice_100th_mm->GetMapMode() );
@@ -844,8 +843,8 @@ void ScDocument::UpdateExternalRefLinks(vcl::Window* pWin)
aBuf.append(OUString(ScResId(SCSTR_EXTDOC_NOT_LOADED)));
aBuf.appendAscii("\n\n");
aBuf.append(aFile);
- MessageDialog aBox(pWin, aBuf.makeStringAndClear());
- aBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aBox(pWin, aBuf.makeStringAndClear());
+ aBox->Execute();
}
pExternalRefMgr->enableDocTimer(true);
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 532090d238d1..30884cc17bc5 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -3204,9 +3204,9 @@ uno::Reference<sdbc::XRowSet> ScDPCollection::DBCaches::createRowSet(
}
catch ( const sdbc::SQLException& rError )
{
- //TODO: store error message
- InfoBox aInfoBox( 0, OUString(rError.Message) );
- aInfoBox.Execute();
+ //! store error message
+ ScopedVclPtrInstance< InfoBox > aInfoBox( nullptr, OUString(rError.Message) );
+ aInfoBox->Execute();
}
catch ( uno::Exception& )
{
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index b7145d569445..12b7cbbe6b56 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -577,13 +577,13 @@ void ScGlobal::InitTextHeight(SfxItemPool* pPool)
}
OutputDevice* pDefaultDev = Application::GetDefaultDevice();
- VirtualDevice aVirtWindow( *pDefaultDev );
- aVirtWindow.SetMapMode(MAP_PIXEL);
+ ScopedVclPtrInstance< VirtualDevice > pVirtWindow( *pDefaultDev );
+ pVirtWindow->SetMapMode(MAP_PIXEL);
vcl::Font aDefFont;
- pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, &aVirtWindow); // Font color doesn't matter here
- aVirtWindow.SetFont(aDefFont);
+ pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, pVirtWindow); // Font color doesn't matter here
+ pVirtWindow->SetFont(aDefFont);
sal_uInt16 nTest = static_cast<sal_uInt16>(
- aVirtWindow.PixelToLogic(Size(0, aVirtWindow.GetTextHeight()), MAP_TWIP).Height());
+ pVirtWindow->PixelToLogic(Size(0, pVirtWindow->GetTextHeight()), MAP_TWIP).Height());
if (nTest > nDefFontHeight)
nDefFontHeight = nTest;
diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index 1d95c3f4c529..4b47cf4525a2 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -253,8 +253,8 @@ bool ScValidationData::DoScript( const ScAddress& rPos, const OUString& rInput,
{
//TODO: different error message, if found, but not bAllowed ??
- MessageDialog aBox( pParent, ScGlobal::GetRscString(STR_VALID_MACRONOTFOUND));
- aBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aBox( pParent, ScGlobal::GetRscString(STR_VALID_MACRONOTFOUND));
+ aBox->Execute();
}
return bScriptReturnedFalse;
@@ -359,8 +359,8 @@ bool ScValidationData::DoMacro( const ScAddress& rPos, const OUString& rInput,
{
//TODO: different error message, if found, but not bAllowed ??
- MessageDialog aBox(pParent, ScGlobal::GetRscString(STR_VALID_MACRONOTFOUND));
- aBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aBox(pParent, ScGlobal::GetRscString(STR_VALID_MACRONOTFOUND));
+ aBox->Execute();
}
return bRet;
@@ -410,8 +410,8 @@ bool ScValidationData::DoError( vcl::Window* pParent, const OUString& rInput,
}
}
- MessBox aBox( pParent, WinBits(nStyle), aTitle, aMessage );
- sal_uInt16 nRet = aBox.Execute();
+ ScopedVclPtrInstance< MessBox > aBox( pParent, WinBits(nStyle), aTitle, aMessage );
+ sal_uInt16 nRet = aBox->Execute();
return ( eErrorStyle == SC_VALERR_STOP || nRet == RET_CANCEL );
}
diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx
index dce8dd7cd0ed..4d797ccda674 100644
--- a/sc/source/core/tool/editutil.cxx
+++ b/sc/source/core/tool/editutil.cxx
@@ -53,6 +53,14 @@ using namespace com::sun::star;
// STATIC DATA
// Delimiters zusaetzlich zu EditEngine-Default:
+ScEditUtil::ScEditUtil( ScDocument* pDocument, SCCOL nX, SCROW nY, SCTAB nZ,
+ const Point& rScrPosPixel,
+ OutputDevice* pDevice, double nScaleX, double nScaleY,
+ const Fraction& rX, const Fraction& rY ) :
+ pDoc(pDocument),nCol(nX),nRow(nY),nTab(nZ),
+ aScrPos(rScrPosPixel),pDev(pDevice),
+ nPPTX(nScaleX),nPPTY(nScaleY),aZoomX(rX),aZoomY(rY) {}
+
OUString ScEditUtil::ModifyDelimiters( const OUString& rOld )
{
// underscore is used in function argument names
diff --git a/sc/source/filter/inc/htmlexp.hxx b/sc/source/filter/inc/htmlexp.hxx
index 3403d4c670a6..bb00ad9aaa06 100644
--- a/sc/source/filter/inc/htmlexp.hxx
+++ b/sc/source/filter/inc/htmlexp.hxx
@@ -110,7 +110,7 @@ class ScHTMLExport : public ScExportBase
OUString aStreamPath;
OUString aFilterOptions;
OUString aCId; // Content-Id for Mail-Export
- OutputDevice* pAppWin; // for Pixel-work
+ VclPtr<OutputDevice> pAppWin; // for Pixel-work
FileNameMapPtr pFileNameMap; // for CopyLocalFileToINet
OUString aNonConvertibleChars; // collect nonconvertible characters
rtl_TextEncoding eDestEnc;
diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index 05a409c4359c..c25004ecff3c 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -662,15 +662,15 @@ void WorkbookGlobals::recalcFormulaCells()
if (rDoc.IsUserInteractionEnabled())
{
// Ask the user if full re-calculation is desired.
- QueryBox aBox(
+ ScopedVclPtrInstance<QueryBox> aBox(
rDocSh.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_XLS));
- aBox.SetCheckBoxText(ScGlobal::GetRscString(STR_ALWAYS_PERFORM_SELECTED));
+ aBox->SetCheckBoxText(ScGlobal::GetRscString(STR_ALWAYS_PERFORM_SELECTED));
- sal_Int32 nRet = aBox.Execute();
+ sal_Int32 nRet = aBox->Execute();
bHardRecalc = nRet == RET_YES;
- if (aBox.GetCheckBoxState())
+ if (aBox->GetCheckBoxState())
{
// Always perform selected action in the future.
std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx
index 973446dfc3af..c72336d30938 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -433,8 +433,8 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, double nOutputFactor, SvNu
// Factor is printer to display ratio
double nPPTX = ScGlobal::nScreenPPTX * (double) aZoom / nOutputFactor;
double nPPTY = ScGlobal::nScreenPPTY * (double) aZoom;
- VirtualDevice aVirtDev;
- sc::RowHeightContext aCxt(nPPTX, nPPTY, aZoom, aZoom, &aVirtDev);
+ ScopedVclPtrInstance< VirtualDevice > pVirtDev;
+ sc::RowHeightContext aCxt(nPPTX, nPPTY, aZoom, aZoom, pVirtDev);
aCxt.setExtraHeight(ScGlobal::nLastRowHeightExtra);
mpDoc->SetOptimalHeight(aCxt, 0, nEndRow, 0);
diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx
index a11a7309b66e..c6ca6ad40564 100644
--- a/sc/source/ui/Accessibility/AccessibleText.cxx
+++ b/sc/source/ui/Accessibility/AccessibleText.cxx
@@ -142,9 +142,9 @@ void ScViewForwarder::SetInvalid()
class ScEditObjectViewForwarder : public SvxViewForwarder
{
- vcl::Window* mpWindow;
+ VclPtr<vcl::Window> mpWindow;
// #i49561# EditView needed for access to its visible area.
- const EditView* mpEditView;
+ const EditView* mpEditView;
public:
ScEditObjectViewForwarder( vcl::Window* pWindow,
const EditView* _pEditView);
@@ -172,7 +172,7 @@ ScEditObjectViewForwarder::~ScEditObjectViewForwarder()
bool ScEditObjectViewForwarder::IsValid() const
{
- return (mpWindow != NULL);
+ return (mpWindow != nullptr);
}
Rectangle ScEditObjectViewForwarder::GetVisArea() const
@@ -545,7 +545,7 @@ Rectangle ScPreviewNoteViewForwarder::GetVisArea() const
class ScEditViewForwarder : public SvxEditViewForwarder
{
EditView* mpEditView;
- vcl::Window* mpWindow;
+ VclPtr<vcl::Window> mpWindow;
public:
ScEditViewForwarder(EditView* pEditView, vcl::Window* pWin);
virtual ~ScEditViewForwarder();
@@ -1073,7 +1073,7 @@ ScAccessibleEditLineTextData::ScAccessibleEditLineTextData(EditView* pEditView,
ScAccessibleEditLineTextData::~ScAccessibleEditLineTextData()
{
- ScTextWnd* pTxtWnd = dynamic_cast< ScTextWnd* >(mpWindow);
+ ScTextWnd* pTxtWnd = dynamic_cast< ScTextWnd* >(mpWindow.get());
if (pTxtWnd)
pTxtWnd->RemoveAccessibleTextData( *this );
@@ -1094,7 +1094,7 @@ ScAccessibleEditLineTextData::~ScAccessibleEditLineTextData()
void ScAccessibleEditLineTextData::Dispose()
{
- ScTextWnd* pTxtWnd = dynamic_cast<ScTextWnd*>(mpWindow);
+ ScTextWnd* pTxtWnd = dynamic_cast<ScTextWnd*>(mpWindow.get());
if (pTxtWnd)
pTxtWnd->RemoveAccessibleTextData( *this );
@@ -1110,7 +1110,7 @@ ScAccessibleTextData* ScAccessibleEditLineTextData::Clone() const
SvxTextForwarder* ScAccessibleEditLineTextData::GetTextForwarder()
{
- ScTextWnd* pTxtWnd = dynamic_cast<ScTextWnd*>(mpWindow);
+ ScTextWnd* pTxtWnd = dynamic_cast<ScTextWnd*>(mpWindow.get());
if (pTxtWnd)
{
@@ -1156,7 +1156,7 @@ SvxTextForwarder* ScAccessibleEditLineTextData::GetTextForwarder()
SvxEditViewForwarder* ScAccessibleEditLineTextData::GetEditViewForwarder( bool bCreate )
{
- ScTextWnd* pTxtWnd = dynamic_cast<ScTextWnd*>(mpWindow);
+ ScTextWnd* pTxtWnd = dynamic_cast<ScTextWnd*>(mpWindow.get());
if (pTxtWnd)
{
@@ -1178,7 +1178,7 @@ SvxEditViewForwarder* ScAccessibleEditLineTextData::GetEditViewForwarder( bool b
void ScAccessibleEditLineTextData::ResetEditMode()
{
- ScTextWnd* pTxtWnd = dynamic_cast<ScTextWnd*>(mpWindow);
+ ScTextWnd* pTxtWnd = dynamic_cast<ScTextWnd*>(mpWindow.get());
if (mbEditEngineCreated && mpEditEngine)
delete mpEditEngine;
@@ -1196,7 +1196,7 @@ void ScAccessibleEditLineTextData::TextChanged()
{
if (mbEditEngineCreated && mpEditEngine)
{
- ScTextWnd* pTxtWnd = dynamic_cast<ScTextWnd*>(mpWindow);
+ ScTextWnd* pTxtWnd = dynamic_cast<ScTextWnd*>(mpWindow.get());
if (pTxtWnd)
mpEditEngine->SetText(pTxtWnd->GetTextString());
@@ -1637,7 +1637,7 @@ SvxViewForwarder* ScAccessibleNoteTextData::GetViewForwarder()
class ScCsvViewForwarder : public SvxViewForwarder
{
Rectangle maBoundBox;
- vcl::Window* mpWindow;
+ VclPtr<vcl::Window> mpWindow;
public:
explicit ScCsvViewForwarder( vcl::Window* pWindow, const Rectangle& rBoundBox );
@@ -1658,7 +1658,7 @@ ScCsvViewForwarder::ScCsvViewForwarder( vcl::Window* pWindow, const Rectangle& r
bool ScCsvViewForwarder::IsValid() const
{
- return mpWindow != NULL;
+ return mpWindow != nullptr;
}
Rectangle ScCsvViewForwarder::GetVisArea() const
diff --git a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
index 89e2fa4cdc15..6a7467d16fb7 100644
--- a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
@@ -117,7 +117,18 @@ ScAnalysisOfVarianceDialog::ScAnalysisOfVarianceDialog(
}
ScAnalysisOfVarianceDialog::~ScAnalysisOfVarianceDialog()
-{}
+{
+ disposeOnce();
+}
+
+void ScAnalysisOfVarianceDialog::dispose()
+{
+ mpAlphaField.clear();
+ mpSingleFactorRadio.clear();
+ mpTwoFactorRadio.clear();
+ mpRowsPerSampleField.clear();
+ ScStatisticsInputOutputDialog::dispose();
+}
bool ScAnalysisOfVarianceDialog::Close()
{
diff --git a/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx b/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx
index 8063b4ab82d9..9acf9ed6f1d7 100644
--- a/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx
@@ -37,7 +37,15 @@ ScExponentialSmoothingDialog::ScExponentialSmoothingDialog(
}
ScExponentialSmoothingDialog::~ScExponentialSmoothingDialog()
-{}
+{
+ disposeOnce();
+}
+
+void ScExponentialSmoothingDialog::dispose()
+{
+ mpSmoothingFactor.clear();
+ ScStatisticsInputOutputDialog::dispose();
+}
bool ScExponentialSmoothingDialog::Close()
{
diff --git a/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx b/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx
index 4a43e79ea8b3..8514dfc1342b 100644
--- a/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx
@@ -37,7 +37,15 @@ ScMovingAverageDialog::ScMovingAverageDialog(
}
ScMovingAverageDialog::~ScMovingAverageDialog()
-{}
+{
+ disposeOnce();
+}
+
+void ScMovingAverageDialog::dispose()
+{
+ mpIntervalSpin.clear();
+ ScStatisticsInputOutputDialog::dispose();
+}
bool ScMovingAverageDialog::Close()
{
diff --git a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx
index ee906d410857..5583760ba2e2 100644
--- a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx
@@ -81,6 +81,31 @@ ScRandomNumberGeneratorDialog::ScRandomNumberGeneratorDialog(
GetRangeFromSelection();
}
+ScRandomNumberGeneratorDialog::~ScRandomNumberGeneratorDialog()
+{
+ disposeOnce();
+}
+
+void ScRandomNumberGeneratorDialog::dispose()
+{
+ mpInputRangeText.clear();
+ mpInputRangeEdit.clear();
+ mpInputRangeButton.clear();
+ mpDistributionCombo.clear();
+ mpParameter1Text.clear();
+ mpParameter1Value.clear();
+ mpParameter2Text.clear();
+ mpParameter2Value.clear();
+ mpSeed.clear();
+ mpEnableSeed.clear();
+ mpDecimalPlaces.clear();
+ mpEnableRounding.clear();
+ mpButtonApply.clear();
+ mpButtonOk.clear();
+ mpButtonClose.clear();
+ ScAnyRefDlg::dispose();
+}
+
void ScRandomNumberGeneratorDialog::Init()
{
mpButtonOk->SetClickHdl( LINK( this, ScRandomNumberGeneratorDialog, OkClicked ) );
@@ -114,9 +139,6 @@ void ScRandomNumberGeneratorDialog::GetRangeFromSelection()
mpInputRangeEdit->SetText( aCurrentString );
}
-ScRandomNumberGeneratorDialog::~ScRandomNumberGeneratorDialog()
-{}
-
void ScRandomNumberGeneratorDialog::SetActive()
{
if ( mbDialogLostFocus )
diff --git a/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx
index a88faafd1f64..f985adb04648 100644
--- a/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx
@@ -60,6 +60,28 @@ ScSamplingDialog::ScSamplingDialog(
GetRangeFromSelection();
}
+ScSamplingDialog::~ScSamplingDialog()
+{
+ disposeOnce();
+}
+
+void ScSamplingDialog::dispose()
+{
+ mpInputRangeLabel.clear();
+ mpInputRangeEdit.clear();
+ mpInputRangeButton.clear();
+ mpOutputRangeLabel.clear();
+ mpOutputRangeEdit.clear();
+ mpOutputRangeButton.clear();
+ mpSampleSize.clear();
+ mpPeriod.clear();
+ mpRandomMethodRadio.clear();
+ mpPeriodicMethodRadio.clear();
+ mpButtonOk.clear();
+ mpActiveEdit.clear();
+ ScAnyRefDlg::dispose();
+}
+
void ScSamplingDialog::Init()
{
mpButtonOk->SetClickHdl( LINK( this, ScSamplingDialog, OkClicked ) );
@@ -98,9 +120,6 @@ void ScSamplingDialog::GetRangeFromSelection()
mpInputRangeEdit->SetText(aCurrentString);
}
-ScSamplingDialog::~ScSamplingDialog()
-{}
-
void ScSamplingDialog::SetActive()
{
if ( mDialogLostFocus )
diff --git a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx
index cb6382142fe3..8e2fa67a455c 100644
--- a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx
@@ -87,7 +87,24 @@ ScStatisticsInputOutputDialog::ScStatisticsInputOutputDialog(
}
ScStatisticsInputOutputDialog::~ScStatisticsInputOutputDialog()
-{}
+{
+ disposeOnce();
+}
+
+void ScStatisticsInputOutputDialog::dispose()
+{
+ mpInputRangeLabel.clear();
+ mpInputRangeEdit.clear();
+ mpInputRangeButton.clear();
+ mpOutputRangeLabel.clear();
+ mpOutputRangeEdit.clear();
+ mpOutputRangeButton.clear();
+ mpGroupByColumnsRadio.clear();
+ mpGroupByRowsRadio.clear();
+ mpButtonOk.clear();
+ mpActiveEdit.clear();
+ ScAnyRefDlg::dispose();
+}
void ScStatisticsInputOutputDialog::Init()
{
diff --git a/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx b/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx
index 80da64a8bd2a..8dc5ade17d61 100644
--- a/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx
@@ -65,7 +65,27 @@ ScStatisticsTwoVariableDialog::ScStatisticsTwoVariableDialog(
}
ScStatisticsTwoVariableDialog::~ScStatisticsTwoVariableDialog()
-{}
+{
+ disposeOnce();
+}
+
+void ScStatisticsTwoVariableDialog::dispose()
+{
+ mpVariable1RangeLabel.clear();
+ mpVariable1RangeEdit.clear();
+ mpVariable1RangeButton.clear();
+ mpVariable2RangeLabel.clear();
+ mpVariable2RangeEdit.clear();
+ mpVariable2RangeButton.clear();
+ mpOutputRangeLabel.clear();
+ mpOutputRangeEdit.clear();
+ mpOutputRangeButton.clear();
+ mpButtonOk.clear();
+ mpGroupByColumnsRadio.clear();
+ mpGroupByRowsRadio.clear();
+ mpActiveEdit.clear();
+ ScAnyRefDlg::dispose();
+}
void ScStatisticsTwoVariableDialog::Init()
{
@@ -141,7 +161,7 @@ void ScStatisticsTwoVariableDialog::SetActive()
void ScStatisticsTwoVariableDialog::SetReference( const ScRange& rReferenceRange, ScDocument* pDocument )
{
- if ( mpActiveEdit != NULL )
+ if ( mpActiveEdit != nullptr )
{
if ( rReferenceRange.aStart != rReferenceRange.aEnd )
RefInputStart( mpActiveEdit );
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index b1a19832233d..caf2c4a98373 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1750,6 +1750,11 @@ void ScInputHandler::UpdateActiveView()
pTopView = NULL;
}
+void ScInputHandler::SetInputWindow( ScInputWindow* pNew )
+{
+ pInputWin = pNew;
+}
+
void ScInputHandler::StopInputWinEngine( bool bAll )
{
if (pInputWin)
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index f5dd784bc22e..95bd92d64358 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -124,7 +124,7 @@ ScInputWindowWrapper::ScInputWindowWrapper( vcl::Window* pParentP,
SfxChildWinInfo* /* pInfo */ )
: SfxChildWindow( pParentP, nId )
{
- ScInputWindow* pWin=new ScInputWindow( pParentP, pBindings );
+ VclPtr<ScInputWindow> pWin=VclPtr<ScInputWindow>::Create( pParentP, pBindings );
pWindow = pWin;
pWin->Show();
@@ -154,7 +154,7 @@ static inline bool lcl_isExperimentalMode()
// class ScInputWindow
-static ScTextWndBase* lcl_chooseRuntimeImpl( vcl::Window* pParent, SfxBindings* pBind )
+static VclPtr<ScTextWndBase> lcl_chooseRuntimeImpl( vcl::Window* pParent, SfxBindings* pBind )
{
ScTabViewShell* pViewSh = NULL;
SfxDispatcher* pDisp = pBind->GetDispatcher();
@@ -166,16 +166,16 @@ static ScTextWndBase* lcl_chooseRuntimeImpl( vcl::Window* pParent, SfxBindings*
}
if ( !lcl_isExperimentalMode() )
- return new ScTextWnd( pParent, pViewSh );
- return new ScInputBarGroup( pParent, pViewSh );
+ return VclPtr<ScTextWnd>::Create( pParent, pViewSh );
+ return VclPtr<ScInputBarGroup>::Create( pParent, pViewSh );
}
ScInputWindow::ScInputWindow( vcl::Window* pParent, SfxBindings* pBind ) :
// With WB_CLIPCHILDREN otherwise we get flickering
ToolBox ( pParent, WinBits(WB_CLIPCHILDREN) ),
- aWndPos ( this ),
- pRuntimeWindow ( lcl_chooseRuntimeImpl( this, pBind ) ),
- aTextWindow ( *pRuntimeWindow ),
+ aWndPos ( VclPtr<ScPosWnd>::Create(this) ),
+ pRuntimeWindow ( lcl_chooseRuntimeImpl( this, pBind ) ),
+ aTextWindow ( *pRuntimeWindow ),
pInputHdl ( NULL ),
aTextOk ( ScResId( SCSTR_QHELP_BTNOK ) ), // Not always new as a Resource
aTextCancel ( ScResId( SCSTR_QHELP_BTNCANCEL ) ),
@@ -202,7 +202,7 @@ ScInputWindow::ScInputWindow( vcl::Window* pParent, SfxBindings* pBind ) :
OSL_ENSURE( pViewSh, "no view shell for input window" );
// Position window, 3 buttons, input window
- InsertWindow ( 1, &aWndPos, ToolBoxItemBits::NONE, 0 );
+ InsertWindow ( 1, aWndPos.get(), ToolBoxItemBits::NONE, 0 );
InsertSeparator ( 1 );
InsertItem ( SID_INPUT_FUNCTION, IMAGE( SID_INPUT_FUNCTION ), ToolBoxItemBits::NONE, 2 );
InsertItem ( SID_INPUT_SUM, IMAGE( SID_INPUT_SUM ), ToolBoxItemBits::NONE, 3 );
@@ -210,8 +210,8 @@ ScInputWindow::ScInputWindow( vcl::Window* pParent, SfxBindings* pBind ) :
InsertSeparator ( 5 );
InsertWindow ( 7, &aTextWindow, ToolBoxItemBits::NONE, 6 );
- aWndPos .SetQuickHelpText( ScResId( SCSTR_QHELP_POSWND ) );
- aWndPos .SetHelpId ( HID_INSWIN_POS );
+ aWndPos ->SetQuickHelpText( ScResId( SCSTR_QHELP_POSWND ) );
+ aWndPos ->SetHelpId ( HID_INSWIN_POS );
aTextWindow.SetQuickHelpText( ScResId( SCSTR_QHELP_INPUTWND ) );
aTextWindow.SetHelpId ( HID_INSWIN_INPUT );
@@ -227,7 +227,7 @@ ScInputWindow::ScInputWindow( vcl::Window* pParent, SfxBindings* pBind ) :
SetHelpId( HID_SC_INPUTWIN ); // For the whole input row
- aWndPos .Show();
+ aWndPos ->Show();
aTextWindow.Show();
pInputHdl = SC_MOD()->GetInputHdl( pViewSh, false ); // use own handler even if ref-handler is set
@@ -259,6 +259,11 @@ ScInputWindow::ScInputWindow( vcl::Window* pParent, SfxBindings* pBind ) :
ScInputWindow::~ScInputWindow()
{
+ disposeOnce();
+}
+
+void ScInputWindow::dispose()
+{
bool bDown = ( ScGlobal::pSysLocale == NULL ); // after Clear?
// if any view's input handler has a pointer to this input window, reset it
@@ -282,6 +287,11 @@ ScInputWindow::~ScInputWindow()
}
SfxImageManager::GetImageManager( *SC_MOD() )->ReleaseToolBox( this );
+
+ pRuntimeWindow.disposeAndClear();
+ aWndPos.disposeAndClear();
+
+ ToolBox::dispose();
}
void ScInputWindow::SetInputHandler( ScInputHandler* pNew )
@@ -630,7 +640,7 @@ void ScInputWindow::SetFuncString( const OUString& rString, bool bDoEdit )
void ScInputWindow::SetPosString( const OUString& rStr )
{
- aWndPos.SetPos( rStr );
+ aWndPos->SetPos( rStr );
}
void ScInputWindow::SetTextString( const OUString& rString )
@@ -690,7 +700,7 @@ void ScInputWindow::SetSumAssignMode()
void ScInputWindow::SetFormulaMode( bool bSet )
{
- aWndPos.SetFormulaMode(bSet);
+ aWndPos->SetFormulaMode(bSet);
aTextWindow.SetFormulaMode(bSet);
}
@@ -755,7 +765,7 @@ void ScInputWindow::SwitchToTextWin()
void ScInputWindow::PosGrabFocus()
{
- aWndPos.GrabFocus();
+ aWndPos->GrabFocus();
}
void ScInputWindow::EnableButtons( bool bEnable )
@@ -897,54 +907,62 @@ void ScInputWindow::MouseButtonUp( const MouseEvent& rMEvt )
ScInputBarGroup::ScInputBarGroup(vcl::Window* pParent, ScTabViewShell* pViewSh)
: ScTextWndBase ( pParent, WinBits(WB_HIDE | WB_TABSTOP ) ),
- aMultiTextWnd ( this, pViewSh ),
- aButton ( this, WB_TABSTOP | WB_RECTSTYLE | WB_SMALLSTYLE ),
- aScrollBar ( this, WB_TABSTOP | WB_VERT | WB_DRAG ),
+ aMultiTextWnd ( VclPtr<ScMultiTextWnd>::Create(this, pViewSh) ),
+ aButton ( VclPtr<ImageButton>::Create(this, WB_TABSTOP | WB_RECTSTYLE | WB_SMALLSTYLE) ),
+ aScrollBar ( VclPtr<ScrollBar>::Create(this, WB_TABSTOP | WB_VERT | WB_DRAG) ),
nVertOffset ( 0 )
{
- aMultiTextWnd.Show();
- aMultiTextWnd.SetQuickHelpText( ScResId( SCSTR_QHELP_INPUTWND ) );
- aMultiTextWnd.SetHelpId( HID_INSWIN_INPUT );
+ aMultiTextWnd->Show();
+ aMultiTextWnd->SetQuickHelpText( ScResId( SCSTR_QHELP_INPUTWND ) );
+ aMultiTextWnd->SetHelpId( HID_INSWIN_INPUT );
- Size aSize( GetSettings().GetStyleSettings().GetScrollBarSize(), aMultiTextWnd.GetPixelHeightForLines(1) );
+ Size aSize( GetSettings().GetStyleSettings().GetScrollBarSize(), aMultiTextWnd->GetPixelHeightForLines(1) );
- aButton.SetClickHdl( LINK( this, ScInputBarGroup, ClickHdl ) );
- aButton.SetSizePixel( aSize );
- aButton.Enable();
- aButton.SetSymbol( SymbolType::SPIN_DOWN );
- aButton.SetQuickHelpText( ScResId( SCSTR_QHELP_EXPAND_FORMULA ) );
- aButton.Show();
+ aButton->SetClickHdl( LINK( this, ScInputBarGroup, ClickHdl ) );
+ aButton->SetSizePixel( aSize );
+ aButton->Enable();
+ aButton->SetSymbol( SymbolType::SPIN_DOWN );
+ aButton->SetQuickHelpText( ScResId( SCSTR_QHELP_EXPAND_FORMULA ) );
+ aButton->Show();
- aScrollBar.SetSizePixel( aSize );
- aScrollBar.SetScrollHdl( LINK( this, ScInputBarGroup, Impl_ScrollHdl ) );
+ aScrollBar->SetSizePixel( aSize );
+ aScrollBar->SetScrollHdl( LINK( this, ScInputBarGroup, Impl_ScrollHdl ) );
}
ScInputBarGroup::~ScInputBarGroup()
{
+ disposeOnce();
+}
+void ScInputBarGroup::dispose()
+{
+ aMultiTextWnd.disposeAndClear();
+ aButton.disposeAndClear();
+ aScrollBar.disposeAndClear();
+ ScTextWndBase::dispose();
}
void
ScInputBarGroup::InsertAccessibleTextData( ScAccessibleEditLineTextData& rTextData )
{
- aMultiTextWnd.InsertAccessibleTextData( rTextData );
+ aMultiTextWnd->InsertAccessibleTextData( rTextData );
}
void
ScInputBarGroup::RemoveAccessibleTextData( ScAccessibleEditLineTextData& rTextData )
{
- aMultiTextWnd.RemoveAccessibleTextData( rTextData );
+ aMultiTextWnd->RemoveAccessibleTextData( rTextData );
}
const OUString&
ScInputBarGroup::GetTextString() const
{
- return aMultiTextWnd.GetTextString();
+ return aMultiTextWnd->GetTextString();
}
void ScInputBarGroup::SetTextString( const OUString& rString )
{
- aMultiTextWnd.SetTextString(rString);
+ aMultiTextWnd->SetTextString(rString);
}
void ScInputBarGroup::Resize()
@@ -965,89 +983,89 @@ void ScInputBarGroup::Resize()
Size aSize = GetSizePixel();
aSize.Width() = std::max( ((long)(nWidth - nLeft - LEFT_OFFSET)), (long)0 );
- aScrollBar.SetPosPixel(Point( aSize.Width() - aButton.GetSizePixel().Width(), aButton.GetSizePixel().Height() ) );
+ aScrollBar->SetPosPixel(Point( aSize.Width() - aButton->GetSizePixel().Width(), aButton->GetSizePixel().Height() ) );
Size aTmpSize( aSize );
- aTmpSize.Width() = aTmpSize.Width() - aButton.GetSizePixel().Width() - BUTTON_OFFSET;
- aMultiTextWnd.SetSizePixel(aTmpSize);
+ aTmpSize.Width() = aTmpSize.Width() - aButton->GetSizePixel().Width() - BUTTON_OFFSET;
+ aMultiTextWnd->SetSizePixel(aTmpSize);
- aMultiTextWnd.Resize();
+ aMultiTextWnd->Resize();
- aSize.Height() = aMultiTextWnd.GetSizePixel().Height();
+ aSize.Height() = aMultiTextWnd->GetSizePixel().Height();
SetSizePixel(aSize);
- if( aMultiTextWnd.GetNumLines() > 1 )
+ if( aMultiTextWnd->GetNumLines() > 1 )
{
- aButton.SetSymbol( SymbolType::SPIN_UP );
- aButton.SetQuickHelpText( ScResId( SCSTR_QHELP_COLLAPSE_FORMULA ) );
- Size scrollSize = aButton.GetSizePixel();
- scrollSize.Height() = aMultiTextWnd.GetSizePixel().Height() - aButton.GetSizePixel().Height();
- aScrollBar.SetSizePixel( scrollSize );
+ aButton->SetSymbol( SymbolType::SPIN_UP );
+ aButton->SetQuickHelpText( ScResId( SCSTR_QHELP_COLLAPSE_FORMULA ) );
+ Size scrollSize = aButton->GetSizePixel();
+ scrollSize.Height() = aMultiTextWnd->GetSizePixel().Height() - aButton->GetSizePixel().Height();
+ aScrollBar->SetSizePixel( scrollSize );
- Size aOutSz = aMultiTextWnd.GetOutputSize();
+ Size aOutSz = aMultiTextWnd->GetOutputSize();
- aScrollBar.SetVisibleSize( aOutSz.Height() );
- aScrollBar.SetPageSize( aOutSz.Height() );
- aScrollBar.SetLineSize( aMultiTextWnd.GetTextHeight() );
- aScrollBar.SetRange( Range( 0, aMultiTextWnd.GetEditEngTxtHeight() ) );
+ aScrollBar->SetVisibleSize( aOutSz.Height() );
+ aScrollBar->SetPageSize( aOutSz.Height() );
+ aScrollBar->SetLineSize( aMultiTextWnd->GetTextHeight() );
+ aScrollBar->SetRange( Range( 0, aMultiTextWnd->GetEditEngTxtHeight() ) );
- aScrollBar.Resize();
- aScrollBar.Show();
+ aScrollBar->Resize();
+ aScrollBar->Show();
}
else
{
- aButton.SetSymbol( SymbolType::SPIN_DOWN );
- aButton.SetQuickHelpText( ScResId( SCSTR_QHELP_EXPAND_FORMULA ) );
- aScrollBar.Hide();
+ aButton->SetSymbol( SymbolType::SPIN_DOWN );
+ aButton->SetQuickHelpText( ScResId( SCSTR_QHELP_EXPAND_FORMULA ) );
+ aScrollBar->Hide();
}
- aButton.SetPosPixel(Point(aSize.Width() - aButton.GetSizePixel().Width(), 0));
+ aButton->SetPosPixel(Point(aSize.Width() - aButton->GetSizePixel().Width(), 0));
Invalidate();
}
void ScInputBarGroup::StopEditEngine( bool bAll )
{
- aMultiTextWnd.StopEditEngine( bAll );
+ aMultiTextWnd->StopEditEngine( bAll );
}
void ScInputBarGroup::StartEditEngine()
{
- aMultiTextWnd.StartEditEngine();
+ aMultiTextWnd->StartEditEngine();
}
void ScInputBarGroup::MakeDialogEditView()
{
- aMultiTextWnd.MakeDialogEditView();
+ aMultiTextWnd->MakeDialogEditView();
}
EditView* ScInputBarGroup::GetEditView()
{
- return aMultiTextWnd.GetEditView();
+ return aMultiTextWnd->GetEditView();
}
bool ScInputBarGroup::IsInputActive()
{
- return aMultiTextWnd.IsInputActive();
+ return aMultiTextWnd->IsInputActive();
}
void ScInputBarGroup::SetFormulaMode(bool bSet)
{
- aMultiTextWnd.SetFormulaMode(bSet);
+ aMultiTextWnd->SetFormulaMode(bSet);
}
void ScInputBarGroup::IncrementVerticalSize()
{
- aMultiTextWnd.SetNumLines( aMultiTextWnd.GetNumLines() + 1 );
+ aMultiTextWnd->SetNumLines( aMultiTextWnd->GetNumLines() + 1 );
TriggerToolboxLayout();
}
void ScInputBarGroup::DecrementVerticalSize()
{
- if ( aMultiTextWnd.GetNumLines() > 1 )
+ if ( aMultiTextWnd->GetNumLines() > 1 )
{
- aMultiTextWnd.SetNumLines( aMultiTextWnd.GetNumLines() - 1 );
+ aMultiTextWnd->SetNumLines( aMultiTextWnd->GetNumLines() - 1 );
TriggerToolboxLayout();
}
}
@@ -1063,19 +1081,19 @@ IMPL_LINK_NOARG(ScInputBarGroup, ClickHdl)
OSL_FAIL("The parent window pointer pParent is null");
return 1;
}
- if( aMultiTextWnd.GetNumLines() > 1 )
+ if( aMultiTextWnd->GetNumLines() > 1 )
{
- aMultiTextWnd.SetNumLines( 1 );
+ aMultiTextWnd->SetNumLines( 1 );
}
else
{
- aMultiTextWnd.SetNumLines( aMultiTextWnd.GetLastNumExpandedLines() );
+ aMultiTextWnd->SetNumLines( aMultiTextWnd->GetLastNumExpandedLines() );
}
TriggerToolboxLayout();
// Restore focus to input line(s) if necessary
if ( SC_MOD()->GetInputHdl()->IsTopMode() )
- aMultiTextWnd.GrabFocus();
+ aMultiTextWnd->GrabFocus();
return 0;
}
@@ -1104,7 +1122,7 @@ void ScInputBarGroup::TriggerToolboxLayout()
if ( xLayoutManager.is() )
{
- if ( aMultiTextWnd.GetNumLines() > 1)
+ if ( aMultiTextWnd->GetNumLines() > 1)
rParent.SetToolbarLayoutMode( TBX_LAYOUT_LOCKVERT );
else
rParent.SetToolbarLayoutMode( TBX_LAYOUT_NORMAL );
@@ -1132,13 +1150,13 @@ void ScInputBarGroup::TriggerToolboxLayout()
IMPL_LINK_NOARG(ScInputBarGroup, Impl_ScrollHdl)
{
- aMultiTextWnd.DoScroll();
+ aMultiTextWnd->DoScroll();
return 0;
}
void ScInputBarGroup::TextGrabFocus()
{
- aMultiTextWnd.TextGrabFocus();
+ aMultiTextWnd->TextGrabFocus();
}
ScMultiTextWnd::ScMultiTextWnd( ScInputBarGroup* pParen, ScTabViewShell* pViewSh )
@@ -1480,11 +1498,20 @@ ScTextWnd::ScTextWnd( vcl::Window* pParent, ScTabViewShell* pViewSh )
ScTextWnd::~ScTextWnd()
{
+ disposeOnce();
+}
+
+void ScTextWnd::dispose()
+{
while (!maAccTextDatas.empty()) {
maAccTextDatas.back()->Dispose();
}
delete pEditView;
+ pEditView = NULL;
delete pEditEngine;
+ pEditEngine = NULL;
+
+ ScTextWndBase::dispose();
}
void ScTextWnd::Paint( const Rectangle& rRect )
@@ -2068,11 +2095,17 @@ ScPosWnd::ScPosWnd( vcl::Window* pParent ) :
ScPosWnd::~ScPosWnd()
{
+ disposeOnce();
+}
+
+void ScPosWnd::dispose()
+{
EndListening( *SfxGetpApp() );
HideTip();
delete pAccel;
+ ComboBox::dispose();
}
void ScPosWnd::SetFormulaMode( bool bSet )
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index 2115fec08daf..116aada89a07 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -2094,9 +2094,9 @@ void ScModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet )
}
}
-SfxTabPage* ScModule::CreateTabPage( sal_uInt16 nId, vcl::Window* pParent, const SfxItemSet& rSet )
+VclPtr<SfxTabPage> ScModule::CreateTabPage( sal_uInt16 nId, vcl::Window* pParent, const SfxItemSet& rSet )
{
- SfxTabPage* pRet = NULL;
+ VclPtr<SfxTabPage> pRet;
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
switch(nId)
@@ -2105,7 +2105,7 @@ SfxTabPage* ScModule::CreateTabPage( sal_uInt16 nId, vcl::Window* pParent, cons
{
::CreateTabPage ScTpLayoutOptionsCreate = pFact->GetTabPageCreatorFunc( RID_SCPAGE_LAYOUT );
if ( ScTpLayoutOptionsCreate )
- pRet = (*ScTpLayoutOptionsCreate) (pParent, &rSet);
+ pRet = (*ScTpLayoutOptionsCreate) (pParent, &rSet);
}
break;
case SID_SC_TP_CONTENT:
@@ -2218,7 +2218,7 @@ IMPL_LINK( ScModule, CalcFieldValueHdl, EditFieldInfo*, pInfo )
bool ScModule::RegisterRefWindow( sal_uInt16 nSlotId, vcl::Window *pWnd )
{
- std::list<vcl::Window*> & rlRefWindow = m_mapRefWindow[nSlotId];
+ std::list<VclPtr<vcl::Window> > & rlRefWindow = m_mapRefWindow[nSlotId];
if( std::find( rlRefWindow.begin(), rlRefWindow.end(), pWnd ) == rlRefWindow.end() )
{
@@ -2231,14 +2231,14 @@ bool ScModule::RegisterRefWindow( sal_uInt16 nSlotId, vcl::Window *pWnd )
bool ScModule::UnregisterRefWindow( sal_uInt16 nSlotId, vcl::Window *pWnd )
{
- std::map<sal_uInt16, std::list<vcl::Window*> >::iterator iSlot = m_mapRefWindow.find( nSlotId );
+ auto iSlot = m_mapRefWindow.find( nSlotId );
if( iSlot == m_mapRefWindow.end() )
return false;
- std::list<vcl::Window*> & rlRefWindow = iSlot->second;
+ std::list<VclPtr<vcl::Window> > & rlRefWindow = iSlot->second;
- std::list<vcl::Window*>::iterator i = std::find( rlRefWindow.begin(), rlRefWindow.end(), pWnd );
+ auto i = std::find( rlRefWindow.begin(), rlRefWindow.end(), pWnd );
if( i == rlRefWindow.end() )
return false;
@@ -2256,16 +2256,16 @@ vcl::Window * ScModule::Find1RefWindow( sal_uInt16 nSlotId, vcl::Window *pWndAn
if (!pWndAncestor)
return NULL;
- std::map<sal_uInt16, std::list<vcl::Window*> >::iterator iSlot = m_mapRefWindow.find( nSlotId );
+ auto iSlot = m_mapRefWindow.find( nSlotId );
if( iSlot == m_mapRefWindow.end() )
return NULL;
- std::list<vcl::Window*> & rlRefWindow = iSlot->second;
+ std::list<VclPtr<vcl::Window> > & rlRefWindow = iSlot->second;
while( vcl::Window *pParent = pWndAncestor->GetParent() ) pWndAncestor = pParent;
- for( std::list<vcl::Window*>::iterator i = rlRefWindow.begin(); i!=rlRefWindow.end(); ++i )
+ for( auto i = rlRefWindow.begin(); i!=rlRefWindow.end(); ++i )
if ( pWndAncestor->IsWindowOrChild( *i, (*i)->IsSystemWindow() ) )
return *i;
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index 759b737918c7..815c10206486 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -337,13 +337,13 @@ bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor, const OUSt
Rectangle aMMRect = pDoc->GetMMRect( aBlock.aStart.Col(), aBlock.aStart.Row(),
aBlock.aEnd.Col(), aBlock.aEnd.Row(),
aBlock.aStart.Tab() );
- VirtualDevice aVirtDev;
- aVirtDev.SetOutputSizePixel( aVirtDev.LogicToPixel( aMMRect.GetSize(), MAP_100TH_MM ) );
+ ScopedVclPtrInstance< VirtualDevice > pVirtDev;
+ pVirtDev->SetOutputSizePixel( pVirtDev->LogicToPixel( aMMRect.GetSize(), MAP_100TH_MM ) );
- PaintToDev( &aVirtDev, pDoc, 1.0, aBlock, false );
+ PaintToDev( pVirtDev, pDoc, 1.0, aBlock, false );
- aVirtDev.SetMapMode( MapMode( MAP_PIXEL ) );
- Bitmap aBmp = aVirtDev.GetBitmap( Point(), aVirtDev.GetOutputSize() );
+ pVirtDev->SetMapMode( MapMode( MAP_PIXEL ) );
+ Bitmap aBmp = pVirtDev->GetBitmap( Point(), pVirtDev->GetOutputSize() );
bOK = SetBitmapEx( aBmp, rFlavor );
}
else if ( nFormat == SotClipboardFormatId::GDIMETAFILE )
@@ -358,17 +358,17 @@ bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor, const OUSt
// like SvEmbeddedTransfer::GetData:
GDIMetaFile aMtf;
- VirtualDevice aVDev;
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
MapMode aMapMode( pEmbObj->GetMapUnit() );
Rectangle aVisArea( pEmbObj->GetVisArea( ASPECT_CONTENT ) );
- aVDev.EnableOutput( false );
- aVDev.SetMapMode( aMapMode );
+ pVDev->EnableOutput( false );
+ pVDev->SetMapMode( aMapMode );
aMtf.SetPrefSize( aVisArea.GetSize() );
aMtf.SetPrefMapMode( aMapMode );
- aMtf.Record( &aVDev );
+ aMtf.Record( pVDev );
- pEmbObj->DoDraw( &aVDev, Point(), aVisArea.GetSize(), JobSetup(), ASPECT_CONTENT );
+ pEmbObj->DoDraw( pVDev, Point(), aVisArea.GetSize(), JobSetup(), ASPECT_CONTENT );
aMtf.Stop();
aMtf.WindStart();
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index a8ca5903bb2c..0e142fdfdb31 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -603,13 +603,13 @@ bool AbstractScTextImportOptionsDlg_Impl::IsDateConversionSet() const
AbstractScImportAsciiDlg * ScAbstractDialogFactory_Impl::CreateScImportAsciiDlg ( vcl::Window* pParent, const OUString& aDatName,
SvStream* pInStream, ScImportAsciiCall eCall )
{
- ScImportAsciiDlg* pDlg = new ScImportAsciiDlg( pParent, aDatName,pInStream, eCall );
+ VclPtr<ScImportAsciiDlg> pDlg = VclPtr<ScImportAsciiDlg>::Create( pParent, aDatName,pInStream, eCall );
return new AbstractScImportAsciiDlg_Impl( pDlg );
}
AbstractScTextImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScTextImportOptionsDlg(vcl::Window* pParent)
{
- ScTextImportOptionsDlg* pDlg = new ScTextImportOptionsDlg(pParent);
+ VclPtr<ScTextImportOptionsDlg> pDlg = VclPtr<ScTextImportOptionsDlg>::Create(pParent);
return new AbstractScTextImportOptionsDlg_Impl(pDlg);
}
@@ -618,7 +618,7 @@ AbstractScAutoFormatDlg * ScAbstractDialogFactory_Impl::CreateScAutoFormatDlg(vc
const ScAutoFormatData* pSelFormatData,
ScViewData *pViewData)
{
- ScAutoFormatDlg* pDlg = new ScAutoFormatDlg(pParent, pAutoFormat, pSelFormatData, pViewData);
+ VclPtr<ScAutoFormatDlg> pDlg = VclPtr<ScAutoFormatDlg>::Create(pParent, pAutoFormat, pSelFormatData, pViewData);
return new AbstractScAutoFormatDlg_Impl(pDlg);
}
@@ -626,24 +626,24 @@ AbstractScColRowLabelDlg * ScAbstractDialogFactory_Impl::CreateScColRowLabelDlg
bool bCol ,
bool bRow)
{
- ScColRowLabelDlg* pDlg = new ScColRowLabelDlg( pParent, bCol,bRow );
+ VclPtr<ScColRowLabelDlg> pDlg = VclPtr<ScColRowLabelDlg>::Create( pParent, bCol,bRow );
return new AbstractScColRowLabelDlg_Impl( pDlg );
}
AbstractScSortWarningDlg* ScAbstractDialogFactory_Impl::CreateScSortWarningDlg( vcl::Window* pParent, const OUString& rExtendText, const OUString& rCurrentText )
{
- ScSortWarningDlg* pDlg = new ScSortWarningDlg(pParent, rExtendText, rCurrentText );
+ VclPtr<ScSortWarningDlg> pDlg = VclPtr<ScSortWarningDlg>::Create(pParent, rExtendText, rCurrentText );
return new AbstractScSortWarningDlg_Impl( pDlg );
}
AbstractScCondFormatManagerDlg* ScAbstractDialogFactory_Impl::CreateScCondFormatMgrDlg(vcl::Window* pParent, ScDocument* pDoc, const ScConditionalFormatList* pFormatList,
const ScAddress& rPos, int nId )
{
- ScCondFormatManagerDlg* pDlg = NULL;
+ VclPtr<ScCondFormatManagerDlg> pDlg;
switch( nId )
{
case RID_SCDLG_COND_FORMAT_MANAGER:
- pDlg = new ScCondFormatManagerDlg( pParent, pDoc, pFormatList, rPos );
+ pDlg = VclPtr<ScCondFormatManagerDlg>::Create( pParent, pDoc, pFormatList, rPos );
break;
default:
break;
@@ -656,14 +656,14 @@ AbstractScCondFormatManagerDlg* ScAbstractDialogFactory_Impl::CreateScCondFormat
AbstractScDataPilotDatabaseDlg * ScAbstractDialogFactory_Impl::CreateScDataPilotDatabaseDlg(vcl::Window* pParent)
{
- ScDataPilotDatabaseDlg * pDlg = new ScDataPilotDatabaseDlg( pParent );
+ VclPtr<ScDataPilotDatabaseDlg> pDlg = VclPtr<ScDataPilotDatabaseDlg>::Create( pParent );
return new AbstractScDataPilotDatabaseDlg_Impl( pDlg );
}
AbstractScDataPilotSourceTypeDlg* ScAbstractDialogFactory_Impl::CreateScDataPilotSourceTypeDlg(
vcl::Window* pParent, bool bEnableExternal)
{
- ScDataPilotSourceTypeDlg* pDlg = new ScDataPilotSourceTypeDlg(pParent, bEnableExternal);
+ VclPtr<ScDataPilotSourceTypeDlg> pDlg = VclPtr<ScDataPilotSourceTypeDlg>::Create(pParent, bEnableExternal);
return new AbstractScDataPilotSourceTypeDlg_Impl(pDlg);
}
@@ -671,11 +671,11 @@ AbstractScDataPilotServiceDlg* ScAbstractDialogFactory_Impl::CreateScDataPilotSe
const com::sun::star::uno::Sequence<OUString>& rServices,
int nId )
{
- ScDataPilotServiceDlg * pDlg=NULL;
+ VclPtr<ScDataPilotServiceDlg> pDlg;
switch ( nId )
{
case RID_SCDLG_DAPISERVICE :
- pDlg = new ScDataPilotServiceDlg( pParent, rServices );
+ pDlg = VclPtr<ScDataPilotServiceDlg>::Create( pParent, rServices );
break;
default:
break;
@@ -689,21 +689,21 @@ AbstractScDataPilotServiceDlg* ScAbstractDialogFactory_Impl::CreateScDataPilotSe
AbstractScDeleteCellDlg* ScAbstractDialogFactory_Impl::CreateScDeleteCellDlg(vcl::Window* pParent,
bool bDisallowCellMove)
{
- ScDeleteCellDlg * pDlg = new ScDeleteCellDlg(pParent, bDisallowCellMove);
+ VclPtr<ScDeleteCellDlg> pDlg = VclPtr<ScDeleteCellDlg>::Create(pParent, bDisallowCellMove);
return new AbstractScDeleteCellDlg_Impl( pDlg );
}
AbstractScDataFormDlg* ScAbstractDialogFactory_Impl::CreateScDataFormDlg(vcl::Window* pParent,
ScTabViewShell* pTabViewShell)
{
- ScDataFormDlg* pDlg = new ScDataFormDlg(pParent, pTabViewShell);
+ VclPtr<ScDataFormDlg> pDlg = VclPtr<ScDataFormDlg>::Create(pParent, pTabViewShell);
return new AbstractScDataFormDlg_Impl(pDlg);
}
AbstractScDeleteContentsDlg* ScAbstractDialogFactory_Impl::CreateScDeleteContentsDlg(vcl::Window* pParent,
InsertDeleteFlags nCheckDefaults)
{
- ScDeleteContentsDlg* pDlg = new ScDeleteContentsDlg(pParent, nCheckDefaults);
+ VclPtr<ScDeleteContentsDlg> pDlg = VclPtr<ScDeleteContentsDlg>::Create(pParent, nCheckDefaults);
return new AbstractScDeleteContentsDlg_Impl( pDlg );
}
@@ -717,15 +717,15 @@ AbstractScFillSeriesDlg* ScAbstractDialogFactory_Impl::CreateScFillSeriesDlg( vc
double fMax,
sal_uInt16 nPossDir)
{
- ScFillSeriesDlg * pDlg = new ScFillSeriesDlg( pParent, rDocument,eFillDir, eFillCmd,eFillDateCmd, aStartStr,fStep,fMax,nPossDir);
- return new AbstractScFillSeriesDlg_Impl( pDlg );
+ VclPtr<ScFillSeriesDlg> pDlg = VclPtr<ScFillSeriesDlg>::Create( pParent, rDocument,eFillDir, eFillCmd,eFillDateCmd, aStartStr,fStep,fMax,nPossDir);
+ return new AbstractScFillSeriesDlg_Impl( pDlg );
}
AbstractScGroupDlg* ScAbstractDialogFactory_Impl::CreateAbstractScGroupDlg( vcl::Window* pParent,
bool bUnGroup,
bool bRows )
{
- ScGroupDlg * pDlg = new ScGroupDlg( pParent, bUnGroup, bRows);
+ VclPtr<ScGroupDlg> pDlg = VclPtr<ScGroupDlg>::Create( pParent, bUnGroup, bRows);
return new AbstractScGroupDlg_Impl( pDlg );
}
@@ -733,11 +733,11 @@ AbstractScInsertCellDlg * ScAbstractDialogFactory_Impl::CreateScInsertCellDlg( v
int nId,
bool bDisallowCellMove )
{
- ScInsertCellDlg * pDlg=NULL;
+ VclPtr<ScInsertCellDlg> pDlg;
switch ( nId )
{
case RID_SCDLG_INSCELL :
- pDlg = new ScInsertCellDlg( pParent, bDisallowCellMove);
+ pDlg = VclPtr<ScInsertCellDlg>::Create( pParent, bDisallowCellMove);
break;
default:
break;
@@ -752,27 +752,27 @@ AbstractScInsertContentsDlg * ScAbstractDialogFactory_Impl::CreateScInsertConten
InsertDeleteFlags nCheckDefaults,
const OUString* pStrTitle )
{
- ScInsertContentsDlg * pDlg = new ScInsertContentsDlg(pParent, nCheckDefaults, pStrTitle);
+ VclPtr<ScInsertContentsDlg> pDlg = VclPtr<ScInsertContentsDlg>::Create(pParent, nCheckDefaults, pStrTitle);
return new AbstractScInsertContentsDlg_Impl( pDlg );
}
AbstractScInsertTableDlg * ScAbstractDialogFactory_Impl::CreateScInsertTableDlg(vcl::Window* pParent, ScViewData& rViewData,
SCTAB nTabCount, bool bFromFile)
{
- ScInsertTableDlg* pDlg = new ScInsertTableDlg( pParent, rViewData,nTabCount, bFromFile );
+ VclPtr<ScInsertTableDlg> pDlg = VclPtr<ScInsertTableDlg>::Create( pParent, rViewData,nTabCount, bFromFile );
return new AbstractScInsertTableDlg_Impl( pDlg );
}
AbstractScSelEntryDlg * ScAbstractDialogFactory_Impl::CreateScSelEntryDlg ( vcl::Window* pParent,
const std::vector<OUString> &rEntryList )
{
- ScSelEntryDlg * pDlg = new ScSelEntryDlg( pParent, rEntryList );
+ VclPtr<ScSelEntryDlg> pDlg = VclPtr<ScSelEntryDlg>::Create( pParent, rEntryList );
return new AbstractScSelEntryDlg_Impl( pDlg );
}
AbstractScLinkedAreaDlg * ScAbstractDialogFactory_Impl::CreateScLinkedAreaDlg(vcl::Window* pParent)
{
- ScLinkedAreaDlg* pDlg = new ScLinkedAreaDlg( pParent );
+ VclPtr<ScLinkedAreaDlg> pDlg = VclPtr<ScLinkedAreaDlg>::Create( pParent );
return new AbstractScLinkedAreaDlg_Impl( pDlg );
}
@@ -787,7 +787,7 @@ AbstractScMetricInputDlg * ScAbstractDialogFactory_Impl::CreateScMetricInputDlg
long nFirst,
long nLast )
{
- ScMetricInputDlg * pDlg = new ScMetricInputDlg(pParent, sDialogName, nCurrent ,nDefault, eFUnit,
+ VclPtr<ScMetricInputDlg> pDlg = VclPtr<ScMetricInputDlg>::Create(pParent, sDialogName, nCurrent ,nDefault, eFUnit,
nDecimals, nMaximum , nMinimum , nFirst, nLast);
return new AbstractScMetricInputDlg_Impl( pDlg );
}
@@ -795,26 +795,26 @@ AbstractScMetricInputDlg * ScAbstractDialogFactory_Impl::CreateScMetricInputDlg
AbstractScMoveTableDlg * ScAbstractDialogFactory_Impl::CreateScMoveTableDlg(vcl::Window* pParent,
const OUString& rDefault)
{
- ScMoveTableDlg * pDlg = new ScMoveTableDlg( pParent, rDefault );
+ VclPtr<ScMoveTableDlg> pDlg = VclPtr<ScMoveTableDlg>::Create( pParent, rDefault );
return new AbstractScMoveTableDlg_Impl( pDlg );
}
AbstractScNameCreateDlg * ScAbstractDialogFactory_Impl::CreateScNameCreateDlg(vcl::Window * pParent, sal_uInt16 nFlags)
{
- ScNameCreateDlg * pDlg = new ScNameCreateDlg( pParent, nFlags );
+ VclPtr<ScNameCreateDlg> pDlg = VclPtr<ScNameCreateDlg>::Create( pParent, nFlags );
return new AbstractScNameCreateDlg_Impl( pDlg );
}
AbstractScNamePasteDlg * ScAbstractDialogFactory_Impl::CreateScNamePasteDlg ( vcl::Window * pParent, ScDocShell* pShell, bool bInsList )
{
- ScNamePasteDlg * pDlg = new ScNamePasteDlg( pParent, pShell, bInsList );
+ VclPtr<ScNamePasteDlg> pDlg = VclPtr<ScNamePasteDlg>::Create( pParent, pShell, bInsList );
return new AbstractScNamePasteDlg_Impl( pDlg );
}
AbstractScPivotFilterDlg * ScAbstractDialogFactory_Impl::CreateScPivotFilterDlg(vcl::Window* pParent,
const SfxItemSet& rArgSet, sal_uInt16 nSourceTab)
{
- ScPivotFilterDlg *pDlg = new ScPivotFilterDlg(pParent, rArgSet, nSourceTab);
+ VclPtr<ScPivotFilterDlg> pDlg = VclPtr<ScPivotFilterDlg>::Create(pParent, rArgSet, nSourceTab);
return new AbstractScPivotFilterDlg_Impl(pDlg);
}
@@ -823,7 +823,7 @@ AbstractScDPFunctionDlg * ScAbstractDialogFactory_Impl::CreateScDPFunctionDlg (
const ScDPLabelData& rLabelData,
const ScPivotFuncData& rFuncData )
{
- ScDPFunctionDlg * pDlg = new ScDPFunctionDlg( pParent, rLabelVec, rLabelData, rFuncData );
+ VclPtr<ScDPFunctionDlg> pDlg = VclPtr<ScDPFunctionDlg>::Create( pParent, rLabelVec, rLabelData, rFuncData );
return new AbstractScDPFunctionDlg_Impl( pDlg );
}
@@ -834,7 +834,7 @@ AbstractScDPSubtotalDlg * ScAbstractDialogFactory_Impl::CreateScDPSubtotalDlg (
const ScDPNameVec& rDataFields,
bool bEnableLayout )
{
- ScDPSubtotalDlg * pDlg = new ScDPSubtotalDlg( pParent, rDPObj, rLabelData, rFuncData, rDataFields, bEnableLayout );
+ VclPtr<ScDPSubtotalDlg> pDlg = VclPtr<ScDPSubtotalDlg>::Create( pParent, rDPObj, rLabelData, rFuncData, rDataFields, bEnableLayout );
return new AbstractScDPSubtotalDlg_Impl( pDlg );
}
@@ -842,7 +842,7 @@ AbstractScDPNumGroupDlg * ScAbstractDialogFactory_Impl::CreateScDPNumGroupDlg(
vcl::Window* pParent, int nId, const ScDPNumGroupInfo& rInfo )
{
if( nId == RID_SCDLG_DPNUMGROUP )
- return new AbstractScDPNumGroupDlg_Impl( new ScDPNumGroupDlg( pParent, rInfo ) );
+ return new AbstractScDPNumGroupDlg_Impl( VclPtr<ScDPNumGroupDlg>::Create( pParent, rInfo ) );
return 0;
}
@@ -851,7 +851,7 @@ AbstractScDPDateGroupDlg * ScAbstractDialogFactory_Impl::CreateScDPDateGroupDlg(
const ScDPNumGroupInfo& rInfo, sal_Int32 nDatePart, const Date& rNullDate )
{
if( nId == RID_SCDLG_DPDATEGROUP )
- return new AbstractScDPDateGroupDlg_Impl( new ScDPDateGroupDlg( pParent, rInfo, nDatePart, rNullDate ) );
+ return new AbstractScDPDateGroupDlg_Impl( VclPtr<ScDPDateGroupDlg>::Create( pParent, rInfo, nDatePart, rNullDate ) );
return 0;
}
@@ -859,20 +859,20 @@ AbstractScDPShowDetailDlg * ScAbstractDialogFactory_Impl::CreateScDPShowDetailDl
vcl::Window* pParent, int nId, ScDPObject& rDPObj, sal_uInt16 nOrient )
{
if( nId == RID_SCDLG_DPSHOWDETAIL )
- return new AbstractScDPShowDetailDlg_Impl( new ScDPShowDetailDlg( pParent, rDPObj, nOrient ) );
+ return new AbstractScDPShowDetailDlg_Impl( VclPtr<ScDPShowDetailDlg>::Create( pParent, rDPObj, nOrient ) );
return 0;
}
AbstractScNewScenarioDlg * ScAbstractDialogFactory_Impl::CreateScNewScenarioDlg(vcl::Window* pParent, const OUString& rName,
bool bEdit, bool bSheetProtected)
{
- ScNewScenarioDlg *pDlg = new ScNewScenarioDlg(pParent, rName, bEdit, bSheetProtected);
+ VclPtr<ScNewScenarioDlg> pDlg = VclPtr<ScNewScenarioDlg>::Create(pParent, rName, bEdit, bSheetProtected);
return new AbstractScNewScenarioDlg_Impl( pDlg );
}
AbstractScShowTabDlg * ScAbstractDialogFactory_Impl::CreateScShowTabDlg(vcl::Window* pParent)
{
- ScShowTabDlg * pDlg = new ScShowTabDlg( pParent);
+ VclPtr<ScShowTabDlg> pDlg = VclPtr<ScShowTabDlg>::Create( pParent);
return new AbstractScShowTabDlg_Impl( pDlg );
}
@@ -882,7 +882,7 @@ AbstractScStringInputDlg * ScAbstractDialogFactory_Impl::CreateScStringInputDlg
const OUString& rDefault,
const OString& sHelpId, const OString& sEditHelpId )
{
- ScStringInputDlg *pDlg = new ScStringInputDlg( pParent, rTitle, rEditTitle, rDefault, sHelpId, sEditHelpId );
+ VclPtr<ScStringInputDlg> pDlg = VclPtr<ScStringInputDlg>::Create( pParent, rTitle, rEditTitle, rDefault, sHelpId, sEditHelpId );
return new AbstractScStringInputDlg_Impl( pDlg );
}
@@ -893,7 +893,7 @@ AbstractScTabBgColorDlg * ScAbstractDialogFactory_Impl::CreateScTabBgColorDlg(
const Color& rDefaultColor,
const OString& sHelpId)
{
- ScTabBgColorDlg * pDlg = new ScTabBgColorDlg( pParent, rTitle, rTabBgColorNoColorText, rDefaultColor, sHelpId );
+ VclPtr<ScTabBgColorDlg> pDlg = VclPtr<ScTabBgColorDlg>::Create( pParent, rTitle, rTabBgColorNoColorText, rDefaultColor, sHelpId );
return new AbstractScTabBgColorDlg_Impl( pDlg );
}
@@ -905,14 +905,14 @@ AbstractScImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScImportOptions
bool bOnlyDbtoolsEncodings,
bool bImport )
{
- ScImportOptionsDlg * pDlg = new ScImportOptionsDlg( pParent, bAscii, pOptions,pStrTitle, bMultiByte,bOnlyDbtoolsEncodings, bImport );
+ VclPtr<ScImportOptionsDlg> pDlg = VclPtr<ScImportOptionsDlg>::Create( pParent, bAscii, pOptions,pStrTitle, bMultiByte,bOnlyDbtoolsEncodings, bImport );
return new AbstractScImportOptionsDlg_Impl( pDlg );
}
SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScAttrDlg(SfxViewFrame* pFrame,
vcl::Window* pParent, const SfxItemSet* pCellAttrs)
{
- SfxTabDialog* pDlg = new ScAttrDlg(pFrame, pParent, pCellAttrs);
+ VclPtr<SfxTabDialog> pDlg = VclPtr<ScAttrDlg>::Create(pFrame, pParent, pCellAttrs);
return new ScAbstractTabDialog_Impl(pDlg);
}
@@ -922,42 +922,42 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScHFEditDlg( SfxViewF
const OUString& rPageStyle,
sal_uInt16 nResId )
{
- SfxTabDialog* pDlg = NULL;
+ VclPtr<SfxTabDialog> pDlg;
switch (nResId)
{
case RID_SCDLG_HFED_HEADER:
case RID_SCDLG_HFEDIT_HEADER:
- pDlg = new ScHFEditHeaderDlg(pFrame, pParent, rCoreSet, rPageStyle);
+ pDlg = VclPtr<ScHFEditHeaderDlg>::Create(pFrame, pParent, rCoreSet, rPageStyle);
break;
case RID_SCDLG_HFED_FOOTER:
case RID_SCDLG_HFEDIT_FOOTER:
- pDlg = new ScHFEditFooterDlg(pFrame, pParent, rCoreSet, rPageStyle);
+ pDlg = VclPtr<ScHFEditFooterDlg>::Create(pFrame, pParent, rCoreSet, rPageStyle);
break;
case RID_SCDLG_HFEDIT_LEFTHEADER:
- pDlg = new ScHFEditLeftHeaderDlg(pFrame, pParent, rCoreSet, rPageStyle);
+ pDlg = VclPtr<ScHFEditLeftHeaderDlg>::Create(pFrame, pParent, rCoreSet, rPageStyle);
break;
case RID_SCDLG_HFEDIT_RIGHTHEADER:
- pDlg = new ScHFEditRightHeaderDlg(pFrame, pParent, rCoreSet, rPageStyle);
+ pDlg = VclPtr<ScHFEditRightHeaderDlg>::Create(pFrame, pParent, rCoreSet, rPageStyle);
break;
case RID_SCDLG_HFEDIT_LEFTFOOTER:
- pDlg = new ScHFEditLeftFooterDlg(pFrame, pParent, rCoreSet, rPageStyle);
+ pDlg = VclPtr<ScHFEditLeftFooterDlg>::Create(pFrame, pParent, rCoreSet, rPageStyle);
break;
case RID_SCDLG_HFEDIT_RIGHTFOOTER:
- pDlg = new ScHFEditRightFooterDlg(pFrame, pParent, rCoreSet, rPageStyle);
+ pDlg = VclPtr<ScHFEditRightFooterDlg>::Create(pFrame, pParent, rCoreSet, rPageStyle);
break;
case RID_SCDLG_HFEDIT_SHDR:
- pDlg = new ScHFEditSharedHeaderDlg(pFrame, pParent, rCoreSet, rPageStyle);
+ pDlg = VclPtr<ScHFEditSharedHeaderDlg>::Create(pFrame, pParent, rCoreSet, rPageStyle);
break;
case RID_SCDLG_HFEDIT_SFTR:
- pDlg = new ScHFEditSharedFooterDlg(pFrame, pParent, rCoreSet, rPageStyle);
+ pDlg = VclPtr<ScHFEditSharedFooterDlg>::Create(pFrame, pParent, rCoreSet, rPageStyle);
break;
case RID_SCDLG_HFEDIT_ALL:
- pDlg = new ScHFEditAllDlg(pFrame, pParent, rCoreSet, rPageStyle);
+ pDlg = VclPtr<ScHFEditAllDlg>::Create(pFrame, pParent, rCoreSet, rPageStyle);
break;
default:
case RID_SCDLG_HFEDIT:
- pDlg = new ScHFEditActiveDlg(pFrame, pParent, rCoreSet, rPageStyle);
+ pDlg = VclPtr<ScHFEditActiveDlg>::Create(pFrame, pParent, rCoreSet, rPageStyle);
break;
}
@@ -969,12 +969,12 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScStyleDlg( vcl::Wind
sal_uInt16 nRscId,
int nId)
{
- SfxTabDialog* pDlg=NULL;
+ VclPtr<SfxTabDialog> pDlg;
switch ( nId )
{
case RID_SCDLG_STYLES_PAGE :
case RID_SCDLG_STYLES_PAR :
- pDlg = new ScStyleDlg( pParent, rStyleBase, nRscId );
+ pDlg = VclPtr<ScStyleDlg>::Create( pParent, rStyleBase, nRscId );
break;
default:
break;
@@ -987,34 +987,34 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScStyleDlg( vcl::Wind
SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScSubTotalDlg(vcl::Window* pParent, const SfxItemSet* pArgSet)
{
- SfxTabDialog* pDlg = new ScSubTotalDlg( pParent, pArgSet );
+ VclPtr<SfxTabDialog> pDlg = VclPtr<ScSubTotalDlg>::Create( pParent, pArgSet );
return new ScAbstractTabDialog_Impl( pDlg );
}
SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScCharDlg(
vcl::Window* pParent, const SfxItemSet* pAttr, const SfxObjectShell* pDocShell)
{
- SfxTabDialog* pDlg = new ScCharDlg(pParent, pAttr, pDocShell);
+ VclPtr<SfxTabDialog> pDlg = VclPtr<ScCharDlg>::Create(pParent, pAttr, pDocShell);
return new ScAbstractTabDialog_Impl(pDlg);
}
SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScParagraphDlg(
vcl::Window* pParent, const SfxItemSet* pAttr)
{
- SfxTabDialog* pDlg = new ScParagraphDlg(pParent, pAttr);
+ VclPtr<SfxTabDialog> pDlg = VclPtr<ScParagraphDlg>::Create(pParent, pAttr);
return new ScAbstractTabDialog_Impl(pDlg);
}
SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScValidationDlg(vcl::Window* pParent,
const SfxItemSet* pArgSet, ScTabViewShell *pTabVwSh)
{
- SfxTabDialog* pDlg = new ScValidationDlg(pParent, pArgSet, pTabVwSh);
+ VclPtr<SfxTabDialog> pDlg = VclPtr<ScValidationDlg>::Create(pParent, pArgSet, pTabVwSh);
return new ScAbstractTabDialog_Impl(pDlg);
}
SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScSortDlg(vcl::Window* pParent, const SfxItemSet* pArgSet)
{
- SfxTabDialog* pDlg = new ScSortDlg( pParent, pArgSet );
+ VclPtr<SfxTabDialog> pDlg = VclPtr<ScSortDlg>::Create( pParent, pArgSet );
return new ScAbstractTabDialog_Impl( pDlg );
}
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index 6e493396bad5..216c3c8a8211 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -58,7 +58,7 @@ class ScTextImportOptionsDlg;
class ScCondFormatManagerDlg;
#define DECL_ABSTDLG_BASE(Class,DialogClass) \
- DialogClass* pDlg; \
+ ScopedVclPtr<DialogClass> pDlg; \
public: \
Class( DialogClass* p) \
: pDlg(p) \
@@ -66,8 +66,8 @@ public: \
virtual ~Class(); \
virtual short Execute() SAL_OVERRIDE ;
-#define DECL_ABSTDLG2_BASE(Class,DialogClass) \
- DialogClass* pDlg; \
+#define DECL_ABSTDLG2_BASE(Class,DialogClass) \
+ ScopedVclPtr<DialogClass> pDlg; \
public: \
Class( DialogClass* p) \
: pDlg(p) \
@@ -79,9 +79,8 @@ public: \
#define IMPL_ABSTDLG_BASE(Class) \
Class::~Class() \
{ \
- delete pDlg; \
} \
-short Class::Execute() \
+short Class::Execute() \
{ \
return pDlg->Execute(); \
}
@@ -89,7 +88,6 @@ short Class::Execute() \
#define IMPL_ABSTDLG2_BASE(Class) \
Class::~Class() \
{ \
- delete pDlg; \
} \
void Class::StartExecuteModal( const Link& rEndDialogHdl ) \
{ \
diff --git a/sc/source/ui/attrdlg/scuiexp.cxx b/sc/source/ui/attrdlg/scuiexp.cxx
index f3e026f24ff2..374e8ad74d15 100644
--- a/sc/source/ui/attrdlg/scuiexp.cxx
+++ b/sc/source/ui/attrdlg/scuiexp.cxx
@@ -20,6 +20,36 @@
#undef SC_DLLIMPLEMENTATION
#include "scdlgfact.hxx"
+#include "corodlg.hxx"
+#include "condformatmgr.hxx"
+#include "dapitype.hxx"
+#include "dapidata.hxx"
+#include "datafdlg.hxx"
+#include "delcodlg.hxx"
+#include "delcldlg.hxx"
+#include "dpgroupdlg.hxx"
+#include "filldlg.hxx"
+#include "groupdlg.hxx"
+#include "linkarea.hxx"
+#include "lbseldlg.hxx"
+#include "inscldlg.hxx"
+#include "instbdlg.hxx"
+#include "inscodlg.hxx"
+#include "mtrindlg.hxx"
+#include "mvtabdlg.hxx"
+#include "namecrea.hxx"
+#include "namepast.hxx"
+#include "pfiltdlg.hxx"
+#include "pvfundlg.hxx"
+#include "shtabdlg.hxx"
+#include "scendlg.hxx"
+#include "scuiasciiopt.hxx"
+#include "scuiautofmt.hxx"
+#include "scuiimoptdlg.hxx"
+#include "sortdlg.hxx"
+#include "strindlg.hxx"
+#include "tabbgcolordlg.hxx"
+#include "textimportoptions.hxx"
#include <sal/types.h>
namespace scui
diff --git a/sc/source/ui/attrdlg/tabpages.cxx b/sc/source/ui/attrdlg/tabpages.cxx
index 2202754e7192..163b8742fc4c 100644
--- a/sc/source/ui/attrdlg/tabpages.cxx
+++ b/sc/source/ui/attrdlg/tabpages.cxx
@@ -59,9 +59,23 @@ ScTabPageProtection::ScTabPageProtection(vcl::Window* pParent, const SfxItemSet&
m_pBtnHidePrint->SetClickHdl( LINK( this, ScTabPageProtection, ButtonClickHdl ) );
}
-SfxTabPage* ScTabPageProtection::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+ScTabPageProtection::~ScTabPageProtection()
{
- return ( new ScTabPageProtection( pParent, *rAttrSet ) );
+ disposeOnce();
+}
+
+void ScTabPageProtection::dispose()
+{
+ m_pBtnHideCell.clear();
+ m_pBtnProtect.clear();
+ m_pBtnHideFormula.clear();
+ m_pBtnHidePrint.clear();
+ SfxTabPage::dispose();
+}
+
+VclPtr<SfxTabPage> ScTabPageProtection::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+{
+ return VclPtr<SfxTabPage>( new ScTabPageProtection( pParent, *rAttrSet ), SAL_NO_ACQUIRE );
}
void ScTabPageProtection::Reset( const SfxItemSet* rCoreAttrs )
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index 4e73d9ef5e77..3fa8a6a8d6ab 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -97,7 +97,14 @@ ScMenuFloatingWindow::ScMenuFloatingWindow(vcl::Window* pParent, ScDocument* pDo
ScMenuFloatingWindow::~ScMenuFloatingWindow()
{
+ disposeOnce();
+}
+
+void ScMenuFloatingWindow::dispose()
+{
EndPopupMode();
+ mpParentMenu.clear();
+ PopupMenuFloatingWindow::dispose();
}
void ScMenuFloatingWindow::PopupModeEnd()
@@ -307,7 +314,7 @@ ScMenuFloatingWindow* ScMenuFloatingWindow::addSubMenuItem(const OUString& rText
MenuItemData aItem;
aItem.maText = rText;
aItem.mbEnabled = bEnabled;
- aItem.mpSubMenuWin.reset(new ScMenuFloatingWindow(this, mpDoc, GetMenuStackLevel()+1));
+ aItem.mpSubMenuWin.reset(VclPtr<ScMenuFloatingWindow>::Create(this, mpDoc, GetMenuStackLevel()+1));
aItem.mpSubMenuWin->setName(rText);
maMenuItems.push_back(aItem);
return aItem.mpSubMenuWin.get();
@@ -848,6 +855,17 @@ ScCheckListMenuWindow::Member::Member()
ScCheckListMenuWindow::CancelButton::CancelButton(ScCheckListMenuWindow* pParent) :
::CancelButton(pParent), mpParent(pParent) {}
+ScCheckListMenuWindow::CancelButton::~CancelButton()
+{
+ disposeOnce();
+}
+
+void ScCheckListMenuWindow::CancelButton::dispose()
+{
+ mpParent.clear();
+ ::CancelButton::dispose();
+}
+
void ScCheckListMenuWindow::CancelButton::Click()
{
mpParent->EndPopupMode();
@@ -856,13 +874,13 @@ void ScCheckListMenuWindow::CancelButton::Click()
ScCheckListMenuWindow::ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* pDoc) :
ScMenuFloatingWindow(pParent, pDoc),
- maEdSearch(this),
- maChecks(this, WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT ),
- maChkToggleAll(this, 0),
- maBtnSelectSingle (this, 0),
- maBtnUnselectSingle(this, 0),
- maBtnOk(this),
- maBtnCancel(this),
+ maEdSearch(new Edit (this)),
+ maChecks(VclPtr<ScCheckListBox>::Create(this, WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT) ),
+ maChkToggleAll(VclPtr<TriStateBox>::Create(this, 0)),
+ maBtnSelectSingle(VclPtr<ImageButton>::Create(this, 0)),
+ maBtnUnselectSingle(VclPtr<ImageButton>::Create(this, 0)),
+ maBtnOk(VclPtr<OKButton>::Create(this)),
+ maBtnCancel(VclPtr<CancelButton>::Create(this)),
mnCurTabStop(0),
mpExtendedData(NULL),
mpOKAction(NULL),
@@ -876,20 +894,32 @@ ScCheckListMenuWindow::ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* p
maTabStopCtrls.reserve(8);
maTabStopCtrls.push_back(this);
- maTabStopCtrls.push_back(&maEdSearch);
- maTabStopCtrls.push_back(&maChecks);
- maTabStopCtrls.push_back(&maChkToggleAll);
- maTabStopCtrls.push_back(&maBtnSelectSingle);
- maTabStopCtrls.push_back(&maBtnUnselectSingle);
- maTabStopCtrls.push_back(&maBtnOk);
- maTabStopCtrls.push_back(&maBtnCancel);
+ maTabStopCtrls.push_back(maEdSearch.get());
+ maTabStopCtrls.push_back(maChecks.get());
+ maTabStopCtrls.push_back(maChkToggleAll.get());
+ maTabStopCtrls.push_back(maBtnSelectSingle.get());
+ maTabStopCtrls.push_back(maBtnUnselectSingle.get());
+ maTabStopCtrls.push_back(maBtnOk.get());
+ maTabStopCtrls.push_back(maBtnCancel.get());
// Enable type-ahead search in the check list box.
- maChecks.SetStyle(maChecks.GetStyle() | WB_QUICK_SEARCH);
+ maChecks->SetStyle(maChecks->GetStyle() | WB_QUICK_SEARCH);
}
ScCheckListMenuWindow::~ScCheckListMenuWindow()
{
+ disposeOnce();
+}
+
+void ScCheckListMenuWindow::dispose()
+{
+ maChecks.disposeAndClear();
+ maChkToggleAll.disposeAndClear();
+ maBtnSelectSingle.disposeAndClear();
+ maBtnUnselectSingle.disposeAndClear();
+ maBtnOk.disposeAndClear();
+ maBtnCancel.disposeAndClear();
+ ScMenuFloatingWindow::dispose();
}
void ScCheckListMenuWindow::getSectionPosSize(
@@ -958,7 +988,7 @@ void ScCheckListMenuWindow::getSectionPosSize(
break;
case CHECK_TOGGLE_ALL:
{
- long h = std::min(maChkToggleAll.CalcMinimumSize().Height(), 26L);
+ long h = std::min(maChkToggleAll->CalcMinimumSize().Height(), 26L);
rPos = Point(nListBoxMargin, nSingleBtnAreaY);
rPos.X() += 5;
rPos.Y() += (nSingleItemBtnAreaHeight - h)/2;
@@ -1029,38 +1059,38 @@ void ScCheckListMenuWindow::packWindow()
SetOutputSizePixel(aSize);
getSectionPosSize(aPos, aSize, BTN_OK);
- maBtnOk.SetPosSizePixel(aPos, aSize);
- maBtnOk.SetFont(getLabelFont());
- maBtnOk.SetClickHdl( LINK(this, ScCheckListMenuWindow, ButtonHdl) );
- maBtnOk.Show();
+ maBtnOk->SetPosSizePixel(aPos, aSize);
+ maBtnOk->SetFont(getLabelFont());
+ maBtnOk->SetClickHdl( LINK(this, ScCheckListMenuWindow, ButtonHdl) );
+ maBtnOk->Show();
getSectionPosSize(aPos, aSize, BTN_CANCEL);
- maBtnCancel.SetPosSizePixel(aPos, aSize);
- maBtnCancel.SetFont(getLabelFont());
- maBtnCancel.Show();
+ maBtnCancel->SetPosSizePixel(aPos, aSize);
+ maBtnCancel->SetFont(getLabelFont());
+ maBtnCancel->Show();
getSectionPosSize(aPos, aSize, EDIT_SEARCH);
- maEdSearch.SetPosSizePixel(aPos, aSize);
- maEdSearch.SetFont(getLabelFont());
- maEdSearch.SetControlBackground(rStyle.GetFieldColor());
- maEdSearch.SetPlaceholderText(SC_STRLOAD(RID_POPUP_FILTER, STR_EDIT_SEARCH_ITEMS));
- maEdSearch.SetModifyHdl( LINK(this, ScCheckListMenuWindow, EdModifyHdl) );
- maEdSearch.Show();
+ maEdSearch->SetPosSizePixel(aPos, aSize);
+ maEdSearch->SetFont(getLabelFont());
+ maEdSearch->SetControlBackground(rStyle.GetFieldColor());
+ maEdSearch->SetPlaceholderText(SC_STRLOAD(RID_POPUP_FILTER, STR_EDIT_SEARCH_ITEMS));
+ maEdSearch->SetModifyHdl( LINK(this, ScCheckListMenuWindow, EdModifyHdl) );
+ maEdSearch->Show();
getSectionPosSize(aPos, aSize, LISTBOX_AREA_INNER);
- maChecks.SetPosSizePixel(aPos, aSize);
- maChecks.SetFont(getLabelFont());
- maChecks.SetCheckButtonHdl( LINK(this, ScCheckListMenuWindow, CheckHdl) );
- maChecks.Show();
+ maChecks->SetPosSizePixel(aPos, aSize);
+ maChecks->SetFont(getLabelFont());
+ maChecks->SetCheckButtonHdl( LINK(this, ScCheckListMenuWindow, CheckHdl) );
+ maChecks->Show();
getSectionPosSize(aPos, aSize, CHECK_TOGGLE_ALL);
- maChkToggleAll.SetPosSizePixel(aPos, aSize);
- maChkToggleAll.SetFont(getLabelFont());
- maChkToggleAll.SetText(SC_STRLOAD(RID_POPUP_FILTER, STR_BTN_TOGGLE_ALL));
- maChkToggleAll.SetTextColor(rStyle.GetMenuTextColor());
- maChkToggleAll.SetControlBackground(rStyle.GetMenuColor());
- maChkToggleAll.SetClickHdl( LINK(this, ScCheckListMenuWindow, TriStateHdl) );
- maChkToggleAll.Show();
+ maChkToggleAll->SetPosSizePixel(aPos, aSize);
+ maChkToggleAll->SetFont(getLabelFont());
+ maChkToggleAll->SetText(SC_STRLOAD(RID_POPUP_FILTER, STR_BTN_TOGGLE_ALL));
+ maChkToggleAll->SetTextColor(rStyle.GetMenuTextColor());
+ maChkToggleAll->SetControlBackground(rStyle.GetMenuColor());
+ maChkToggleAll->SetClickHdl( LINK(this, ScCheckListMenuWindow, TriStateHdl) );
+ maChkToggleAll->Show();
sal_Int32 nScaleFactor = GetDPIScaleFactor();
@@ -1073,11 +1103,11 @@ void ScCheckListMenuWindow::packWindow()
}
getSectionPosSize(aPos, aSize, BTN_SINGLE_SELECT);
- maBtnSelectSingle.SetPosSizePixel(aPos, aSize);
- maBtnSelectSingle.SetQuickHelpText(SC_STRLOAD(RID_POPUP_FILTER, STR_BTN_SELECT_CURRENT));
- maBtnSelectSingle.SetModeImage(aSingleSelect);
- maBtnSelectSingle.SetClickHdl( LINK(this, ScCheckListMenuWindow, ButtonHdl) );
- maBtnSelectSingle.Show();
+ maBtnSelectSingle->SetPosSizePixel(aPos, aSize);
+ maBtnSelectSingle->SetQuickHelpText(SC_STRLOAD(RID_POPUP_FILTER, STR_BTN_SELECT_CURRENT));
+ maBtnSelectSingle->SetModeImage(aSingleSelect);
+ maBtnSelectSingle->SetClickHdl( LINK(this, ScCheckListMenuWindow, ButtonHdl) );
+ maBtnSelectSingle->Show();
Image aSingleUnselect(ScResId(RID_IMG_UNSELECT_CURRENT));
if (nScaleFactor != 1)
@@ -1088,11 +1118,11 @@ void ScCheckListMenuWindow::packWindow()
}
getSectionPosSize(aPos, aSize, BTN_SINGLE_UNSELECT);
- maBtnUnselectSingle.SetPosSizePixel(aPos, aSize);
- maBtnUnselectSingle.SetQuickHelpText(SC_STRLOAD(RID_POPUP_FILTER, STR_BTN_UNSELECT_CURRENT));
- maBtnUnselectSingle.SetModeImage(aSingleUnselect);
- maBtnUnselectSingle.SetClickHdl( LINK(this, ScCheckListMenuWindow, ButtonHdl) );
- maBtnUnselectSingle.Show();
+ maBtnUnselectSingle->SetPosSizePixel(aPos, aSize);
+ maBtnUnselectSingle->SetQuickHelpText(SC_STRLOAD(RID_POPUP_FILTER, STR_BTN_UNSELECT_CURRENT));
+ maBtnUnselectSingle->SetModeImage(aSingleUnselect);
+ maBtnUnselectSingle->SetClickHdl( LINK(this, ScCheckListMenuWindow, ButtonHdl) );
+ maBtnUnselectSingle->Show();
}
void ScCheckListMenuWindow::setAllMemberState(bool bSet)
@@ -1103,21 +1133,21 @@ void ScCheckListMenuWindow::setAllMemberState(bool bSet)
aLabel = maMembers[i].maName;
if (aLabel.isEmpty())
aLabel = ScGlobal::GetRscString(STR_EMPTYDATA);
- maChecks.ShowCheckEntry( aLabel, maMembers[i].mpParent, true, bSet);
+ maChecks->ShowCheckEntry( aLabel, maMembers[i].mpParent, true, bSet);
}
if (!maConfig.mbAllowEmptySet)
// We need to have at least one member selected.
- maBtnOk.Enable(maChecks.GetCheckedEntryCount() != 0);
+ maBtnOk->Enable(maChecks->GetCheckedEntryCount() != 0);
}
void ScCheckListMenuWindow::selectCurrentMemberOnly(bool bSet)
{
setAllMemberState(!bSet);
- SvTreeListEntry* pEntry = maChecks.GetCurEntry();
+ SvTreeListEntry* pEntry = maChecks->GetCurEntry();
if (!pEntry)
return;
- maChecks.CheckEntry(pEntry, bSet );
+ maChecks->CheckEntry(pEntry, bSet );
}
void ScCheckListMenuWindow::cycleFocus(bool bReverse)
@@ -1146,17 +1176,17 @@ void ScCheckListMenuWindow::cycleFocus(bool bReverse)
IMPL_LINK( ScCheckListMenuWindow, ButtonHdl, Button*, pBtn )
{
- if (pBtn == &maBtnOk)
+ if (pBtn == maBtnOk.get())
close(true);
- else if (pBtn == &maBtnSelectSingle)
+ else if (pBtn == maBtnSelectSingle.get())
{
selectCurrentMemberOnly(true);
- CheckHdl(&maChecks);
+ CheckHdl(maChecks.get());
}
- else if (pBtn == &maBtnUnselectSingle)
+ else if (pBtn == maBtnUnselectSingle.get())
{
selectCurrentMemberOnly(false);
- CheckHdl(&maChecks);
+ CheckHdl(maChecks.get());
}
return 0;
}
@@ -1166,27 +1196,27 @@ IMPL_LINK_NOARG(ScCheckListMenuWindow, TriStateHdl)
switch (mePrevToggleAllState)
{
case TRISTATE_FALSE:
- maChkToggleAll.SetState(TRISTATE_TRUE);
+ maChkToggleAll->SetState(TRISTATE_TRUE);
setAllMemberState(true);
break;
case TRISTATE_TRUE:
- maChkToggleAll.SetState(TRISTATE_FALSE);
+ maChkToggleAll->SetState(TRISTATE_FALSE);
setAllMemberState(false);
break;
case TRISTATE_INDET:
default:
- maChkToggleAll.SetState(TRISTATE_TRUE);
+ maChkToggleAll->SetState(TRISTATE_TRUE);
setAllMemberState(true);
break;
}
- mePrevToggleAllState = maChkToggleAll.GetState();
+ mePrevToggleAllState = maChkToggleAll->GetState();
return 0;
}
IMPL_LINK_NOARG(ScCheckListMenuWindow, EdModifyHdl)
{
- OUString aSearchText = maEdSearch.GetText();
+ OUString aSearchText = maEdSearch->GetText();
aSearchText = aSearchText.toAsciiLowerCase();
bool bSearchTextEmpty = aSearchText.isEmpty();
size_t n = maMembers.size();
@@ -1202,7 +1232,7 @@ IMPL_LINK_NOARG(ScCheckListMenuWindow, EdModifyHdl)
if ( bSearchTextEmpty )
{
- maChecks.ShowCheckEntry( aLabelDisp, maMembers[i].mpParent, true, maMembers[i].mbVisible );
+ maChecks->ShowCheckEntry( aLabelDisp, maMembers[i].mpParent, true, maMembers[i].mbVisible );
if ( maMembers[i].mbVisible )
++nSelCount;
continue;
@@ -1210,45 +1240,45 @@ IMPL_LINK_NOARG(ScCheckListMenuWindow, EdModifyHdl)
if ( aLabelDisp.toAsciiLowerCase().indexOf( aSearchText ) != -1 )
{
- maChecks.ShowCheckEntry( aLabelDisp, maMembers[i].mpParent, true, true );
+ maChecks->ShowCheckEntry( aLabelDisp, maMembers[i].mpParent, true, true );
++nSelCount;
}
else
- maChecks.ShowCheckEntry( aLabelDisp, maMembers[i].mpParent, false, false );
+ maChecks->ShowCheckEntry( aLabelDisp, maMembers[i].mpParent, false, false );
}
if ( nSelCount == n )
- maChkToggleAll.SetState( TRISTATE_TRUE );
+ maChkToggleAll->SetState( TRISTATE_TRUE );
else if ( nSelCount == 0 )
- maChkToggleAll.SetState( TRISTATE_FALSE );
+ maChkToggleAll->SetState( TRISTATE_FALSE );
else
- maChkToggleAll.SetState( TRISTATE_INDET );
+ maChkToggleAll->SetState( TRISTATE_INDET );
return 0;
}
IMPL_LINK( ScCheckListMenuWindow, CheckHdl, SvTreeListBox*, pChecks )
{
- if (pChecks != &maChecks)
+ if (pChecks != maChecks.get())
return 0;
SvTreeListEntry* pEntry = pChecks->GetHdlEntry();
if ( pEntry )
- maChecks.CheckEntry( pEntry, ( pChecks->GetCheckButtonState( pEntry ) == SV_BUTTON_CHECKED ) );
- size_t nNumChecked = maChecks.GetCheckedEntryCount();
+ maChecks->CheckEntry( pEntry, ( pChecks->GetCheckButtonState( pEntry ) == SV_BUTTON_CHECKED ) );
+ size_t nNumChecked = maChecks->GetCheckedEntryCount();
if (nNumChecked == maMembers.size())
// all members visible
- maChkToggleAll.SetState(TRISTATE_TRUE);
+ maChkToggleAll->SetState(TRISTATE_TRUE);
else if (nNumChecked == 0)
// no members visible
- maChkToggleAll.SetState(TRISTATE_FALSE);
+ maChkToggleAll->SetState(TRISTATE_FALSE);
else
- maChkToggleAll.SetState(TRISTATE_INDET);
+ maChkToggleAll->SetState(TRISTATE_INDET);
if (!maConfig.mbAllowEmptySet)
// We need to have at least one member selected.
- maBtnOk.Enable(nNumChecked != 0);
+ maBtnOk->Enable(nNumChecked != 0);
- mePrevToggleAllState = maChkToggleAll.GetState();
+ mePrevToggleAllState = maChkToggleAll->GetState();
return 0;
}
@@ -1315,19 +1345,19 @@ Reference<XAccessible> ScCheckListMenuWindow::CreateAccessible()
fillMenuItemsToAccessible(pAccTop);
pAccTop->setAccessibleChild(
- maEdSearch.CreateAccessible(), ScAccessibleFilterTopWindow::EDIT_SEARCH_BOX);
+ maEdSearch->CreateAccessible(), ScAccessibleFilterTopWindow::EDIT_SEARCH_BOX);
pAccTop->setAccessibleChild(
- maChecks.CreateAccessible(), ScAccessibleFilterTopWindow::LISTBOX);
+ maChecks->CreateAccessible(), ScAccessibleFilterTopWindow::LISTBOX);
pAccTop->setAccessibleChild(
- maChkToggleAll.CreateAccessible(), ScAccessibleFilterTopWindow::TOGGLE_ALL);
+ maChkToggleAll->CreateAccessible(), ScAccessibleFilterTopWindow::TOGGLE_ALL);
pAccTop->setAccessibleChild(
- maBtnSelectSingle.CreateAccessible(), ScAccessibleFilterTopWindow::SINGLE_ON_BTN);
+ maBtnSelectSingle->CreateAccessible(), ScAccessibleFilterTopWindow::SINGLE_ON_BTN);
pAccTop->setAccessibleChild(
- maBtnUnselectSingle.CreateAccessible(), ScAccessibleFilterTopWindow::SINGLE_OFF_BTN);
+ maBtnUnselectSingle->CreateAccessible(), ScAccessibleFilterTopWindow::SINGLE_OFF_BTN);
pAccTop->setAccessibleChild(
- maBtnOk.CreateAccessible(), ScAccessibleFilterTopWindow::OK_BTN);
+ maBtnOk->CreateAccessible(), ScAccessibleFilterTopWindow::OK_BTN);
pAccTop->setAccessibleChild(
- maBtnCancel.CreateAccessible(), ScAccessibleFilterTopWindow::CANCEL_BTN);
+ maBtnCancel->CreateAccessible(), ScAccessibleFilterTopWindow::CANCEL_BTN);
}
return mxAccessible;
@@ -1361,12 +1391,12 @@ void ScCheckListMenuWindow::addDateMember(const OUString& rsName, double nVal, b
OUString aMonthName = aMonths[nMonth-1].FullName;
OUString aDayName = OUString::number(nDay);
- maChecks.SetUpdateMode(false);
+ maChecks->SetUpdateMode(false);
- SvTreeListEntry* pYearEntry = maChecks.FindEntry(NULL, aYearName);
+ SvTreeListEntry* pYearEntry = maChecks->FindEntry(NULL, aYearName);
if (!pYearEntry)
{
- pYearEntry = maChecks.InsertEntry(aYearName, NULL, true);
+ pYearEntry = maChecks->InsertEntry(aYearName, NULL, true);
Member aMemYear;
aMemYear.maName = aYearName;
aMemYear.maRealName = rsName;
@@ -1377,10 +1407,10 @@ void ScCheckListMenuWindow::addDateMember(const OUString& rsName, double nVal, b
maMembers.push_back(aMemYear);
}
- SvTreeListEntry* pMonthEntry = maChecks.FindEntry(pYearEntry, aMonthName);
+ SvTreeListEntry* pMonthEntry = maChecks->FindEntry(pYearEntry, aMonthName);
if (!pMonthEntry)
{
- pMonthEntry = maChecks.InsertEntry(aMonthName, pYearEntry, true);
+ pMonthEntry = maChecks->InsertEntry(aMonthName, pYearEntry, true);
Member aMemMonth;
aMemMonth.maName = aMonthName;
aMemMonth.maRealName = rsName;
@@ -1391,10 +1421,10 @@ void ScCheckListMenuWindow::addDateMember(const OUString& rsName, double nVal, b
maMembers.push_back(aMemMonth);
}
- SvTreeListEntry* pDayEntry = maChecks.FindEntry(pMonthEntry, aDayName);
+ SvTreeListEntry* pDayEntry = maChecks->FindEntry(pMonthEntry, aDayName);
if (!pDayEntry)
{
- maChecks.InsertEntry(aDayName, pMonthEntry, false);
+ maChecks->InsertEntry(aDayName, pMonthEntry, false);
Member aMemDay;
aMemDay.maName = aDayName;
aMemDay.maRealName = rsName;
@@ -1405,7 +1435,7 @@ void ScCheckListMenuWindow::addDateMember(const OUString& rsName, double nVal, b
maMembers.push_back(aMemDay);
}
- maChecks.SetUpdateMode(true);
+ maChecks->SetUpdateMode(true);
}
void ScCheckListMenuWindow::addMember(const OUString& rName, bool bVisible)
@@ -1591,20 +1621,20 @@ void ScCheckListMenuWindow::initMembers()
size_t n = maMembers.size();
size_t nVisMemCount = 0;
- maChecks.SetUpdateMode(false);
- maChecks.GetModel()->EnableInvalidate(false);
+ maChecks->SetUpdateMode(false);
+ maChecks->GetModel()->EnableInvalidate(false);
for (size_t i = 0; i < n; ++i)
{
if (maMembers[i].mbDate)
{
- maChecks.CheckEntry(maMembers[i].maName, maMembers[i].mpParent, maMembers[i].mbVisible);
+ maChecks->CheckEntry(maMembers[i].maName, maMembers[i].mpParent, maMembers[i].mbVisible);
// Expand first node of checked dates
- if (!maMembers[i].mpParent && maChecks.IsChecked(maMembers[i].maName, maMembers[i].mpParent))
+ if (!maMembers[i].mpParent && maChecks->IsChecked(maMembers[i].maName, maMembers[i].mpParent))
{
- SvTreeListEntry* pEntry = maChecks.FindEntry(NULL, maMembers[i].maName);
+ SvTreeListEntry* pEntry = maChecks->FindEntry(NULL, maMembers[i].maName);
if (pEntry)
- maChecks.Expand(pEntry);
+ maChecks->Expand(pEntry);
}
}
else
@@ -1612,11 +1642,11 @@ void ScCheckListMenuWindow::initMembers()
OUString aLabel = maMembers[i].maName;
if (aLabel.isEmpty())
aLabel = ScGlobal::GetRscString(STR_EMPTYDATA);
- SvTreeListEntry* pEntry = maChecks.InsertEntry(
+ SvTreeListEntry* pEntry = maChecks->InsertEntry(
aLabel, NULL, false, TREELIST_APPEND, NULL,
SvLBoxButtonKind_enabledCheckbox);
- maChecks.SetCheckButtonState(
+ maChecks->SetCheckButtonState(
pEntry, maMembers[i].mbVisible ? SV_BUTTON_CHECKED : SV_BUTTON_UNCHECKED);
}
@@ -1626,23 +1656,23 @@ void ScCheckListMenuWindow::initMembers()
if (nVisMemCount == n)
{
// all members visible
- maChkToggleAll.SetState(TRISTATE_TRUE);
+ maChkToggleAll->SetState(TRISTATE_TRUE);
mePrevToggleAllState = TRISTATE_TRUE;
}
else if (nVisMemCount == 0)
{
// no members visible
- maChkToggleAll.SetState(TRISTATE_FALSE);
+ maChkToggleAll->SetState(TRISTATE_FALSE);
mePrevToggleAllState = TRISTATE_FALSE;
}
else
{
- maChkToggleAll.SetState(TRISTATE_INDET);
+ maChkToggleAll->SetState(TRISTATE_INDET);
mePrevToggleAllState = TRISTATE_INDET;
}
- maChecks.GetModel()->EnableInvalidate(true);
- maChecks.SetUpdateMode(true);
+ maChecks->GetModel()->EnableInvalidate(true);
+ maChecks->SetUpdateMode(true);
}
void ScCheckListMenuWindow::setConfig(const Config& rConfig)
@@ -1652,7 +1682,7 @@ void ScCheckListMenuWindow::setConfig(const Config& rConfig)
bool ScCheckListMenuWindow::isAllSelected() const
{
- return maChkToggleAll.IsChecked();
+ return maChkToggleAll->IsChecked();
}
void ScCheckListMenuWindow::getResult(ResultType& rResult)
@@ -1666,7 +1696,7 @@ void ScCheckListMenuWindow::getResult(ResultType& rResult)
OUString aLabel = maMembers[i].maName;
if (aLabel.isEmpty())
aLabel = ScGlobal::GetRscString(STR_EMPTYDATA);
- bool bState = maChecks.IsChecked( aLabel, maMembers[i].mpParent );
+ bool bState = maChecks->IsChecked( aLabel, maMembers[i].mpParent );
OUString sName;
if ( maMembers[i].mbDate )
sName = maMembers[i].maRealName;
@@ -1683,7 +1713,7 @@ void ScCheckListMenuWindow::launch(const Rectangle& rRect)
packWindow();
if (!maConfig.mbAllowEmptySet)
// We need to have at least one member selected.
- maBtnOk.Enable(maChecks.GetCheckedEntryCount() != 0);
+ maBtnOk->Enable(maChecks->GetCheckedEntryCount() != 0);
Rectangle aRect(rRect);
if (maConfig.mbRTL)
diff --git a/sc/source/ui/cctrl/tbinsert.cxx b/sc/source/ui/cctrl/tbinsert.cxx
index 32b06bbb8d90..8b3469a6f89e 100644
--- a/sc/source/ui/cctrl/tbinsert.cxx
+++ b/sc/source/ui/cctrl/tbinsert.cxx
@@ -72,7 +72,7 @@ void ScTbxInsertCtrl::StateChanged( sal_uInt16 /* nSID */, SfxItemState eState,
}
}
-SfxPopupWindow* ScTbxInsertCtrl::CreatePopupWindow()
+VclPtr<SfxPopupWindow> ScTbxInsertCtrl::CreatePopupWindow()
{
sal_uInt16 nSlotId = GetSlotId();
if (nSlotId == SID_TBXCTL_INSERT)
diff --git a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
index 3a3bcd769c76..b93ec720901c 100644
--- a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
+++ b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
@@ -79,14 +79,14 @@ void ScZoomSliderControl::StateChanged( sal_uInt16 /*nSID*/, SfxItemState eState
}
}
-vcl::Window* ScZoomSliderControl::CreateItemWindow( vcl::Window *pParent )
+VclPtr<vcl::Window> ScZoomSliderControl::CreateItemWindow( vcl::Window *pParent )
{
// #i98000# Don't try to get a value via SfxViewFrame::Current here.
// The view's value is always notified via StateChanged later.
- ScZoomSliderWnd* pSlider = new ScZoomSliderWnd( pParent,
+ VclPtrInstance<ScZoomSliderWnd> pSlider( pParent,
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >( m_xFrame->getController(),
::com::sun::star::uno::UNO_QUERY ), m_xFrame, 100 );
- return pSlider;
+ return pSlider.get();
}
struct ScZoomSliderWnd::ScZoomSliderWnd_Impl
@@ -233,7 +233,13 @@ ScZoomSliderWnd::ScZoomSliderWnd( vcl::Window* pParent, const ::com::sun::star::
ScZoomSliderWnd::~ScZoomSliderWnd()
{
+ disposeOnce();
+}
+
+void ScZoomSliderWnd::dispose()
+{
delete mpImpl;
+ vcl::Window::dispose();
}
void ScZoomSliderWnd::MouseButtonDown( const MouseEvent& rMEvt )
@@ -395,7 +401,7 @@ void ScZoomSliderWnd::DoPaint( const Rectangle& /*rRect*/ )
Size aSliderWindowSize = GetOutputSizePixel();
Rectangle aRect( Point( 0, 0 ), aSliderWindowSize );
- VirtualDevice* pVDev = new VirtualDevice( *this );
+ ScopedVclPtrInstance< VirtualDevice > pVDev( *this );
pVDev->SetOutputSizePixel( aSliderWindowSize );
Rectangle aSlider = aRect;
@@ -478,9 +484,6 @@ void ScZoomSliderWnd::DoPaint( const Rectangle& /*rRect*/ )
pVDev->DrawImage( aImagePoint, mpImpl->maIncreaseButton );
DrawOutDev( Point(0, 0), aSliderWindowSize, Point(0, 0), aSliderWindowSize, *pVDev );
-
- delete pVDev;
-
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx
index 26c204030610..37bae8c62d19 100644
--- a/sc/source/ui/condformat/colorformat.cxx
+++ b/sc/source/ui/condformat/colorformat.cxx
@@ -123,6 +123,30 @@ ScDataBarSettingsDlg::ScDataBarSettingsDlg(vcl::Window* pWindow, const ScDataBar
PosSelectHdl(NULL);
}
+ScDataBarSettingsDlg::~ScDataBarSettingsDlg()
+{
+ disposeOnce();
+}
+
+void ScDataBarSettingsDlg::dispose()
+{
+ mpBtnOk.clear();
+ mpBtnCancel.clear();
+ mpLbPos.clear();
+ mpLbNeg.clear();
+ mpLbAxisCol.clear();
+ mpLbTypeMin.clear();
+ mpLbTypeMax.clear();
+ mpLbFillType.clear();
+ mpLbAxisPos.clear();
+ mpEdMin.clear();
+ mpEdMax.clear();
+ mpLenMin.clear();
+ mpLenMax.clear();
+ mpCbOnlyBar.clear();
+ ModalDialog::dispose();
+}
+
void ScDataBarSettingsDlg::Init()
{
SfxObjectShell* pDocSh = SfxObjectShell::Current();
@@ -264,8 +288,8 @@ IMPL_LINK_NOARG( ScDataBarSettingsDlg, OkBtnHdl )
if(bWarn)
{
//show warning message and don't close
- WarningBox aWarn(this, WB_OK, maStrWarnSameValue );
- aWarn.Execute();
+ ScopedVclPtrInstance< WarningBox > aWarn(this, WB_OK, maStrWarnSameValue );
+ aWarn->Execute();
}
else
{
diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx
index ad260e40fe80..59d343195294 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -37,7 +37,7 @@
ScCondFormatList::ScCondFormatList(vcl::Window* pParent, WinBits nStyle)
: Control(pParent, nStyle | WB_DIALOGCONTROL)
, mbHasScrollBar(false)
- , mpScrollBar(new ScrollBar(this, WB_VERT ))
+ , mpScrollBar(VclPtr<ScrollBar>::Create(this, WB_VERT ))
, mpDoc(NULL)
, mpDialogParent(NULL)
{
@@ -47,6 +47,18 @@ ScCondFormatList::ScCondFormatList(vcl::Window* pParent, WinBits nStyle)
SetBackground(GetControlBackground());
}
+ScCondFormatList::~ScCondFormatList()
+{
+ disposeOnce();
+}
+
+void ScCondFormatList::dispose()
+{
+ mpDialogParent.clear();
+ mpScrollBar.disposeAndClear();
+ Control::dispose();
+}
+
void ScCondFormatList::init(ScDocument* pDoc, ScCondFormatDlg* pDialogParent,
const ScConditionalFormat* pFormat, const ScRangeList& rRanges,
const ScAddress& rPos, condformat::dialog::ScCondFormatDialogType eType)
@@ -68,9 +80,9 @@ void ScCondFormatList::init(ScDocument* pDoc, ScCondFormatDlg* pDialogParent,
{
const ScCondFormatEntry* pConditionEntry = static_cast<const ScCondFormatEntry*>( pEntry );
if(pConditionEntry->GetOperation() != SC_COND_DIRECT)
- maEntries.push_back(new ScConditionFrmtEntry( this, mpDoc, pDialogParent, maPos, pConditionEntry ) );
+ maEntries.push_back(VclPtr<ScConditionFrmtEntry>::Create( this, mpDoc, pDialogParent, maPos, pConditionEntry ) );
else
- maEntries.push_back(new ScFormulaFrmtEntry( this, mpDoc, pDialogParent, maPos, pConditionEntry ) );
+ maEntries.push_back(VclPtr<ScFormulaFrmtEntry>::Create( this, mpDoc, pDialogParent, maPos, pConditionEntry ) );
}
break;
@@ -78,43 +90,43 @@ void ScCondFormatList::init(ScDocument* pDoc, ScCondFormatDlg* pDialogParent,
{
const ScColorScaleFormat* pColorScale = static_cast<const ScColorScaleFormat*>( pEntry );
if( pColorScale->size() == 2 )
- maEntries.push_back(new ScColorScale2FrmtEntry( this, mpDoc, maPos, pColorScale ) );
+ maEntries.push_back(VclPtr<ScColorScale2FrmtEntry>::Create( this, mpDoc, maPos, pColorScale ) );
else
- maEntries.push_back(new ScColorScale3FrmtEntry( this, mpDoc, maPos, pColorScale ) );
+ maEntries.push_back(VclPtr<ScColorScale3FrmtEntry>::Create( this, mpDoc, maPos, pColorScale ) );
}
break;
case condformat::DATABAR:
- maEntries.push_back(new ScDataBarFrmtEntry( this, mpDoc, maPos, static_cast<const ScDataBarFormat*>( pEntry ) ) );
+ maEntries.push_back(VclPtr<ScDataBarFrmtEntry>::Create( this, mpDoc, maPos, static_cast<const ScDataBarFormat*>( pEntry ) ) );
break;
case condformat::ICONSET:
- maEntries.push_back(new ScIconSetFrmtEntry( this, mpDoc, maPos, static_cast<const ScIconSetFormat*>( pEntry ) ) );
+ maEntries.push_back(VclPtr<ScIconSetFrmtEntry>::Create( this, mpDoc, maPos, static_cast<const ScIconSetFormat*>( pEntry ) ) );
break;
case condformat::DATE:
- maEntries.push_back(new ScDateFrmtEntry( this, mpDoc, static_cast<const ScCondDateFormatEntry*>( pEntry ) ) );
+ maEntries.push_back(VclPtr<ScDateFrmtEntry>::Create( this, mpDoc, static_cast<const ScCondDateFormatEntry*>( pEntry ) ) );
break;
}
}
if(nCount)
- EntrySelectHdl(&maEntries[0]);
+ EntrySelectHdl(maEntries[0].get());
}
else
{
switch(eType)
{
case condformat::dialog::CONDITION:
- maEntries.push_back(new ScConditionFrmtEntry( this, mpDoc, pDialogParent, maPos ));
+ maEntries.push_back(VclPtr<ScConditionFrmtEntry>::Create( this, mpDoc, pDialogParent, maPos ));
break;
case condformat::dialog::COLORSCALE:
- maEntries.push_back(new ScColorScale3FrmtEntry( this, mpDoc, maPos ));
+ maEntries.push_back(VclPtr<ScColorScale3FrmtEntry>::Create( this, mpDoc, maPos ));
break;
case condformat::dialog::DATABAR:
- maEntries.push_back(new ScDataBarFrmtEntry( this, mpDoc, maPos ));
+ maEntries.push_back(VclPtr<ScDataBarFrmtEntry>::Create( this, mpDoc, maPos ));
break;
case condformat::dialog::ICONSET:
- maEntries.push_back(new ScIconSetFrmtEntry( this, mpDoc, maPos ));
+ maEntries.push_back(VclPtr<ScIconSetFrmtEntry>::Create( this, mpDoc, maPos ));
break;
case condformat::dialog::DATE:
- maEntries.push_back(new ScDateFrmtEntry( this, mpDoc ));
+ maEntries.push_back(VclPtr<ScDateFrmtEntry>::Create( this, mpDoc ));
break;
case condformat::dialog::NONE:
break;
@@ -122,7 +134,7 @@ void ScCondFormatList::init(ScDocument* pDoc, ScCondFormatDlg* pDialogParent,
}
RecalcAll();
if (!maEntries.empty())
- maEntries.begin()->SetActive();
+ (*maEntries.begin())->SetActive();
RecalcAll();
}
@@ -158,7 +170,7 @@ ScConditionalFormat* ScCondFormatList::GetConditionalFormat() const
ScConditionalFormat* pFormat = new ScConditionalFormat(0, mpDoc);
for(EntryContainer::const_iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr)
{
- ScFormatEntry* pEntry = itr->GetEntry();
+ ScFormatEntry* pEntry = (*itr)->GetEntry();
if(pEntry)
pFormat->AddEntry(pEntry);
}
@@ -174,8 +186,8 @@ void ScCondFormatList::RecalcAll()
sal_Int32 nIndex = 1;
for(EntryContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr)
{
- nTotalHeight += itr->GetSizePixel().Height();
- itr->SetIndex( nIndex );
+ nTotalHeight += (*itr)->GetSizePixel().Height();
+ (*itr)->SetIndex( nIndex );
++nIndex;
}
@@ -199,15 +211,15 @@ void ScCondFormatList::RecalcAll()
Point aPoint(0,-1*mpScrollBar->GetThumbPos());
for(EntryContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr)
{
- itr->SetPosPixel(aPoint);
- Size aSize = itr->GetSizePixel();
+ (*itr)->SetPosPixel(aPoint);
+ Size aSize = (*itr)->GetSizePixel();
if(mbHasScrollBar)
aSize.Width() = aCtrlSize.Width() - nSrcBarSize;
else
aSize.Width() = aCtrlSize.Width();
- itr->SetSizePixel(aSize);
+ (*itr)->SetSizePixel(aSize);
- aPoint.Y() += itr->GetSizePixel().Height();
+ aPoint.Y() += (*itr)->GetSizePixel().Height();
}
}
@@ -225,7 +237,7 @@ IMPL_LINK(ScCondFormatList, ColFormatTypeHdl, ListBox*, pBox)
EntryContainer::iterator itr = maEntries.begin();
for(; itr != maEntries.end(); ++itr)
{
- if(itr->IsSelected())
+ if((*itr)->IsSelected())
break;
}
if(itr == maEntries.end())
@@ -235,34 +247,34 @@ IMPL_LINK(ScCondFormatList, ColFormatTypeHdl, ListBox*, pBox)
switch(nPos)
{
case 0:
- if(itr->GetType() == condformat::entry::COLORSCALE2)
+ if((*itr)->GetType() == condformat::entry::COLORSCALE2)
return 0;
- maEntries.replace( itr, new ScColorScale2FrmtEntry( this, mpDoc, maPos ) );
+ *itr = VclPtr<ScColorScale2FrmtEntry>::Create( this, mpDoc, maPos );
break;
case 1:
- if(itr->GetType() == condformat::entry::COLORSCALE3)
+ if((*itr)->GetType() == condformat::entry::COLORSCALE3)
return 0;
- maEntries.replace( itr, new ScColorScale3FrmtEntry( this, mpDoc, maPos ) );
+ *itr = VclPtr<ScColorScale3FrmtEntry>::Create( this, mpDoc, maPos );
break;
case 2:
- if(itr->GetType() == condformat::entry::DATABAR)
+ if((*itr)->GetType() == condformat::entry::DATABAR)
return 0;
- maEntries.replace( itr, new ScDataBarFrmtEntry( this, mpDoc, maPos ) );
+ *itr = VclPtr<ScDataBarFrmtEntry>::Create( this, mpDoc, maPos );
break;
case 3:
- if(itr->GetType() == condformat::entry::ICONSET)
+ if((*itr)->GetType() == condformat::entry::ICONSET)
return 0;
- maEntries.replace( itr, new ScIconSetFrmtEntry( this, mpDoc, maPos ) );
+ *itr = VclPtr<ScIconSetFrmtEntry>::Create( this, mpDoc, maPos );
break;
default:
break;
}
mpDialogParent->InvalidateRefData();
- itr->SetActive();
+ (*itr)->SetActive();
RecalcAll();
return 0;
}
@@ -282,7 +294,7 @@ IMPL_LINK(ScCondFormatList, AfterTypeListHdl, ListBox*, pBox)
EntryContainer::iterator itr = maEntries.begin();
for(; itr != maEntries.end(); ++itr)
{
- if(itr->IsSelected())
+ if((*itr)->IsSelected())
break;
}
if(itr == maEntries.end())
@@ -292,7 +304,7 @@ IMPL_LINK(ScCondFormatList, AfterTypeListHdl, ListBox*, pBox)
switch(nPos)
{
case 0:
- switch(itr->GetType())
+ switch((*itr)->GetType())
{
case condformat::entry::FORMULA:
case condformat::entry::CONDITION:
@@ -304,33 +316,33 @@ IMPL_LINK(ScCondFormatList, AfterTypeListHdl, ListBox*, pBox)
case condformat::entry::ICONSET:
return 0;
}
- maEntries.replace( itr, new ScColorScale3FrmtEntry(this, mpDoc, maPos));
+ *itr = VclPtr<ScColorScale3FrmtEntry>::Create(this, mpDoc, maPos);
mpDialogParent->InvalidateRefData();
- itr->SetActive();
+ (*itr)->SetActive();
break;
case 1:
- if(itr->GetType() == condformat::entry::CONDITION)
+ if((*itr)->GetType() == condformat::entry::CONDITION)
return 0;
- maEntries.replace( itr, new ScConditionFrmtEntry(this, mpDoc, mpDialogParent, maPos));
+ *itr = VclPtr<ScConditionFrmtEntry>::Create(this, mpDoc, mpDialogParent, maPos);
mpDialogParent->InvalidateRefData();
- itr->SetActive();
+ (*itr)->SetActive();
break;
case 2:
- if(itr->GetType() == condformat::entry::FORMULA)
+ if((*itr)->GetType() == condformat::entry::FORMULA)
return 0;
- maEntries.replace( itr, new ScFormulaFrmtEntry(this, mpDoc, mpDialogParent, maPos));
+ *itr = VclPtr<ScFormulaFrmtEntry>::Create(this, mpDoc, mpDialogParent, maPos);
mpDialogParent->InvalidateRefData();
- itr->SetActive();
+ (*itr)->SetActive();
break;
case 3:
- if(itr->GetType() == condformat::entry::DATE)
+ if((*itr)->GetType() == condformat::entry::DATE)
return 0;
- maEntries.replace( itr, new ScDateFrmtEntry( this, mpDoc ));
+ *itr = VclPtr<ScDateFrmtEntry>::Create( this, mpDoc );
mpDialogParent->InvalidateRefData();
- itr->SetActive();
+ (*itr)->SetActive();
break;
}
@@ -340,11 +352,11 @@ IMPL_LINK(ScCondFormatList, AfterTypeListHdl, ListBox*, pBox)
IMPL_LINK_NOARG( ScCondFormatList, AddBtnHdl )
{
- ScCondFrmtEntry* pNewEntry = new ScConditionFrmtEntry(this, mpDoc, mpDialogParent, maPos);
+ VclPtr<ScCondFrmtEntry> pNewEntry = VclPtr<ScConditionFrmtEntry>::Create(this, mpDoc, mpDialogParent, maPos);
maEntries.push_back( pNewEntry );
for(EntryContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr)
{
- itr->SetInactive();
+ (*itr)->SetInactive();
}
mpDialogParent->InvalidateRefData();
pNewEntry->SetActive();
@@ -356,7 +368,7 @@ IMPL_LINK_NOARG( ScCondFormatList, RemoveBtnHdl )
{
for(EntryContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr)
{
- if(itr->IsSelected())
+ if((*itr)->IsSelected())
{
maEntries.erase(itr);
break;
@@ -377,7 +389,7 @@ IMPL_LINK( ScCondFormatList, EntrySelectHdl, ScCondFrmtEntry*, pEntry )
bool bReGrabFocus = HasChildPathFocus();
for(EntryContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr)
{
- itr->SetInactive();
+ (*itr)->SetInactive();
}
mpDialogParent->InvalidateRefData();
pEntry->SetActive();
@@ -436,7 +448,20 @@ ScCondFormatDlg::ScCondFormatDlg(vcl::Window* pParent, ScDocument* pDoc,
ScCondFormatDlg::~ScCondFormatDlg()
{
+ disposeOnce();
+}
+
+void ScCondFormatDlg::dispose()
+{
SC_MOD()->PopAnyRefDlg();
+ mpBtnAdd.clear();
+ mpBtnRemove.clear();
+ mpFtRange.clear();
+ mpEdRange.clear();
+ mpRbRange.clear();
+ mpCondFormList.clear();
+ mpLastEdit.clear();
+ ScAnyRefModalDlg::dispose();
}
void ScCondFormatDlg::SetActive()
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx
index 4a8160b3ffe8..aa37bdfe0bc9 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -38,11 +38,11 @@
ScCondFrmtEntry::ScCondFrmtEntry(vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos):
Control(pParent, ScResId( RID_COND_ENTRY ) ),
mbActive(false),
- maFtCondNr( this, ScResId( FT_COND_NR ) ),
- maFtCondition( this, ScResId( FT_CONDITION ) ),
+ maFtCondNr( VclPtr<FixedText>::Create( this, ScResId( FT_COND_NR ) ) ),
+ maFtCondition( VclPtr<FixedText>::Create( this, ScResId( FT_CONDITION ) ) ),
mnIndex(0),
maStrCondition(ScResId( STR_CONDITION ).toString()),
- maLbType( this, ScResId( LB_TYPE ) ),
+ maLbType( VclPtr<ListBox>::Create( this, ScResId( LB_TYPE ) ) ),
mpDoc(pDoc),
maPos(rPos)
{
@@ -51,18 +51,27 @@ ScCondFrmtEntry::ScCondFrmtEntry(vcl::Window* pParent, ScDocument* pDoc, const S
SetControlBackground(aBack);
SetBackground(GetControlBackground());
- maFtCondNr.SetControlBackground(aBack);
- maFtCondNr.SetBackground(maFtCondNr.GetControlBackground());
+ maFtCondNr->SetControlBackground(aBack);
+ maFtCondNr->SetBackground(maFtCondNr->GetControlBackground());
- maFtCondition.SetControlBackground(aBack);
- maFtCondition.SetBackground(maFtCondition.GetControlBackground());
+ maFtCondition->SetControlBackground(aBack);
+ maFtCondition->SetBackground(maFtCondition->GetControlBackground());
- maLbType.SetSelectHdl( LINK( pParent, ScCondFormatList, TypeListHdl ) );
+ maLbType->SetSelectHdl( LINK( pParent, ScCondFormatList, TypeListHdl ) );
maClickHdl = LINK( pParent, ScCondFormatList, EntrySelectHdl );
}
ScCondFrmtEntry::~ScCondFrmtEntry()
{
+ disposeOnce();
+}
+
+void ScCondFrmtEntry::dispose()
+{
+ maFtCondNr.disposeAndClear();
+ maFtCondition.disposeAndClear();
+ maLbType.disposeAndClear();
+ Control::dispose();
}
bool ScCondFrmtEntry::Notify( NotifyEvent& rNEvt )
@@ -79,7 +88,7 @@ void ScCondFrmtEntry::SetIndex(sal_Int32 nIndex)
mnIndex = nIndex;
OUStringBuffer aBuffer(maStrCondition);
aBuffer.append(OUString::number(nIndex));
- maFtCondNr.SetText(aBuffer.makeStringAndClear());
+ maFtCondNr->SetText(aBuffer.makeStringAndClear());
}
void ScCondFrmtEntry::SetHeight()
@@ -109,9 +118,9 @@ void ScCondFrmtEntry::SetHeight()
void ScCondFrmtEntry::Select()
{
- maFtCondition.SetText(OUString());
- maFtCondition.Hide();
- maLbType.Show();
+ maFtCondition->SetText(OUString());
+ maFtCondition->Hide();
+ maLbType->Show();
mbActive = true;
SetHeight();
}
@@ -119,9 +128,9 @@ void ScCondFrmtEntry::Select()
void ScCondFrmtEntry::Deselect()
{
OUString maCondText = GetExpressionString();
- maFtCondition.SetText(maCondText);
- maFtCondition.Show();
- maLbType.Hide();
+ maFtCondition->SetText(maCondText);
+ maFtCondition->Show();
+ maLbType->Hide();
mbActive = false;
SetHeight();
}
@@ -179,18 +188,18 @@ const ScConditionMode ScConditionFrmtEntry::mpEntryToCond[ScConditionFrmtEntry::
ScConditionFrmtEntry::ScConditionFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, ScCondFormatDlg* pDialogParent,
const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry ):
ScCondFrmtEntry( pParent, pDoc, rPos ),
- maLbCondType( this, ScResId( LB_CELLIS_TYPE ) ),
- maEdVal1( this, NULL, NULL, ScResId( ED_VAL1 ) ),
- maEdVal2( this, NULL, NULL, ScResId( ED_VAL2 ) ),
- maFtVal( this, ScResId( FT_VAL ) ),
- maFtStyle( this, ScResId( FT_STYLE ) ),
- maLbStyle( this, ScResId( LB_STYLE ) ),
- maWdPreview( this, ScResId( WD_PREVIEW ) ),
+ maLbCondType( VclPtr<ListBox>::Create( this, ScResId( LB_CELLIS_TYPE ) ) ),
+ maEdVal1( VclPtr<formula::RefEdit>::Create( this, nullptr, nullptr, ScResId( ED_VAL1 ) ) ),
+ maEdVal2( VclPtr<formula::RefEdit>::Create( this, nullptr, nullptr, ScResId( ED_VAL2 ) ) ),
+ maFtVal( VclPtr<FixedText>::Create( this, ScResId( FT_VAL ) ) ),
+ maFtStyle( VclPtr<FixedText>::Create( this, ScResId( FT_STYLE ) ) ),
+ maLbStyle( VclPtr<ListBox>::Create( this, ScResId( LB_STYLE ) ) ),
+ maWdPreview( VclPtr<SvxFontPrevWindow>::Create( this, ScResId( WD_PREVIEW ) ) ),
mbIsInStyleCreate(false)
{
FreeResource();
- maLbType.SelectEntryPos(1);
+ maLbType->SelectEntryPos(1);
Init(pDialogParent);
@@ -199,76 +208,93 @@ ScConditionFrmtEntry::ScConditionFrmtEntry( vcl::Window* pParent, ScDocument* pD
if(pFormatEntry)
{
OUString aStyleName = pFormatEntry->GetStyle();
- maLbStyle.SelectEntry(aStyleName);
+ maLbStyle->SelectEntry(aStyleName);
StyleSelectHdl(NULL);
ScConditionMode eMode = pFormatEntry->GetOperation();
- maLbCondType.SelectEntryPos(ConditionModeToEntryPos(eMode));
+ maLbCondType->SelectEntryPos(ConditionModeToEntryPos(eMode));
switch(GetNumberEditFields(eMode))
{
case 0:
- maEdVal1.Hide();
- maEdVal2.Hide();
+ maEdVal1->Hide();
+ maEdVal2->Hide();
break;
case 1:
- maEdVal1.Show();
- maEdVal1.SetText(pFormatEntry->GetExpression(maPos, 0));
- maEdVal2.Hide();
- OnEdChanged(&maEdVal1);
+ maEdVal1->Show();
+ maEdVal1->SetText(pFormatEntry->GetExpression(maPos, 0));
+ maEdVal2->Hide();
+ OnEdChanged(maEdVal1);
break;
case 2:
- maEdVal1.Show();
- maEdVal1.SetText(pFormatEntry->GetExpression(maPos, 0));
- OnEdChanged(&maEdVal1);
- maEdVal2.Show();
- maEdVal2.SetText(pFormatEntry->GetExpression(maPos, 1));
- OnEdChanged(&maEdVal2);
+ maEdVal1->Show();
+ maEdVal1->SetText(pFormatEntry->GetExpression(maPos, 0));
+ OnEdChanged(maEdVal1);
+ maEdVal2->Show();
+ maEdVal2->SetText(pFormatEntry->GetExpression(maPos, 1));
+ OnEdChanged(maEdVal2);
break;
}
}
else
{
- maLbCondType.SelectEntryPos(0);
- maEdVal2.Hide();
- maLbStyle.SelectEntryPos(1);
+ maLbCondType->SelectEntryPos(0);
+ maEdVal2->Hide();
+ maLbStyle->SelectEntryPos(1);
}
}
+ScConditionFrmtEntry::~ScConditionFrmtEntry()
+{
+ disposeOnce();
+}
+
+void ScConditionFrmtEntry::dispose()
+{
+ maLbCondType.disposeAndClear();
+ maEdVal1.disposeAndClear();
+ maEdVal2.disposeAndClear();
+ maFtVal.disposeAndClear();
+ maFtStyle.disposeAndClear();
+ maLbStyle.disposeAndClear();
+ maWdPreview.disposeAndClear();
+ ScCondFrmtEntry::dispose();
+}
+
void ScConditionFrmtEntry::Init(ScCondFormatDlg* pDialogParent)
{
- maEdVal1.SetGetFocusHdl( LINK( pDialogParent, ScCondFormatDlg, RangeGetFocusHdl ) );
- maEdVal2.SetGetFocusHdl( LINK( pDialogParent, ScCondFormatDlg, RangeGetFocusHdl ) );
- maEdVal1.SetLoseFocusHdl( LINK( pDialogParent, ScCondFormatDlg, RangeLoseFocusHdl ) );
- maEdVal2.SetLoseFocusHdl( LINK( pDialogParent, ScCondFormatDlg, RangeLoseFocusHdl ) );
+ maEdVal1->SetGetFocusHdl( LINK( pDialogParent, ScCondFormatDlg, RangeGetFocusHdl ) );
+ maEdVal2->SetGetFocusHdl( LINK( pDialogParent, ScCondFormatDlg, RangeGetFocusHdl ) );
+ maEdVal1->SetLoseFocusHdl( LINK( pDialogParent, ScCondFormatDlg, RangeLoseFocusHdl ) );
+ maEdVal2->SetLoseFocusHdl( LINK( pDialogParent, ScCondFormatDlg, RangeLoseFocusHdl ) );
- maEdVal1.SetStyle( maEdVal1.GetStyle() | WB_FORCECTRLBACKGROUND );
- maEdVal2.SetStyle( maEdVal2.GetStyle() | WB_FORCECTRLBACKGROUND );
+ maEdVal1->SetStyle( maEdVal1->GetStyle() | WB_FORCECTRLBACKGROUND );
+ maEdVal2->SetStyle( maEdVal2->GetStyle() | WB_FORCECTRLBACKGROUND );
- maEdVal1.SetModifyHdl( LINK( this, ScConditionFrmtEntry, OnEdChanged ) );
- maEdVal2.SetModifyHdl( LINK( this, ScConditionFrmtEntry, OnEdChanged ) );
+ maEdVal1->SetModifyHdl( LINK( this, ScConditionFrmtEntry, OnEdChanged ) );
+ maEdVal2->SetModifyHdl( LINK( this, ScConditionFrmtEntry, OnEdChanged ) );
- FillStyleListBox( mpDoc, maLbStyle );
- maLbStyle.SetSelectHdl( LINK( this, ScConditionFrmtEntry, StyleSelectHdl ) );
+ FillStyleListBox( mpDoc, *maLbStyle.get() );
+ maLbStyle->SetSelectHdl( LINK( this, ScConditionFrmtEntry, StyleSelectHdl ) );
- maLbCondType.SetSelectHdl( LINK( this, ScConditionFrmtEntry, ConditionTypeSelectHdl ) );
+ maLbCondType->SetSelectHdl( LINK( this, ScConditionFrmtEntry, ConditionTypeSelectHdl ) );
}
ScFormatEntry* ScConditionFrmtEntry::createConditionEntry() const
{
- ScConditionMode eMode = EntryPosToConditionMode(maLbCondType.GetSelectEntryPos());
- OUString aExpr1 = maEdVal1.GetText();
+ ScConditionMode eMode = EntryPosToConditionMode(maLbCondType->GetSelectEntryPos());
+ OUString aExpr1 = maEdVal1->GetText();
OUString aExpr2;
if (GetNumberEditFields(eMode) == 2)
{
- aExpr2 = maEdVal2.GetText();
+ aExpr2 = maEdVal2->GetText();
if (aExpr2.isEmpty())
{
return NULL;
}
}
- ScFormatEntry* pEntry = new ScCondFormatEntry(eMode, aExpr1, aExpr2, mpDoc, maPos, maLbStyle.GetSelectEntry());
+ ScFormatEntry* pEntry = new ScCondFormatEntry(eMode, aExpr1, aExpr2, mpDoc, maPos, maLbStyle->GetSelectEntry());
return pEntry;
}
@@ -278,7 +304,7 @@ IMPL_LINK(ScConditionFrmtEntry, OnEdChanged, Edit*, pEdit)
if( aFormula.isEmpty() )
{
- maFtVal.SetText(ScGlobal::GetRscString(STR_ENTER_VALUE));
+ maFtVal->SetText(ScGlobal::GetRscString(STR_ENTER_VALUE));
return 0;
}
@@ -290,7 +316,7 @@ IMPL_LINK(ScConditionFrmtEntry, OnEdChanged, Edit*, pEdit)
if( ta->GetCodeError() )
{
pEdit->SetControlBackground(COL_LIGHTRED);
- maFtVal.SetText(ScGlobal::GetRscString(STR_VALID_DEFERROR));
+ maFtVal->SetText(ScGlobal::GetRscString(STR_VALID_DEFERROR));
return 0;
}
@@ -303,24 +329,24 @@ IMPL_LINK(ScConditionFrmtEntry, OnEdChanged, Edit*, pEdit)
)
{
pEdit->SetControlBackground(COL_YELLOW);
- maFtVal.SetText(ScGlobal::GetRscString(STR_UNQUOTED_STRING));
+ maFtVal->SetText(ScGlobal::GetRscString(STR_UNQUOTED_STRING));
return 0;
}
pEdit->SetControlBackground(GetSettings().GetStyleSettings().GetWindowColor());
- maFtVal.SetText("");
+ maFtVal->SetText("");
return 0;
}
void ScConditionFrmtEntry::Select()
{
- maFtVal.Show();
+ maFtVal->Show();
ScCondFrmtEntry::Select();
}
void ScConditionFrmtEntry::Deselect()
{
- maFtVal.Hide();
+ maFtVal->Hide();
ScCondFrmtEntry::Deselect();
}
@@ -383,7 +409,7 @@ sal_Int32 ScConditionFrmtEntry::GetNumberEditFields( ScConditionMode eMode ) con
OUString ScConditionFrmtEntry::GetExpressionString()
{
- return ScCondFormatHelper::GetExpression(CONDITION, maLbCondType.GetSelectEntryPos(), maEdVal1.GetText(), maEdVal2.GetText());
+ return ScCondFormatHelper::GetExpression(CONDITION, maLbCondType->GetSelectEntryPos(), maEdVal1->GetText(), maEdVal2->GetText());
}
ScFormatEntry* ScConditionFrmtEntry::GetEntry() const
@@ -393,33 +419,33 @@ ScFormatEntry* ScConditionFrmtEntry::GetEntry() const
void ScConditionFrmtEntry::SetActive()
{
- ScConditionMode eMode = EntryPosToConditionMode(maLbCondType.GetSelectEntryPos());
- maLbCondType.Show();
+ ScConditionMode eMode = EntryPosToConditionMode(maLbCondType->GetSelectEntryPos());
+ maLbCondType->Show();
switch(GetNumberEditFields(eMode))
{
case 1:
- maEdVal1.Show();
+ maEdVal1->Show();
break;
case 2:
- maEdVal1.Show();
- maEdVal2.Show();
+ maEdVal1->Show();
+ maEdVal2->Show();
break;
}
- maFtStyle.Show();
- maLbStyle.Show();
- maWdPreview.Show();
+ maFtStyle->Show();
+ maLbStyle->Show();
+ maWdPreview->Show();
Select();
}
void ScConditionFrmtEntry::SetInactive()
{
- maLbCondType.Hide();
- maEdVal1.Hide();
- maEdVal2.Hide();
- maFtStyle.Hide();
- maLbStyle.Hide();
- maWdPreview.Hide();
+ maLbCondType->Hide();
+ maEdVal1->Hide();
+ maEdVal2->Hide();
+ maFtStyle->Hide();
+ maLbStyle->Hide();
+ maWdPreview->Hide();
Deselect();
}
@@ -449,7 +475,7 @@ void ScConditionFrmtEntry::Notify(SfxBroadcaster&, const SfxHint& rHint)
if(nHint == SfxStyleSheetHintId::MODIFIED)
{
if(!mbIsInStyleCreate)
- UpdateStyleList(maLbStyle, mpDoc);
+ UpdateStyleList(*maLbStyle.get(), mpDoc);
}
}
@@ -523,7 +549,7 @@ void StyleSelect( ListBox& rLbStyle, ScDocument* pDoc, SvxFontPrevWindow& rWdPre
IMPL_LINK_NOARG(ScConditionFrmtEntry, StyleSelectHdl)
{
mbIsInStyleCreate = true;
- StyleSelect( maLbStyle, mpDoc, maWdPreview );
+ StyleSelect( *maLbStyle.get(), mpDoc, *maWdPreview.get() );
mbIsInStyleCreate = false;
return 0;
}
@@ -532,41 +558,55 @@ IMPL_LINK_NOARG(ScConditionFrmtEntry, StyleSelectHdl)
ScFormulaFrmtEntry::ScFormulaFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, ScCondFormatDlg* pDialogParent, const ScAddress& rPos, const ScCondFormatEntry* pFormat ):
ScCondFrmtEntry( pParent, pDoc, rPos ),
- maFtStyle( this, ScResId( FT_STYLE ) ),
- maLbStyle( this, ScResId( LB_STYLE ) ),
- maWdPreview( this, ScResId( WD_PREVIEW ) ),
- maEdFormula( this, NULL, NULL, ScResId( ED_FORMULA ) )
+ maFtStyle( VclPtr<FixedText>::Create( this, ScResId( FT_STYLE ) ) ),
+ maLbStyle( VclPtr<ListBox>::Create( this, ScResId( LB_STYLE ) ) ),
+ maWdPreview( VclPtr<SvxFontPrevWindow>::Create( this, ScResId( WD_PREVIEW ) ) ),
+ maEdFormula( VclPtr<formula::RefEdit>::Create(this, nullptr, nullptr, ScResId( ED_FORMULA ) ) )
{
Init(pDialogParent);
FreeResource();
- maLbType.SelectEntryPos(2);
+ maLbType->SelectEntryPos(2);
if(pFormat)
{
- maEdFormula.SetText(pFormat->GetExpression(rPos, 0, 0, pDoc->GetGrammar()));
- maLbStyle.SelectEntry(pFormat->GetStyle());
+ maEdFormula->SetText(pFormat->GetExpression(rPos, 0, 0, pDoc->GetGrammar()));
+ maLbStyle->SelectEntry(pFormat->GetStyle());
}
else
{
- maLbStyle.SelectEntryPos(1);
+ maLbStyle->SelectEntryPos(1);
}
StyleSelectHdl(NULL);
}
+ScFormulaFrmtEntry::~ScFormulaFrmtEntry()
+{
+ disposeOnce();
+}
+
+void ScFormulaFrmtEntry::dispose()
+{
+ maFtStyle.disposeAndClear();
+ maLbStyle.disposeAndClear();
+ maWdPreview.disposeAndClear();
+ maEdFormula.disposeAndClear();
+ ScCondFrmtEntry::dispose();
+}
+
void ScFormulaFrmtEntry::Init(ScCondFormatDlg* pDialogParent)
{
- maEdFormula.SetGetFocusHdl( LINK( pDialogParent, ScCondFormatDlg, RangeGetFocusHdl ) );
- maEdFormula.SetLoseFocusHdl( LINK( pDialogParent, ScCondFormatDlg, RangeLoseFocusHdl ) );
+ maEdFormula->SetGetFocusHdl( LINK( pDialogParent, ScCondFormatDlg, RangeGetFocusHdl ) );
+ maEdFormula->SetLoseFocusHdl( LINK( pDialogParent, ScCondFormatDlg, RangeLoseFocusHdl ) );
- FillStyleListBox( mpDoc, maLbStyle );
- maLbStyle.SetSelectHdl( LINK( this, ScFormulaFrmtEntry, StyleSelectHdl ) );
+ FillStyleListBox( mpDoc, *maLbStyle.get() );
+ maLbStyle->SetSelectHdl( LINK( this, ScFormulaFrmtEntry, StyleSelectHdl ) );
}
IMPL_LINK_NOARG(ScFormulaFrmtEntry, StyleSelectHdl)
{
- StyleSelect( maLbStyle, mpDoc, maWdPreview );
+ StyleSelect( *maLbStyle.get(), mpDoc, *maWdPreview.get() );
return 0;
}
@@ -574,12 +614,12 @@ IMPL_LINK_NOARG(ScFormulaFrmtEntry, StyleSelectHdl)
ScFormatEntry* ScFormulaFrmtEntry::createFormulaEntry() const
{
ScConditionMode eMode = SC_COND_DIRECT;
- OUString aFormula = maEdFormula.GetText();
+ OUString aFormula = maEdFormula->GetText();
if(aFormula.isEmpty())
return NULL;
OUString aExpr2;
- ScFormatEntry* pEntry = new ScCondFormatEntry(eMode, aFormula, aExpr2, mpDoc, maPos, maLbStyle.GetSelectEntry());
+ ScFormatEntry* pEntry = new ScCondFormatEntry(eMode, aFormula, aExpr2, mpDoc, maPos, maLbStyle->GetSelectEntry());
return pEntry;
}
@@ -590,25 +630,25 @@ ScFormatEntry* ScFormulaFrmtEntry::GetEntry() const
OUString ScFormulaFrmtEntry::GetExpressionString()
{
- return ScCondFormatHelper::GetExpression(FORMULA, 0, maEdFormula.GetText());
+ return ScCondFormatHelper::GetExpression(FORMULA, 0, maEdFormula->GetText());
}
void ScFormulaFrmtEntry::SetActive()
{
- maWdPreview.Show();
- maFtStyle.Show();
- maLbStyle.Show();
- maEdFormula.Show();
+ maWdPreview->Show();
+ maFtStyle->Show();
+ maLbStyle->Show();
+ maEdFormula->Show();
Select();
}
void ScFormulaFrmtEntry::SetInactive()
{
- maWdPreview.Hide();
- maFtStyle.Hide();
- maLbStyle.Hide();
- maEdFormula.Hide();
+ maWdPreview->Hide();
+ maFtStyle->Hide();
+ maLbStyle->Hide();
+ maEdFormula->Hide();
Deselect();
}
@@ -702,45 +742,62 @@ ScColorScaleEntry* createColorScaleEntry( const ListBox& rType, const ColorListB
ScColorScale2FrmtEntry::ScColorScale2FrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat ):
ScCondFrmtEntry( pParent, pDoc, rPos ),
- maLbColorFormat( this, ScResId( LB_COLOR_FORMAT ) ),
- maLbEntryTypeMin( this, ScResId( LB_TYPE_COL_SCALE_MIN ) ),
- maLbEntryTypeMax( this, ScResId( LB_TYPE_COL_SCALE_MAX ) ),
- maEdMin( this, ScResId( ED_COL_SCALE_MIN ) ),
- maEdMax( this, ScResId( ED_COL_SCALE_MAX ) ),
- maLbColMin( this, ScResId( LB_COL_MIN ) ),
- maLbColMax( this, ScResId( LB_COL_MAX ) )
+ maLbColorFormat( VclPtr<ListBox>::Create( this, ScResId( LB_COLOR_FORMAT ) ) ),
+ maLbEntryTypeMin( VclPtr<ListBox>::Create( this, ScResId( LB_TYPE_COL_SCALE_MIN ) ) ),
+ maLbEntryTypeMax( VclPtr<ListBox>::Create( this, ScResId( LB_TYPE_COL_SCALE_MAX ) ) ),
+ maEdMin( VclPtr<Edit>::Create( this, ScResId( ED_COL_SCALE_MIN ) ) ),
+ maEdMax( VclPtr<Edit>::Create( this, ScResId( ED_COL_SCALE_MAX ) ) ),
+ maLbColMin( VclPtr<ColorListBox>::Create( this, ScResId( LB_COL_MIN ) ) ),
+ maLbColMax( VclPtr<ColorListBox>::Create( this, ScResId( LB_COL_MAX ) ) )
{
// remove the automatic entry from color scales
- maLbEntryTypeMin.RemoveEntry(0);
- maLbEntryTypeMax.RemoveEntry(0);
+ maLbEntryTypeMin->RemoveEntry(0);
+ maLbEntryTypeMax->RemoveEntry(0);
- maLbType.SelectEntryPos(0);
- maLbColorFormat.SelectEntryPos(0);
+ maLbType->SelectEntryPos(0);
+ maLbColorFormat->SelectEntryPos(0);
Init();
if(pFormat)
{
ScColorScaleFormat::const_iterator itr = pFormat->begin();
- SetColorScaleEntryTypes(*itr, maLbEntryTypeMin, maEdMin, maLbColMin, pDoc);
+ SetColorScaleEntryTypes(*itr, *maLbEntryTypeMin.get(), *maEdMin.get(), *maLbColMin.get(), pDoc);
++itr;
- SetColorScaleEntryTypes(*itr, maLbEntryTypeMax, maEdMax, maLbColMax, pDoc);
+ SetColorScaleEntryTypes(*itr, *maLbEntryTypeMax.get(), *maEdMax.get(), *maLbColMax.get(), pDoc);
}
else
{
- maLbEntryTypeMin.SelectEntryPos(0);
- maLbEntryTypeMax.SelectEntryPos(1);
+ maLbEntryTypeMin->SelectEntryPos(0);
+ maLbEntryTypeMax->SelectEntryPos(1);
}
FreeResource();
- maLbColorFormat.SetSelectHdl( LINK( pParent, ScCondFormatList, ColFormatTypeHdl ) );
+ maLbColorFormat->SetSelectHdl( LINK( pParent, ScCondFormatList, ColFormatTypeHdl ) );
- EntryTypeHdl(&maLbEntryTypeMin);
- EntryTypeHdl(&maLbEntryTypeMax);
+ EntryTypeHdl(maLbEntryTypeMin.get());
+ EntryTypeHdl(maLbEntryTypeMax.get());
+}
+
+ScColorScale2FrmtEntry::~ScColorScale2FrmtEntry()
+{
+ disposeOnce();
+}
+
+void ScColorScale2FrmtEntry::dispose()
+{
+ maLbColorFormat.disposeAndClear();
+ maLbEntryTypeMin.disposeAndClear();
+ maLbEntryTypeMax.disposeAndClear();
+ maEdMin.disposeAndClear();
+ maEdMax.disposeAndClear();
+ maLbColMin.disposeAndClear();
+ maLbColMax.disposeAndClear();
+ ScCondFrmtEntry::dispose();
}
void ScColorScale2FrmtEntry::Init()
{
- maLbEntryTypeMin.SetSelectHdl( LINK( this, ScColorScale2FrmtEntry, EntryTypeHdl ) );
- maLbEntryTypeMax.SetSelectHdl( LINK( this, ScColorScale2FrmtEntry, EntryTypeHdl ) );
+ maLbEntryTypeMin->SetSelectHdl( LINK( this, ScColorScale2FrmtEntry, EntryTypeHdl ) );
+ maLbEntryTypeMax->SetSelectHdl( LINK( this, ScColorScale2FrmtEntry, EntryTypeHdl ) );
SfxObjectShell* pDocSh = SfxObjectShell::Current();
XColorListRef pColorTable;
@@ -756,30 +813,30 @@ void ScColorScale2FrmtEntry::Init()
if ( pColorTable.is() )
{
// filling the line color box
- maLbColMin.SetUpdateMode( false );
- maLbColMax.SetUpdateMode( false );
+ maLbColMin->SetUpdateMode( false );
+ maLbColMax->SetUpdateMode( false );
for ( long i = 0; i < pColorTable->Count(); ++i )
{
XColorEntry* pEntry = pColorTable->GetColor(i);
- maLbColMin.InsertEntry( pEntry->GetColor(), pEntry->GetName() );
- maLbColMax.InsertEntry( pEntry->GetColor(), pEntry->GetName() );
+ maLbColMin->InsertEntry( pEntry->GetColor(), pEntry->GetName() );
+ maLbColMax->InsertEntry( pEntry->GetColor(), pEntry->GetName() );
if(pEntry->GetColor() == Color(COL_LIGHTRED))
- maLbColMin.SelectEntryPos(i);
+ maLbColMin->SelectEntryPos(i);
if(pEntry->GetColor() == Color(COL_LIGHTBLUE))
- maLbColMax.SelectEntryPos(i);
+ maLbColMax->SelectEntryPos(i);
}
- maLbColMin.SetUpdateMode( true );
- maLbColMax.SetUpdateMode( true );
+ maLbColMin->SetUpdateMode( true );
+ maLbColMax->SetUpdateMode( true );
}
}
ScFormatEntry* ScColorScale2FrmtEntry::createColorscaleEntry() const
{
ScColorScaleFormat* pColorScale = new ScColorScaleFormat(mpDoc);
- pColorScale->AddEntry(createColorScaleEntry(maLbEntryTypeMin, maLbColMin, maEdMin, mpDoc, maPos));
- pColorScale->AddEntry(createColorScaleEntry(maLbEntryTypeMax, maLbColMax, maEdMax, mpDoc, maPos));
+ pColorScale->AddEntry(createColorScaleEntry(*maLbEntryTypeMin.get(), *maLbColMin.get(), *maEdMin.get(), mpDoc, maPos));
+ pColorScale->AddEntry(createColorScaleEntry(*maLbEntryTypeMax.get(), *maLbColMax.get(), *maEdMax.get(), mpDoc, maPos));
return pColorScale;
}
@@ -795,32 +852,32 @@ ScFormatEntry* ScColorScale2FrmtEntry::GetEntry() const
void ScColorScale2FrmtEntry::SetActive()
{
- maLbColorFormat.Show();
+ maLbColorFormat->Show();
- maLbEntryTypeMin.Show();
- maLbEntryTypeMax.Show();
+ maLbEntryTypeMin->Show();
+ maLbEntryTypeMax->Show();
- maEdMin.Show();
- maEdMax.Show();
+ maEdMin->Show();
+ maEdMax->Show();
- maLbColMin.Show();
- maLbColMax.Show();
+ maLbColMin->Show();
+ maLbColMax->Show();
Select();
}
void ScColorScale2FrmtEntry::SetInactive()
{
- maLbColorFormat.Hide();
+ maLbColorFormat->Hide();
- maLbEntryTypeMin.Hide();
- maLbEntryTypeMax.Hide();
+ maLbEntryTypeMin->Hide();
+ maLbEntryTypeMax->Hide();
- maEdMin.Hide();
- maEdMax.Hide();
+ maEdMin->Hide();
+ maEdMax->Hide();
- maLbColMin.Hide();
- maLbColMax.Hide();
+ maLbColMin->Hide();
+ maLbColMax->Hide();
Deselect();
}
@@ -828,10 +885,10 @@ void ScColorScale2FrmtEntry::SetInactive()
IMPL_LINK( ScColorScale2FrmtEntry, EntryTypeHdl, ListBox*, pBox )
{
Edit* pEd = NULL;
- if (pBox == &maLbEntryTypeMin)
- pEd = &maEdMin;
- else if (pBox == &maLbEntryTypeMax)
- pEd = &maEdMax;
+ if (pBox == maLbEntryTypeMin.get())
+ pEd = maEdMin;
+ else if (pBox == maLbEntryTypeMax.get())
+ pEd = maEdMax.get();
if (!pEd)
return 0;
@@ -853,56 +910,76 @@ IMPL_LINK( ScColorScale2FrmtEntry, EntryTypeHdl, ListBox*, pBox )
ScColorScale3FrmtEntry::ScColorScale3FrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat ):
ScCondFrmtEntry( pParent, pDoc, rPos ),
- maLbColorFormat( this, ScResId( LB_COLOR_FORMAT ) ),
- maLbEntryTypeMin( this, ScResId( LB_TYPE_COL_SCALE_MIN ) ),
- maLbEntryTypeMiddle( this, ScResId( LB_TYPE_COL_SCALE_MIDDLE ) ),
- maLbEntryTypeMax( this, ScResId( LB_TYPE_COL_SCALE_MAX ) ),
- maEdMin( this, ScResId( ED_COL_SCALE_MIN ) ),
- maEdMiddle( this, ScResId( ED_COL_SCALE_MIDDLE ) ),
- maEdMax( this, ScResId( ED_COL_SCALE_MAX ) ),
- maLbColMin( this, ScResId( LB_COL_MIN ) ),
- maLbColMiddle( this, ScResId( LB_COL_MIDDLE ) ),
- maLbColMax( this, ScResId( LB_COL_MAX ) )
+ maLbColorFormat( VclPtr<ListBox>::Create( this, ScResId( LB_COLOR_FORMAT ) ) ),
+ maLbEntryTypeMin( VclPtr<ListBox>::Create( this, ScResId( LB_TYPE_COL_SCALE_MIN ) ) ),
+ maLbEntryTypeMiddle( VclPtr<ListBox>::Create( this, ScResId( LB_TYPE_COL_SCALE_MIDDLE ) ) ),
+ maLbEntryTypeMax( VclPtr<ListBox>::Create( this, ScResId( LB_TYPE_COL_SCALE_MAX ) ) ),
+ maEdMin( VclPtr<Edit>::Create( this, ScResId( ED_COL_SCALE_MIN ) ) ),
+ maEdMiddle( VclPtr<Edit>::Create( this, ScResId( ED_COL_SCALE_MIDDLE ) ) ),
+ maEdMax( VclPtr<Edit>::Create( this, ScResId( ED_COL_SCALE_MAX ) ) ),
+ maLbColMin( VclPtr<ColorListBox>::Create( this, ScResId( LB_COL_MIN ) ) ),
+ maLbColMiddle( VclPtr<ColorListBox>::Create( this, ScResId( LB_COL_MIDDLE ) ) ),
+ maLbColMax( VclPtr<ColorListBox>::Create( this, ScResId( LB_COL_MAX ) ) )
{
// remove the automatic entry from color scales
- maLbEntryTypeMin.RemoveEntry(0);
- maLbEntryTypeMiddle.RemoveEntry(0);
- maLbEntryTypeMax.RemoveEntry(0);
- maLbColorFormat.SelectEntryPos(1);
+ maLbEntryTypeMin->RemoveEntry(0);
+ maLbEntryTypeMiddle->RemoveEntry(0);
+ maLbEntryTypeMax->RemoveEntry(0);
+ maLbColorFormat->SelectEntryPos(1);
Init();
- maLbType.SelectEntryPos(0);
+ maLbType->SelectEntryPos(0);
if(pFormat)
{
ScColorScaleFormat::const_iterator itr = pFormat->begin();
- SetColorScaleEntryTypes(*itr, maLbEntryTypeMin, maEdMin, maLbColMin, pDoc);
+ SetColorScaleEntryTypes(*itr, *maLbEntryTypeMin.get(), *maEdMin.get(), *maLbColMin.get(), pDoc);
assert(pFormat->size() == 3);
++itr;
- SetColorScaleEntryTypes(*itr, maLbEntryTypeMiddle, maEdMiddle, maLbColMiddle, pDoc);
+ SetColorScaleEntryTypes(*itr, *maLbEntryTypeMiddle.get(), *maEdMiddle.get(), *maLbColMiddle.get(), pDoc);
++itr;
- SetColorScaleEntryTypes(*itr, maLbEntryTypeMax, maEdMax, maLbColMax, pDoc);
+ SetColorScaleEntryTypes(*itr, *maLbEntryTypeMax.get(), *maEdMax.get(), *maLbColMax.get(), pDoc);
}
else
{
- maLbColorFormat.SelectEntryPos(1);
- maLbEntryTypeMin.SelectEntryPos(0);
- maLbEntryTypeMiddle.SelectEntryPos(2);
- maLbEntryTypeMax.SelectEntryPos(1);
- maEdMiddle.SetText(OUString::number(50));
+ maLbColorFormat->SelectEntryPos(1);
+ maLbEntryTypeMin->SelectEntryPos(0);
+ maLbEntryTypeMiddle->SelectEntryPos(2);
+ maLbEntryTypeMax->SelectEntryPos(1);
+ maEdMiddle->SetText(OUString::number(50));
}
FreeResource();
- maLbColorFormat.SetSelectHdl( LINK( pParent, ScCondFormatList, ColFormatTypeHdl ) );
- EntryTypeHdl(&maLbEntryTypeMin);
- EntryTypeHdl(&maLbEntryTypeMiddle);
- EntryTypeHdl(&maLbEntryTypeMax);
+ maLbColorFormat->SetSelectHdl( LINK( pParent, ScCondFormatList, ColFormatTypeHdl ) );
+ EntryTypeHdl(maLbEntryTypeMin.get());
+ EntryTypeHdl(maLbEntryTypeMiddle.get());
+ EntryTypeHdl(maLbEntryTypeMax.get());
+}
+
+ScColorScale3FrmtEntry::~ScColorScale3FrmtEntry()
+{
+ disposeOnce();
+}
+
+void ScColorScale3FrmtEntry::dispose()
+{
+ maLbColorFormat.disposeAndClear();
+ maLbEntryTypeMin.disposeAndClear();
+ maLbEntryTypeMiddle.disposeAndClear();
+ maLbEntryTypeMax.disposeAndClear();
+ maEdMin.disposeAndClear();
+ maEdMiddle.disposeAndClear();
+ maEdMax.disposeAndClear();
+ maLbColMin.disposeAndClear();
+ maLbColMiddle.disposeAndClear();
+ maLbColMax.disposeAndClear();
+ ScCondFrmtEntry::dispose();
}
void ScColorScale3FrmtEntry::Init()
{
- maLbEntryTypeMin.SetSelectHdl( LINK( this, ScColorScale3FrmtEntry, EntryTypeHdl ) );
- maLbEntryTypeMax.SetSelectHdl( LINK( this, ScColorScale3FrmtEntry, EntryTypeHdl ) );
- maLbEntryTypeMiddle.SetSelectHdl( LINK( this, ScColorScale3FrmtEntry, EntryTypeHdl ) );
+ maLbEntryTypeMin->SetSelectHdl( LINK( this, ScColorScale3FrmtEntry, EntryTypeHdl ) );
+ maLbEntryTypeMax->SetSelectHdl( LINK( this, ScColorScale3FrmtEntry, EntryTypeHdl ) );
+ maLbEntryTypeMiddle->SetSelectHdl( LINK( this, ScColorScale3FrmtEntry, EntryTypeHdl ) );
SfxObjectShell* pDocSh = SfxObjectShell::Current();
XColorListRef pColorTable;
@@ -918,37 +995,37 @@ void ScColorScale3FrmtEntry::Init()
if ( pColorTable.is() )
{
// filling the line color box
- maLbColMin.SetUpdateMode( false );
- maLbColMiddle.SetUpdateMode( false );
- maLbColMax.SetUpdateMode( false );
+ maLbColMin->SetUpdateMode( false );
+ maLbColMiddle->SetUpdateMode( false );
+ maLbColMax->SetUpdateMode( false );
for ( long i = 0; i < pColorTable->Count(); ++i )
{
XColorEntry* pEntry = pColorTable->GetColor(i);
- maLbColMin.InsertEntry( pEntry->GetColor(), pEntry->GetName() );
- maLbColMiddle.InsertEntry( pEntry->GetColor(), pEntry->GetName() );
- maLbColMax.InsertEntry( pEntry->GetColor(), pEntry->GetName() );
+ maLbColMin->InsertEntry( pEntry->GetColor(), pEntry->GetName() );
+ maLbColMiddle->InsertEntry( pEntry->GetColor(), pEntry->GetName() );
+ maLbColMax->InsertEntry( pEntry->GetColor(), pEntry->GetName() );
if(pEntry->GetColor() == Color(COL_LIGHTRED))
- maLbColMin.SelectEntryPos(i);
+ maLbColMin->SelectEntryPos(i);
if(pEntry->GetColor() == Color(COL_GREEN))
- maLbColMiddle.SelectEntryPos(i);
+ maLbColMiddle->SelectEntryPos(i);
if(pEntry->GetColor() == Color(COL_LIGHTBLUE))
- maLbColMax.SelectEntryPos(i);
+ maLbColMax->SelectEntryPos(i);
}
- maLbColMin.SetUpdateMode( true );
- maLbColMiddle.SetUpdateMode( true );
- maLbColMax.SetUpdateMode( true );
+ maLbColMin->SetUpdateMode( true );
+ maLbColMiddle->SetUpdateMode( true );
+ maLbColMax->SetUpdateMode( true );
}
}
ScFormatEntry* ScColorScale3FrmtEntry::createColorscaleEntry() const
{
ScColorScaleFormat* pColorScale = new ScColorScaleFormat(mpDoc);
- pColorScale->AddEntry(createColorScaleEntry(maLbEntryTypeMin, maLbColMin, maEdMin, mpDoc, maPos));
- if(maLbColorFormat.GetSelectEntryPos() == 1)
- pColorScale->AddEntry(createColorScaleEntry(maLbEntryTypeMiddle, maLbColMiddle, maEdMiddle, mpDoc, maPos));
- pColorScale->AddEntry(createColorScaleEntry(maLbEntryTypeMax, maLbColMax, maEdMax, mpDoc, maPos));
+ pColorScale->AddEntry(createColorScaleEntry(*maLbEntryTypeMin.get(), *maLbColMin.get(), *maEdMin.get(), mpDoc, maPos));
+ if(maLbColorFormat->GetSelectEntryPos() == 1)
+ pColorScale->AddEntry(createColorScaleEntry(*maLbEntryTypeMiddle.get(), *maLbColMiddle.get(), *maEdMiddle.get(), mpDoc, maPos));
+ pColorScale->AddEntry(createColorScaleEntry(*maLbEntryTypeMax.get(), *maLbColMax.get(), *maEdMax.get(), mpDoc, maPos));
return pColorScale;
}
@@ -964,37 +1041,37 @@ ScFormatEntry* ScColorScale3FrmtEntry::GetEntry() const
void ScColorScale3FrmtEntry::SetActive()
{
- maLbColorFormat.Show();
- maLbEntryTypeMin.Show();
- maLbEntryTypeMiddle.Show();
- maLbEntryTypeMax.Show();
+ maLbColorFormat->Show();
+ maLbEntryTypeMin->Show();
+ maLbEntryTypeMiddle->Show();
+ maLbEntryTypeMax->Show();
- maEdMin.Show();
- maEdMiddle.Show();
- maEdMax.Show();
+ maEdMin->Show();
+ maEdMiddle->Show();
+ maEdMax->Show();
- maLbColMin.Show();
- maLbColMiddle.Show();
- maLbColMax.Show();
+ maLbColMin->Show();
+ maLbColMiddle->Show();
+ maLbColMax->Show();
Select();
}
void ScColorScale3FrmtEntry::SetInactive()
{
- maLbColorFormat.Hide();
+ maLbColorFormat->Hide();
- maLbEntryTypeMin.Hide();
- maLbEntryTypeMiddle.Hide();
- maLbEntryTypeMax.Hide();
+ maLbEntryTypeMin->Hide();
+ maLbEntryTypeMiddle->Hide();
+ maLbEntryTypeMax->Hide();
- maEdMin.Hide();
- maEdMiddle.Hide();
- maEdMax.Hide();
+ maEdMin->Hide();
+ maEdMiddle->Hide();
+ maEdMax->Hide();
- maLbColMin.Hide();
- maLbColMiddle.Hide();
- maLbColMax.Hide();
+ maLbColMin->Hide();
+ maLbColMiddle->Hide();
+ maLbColMax->Hide();
Deselect();
}
@@ -1002,12 +1079,12 @@ void ScColorScale3FrmtEntry::SetInactive()
IMPL_LINK( ScColorScale3FrmtEntry, EntryTypeHdl, ListBox*, pBox )
{
Edit* pEd = NULL;
- if(pBox == &maLbEntryTypeMin)
- pEd = &maEdMin;
- else if(pBox == &maLbEntryTypeMiddle)
- pEd = &maEdMiddle;
- else if(pBox == &maLbEntryTypeMax)
- pEd = &maEdMax;
+ if(pBox == maLbEntryTypeMin.get())
+ pEd = maEdMin.get();
+ else if(pBox == maLbEntryTypeMiddle.get())
+ pEd = maEdMiddle.get();
+ else if(pBox == maLbEntryTypeMax.get())
+ pEd = maEdMax.get();
if (!pEd)
return 0;
@@ -1029,24 +1106,24 @@ IMPL_LINK( ScColorScale3FrmtEntry, EntryTypeHdl, ListBox*, pBox )
IMPL_LINK_NOARG( ScConditionFrmtEntry, ConditionTypeSelectHdl )
{
- sal_Int32 nSelectPos = maLbCondType.GetSelectEntryPos();
+ sal_Int32 nSelectPos = maLbCondType->GetSelectEntryPos();
ScConditionMode eMode = EntryPosToConditionMode(nSelectPos);
switch(GetNumberEditFields(eMode))
{
case 0:
- maEdVal1.Hide();
- maEdVal2.Hide();
- maFtVal.Hide();
+ maEdVal1->Hide();
+ maEdVal2->Hide();
+ maFtVal->Hide();
break;
case 1:
- maEdVal1.Show();
- maEdVal2.Hide();
- maFtVal.Show();
+ maEdVal1->Show();
+ maEdVal2->Hide();
+ maFtVal->Show();
break;
case 2:
- maEdVal1.Show();
- maEdVal2.Show();
- maFtVal.Show();
+ maEdVal1->Show();
+ maEdVal2->Show();
+ maFtVal->Show();
break;
}
@@ -1087,35 +1164,51 @@ void SetDataBarEntryTypes( const ScColorScaleEntry& rEntry, ListBox& rLbType, Ed
ScDataBarFrmtEntry::ScDataBarFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScDataBarFormat* pFormat ):
ScCondFrmtEntry( pParent, pDoc, rPos ),
- maLbColorFormat( this, ScResId( LB_COLOR_FORMAT ) ),
- maLbDataBarMinType( this, ScResId( LB_TYPE_COL_SCALE_MIN ) ),
- maLbDataBarMaxType( this, ScResId( LB_TYPE_COL_SCALE_MAX ) ),
- maEdDataBarMin( this, ScResId( ED_COL_SCALE_MIN ) ),
- maEdDataBarMax( this, ScResId( ED_COL_SCALE_MAX ) ),
- maBtOptions( this, ScResId( BTN_OPTIONS ) )
-{
- maLbColorFormat.SelectEntryPos(2);
- maLbType.SelectEntryPos(0);
+ maLbColorFormat( VclPtr<ListBox>::Create( this, ScResId( LB_COLOR_FORMAT ) ) ),
+ maLbDataBarMinType( VclPtr<ListBox>::Create( this, ScResId( LB_TYPE_COL_SCALE_MIN ) ) ),
+ maLbDataBarMaxType( VclPtr<ListBox>::Create( this, ScResId( LB_TYPE_COL_SCALE_MAX ) ) ),
+ maEdDataBarMin( VclPtr<Edit>::Create( this, ScResId( ED_COL_SCALE_MIN ) ) ),
+ maEdDataBarMax( VclPtr<Edit>::Create( this, ScResId( ED_COL_SCALE_MAX ) ) ),
+ maBtOptions( VclPtr<PushButton>::Create( this, ScResId( BTN_OPTIONS ) ) )
+{
+ maLbColorFormat->SelectEntryPos(2);
+ maLbType->SelectEntryPos(0);
if(pFormat)
{
mpDataBarData.reset(new ScDataBarFormatData(*pFormat->GetDataBarData()));
- SetDataBarEntryTypes(*mpDataBarData->mpLowerLimit, maLbDataBarMinType, maEdDataBarMin, pDoc);
- SetDataBarEntryTypes(*mpDataBarData->mpUpperLimit, maLbDataBarMaxType, maEdDataBarMax, pDoc);
+ SetDataBarEntryTypes(*mpDataBarData->mpLowerLimit, *maLbDataBarMinType.get(), *maEdDataBarMin.get(), pDoc);
+ SetDataBarEntryTypes(*mpDataBarData->mpUpperLimit, *maLbDataBarMaxType.get(), *maEdDataBarMax.get(), pDoc);
DataBarTypeSelectHdl(NULL);
}
else
{
- maLbDataBarMinType.SelectEntryPos(0);
- maLbDataBarMaxType.SelectEntryPos(0);
+ maLbDataBarMinType->SelectEntryPos(0);
+ maLbDataBarMaxType->SelectEntryPos(0);
DataBarTypeSelectHdl(NULL);
}
Init();
- maLbColorFormat.SetSelectHdl( LINK( pParent, ScCondFormatList, ColFormatTypeHdl ) );
+ maLbColorFormat->SetSelectHdl( LINK( pParent, ScCondFormatList, ColFormatTypeHdl ) );
FreeResource();
}
+ScDataBarFrmtEntry::~ScDataBarFrmtEntry()
+{
+ disposeOnce();
+}
+
+void ScDataBarFrmtEntry::dispose()
+{
+ maLbColorFormat.disposeAndClear();
+ maLbDataBarMinType.disposeAndClear();
+ maLbDataBarMaxType.disposeAndClear();
+ maEdDataBarMin.disposeAndClear();
+ maEdDataBarMax.disposeAndClear();
+ maBtOptions.disposeAndClear();
+ ScCondFrmtEntry::dispose();
+}
+
ScFormatEntry* ScDataBarFrmtEntry::GetEntry() const
{
return createDatabarEntry();
@@ -1123,10 +1216,10 @@ ScFormatEntry* ScDataBarFrmtEntry::GetEntry() const
void ScDataBarFrmtEntry::Init()
{
- maLbDataBarMinType.SetSelectHdl( LINK( this, ScDataBarFrmtEntry, DataBarTypeSelectHdl ) );
- maLbDataBarMaxType.SetSelectHdl( LINK( this, ScDataBarFrmtEntry, DataBarTypeSelectHdl ) );
+ maLbDataBarMinType->SetSelectHdl( LINK( this, ScDataBarFrmtEntry, DataBarTypeSelectHdl ) );
+ maLbDataBarMaxType->SetSelectHdl( LINK( this, ScDataBarFrmtEntry, DataBarTypeSelectHdl ) );
- maBtOptions.SetClickHdl( LINK( this, ScDataBarFrmtEntry, OptionBtnHdl ) );
+ maBtOptions->SetClickHdl( LINK( this, ScDataBarFrmtEntry, OptionBtnHdl ) );
if(!mpDataBarData)
{
@@ -1141,8 +1234,8 @@ void ScDataBarFrmtEntry::Init()
ScFormatEntry* ScDataBarFrmtEntry::createDatabarEntry() const
{
- SetColorScaleEntry(mpDataBarData->mpLowerLimit.get(), maLbDataBarMinType, maEdDataBarMin, mpDoc, maPos, true);
- SetColorScaleEntry(mpDataBarData->mpUpperLimit.get(), maLbDataBarMaxType, maEdDataBarMax, mpDoc, maPos, true);
+ SetColorScaleEntry(mpDataBarData->mpLowerLimit.get(), *maLbDataBarMinType.get(), *maEdDataBarMin.get(), mpDoc, maPos, true);
+ SetColorScaleEntry(mpDataBarData->mpUpperLimit.get(), *maLbDataBarMaxType.get(), *maEdDataBarMax.get(), mpDoc, maPos, true);
ScDataBarFormat* pDataBar = new ScDataBarFormat(mpDoc);
pDataBar->SetDataBarData(new ScDataBarFormatData(*mpDataBarData.get()));
return pDataBar;
@@ -1155,57 +1248,57 @@ OUString ScDataBarFrmtEntry::GetExpressionString()
void ScDataBarFrmtEntry::SetActive()
{
- maLbColorFormat.Show();
+ maLbColorFormat->Show();
- maLbDataBarMinType.Show();
- maLbDataBarMaxType.Show();
- maEdDataBarMin.Show();
- maEdDataBarMax.Show();
- maBtOptions.Show();
+ maLbDataBarMinType->Show();
+ maLbDataBarMaxType->Show();
+ maEdDataBarMin->Show();
+ maEdDataBarMax->Show();
+ maBtOptions->Show();
Select();
}
void ScDataBarFrmtEntry::SetInactive()
{
- maLbColorFormat.Hide();
+ maLbColorFormat->Hide();
- maLbDataBarMinType.Hide();
- maLbDataBarMaxType.Hide();
- maEdDataBarMin.Hide();
- maEdDataBarMax.Hide();
- maBtOptions.Hide();
+ maLbDataBarMinType->Hide();
+ maLbDataBarMaxType->Hide();
+ maEdDataBarMin->Hide();
+ maEdDataBarMax->Hide();
+ maBtOptions->Hide();
Deselect();
}
IMPL_LINK_NOARG( ScDataBarFrmtEntry, DataBarTypeSelectHdl )
{
- sal_Int32 nSelectPos = maLbDataBarMinType.GetSelectEntryPos();
+ sal_Int32 nSelectPos = maLbDataBarMinType->GetSelectEntryPos();
if(nSelectPos <= COLORSCALE_MAX)
- maEdDataBarMin.Disable();
+ maEdDataBarMin->Disable();
else
- maEdDataBarMin.Enable();
+ maEdDataBarMin->Enable();
- nSelectPos = maLbDataBarMaxType.GetSelectEntryPos();
+ nSelectPos = maLbDataBarMaxType->GetSelectEntryPos();
if(nSelectPos <= COLORSCALE_MAX)
- maEdDataBarMax.Disable();
+ maEdDataBarMax->Disable();
else
- maEdDataBarMax.Enable();
+ maEdDataBarMax->Enable();
return 0;
}
IMPL_LINK_NOARG( ScDataBarFrmtEntry, OptionBtnHdl )
{
- SetColorScaleEntry(mpDataBarData->mpLowerLimit.get(), maLbDataBarMinType, maEdDataBarMin, mpDoc, maPos, true);
- SetColorScaleEntry(mpDataBarData->mpUpperLimit.get(), maLbDataBarMaxType, maEdDataBarMax, mpDoc, maPos, true);
- ScDataBarSettingsDlg* pDlg = new ScDataBarSettingsDlg(this, *mpDataBarData, mpDoc, maPos);
+ SetColorScaleEntry(mpDataBarData->mpLowerLimit.get(), *maLbDataBarMinType.get(), *maEdDataBarMin.get(), mpDoc, maPos, true);
+ SetColorScaleEntry(mpDataBarData->mpUpperLimit.get(), *maLbDataBarMaxType.get(), *maEdDataBarMax.get(), mpDoc, maPos, true);
+ ScopedVclPtrInstance<ScDataBarSettingsDlg> pDlg(this, *mpDataBarData, mpDoc, maPos);
if( pDlg->Execute() == RET_OK)
{
mpDataBarData.reset(pDlg->GetData());
- SetDataBarEntryTypes(*mpDataBarData->mpLowerLimit, maLbDataBarMinType, maEdDataBarMin, mpDoc);
- SetDataBarEntryTypes(*mpDataBarData->mpUpperLimit, maLbDataBarMaxType, maEdDataBarMax, mpDoc);
+ SetDataBarEntryTypes(*mpDataBarData->mpLowerLimit, *maLbDataBarMinType, *maEdDataBarMin.get(), mpDoc);
+ SetDataBarEntryTypes(*mpDataBarData->mpUpperLimit, *maLbDataBarMaxType.get(), *maEdDataBarMax.get(), mpDoc);
DataBarTypeSelectHdl(NULL);
}
return 0;
@@ -1213,10 +1306,10 @@ IMPL_LINK_NOARG( ScDataBarFrmtEntry, OptionBtnHdl )
ScDateFrmtEntry::ScDateFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScCondDateFormatEntry* pFormat ):
ScCondFrmtEntry( pParent, pDoc, ScAddress() ),
- maLbDateEntry( this, ScResId( LB_DATE_TYPE ) ),
- maFtStyle( this, ScResId( FT_STYLE ) ),
- maLbStyle( this, ScResId( LB_STYLE ) ),
- maWdPreview( this, ScResId( WD_PREVIEW ) ),
+ maLbDateEntry( VclPtr<ListBox>::Create( this, ScResId( LB_DATE_TYPE ) ) ),
+ maFtStyle( VclPtr<FixedText>::Create( this, ScResId( FT_STYLE ) ) ),
+ maLbStyle( VclPtr<ListBox>::Create( this, ScResId( LB_STYLE ) ) ),
+ maWdPreview( VclPtr<SvxFontPrevWindow>::Create( this, ScResId( WD_PREVIEW ) ) ),
mbIsInStyleCreate(false)
{
Init();
@@ -1227,41 +1320,55 @@ ScDateFrmtEntry::ScDateFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const
if(pFormat)
{
sal_Int32 nPos = static_cast<sal_Int32>(pFormat->GetDateType());
- maLbDateEntry.SelectEntryPos(nPos);
+ maLbDateEntry->SelectEntryPos(nPos);
OUString aStyleName = pFormat->GetStyleName();
- maLbStyle.SelectEntry(aStyleName);
+ maLbStyle->SelectEntry(aStyleName);
}
StyleSelectHdl(NULL);
}
+ScDateFrmtEntry::~ScDateFrmtEntry()
+{
+ disposeOnce();
+}
+
+void ScDateFrmtEntry::dispose()
+{
+ maLbDateEntry.disposeAndClear();
+ maFtStyle.disposeAndClear();
+ maLbStyle.disposeAndClear();
+ maWdPreview.disposeAndClear();
+ ScCondFrmtEntry::dispose();
+}
+
void ScDateFrmtEntry::Init()
{
- maLbDateEntry.SelectEntryPos(0);
- maLbType.SelectEntryPos(3);
+ maLbDateEntry->SelectEntryPos(0);
+ maLbType->SelectEntryPos(3);
- FillStyleListBox( mpDoc, maLbStyle );
- maLbStyle.SetSelectHdl( LINK( this, ScDateFrmtEntry, StyleSelectHdl ) );
- maLbStyle.SelectEntryPos(1);
+ FillStyleListBox( mpDoc, *maLbStyle.get() );
+ maLbStyle->SetSelectHdl( LINK( this, ScDateFrmtEntry, StyleSelectHdl ) );
+ maLbStyle->SelectEntryPos(1);
}
void ScDateFrmtEntry::SetActive()
{
- maLbDateEntry.Show();
- maFtStyle.Show();
- maWdPreview.Show();
- maLbStyle.Show();
+ maLbDateEntry->Show();
+ maFtStyle->Show();
+ maWdPreview->Show();
+ maLbStyle->Show();
Select();
}
void ScDateFrmtEntry::SetInactive()
{
- maLbDateEntry.Hide();
- maFtStyle.Hide();
- maWdPreview.Hide();
- maLbStyle.Hide();
+ maLbDateEntry->Hide();
+ maFtStyle->Hide();
+ maWdPreview->Hide();
+ maLbStyle->Hide();
Deselect();
}
@@ -1276,16 +1383,16 @@ void ScDateFrmtEntry::Notify( SfxBroadcaster&, const SfxHint& rHint )
if(nHint == SfxStyleSheetHintId::MODIFIED)
{
if(!mbIsInStyleCreate)
- UpdateStyleList(maLbStyle, mpDoc);
+ UpdateStyleList(*maLbStyle.get(), mpDoc);
}
}
ScFormatEntry* ScDateFrmtEntry::GetEntry() const
{
ScCondDateFormatEntry* pNewEntry = new ScCondDateFormatEntry(mpDoc);
- condformat::ScCondFormatDateType eType = static_cast<condformat::ScCondFormatDateType>(maLbDateEntry.GetSelectEntryPos());
+ condformat::ScCondFormatDateType eType = static_cast<condformat::ScCondFormatDateType>(maLbDateEntry->GetSelectEntryPos());
pNewEntry->SetDateType(eType);
- pNewEntry->SetStyleName(maLbStyle.GetSelectEntry());
+ pNewEntry->SetStyleName(maLbStyle->GetSelectEntry());
return pNewEntry;
}
@@ -1297,7 +1404,7 @@ OUString ScDateFrmtEntry::GetExpressionString()
IMPL_LINK_NOARG( ScDateFrmtEntry, StyleSelectHdl )
{
mbIsInStyleCreate = true;
- StyleSelect( maLbStyle, mpDoc, maWdPreview );
+ StyleSelect( *maLbStyle.get(), mpDoc, *maWdPreview.get() );
mbIsInStyleCreate = false;
return 0;
@@ -1306,14 +1413,16 @@ IMPL_LINK_NOARG( ScDateFrmtEntry, StyleSelectHdl )
class ScIconSetFrmtDataEntry : public Control
{
private:
- FixedImage maImgIcon;
- FixedText maFtEntry;
- Edit maEdEntry;
- ListBox maLbEntryType;
+ VclPtr<FixedImage> maImgIcon;
+ VclPtr<FixedText> maFtEntry;
+ VclPtr<Edit> maEdEntry;
+ VclPtr<ListBox> maLbEntryType;
public:
ScIconSetFrmtDataEntry( vcl::Window* pParent, ScIconSetType eType, ScDocument* pDoc,
sal_Int32 i, const ScColorScaleEntry* pEntry = NULL );
+ virtual ~ScIconSetFrmtDataEntry();
+ virtual void dispose() SAL_OVERRIDE;
ScColorScaleEntry* CreateEntry(ScDocument* pDoc, const ScAddress& rPos) const;
@@ -1322,31 +1431,31 @@ class ScIconSetFrmtDataEntry : public Control
ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry( vcl::Window* pParent, ScIconSetType eType, ScDocument* pDoc, sal_Int32 i, const ScColorScaleEntry* pEntry ):
Control( pParent, ScResId( RID_ICON_SET_ENTRY ) ),
- maImgIcon( this, ScResId( IMG_ICON ) ),
- maFtEntry( this, ScResId( FT_ICON_SET_ENTRY_TEXT ) ),
- maEdEntry( this, ScResId( ED_ICON_SET_ENTRY_VALUE ) ),
- maLbEntryType( this, ScResId( LB_ICON_SET_ENTRY_TYPE ) )
+ maImgIcon( VclPtr<FixedImage>::Create( this, ScResId( IMG_ICON ) ) ),
+ maFtEntry( VclPtr<FixedText>::Create( this, ScResId( FT_ICON_SET_ENTRY_TEXT ) ) ),
+ maEdEntry( VclPtr<Edit>::Create( this, ScResId( ED_ICON_SET_ENTRY_VALUE ) ) ),
+ maLbEntryType( VclPtr<ListBox>::Create( this, ScResId( LB_ICON_SET_ENTRY_TYPE ) ) )
{
- maImgIcon.SetImage(Image(ScIconSetFormat::getBitmap(eType, i)));
+ maImgIcon->SetImage(Image(ScIconSetFormat::getBitmap(eType, i)));
if(pEntry)
{
switch(pEntry->GetType())
{
case COLORSCALE_VALUE:
- maLbEntryType.SelectEntryPos(0);
- maEdEntry.SetText(convertNumberToString(pEntry->GetValue(), pDoc));
+ maLbEntryType->SelectEntryPos(0);
+ maEdEntry->SetText(convertNumberToString(pEntry->GetValue(), pDoc));
break;
case COLORSCALE_PERCENTILE:
- maLbEntryType.SelectEntryPos(2);
- maEdEntry.SetText(convertNumberToString(pEntry->GetValue(), pDoc));
+ maLbEntryType->SelectEntryPos(2);
+ maEdEntry->SetText(convertNumberToString(pEntry->GetValue(), pDoc));
break;
case COLORSCALE_PERCENT:
- maLbEntryType.SelectEntryPos(1);
- maEdEntry.SetText(convertNumberToString(pEntry->GetValue(), pDoc));
+ maLbEntryType->SelectEntryPos(1);
+ maEdEntry->SetText(convertNumberToString(pEntry->GetValue(), pDoc));
break;
case COLORSCALE_FORMULA:
- maLbEntryType.SelectEntryPos(3);
- maEdEntry.SetText(pEntry->GetFormula(formula::FormulaGrammar::GRAM_DEFAULT));
+ maLbEntryType->SelectEntryPos(3);
+ maEdEntry->SetText(pEntry->GetFormula(formula::FormulaGrammar::GRAM_DEFAULT));
break;
default:
assert(false);
@@ -1354,15 +1463,29 @@ ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry( vcl::Window* pParent, ScIconSetT
}
else
{
- maLbEntryType.SelectEntryPos(1);
+ maLbEntryType->SelectEntryPos(1);
}
FreeResource();
}
+ScIconSetFrmtDataEntry::~ScIconSetFrmtDataEntry()
+{
+ disposeOnce();
+}
+
+void ScIconSetFrmtDataEntry::dispose()
+{
+ maImgIcon.disposeAndClear();
+ maFtEntry.disposeAndClear();
+ maEdEntry.disposeAndClear();
+ maLbEntryType.disposeAndClear();
+ Control::dispose();
+}
+
ScColorScaleEntry* ScIconSetFrmtDataEntry::CreateEntry(ScDocument* pDoc, const ScAddress& rPos) const
{
- sal_Int32 nPos = maLbEntryType.GetSelectEntryPos();
- OUString aText = maEdEntry.GetText();
+ sal_Int32 nPos = maLbEntryType->GetSelectEntryPos();
+ OUString aText = maEdEntry->GetText();
ScColorScaleEntry* pEntry = new ScColorScaleEntry();
sal_uInt32 nIndex = 0;
@@ -1395,69 +1518,81 @@ ScColorScaleEntry* ScIconSetFrmtDataEntry::CreateEntry(ScDocument* pDoc, const S
void ScIconSetFrmtDataEntry::SetFirstEntry()
{
- maEdEntry.Hide();
- maLbEntryType.Hide();
- maFtEntry.Hide();
- maEdEntry.SetText(OUString("0"));
- maLbEntryType.SelectEntryPos(1);
+ maEdEntry->Hide();
+ maLbEntryType->Hide();
+ maFtEntry->Hide();
+ maEdEntry->SetText(OUString("0"));
+ maLbEntryType->SelectEntryPos(1);
}
ScIconSetFrmtEntry::ScIconSetFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScIconSetFormat* pFormat ):
ScCondFrmtEntry( pParent, pDoc, rPos ),
- maLbColorFormat( this, ScResId( LB_COLOR_FORMAT ) ),
- maLbIconSetType( this, ScResId( LB_ICONSET_TYPE ) )
+ maLbColorFormat( VclPtr<ListBox>::Create( this, ScResId( LB_COLOR_FORMAT ) ) ),
+ maLbIconSetType( VclPtr<ListBox>::Create( this, ScResId( LB_ICONSET_TYPE ) ) )
{
Init();
FreeResource();
- maLbColorFormat.SetSelectHdl( LINK( pParent, ScCondFormatList, ColFormatTypeHdl ) );
+ maLbColorFormat->SetSelectHdl( LINK( pParent, ScCondFormatList, ColFormatTypeHdl ) );
if(pFormat)
{
const ScIconSetFormatData* pIconSetFormatData = pFormat->GetIconSetData();
ScIconSetType eType = pIconSetFormatData->eIconSetType;
sal_Int32 nType = static_cast<sal_Int32>(eType);
- maLbIconSetType.SelectEntryPos(nType);
+ maLbIconSetType->SelectEntryPos(nType);
for(size_t i = 0, n = pIconSetFormatData->maEntries.size();
i < n; ++i)
{
- maEntries.push_back( new ScIconSetFrmtDataEntry( this, eType, pDoc, i, &pIconSetFormatData->maEntries[i] ) );
- Point aPos = maEntries[0].GetPosPixel();
- aPos.Y() += maEntries[0].GetSizePixel().Height() * i * 1.2;
- maEntries[i].SetPosPixel( aPos );
+ maEntries.push_back( VclPtr<ScIconSetFrmtDataEntry>::Create( this, eType, pDoc, i, &pIconSetFormatData->maEntries[i] ) );
+ Point aPos = maEntries[0]->GetPosPixel();
+ aPos.Y() += maEntries[0]->GetSizePixel().Height() * i * 1.2;
+ maEntries[i]->SetPosPixel( aPos );
}
- maEntries.begin()->SetFirstEntry();
+ maEntries[0]->SetFirstEntry();
}
else
IconSetTypeHdl(NULL);
}
+ScIconSetFrmtEntry::~ScIconSetFrmtEntry()
+{
+ disposeOnce();
+}
+
+void ScIconSetFrmtEntry::dispose()
+{
+ maLbColorFormat.disposeAndClear();
+ maLbIconSetType.disposeAndClear();
+ ScCondFrmtEntry::dispose();
+}
+
void ScIconSetFrmtEntry::Init()
{
- maLbColorFormat.SelectEntryPos(3);
- maLbType.SelectEntryPos(0);
- maLbIconSetType.SelectEntryPos(0);
+ maLbColorFormat->SelectEntryPos(3);
+ maLbType->SelectEntryPos(0);
+ maLbIconSetType->SelectEntryPos(0);
- maLbIconSetType.SetSelectHdl( LINK( this, ScIconSetFrmtEntry, IconSetTypeHdl ) );
+ maLbIconSetType->SetSelectHdl( LINK( this, ScIconSetFrmtEntry, IconSetTypeHdl ) );
}
IMPL_LINK_NOARG( ScIconSetFrmtEntry, IconSetTypeHdl )
{
ScIconSetMap* pMap = ScIconSetFormat::getIconSetMap();
- sal_Int32 nPos = maLbIconSetType.GetSelectEntryPos();
+ sal_Int32 nPos = maLbIconSetType->GetSelectEntryPos();
sal_uInt32 nElements = pMap[nPos].nElements;
maEntries.clear();
for(size_t i = 0; i < nElements; ++i)
{
- maEntries.push_back( new ScIconSetFrmtDataEntry( this, static_cast<ScIconSetType>(nPos), mpDoc, i ) );
- Point aPos = maEntries[0].GetPosPixel();
- aPos.Y() += maEntries[0].GetSizePixel().Height() * i * 1.2;
- maEntries[i].SetPosPixel( aPos );
- maEntries[i].Show();
+ maEntries.push_back( VclPtr<ScIconSetFrmtDataEntry>::Create( this, static_cast<ScIconSetType>(nPos), mpDoc, i ) );
+ Point aPos = maEntries[0]->GetPosPixel();
+ aPos.Y() += maEntries[0]->GetSizePixel().Height() * i * 1.2;
+ maEntries[i]->SetPosPixel( aPos );
+ maEntries[i]->Show();
}
- maEntries.begin()->SetFirstEntry();
+ maEntries[0]->SetFirstEntry();
SetHeight();
static_cast<ScCondFormatList*>(GetParent())->RecalcAll();
@@ -1472,12 +1607,12 @@ OUString ScIconSetFrmtEntry::GetExpressionString()
void ScIconSetFrmtEntry::SetActive()
{
- maLbColorFormat.Show();
- maLbIconSetType.Show();
+ maLbColorFormat->Show();
+ maLbIconSetType->Show();
for(ScIconSetFrmtDataEntriesType::iterator itr = maEntries.begin(),
itrEnd = maEntries.end(); itr != itrEnd; ++itr)
{
- itr->Show();
+ (*itr)->Show();
}
Select();
@@ -1485,12 +1620,12 @@ void ScIconSetFrmtEntry::SetActive()
void ScIconSetFrmtEntry::SetInactive()
{
- maLbColorFormat.Hide();
- maLbIconSetType.Hide();
+ maLbColorFormat->Hide();
+ maLbIconSetType->Hide();
for(ScIconSetFrmtDataEntriesType::iterator itr = maEntries.begin(),
itrEnd = maEntries.end(); itr != itrEnd; ++itr)
{
- itr->Hide();
+ (*itr)->Hide();
}
Deselect();
@@ -1501,11 +1636,11 @@ ScFormatEntry* ScIconSetFrmtEntry::GetEntry() const
ScIconSetFormat* pFormat = new ScIconSetFormat(mpDoc);
ScIconSetFormatData* pData = new ScIconSetFormatData;
- pData->eIconSetType = static_cast<ScIconSetType>(maLbIconSetType.GetSelectEntryPos());
+ pData->eIconSetType = static_cast<ScIconSetType>(maLbIconSetType->GetSelectEntryPos());
for(ScIconSetFrmtDataEntriesType::const_iterator itr = maEntries.begin(),
itrEnd = maEntries.end(); itr != itrEnd; ++itr)
{
- pData->maEntries.push_back(itr->CreateEntry(mpDoc, maPos));
+ pData->maEntries.push_back((*itr)->CreateEntry(mpDoc, maPos));
}
pFormat->SetIconSetData(pData);
diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx
index c4c73b5deff7..f018fce02b07 100644
--- a/sc/source/ui/condformat/condformatmgr.cxx
+++ b/sc/source/ui/condformat/condformatmgr.cxx
@@ -120,7 +120,7 @@ ScCondFormatManagerDlg::ScCondFormatManagerDlg(vcl::Window* pParent, ScDocument*
Size aSize(LogicToPixel(Size(290, 220), MAP_APPFONT));
pContainer->set_width_request(aSize.Width());
pContainer->set_height_request(aSize.Height());
- m_pCtrlManager = new ScCondFormatManagerWindow(*pContainer, mpDoc, mpFormatList);
+ m_pCtrlManager = VclPtr<ScCondFormatManagerWindow>::Create(*pContainer, mpDoc, mpFormatList);
get(m_pBtnAdd, "add");
get(m_pBtnRemove, "remove");
get(m_pBtnEdit, "edit");
@@ -133,8 +133,17 @@ ScCondFormatManagerDlg::ScCondFormatManagerDlg(vcl::Window* pParent, ScDocument*
ScCondFormatManagerDlg::~ScCondFormatManagerDlg()
{
- delete m_pCtrlManager;
+ disposeOnce();
+}
+
+void ScCondFormatManagerDlg::dispose()
+{
delete mpFormatList;
+ m_pBtnAdd.clear();
+ m_pBtnRemove.clear();
+ m_pBtnEdit.clear();
+ m_pCtrlManager.disposeAndClear();
+ ModalDialog::dispose();
}
@@ -162,8 +171,8 @@ IMPL_LINK_NOARG(ScCondFormatManagerDlg, EditBtnHdl)
sal_uInt16 nId = 1;
ScModule* pScMod = SC_MOD();
pScMod->SetRefDialog( nId, true );
- boost::scoped_ptr<ScCondFormatDlg> pDlg(new ScCondFormatDlg(this, mpDoc, pFormat, pFormat->GetRange(),
- pFormat->GetRange().GetTopLeftCorner(), condformat::dialog::NONE));
+ VclPtrInstance<ScCondFormatDlg> pDlg(this, mpDoc, pFormat, pFormat->GetRange(),
+ pFormat->GetRange().GetTopLeftCorner(), condformat::dialog::NONE);
Show(false, 0);
if(pDlg->Execute() == RET_OK)
{
@@ -208,8 +217,8 @@ IMPL_LINK_NOARG(ScCondFormatManagerDlg, AddBtnHdl)
sal_uInt16 nId = 1;
ScModule* pScMod = SC_MOD();
pScMod->SetRefDialog( nId, true );
- boost::scoped_ptr<ScCondFormatDlg> pDlg(new ScCondFormatDlg(this, mpDoc, NULL, ScRangeList(),
- maPos, condformat::dialog::CONDITION));
+ VclPtrInstance<ScCondFormatDlg> pDlg(this, mpDoc, nullptr, ScRangeList(),
+ maPos, condformat::dialog::CONDITION);
Show(false, 0);
if(pDlg->Execute() == RET_OK)
{
diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
index c8087b39920f..6858d5df706e 100644
--- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
@@ -184,7 +184,41 @@ ScPivotLayoutDialog::ScPivotLayoutDialog(
}
ScPivotLayoutDialog::~ScPivotLayoutDialog()
-{}
+{
+ disposeOnce();
+}
+
+void ScPivotLayoutDialog::dispose()
+{
+ mpPreviouslyFocusedListBox.clear();
+ mpCurrentlyFocusedListBox.clear();
+ mpListBoxField.clear();
+ mpListBoxPage.clear();
+ mpListBoxColumn.clear();
+ mpListBoxRow.clear();
+ mpListBoxData.clear();
+ mpCheckIgnoreEmptyRows.clear();
+ mpCheckTotalColumns.clear();
+ mpCheckAddFilter.clear();
+ mpCheckIdentifyCategories.clear();
+ mpCheckTotalRows.clear();
+ mpCheckDrillToDetail.clear();
+ mpSourceRadioNamedRange.clear();
+ mpSourceRadioSelection.clear();
+ mpSourceListBox.clear();
+ mpSourceEdit.clear();
+ mpSourceButton.clear();
+ mpDestinationRadioNewSheet.clear();
+ mpDestinationRadioNamedRange.clear();
+ mpDestinationRadioSelection.clear();
+ mpDestinationListBox.clear();
+ mpDestinationEdit.clear();
+ mpDestinationButton.clear();
+ mpBtnOK.clear();
+ mpBtnCancel.clear();
+ mpActiveEdit.clear();
+ ScAnyRefDlg::dispose();
+}
void ScPivotLayoutDialog::SetupSource()
{
@@ -314,7 +348,7 @@ void ScPivotLayoutDialog::SetActive()
if (mbDialogLostFocus)
{
mbDialogLostFocus = false;
- if(mpActiveEdit != NULL)
+ if(mpActiveEdit != nullptr)
{
mpActiveEdit->GrabFocus();
if (mpActiveEdit == mpSourceEdit)
@@ -334,7 +368,7 @@ void ScPivotLayoutDialog::SetReference(const ScRange& rReferenceRange, ScDocumen
if (!mbDialogLostFocus)
return;
- if (mpActiveEdit == NULL)
+ if (mpActiveEdit == nullptr)
return;
if (rReferenceRange.aStart != rReferenceRange.aEnd)
diff --git a/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx b/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx
index e0423626febc..99bb77b0c742 100644
--- a/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx
@@ -28,7 +28,15 @@ ScPivotLayoutTreeListBase::ScPivotLayoutTreeListBase(vcl::Window* pParent, WinBi
}
ScPivotLayoutTreeListBase::~ScPivotLayoutTreeListBase()
-{}
+{
+ disposeOnce();
+}
+
+void ScPivotLayoutTreeListBase::dispose()
+{
+ mpParent.clear();
+ SvTreeListBox::dispose();
+}
void ScPivotLayoutTreeListBase::Setup(ScPivotLayoutDialog* pParent)
{
@@ -126,7 +134,7 @@ void ScPivotLayoutTreeListBase::GetFocus()
if (pEntry)
InsertEntryForSourceTarget(pEntry, NULL);
- if (mpParent->mpPreviouslyFocusedListBox != NULL)
+ if (mpParent->mpPreviouslyFocusedListBox != nullptr)
mpParent->mpPreviouslyFocusedListBox->GrabFocus();
}
diff --git a/sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx b/sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx
index 3644f8444040..3595286c2fda 100644
--- a/sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx
@@ -59,7 +59,7 @@ void ScPivotLayoutTreeListLabel::FillLabelFields(ScDPLabelDataVector& rLabelVect
void ScPivotLayoutTreeListLabel::InsertEntryForSourceTarget(SvTreeListEntry* /*pSource*/, SvTreeListEntry* /*pTarget*/)
{
- if(mpParent->mpPreviouslyFocusedListBox != this)
+ if(mpParent->mpPreviouslyFocusedListBox.get() != this)
mpParent->mpPreviouslyFocusedListBox->RemoveSelection();
}
diff --git a/sc/source/ui/dbgui/consdlg.cxx b/sc/source/ui/dbgui/consdlg.cxx
index a8b6c737d010..1b84ae626154 100644
--- a/sc/source/ui/dbgui/consdlg.cxx
+++ b/sc/source/ui/dbgui/consdlg.cxx
@@ -105,8 +105,31 @@ ScConsolidateDlg::ScConsolidateDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::W
ScConsolidateDlg::~ScConsolidateDlg()
{
+ disposeOnce();
+}
+
+void ScConsolidateDlg::dispose()
+{
delete [] pAreaData;
delete pRangeUtil;
+ pLbFunc.clear();
+ pLbConsAreas.clear();
+ pLbDataArea.clear();
+ pEdDataArea.clear();
+ pRbDataArea.clear();
+ pLbDestArea.clear();
+ pEdDestArea.clear();
+ pRbDestArea.clear();
+ pExpander.clear();
+ pBtnByRow.clear();
+ pBtnByCol.clear();
+ pBtnRefs.clear();
+ pBtnOk.clear();
+ pBtnCancel.clear();
+ pBtnAdd.clear();
+ pBtnRemove.clear();
+ pRefInputEdit.clear();
+ ScAnyRefDlg::dispose();
}
void ScConsolidateDlg::Init()
diff --git a/sc/source/ui/dbgui/csvcontrol.cxx b/sc/source/ui/dbgui/csvcontrol.cxx
index ac0b16c91122..72a437720e3e 100644
--- a/sc/source/ui/dbgui/csvcontrol.cxx
+++ b/sc/source/ui/dbgui/csvcontrol.cxx
@@ -74,8 +74,14 @@ ScCsvControl::ScCsvControl( vcl::Window* pParent, const ScCsvLayoutData& rData,
ScCsvControl::~ScCsvControl()
{
+ disposeOnce();
+}
+
+void ScCsvControl::dispose()
+{
if( mpAccessible )
mpAccessible->dispose();
+ Control::dispose();
}
// event handling -------------------------------------------------------------
diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx
index f99a609ea52a..c0adb89e590d 100644
--- a/sc/source/ui/dbgui/csvgrid.cxx
+++ b/sc/source/ui/dbgui/csvgrid.cxx
@@ -62,6 +62,8 @@ struct Func_Select
ScCsvGrid::ScCsvGrid( ScCsvControl& rParent ) :
ScCsvControl( rParent ),
+ mpBackgrDev( VclPtr<VirtualDevice>::Create() ),
+ mpGridDev( VclPtr<VirtualDevice>::Create() ),
mpColorConfig( 0 ),
mpEditEngine( new ScEditEngineDefaulter( EditEngine::CreatePool(), true ) ),
maHeaderFont( GetFont() ),
@@ -72,7 +74,7 @@ ScCsvGrid::ScCsvGrid( ScCsvControl& rParent ) :
mnMTCurrCol( SAL_MAX_UINT32 ),
mbMTSelecting( false )
{
- mpEditEngine->SetRefDevice( &maBackgrDev );
+ mpEditEngine->SetRefDevice( mpBackgrDev.get() );
mpEditEngine->SetRefMapMode( MapMode( MAP_PIXEL ) );
maEdEngSize = mpEditEngine->GetPaperSize();
@@ -85,9 +87,17 @@ ScCsvGrid::ScCsvGrid( ScCsvControl& rParent ) :
ScCsvGrid::~ScCsvGrid()
{
+ disposeOnce();
+}
+
+void ScCsvGrid::dispose()
+{
OSL_ENSURE(mpColorConfig, "the object hasn't been initialized properly");
if (mpColorConfig)
mpColorConfig->RemoveListener(this);
+ mpBackgrDev.disposeAndClear();
+ mpGridDev.disposeAndClear();
+ ScCsvControl::dispose();
}
void
@@ -257,8 +267,8 @@ void ScCsvGrid::InitFonts()
void ScCsvGrid::InitSizeData()
{
maWinSize = GetSizePixel();
- maBackgrDev.SetOutputSizePixel( maWinSize );
- maGridDev.SetOutputSizePixel( maWinSize );
+ mpBackgrDev->SetOutputSizePixel( maWinSize );
+ mpGridDev->SetOutputSizePixel( maWinSize );
InvalidateGfx();
}
@@ -1015,7 +1025,7 @@ void ScCsvGrid::ImplRedraw()
ImplDrawBackgrDev();
ImplDrawGridDev();
}
- DrawOutDev( Point(), maWinSize, Point(), maWinSize, maGridDev );
+ DrawOutDev( Point(), maWinSize, Point(), maWinSize, *mpGridDev.get() );
ImplDrawTrackingRect( GetFocusColumn() );
}
}
@@ -1072,7 +1082,7 @@ void ScCsvGrid::ImplDrawCellText( const Point& rPos, const OUString& rText )
{
sal_Int32 nX = rPos.X() + GetCharWidth() * nBeginIx;
mpEditEngine->SetText( aToken );
- mpEditEngine->Draw( &maBackgrDev, Point( nX, rPos.Y() ) );
+ mpEditEngine->Draw( mpBackgrDev.get(), Point( nX, rPos.Y() ) );
}
}
@@ -1083,10 +1093,10 @@ void ScCsvGrid::ImplDrawCellText( const Point& rPos, const OUString& rText )
sal_Int32 nX2 = nX1 + GetCharWidth() - 2;
sal_Int32 nY = rPos.Y() + GetLineHeight() / 2;
Color aColor( maTextColor );
- maBackgrDev.SetLineColor( aColor );
- maBackgrDev.DrawLine( Point( nX1, nY ), Point( nX2, nY ) );
- maBackgrDev.DrawLine( Point( nX2 - 2, nY - 2 ), Point( nX2, nY ) );
- maBackgrDev.DrawLine( Point( nX2 - 2, nY + 2 ), Point( nX2, nY ) );
+ mpBackgrDev->SetLineColor( aColor );
+ mpBackgrDev->DrawLine( Point( nX1, nY ), Point( nX2, nY ) );
+ mpBackgrDev->DrawLine( Point( nX2 - 2, nY - 2 ), Point( nX2, nY ) );
+ mpBackgrDev->DrawLine( Point( nX2 - 2, nY + 2 ), Point( nX2, nY ) );
++nCharIx;
}
nCharIx = 0;
@@ -1096,11 +1106,11 @@ void ScCsvGrid::ImplDrawCellText( const Point& rPos, const OUString& rText )
sal_Int32 nX2 = nX1 + GetCharWidth() - 2;
sal_Int32 nY = rPos.Y() + GetLineHeight() / 2;
Color aColor( maTextColor );
- maBackgrDev.SetLineColor( aColor );
- maBackgrDev.DrawLine( Point( nX1, nY ), Point( nX2, nY ) );
- maBackgrDev.DrawLine( Point( nX1 + 2, nY - 2 ), Point( nX1, nY ) );
- maBackgrDev.DrawLine( Point( nX1 + 2, nY + 2 ), Point( nX1, nY ) );
- maBackgrDev.DrawLine( Point( nX2, nY - 2 ), Point( nX2, nY ) );
+ mpBackgrDev->SetLineColor( aColor );
+ mpBackgrDev->DrawLine( Point( nX1, nY ), Point( nX2, nY ) );
+ mpBackgrDev->DrawLine( Point( nX1 + 2, nY - 2 ), Point( nX1, nY ) );
+ mpBackgrDev->DrawLine( Point( nX1 + 2, nY + 2 ), Point( nX1, nY ) );
+ mpBackgrDev->DrawLine( Point( nX2, nY - 2 ), Point( nX2, nY ) );
++nCharIx;
}
}
@@ -1111,8 +1121,8 @@ void ScCsvGrid::ImplDrawFirstLineSep( bool bSet )
{
sal_Int32 nY = GetY( mnFirstImpLine );
sal_Int32 nX = std::min( GetColumnX( GetLastVisColumn() + 1 ), GetLastX() );
- maBackgrDev.SetLineColor( bSet ? maGridPBColor : maGridColor );
- maBackgrDev.DrawLine( Point( GetFirstX() + 1, nY ), Point( nX, nY ) );
+ mpBackgrDev->SetLineColor( bSet ? maGridPBColor : maGridColor );
+ mpBackgrDev->DrawLine( Point( GetFirstX() + 1, nY ), Point( nX, nY ) );
}
}
@@ -1121,20 +1131,20 @@ void ScCsvGrid::ImplDrawColumnBackgr( sal_uInt32 nColIndex )
if( !IsVisibleColumn( nColIndex ) )
return;
- ImplSetColumnClipRegion( maBackgrDev, nColIndex );
+ ImplSetColumnClipRegion( *mpBackgrDev.get(), nColIndex );
// grid
- maBackgrDev.SetLineColor();
- maBackgrDev.SetFillColor( maBackColor );
+ mpBackgrDev->SetLineColor();
+ mpBackgrDev->SetFillColor( maBackColor );
sal_Int32 nX1 = GetColumnX( nColIndex ) + 1;
sal_Int32 nX2 = GetColumnX( nColIndex + 1 );
sal_Int32 nY2 = GetY( GetLastVisLine() + 1 );
sal_Int32 nHdrHt = GetHdrHeight();
Rectangle aRect( nX1, nHdrHt, nX2, nY2 );
- maBackgrDev.DrawRect( aRect );
- maBackgrDev.SetLineColor( maGridColor );
- maBackgrDev.DrawGrid( aRect, Size( 1, GetLineHeight() ), GRID_HORZLINES );
- maBackgrDev.DrawLine( Point( nX2, nHdrHt ), Point( nX2, nY2 ) );
+ mpBackgrDev->DrawRect( aRect );
+ mpBackgrDev->SetLineColor( maGridColor );
+ mpBackgrDev->DrawGrid( aRect, Size( 1, GetLineHeight() ), GRID_HORZLINES );
+ mpBackgrDev->DrawLine( Point( nX2, nHdrHt ), Point( nX2, nY2 ) );
ImplDrawFirstLineSep( true );
// cell texts
@@ -1158,53 +1168,53 @@ void ScCsvGrid::ImplDrawColumnBackgr( sal_uInt32 nColIndex )
}
// header
- ImplDrawColumnHeader( maBackgrDev, nColIndex, maHeaderBackColor );
+ ImplDrawColumnHeader( *mpBackgrDev.get(), nColIndex, maHeaderBackColor );
- maBackgrDev.SetClipRegion();
+ mpBackgrDev->SetClipRegion();
}
void ScCsvGrid::ImplDrawRowHeaders()
{
- maBackgrDev.SetLineColor();
- maBackgrDev.SetFillColor( maAppBackColor );
+ mpBackgrDev->SetLineColor();
+ mpBackgrDev->SetFillColor( maAppBackColor );
Point aPoint( GetHdrX(), 0 );
Rectangle aRect( aPoint, Size( GetHdrWidth() + 1, GetHeight() ) );
- maBackgrDev.DrawRect( aRect );
+ mpBackgrDev->DrawRect( aRect );
- maBackgrDev.SetFillColor( maHeaderBackColor );
+ mpBackgrDev->SetFillColor( maHeaderBackColor );
aRect.Bottom() = GetY( GetLastVisLine() + 1 );
- maBackgrDev.DrawRect( aRect );
+ mpBackgrDev->DrawRect( aRect );
// line numbers
- maBackgrDev.SetFont( maHeaderFont );
- maBackgrDev.SetTextColor( maHeaderTextColor );
- maBackgrDev.SetTextFillColor();
+ mpBackgrDev->SetFont( maHeaderFont );
+ mpBackgrDev->SetTextColor( maHeaderTextColor );
+ mpBackgrDev->SetTextFillColor();
sal_Int32 nLastLine = GetLastVisLine();
for( sal_Int32 nLine = GetFirstVisLine(); nLine <= nLastLine; ++nLine )
{
OUString aText( OUString::number( nLine + 1 ) );
- sal_Int32 nX = GetHdrX() + (GetHdrWidth() - maBackgrDev.GetTextWidth( aText )) / 2;
- maBackgrDev.DrawText( Point( nX, GetY( nLine ) ), aText );
+ sal_Int32 nX = GetHdrX() + (GetHdrWidth() - mpBackgrDev->GetTextWidth( aText )) / 2;
+ mpBackgrDev->DrawText( Point( nX, GetY( nLine ) ), aText );
}
// grid
- maBackgrDev.SetLineColor( maHeaderGridColor );
+ mpBackgrDev->SetLineColor( maHeaderGridColor );
if( IsRTL() )
{
- maBackgrDev.DrawLine( Point( 0, 0 ), Point( 0, GetHeight() - 1 ) );
- maBackgrDev.DrawLine( aRect.TopLeft(), aRect.BottomLeft() );
+ mpBackgrDev->DrawLine( Point( 0, 0 ), Point( 0, GetHeight() - 1 ) );
+ mpBackgrDev->DrawLine( aRect.TopLeft(), aRect.BottomLeft() );
}
else
- maBackgrDev.DrawLine( aRect.TopRight(), aRect.BottomRight() );
+ mpBackgrDev->DrawLine( aRect.TopRight(), aRect.BottomRight() );
aRect.Top() = GetHdrHeight();
- maBackgrDev.DrawGrid( aRect, Size( 1, GetLineHeight() ), GRID_HORZLINES );
+ mpBackgrDev->DrawGrid( aRect, Size( 1, GetLineHeight() ), GRID_HORZLINES );
}
void ScCsvGrid::ImplDrawBackgrDev()
{
- maBackgrDev.SetLineColor();
- maBackgrDev.SetFillColor( maAppBackColor );
- maBackgrDev.DrawRect( Rectangle(
+ mpBackgrDev->SetLineColor();
+ mpBackgrDev->SetFillColor( maAppBackColor );
+ mpBackgrDev->DrawRect( Rectangle(
Point( GetFirstX() + 1, 0 ), Size( GetWidth() - GetHdrWidth(), GetHeight() ) ) );
sal_uInt32 nLastCol = GetLastVisColumn();
@@ -1219,8 +1229,8 @@ void ScCsvGrid::ImplDrawBackgrDev()
void ScCsvGrid::ImplDrawColumnSelection( sal_uInt32 nColIndex )
{
ImplInvertCursor( GetRulerCursorPos() );
- ImplSetColumnClipRegion( maGridDev, nColIndex );
- maGridDev.DrawOutDev( Point(), maWinSize, Point(), maWinSize, maBackgrDev );
+ ImplSetColumnClipRegion( *mpGridDev.get(), nColIndex );
+ mpGridDev->DrawOutDev( Point(), maWinSize, Point(), maWinSize, *mpBackgrDev.get() );
if( IsSelected( nColIndex ) )
{
@@ -1229,29 +1239,29 @@ void ScCsvGrid::ImplDrawColumnSelection( sal_uInt32 nColIndex )
// header
Rectangle aRect( nX1, 0, nX2, GetHdrHeight() );
- maGridDev.SetLineColor();
+ mpGridDev->SetLineColor();
if( maHeaderBackColor.IsDark() )
// redraw with light gray background in dark mode
- ImplDrawColumnHeader( maGridDev, nColIndex, COL_LIGHTGRAY );
+ ImplDrawColumnHeader( *mpGridDev.get(), nColIndex, COL_LIGHTGRAY );
else
{
// use transparent active color
- maGridDev.SetFillColor( maSelectColor );
- maGridDev.DrawTransparent( tools::PolyPolygon( Polygon( aRect ) ), CSV_HDR_TRANSPARENCY );
+ mpGridDev->SetFillColor( maSelectColor );
+ mpGridDev->DrawTransparent( tools::PolyPolygon( Polygon( aRect ) ), CSV_HDR_TRANSPARENCY );
}
// column selection
aRect = Rectangle( nX1, GetHdrHeight() + 1, nX2, GetY( GetLastVisLine() + 1 ) - 1 );
- ImplInvertRect( maGridDev, aRect );
+ ImplInvertRect( *mpGridDev.get(), aRect );
}
- maGridDev.SetClipRegion();
+ mpGridDev->SetClipRegion();
ImplInvertCursor( GetRulerCursorPos() );
}
void ScCsvGrid::ImplDrawGridDev()
{
- maGridDev.DrawOutDev( Point(), maWinSize, Point(), maWinSize, maBackgrDev );
+ mpGridDev->DrawOutDev( Point(), maWinSize, Point(), maWinSize, *mpBackgrDev );
sal_uInt32 nLastCol = GetLastVisColumn();
if (nLastCol == CSV_COLUMN_INVALID)
return;
@@ -1297,12 +1307,12 @@ void ScCsvGrid::ImplDrawHorzScrolled( sal_Int32 nOldPos )
ImplInvertCursor( GetRulerCursorPos() + (nPos - nOldPos) );
Rectangle aRectangle( GetFirstX(), 0, GetLastX(), GetHeight() - 1 );
vcl::Region aClipReg( aRectangle );
- maBackgrDev.SetClipRegion( aClipReg );
- maBackgrDev.CopyArea( aDest, aSrc, maWinSize );
- maBackgrDev.SetClipRegion();
- maGridDev.SetClipRegion( aClipReg );
- maGridDev.CopyArea( aDest, aSrc, maWinSize );
- maGridDev.SetClipRegion();
+ mpBackgrDev->SetClipRegion( aClipReg );
+ mpBackgrDev->CopyArea( aDest, aSrc, maWinSize );
+ mpBackgrDev->SetClipRegion();
+ mpGridDev->SetClipRegion( aClipReg );
+ mpGridDev->CopyArea( aDest, aSrc, maWinSize );
+ mpGridDev->SetClipRegion();
ImplInvertCursor( GetRulerCursorPos() );
for( sal_uInt32 nColIx = nFirstColIx; nColIx <= nLastColIx; ++nColIx )
@@ -1312,12 +1322,12 @@ void ScCsvGrid::ImplDrawHorzScrolled( sal_Int32 nOldPos )
if( nLastX <= GetLastX() )
{
Rectangle aRect( nLastX, 0, GetLastX(), GetHeight() - 1 );
- maBackgrDev.SetLineColor();
- maBackgrDev.SetFillColor( maAppBackColor );
- maBackgrDev.DrawRect( aRect );
- maGridDev.SetLineColor();
- maGridDev.SetFillColor( maAppBackColor );
- maGridDev.DrawRect( aRect );
+ mpBackgrDev->SetLineColor();
+ mpBackgrDev->SetFillColor( maAppBackColor );
+ mpBackgrDev->DrawRect( aRect );
+ mpGridDev->SetLineColor();
+ mpGridDev->SetFillColor( maAppBackColor );
+ mpGridDev->DrawRect( aRect );
}
}
@@ -1327,10 +1337,10 @@ void ScCsvGrid::ImplInvertCursor( sal_Int32 nPos )
{
sal_Int32 nX = GetX( nPos ) - 1;
Rectangle aRect( Point( nX, 0 ), Size( 3, GetHdrHeight() ) );
- ImplInvertRect( maGridDev, aRect );
+ ImplInvertRect( *mpGridDev.get(), aRect );
aRect.Top() = GetHdrHeight() + 1;
aRect.Bottom() = GetY( GetLastVisLine() + 1 );
- ImplInvertRect( maGridDev, aRect );
+ ImplInvertRect( *mpGridDev.get(), aRect );
}
}
diff --git a/sc/source/ui/dbgui/csvruler.cxx b/sc/source/ui/dbgui/csvruler.cxx
index 71a1ce4f4c84..4057831ea94b 100644
--- a/sc/source/ui/dbgui/csvruler.cxx
+++ b/sc/source/ui/dbgui/csvruler.cxx
@@ -93,15 +93,21 @@ ScCsvRuler::ScCsvRuler( ScCsvControl& rParent ) :
EnableRTL( false ); // RTL
InitColors();
InitSizeData();
- maBackgrDev.SetFont( GetFont() );
- maRulerDev.SetFont( GetFont() );
+ maBackgrDev->SetFont( GetFont() );
+ maRulerDev->SetFont( GetFont() );
load_FixedWidthList( maSplits );
}
ScCsvRuler::~ScCsvRuler()
{
+ disposeOnce();
+}
+
+void ScCsvRuler::dispose()
+{
save_FixedWidthList( maSplits );
+ ScCsvControl::dispose();
}
// common ruler handling ------------------------------------------------------
@@ -159,8 +165,8 @@ void ScCsvRuler::InitSizeData()
maActiveRect.SetPos( Point( GetFirstX(), (GetHeight() - nActiveHeight - 1) / 2 ) );
maActiveRect.SetSize( Size( nActiveWidth, nActiveHeight ) );
- maBackgrDev.SetOutputSizePixel( maWinSize );
- maRulerDev.SetOutputSizePixel( maWinSize );
+ maBackgrDev->SetOutputSizePixel( maWinSize );
+ maRulerDev->SetOutputSizePixel( maWinSize );
InvalidateGfx();
}
@@ -527,30 +533,30 @@ void ScCsvRuler::ImplRedraw()
ImplDrawBackgrDev();
ImplDrawRulerDev();
}
- DrawOutDev( Point(), maWinSize, Point(), maWinSize, maRulerDev );
+ DrawOutDev( Point(), maWinSize, Point(), maWinSize, *maRulerDev.get() );
ImplDrawTrackingRect();
}
}
void ScCsvRuler::ImplDrawArea( sal_Int32 nPosX, sal_Int32 nWidth )
{
- maBackgrDev.SetLineColor();
+ maBackgrDev->SetLineColor();
Rectangle aRect( Point( nPosX, 0 ), Size( nWidth, GetHeight() ) );
- maBackgrDev.SetFillColor( maBackColor );
- maBackgrDev.DrawRect( aRect );
+ maBackgrDev->SetFillColor( maBackColor );
+ maBackgrDev->DrawRect( aRect );
aRect = maActiveRect;
aRect.Left() = std::max( GetFirstX(), nPosX );
aRect.Right() = std::min( std::min( GetX( GetPosCount() ), GetLastX() ), nPosX + nWidth - sal_Int32( 1 ) );
if( aRect.Left() <= aRect.Right() )
{
- maBackgrDev.SetFillColor( maActiveColor );
- maBackgrDev.DrawRect( aRect );
+ maBackgrDev->SetFillColor( maActiveColor );
+ maBackgrDev->DrawRect( aRect );
}
- maBackgrDev.SetLineColor( maTextColor );
+ maBackgrDev->SetLineColor( maTextColor );
sal_Int32 nY = GetHeight() - 1;
- maBackgrDev.DrawLine( Point( nPosX, nY ), Point( nPosX + nWidth - 1, nY ) );
+ maBackgrDev->DrawLine( Point( nPosX, nY ), Point( nPosX + nWidth - 1, nY ) );
}
void ScCsvRuler::ImplDrawBackgrDev()
@@ -558,8 +564,8 @@ void ScCsvRuler::ImplDrawBackgrDev()
ImplDrawArea( 0, GetWidth() );
// scale
- maBackgrDev.SetLineColor( maTextColor );
- maBackgrDev.SetFillColor();
+ maBackgrDev->SetLineColor( maTextColor );
+ maBackgrDev->SetFillColor();
sal_Int32 nPos;
sal_Int32 nFirstPos = std::max( GetPosFromX( 0 ) - (sal_Int32)(1L), (sal_Int32)(0L) );
@@ -569,21 +575,21 @@ void ScCsvRuler::ImplDrawBackgrDev()
{
sal_Int32 nX = GetX( nPos );
if( nPos % 5 )
- maBackgrDev.DrawPixel( Point( nX, nY ) );
+ maBackgrDev->DrawPixel( Point( nX, nY ) );
else
- maBackgrDev.DrawLine( Point( nX, nY - 1 ), Point( nX, nY + 1 ) );
+ maBackgrDev->DrawLine( Point( nX, nY - 1 ), Point( nX, nY + 1 ) );
}
// texts
- maBackgrDev.SetTextColor( maTextColor );
- maBackgrDev.SetTextFillColor();
+ maBackgrDev->SetTextColor( maTextColor );
+ maBackgrDev->SetTextFillColor();
for( nPos = ((nFirstPos + 9) / 10) * 10; nPos <= nLastPos; nPos += 10 )
{
OUString aText( OUString::number( nPos ) );
- sal_Int32 nTextWidth = maBackgrDev.GetTextWidth( aText );
+ sal_Int32 nTextWidth = maBackgrDev->GetTextWidth( aText );
sal_Int32 nTextX = GetX( nPos ) - nTextWidth / 2;
ImplDrawArea( nTextX - 1, nTextWidth + 2 );
- maBackgrDev.DrawText( Point( nTextX, maActiveRect.Top() ), aText );
+ maBackgrDev->DrawText( Point( nTextX, maActiveRect.Top() ), aText );
}
}
@@ -593,10 +599,10 @@ void ScCsvRuler::ImplDrawSplit( sal_Int32 nPos )
{
Point aPos( GetX( nPos ) - mnSplitSize / 2, GetHeight() - mnSplitSize - 2 );
Size aSize( mnSplitSize, mnSplitSize );
- maRulerDev.SetLineColor( maTextColor );
- maRulerDev.SetFillColor( maSplitColor );
- maRulerDev.DrawEllipse( Rectangle( aPos, aSize ) );
- maRulerDev.DrawPixel( Point( GetX( nPos ), GetHeight() - 2 ) );
+ maRulerDev->SetLineColor( maTextColor );
+ maRulerDev->SetFillColor( maSplitColor );
+ maRulerDev->DrawEllipse( Rectangle( aPos, aSize ) );
+ maRulerDev->DrawPixel( Point( GetX( nPos ), GetHeight() - 2 ) );
}
}
@@ -607,14 +613,14 @@ void ScCsvRuler::ImplEraseSplit( sal_Int32 nPos )
ImplInvertCursor( GetRulerCursorPos() );
Point aPos( GetX( nPos ) - mnSplitSize / 2, 0 );
Size aSize( mnSplitSize, GetHeight() );
- maRulerDev.DrawOutDev( aPos, aSize, aPos, aSize, maBackgrDev );
+ maRulerDev->DrawOutDev( aPos, aSize, aPos, aSize, *maBackgrDev.get() );
ImplInvertCursor( GetRulerCursorPos() );
}
}
void ScCsvRuler::ImplDrawRulerDev()
{
- maRulerDev.DrawOutDev( Point(), maWinSize, Point(), maWinSize, maBackgrDev );
+ maRulerDev->DrawOutDev( Point(), maWinSize, Point(), maWinSize, *maBackgrDev.get() );
ImplInvertCursor( GetRulerCursorPos() );
sal_uInt32 nFirst = maSplits.LowerBound( GetFirstVisPos() );
@@ -628,7 +634,7 @@ void ScCsvRuler::ImplInvertCursor( sal_Int32 nPos )
{
if( IsVisibleSplitPos( nPos ) )
{
- ImplInvertRect( maRulerDev, Rectangle( Point( GetX( nPos ) - 1, 0 ), Size( 3, GetHeight() - 1 ) ) );
+ ImplInvertRect( *maRulerDev.get(), Rectangle( Point( GetX( nPos ) - 1, 0 ), Size( 3, GetHeight() - 1 ) ) );
if( HasSplit( nPos ) )
ImplDrawSplit( nPos );
}
diff --git a/sc/source/ui/dbgui/csvtablebox.cxx b/sc/source/ui/dbgui/csvtablebox.cxx
index 424bcc0b6dd7..9dab72200314 100644
--- a/sc/source/ui/dbgui/csvtablebox.cxx
+++ b/sc/source/ui/dbgui/csvtablebox.cxx
@@ -25,35 +25,50 @@
ScCsvTableBox::ScCsvTableBox( vcl::Window* pParent, WinBits nBits ) :
ScCsvControl( pParent, maData, nBits ),
- maRuler( *this ),
- maGrid( *this ),
- maHScroll( this, WB_HORZ | WB_DRAG ),
- maVScroll( this, WB_VERT | WB_DRAG ),
- maScrollBox( this )
+ maRuler( VclPtr<ScCsvRuler>::Create(*this) ),
+ maGrid( VclPtr<ScCsvGrid>::Create(*this) ),
+ maHScroll( VclPtr<ScrollBar>::Create( this, WB_HORZ | WB_DRAG ) ),
+ maVScroll( VclPtr<ScrollBar>::Create( this, WB_VERT | WB_DRAG ) ),
+ maScrollBox( VclPtr<ScrollBarBox>::Create(this) )
{
mbFixedMode = false;
mnFixedWidth = 1;
- maHScroll.EnableRTL( false ); // RTL
- maHScroll.SetLineSize( 1 );
- maVScroll.SetLineSize( 1 );
+ maHScroll->EnableRTL( false ); // RTL
+ maHScroll->SetLineSize( 1 );
+ maVScroll->SetLineSize( 1 );
Link aLink = LINK( this, ScCsvTableBox, CsvCmdHdl );
SetCmdHdl( aLink );
- maRuler.SetCmdHdl( aLink );
- maGrid.SetCmdHdl( aLink );
+ maRuler->SetCmdHdl( aLink );
+ maGrid->SetCmdHdl( aLink );
aLink = LINK( this, ScCsvTableBox, ScrollHdl );
- maHScroll.SetScrollHdl( aLink );
- maVScroll.SetScrollHdl( aLink );
+ maHScroll->SetScrollHdl( aLink );
+ maVScroll->SetScrollHdl( aLink );
aLink = LINK( this, ScCsvTableBox, ScrollEndHdl );
- maHScroll.SetEndScrollHdl( aLink );
- maVScroll.SetEndScrollHdl( aLink );
+ maHScroll->SetEndScrollHdl( aLink );
+ maVScroll->SetEndScrollHdl( aLink );
InitControls();
}
+ScCsvTableBox::~ScCsvTableBox()
+{
+ disposeOnce();
+}
+
+void ScCsvTableBox::dispose()
+{
+ maRuler.disposeAndClear();
+ maGrid.disposeAndClear();
+ maHScroll.disposeAndClear();
+ maVScroll.disposeAndClear();
+ maScrollBox.disposeAndClear();
+ ScCsvControl::dispose();
+}
+
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeScCsvTableBox(vcl::Window *pParent, VclBuilder::stringmap &)
{
return new ScCsvTableBox(pParent, WB_BORDER);
@@ -73,7 +88,7 @@ void ScCsvTableBox::SetSeparatorsMode()
{
// rescue data for fixed width mode
mnFixedWidth = GetPosCount();
- maFixColStates = maGrid.GetColumnStates();
+ maFixColStates = maGrid->GetColumnStates();
// switch to separators mode
mbFixedMode = false;
// reset and reinitialize controls
@@ -81,7 +96,7 @@ void ScCsvTableBox::SetSeparatorsMode()
Execute( CSVCMD_SETLINEOFFSET, 0 );
Execute( CSVCMD_SETPOSCOUNT, 1 );
Execute( CSVCMD_NEWCELLTEXTS );
- maGrid.SetColumnStates( maSepColStates );
+ maGrid->SetColumnStates( maSepColStates );
InitControls();
EnableRepaint();
}
@@ -92,15 +107,15 @@ void ScCsvTableBox::SetFixedWidthMode()
if( !mbFixedMode )
{
// rescue data for separators mode
- maSepColStates = maGrid.GetColumnStates();
+ maSepColStates = maGrid->GetColumnStates();
// switch to fixed width mode
mbFixedMode = true;
// reset and reinitialize controls
DisableRepaint();
Execute( CSVCMD_SETLINEOFFSET, 0 );
Execute( CSVCMD_SETPOSCOUNT, mnFixedWidth );
- maGrid.SetSplits( maRuler.GetSplits() );
- maGrid.SetColumnStates( maFixColStates );
+ maGrid->SetSplits( maRuler->GetSplits() );
+ maGrid->SetColumnStates( maFixColStates );
InitControls();
EnableRepaint();
}
@@ -108,12 +123,12 @@ void ScCsvTableBox::SetFixedWidthMode()
void ScCsvTableBox::Init()
{
- maGrid.Init();
+ maGrid->Init();
}
void ScCsvTableBox::InitControls()
{
- maGrid.UpdateLayoutData();
+ maGrid->UpdateLayoutData();
long nScrollBarSize = GetSettings().GetStyleSettings().GetScrollBarSize();
Size aWinSize = CalcOutputSize( GetSizePixel() );
@@ -126,30 +141,30 @@ void ScCsvTableBox::InitControls()
if( mbFixedMode )
{
// ruler sets height internally
- maRuler.setPosSizePixel( 0, 0, nDataWidth, 0 );
- sal_Int32 nY = maRuler.GetSizePixel().Height();
+ maRuler->setPosSizePixel( 0, 0, nDataWidth, 0 );
+ sal_Int32 nY = maRuler->GetSizePixel().Height();
maData.mnWinHeight -= nY;
- maGrid.setPosSizePixel( 0, nY, nDataWidth, maData.mnWinHeight );
+ maGrid->setPosSizePixel( 0, nY, nDataWidth, maData.mnWinHeight );
}
else
- maGrid.setPosSizePixel( 0, 0, nDataWidth, nDataHeight );
- maGrid.Show();
- maRuler.Show( mbFixedMode );
+ maGrid->setPosSizePixel( 0, 0, nDataWidth, nDataHeight );
+ maGrid->Show();
+ maRuler->Show( mbFixedMode );
// scrollbars always visible
- maHScroll.setPosSizePixel( 0, nDataHeight, nDataWidth, nScrollBarSize );
+ maHScroll->setPosSizePixel( 0, nDataHeight, nDataWidth, nScrollBarSize );
InitHScrollBar();
- maHScroll.Show();
+ maHScroll->Show();
// scrollbars always visible
- maVScroll.setPosSizePixel( nDataWidth, 0, nScrollBarSize, nDataHeight );
+ maVScroll->setPosSizePixel( nDataWidth, 0, nScrollBarSize, nDataHeight );
InitVScrollBar();
- maVScroll.Show();
+ maVScroll->Show();
- bool bScrBox = maHScroll.IsVisible() && maVScroll.IsVisible();
+ bool bScrBox = maHScroll->IsVisible() && maVScroll->IsVisible();
if( bScrBox )
- maScrollBox.setPosSizePixel( nDataWidth, nDataHeight, nScrollBarSize, nScrollBarSize );
- maScrollBox.Show( bScrBox );
+ maScrollBox->setPosSizePixel( nDataWidth, nDataHeight, nScrollBarSize, nScrollBarSize );
+ maScrollBox->Show( bScrBox );
// let the controls self-adjust to visible area
Execute( CSVCMD_SETPOSOFFSET, GetFirstVisPos() );
@@ -158,18 +173,18 @@ void ScCsvTableBox::InitControls()
void ScCsvTableBox::InitHScrollBar()
{
- maHScroll.SetRange( Range( 0, GetPosCount() + 2 ) );
- maHScroll.SetVisibleSize( GetVisPosCount() );
- maHScroll.SetPageSize( GetVisPosCount() * 3 / 4 );
- maHScroll.SetThumbPos( GetFirstVisPos() );
+ maHScroll->SetRange( Range( 0, GetPosCount() + 2 ) );
+ maHScroll->SetVisibleSize( GetVisPosCount() );
+ maHScroll->SetPageSize( GetVisPosCount() * 3 / 4 );
+ maHScroll->SetThumbPos( GetFirstVisPos() );
}
void ScCsvTableBox::InitVScrollBar()
{
- maVScroll.SetRange( Range( 0, GetLineCount() + 1 ) );
- maVScroll.SetVisibleSize( GetVisLineCount() );
- maVScroll.SetPageSize( GetVisLineCount() - 2 );
- maVScroll.SetThumbPos( GetFirstVisLine() );
+ maVScroll->SetRange( Range( 0, GetLineCount() + 1 ) );
+ maVScroll->SetVisibleSize( GetVisLineCount() );
+ maVScroll->SetPageSize( GetVisLineCount() - 2 );
+ maVScroll->SetThumbPos( GetFirstVisLine() );
}
void ScCsvTableBox::MakePosVisible( sal_Int32 nPos )
@@ -197,9 +212,9 @@ void ScCsvTableBox::SetUniStrings(
for( sal_Int32 nLine = GetFirstVisLine(); nLine < nEndLine; ++nLine, ++pString )
{
if( mbFixedMode )
- maGrid.ImplSetTextLineFix( nLine, *pString );
+ maGrid->ImplSetTextLineFix( nLine, *pString );
else
- maGrid.ImplSetTextLineSep( nLine, *pString, rSepChars, cTextSep, bMergeSep );
+ maGrid->ImplSetTextLineSep( nLine, *pString, rSepChars, cTextSep, bMergeSep );
}
EnableRepaint();
}
@@ -212,15 +227,15 @@ void ScCsvTableBox::InitTypes( const ListBox& rListBox )
StringVec aTypeNames( nTypeCount );
for( sal_uInt16 nIndex = 0; nIndex < nTypeCount; ++nIndex )
aTypeNames[ nIndex ] = rListBox.GetEntry( nIndex );
- maGrid.SetTypeNames( aTypeNames );
+ maGrid->SetTypeNames( aTypeNames );
}
void ScCsvTableBox::FillColumnData( ScAsciiOptions& rOptions ) const
{
if( mbFixedMode )
- maGrid.FillColumnDataFix( rOptions );
+ maGrid->FillColumnDataFix( rOptions );
else
- maGrid.FillColumnDataSep( rOptions );
+ maGrid->FillColumnDataSep( rOptions );
}
// event handling -------------------------------------------------------------
@@ -253,8 +268,8 @@ IMPL_LINK( ScCsvTableBox, CsvCmdHdl, ScCsvControl*, pCtrl )
case CSVCMD_REPAINT:
if( !IsNoRepaint() )
{
- maGrid.ImplRedraw();
- maRuler.ImplRedraw();
+ maGrid->ImplRedraw();
+ maRuler->ImplRedraw();
InitHScrollBar();
InitVScrollBar();
}
@@ -269,12 +284,12 @@ IMPL_LINK( ScCsvTableBox, CsvCmdHdl, ScCsvControl*, pCtrl )
else
{
DisableRepaint();
- ScCsvColStateVec aStates( maGrid.GetColumnStates() );
+ ScCsvColStateVec aStates( maGrid->GetColumnStates() );
sal_Int32 nPos = GetFirstVisPos();
Execute( CSVCMD_SETPOSCOUNT, 1 );
Execute( CSVCMD_UPDATECELLTEXTS );
Execute( CSVCMD_SETPOSOFFSET, nPos );
- maGrid.SetColumnStates( aStates );
+ maGrid->SetColumnStates( aStates );
EnableRepaint();
}
break;
@@ -282,40 +297,40 @@ IMPL_LINK( ScCsvTableBox, CsvCmdHdl, ScCsvControl*, pCtrl )
maUpdateTextHdl.Call( this );
break;
case CSVCMD_SETCOLUMNTYPE:
- maGrid.SetSelColumnType( nParam1 );
+ maGrid->SetSelColumnType( nParam1 );
break;
case CSVCMD_EXPORTCOLUMNTYPE:
maColTypeHdl.Call( this );
break;
case CSVCMD_SETFIRSTIMPORTLINE:
- maGrid.SetFirstImportedLine( nParam1 );
+ maGrid->SetFirstImportedLine( nParam1 );
break;
case CSVCMD_INSERTSPLIT:
OSL_ENSURE( mbFixedMode, "ScCsvTableBox::CsvCmdHdl::InsertSplit - invalid call" );
- if( maRuler.GetSplitCount() + 1 < sal::static_int_cast<sal_uInt32>(CSV_MAXCOLCOUNT) )
+ if( maRuler->GetSplitCount() + 1 < sal::static_int_cast<sal_uInt32>(CSV_MAXCOLCOUNT) )
{
- maRuler.InsertSplit( nParam1 );
- maGrid.InsertSplit( nParam1 );
+ maRuler->InsertSplit( nParam1 );
+ maGrid->InsertSplit( nParam1 );
}
break;
case CSVCMD_REMOVESPLIT:
OSL_ENSURE( mbFixedMode, "ScCsvTableBox::CsvCmdHdl::RemoveSplit - invalid call" );
- maRuler.RemoveSplit( nParam1 );
- maGrid.RemoveSplit( nParam1 );
+ maRuler->RemoveSplit( nParam1 );
+ maGrid->RemoveSplit( nParam1 );
break;
case CSVCMD_TOGGLESPLIT:
- Execute( maRuler.HasSplit( nParam1 ) ? CSVCMD_REMOVESPLIT : CSVCMD_INSERTSPLIT, nParam1 );
+ Execute( maRuler->HasSplit( nParam1 ) ? CSVCMD_REMOVESPLIT : CSVCMD_INSERTSPLIT, nParam1 );
break;
case CSVCMD_MOVESPLIT:
OSL_ENSURE( mbFixedMode, "ScCsvTableBox::CsvCmdHdl::MoveSplit - invalid call" );
- maRuler.MoveSplit( nParam1, nParam2 );
- maGrid.MoveSplit( nParam1, nParam2 );
+ maRuler->MoveSplit( nParam1, nParam2 );
+ maGrid->MoveSplit( nParam1, nParam2 );
break;
case CSVCMD_REMOVEALLSPLITS:
OSL_ENSURE( mbFixedMode, "ScCsvTableBox::CsvCmdHdl::RemoveAllSplits - invalid call" );
- maRuler.RemoveAllSplits();
- maGrid.RemoveAllSplits();
+ maRuler->RemoveAllSplits();
+ maGrid->RemoveAllSplits();
break;
default:
bFound = false;
@@ -371,8 +386,8 @@ IMPL_LINK( ScCsvTableBox, CsvCmdHdl, ScCsvControl*, pCtrl )
if( maData != aOldData )
{
DisableRepaint();
- maRuler.ApplyLayout( aOldData );
- maGrid.ApplyLayout( aOldData );
+ maRuler->ApplyLayout( aOldData );
+ maGrid->ApplyLayout( aOldData );
EnableRepaint();
}
@@ -383,9 +398,9 @@ IMPL_LINK( ScCsvTableBox, ScrollHdl, ScrollBar*, pScrollBar )
{
OSL_ENSURE( pScrollBar, "ScCsvTableBox::ScrollHdl - missing sender" );
- if( pScrollBar == &maHScroll )
+ if( pScrollBar == maHScroll.get() )
Execute( CSVCMD_SETPOSOFFSET, pScrollBar->GetThumbPos() );
- else if( pScrollBar == &maVScroll )
+ else if( pScrollBar == maVScroll.get() )
Execute( CSVCMD_SETLINEOFFSET, pScrollBar->GetThumbPos() );
return 0;
@@ -395,12 +410,12 @@ IMPL_LINK( ScCsvTableBox, ScrollEndHdl, ScrollBar*, pScrollBar )
{
OSL_ENSURE( pScrollBar, "ScCsvTableBox::ScrollEndHdl - missing sender" );
- if( pScrollBar == &maHScroll )
+ if( pScrollBar == maHScroll.get() )
{
if( GetRulerCursorPos() != CSV_POS_INVALID )
- Execute( CSVCMD_MOVERULERCURSOR, maRuler.GetNoScrollPos( GetRulerCursorPos() ) );
+ Execute( CSVCMD_MOVERULERCURSOR, maRuler->GetNoScrollPos( GetRulerCursorPos() ) );
if( GetGridCursorPos() != CSV_POS_INVALID )
- Execute( CSVCMD_MOVEGRIDCURSOR, maGrid.GetNoScrollCol( GetGridCursorPos() ) );
+ Execute( CSVCMD_MOVEGRIDCURSOR, maGrid->GetNoScrollCol( GetGridCursorPos() ) );
}
return 0;
diff --git a/sc/source/ui/dbgui/dapidata.cxx b/sc/source/ui/dbgui/dapidata.cxx
index 5cf72605ee55..dd39bf05d290 100644
--- a/sc/source/ui/dbgui/dapidata.cxx
+++ b/sc/source/ui/dbgui/dapidata.cxx
@@ -82,6 +82,19 @@ ScDataPilotDatabaseDlg::ScDataPilotDatabaseDlg( vcl::Window* pParent ) :
m_pLbType->SetSelectHdl( LINK( this, ScDataPilotDatabaseDlg, SelectHdl ) );
}
+ScDataPilotDatabaseDlg::~ScDataPilotDatabaseDlg()
+{
+ disposeOnce();
+}
+
+void ScDataPilotDatabaseDlg::dispose()
+{
+ m_pLbDatabase.clear();
+ m_pCbObject.clear();
+ m_pLbType.clear();
+ ModalDialog::dispose();
+}
+
void ScDataPilotDatabaseDlg::GetValues( ScImportSourceDesc& rDesc )
{
sal_uInt16 nSelect = m_pLbType->GetSelectEntryPos();
diff --git a/sc/source/ui/dbgui/dapitype.cxx b/sc/source/ui/dbgui/dapitype.cxx
index f32ce2bf0ad1..35407ade36b8 100644
--- a/sc/source/ui/dbgui/dapitype.cxx
+++ b/sc/source/ui/dbgui/dapitype.cxx
@@ -53,6 +53,17 @@ ScDataPilotSourceTypeDlg::ScDataPilotSourceTypeDlg(vcl::Window* pParent, bool bE
ScDataPilotSourceTypeDlg::~ScDataPilotSourceTypeDlg()
{
+ disposeOnce();
+}
+
+void ScDataPilotSourceTypeDlg::dispose()
+{
+ m_pBtnSelection.clear();
+ m_pBtnNamedRange.clear();
+ m_pBtnDatabase.clear();
+ m_pBtnExternal.clear();
+ m_pLbNamedRange.clear();
+ ModalDialog::dispose();
}
bool ScDataPilotSourceTypeDlg::IsDatabase() const
@@ -115,8 +126,20 @@ ScDataPilotServiceDlg::ScDataPilotServiceDlg( vcl::Window* pParent,
ScDataPilotServiceDlg::~ScDataPilotServiceDlg()
{
+ disposeOnce();
}
+void ScDataPilotServiceDlg::dispose()
+{
+ m_pLbService.clear();
+ m_pEdSource.clear();
+ m_pEdName.clear();
+ m_pEdUser.clear();
+ m_pEdPasswd.clear();
+ ModalDialog::dispose();
+}
+
+
OUString ScDataPilotServiceDlg::GetServiceName() const
{
return m_pLbService->GetSelectEntry();
diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx
index fef3575368ba..7df39d8335b2 100644
--- a/sc/source/ui/dbgui/dbnamdlg.cxx
+++ b/sc/source/ui/dbgui/dbnamdlg.cxx
@@ -158,7 +158,28 @@ ScDbNameDlg::ScDbNameDlg(SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pPar
ScDbNameDlg::~ScDbNameDlg()
{
+ disposeOnce();
+}
+
+void ScDbNameDlg::dispose()
+{
DELETEZ( pSaveObj );
+ m_pEdName.clear();
+ m_pAssignFrame.clear();
+ m_pEdAssign.clear();
+ m_pRbAssign.clear();
+ m_pOptions.clear();
+ m_pBtnHeader.clear();
+ m_pBtnDoSize.clear();
+ m_pBtnKeepFmt.clear();
+ m_pBtnStripData.clear();
+ m_pFTSource.clear();
+ m_pFTOperations.clear();
+ m_pBtnOk.clear();
+ m_pBtnCancel.clear();
+ m_pBtnAdd.clear();
+ m_pBtnRemove.clear();
+ ScAnyRefDlg::dispose();
}
void ScDbNameDlg::Init()
@@ -498,9 +519,9 @@ IMPL_LINK_NOARG(ScDbNameDlg, RemoveBtnHdl)
aBuf.append(aStrDelMsg.getToken(0, '#'));
aBuf.append(aStrEntry);
aBuf.append(aStrDelMsg.getToken(1, '#'));
- QueryBox aBox(this, WinBits(WB_YES_NO|WB_DEF_YES), aBuf.makeStringAndClear());
+ ScopedVclPtrInstance< QueryBox > aBox(this, WinBits(WB_YES_NO|WB_DEF_YES), aBuf.makeStringAndClear());
- if (RET_YES == aBox.Execute())
+ if (RET_YES == aBox->Execute())
{
SCTAB nTab;
SCCOL nColStart, nColEnd;
diff --git a/sc/source/ui/dbgui/dpgroupdlg.cxx b/sc/source/ui/dbgui/dpgroupdlg.cxx
index 17493333b5fb..7bbb0fd80985 100644
--- a/sc/source/ui/dbgui/dpgroupdlg.cxx
+++ b/sc/source/ui/dbgui/dpgroupdlg.cxx
@@ -173,6 +173,24 @@ ScDPNumGroupDlg::ScDPNumGroupDlg( vcl::Window* pParent, const ScDPNumGroupInfo&
mpEdBy->GrabFocus();
}
+ScDPNumGroupDlg::~ScDPNumGroupDlg()
+{
+ disposeOnce();
+}
+
+void ScDPNumGroupDlg::dispose()
+{
+ mpRbAutoStart.clear();
+ mpRbManStart.clear();
+ mpEdStart.clear();
+ mpRbAutoEnd.clear();
+ mpRbManEnd.clear();
+ mpEdEnd.clear();
+ mpEdBy.clear();
+ ModalDialog::dispose();
+}
+
+
ScDPNumGroupInfo ScDPNumGroupDlg::GetGroupInfo() const
{
ScDPNumGroupInfo aInfo;
@@ -259,6 +277,27 @@ ScDPDateGroupDlg::ScDPDateGroupDlg( vcl::Window* pParent,
mpLbUnits->SetCheckButtonHdl( LINK( this, ScDPDateGroupDlg, CheckHdl ) );
}
+ScDPDateGroupDlg::~ScDPDateGroupDlg()
+{
+ disposeOnce();
+}
+
+void ScDPDateGroupDlg::dispose()
+{
+ mpRbAutoStart.clear();
+ mpRbManStart.clear();
+ mpEdStart.clear();
+ mpRbAutoEnd.clear();
+ mpRbManEnd.clear();
+ mpEdEnd.clear();
+ mpRbNumDays.clear();
+ mpRbUnits.clear();
+ mpEdNumDays.clear();
+ mpLbUnits.clear();
+ mpBtnOk.clear();
+ ModalDialog::dispose();
+}
+
ScDPNumGroupInfo ScDPDateGroupDlg::GetGroupInfo() const
{
ScDPNumGroupInfo aInfo;
diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx
index 5de6d53668fd..e3584d570015 100644
--- a/sc/source/ui/dbgui/filtdlg.cxx
+++ b/sc/source/ui/dbgui/filtdlg.cxx
@@ -160,12 +160,50 @@ ScFilterDlg::ScFilterDlg(SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pPar
ScFilterDlg::~ScFilterDlg()
{
+ disposeOnce();
+}
+
+void ScFilterDlg::dispose()
+{
delete pOptionsMgr;
delete pOutItem;
// Hack: RefInput control
pTimer->Stop();
delete pTimer;
+
+ pLbConnect1.clear();
+ pLbField1.clear();
+ pLbCond1.clear();
+ pEdVal1.clear();
+ pLbConnect2.clear();
+ pLbField2.clear();
+ pLbCond2.clear();
+ pEdVal2.clear();
+ pLbConnect3.clear();
+ pLbField3.clear();
+ pLbCond3.clear();
+ pEdVal3.clear();
+ pLbConnect4.clear();
+ pLbField4.clear();
+ pLbCond4.clear();
+ pEdVal4.clear();
+ pScrollBar.clear();
+ pExpander.clear();
+ pBtnOk.clear();
+ pBtnCancel.clear();
+ pBtnCase.clear();
+ pBtnRegExp.clear();
+ pBtnHeader.clear();
+ pBtnUnique.clear();
+ pBtnCopyResult.clear();
+ pLbCopyArea.clear();
+ pEdCopyArea.clear();
+ pRbCopyArea.clear();
+ pBtnDestPers.clear();
+ pFtDbAreaLabel.clear();
+ pFtDbArea.clear();
+ ScAnyRefDlg::dispose();
}
void ScFilterDlg::Init( const SfxItemSet& rArgSet )
diff --git a/sc/source/ui/dbgui/pfiltdlg.cxx b/sc/source/ui/dbgui/pfiltdlg.cxx
index 096c9c2e17dd..18f2072731e2 100644
--- a/sc/source/ui/dbgui/pfiltdlg.cxx
+++ b/sc/source/ui/dbgui/pfiltdlg.cxx
@@ -83,10 +83,34 @@ ScPivotFilterDlg::ScPivotFilterDlg(vcl::Window* pParent, const SfxItemSet& rArgS
ScPivotFilterDlg::~ScPivotFilterDlg()
{
+ disposeOnce();
+}
+
+void ScPivotFilterDlg::dispose()
+{
for (sal_uInt16 i=0; i<=MAXCOL; i++)
delete pEntryLists[i];
delete pOutItem;
+ m_pLbField1.clear();
+ m_pLbCond1.clear();
+ m_pEdVal1.clear();
+ m_pLbConnect1.clear();
+ m_pLbField2.clear();
+ m_pLbCond2.clear();
+ m_pEdVal2.clear();
+ m_pLbConnect2.clear();
+ m_pLbField3.clear();
+ m_pLbCond3.clear();
+ m_pEdVal3.clear();
+ m_pBtnCase.clear();
+ m_pBtnRegExp.clear();
+ m_pBtnUnique.clear();
+ m_pFtDbArea.clear();
+ for (auto a : aValueEdArr) a.clear();
+ for (auto a : aFieldLbArr) a.clear();
+ for (auto a : aCondLbArr) a.clear();
+ ModalDialog::dispose();
}
void ScPivotFilterDlg::Init( const SfxItemSet& rArgSet )
diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx
index 3f55a4be76d9..4cc9de6ed1b0 100644
--- a/sc/source/ui/dbgui/pvfundlg.cxx
+++ b/sc/source/ui/dbgui/pvfundlg.cxx
@@ -214,6 +214,25 @@ ScDPFunctionDlg::ScDPFunctionDlg(
Init( rLabelData, rFuncData );
}
+ScDPFunctionDlg::~ScDPFunctionDlg()
+{
+ disposeOnce();
+}
+
+void ScDPFunctionDlg::dispose()
+{
+ mpLbFunc.clear();
+ mpFtName.clear();
+ mpLbType.clear();
+ mpFtBaseField.clear();
+ mpLbBaseField.clear();
+ mpFtBaseItem.clear();
+ mpLbBaseItem.clear();
+ mpBtnOk.clear();
+ ModalDialog::dispose();
+}
+
+
sal_uInt16 ScDPFunctionDlg::GetFuncMask() const
{
return mpLbFunc->GetSelection();
@@ -431,6 +450,24 @@ ScDPSubtotalDlg::ScDPSubtotalDlg( vcl::Window* pParent, ScDPObject& rDPObj,
Init( rLabelData, rFuncData );
}
+ScDPSubtotalDlg::~ScDPSubtotalDlg()
+{
+ disposeOnce();
+}
+
+void ScDPSubtotalDlg::dispose()
+{
+ mpRbNone.clear();
+ mpRbAuto.clear();
+ mpRbUser.clear();
+ mpLbFunc.clear();
+ mpFtName.clear();
+ mpCbShowAll.clear();
+ mpBtnOk.clear();
+ mpBtnOptions.clear();
+ ModalDialog::dispose();
+}
+
sal_uInt16 ScDPSubtotalDlg::GetFuncMask() const
{
sal_uInt16 nFuncMask = PIVOT_FUNC_NONE;
@@ -502,7 +539,7 @@ IMPL_LINK( ScDPSubtotalDlg, ClickHdl, PushButton*, pBtn )
{
if (pBtn == mpBtnOptions)
{
- boost::scoped_ptr<ScDPSubtotalOptDlg> pDlg(new ScDPSubtotalOptDlg( this, mrDPObj, maLabelData, mrDataFields, mbEnableLayout ));
+ VclPtrInstance< ScDPSubtotalOptDlg > pDlg( this, mrDPObj, maLabelData, mrDataFields, mbEnableLayout );
if( pDlg->Execute() == RET_OK )
pDlg->FillLabelData( maLabelData );
}
@@ -545,6 +582,35 @@ ScDPSubtotalOptDlg::ScDPSubtotalOptDlg( vcl::Window* pParent, ScDPObject& rDPObj
Init( rDataFields, bEnableLayout );
}
+ScDPSubtotalOptDlg::~ScDPSubtotalOptDlg()
+{
+ disposeOnce();
+}
+
+void ScDPSubtotalOptDlg::dispose()
+{
+ m_pLbSortBy.clear();
+ m_pRbSortAsc.clear();
+ m_pRbSortDesc.clear();
+ m_pRbSortMan.clear();
+ m_pLayoutFrame.clear();
+ m_pLbLayout.clear();
+ m_pCbLayoutEmpty.clear();
+ m_pCbRepeatItemLabels.clear();
+ m_pCbShow.clear();
+ m_pNfShow.clear();
+ m_pFtShow.clear();
+ m_pFtShowFrom.clear();
+ m_pLbShowFrom.clear();
+ m_pFtShowUsing.clear();
+ m_pLbShowUsing.clear();
+ m_pHideFrame.clear();
+ m_pLbHide.clear();
+ m_pFtHierarchy.clear();
+ m_pLbHierarchy.clear();
+ ModalDialog::dispose();
+}
+
void ScDPSubtotalOptDlg::FillLabelData( ScDPLabelData& rLabelData ) const
{
// *** SORTING ***
@@ -798,6 +864,18 @@ ScDPShowDetailDlg::ScDPShowDetailDlg( vcl::Window* pParent, ScDPObject& rDPObj,
mpLbDims->SetDoubleClickHdl( LINK( this, ScDPShowDetailDlg, DblClickHdl ) );
}
+ScDPShowDetailDlg::~ScDPShowDetailDlg()
+{
+ disposeOnce();
+}
+
+void ScDPShowDetailDlg::dispose()
+{
+ mpLbDims.clear();
+ mpBtnOk.clear();
+ ModalDialog::dispose();
+}
+
short ScDPShowDetailDlg::Execute()
{
return mpLbDims->GetEntryCount() ? ModalDialog::Execute() : static_cast<short>(RET_CANCEL);
diff --git a/sc/source/ui/dbgui/scendlg.cxx b/sc/source/ui/dbgui/scendlg.cxx
index cd2b3a750fde..bbe8b6c4e5e5 100644
--- a/sc/source/ui/dbgui/scendlg.cxx
+++ b/sc/source/ui/dbgui/scendlg.cxx
@@ -108,6 +108,24 @@ ScNewScenarioDlg::ScNewScenarioDlg( vcl::Window* pParent, const OUString& rName,
m_pCbProtect->Enable(false);
}
+ScNewScenarioDlg::~ScNewScenarioDlg()
+{
+ disposeOnce();
+}
+
+void ScNewScenarioDlg::dispose()
+{
+ m_pEdName.clear();
+ m_pEdComment.clear();
+ m_pCbShowFrame.clear();
+ m_pLbColor.clear();
+ m_pCbTwoWay.clear();
+ m_pCbCopyAll.clear();
+ m_pCbProtect.clear();
+ m_pBtnOk.clear();
+ ModalDialog::dispose();
+}
+
void ScNewScenarioDlg::GetScenarioData( OUString& rName, OUString& rComment,
Color& rColor, sal_uInt16& rFlags ) const
{
diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx
index a3b73879b266..1ac8ca860e35 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -464,7 +464,35 @@ ScImportAsciiDlg::ScImportAsciiDlg( vcl::Window* pParent, const OUString& aDatNa
ScImportAsciiDlg::~ScImportAsciiDlg()
{
+ disposeOnce();
+}
+
+void ScImportAsciiDlg::dispose()
+{
delete[] mpRowPosArray;
+ pFtCharSet.clear();
+ pLbCharSet.clear();
+ pFtCustomLang.clear();
+ pLbCustomLang.clear();
+ pFtRow.clear();
+ pNfRow.clear();
+ pRbFixed.clear();
+ pRbSeparated.clear();
+ pCkbTab.clear();
+ pCkbSemicolon.clear();
+ pCkbComma.clear();
+ pCkbSpace.clear();
+ pCkbOther.clear();
+ pEdOther.clear();
+ pCkbAsOnce.clear();
+ pFtTextSep.clear();
+ pCbTextSep.clear();
+ pCkbQuotedAsText.clear();
+ pCkbDetectNumber.clear();
+ pFtType.clear();
+ pLbType.clear();
+ mpTableBox.clear();
+ ModalDialog::dispose();
}
bool ScImportAsciiDlg::GetLine( sal_uLong nLine, OUString &rText )
diff --git a/sc/source/ui/dbgui/scuiimoptdlg.cxx b/sc/source/ui/dbgui/scuiimoptdlg.cxx
index 4079b60c39cc..a1c1e487b530 100644
--- a/sc/source/ui/dbgui/scuiimoptdlg.cxx
+++ b/sc/source/ui/dbgui/scuiimoptdlg.cxx
@@ -239,8 +239,26 @@ ScImportOptionsDlg::ScImportOptionsDlg(
ScImportOptionsDlg::~ScImportOptionsDlg()
{
+ disposeOnce();
+}
+
+void ScImportOptionsDlg::dispose()
+{
delete pFieldSepTab;
delete pTextSepTab;
+ m_pFieldFrame.clear();
+ m_pFtCharset.clear();
+ m_pLbCharset.clear();
+ m_pFtFieldSep.clear();
+ m_pEdFieldSep.clear();
+ m_pFtTextSep.clear();
+ m_pEdTextSep.clear();
+ m_pCbShown.clear();
+ m_pCbFormulas.clear();
+ m_pCbQuoteAll.clear();
+ m_pCbFixed.clear();
+ m_pBtnOk.clear();
+ ModalDialog::dispose();
}
void ScImportOptionsDlg::GetImportOptions( ScImportOptions& rOptions ) const
diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx
index 380278b8c8b8..028963d76556 100644
--- a/sc/source/ui/dbgui/sfiltdlg.cxx
+++ b/sc/source/ui/dbgui/sfiltdlg.cxx
@@ -97,6 +97,11 @@ ScSpecialFilterDlg::ScSpecialFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, vc
ScSpecialFilterDlg::~ScSpecialFilterDlg()
{
+ disposeOnce();
+}
+
+void ScSpecialFilterDlg::dispose()
+{
sal_uInt16 nEntries = pLbFilterArea->GetEntryCount();
sal_uInt16 i;
@@ -111,6 +116,26 @@ ScSpecialFilterDlg::~ScSpecialFilterDlg()
// Hack: RefInput-Kontrolle
pIdle->Stop();
delete pIdle;
+
+ pLbFilterArea.clear();
+ pEdFilterArea.clear();
+ pRbFilterArea.clear();
+ pExpander.clear();
+ pBtnCase.clear();
+ pBtnRegExp.clear();
+ pBtnHeader.clear();
+ pBtnUnique.clear();
+ pBtnCopyResult.clear();
+ pLbCopyArea.clear();
+ pEdCopyArea.clear();
+ pRbCopyArea.clear();
+ pBtnDestPers.clear();
+ pFtDbAreaLabel.clear();
+ pFtDbArea.clear();
+ pBtnOk.clear();
+ pBtnCancel.clear();
+ pRefInputEdit.clear();
+ ScAnyRefDlg::dispose();
}
void ScSpecialFilterDlg::Init( const SfxItemSet& rArgSet )
diff --git a/sc/source/ui/dbgui/sortdlg.cxx b/sc/source/ui/dbgui/sortdlg.cxx
index 97c6b98641c8..4702a0615c0a 100644
--- a/sc/source/ui/dbgui/sortdlg.cxx
+++ b/sc/source/ui/dbgui/sortdlg.cxx
@@ -50,6 +50,19 @@ ScSortWarningDlg::ScSortWarningDlg(vcl::Window* pParent,
aBtnCurSort->SetClickHdl( LINK( this, ScSortWarningDlg, BtnHdl ) );
}
+ScSortWarningDlg::~ScSortWarningDlg()
+{
+ disposeOnce();
+}
+
+void ScSortWarningDlg::dispose()
+{
+ aFtText.clear();
+ aBtnExtSort.clear();
+ aBtnCurSort.clear();
+ ModalDialog::dispose();
+}
+
IMPL_LINK( ScSortWarningDlg, BtnHdl, PushButton*, pBtn )
{
if ( pBtn == aBtnExtSort )
diff --git a/sc/source/ui/dbgui/subtdlg.cxx b/sc/source/ui/dbgui/subtdlg.cxx
index c4a718a9e6d7..45132c0b02ff 100644
--- a/sc/source/ui/dbgui/subtdlg.cxx
+++ b/sc/source/ui/dbgui/subtdlg.cxx
@@ -36,6 +36,17 @@ ScSubTotalDlg::ScSubTotalDlg(vcl::Window* pParent, const SfxItemSet* pArgSet)
m_pBtnRemove->SetClickHdl( LINK( this, ScSubTotalDlg, RemoveHdl ) );
}
+ScSubTotalDlg::~ScSubTotalDlg()
+{
+ disposeOnce();
+}
+
+void ScSubTotalDlg::dispose()
+{
+ m_pBtnRemove.clear();
+ SfxTabDialog::dispose();
+}
+
IMPL_LINK_INLINE_START( ScSubTotalDlg, RemoveHdl, PushButton *, pBtn )
{
if (pBtn == m_pBtnRemove)
diff --git a/sc/source/ui/dbgui/textimportoptions.cxx b/sc/source/ui/dbgui/textimportoptions.cxx
index fb1b34945c14..6ec64bf36506 100644
--- a/sc/source/ui/dbgui/textimportoptions.cxx
+++ b/sc/source/ui/dbgui/textimportoptions.cxx
@@ -38,8 +38,20 @@ ScTextImportOptionsDlg::ScTextImportOptionsDlg(vcl::Window* pParent)
ScTextImportOptionsDlg::~ScTextImportOptionsDlg()
{
+ disposeOnce();
}
+void ScTextImportOptionsDlg::dispose()
+{
+ m_pBtnOk.clear();
+ m_pRbAutomatic.clear();
+ m_pRbCustom.clear();
+ m_pLbCustomLang.clear();
+ m_pBtnConvertDate.clear();
+ ModalDialog::dispose();
+}
+
+
short ScTextImportOptionsDlg::Execute()
{
return ModalDialog::Execute();
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index c1a0770a51fd..210f60468d98 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -93,6 +93,17 @@ ScTabPageSortFields::ScTabPageSortFields(vcl::Window* pParent,
SetExchangeSupport();
}
+ScTabPageSortFields::~ScTabPageSortFields()
+{
+ disposeOnce();
+}
+
+void ScTabPageSortFields::dispose()
+{
+ pDlg.clear();
+ SfxTabPage::dispose();
+}
+
void ScTabPageSortFields::SetPosSizePixel(const Point& rAllocPos, const Size& rAllocation)
{
SfxTabPage::SetPosSizePixel(rAllocPos, rAllocation);
@@ -111,10 +122,6 @@ void ScTabPageSortFields::SetPosPixel(const Point& rAllocPos)
maSortKeyCtrl.setScrollRange();
}
-ScTabPageSortFields::~ScTabPageSortFields()
-{
-}
-
void ScTabPageSortFields::Init()
{
const ScSortItem& rSortItem = static_cast<const ScSortItem&>(
@@ -135,10 +142,10 @@ void ScTabPageSortFields::Init()
}
}
-SfxTabPage* ScTabPageSortFields::Create( vcl::Window* pParent,
- const SfxItemSet* rArgSet )
+VclPtr<SfxTabPage> ScTabPageSortFields::Create( vcl::Window* pParent,
+ const SfxItemSet* rArgSet )
{
- return ( new ScTabPageSortFields( pParent, *rArgSet ) );
+ return VclPtr<ScTabPageSortFields>::Create( pParent, *rArgSet );
}
void ScTabPageSortFields::Reset( const SfxItemSet* /* rArgSet */ )
@@ -516,6 +523,11 @@ ScTabPageSortOptions::ScTabPageSortOptions( vcl::Window* pParent,
ScTabPageSortOptions::~ScTabPageSortOptions()
{
+ disposeOnce();
+}
+
+void ScTabPageSortOptions::dispose()
+{
sal_uInt16 nEntries = m_pLbOutPos->GetEntryCount();
for ( sal_uInt16 i=1; i<nEntries; i++ )
@@ -523,6 +535,22 @@ ScTabPageSortOptions::~ScTabPageSortOptions()
delete pColRes;
delete pColWrap; //! not if from document
+ m_pBtnCase.clear();
+ m_pBtnHeader.clear();
+ m_pBtnFormats.clear();
+ m_pBtnNaturalSort.clear();
+ m_pBtnCopyResult.clear();
+ m_pLbOutPos.clear();
+ m_pEdOutPos.clear();
+ m_pBtnSortUser.clear();
+ m_pLbSortUser.clear();
+ m_pLbLanguage.clear();
+ m_pFtAlgorithm.clear();
+ m_pLbAlgorithm.clear();
+ m_pBtnTopDown.clear();
+ m_pBtnLeftRight.clear();
+ pDlg.clear();
+ SfxTabPage::dispose();
}
void ScTabPageSortOptions::Init()
@@ -607,11 +635,10 @@ void ScTabPageSortOptions::Init()
m_pLbLanguage->InsertLanguage( LANGUAGE_SYSTEM );
}
-SfxTabPage* ScTabPageSortOptions::Create(
- vcl::Window* pParent,
- const SfxItemSet* rArgSet )
+VclPtr<SfxTabPage> ScTabPageSortOptions::Create( vcl::Window* pParent,
+ const SfxItemSet* rArgSet )
{
- return ( new ScTabPageSortOptions( pParent, *rArgSet ) );
+ return VclPtr<ScTabPageSortOptions>::Create( pParent, *rArgSet );
}
void ScTabPageSortOptions::Reset( const SfxItemSet* /* rArgSet */ )
diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx
index f76265dbf9b0..c41bbc1a07ca 100644
--- a/sc/source/ui/dbgui/tpsubt.cxx
+++ b/sc/source/ui/dbgui/tpsubt.cxx
@@ -67,6 +67,11 @@ ScTpSubTotalGroup::ScTpSubTotalGroup( vcl::Window* pParent,
ScTpSubTotalGroup::~ScTpSubTotalGroup()
{
+ disposeOnce();
+}
+
+void ScTpSubTotalGroup::dispose()
+{
sal_uLong nCount = mpLbColumns->GetEntryCount();
if ( nCount > 0 )
@@ -79,6 +84,10 @@ ScTpSubTotalGroup::~ScTpSubTotalGroup()
delete pData;
}
}
+ mpLbGroup.clear();
+ mpLbColumns.clear();
+ mpLbFunctions.clear();
+ SfxTabPage::dispose();
}
void ScTpSubTotalGroup::Init()
@@ -376,17 +385,17 @@ IMPL_LINK( ScTpSubTotalGroup, CheckHdl, void *, pLb )
// Derived Group TabPages:
-SfxTabPage* ScTpSubTotalGroup1::Create( vcl::Window* pParent,
+VclPtr<SfxTabPage> ScTpSubTotalGroup1::Create( vcl::Window* pParent,
const SfxItemSet* rArgSet )
- { return ( new ScTpSubTotalGroup1( pParent, *rArgSet ) ); }
+ { return VclPtr<SfxTabPage>( new ScTpSubTotalGroup1( pParent, *rArgSet ), SAL_NO_ACQUIRE ); }
-SfxTabPage* ScTpSubTotalGroup2::Create( vcl::Window* pParent,
+VclPtr<SfxTabPage> ScTpSubTotalGroup2::Create( vcl::Window* pParent,
const SfxItemSet* rArgSet )
- { return ( new ScTpSubTotalGroup2( pParent, *rArgSet ) ); }
+ { return VclPtr<SfxTabPage>( new ScTpSubTotalGroup2( pParent, *rArgSet ), SAL_NO_ACQUIRE ); }
-SfxTabPage* ScTpSubTotalGroup3::Create( vcl::Window* pParent,
+VclPtr<SfxTabPage> ScTpSubTotalGroup3::Create( vcl::Window* pParent,
const SfxItemSet* rArgSet )
- { return ( new ScTpSubTotalGroup3( pParent, *rArgSet ) ); }
+ { return VclPtr<SfxTabPage>( new ScTpSubTotalGroup3( pParent, *rArgSet ), SAL_NO_ACQUIRE ); }
ScTpSubTotalGroup1::ScTpSubTotalGroup1( vcl::Window* pParent, const SfxItemSet& rArgSet ) :
ScTpSubTotalGroup( pParent, rArgSet )
@@ -442,6 +451,21 @@ ScTpSubTotalOptions::ScTpSubTotalOptions( vcl::Window* pParent,
ScTpSubTotalOptions::~ScTpSubTotalOptions()
{
+ disposeOnce();
+}
+
+void ScTpSubTotalOptions::dispose()
+{
+ pBtnPagebreak.clear();
+ pBtnCase.clear();
+ pBtnSort.clear();
+ pFlSort.clear();
+ pBtnAscending.clear();
+ pBtnDescending.clear();
+ pBtnFormats.clear();
+ pBtnUserDef.clear();
+ pLbUserDef.clear();
+ SfxTabPage::dispose();
}
void ScTpSubTotalOptions::Init()
@@ -460,10 +484,10 @@ void ScTpSubTotalOptions::Init()
FillUserSortListBox();
}
-SfxTabPage* ScTpSubTotalOptions::Create( vcl::Window* pParent,
- const SfxItemSet* rArgSet )
+VclPtr<SfxTabPage> ScTpSubTotalOptions::Create( vcl::Window* pParent,
+ const SfxItemSet* rArgSet )
{
- return ( new ScTpSubTotalOptions( pParent, *rArgSet ) );
+ return VclPtr<SfxTabPage>( new ScTpSubTotalOptions( pParent, *rArgSet ), SAL_NO_ACQUIRE );
}
void ScTpSubTotalOptions::Reset( const SfxItemSet* /* rArgSet */ )
diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index af21095d6c1e..7952949c3b67 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -168,6 +168,17 @@ void ScTPValidationValue::RefInputDonePostHdl()
m_pRefEdit->GrabFocus();
}
+ScTPValidationValue::ScRefButtonEx::~ScRefButtonEx()
+{
+ disposeOnce();
+}
+
+void ScTPValidationValue::ScRefButtonEx::dispose()
+{
+ m_pPage.clear();
+ ::formula::RefButton::dispose();
+}
+
namespace {
/** Converts the passed ScValidationMode to the position in the list box. */
@@ -346,6 +357,33 @@ ScTPValidationValue::ScTPValidationValue( vcl::Window* pParent, const SfxItemSet
m_pBtnRef->Hide(); // cell range picker
}
+ScTPValidationValue::~ScTPValidationValue()
+{
+ disposeOnce();
+}
+
+void ScTPValidationValue::dispose()
+{
+ m_pLbAllow.clear();
+ m_pCbAllow.clear();
+ m_pCbShow.clear();
+ m_pCbSort.clear();
+ m_pFtValue.clear();
+ m_pLbValue.clear();
+ m_pFtMin.clear();
+ m_pMinGrid.clear();
+ m_pEdMin.clear();
+ m_pEdList.clear();
+ m_pFtMax.clear();
+ m_pEdMax.clear();
+ m_pFtHint.clear();
+ m_pRefEdit.clear();
+ m_pBtnRef.clear();
+ m_pRefGrid.clear();
+ SfxTabPage::dispose();
+}
+
+
void ScTPValidationValue::Init()
{
m_pLbAllow->SetSelectHdl( LINK( this, ScTPValidationValue, SelectHdl ) );
@@ -366,9 +404,9 @@ void ScTPValidationValue::Init()
CheckHdl( NULL );
}
-SfxTabPage* ScTPValidationValue::Create( vcl::Window* pParent, const SfxItemSet* rArgSet )
+VclPtr<SfxTabPage> ScTPValidationValue::Create( vcl::Window* pParent, const SfxItemSet* rArgSet )
{
- return( new ScTPValidationValue( pParent, *rArgSet ) );
+ return VclPtr<SfxTabPage>(new ScTPValidationValue( pParent, *rArgSet ), SAL_NO_ACQUIRE);
}
void ScTPValidationValue::Reset( const SfxItemSet* rArgSet )
@@ -649,6 +687,15 @@ ScTPValidationHelp::ScTPValidationHelp( vcl::Window* pParent,
ScTPValidationHelp::~ScTPValidationHelp()
{
+ disposeOnce();
+}
+
+void ScTPValidationHelp::dispose()
+{
+ pTsbHelp.clear();
+ pEdtTitle.clear();
+ pEdInputHelp.clear();
+ SfxTabPage::dispose();
}
void ScTPValidationHelp::Init()
@@ -656,10 +703,10 @@ void ScTPValidationHelp::Init()
pTsbHelp->EnableTriState( false );
}
-SfxTabPage* ScTPValidationHelp::Create( vcl::Window* pParent,
- const SfxItemSet* rArgSet )
+VclPtr<SfxTabPage> ScTPValidationHelp::Create( vcl::Window* pParent,
+ const SfxItemSet* rArgSet )
{
- return ( new ScTPValidationHelp( pParent, *rArgSet ) );
+ return VclPtr<ScTPValidationHelp>::Create( pParent, *rArgSet );
}
void ScTPValidationHelp::Reset( const SfxItemSet* rArgSet )
@@ -713,6 +760,18 @@ ScTPValidationError::ScTPValidationError( vcl::Window* pParent,
ScTPValidationError::~ScTPValidationError()
{
+ disposeOnce();
+}
+
+void ScTPValidationError::dispose()
+{
+ m_pTsbShow.clear();
+ m_pLbAction.clear();
+ m_pBtnSearch.clear();
+ m_pEdtTitle.clear();
+ m_pFtError.clear();
+ m_pEdError.clear();
+ SfxTabPage::dispose();
}
void ScTPValidationError::Init()
@@ -726,10 +785,10 @@ void ScTPValidationError::Init()
SelectActionHdl( NULL );
}
-SfxTabPage* ScTPValidationError::Create( vcl::Window* pParent,
- const SfxItemSet* rArgSet )
+VclPtr<SfxTabPage> ScTPValidationError::Create( vcl::Window* pParent,
+ const SfxItemSet* rArgSet )
{
- return ( new ScTPValidationError( pParent, *rArgSet ) );
+ return VclPtr<ScTPValidationError>::Create( pParent, *rArgSet );
}
void ScTPValidationError::Reset( const SfxItemSet* rArgSet )
diff --git a/sc/source/ui/dialogs/searchresults.cxx b/sc/source/ui/dialogs/searchresults.cxx
index f9384ac281e0..2d91c929f12c 100644
--- a/sc/source/ui/dialogs/searchresults.cxx
+++ b/sc/source/ui/dialogs/searchresults.cxx
@@ -32,7 +32,7 @@ SearchResultsDlg::SearchResultsDlg( SfxBindings* _pBindings, vcl::Window* pParen
pContainer->set_width_request(aControlSize.Width());
pContainer->set_height_request(aControlSize.Height());
- mpList = new SvSimpleTable(*pContainer);
+ mpList = VclPtr<SvSimpleTable>::Create(*pContainer);
long nTabs[] = {3, 0, 40, 60};
mpList->SetTabs(&nTabs[0]);
mpList->InsertHeaderEntry(SC_RESSTR(STR_SHEET) + "\t" + SC_RESSTR(STR_CELL) + "\t" + SC_RESSTR(STR_CONTENT));
@@ -41,7 +41,13 @@ SearchResultsDlg::SearchResultsDlg( SfxBindings* _pBindings, vcl::Window* pParen
SearchResultsDlg::~SearchResultsDlg()
{
- delete mpList;
+ disposeOnce();
+}
+
+void SearchResultsDlg::dispose()
+{
+ mpList.disposeAndClear();
+ ModelessDialog::dispose();
}
void SearchResultsDlg::FillResults( ScDocument* pDoc, const ScRangeList &rMatchedRanges )
@@ -118,7 +124,7 @@ SearchResultsDlgWrapper::SearchResultsDlgWrapper(
vcl::Window* _pParent, sal_uInt16 nId, SfxBindings* pBindings, SfxChildWinInfo* /*pInfo*/ ) :
SfxChildWindow(_pParent, nId)
{
- pWindow = new SearchResultsDlg(pBindings, _pParent, nId);
+ pWindow = VclPtr<SearchResultsDlg>::Create(pBindings, _pParent, nId);
}
SearchResultsDlgWrapper::~SearchResultsDlgWrapper() {}
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index 663eb89dfaf5..8b3247af4f3b 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -459,9 +459,9 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
//! Link-Dialog muss Default-Parent setzen
// "kann keine Zeilen einfuegen"
- InfoBox aBox( Application::GetDefDialogParent(),
- ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_2 ) );
- aBox.Execute();
+ ScopedVclPtrInstance<InfoBox> aBox( Application::GetDefDialogParent(),
+ ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_2 ) );
+ aBox->Execute();
}
// aufraeumen
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index bb974630a333..d8e63818fb7e 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -1269,9 +1269,9 @@ bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb
// OutRange of pOldObj (pDestObj) is still old area
if (!lcl_EmptyExcept(&rDoc, aNewOut, pOldObj->GetOutRange()))
{
- QueryBox aBox( rDocShell.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
+ ScopedVclPtrInstance<QueryBox> aBox( rDocShell.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
ScGlobal::GetRscString(STR_PIVOT_NOTEMPTY) );
- if (aBox.Execute() == RET_NO)
+ if (aBox->Execute() == RET_NO)
{
//! like above (not editable)
*pOldObj = aUndoDPObj;
@@ -1421,11 +1421,11 @@ bool ScDBDocFunc::CreatePivotTable(const ScDPObject& rDPObj, bool bRecord, bool
if (!bEmpty)
{
- QueryBox aBox(
+ ScopedVclPtrInstance<QueryBox> aBox(
rDocShell.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
ScGlobal::GetRscString(STR_PIVOT_NOTEMPTY));
- if (aBox.Execute() == RET_NO)
+ if (aBox->Execute() == RET_NO)
{
//! like above (not editable)
return false;
@@ -1495,9 +1495,9 @@ bool ScDBDocFunc::UpdatePivotTable(ScDPObject& rDPObj, bool bRecord, bool bApi)
{
if (!lcl_EmptyExcept(&rDoc, aNewOut, rDPObj.GetOutRange()))
{
- QueryBox aBox( rDocShell.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
- ScGlobal::GetRscString(STR_PIVOT_NOTEMPTY) );
- if (aBox.Execute() == RET_NO)
+ ScopedVclPtrInstance<QueryBox> aBox( rDocShell.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
+ ScGlobal::GetRscString(STR_PIVOT_NOTEMPTY) );
+ if (aBox->Execute() == RET_NO)
{
rDPObj = aUndoDPObj;
return false;
@@ -1593,9 +1593,9 @@ void ScDBDocFunc::UpdateImport( const OUString& rTarget, const svx::ODataAccessD
const ScDBData* pData = rDBColl.getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(rTarget));
if (!pData)
{
- InfoBox aInfoBox(rDocShell.GetActiveDialogParent(),
- ScGlobal::GetRscString( STR_TARGETNOTFOUND ) );
- aInfoBox.Execute();
+ ScopedVclPtrInstance<InfoBox> aInfoBox( rDocShell.GetActiveDialogParent(),
+ ScGlobal::GetRscString( STR_TARGETNOTFOUND ) );
+ aInfoBox->Execute();
return;
}
diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx
index 6c0b23772d5a..df197e37db44 100644
--- a/sc/source/ui/docshell/dbdocimp.cxx
+++ b/sc/source/ui/docshell/dbdocimp.cxx
@@ -635,8 +635,8 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
nErrStringId = STR_MSSG_IMPORTDATA_0;
aErrorMessage = ScGlobal::GetRscString( nErrStringId );
}
- InfoBox aInfoBox( rDocShell.GetActiveDialogParent(), aErrorMessage );
- aInfoBox.Execute();
+ ScopedVclPtrInstance< InfoBox > aInfoBox( rDocShell.GetActiveDialogParent(), aErrorMessage );
+ aInfoBox->Execute();
}
delete pImportDoc;
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 753fd6de8735..305ab149d229 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -2764,7 +2764,6 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
if ( !bIncludeFiltered && pClipDoc->HasClipFilteredRows() )
UnmergeCells( aPasteDest, false );
- VirtualDevice aVirtDev;
bool bDestHeight = AdjustRowHeight(
ScRange( 0,nDestRow,nDestTab, MAXCOL,nDestEndRow,nDestEndTab ),
false );
@@ -3757,8 +3756,8 @@ bool ScDocFunc::Unprotect( SCTAB nTab, const OUString& rPassword, bool bApi )
{
if (!bApi)
{
- InfoBox aBox( rDocShell.GetActiveDialogParent(), OUString( ScResId( SCSTR_WRONGPASSWORD ) ) );
- aBox.Execute();
+ ScopedVclPtrInstance< InfoBox > aBox( rDocShell.GetActiveDialogParent(), OUString( ScResId( SCSTR_WRONGPASSWORD ) ) );
+ aBox->Execute();
}
return false;
}
@@ -3787,8 +3786,8 @@ bool ScDocFunc::Unprotect( SCTAB nTab, const OUString& rPassword, bool bApi )
{
if (!bApi)
{
- InfoBox aBox( rDocShell.GetActiveDialogParent(), OUString( ScResId( SCSTR_WRONGPASSWORD ) ) );
- aBox.Execute();
+ ScopedVclPtrInstance< InfoBox > aBox( rDocShell.GetActiveDialogParent(), OUString( ScResId( SCSTR_WRONGPASSWORD ) ) );
+ aBox->Execute();
}
return false;
}
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index a422041945e6..ad3b6bffee8f 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -472,14 +472,14 @@ bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const ::com::sun::star::uno::R
{
// Generator is not LibreOffice. Ask if the user wants to perform
// full re-calculation.
- QueryBox aBox(
+ ScopedVclPtrInstance<QueryBox> aBox(
GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_ODS));
- aBox.SetCheckBoxText(ScGlobal::GetRscString(STR_ALWAYS_PERFORM_SELECTED));
+ aBox->SetCheckBoxText(ScGlobal::GetRscString(STR_ALWAYS_PERFORM_SELECTED));
- bHardRecalc = aBox.Execute() == RET_YES;
+ bHardRecalc = aBox->Execute() == RET_YES;
- if (aBox.GetCheckBoxState())
+ if (aBox->GetCheckBoxState())
{
// Always perform selected action in the future.
std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
@@ -689,11 +689,11 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
ScAppOptions aAppOptions = SC_MOD()->GetAppOptions();
if ( aAppOptions.GetShowSharedDocumentWarning() )
{
- WarningBox aBox( GetActiveDialogParent(), WinBits( WB_OK ),
+ ScopedVclPtrInstance<WarningBox> aBox( GetActiveDialogParent(), WinBits( WB_OK ),
ScGlobal::GetRscString( STR_SHARED_DOC_WARNING ) );
- aBox.SetDefaultCheckBoxText();
- aBox.Execute();
- bool bChecked = aBox.GetCheckBoxState();
+ aBox->SetDefaultCheckBoxText();
+ aBox->Execute();
+ bool bChecked = aBox->GetCheckBoxState();
if ( bChecked )
{
aAppOptions.SetShowSharedDocumentWarning( !bChecked );
@@ -818,8 +818,8 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
OUString aMessage( ScGlobal::GetRscString( STR_FILE_LOCKED_SAVE_LATER ) );
aMessage = aMessage.replaceFirst( "%1", aUserName );
- WarningBox aBox( GetActiveDialogParent(), WinBits( WB_RETRY_CANCEL | WB_DEF_RETRY ), aMessage );
- if ( aBox.Execute() == RET_RETRY )
+ ScopedVclPtrInstance< WarningBox > aBox( GetActiveDialogParent(), WinBits( WB_RETRY_CANCEL | WB_DEF_RETRY ), aMessage );
+ if ( aBox->Execute() == RET_RETRY )
{
bRetry = true;
}
@@ -893,9 +893,9 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
else
{
- WarningBox aBox( GetActiveDialogParent(), WinBits( WB_OK ),
+ ScopedVclPtrInstance<WarningBox> aBox( GetActiveDialogParent(), WinBits( WB_OK ),
ScGlobal::GetRscString( STR_DOC_NOLONGERSHARED ) );
- aBox.Execute();
+ aBox->Execute();
SfxBindings* pBindings = GetViewBindings();
if ( pBindings )
@@ -934,10 +934,10 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
if ( GetDocument().GetExternalRefManager()->containsUnsavedReferences() )
{
- WarningBox aBox( GetActiveDialogParent(), WinBits( WB_YES_NO ),
+ ScopedVclPtrInstance<WarningBox> aBox( GetActiveDialogParent(), WinBits( WB_YES_NO ),
ScGlobal::GetRscString( STR_UNSAVED_EXT_REF ) );
- if( RET_NO == aBox.Execute())
+ if( RET_NO == aBox->Execute())
{
SetError( ERRCODE_IO_ABORT, OUString( OSL_LOG_PREFIX ) ); // this error code will produce no error message, but will break the further saving process
}
@@ -1454,7 +1454,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
Fraction aZoom( 1, 1 );
double nPPTX = ScGlobal::nScreenPPTX * (double) aZoom / GetOutputFactor(); // Factor is printer display ratio
double nPPTY = ScGlobal::nScreenPPTY * (double) aZoom;
- VirtualDevice aVirtDev;
+ ScopedVclPtrInstance< VirtualDevice > pVirtDev;
// all sheets (for Excel import)
SCTAB nTabCount = aDocument.GetTableCount();
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
@@ -1477,7 +1477,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
aColWidthParam[nCol].mbSimpleText = false;
sal_uInt16 nWidth = aDocument.GetOptimalColWidth(
- nCol, nTab, &aVirtDev, nPPTX, nPPTY, aZoom, aZoom, false, &aMark,
+ nCol, nTab, pVirtDev, nPPTX, nPPTY, aZoom, aZoom, false, &aMark,
&aColWidthParam[nCol] );
aDocument.SetColWidth( nCol, nTab,
nWidth + (sal_uInt16)ScGlobal::nLastColWidthExtra );
@@ -2880,10 +2880,10 @@ void ScDocShell::GetDocStat( ScDocStat& rDocStat )
(sal_uInt16) ScPrintFunc( this, pPrinter, i ).GetTotalPages() );
}
-SfxDocumentInfoDialog* ScDocShell::CreateDocumentInfoDialog(
+VclPtr<SfxDocumentInfoDialog> ScDocShell::CreateDocumentInfoDialog(
vcl::Window *pParent, const SfxItemSet &rSet )
{
- SfxDocumentInfoDialog* pDlg = new SfxDocumentInfoDialog( pParent, rSet );
+ VclPtr<SfxDocumentInfoDialog> pDlg = VclPtr<SfxDocumentInfoDialog>::Create( pParent, rSet );
ScDocShell* pDocSh = PTR_CAST(ScDocShell,SfxObjectShell::Current());
// Only for statistics, if this Doc is shown; not from the Doc Manager
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 66c3a8608338..b97bf8675e89 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -368,11 +368,11 @@ void ScDocShell::CalcOutputFactor()
pRefDev->SetFont(aOldFont);
pRefDev->SetMapMode(aOldMode);
- VirtualDevice aVirtWindow( *Application::GetDefaultDevice() );
- aVirtWindow.SetMapMode(MAP_PIXEL);
- pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, &aVirtWindow); // font color doesn't matter here
- aVirtWindow.SetFont(aDefFont);
- nWindowWidth = aVirtWindow.GetTextWidth(aTestString);
+ ScopedVclPtrInstance< VirtualDevice > pVirtWindow( *Application::GetDefaultDevice() );
+ pVirtWindow->SetMapMode(MAP_PIXEL);
+ pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, pVirtWindow); // font color doesn't matter here
+ pVirtWindow->SetFont(aDefFont);
+ nWindowWidth = pVirtWindow->GetTextWidth(aTestString);
nWindowWidth = (long) ( nWindowWidth / ScGlobal::nScreenPPTX * HMM_PER_TWIPS );
if (nPrinterWidth && nWindowWidth)
@@ -1202,12 +1202,12 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
while ( bLoop )
{
bLoop = false;
- ScConflictsDlg aDlg( GetActiveDialogParent(), GetViewData(), &rSharedDoc, aConflictsList );
- if ( aDlg.Execute() == RET_CANCEL )
+ ScopedVclPtrInstance< ScConflictsDlg > aDlg( GetActiveDialogParent(), GetViewData(), &rSharedDoc, aConflictsList );
+ if ( aDlg->Execute() == RET_CANCEL )
{
- QueryBox aBox( GetActiveDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ),
+ ScopedVclPtrInstance<QueryBox> aBox( GetActiveDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ),
ScGlobal::GetRscString( STR_DOC_WILLNOTBESAVED ) );
- if ( aBox.Execute() == RET_YES )
+ if ( aBox->Execute() == RET_YES )
{
return false;
}
@@ -1320,8 +1320,8 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
PostPaintExtras();
PostPaintGridAll();
- InfoBox aInfoBox( GetActiveDialogParent(), ScGlobal::GetRscString( STR_DOC_UPDATED ) );
- aInfoBox.Execute();
+ ScopedVclPtrInstance< InfoBox > aInfoBox( GetActiveDialogParent(), ScGlobal::GetRscString( STR_DOC_UPDATED ) );
+ aInfoBox->Execute();
}
return ( pThisAction != NULL );
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 8e400290014e..515ed542a921 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -222,8 +222,8 @@ void ScDocShell::Execute( SfxRequest& rReq )
aMessage += sTarget;
aMessage += aTemplate.getToken( 1, '#' );
- QueryBox aBox( 0, WinBits(WB_YES_NO | WB_DEF_YES), aMessage );
- bDo = ( aBox.Execute() == RET_YES );
+ ScopedVclPtrInstance< QueryBox > aBox( nullptr, WinBits(WB_YES_NO | WB_DEF_YES), aMessage );
+ bDo = ( aBox->Execute() == RET_YES );
}
if (bDo)
@@ -427,10 +427,10 @@ void ScDocShell::Execute( SfxRequest& rReq )
if(nSet==LM_ON_DEMAND)
{
- QueryBox aBox( GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
+ ScopedVclPtrInstance<QueryBox> aBox( GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
ScGlobal::GetRscString(STR_RELOAD_TABLES) );
- nDlgRet=aBox.Execute();
+ nDlgRet=aBox->Execute();
}
if (nDlgRet == RET_YES || nSet==LM_ALWAYS)
@@ -476,9 +476,9 @@ void ScDocShell::Execute( SfxRequest& rReq )
OSL_ENSURE(pViewSh,"SID_REIMPORT_AFTER_LOAD: keine View");
if (pViewSh && pDBColl)
{
- QueryBox aBox( GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
+ ScopedVclPtrInstance<QueryBox> aBox( GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
ScGlobal::GetRscString(STR_REIMPORT_AFTER_LOAD) );
- if (aBox.Execute() == RET_YES)
+ if (aBox->Execute() == RET_YES)
{
ScDBCollection::NamedDBs& rDBs = pDBColl->getNamedDBs();
ScDBCollection::NamedDBs::iterator itr = rDBs.begin(), itrEnd = rDBs.end();
@@ -575,10 +575,10 @@ void ScDocShell::Execute( SfxRequest& rReq )
if ( !pItem )
{
// no dialog on playing the macro
- WarningBox aBox( pParent ? pParent : GetActiveDialogParent(),
+ ScopedVclPtrInstance<WarningBox> aBox( pParent ? pParent : GetActiveDialogParent(),
WinBits(WB_YES_NO | WB_DEF_NO),
ScGlobal::GetRscString( STR_END_REDLINING ) );
- bDo = ( aBox.Execute() == RET_YES );
+ bDo = ( aBox->Execute() == RET_YES );
}
if ( bDo )
@@ -644,10 +644,10 @@ void ScDocShell::Execute( SfxRequest& rReq )
{
if ( nSlot == SID_DOCUMENT_COMPARE )
{ //! old changes trace will be lost
- WarningBox aBox( GetActiveDialogParent(),
+ ScopedVclPtrInstance<WarningBox> aBox( GetActiveDialogParent(),
WinBits(WB_YES_NO | WB_DEF_NO),
ScGlobal::GetRscString( STR_END_REDLINING ) );
- if( aBox.Execute() == RET_YES )
+ if( aBox->Execute() == RET_YES )
bDo = ExecuteChangeProtectionDialog( NULL, true );
else
bDo = false;
@@ -913,10 +913,10 @@ void ScDocShell::Execute( SfxRequest& rReq )
break;
}
- ScShareDocumentDlg aDlg( GetActiveDialogParent(), pViewData );
- if ( aDlg.Execute() == RET_OK )
+ ScopedVclPtrInstance< ScShareDocumentDlg > aDlg( GetActiveDialogParent(), pViewData );
+ if ( aDlg->Execute() == RET_OK )
{
- bool bSetShared = aDlg.IsShareDocumentChecked();
+ bool bSetShared = aDlg->IsShareDocumentChecked();
if ( bSetShared != static_cast< bool >( IsDocShared() ) )
{
if ( bSetShared )
@@ -924,9 +924,11 @@ void ScDocShell::Execute( SfxRequest& rReq )
bool bContinue = true;
if ( HasName() )
{
- QueryBox aBox( GetActiveDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ),
+ ScopedVclPtrInstance<QueryBox> aBox(
+ GetActiveDialogParent(),
+ WinBits( WB_YES_NO | WB_DEF_YES ),
ScGlobal::GetRscString( STR_DOC_WILLBESAVED ) );
- if ( aBox.Execute() == RET_NO )
+ if ( aBox->Execute() == RET_NO )
{
bContinue = false;
}
@@ -1013,14 +1015,16 @@ void ScDocShell::Execute( SfxRequest& rReq )
OUString aMessage( ScGlobal::GetRscString( STR_FILE_LOCKED_TRY_LATER ) );
aMessage = aMessage.replaceFirst( "%1", aUserName );
- WarningBox aBox( GetActiveDialogParent(), WinBits( WB_OK ), aMessage );
- aBox.Execute();
+ ScopedVclPtrInstance< WarningBox > aBox( GetActiveDialogParent(), WinBits( WB_OK ), aMessage );
+ aBox->Execute();
}
else
{
- WarningBox aBox( GetActiveDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ),
+ ScopedVclPtrInstance<WarningBox> aBox(
+ GetActiveDialogParent(),
+ WinBits( WB_YES_NO | WB_DEF_YES ),
ScGlobal::GetRscString( STR_DOC_DISABLESHARED ) );
- if ( aBox.Execute() == RET_YES )
+ if ( aBox->Execute() == RET_YES )
{
xCloseable->close( sal_True );
@@ -1052,9 +1056,9 @@ void ScDocShell::Execute( SfxRequest& rReq )
else
{
xCloseable->close( sal_True );
- WarningBox aBox( GetActiveDialogParent(), WinBits( WB_OK ),
+ ScopedVclPtrInstance<WarningBox> aBox( GetActiveDialogParent(), WinBits( WB_OK ),
ScGlobal::GetRscString( STR_DOC_NOLONGERSHARED ) );
- aBox.Execute();
+ aBox->Execute();
}
}
catch ( uno::Exception& )
@@ -1127,8 +1131,8 @@ bool ScDocShell::ExecuteChangeProtectionDialog( vcl::Window* _pParent, bool bJus
OUString aText( ScResId( SCSTR_PASSWORD ) );
OUString aPassword;
- boost::scoped_ptr<SfxPasswordDialog> pDlg(new SfxPasswordDialog(
- _pParent ? _pParent : GetActiveDialogParent(), &aText ));
+ ScopedVclPtrInstance<SfxPasswordDialog> pDlg(
+ _pParent ? _pParent : GetActiveDialogParent(), &aText );
pDlg->SetText( aTitle );
pDlg->SetMinLen( 1 );
pDlg->SetHelpId( GetStaticInterface()->GetSlot(SID_CHG_PROTECT)->GetCommand() );
@@ -1153,9 +1157,9 @@ bool ScDocShell::ExecuteChangeProtectionDialog( vcl::Window* _pParent, bool bJus
}
else
{
- InfoBox aBox( GetActiveDialogParent(),
+ ScopedVclPtrInstance<InfoBox> aBox( GetActiveDialogParent(),
OUString( ScResId( SCSTR_WRONGPASSWORD ) ) );
- aBox.Execute();
+ aBox->Execute();
}
}
else
@@ -1483,9 +1487,9 @@ void ScDocShell::PageStyleModified( const OUString& rStyleName, bool bApi )
if (bWarn && !bApi)
{
ScWaitCursorOff aWaitOff( GetActiveDialogParent() );
- InfoBox aInfoBox(GetActiveDialogParent(),
- ScGlobal::GetRscString(STR_PRINT_INVALID_AREA));
- aInfoBox.Execute();
+ ScopedVclPtrInstance<InfoBox> aInfoBox(GetActiveDialogParent(),
+ ScGlobal::GetRscString(STR_PRINT_INVALID_AREA));
+ aInfoBox->Execute();
}
}
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index 79167bcaa71d..f95815389e66 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -81,8 +81,8 @@ void ScDocShell::ErrorMessage( sal_uInt16 nGlobStrId )
}
}
- InfoBox aBox( pParent, ScGlobal::GetRscString( nGlobStrId ) );
- aBox.Execute();
+ ScopedVclPtrInstance< InfoBox > aBox( pParent, ScGlobal::GetRscString( nGlobStrId ) );
+ aBox->Execute();
if (bFocus)
pParent->GrabFocus();
}
@@ -487,9 +487,9 @@ void ScDocShell::DoConsolidate( const ScConsolidateParam& rParam, bool bRecord )
if (bErr)
{
- InfoBox aBox( GetActiveDialogParent(),
+ ScopedVclPtrInstance<InfoBox> aBox( GetActiveDialogParent(),
ScGlobal::GetRscString( STR_CONSOLIDATE_ERR1 ) );
- aBox.Execute();
+ aBox->Execute();
return;
}
@@ -697,16 +697,16 @@ void ScDocShell::UseScenario( SCTAB nTab, const OUString& rName, bool bRecord )
}
else
{
- InfoBox aBox(GetActiveDialogParent(),
+ ScopedVclPtrInstance<InfoBox> aBox( GetActiveDialogParent(),
ScGlobal::GetRscString( STR_PROTECTIONERR ) );
- aBox.Execute();
+ aBox->Execute();
}
}
else
{
- InfoBox aBox(GetActiveDialogParent(),
+ ScopedVclPtrInstance<InfoBox> aBox(GetActiveDialogParent(),
ScGlobal::GetRscString( STR_SCENARIO_NOTFOUND ) );
- aBox.Execute();
+ aBox->Execute();
}
}
else
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index 3918dbc929df..6d320959f46e 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -531,8 +531,8 @@ void ScDocShell::CheckConfigOptions()
if (pViewShell)
{
vcl::Window* pParent = pViewShell->GetFrameWin();
- InfoBox aBox(pParent, ScGlobal::GetRscString(STR_OPTIONS_WARN_SEPARATORS));
- aBox.Execute();
+ ScopedVclPtrInstance< InfoBox > aBox(pParent, ScGlobal::GetRscString(STR_OPTIONS_WARN_SEPARATORS));
+ aBox->Execute();
}
// For now, this is the only option setting that could launch info
diff --git a/sc/source/ui/docshell/documentlinkmgr.cxx b/sc/source/ui/docshell/documentlinkmgr.cxx
index 7da7c3855d8c..42745eb3f344 100644
--- a/sc/source/ui/docshell/documentlinkmgr.cxx
+++ b/sc/source/ui/docshell/documentlinkmgr.cxx
@@ -165,8 +165,8 @@ bool DocumentLinkManager::updateDdeLinks( vcl::Window* pWin )
aBuf.append(aElem);
aBuf.appendAscii("\nType : ");
aBuf.append(aType);
- MessageDialog aBox(pWin, aBuf.makeStringAndClear());
- aBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aBox(pWin, aBuf.makeStringAndClear());
+ aBox->Execute();
}
}
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index e99e9e017e94..ddea5130c995 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -3020,9 +3020,9 @@ void ScExternalRefManager::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
SfxObjectShell* pObjShell = static_cast<const SfxEventHint&>( rHint ).GetObjShell();
ScDocShell* pDocShell = static_cast< ScDocShell* >( pObjShell );
- WarningBox aBox( pDocShell->GetActiveDialogParent(), WinBits( WB_OK ),
+ ScopedVclPtrInstance<WarningBox> aBox( pDocShell->GetActiveDialogParent(), WinBits( WB_OK ),
ScGlobal::GetRscString( STR_CLOSE_WITH_UNSAVED_REFS ) );
- aBox.Execute();
+ aBox->Execute();
}
break;
case SFX_EVENT_SAVEDOCDONE:
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 806c1b4d7c01..e11b6be89f79 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -210,9 +210,9 @@ bool ScImportExport::StartPaste()
ScEditableTester aTester( pDoc, aRange );
if ( !aTester.IsEditable() )
{
- InfoBox aInfoBox(Application::GetDefDialogParent(),
+ ScopedVclPtrInstance<InfoBox> aInfoBox( Application::GetDefDialogParent(),
ScGlobal::GetRscString( aTester.GetMessageId() ) );
- aInfoBox.Execute();
+ aInfoBox->Execute();
return false;
}
}
@@ -1452,8 +1452,8 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
if ( !mbApi && nStartCol != nEndCol &&
!pDoc->IsBlockEmpty( nTab, nStartCol + 1, nStartRow, nEndCol, nRow ) )
{
- ScReplaceWarnBox aBox( pDocSh->GetActiveDialogParent() );
- if ( aBox.Execute() != RET_YES )
+ ScopedVclPtrInstance< ScReplaceWarnBox > aBox( pDocSh->GetActiveDialogParent() );
+ if ( aBox->Execute() != RET_YES )
{
return false;
}
diff --git a/sc/source/ui/docshell/sizedev.cxx b/sc/source/ui/docshell/sizedev.cxx
index e0ff33c205c1..744266efe4f5 100644
--- a/sc/source/ui/docshell/sizedev.cxx
+++ b/sc/source/ui/docshell/sizedev.cxx
@@ -55,7 +55,7 @@ ScSizeDeviceProvider::ScSizeDeviceProvider( ScDocShell* pDocSh )
ScSizeDeviceProvider::~ScSizeDeviceProvider()
{
if (bOwner)
- delete pDevice;
+ pDevice.disposeAndClear();
else
pDevice->SetMapMode( aOldMapMode );
}
diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx
index 65df85b18ff9..6c8edb9ecbb5 100644
--- a/sc/source/ui/docshell/tablink.cxx
+++ b/sc/source/ui/docshell/tablink.cxx
@@ -47,9 +47,9 @@
struct TableLink_Impl
{
- ScDocShell* m_pDocSh;
- vcl::Window* m_pOldParent;
- Link m_aEndEditLink;
+ ScDocShell* m_pDocSh;
+ VclPtr<vcl::Window> m_pOldParent;
+ Link m_aEndEditLink;
TableLink_Impl() : m_pDocSh( NULL ), m_pOldParent( NULL ) {}
};
diff --git a/sc/source/ui/docshell/tpstat.cxx b/sc/source/ui/docshell/tpstat.cxx
index 7895be53451e..7aca08e43042 100644
--- a/sc/source/ui/docshell/tpstat.cxx
+++ b/sc/source/ui/docshell/tpstat.cxx
@@ -27,9 +27,9 @@
// Dokumentinfo-Tabpage:
-SfxTabPage* ScDocStatPage::Create( vcl::Window *pParent, const SfxItemSet* rSet )
+VclPtr<SfxTabPage> ScDocStatPage::Create( vcl::Window *pParent, const SfxItemSet* rSet )
{
- return new ScDocStatPage( pParent, *rSet );
+ return VclPtr<SfxTabPage>( new ScDocStatPage ( pParent, *rSet ), SAL_NO_ACQUIRE );
}
ScDocStatPage::ScDocStatPage( vcl::Window *pParent, const SfxItemSet& rSet )
@@ -56,8 +56,18 @@ ScDocStatPage::ScDocStatPage( vcl::Window *pParent, const SfxItemSet& rSet )
ScDocStatPage::~ScDocStatPage()
{
+ disposeOnce();
}
+void ScDocStatPage::dispose()
+{
+ m_pFtTables.clear();
+ m_pFtCells.clear();
+ m_pFtPages.clear();
+ SfxTabPage::dispose();
+}
+
+
bool ScDocStatPage::FillItemSet( SfxItemSet* /* rSet */ )
{
return false;
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx
index d53741d617e9..43b8f0616b54 100644
--- a/sc/source/ui/drawfunc/fuins1.cxx
+++ b/sc/source/ui/drawfunc/fuins1.cxx
@@ -271,8 +271,8 @@ FuInsertGraphic::FuInsertGraphic( ScTabViewShell* pViewSh,
// really store as link only?
if( bAsLink && SvtMiscOptions().ShowLinkWarningDialog() )
{
- SvxLinkWarningDialog aWarnDlg(pWin,aFileName);
- if( aWarnDlg.Execute() != RET_OK )
+ ScopedVclPtrInstance< SvxLinkWarningDialog > aWarnDlg(pWin,aFileName);
+ if( aWarnDlg->Execute() != RET_OK )
bAsLink = false; // don't store as link
}
diff --git a/sc/source/ui/drawfunc/fupoor.cxx b/sc/source/ui/drawfunc/fupoor.cxx
index aab43720b1c8..46b4132fc7be 100644
--- a/sc/source/ui/drawfunc/fupoor.cxx
+++ b/sc/source/ui/drawfunc/fupoor.cxx
@@ -53,8 +53,7 @@ FuPoor::~FuPoor()
{
aDragTimer.Stop();
aScrollTimer.Stop();
-
- delete pDialog;
+ pDialog.disposeAndClear();
}
void FuPoor::Activate()
diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx
index b98f92be1f57..f8c2be9ca17b 100644
--- a/sc/source/ui/drawfunc/graphsh.cxx
+++ b/sc/source/ui/drawfunc/graphsh.cxx
@@ -200,10 +200,10 @@ void ScGraphicShell::ExecuteCompressGraphic( SfxRequest& )
if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP )
{
SdrGrafObj* pGraphicObj = static_cast<SdrGrafObj*>(pObj);
- CompressGraphicsDialog dialog( GetViewData()->GetDialogParent(), pGraphicObj, GetViewData()->GetBindings() );
- if ( dialog.Execute() == RET_OK )
+ ScopedVclPtrInstance< CompressGraphicsDialog > dialog( GetViewData()->GetDialogParent(), pGraphicObj, GetViewData()->GetBindings() );
+ if ( dialog->Execute() == RET_OK )
{
- SdrGrafObj* pNewObject = dialog.GetCompressedSdrGrafObj();
+ SdrGrafObj* pNewObject = dialog->GetCompressedSdrGrafObj();
SdrPageView* pPageView = pView->GetSdrPageView();
OUString aUndoString = pView->GetDescriptionOfMarkedObjects() + " Compress";
pView->BegUndo( aUndoString );
diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx
index 65604ad60cac..1a692d54dc80 100644
--- a/sc/source/ui/formdlg/dwfunctr.cxx
+++ b/sc/source/ui/formdlg/dwfunctr.cxx
@@ -63,7 +63,7 @@ ScFunctionChildWindow::ScFunctionChildWindow( vcl::Window* pParentP,
SfxChildWinInfo* pInfo ) :
SfxChildWindow( pParentP, nId )
{
- ScFunctionDockWin* pWin = new ScFunctionDockWin( pBindings, this,
+ VclPtr<ScFunctionDockWin> pWin = VclPtr<ScFunctionDockWin>::Create( pBindings, this,
pParentP, ScResId( FID_FUNCTION_BOX ) );
pWindow = pWin;
@@ -90,12 +90,12 @@ ScFunctionDockWin::ScFunctionDockWin( SfxBindings* pBindingsP,
SfxChildWindow *pCW, vcl::Window* pParent, const ResId& rResId ) :
SfxDockingWindow( pBindingsP, pCW, pParent, rResId ),
- aPrivatSplit ( this, ResId( FT_SPLIT, *rResId.GetResMgr() ),SC_SPLIT_VERT),
- aCatBox ( this, ResId( CB_CAT, *rResId.GetResMgr() ) ),
- aFuncList ( this, ResId( LB_FUNC, *rResId.GetResMgr() ) ),
- aDDFuncList ( this, ResId( DDLB_FUNC, *rResId.GetResMgr() ) ),
- aInsertButton ( this, ResId( IMB_INSERT, *rResId.GetResMgr() ) ),
- aFiFuncDesc ( this, ResId( FI_FUNCDESC, *rResId.GetResMgr() ) ),
+ aPrivatSplit ( VclPtr<ScPrivatSplit>::Create( this, ResId( FT_SPLIT, *rResId.GetResMgr() ),SC_SPLIT_VERT) ),
+ aCatBox ( VclPtr<ListBox>::Create( this, ResId( CB_CAT, *rResId.GetResMgr() ) ) ),
+ aFuncList ( VclPtr<ListBox>::Create( this, ResId( LB_FUNC, *rResId.GetResMgr() ) ) ),
+ aDDFuncList ( VclPtr<ListBox>::Create( this, ResId( DDLB_FUNC, *rResId.GetResMgr() ) ) ),
+ aInsertButton ( VclPtr<ImageButton>::Create( this, ResId( IMB_INSERT, *rResId.GetResMgr() ) ) ),
+ aFiFuncDesc ( VclPtr<FixedText>::Create( this, ResId( FI_FUNCDESC, *rResId.GetResMgr() ) ) ),
aOldSize (0,0),
pFuncDesc (NULL)
{
@@ -111,45 +111,45 @@ ScFunctionDockWin::ScFunctionDockWin( SfxBindings* pBindingsP,
else
eSfxNewAlignment=SfxChildAlignment::RIGHT;
eSfxOldAlignment=eSfxNewAlignment;
- aFiFuncDesc.SetUpdateMode(true);
- pAllFuncList=&aFuncList;
- aDDFuncList.Disable();
- aDDFuncList.Hide();
+ aFiFuncDesc->SetUpdateMode(true);
+ pAllFuncList=aFuncList.get();
+ aDDFuncList->Disable();
+ aDDFuncList->Hide();
nArgs=0;
nDockMode=0;
bSizeFlag=false;
- aCatBox.SetDropDownLineCount(9);
- vcl::Font aFont=aFiFuncDesc.GetFont();
+ aCatBox->SetDropDownLineCount(9);
+ vcl::Font aFont=aFiFuncDesc->GetFont();
aFont.SetColor(Color(COL_BLACK));
- aFiFuncDesc.SetFont(aFont);
- aFiFuncDesc.SetBackground( GetBackground() ); //! never transparent?
+ aFiFuncDesc->SetFont(aFont);
+ aFiFuncDesc->SetBackground( GetBackground() ); //! never transparent?
Link aLink=LINK( this, ScFunctionDockWin, SelHdl);
- aCatBox.SetSelectHdl(aLink);
- aFuncList.SetSelectHdl(aLink);
- aDDFuncList.SetSelectHdl(aLink);
+ aCatBox->SetSelectHdl(aLink);
+ aFuncList->SetSelectHdl(aLink);
+ aDDFuncList->SetSelectHdl(aLink);
Link a2Link=LINK( this, ScFunctionDockWin, SetSelectionHdl);
- aFuncList.SetDoubleClickHdl(a2Link);
- aDDFuncList.SetSelectHdl(aLink);
- aInsertButton.SetClickHdl(a2Link);
+ aFuncList->SetDoubleClickHdl(a2Link);
+ aDDFuncList->SetSelectHdl(aLink);
+ aInsertButton->SetClickHdl(a2Link);
Link a3Link=LINK( this, ScFunctionDockWin, SetSplitHdl);
- aPrivatSplit.SetCtrModifiedHdl(a3Link);
+ aPrivatSplit->SetCtrModifiedHdl(a3Link);
StartListening( *pBindingsP, true );
- Point aTopLeft=aCatBox.GetPosPixel();
+ Point aTopLeft=aCatBox->GetPosPixel();
OUString aString("ww");
- Size aTxtSize( aFiFuncDesc.GetTextWidth(aString), aFiFuncDesc.GetTextHeight() );
+ Size aTxtSize( aFiFuncDesc->GetTextWidth(aString), aFiFuncDesc->GetTextHeight() );
nMinWidth=aTxtSize.Width()+aTopLeft.X()
- +2*aFuncList.GetPosPixel().X();
+ +2*aFuncList->GetPosPixel().X();
nMinHeight=19*aTxtSize.Height();
- aCatBox.SelectEntryPos(0);
+ aCatBox->SelectEntryPos(0);
- Range aYRange(3*aTxtSize.Height()+aFuncList.GetPosPixel().Y(),
+ Range aYRange(3*aTxtSize.Height()+aFuncList->GetPosPixel().Y(),
GetOutputSizePixel().Height()-2*aTxtSize.Height());
- aPrivatSplit.SetYRange(aYRange);
- SelHdl(&aCatBox);
+ aPrivatSplit->SetYRange(aYRange);
+ SelHdl(aCatBox.get());
bInit = true;
}
@@ -169,7 +169,20 @@ ScFunctionDockWin::ScFunctionDockWin( SfxBindings* pBindingsP,
ScFunctionDockWin::~ScFunctionDockWin()
{
+ disposeOnce();
+}
+
+void ScFunctionDockWin::dispose()
+{
EndListening( GetBindings() );
+ aPrivatSplit.disposeAndClear();
+ aCatBox.disposeAndClear();
+ aFuncList.disposeAndClear();
+ aDDFuncList.disposeAndClear();
+ aInsertButton.disposeAndClear();
+ aFiFuncDesc.disposeAndClear();
+ pAllFuncList.clear();
+ SfxDockingWindow::dispose();
}
/*************************************************************************
@@ -192,7 +205,7 @@ void ScFunctionDockWin::InitLRUList()
ScFunctionMgr* pFuncMgr = ScGlobal::GetStarCalcFunctionMgr();
pFuncMgr->fillLastRecentlyUsedFunctions(aLRUList);
- sal_Int32 nSelPos = aCatBox.GetSelectEntryPos();
+ sal_Int32 nSelPos = aCatBox->GetSelectEntryPos();
if(nSelPos == 0)
UpdateFunctionList();
@@ -254,18 +267,18 @@ void ScFunctionDockWin::SetSize()
if(nDockMode!=nNewDockMode)
{
nDockMode=nNewDockMode;
- nSelEntry=aFuncList.GetSelectEntryPos();
- aFuncList.Clear();
- aFiFuncDesc.SetPosPixel(aFuncList.GetPosPixel());
- aDDFuncList.Enable();
- aDDFuncList.Show();
- aPrivatSplit.Disable();
- aPrivatSplit.Hide();
- aFuncList.Disable();
- aFuncList.Hide();
- pAllFuncList=&aDDFuncList;
- SelHdl(&aCatBox);
- aDDFuncList.SelectEntryPos(nSelEntry);
+ nSelEntry=aFuncList->GetSelectEntryPos();
+ aFuncList->Clear();
+ aFiFuncDesc->SetPosPixel(aFuncList->GetPosPixel());
+ aDDFuncList->Enable();
+ aDDFuncList->Show();
+ aPrivatSplit->Disable();
+ aPrivatSplit->Hide();
+ aFuncList->Disable();
+ aFuncList->Hide();
+ pAllFuncList=aDDFuncList.get();
+ SelHdl(aCatBox.get());
+ aDDFuncList->SelectEntryPos(nSelEntry);
}
break;
@@ -273,17 +286,17 @@ void ScFunctionDockWin::SetSize()
if(nDockMode!=nNewDockMode)
{
nDockMode=nNewDockMode;
- nSelEntry=aDDFuncList.GetSelectEntryPos();
- aDDFuncList.Clear();
- aDDFuncList.Disable();
- aDDFuncList.Hide();
- aPrivatSplit.Enable();
- aPrivatSplit.Show();
- aFuncList.Enable();
- aFuncList.Show();
- pAllFuncList=&aFuncList;
- SelHdl(&aCatBox);
- aFuncList.SelectEntryPos(nSelEntry);
+ nSelEntry=aDDFuncList->GetSelectEntryPos();
+ aDDFuncList->Clear();
+ aDDFuncList->Disable();
+ aDDFuncList->Hide();
+ aPrivatSplit->Enable();
+ aPrivatSplit->Show();
+ aFuncList->Enable();
+ aFuncList->Show();
+ pAllFuncList=aFuncList.get();
+ SelHdl(aCatBox.get());
+ aFuncList->SelectEntryPos(nSelEntry);
}
break;
}
@@ -324,11 +337,11 @@ void ScFunctionDockWin::SetLeftRightSize()
aDiffSize.Height()-=aNewSize.Height();
OUString aString("ww");
- Size aTxtSize( aFuncList.GetTextWidth(aString), aFuncList.GetTextHeight() );
+ Size aTxtSize( aFuncList->GetTextWidth(aString), aFuncList->GetTextHeight() );
- Range aYRange(3*aTxtSize.Height()+aFuncList.GetPosPixel().Y(),
+ Range aYRange(3*aTxtSize.Height()+aFuncList->GetPosPixel().Y(),
GetOutputSizePixel().Height()-2*aTxtSize.Height());
- aPrivatSplit.SetYRange(aYRange);
+ aPrivatSplit->SetYRange(aYRange);
if(aOldSize.Width()!=aNewSize.Width())
SetMyWidthLeRi(aNewSize);
@@ -396,23 +409,23 @@ void ScFunctionDockWin::SetMyWidthLeRi(Size &aNewSize)
{
if((sal_uLong)aNewSize.Width()<nMinWidth) aNewSize.Width()=nMinWidth;
- Size aCDSize=aCatBox.GetSizePixel();
- Size aFLSize=aFuncList.GetSizePixel();
- Size aSplitterSize=aPrivatSplit.GetSizePixel();
- Size aFDSize=aFiFuncDesc.GetSizePixel();
+ Size aCDSize=aCatBox->GetSizePixel();
+ Size aFLSize=aFuncList->GetSizePixel();
+ Size aSplitterSize=aPrivatSplit->GetSizePixel();
+ Size aFDSize=aFiFuncDesc->GetSizePixel();
- Point aCDTopLeft=aCatBox.GetPosPixel();
- Point aFLTopLeft=aFuncList.GetPosPixel();
+ Point aCDTopLeft=aCatBox->GetPosPixel();
+ Point aFLTopLeft=aFuncList->GetPosPixel();
aCDSize.Width()=aNewSize.Width()-aCDTopLeft.X()-aFLTopLeft.X();
aFLSize.Width()=aNewSize.Width()-2*aFLTopLeft.X();
aFDSize.Width()=aFLSize.Width();
aSplitterSize.Width()=aFLSize.Width();
- aCatBox.SetSizePixel(aCDSize);
- aFuncList.SetSizePixel(aFLSize);
- aPrivatSplit.SetSizePixel(aSplitterSize);
- aFiFuncDesc.SetSizePixel(aFDSize);
+ aCatBox->SetSizePixel(aCDSize);
+ aFuncList->SetSizePixel(aFLSize);
+ aPrivatSplit->SetSizePixel(aSplitterSize);
+ aFiFuncDesc->SetSizePixel(aFDSize);
}
/*************************************************************************
@@ -434,18 +447,18 @@ void ScFunctionDockWin::SetMyHeightLeRi(Size &aNewSize)
{
if((sal_uLong)aNewSize.Height()<nMinHeight) aNewSize.Height()=nMinHeight;
- Size aFLSize=aFuncList.GetSizePixel();
- Size aSplitterSize=aPrivatSplit.GetSizePixel();
- Size aFDSize=aFiFuncDesc.GetSizePixel();
+ Size aFLSize=aFuncList->GetSizePixel();
+ Size aSplitterSize=aPrivatSplit->GetSizePixel();
+ Size aFDSize=aFiFuncDesc->GetSizePixel();
- Point aFLTopLeft=aFuncList.GetPosPixel();
- Point aSplitterTopLeft=aPrivatSplit.GetPosPixel();
- Point aFDTopLeft=aFiFuncDesc.GetPosPixel();
+ Point aFLTopLeft=aFuncList->GetPosPixel();
+ Point aSplitterTopLeft=aPrivatSplit->GetPosPixel();
+ Point aFDTopLeft=aFiFuncDesc->GetPosPixel();
- long nTxtHeight = aFuncList.GetTextHeight();
+ long nTxtHeight = aFuncList->GetTextHeight();
short nY=(short)(3*nTxtHeight+
- aFuncList.GetPosPixel().Y()+aSplitterSize.Height());
+ aFuncList->GetPosPixel().Y()+aSplitterSize.Height());
aFDTopLeft.Y()=aNewSize.Height()-aFDSize.Height()-4;
if(nY>aFDTopLeft.Y())
@@ -456,10 +469,10 @@ void ScFunctionDockWin::SetMyHeightLeRi(Size &aNewSize)
aSplitterTopLeft.Y()=aFDTopLeft.Y()-aSplitterSize.Height()-1;
aFLSize.Height()=aSplitterTopLeft.Y()-aFLTopLeft.Y()-1;
- aFuncList.SetSizePixel(aFLSize);
- aPrivatSplit.SetPosPixel(aSplitterTopLeft);
- aFiFuncDesc.SetPosPixel(aFDTopLeft);
- aFiFuncDesc.SetSizePixel(aFDSize);
+ aFuncList->SetSizePixel(aFLSize);
+ aPrivatSplit->SetPosPixel(aSplitterTopLeft);
+ aFiFuncDesc->SetPosPixel(aFDTopLeft);
+ aFiFuncDesc->SetSizePixel(aFDSize);
}
@@ -483,13 +496,13 @@ void ScFunctionDockWin::SetMyWidthToBo(Size &aNewSize)
{
if((sal_uLong)aNewSize.Width()<nMinWidth) aNewSize.Width()=nMinWidth;
- Size aCDSize=aCatBox.GetSizePixel();
- Size aDdFLSize=aDDFuncList.GetSizePixel();
- Size aFDSize=aFiFuncDesc.GetSizePixel();
+ Size aCDSize=aCatBox->GetSizePixel();
+ Size aDdFLSize=aDDFuncList->GetSizePixel();
+ Size aFDSize=aFiFuncDesc->GetSizePixel();
- Point aCDTopLeft=aCatBox.GetPosPixel();
- Point aDdFLTopLeft=aDDFuncList.GetPosPixel();
- Point aFDTopLeft=aFiFuncDesc.GetPosPixel();
+ Point aCDTopLeft=aCatBox->GetPosPixel();
+ Point aDdFLTopLeft=aDDFuncList->GetPosPixel();
+ Point aFDTopLeft=aFiFuncDesc->GetPosPixel();
aCDSize.Width()=aDdFLTopLeft.X()-aFDTopLeft.X()-aCDTopLeft.X();
aDdFLTopLeft.X()=aCDSize.Width()+aCDTopLeft.X()+aFDTopLeft.X();
@@ -498,10 +511,10 @@ void ScFunctionDockWin::SetMyWidthToBo(Size &aNewSize)
aFDSize.Width()=aNewSize.Width()-2*aFDTopLeft.X();
- aDDFuncList.SetPosPixel(aDdFLTopLeft);
- aDDFuncList.SetSizePixel(aDdFLSize);
- aCatBox.SetSizePixel(aCDSize);
- aFiFuncDesc.SetSizePixel(aFDSize);
+ aDDFuncList->SetPosPixel(aDdFLTopLeft);
+ aDDFuncList->SetSizePixel(aDdFLSize);
+ aCatBox->SetSizePixel(aCDSize);
+ aFiFuncDesc->SetSizePixel(aFDSize);
}
/*************************************************************************
@@ -524,12 +537,12 @@ void ScFunctionDockWin::SetMyHeightToBo(Size &aNewSize)
{
if((sal_uLong)aNewSize.Height()<nMinHeight) aNewSize.Height()=nMinHeight;
- Size aFDSize=aFiFuncDesc.GetSizePixel();
+ Size aFDSize=aFiFuncDesc->GetSizePixel();
- Point aFDTopLeft=aFiFuncDesc.GetPosPixel();
- Point aCBTopLeft=aCatBox.GetPosPixel();
+ Point aFDTopLeft=aFiFuncDesc->GetPosPixel();
+ Point aCBTopLeft=aCatBox->GetPosPixel();
aFDSize.Height()=aNewSize.Height()-aFDTopLeft.Y()-aCBTopLeft.Y();
- aFiFuncDesc.SetSizePixel(aFDSize);
+ aFiFuncDesc->SetSizePixel(aFDSize);
}
@@ -549,7 +562,7 @@ void ScFunctionDockWin::SetMyHeightToBo(Size &aNewSize)
void ScFunctionDockWin::SetDescription()
{
- aFiFuncDesc.SetText( EMPTY_OUSTRING );
+ aFiFuncDesc->SetText( EMPTY_OUSTRING );
const ScFuncDesc* pDesc =
static_cast<const ScFuncDesc*>(pAllFuncList->GetEntryData(
pAllFuncList->GetSelectEntryPos() ));
@@ -580,10 +593,10 @@ void ScFunctionDockWin::SetDescription()
aBuf.append(*pDesc->pFuncDesc);
- aFiFuncDesc.SetText(aBuf.makeStringAndClear());
- aFiFuncDesc.StateChanged(StateChangedType::TEXT);
- aFiFuncDesc.Invalidate();
- aFiFuncDesc.Update();
+ aFiFuncDesc->SetText(aBuf.makeStringAndClear());
+ aFiFuncDesc->StateChanged(StateChangedType::TEXT);
+ aFiFuncDesc->Invalidate();
+ aFiFuncDesc->Update();
}
}
@@ -641,7 +654,7 @@ SfxChildAlignment ScFunctionDockWin::CheckAlignment(SfxChildAlignment /* abla */
SfxChildAlignment aChildAlign)
{
OUString aString("ww");
- Size aTxtSize( aFiFuncDesc.GetTextWidth(aString), aFiFuncDesc.GetTextHeight() );
+ Size aTxtSize( aFiFuncDesc->GetTextWidth(aString), aFiFuncDesc->GetTextHeight() );
if(!bInit)
{
eSfxOldAlignment=eSfxNewAlignment;
@@ -671,14 +684,14 @@ SfxChildAlignment ScFunctionDockWin::CheckAlignment(SfxChildAlignment /* abla */
case SfxChildAlignment::NOALIGNMENT:
- aString = aCatBox.GetEntry(0);
+ aString = aCatBox->GetEntry(0);
aString += "www";
- aTxtSize = Size( aFiFuncDesc.GetTextWidth(aString),
- aFiFuncDesc.GetTextHeight() );
+ aTxtSize = Size( aFiFuncDesc->GetTextWidth(aString),
+ aFiFuncDesc->GetTextHeight() );
// fall-through
- default: Point aTopLeft=aCatBox.GetPosPixel();
+ default: Point aTopLeft=aCatBox->GetPosPixel();
nMinWidth=aTxtSize.Width()+aTopLeft.X()
- +2*aFuncList.GetPosPixel().X();
+ +2*aFuncList->GetPosPixel().X();
nMinHeight=19*aTxtSize.Height();
break;
@@ -733,7 +746,7 @@ void ScFunctionDockWin::Resize()
void ScFunctionDockWin::UpdateFunctionList()
{
- sal_Int32 nSelPos = aCatBox.GetSelectEntryPos();
+ sal_Int32 nSelPos = aCatBox->GetSelectEntryPos();
sal_Int32 nCategory = ( LISTBOX_ENTRY_NOTFOUND != nSelPos )
? (nSelPos-1) : 0;
@@ -912,13 +925,13 @@ void ScFunctionDockWin::DoEnter()
IMPL_LINK( ScFunctionDockWin, SelHdl, ListBox*, pLb )
{
- if ( pLb == &aCatBox)
+ if ( pLb == aCatBox.get() )
{
UpdateFunctionList();
SetDescription();
}
- if ( pLb == &aFuncList||pLb == &aDDFuncList)
+ if ( pLb == aFuncList.get() || pLb == aDDFuncList.get() )
{
SetDescription();
}
@@ -944,8 +957,8 @@ IMPL_LINK( ScFunctionDockWin, SelHdl, ListBox*, pLb )
IMPL_LINK( ScFunctionDockWin, SetSelectionHdl, void*, pCtrl )
{
- if (static_cast<ImageButton *>(pCtrl) == &aInsertButton ||
- static_cast<ListBox *>(pCtrl) == &aFuncList)
+ if (static_cast<ImageButton *>(pCtrl) == aInsertButton.get() ||
+ static_cast<ListBox *>(pCtrl) == aFuncList.get())
{
DoEnter(); // Uebernimmt die Eingabe
}
@@ -970,19 +983,19 @@ IMPL_LINK( ScFunctionDockWin, SetSelectionHdl, void*, pCtrl )
IMPL_LINK( ScFunctionDockWin, SetSplitHdl, ScPrivatSplit*, pCtrl )
{
- if (pCtrl == &aPrivatSplit)
+ if (pCtrl == aPrivatSplit.get())
{
- short nDeltaY=aPrivatSplit.GetDeltaY();
- Size aFLSize=aFuncList.GetSizePixel();
- Size aFDSize=aFiFuncDesc.GetSizePixel();
- Point aFDTopLeft=aFiFuncDesc.GetPosPixel();
+ short nDeltaY=aPrivatSplit->GetDeltaY();
+ Size aFLSize=aFuncList->GetSizePixel();
+ Size aFDSize=aFiFuncDesc->GetSizePixel();
+ Point aFDTopLeft=aFiFuncDesc->GetPosPixel();
aFLSize.Height()+=nDeltaY;
aFDSize.Height()-=nDeltaY;
aFDTopLeft.Y()+=nDeltaY;
- aFuncList.SetSizePixel(aFLSize);
- aFiFuncDesc.SetPosPixel(aFDTopLeft);
- aFiFuncDesc.SetSizePixel(aFDSize);
+ aFuncList->SetSizePixel(aFLSize);
+ aFiFuncDesc->SetPosPixel(aFDTopLeft);
+ aFiFuncDesc->SetSizePixel(aFDSize);
}
return 0;
@@ -1040,13 +1053,13 @@ void ScFunctionDockWin::Initialize(SfxChildWinInfo *pInfo)
if ( !aStr.isEmpty())
{
- aSplitterInitPos = aPrivatSplit.GetPosPixel();
+ aSplitterInitPos = aPrivatSplit->GetPosPixel();
aSplitterInitPos.Y() = (sal_uInt16) aStr.toInt32();
sal_Int32 n1 = aStr.indexOf(';');
aStr = aStr.copy( n1+1 );
sal_Int32 nSelPos = aStr.toInt32();
- aCatBox.SelectEntryPos(nSelPos);
- SelHdl(&aCatBox);
+ aCatBox->SelectEntryPos(nSelPos);
+ SelHdl(aCatBox.get());
// if the window has already been shown (from SfxDockingWindow::Initialize if docked),
// set the splitter position now, otherwise it is set in StateChanged with type INITSHOW
@@ -1058,17 +1071,17 @@ void ScFunctionDockWin::Initialize(SfxChildWinInfo *pInfo)
void ScFunctionDockWin::FillInfo(SfxChildWinInfo& rInfo) const
{
SfxDockingWindow::FillInfo(rInfo);
- Point aPoint=aPrivatSplit.GetPosPixel();
+ Point aPoint=aPrivatSplit->GetPosPixel();
rInfo.aExtraString += "ScFuncList:(" +
OUString::number(aPoint.Y()) + ";" +
- OUString::number(aCatBox.GetSelectEntryPos()) + ")";
+ OUString::number(aCatBox->GetSelectEntryPos()) + ")";
}
void ScFunctionDockWin::UseSplitterInitPos()
{
- if ( IsVisible() && aPrivatSplit.IsEnabled() && aSplitterInitPos != Point() )
+ if ( IsVisible() && aPrivatSplit->IsEnabled() && aSplitterInitPos != Point() )
{
- aPrivatSplit.MoveSplitTo(aSplitterInitPos);
+ aPrivatSplit->MoveSplitTo(aSplitterInitPos);
aSplitterInitPos = Point(); // use only once
}
}
diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index 5909f3bf7dfe..e9f160fb13f8 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -241,6 +241,11 @@ void ScFormulaDlg::fill()
ScFormulaDlg::~ScFormulaDlg()
{
+ disposeOnce();
+}
+
+void ScFormulaDlg::dispose()
+{
ScModule* pScMod = SC_MOD();
ScFormEditData* pData = pScMod->GetFormEditData();
@@ -250,6 +255,7 @@ ScFormulaDlg::~ScFormulaDlg()
pScMod->SetRefInputHdl(NULL);
StoreFormEditData(pData);
}
+ formula::FormulaDlg::dispose();
}
bool ScFormulaDlg::IsInputHdl(ScInputHandler* pHdl)
diff --git a/sc/source/ui/inc/AccessibleCsvControl.hxx b/sc/source/ui/inc/AccessibleCsvControl.hxx
index 74753391a62c..a8f3180b3090 100644
--- a/sc/source/ui/inc/AccessibleCsvControl.hxx
+++ b/sc/source/ui/inc/AccessibleCsvControl.hxx
@@ -29,6 +29,7 @@
#include <cppuhelper/implbase2.hxx>
#include <editeng/AccessibleStaticTextBase.hxx>
#include <comphelper/uno3.hxx>
+#include <vcl/vclptr.hxx>
#include "AccessibleContextBase.hxx"
class ScCsvControl;
@@ -50,7 +51,7 @@ protected:
typedef ::com::sun::star::awt::Rectangle AwtRectangle;
private:
- ScCsvControl* mpControl; /// Pointer to the VCL control.
+ VclPtr<ScCsvControl> mpControl; /// Pointer to the VCL control.
public:
explicit ScAccessibleCsvControl(
diff --git a/sc/source/ui/inc/AccessibleEditObject.hxx b/sc/source/ui/inc/AccessibleEditObject.hxx
index 919a896a561f..4e6501929d18 100644
--- a/sc/source/ui/inc/AccessibleEditObject.hxx
+++ b/sc/source/ui/inc/AccessibleEditObject.hxx
@@ -24,6 +24,7 @@
#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
#include "global.hxx"
+#include <vcl/window.hxx>
namespace accessibility
{
@@ -188,7 +189,7 @@ public:
private:
accessibility::AccessibleTextHelper* mpTextHelper;
EditView* mpEditView;
- vcl::Window* mpWindow;
+ VclPtr<vcl::Window> mpWindow;
EditObjectType meObjectType;
bool mbHasFocus;
diff --git a/sc/source/ui/inc/AccessibleText.hxx b/sc/source/ui/inc/AccessibleText.hxx
index 9be73428bd3b..2d4601b6c92b 100644
--- a/sc/source/ui/inc/AccessibleText.hxx
+++ b/sc/source/ui/inc/AccessibleText.hxx
@@ -134,7 +134,7 @@ protected:
EditView* mpEditView;
EditEngine* mpEditEngine;
SvxEditEngineForwarder* mpForwarder;
- vcl::Window* mpWindow;
+ VclPtr<vcl::Window> mpWindow;
bool mbIsCloned;
};
@@ -274,7 +274,7 @@ private:
typedef ::std::unique_ptr< SvxTextForwarder > TextForwarderPtr;
typedef ::std::unique_ptr< ScCsvViewForwarder > ViewForwarderPtr;
- vcl::Window* mpWindow;
+ VclPtr<vcl::Window> mpWindow;
EditEngine* mpEditEngine;
TextForwarderPtr mpTextForwarder;
ViewForwarderPtr mpViewForwarder;
diff --git a/sc/source/ui/inc/AnalysisOfVarianceDialog.hxx b/sc/source/ui/inc/AnalysisOfVarianceDialog.hxx
index a6808a53b3e5..0b1d068149aa 100644
--- a/sc/source/ui/inc/AnalysisOfVarianceDialog.hxx
+++ b/sc/source/ui/inc/AnalysisOfVarianceDialog.hxx
@@ -33,10 +33,10 @@ private:
TWO_FACTOR
};
- NumericField* mpAlphaField;
- RadioButton* mpSingleFactorRadio;
- RadioButton* mpTwoFactorRadio;
- NumericField* mpRowsPerSampleField;
+ VclPtr<NumericField> mpAlphaField;
+ VclPtr<RadioButton> mpSingleFactorRadio;
+ VclPtr<RadioButton> mpTwoFactorRadio;
+ VclPtr<NumericField> mpRowsPerSampleField;
DECL_LINK(FactorChanged, void*);
@@ -55,6 +55,7 @@ public:
vcl::Window* pParent, ScViewData* pViewData );
virtual ~ScAnalysisOfVarianceDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool Close() SAL_OVERRIDE;
diff --git a/sc/source/ui/inc/ExponentialSmoothingDialog.hxx b/sc/source/ui/inc/ExponentialSmoothingDialog.hxx
index 9012c6755435..0f186b4f4252 100644
--- a/sc/source/ui/inc/ExponentialSmoothingDialog.hxx
+++ b/sc/source/ui/inc/ExponentialSmoothingDialog.hxx
@@ -24,7 +24,7 @@
class ScExponentialSmoothingDialog : public ScStatisticsInputOutputDialog
{
private:
- NumericField* mpSmoothingFactor;
+ VclPtr<NumericField> mpSmoothingFactor;
public:
ScExponentialSmoothingDialog(
@@ -32,6 +32,7 @@ public:
vcl::Window* pParent, ScViewData* pViewData );
virtual ~ScExponentialSmoothingDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool Close() SAL_OVERRIDE;
diff --git a/sc/source/ui/inc/MovingAverageDialog.hxx b/sc/source/ui/inc/MovingAverageDialog.hxx
index dab6acc8e5a2..f6aa85eb079b 100644
--- a/sc/source/ui/inc/MovingAverageDialog.hxx
+++ b/sc/source/ui/inc/MovingAverageDialog.hxx
@@ -24,7 +24,7 @@
class ScMovingAverageDialog : public ScStatisticsInputOutputDialog
{
private:
- NumericField* mpIntervalSpin;
+ VclPtr<NumericField> mpIntervalSpin;
public:
ScMovingAverageDialog(
@@ -32,6 +32,7 @@ public:
vcl::Window* pParent, ScViewData* pViewData );
virtual ~ScMovingAverageDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool Close() SAL_OVERRIDE;
diff --git a/sc/source/ui/inc/PivotLayoutDialog.hxx b/sc/source/ui/inc/PivotLayoutDialog.hxx
index c806a8ccb2ff..765990615a98 100644
--- a/sc/source/ui/inc/PivotLayoutDialog.hxx
+++ b/sc/source/ui/inc/PivotLayoutDialog.hxx
@@ -44,8 +44,8 @@ class ScPivotLayoutDialog : public ScAnyRefDlg
public:
ScDPObject maPivotTableObject;
- ScPivotLayoutTreeListBase* mpPreviouslyFocusedListBox;
- ScPivotLayoutTreeListBase* mpCurrentlyFocusedListBox;
+ VclPtr<ScPivotLayoutTreeListBase> mpPreviouslyFocusedListBox;
+ VclPtr<ScPivotLayoutTreeListBase> mpCurrentlyFocusedListBox;
private:
ScViewData* mpViewData;
@@ -53,38 +53,38 @@ private:
bool mbNewPivotTable;
- ScPivotLayoutTreeListLabel* mpListBoxField;
- ScPivotLayoutTreeList* mpListBoxPage;
- ScPivotLayoutTreeList* mpListBoxColumn;
- ScPivotLayoutTreeList* mpListBoxRow;
- ScPivotLayoutTreeListData* mpListBoxData;
+ VclPtr<ScPivotLayoutTreeListLabel> mpListBoxField;
+ VclPtr<ScPivotLayoutTreeList> mpListBoxPage;
+ VclPtr<ScPivotLayoutTreeList> mpListBoxColumn;
+ VclPtr<ScPivotLayoutTreeList> mpListBoxRow;
+ VclPtr<ScPivotLayoutTreeListData> mpListBoxData;
- CheckBox* mpCheckIgnoreEmptyRows;
- CheckBox* mpCheckTotalColumns;
- CheckBox* mpCheckAddFilter;
- CheckBox* mpCheckIdentifyCategories;
- CheckBox* mpCheckTotalRows;
- CheckBox* mpCheckDrillToDetail;
+ VclPtr<CheckBox> mpCheckIgnoreEmptyRows;
+ VclPtr<CheckBox> mpCheckTotalColumns;
+ VclPtr<CheckBox> mpCheckAddFilter;
+ VclPtr<CheckBox> mpCheckIdentifyCategories;
+ VclPtr<CheckBox> mpCheckTotalRows;
+ VclPtr<CheckBox> mpCheckDrillToDetail;
- RadioButton* mpSourceRadioNamedRange;
- RadioButton* mpSourceRadioSelection;
+ VclPtr<RadioButton> mpSourceRadioNamedRange;
+ VclPtr<RadioButton> mpSourceRadioSelection;
- ListBox* mpSourceListBox;
- formula::RefEdit* mpSourceEdit;
- formula::RefButton* mpSourceButton;
+ VclPtr<ListBox> mpSourceListBox;
+ VclPtr<formula::RefEdit> mpSourceEdit;
+ VclPtr<formula::RefButton> mpSourceButton;
- RadioButton* mpDestinationRadioNewSheet;
- RadioButton* mpDestinationRadioNamedRange;
- RadioButton* mpDestinationRadioSelection;
+ VclPtr<RadioButton> mpDestinationRadioNewSheet;
+ VclPtr<RadioButton> mpDestinationRadioNamedRange;
+ VclPtr<RadioButton> mpDestinationRadioSelection;
- ListBox* mpDestinationListBox;
- formula::RefEdit* mpDestinationEdit;
- formula::RefButton* mpDestinationButton;
+ VclPtr<ListBox> mpDestinationListBox;
+ VclPtr<formula::RefEdit> mpDestinationEdit;
+ VclPtr<formula::RefButton> mpDestinationButton;
- PushButton* mpBtnOK;
- CancelButton* mpBtnCancel;
+ VclPtr<PushButton> mpBtnOK;
+ VclPtr<CancelButton> mpBtnCancel;
- formula::RefEdit* mpActiveEdit;
+ VclPtr<formula::RefEdit> mpActiveEdit;
ScAddress::Details maAddressDetails;
bool mbDialogLostFocus;
@@ -111,6 +111,7 @@ public:
ScPivotLayoutDialog(SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow, vcl::Window* pParent,
ScViewData* pViewData, const ScDPObject* pPivotTableObject, bool bCreateNewPivotTable);
virtual ~ScPivotLayoutDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual void SetReference(const ScRange& rReferenceRange, ScDocument* pDocument) SAL_OVERRIDE;
virtual void SetActive() SAL_OVERRIDE;
diff --git a/sc/source/ui/inc/PivotLayoutTreeListBase.hxx b/sc/source/ui/inc/PivotLayoutTreeListBase.hxx
index 7812674a351c..4ce7740f2bb9 100644
--- a/sc/source/ui/inc/PivotLayoutTreeListBase.hxx
+++ b/sc/source/ui/inc/PivotLayoutTreeListBase.hxx
@@ -35,13 +35,14 @@ public:
protected:
SvPivotTreeListType meType;
- ScPivotLayoutDialog* mpParent;
+ VclPtr<ScPivotLayoutDialog> mpParent;
public:
void Setup(ScPivotLayoutDialog* pParent);
ScPivotLayoutTreeListBase(vcl::Window* pParent, WinBits nBits, SvPivotTreeListType eType = UNDEFINED);
virtual ~ScPivotLayoutTreeListBase();
+ virtual void dispose() SAL_OVERRIDE;
virtual sal_Int8 AcceptDrop(const AcceptDropEvent& rEvent) SAL_OVERRIDE;
virtual bool NotifyAcceptDrop(SvTreeListEntry* pEntry) SAL_OVERRIDE;
diff --git a/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx b/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx
index b1736b2661c0..6d791c27c2a4 100644
--- a/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx
+++ b/sc/source/ui/inc/RandomNumberGeneratorDialog.hxx
@@ -29,6 +29,7 @@ public:
vcl::Window* pParent, ScViewData* pViewData );
virtual ~ScRandomNumberGeneratorDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) SAL_OVERRIDE;
virtual void SetActive() SAL_OVERRIDE;
@@ -36,21 +37,21 @@ public:
private:
// Widgets
- FixedText* mpInputRangeText;
- formula::RefEdit* mpInputRangeEdit;
- formula::RefButton* mpInputRangeButton;
- ListBox* mpDistributionCombo;
- FixedText* mpParameter1Text;
- NumericField* mpParameter1Value;
- FixedText* mpParameter2Text;
- NumericField* mpParameter2Value;
- NumericField* mpSeed;
- CheckBox* mpEnableSeed;
- NumericField* mpDecimalPlaces;
- CheckBox* mpEnableRounding;
- PushButton* mpButtonApply;
- OKButton* mpButtonOk;
- CloseButton* mpButtonClose;
+ VclPtr<FixedText> mpInputRangeText;
+ VclPtr<formula::RefEdit> mpInputRangeEdit;
+ VclPtr<formula::RefButton> mpInputRangeButton;
+ VclPtr<ListBox> mpDistributionCombo;
+ VclPtr<FixedText> mpParameter1Text;
+ VclPtr<NumericField> mpParameter1Value;
+ VclPtr<FixedText> mpParameter2Text;
+ VclPtr<NumericField> mpParameter2Value;
+ VclPtr<NumericField> mpSeed;
+ VclPtr<CheckBox> mpEnableSeed;
+ VclPtr<NumericField> mpDecimalPlaces;
+ VclPtr<CheckBox> mpEnableRounding;
+ VclPtr<PushButton> mpButtonApply;
+ VclPtr<OKButton> mpButtonOk;
+ VclPtr<CloseButton> mpButtonClose;
// Data
ScViewData* mpViewData;
diff --git a/sc/source/ui/inc/SamplingDialog.hxx b/sc/source/ui/inc/SamplingDialog.hxx
index 022b5e8075d0..6622ad90cd4c 100644
--- a/sc/source/ui/inc/SamplingDialog.hxx
+++ b/sc/source/ui/inc/SamplingDialog.hxx
@@ -27,30 +27,31 @@ public:
vcl::Window* pParent, ScViewData* pViewData );
virtual ~ScSamplingDialog();
+ virtual void dispose() SAL_OVERRIDE;
- virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) SAL_OVERRIDE;
- virtual void SetActive() SAL_OVERRIDE;
+ virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) SAL_OVERRIDE;
+ virtual void SetActive() SAL_OVERRIDE;
virtual bool Close() SAL_OVERRIDE;
private:
// Widgets
- FixedText* mpInputRangeLabel;
- formula::RefEdit* mpInputRangeEdit;
- formula::RefButton* mpInputRangeButton;
+ VclPtr<FixedText> mpInputRangeLabel;
+ VclPtr<formula::RefEdit> mpInputRangeEdit;
+ VclPtr<formula::RefButton> mpInputRangeButton;
- FixedText* mpOutputRangeLabel;
- formula::RefEdit* mpOutputRangeEdit;
- formula::RefButton* mpOutputRangeButton;
+ VclPtr<FixedText> mpOutputRangeLabel;
+ VclPtr<formula::RefEdit> mpOutputRangeEdit;
+ VclPtr<formula::RefButton> mpOutputRangeButton;
- NumericField* mpSampleSize;
- NumericField* mpPeriod;
+ VclPtr<NumericField> mpSampleSize;
+ VclPtr<NumericField> mpPeriod;
- RadioButton* mpRandomMethodRadio;
- RadioButton* mpPeriodicMethodRadio;
+ VclPtr<RadioButton> mpRandomMethodRadio;
+ VclPtr<RadioButton> mpPeriodicMethodRadio;
- OKButton* mpButtonOk;
+ VclPtr<OKButton> mpButtonOk;
- formula::RefEdit* mpActiveEdit;
+ VclPtr<formula::RefEdit> mpActiveEdit;
// Data
ScViewData* mViewData;
diff --git a/sc/source/ui/inc/StatisticsInputOutputDialog.hxx b/sc/source/ui/inc/StatisticsInputOutputDialog.hxx
index 520ec223a784..c18119c0b4ec 100644
--- a/sc/source/ui/inc/StatisticsInputOutputDialog.hxx
+++ b/sc/source/ui/inc/StatisticsInputOutputDialog.hxx
@@ -33,6 +33,7 @@ public:
const OUString& rID, const OUString& rUIXMLDescription );
virtual ~ScStatisticsInputOutputDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) SAL_OVERRIDE;
virtual void SetActive() SAL_OVERRIDE;
@@ -44,16 +45,16 @@ protected:
virtual sal_Int16 GetUndoNameId() = 0;
// Widgets
- FixedText* mpInputRangeLabel;
- formula::RefEdit* mpInputRangeEdit;
- formula::RefButton* mpInputRangeButton;
+ VclPtr<FixedText> mpInputRangeLabel;
+ VclPtr<formula::RefEdit> mpInputRangeEdit;
+ VclPtr<formula::RefButton> mpInputRangeButton;
- FixedText* mpOutputRangeLabel;
- formula::RefEdit* mpOutputRangeEdit;
- formula::RefButton* mpOutputRangeButton;
+ VclPtr<FixedText> mpOutputRangeLabel;
+ VclPtr<formula::RefEdit> mpOutputRangeEdit;
+ VclPtr<formula::RefButton> mpOutputRangeButton;
- RadioButton* mpGroupByColumnsRadio;
- RadioButton* mpGroupByRowsRadio;
+ VclPtr<RadioButton> mpGroupByColumnsRadio;
+ VclPtr<RadioButton> mpGroupByRowsRadio;
// Data
ScViewData* mViewData;
@@ -69,9 +70,9 @@ protected:
private:
// Widgets
- OKButton* mpButtonOk;
+ VclPtr<OKButton> mpButtonOk;
- formula::RefEdit* mpActiveEdit;
+ VclPtr<formula::RefEdit> mpActiveEdit;
ScAddress mCurrentAddress;
bool mDialogLostFocus;
diff --git a/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx b/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx
index db4514ab49f9..b0a48e1dcbc7 100644
--- a/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx
+++ b/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx
@@ -33,6 +33,7 @@ public:
const OUString& rID, const OUString& rUIXMLDescription );
virtual ~ScStatisticsTwoVariableDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) SAL_OVERRIDE;
virtual void SetActive() SAL_OVERRIDE;
@@ -44,17 +45,17 @@ protected:
virtual sal_Int16 GetUndoNameId() = 0;
// Widgets
- FixedText* mpVariable1RangeLabel;
- formula::RefEdit* mpVariable1RangeEdit;
- formula::RefButton* mpVariable1RangeButton;
+ VclPtr<FixedText> mpVariable1RangeLabel;
+ VclPtr<formula::RefEdit> mpVariable1RangeEdit;
+ VclPtr<formula::RefButton> mpVariable1RangeButton;
- FixedText* mpVariable2RangeLabel;
- formula::RefEdit* mpVariable2RangeEdit;
- formula::RefButton* mpVariable2RangeButton;
+ VclPtr<FixedText> mpVariable2RangeLabel;
+ VclPtr<formula::RefEdit> mpVariable2RangeEdit;
+ VclPtr<formula::RefButton> mpVariable2RangeButton;
- FixedText* mpOutputRangeLabel;
- formula::RefEdit* mpOutputRangeEdit;
- formula::RefButton* mpOutputRangeButton;
+ VclPtr<FixedText> mpOutputRangeLabel;
+ VclPtr<formula::RefEdit> mpOutputRangeEdit;
+ VclPtr<formula::RefButton> mpOutputRangeButton;
// Data
ScViewData* mViewData;
@@ -69,12 +70,12 @@ protected:
private:
// Widgets
- OKButton* mpButtonOk;
+ VclPtr<OKButton> mpButtonOk;
- RadioButton* mpGroupByColumnsRadio;
- RadioButton* mpGroupByRowsRadio;
+ VclPtr<RadioButton> mpGroupByColumnsRadio;
+ VclPtr<RadioButton> mpGroupByRowsRadio;
- formula::RefEdit* mpActiveEdit;
+ VclPtr<formula::RefEdit> mpActiveEdit;
ScAddress mCurrentAddress;
bool mDialogLostFocus;
diff --git a/sc/source/ui/inc/acredlin.hxx b/sc/source/ui/inc/acredlin.hxx
index 5f10898ba278..c8252fd9db0b 100644
--- a/sc/source/ui/inc/acredlin.hxx
+++ b/sc/source/ui/inc/acredlin.hxx
@@ -98,13 +98,13 @@ private:
Idle aSelectionIdle;
Idle aReOpenIdle;
- SvxAcceptChgCtr* m_pAcceptChgCtr;
+ VclPtr<SvxAcceptChgCtr> m_pAcceptChgCtr;
ScViewData* pViewData;
ScDocument* pDoc;
ScRangeName aLocalRangeName;
- SvxTPFilter* pTPFilter;
- SvxTPView* pTPView;
- SvxRedlinTable* pTheView; // #i48648 now SvHeaderTabListBox
+ VclPtr<SvxTPFilter> pTPFilter;
+ VclPtr<SvxTPView> pTPView;
+ VclPtr<SvxRedlinTable> pTheView; // #i48648 now SvHeaderTabListBox
ScRangeList aRangeList;
ScChangeViewSettings aChangeViewSet;
OUString aStrInsertCols;
@@ -206,6 +206,7 @@ public:
ScViewData* ptrViewData);
virtual ~ScAcceptChgDlg();
+ virtual void dispose() SAL_OVERRIDE;
void ReInit(ScViewData* ptrViewData);
diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx
index 4a7ee80233f9..833b541709dc 100644
--- a/sc/source/ui/inc/anyrefdg.hxx
+++ b/sc/source/ui/inc/anyrefdg.hxx
@@ -45,13 +45,13 @@ class ScFormulaReferenceHelper
{
IAnyRefDialog* m_pDlg;
::std::unique_ptr<ScCompiler> pRefComp;
- formula::RefEdit* pRefEdit; // active input field
- formula::RefButton* pRefBtn; // associated button
- vcl::Window* m_pWindow;
+ VclPtr<formula::RefEdit> pRefEdit; // active input field
+ VclPtr<formula::RefButton> pRefBtn; // associated button
+ VclPtr<vcl::Window> m_pWindow;
SfxBindings* m_pBindings;
::std::unique_ptr<Accelerator>
pAccel; // for Enter/Escape
- ::std::vector<vcl::Window*> m_aHiddenWidgets; // vector of hidden Controls
+ ::std::vector<VclPtr<vcl::Window> > m_aHiddenWidgets; // vector of hidden Controls
sal_Int32 m_nOldBorderWidth; // border width for expanded dialog
SCTAB nRefTab; // used for ShowReference
@@ -61,7 +61,7 @@ class ScFormulaReferenceHelper
Size aOldEditSize; // Original size of the input field
long mnOldEditWidthReq;
Point aOldButtonPos; // Original position of the button
- vcl::Window* mpOldEditParent; // Original parent of the edit field and the button
+ VclPtr<vcl::Window> mpOldEditParent; // Original parent of the edit field and the button
bool mbOldDlgLayoutEnabled; // Original layout state of parent dialog
bool mbOldEditParentLayoutEnabled; // Original layout state of edit widget parent
@@ -106,11 +106,11 @@ public:
class SC_DLLPUBLIC ScRefHandler :
public IAnyRefDialog
{
- vcl::Window & m_rWindow;
- bool m_bInRefMode;
+ VclPtr<vcl::Window> m_rWindow;
+ bool m_bInRefMode;
public:
- operator vcl::Window *(){ return &m_rWindow; }
+ operator vcl::Window *(){ return m_rWindow.get(); }
vcl::Window* operator ->() { return static_cast<vcl::Window *>(*this); }
friend class formula::RefButton;
friend class formula::RefEdit;
@@ -120,7 +120,7 @@ private:
m_aHelper;
SfxBindings* pMyBindings;
- vcl::Window* pActiveWin;
+ VclPtr<vcl::Window> pActiveWin;
Idle aIdle;
OUString aDocName; // document on which the dialog was opened
diff --git a/sc/source/ui/inc/areasdlg.hxx b/sc/source/ui/inc/areasdlg.hxx
index dab930898c55..dbc09faa4467 100644
--- a/sc/source/ui/inc/areasdlg.hxx
+++ b/sc/source/ui/inc/areasdlg.hxx
@@ -1,4 +1,3 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
@@ -35,6 +34,7 @@ class ScPrintAreasDlg : public ScAnyRefDlg
public:
ScPrintAreasDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent );
virtual ~ScPrintAreasDlg();
+ virtual void dispose() SAL_OVERRIDE;
virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) SAL_OVERRIDE;
virtual void AddRefEntry() SAL_OVERRIDE;
@@ -46,23 +46,23 @@ public:
virtual bool Close() SAL_OVERRIDE;
private:
- ListBox* pLbPrintArea;
- formula::RefEdit* pEdPrintArea;
- formula::RefButton* pRbPrintArea;
+ VclPtr<ListBox> pLbPrintArea;
+ VclPtr<formula::RefEdit> pEdPrintArea;
+ VclPtr<formula::RefButton> pRbPrintArea;
- ListBox* pLbRepeatRow;
- formula::RefEdit* pEdRepeatRow;
- formula::RefButton* pRbRepeatRow;
+ VclPtr<ListBox> pLbRepeatRow;
+ VclPtr<formula::RefEdit> pEdRepeatRow;
+ VclPtr<formula::RefButton> pRbRepeatRow;
- ListBox* pLbRepeatCol;
- formula::RefEdit* pEdRepeatCol;
- formula::RefButton* pRbRepeatCol;
+ VclPtr<ListBox> pLbRepeatCol;
+ VclPtr<formula::RefEdit> pEdRepeatCol;
+ VclPtr<formula::RefButton> pRbRepeatCol;
- OKButton* pBtnOk;
- CancelButton* pBtnCancel;
+ VclPtr<OKButton> pBtnOk;
+ VclPtr<CancelButton> pBtnCancel;
bool bDlgLostFocus;
- formula::RefEdit* pRefInputEdit;
+ VclPtr<formula::RefEdit> pRefInputEdit;
ScDocument* pDoc;
ScViewData* pViewData;
SCTAB nCurTab;
diff --git a/sc/source/ui/inc/autofmt.hxx b/sc/source/ui/inc/autofmt.hxx
index 59879825d07b..8227376434f3 100644
--- a/sc/source/ui/inc/autofmt.hxx
+++ b/sc/source/ui/inc/autofmt.hxx
@@ -46,6 +46,7 @@ public:
ScAutoFmtPreview(vcl::Window* pParent);
void DetectRTL(ScViewData *pViewData);
virtual ~ScAutoFmtPreview();
+ virtual void dispose() SAL_OVERRIDE;
void NotifyChange( ScAutoFormatData* pNewData );
@@ -55,7 +56,7 @@ protected:
private:
ScAutoFormatData* pCurData;
- VirtualDevice aVD;
+ ScopedVclPtrInstance<VirtualDevice> aVD;
SvtScriptedTextHelper aScriptedText;
::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > xBreakIter;
bool bFitWidth;
diff --git a/sc/source/ui/inc/cbutton.hxx b/sc/source/ui/inc/cbutton.hxx
index f6b15a68ccea..2e8c8b1eac53 100644
--- a/sc/source/ui/inc/cbutton.hxx
+++ b/sc/source/ui/inc/cbutton.hxx
@@ -22,6 +22,7 @@
#include <tools/gen.hxx>
#include <tools/color.hxx>
+#include <vcl/vclptr.hxx>
class OutputDevice;
@@ -60,7 +61,7 @@ private:
bool bState );
protected:
- OutputDevice* pOut;
+ VclPtr<OutputDevice> pOut;
Point aBtnPos;
Size aBtnSize;
};
diff --git a/sc/source/ui/inc/checklistmenu.hxx b/sc/source/ui/inc/checklistmenu.hxx
index aea85074aba1..11dc8ddf0108 100644
--- a/sc/source/ui/inc/checklistmenu.hxx
+++ b/sc/source/ui/inc/checklistmenu.hxx
@@ -48,6 +48,7 @@ public:
explicit ScMenuFloatingWindow(vcl::Window* pParent, ScDocument* pDoc, sal_uInt16 nMenuStackLevel = 0);
virtual ~ScMenuFloatingWindow();
+ void dispose() SAL_OVERRIDE;
virtual void PopupModeEnd() SAL_OVERRIDE;
virtual void MouseMove(const MouseEvent& rMEvt) SAL_OVERRIDE;
@@ -148,7 +149,7 @@ private:
bool mbSeparator:1;
::boost::shared_ptr<Action> mpAction;
- ::boost::shared_ptr<ScMenuFloatingWindow> mpSubMenuWin;
+ VclPtr<ScMenuFloatingWindow> mpSubMenuWin;
MenuItemData();
};
@@ -158,7 +159,7 @@ private:
struct SubMenuItemData
{
Timer maTimer;
- ScMenuFloatingWindow* mpSubMenu;
+ VclPtr<ScMenuFloatingWindow> mpSubMenu;
size_t mnMenuPos;
DECL_LINK( TimeoutHdl, void* );
@@ -167,7 +168,7 @@ private:
void reset();
private:
- ScMenuFloatingWindow* mpParent;
+ VclPtr<ScMenuFloatingWindow> mpParent;
};
SubMenuItemData maOpenTimer;
SubMenuItemData maCloseTimer;
@@ -184,7 +185,7 @@ private:
ScDocument* mpDoc;
- ScMenuFloatingWindow* mpParentMenu;
+ VclPtr<ScMenuFloatingWindow> mpParentMenu;
};
class ScCheckListBox : public SvTreeListBox
@@ -196,7 +197,8 @@ class ScCheckListBox : public SvTreeListBox
public:
ScCheckListBox( vcl::Window* pParent, WinBits nWinStyle = 0 );
- virtual ~ScCheckListBox() { delete mpCheckButton; }
+ virtual ~ScCheckListBox() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE { delete mpCheckButton; SvTreeListBox::dispose(); }
void Init();
void CheckEntry( const OUString& sName, SvTreeListEntry* pParent, bool bCheck = true );
void CheckEntry( SvTreeListEntry* pEntry, bool bCheck = true );
@@ -238,6 +240,7 @@ public:
explicit ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* pDoc);
virtual ~ScCheckListMenuWindow();
+ virtual void dispose() SAL_OVERRIDE;
virtual void MouseMove(const MouseEvent& rMEvt) SAL_OVERRIDE;
virtual bool Notify(NotifyEvent& rNEvt) SAL_OVERRIDE;
@@ -291,11 +294,13 @@ private:
{
public:
CancelButton(ScCheckListMenuWindow* pParent);
+ virtual ~CancelButton();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Click() SAL_OVERRIDE;
private:
- ScCheckListMenuWindow* mpParent;
+ VclPtr<ScCheckListMenuWindow> mpParent;
};
enum SectionType {
@@ -329,18 +334,17 @@ private:
private:
SvTreeListEntry* findEntry( SvTreeListEntry* pParent, const OUString& rText );
- Edit maEdSearch;
+ VclPtr<Edit> maEdSearch;
+ VclPtr<ScCheckListBox> maChecks;
- ScCheckListBox maChecks;
+ VclPtr<TriStateBox> maChkToggleAll;
+ VclPtr<ImageButton> maBtnSelectSingle;
+ VclPtr<ImageButton> maBtnUnselectSingle;
- TriStateBox maChkToggleAll;
- ImageButton maBtnSelectSingle;
- ImageButton maBtnUnselectSingle;
+ VclPtr<OKButton> maBtnOk;
+ VclPtr<CancelButton> maBtnCancel;
- OKButton maBtnOk;
- CancelButton maBtnCancel;
-
- ::std::vector<vcl::Window*> maTabStopCtrls;
+ ::std::vector<VclPtr<vcl::Window> > maTabStopCtrls;
size_t mnCurTabStop;
::std::vector<Member> maMembers;
diff --git a/sc/source/ui/inc/colorformat.hxx b/sc/source/ui/inc/colorformat.hxx
index a3003755ca4b..9c0dca889596 100644
--- a/sc/source/ui/inc/colorformat.hxx
+++ b/sc/source/ui/inc/colorformat.hxx
@@ -23,24 +23,24 @@ class ScDocument;
class ScDataBarSettingsDlg : public ModalDialog
{
private:
- OKButton* mpBtnOk;
- CancelButton* mpBtnCancel;
+ VclPtr<OKButton> mpBtnOk;
+ VclPtr<CancelButton> mpBtnCancel;
- ColorListBox* mpLbPos;
- ColorListBox* mpLbNeg;
- ColorListBox* mpLbAxisCol;
+ VclPtr<ColorListBox> mpLbPos;
+ VclPtr<ColorListBox> mpLbNeg;
+ VclPtr<ColorListBox> mpLbFillType;
+ VclPtr<ColorListBox> mpLbAxisCol;
- ListBox* mpLbTypeMin;
- ListBox* mpLbTypeMax;
- ListBox* mpLbFillType;
- ListBox* mpLbAxisPos;
+ VclPtr<ListBox> mpLbTypeMin;
+ VclPtr<ListBox> mpLbTypeMax;
+ VclPtr<ListBox> mpLbAxisPos;
- Edit* mpEdMin;
- Edit* mpEdMax;
- Edit* mpLenMin;
- Edit* mpLenMax;
+ VclPtr<Edit> mpEdMin;
+ VclPtr<Edit> mpEdMax;
+ VclPtr<Edit> mpLenMin;
+ VclPtr<Edit> mpLenMax;
- CheckBox *mpCbOnlyBar;
+ VclPtr<CheckBox> mpCbOnlyBar;
OUString maStrWarnSameValue;
SvNumberFormatter* mpNumberFormatter;
@@ -56,6 +56,8 @@ private:
public:
ScDataBarSettingsDlg(vcl::Window* pParent, const ScDataBarFormatData& rData, ScDocument* pDoc, const ScAddress& rPos);
+ virtual ~ScDataBarSettingsDlg();
+ virtual void dispose() SAL_OVERRIDE;
ScDataBarFormatData* GetData();
};
diff --git a/sc/source/ui/inc/condformatdlg.hxx b/sc/source/ui/inc/condformatdlg.hxx
index 6f6d2c0c7d04..eaf90aa2dcfb 100644
--- a/sc/source/ui/inc/condformatdlg.hxx
+++ b/sc/source/ui/inc/condformatdlg.hxx
@@ -22,8 +22,6 @@
#include "rangelst.hxx"
#include "condformathelper.hxx"
-#include <boost/ptr_container/ptr_vector.hpp>
-#include <boost/scoped_ptr.hpp>
#include "anyrefdg.hxx"
class ScDocument;
@@ -56,21 +54,23 @@ class ScCondFormatDlg;
class ScCondFormatList : public Control
{
private:
- typedef boost::ptr_vector<ScCondFrmtEntry> EntryContainer;
+ typedef std::vector<VclPtr<ScCondFrmtEntry>> EntryContainer;
EntryContainer maEntries;
bool mbHasScrollBar;
- boost::scoped_ptr<ScrollBar> mpScrollBar;
+ VclPtr<ScrollBar> mpScrollBar;
ScDocument* mpDoc;
ScAddress maPos;
ScRangeList maRanges;
- ScCondFormatDlg* mpDialogParent;
+ VclPtr<ScCondFormatDlg> mpDialogParent;
void DoScroll(long nDiff);
public:
ScCondFormatList(vcl::Window* pParent, WinBits nStyle);
+ virtual ~ScCondFormatList();
+ virtual void dispose() SAL_OVERRIDE;
void init(ScDocument* pDoc, ScCondFormatDlg* pDialogParent, const ScConditionalFormat* pFormat,
const ScRangeList& rRanges, const ScAddress& rPos,
@@ -95,18 +95,18 @@ public:
class ScCondFormatDlg : public ScAnyRefModalDlg
{
private:
- PushButton* mpBtnAdd;
- PushButton* mpBtnRemove;
- FixedText* mpFtRange;
- formula::RefEdit* mpEdRange;
- formula::RefButton* mpRbRange;
+ VclPtr<PushButton> mpBtnAdd;
+ VclPtr<PushButton> mpBtnRemove;
+ VclPtr<FixedText> mpFtRange;
+ VclPtr<formula::RefEdit> mpEdRange;
+ VclPtr<formula::RefButton> mpRbRange;
- ScCondFormatList* mpCondFormList;
+ VclPtr<ScCondFormatList> mpCondFormList;
ScAddress maPos;
ScDocument* mpDoc;
- formula::RefEdit* mpLastEdit;
+ VclPtr<formula::RefEdit> mpLastEdit;
DECL_LINK( EdRangeModifyHdl, Edit* );
protected:
@@ -117,6 +117,7 @@ public:
SC_DLLPUBLIC ScCondFormatDlg(vcl::Window* pWindow, ScDocument* pDoc, const ScConditionalFormat* pFormat,
const ScRangeList& rRange, const ScAddress& rPos, condformat::dialog::ScCondFormatDialogType eType);
virtual ~ScCondFormatDlg();
+ virtual void dispose() SAL_OVERRIDE;
SC_DLLPUBLIC ScConditionalFormat* GetConditionalFormat() const;
diff --git a/sc/source/ui/inc/condformatdlgentry.hxx b/sc/source/ui/inc/condformatdlgentry.hxx
index 0ed7a5b40717..168b6927cbfc 100644
--- a/sc/source/ui/inc/condformatdlgentry.hxx
+++ b/sc/source/ui/inc/condformatdlgentry.hxx
@@ -46,13 +46,13 @@ private:
Link maClickHdl;
//general ui elements
- FixedText maFtCondNr;
- FixedText maFtCondition;
+ VclPtr<FixedText> maFtCondNr;
+ VclPtr<FixedText> maFtCondition;
sal_Int32 mnIndex;
OUString maStrCondition;
protected:
- ListBox maLbType;
+ VclPtr<ListBox> maLbType;
ScDocument* mpDoc;
ScAddress maPos;
@@ -67,6 +67,7 @@ protected:
public:
ScCondFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos );
virtual ~ScCondFrmtEntry();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -85,13 +86,13 @@ public:
class ScConditionFrmtEntry : public ScCondFrmtEntry, public SfxListener
{
//cond format ui elements
- ListBox maLbCondType;
- formula::RefEdit maEdVal1;
- formula::RefEdit maEdVal2;
- FixedText maFtVal;
- FixedText maFtStyle;
- ListBox maLbStyle;
- SvxFontPrevWindow maWdPreview;
+ VclPtr<ListBox> maLbCondType;
+ VclPtr<formula::RefEdit> maEdVal1;
+ VclPtr<formula::RefEdit> maEdVal2;
+ VclPtr<FixedText> maFtVal;
+ VclPtr<FixedText> maFtStyle;
+ VclPtr<ListBox> maLbStyle;
+ VclPtr<SvxFontPrevWindow> maWdPreview;
bool mbIsInStyleCreate;
static const sal_Int32 NUM_COND_ENTRIES = 24;
@@ -120,6 +121,8 @@ protected:
public:
ScConditionFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, ScCondFormatDlg* pDialogParent,
const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry = NULL );
+ virtual ~ScConditionFrmtEntry();
+ virtual void dispose() SAL_OVERRIDE;
virtual ScFormatEntry* GetEntry() const SAL_OVERRIDE;
virtual void SetActive() SAL_OVERRIDE;
@@ -133,10 +136,10 @@ public:
class ScFormulaFrmtEntry : public ScCondFrmtEntry
{
- FixedText maFtStyle;
- ListBox maLbStyle;
- SvxFontPrevWindow maWdPreview;
- formula::RefEdit maEdFormula;
+ VclPtr<FixedText> maFtStyle;
+ VclPtr<ListBox> maLbStyle;
+ VclPtr<SvxFontPrevWindow> maWdPreview;
+ VclPtr<formula::RefEdit> maEdFormula;
ScFormatEntry* createFormulaEntry() const;
virtual OUString GetExpressionString() SAL_OVERRIDE;
@@ -146,6 +149,8 @@ class ScFormulaFrmtEntry : public ScCondFrmtEntry
public:
ScFormulaFrmtEntry( vcl::Window* pParent, ScDocument* PDoc, ScCondFormatDlg* pDialogParent, const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry = NULL );
+ virtual ~ScFormulaFrmtEntry();
+ virtual void dispose() SAL_OVERRIDE;
virtual ScFormatEntry* GetEntry() const SAL_OVERRIDE;
virtual void SetActive() SAL_OVERRIDE;
@@ -157,17 +162,17 @@ class ScColorScale2FrmtEntry : public ScCondFrmtEntry
{
//color format ui elements
- ListBox maLbColorFormat;
+ VclPtr<ListBox> maLbColorFormat;
//color scale ui elements
- ListBox maLbEntryTypeMin;
- ListBox maLbEntryTypeMax;
+ VclPtr<ListBox> maLbEntryTypeMin;
+ VclPtr<ListBox> maLbEntryTypeMax;
- Edit maEdMin;
- Edit maEdMax;
+ VclPtr<Edit> maEdMin;
+ VclPtr<Edit> maEdMax;
- ColorListBox maLbColMin;
- ColorListBox maLbColMax;
+ VclPtr<ColorListBox> maLbColMin;
+ VclPtr<ColorListBox> maLbColMax;
ScFormatEntry* createColorscaleEntry() const;
@@ -177,6 +182,8 @@ class ScColorScale2FrmtEntry : public ScCondFrmtEntry
DECL_LINK( EntryTypeHdl, ListBox* );
public:
ScColorScale2FrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat = NULL );
+ virtual ~ScColorScale2FrmtEntry();
+ virtual void dispose() SAL_OVERRIDE;
virtual ScFormatEntry* GetEntry() const SAL_OVERRIDE;
virtual void SetActive() SAL_OVERRIDE;
virtual void SetInactive() SAL_OVERRIDE;
@@ -187,20 +194,20 @@ class ScColorScale3FrmtEntry : public ScCondFrmtEntry
{
//color format ui elements
- ListBox maLbColorFormat;
+ VclPtr<ListBox> maLbColorFormat;
//color scale ui elements
- ListBox maLbEntryTypeMin;
- ListBox maLbEntryTypeMiddle;
- ListBox maLbEntryTypeMax;
+ VclPtr<ListBox> maLbEntryTypeMin;
+ VclPtr<ListBox> maLbEntryTypeMiddle;
+ VclPtr<ListBox> maLbEntryTypeMax;
- Edit maEdMin;
- Edit maEdMiddle;
- Edit maEdMax;
+ VclPtr<Edit> maEdMin;
+ VclPtr<Edit> maEdMiddle;
+ VclPtr<Edit> maEdMax;
- ColorListBox maLbColMin;
- ColorListBox maLbColMiddle;
- ColorListBox maLbColMax;
+ VclPtr<ColorListBox> maLbColMin;
+ VclPtr<ColorListBox> maLbColMiddle;
+ VclPtr<ColorListBox> maLbColMax;
ScFormatEntry* createColorscaleEntry() const;
@@ -210,6 +217,8 @@ class ScColorScale3FrmtEntry : public ScCondFrmtEntry
DECL_LINK( EntryTypeHdl, ListBox* );
public:
ScColorScale3FrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat = NULL );
+ virtual ~ScColorScale3FrmtEntry();
+ virtual void dispose() SAL_OVERRIDE;
virtual ScFormatEntry* GetEntry() const SAL_OVERRIDE;
virtual void SetActive() SAL_OVERRIDE;
virtual void SetInactive() SAL_OVERRIDE;
@@ -219,15 +228,15 @@ public:
class ScDataBarFrmtEntry : public ScCondFrmtEntry
{
//color format ui elements
- ListBox maLbColorFormat;
+ VclPtr<ListBox> maLbColorFormat;
//data bar ui elements
- ListBox maLbDataBarMinType;
- ListBox maLbDataBarMaxType;
- Edit maEdDataBarMin;
- Edit maEdDataBarMax;
+ VclPtr<ListBox> maLbDataBarMinType;
+ VclPtr<ListBox> maLbDataBarMaxType;
+ VclPtr<Edit> maEdDataBarMin;
+ VclPtr<Edit> maEdDataBarMax;
- PushButton maBtOptions;
+ VclPtr<PushButton> maBtOptions;
boost::scoped_ptr<ScDataBarFormatData> mpDataBarData;
@@ -240,6 +249,8 @@ class ScDataBarFrmtEntry : public ScCondFrmtEntry
DECL_LINK( DataBarTypeSelectHdl, void* );
public:
ScDataBarFrmtEntry( vcl::Window* pParemt, ScDocument* pDoc, const ScAddress& rPos, const ScDataBarFormat* pFormat = NULL );
+ virtual ~ScDataBarFrmtEntry();
+ virtual void dispose() SAL_OVERRIDE;
virtual ScFormatEntry* GetEntry() const SAL_OVERRIDE;
virtual void SetActive() SAL_OVERRIDE;
virtual void SetInactive() SAL_OVERRIDE;
@@ -251,6 +262,8 @@ class ScDateFrmtEntry : public ScCondFrmtEntry, public SfxListener
{
public:
ScDateFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScCondDateFormatEntry* pFormat = NULL );
+ virtual ~ScDateFrmtEntry();
+ virtual void dispose() SAL_OVERRIDE;
virtual ScFormatEntry* GetEntry() const SAL_OVERRIDE;
virtual void SetActive() SAL_OVERRIDE;
virtual void SetInactive() SAL_OVERRIDE;
@@ -266,10 +279,10 @@ private:
DECL_LINK( StyleSelectHdl, void* );
- ListBox maLbDateEntry;
- FixedText maFtStyle;
- ListBox maLbStyle;
- SvxFontPrevWindow maWdPreview;
+ VclPtr<ListBox> maLbDateEntry;
+ VclPtr<FixedText> maFtStyle;
+ VclPtr<ListBox> maLbStyle;
+ VclPtr<SvxFontPrevWindow> maWdPreview;
bool mbIsInStyleCreate;
};
@@ -277,12 +290,12 @@ private:
class ScIconSetFrmtEntry : public ScCondFrmtEntry
{
//color format ui elements
- ListBox maLbColorFormat;
+ VclPtr<ListBox> maLbColorFormat;
// icon set ui elements
- ListBox maLbIconSetType;
+ VclPtr<ListBox> maLbIconSetType;
- typedef boost::ptr_vector<ScIconSetFrmtDataEntry> ScIconSetFrmtDataEntriesType;
+ typedef std::vector<VclPtr<ScIconSetFrmtDataEntry>> ScIconSetFrmtDataEntriesType;
ScIconSetFrmtDataEntriesType maEntries;
virtual OUString GetExpressionString() SAL_OVERRIDE;
@@ -293,6 +306,8 @@ class ScIconSetFrmtEntry : public ScCondFrmtEntry
public:
ScIconSetFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScIconSetFormat* pFormat = NULL );
+ virtual ~ScIconSetFrmtEntry();
+ virtual void dispose() SAL_OVERRIDE;
virtual ScFormatEntry* GetEntry() const SAL_OVERRIDE;
virtual void SetActive() SAL_OVERRIDE;
virtual void SetInactive() SAL_OVERRIDE;
diff --git a/sc/source/ui/inc/condformatmgr.hxx b/sc/source/ui/inc/condformatmgr.hxx
index 6f577e4cf5b1..1d339884e19a 100644
--- a/sc/source/ui/inc/condformatmgr.hxx
+++ b/sc/source/ui/inc/condformatmgr.hxx
@@ -50,17 +50,18 @@ class ScCondFormatManagerDlg : public ModalDialog
public:
ScCondFormatManagerDlg(vcl::Window* pParent, ScDocument* pDoc, const ScConditionalFormatList* pFormatList, const ScAddress& rPos);
virtual ~ScCondFormatManagerDlg();
+ virtual void dispose() SAL_OVERRIDE;
ScConditionalFormatList* GetConditionalFormatList();
bool CondFormatsChanged() { return mbModified;}
private:
- PushButton *m_pBtnAdd;
- PushButton *m_pBtnRemove;
- PushButton *m_pBtnEdit;
+ VclPtr<PushButton> m_pBtnAdd;
+ VclPtr<PushButton> m_pBtnRemove;
+ VclPtr<PushButton> m_pBtnEdit;
ScConditionalFormatList* mpFormatList;
- ScCondFormatManagerWindow *m_pCtrlManager;
+ VclPtr<ScCondFormatManagerWindow> m_pCtrlManager;
ScDocument* mpDoc;
ScAddress maPos;
diff --git a/sc/source/ui/inc/conflictsdlg.hxx b/sc/source/ui/inc/conflictsdlg.hxx
index 3e9ebd64fdbe..3c429d11a021 100644
--- a/sc/source/ui/inc/conflictsdlg.hxx
+++ b/sc/source/ui/inc/conflictsdlg.hxx
@@ -117,12 +117,12 @@ public:
class ScConflictsDlg : public ModalDialog
{
private:
- SvSimpleTableContainer *m_pLbConflictsContainer;
- boost::scoped_ptr<SvxRedlinTable> m_pLbConflicts;
- PushButton *m_pBtnKeepMine;
- PushButton *m_pBtnKeepOther;
- PushButton *m_pBtnKeepAllMine;
- PushButton *m_pBtnKeepAllOthers;
+ VclPtr<SvSimpleTableContainer> m_pLbConflictsContainer;
+ VclPtr<SvxRedlinTable> m_pLbConflicts;
+ VclPtr<PushButton> m_pBtnKeepMine;
+ VclPtr<PushButton> m_pBtnKeepOther;
+ VclPtr<PushButton> m_pBtnKeepAllMine;
+ VclPtr<PushButton> m_pBtnKeepAllOthers;
OUString maStrTitleConflict;
OUString maStrTitleAuthor;
@@ -160,6 +160,7 @@ private:
public:
ScConflictsDlg( vcl::Window* pParent, ScViewData* pViewData, ScDocument* pSharedDoc, ScConflictsList& rConflictsList );
virtual ~ScConflictsDlg();
+ virtual void dispose() SAL_OVERRIDE;
void UpdateView();
};
diff --git a/sc/source/ui/inc/consdlg.hxx b/sc/source/ui/inc/consdlg.hxx
index 0f3c60c69781..c71f7e979927 100644
--- a/sc/source/ui/inc/consdlg.hxx
+++ b/sc/source/ui/inc/consdlg.hxx
@@ -39,6 +39,7 @@ public:
ScConsolidateDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent,
const SfxItemSet& rArgSet );
virtual ~ScConsolidateDlg();
+ virtual void dispose() SAL_OVERRIDE;
virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) SAL_OVERRIDE;
@@ -51,27 +52,27 @@ protected:
virtual void Deactivate() SAL_OVERRIDE;
private:
- ListBox* pLbFunc;
- ListBox* pLbConsAreas;
+ VclPtr<ListBox> pLbFunc;
+ VclPtr<ListBox> pLbConsAreas;
- ListBox* pLbDataArea;
- formula::RefEdit* pEdDataArea;
- formula::RefButton* pRbDataArea;
+ VclPtr<ListBox> pLbDataArea;
+ VclPtr<formula::RefEdit> pEdDataArea;
+ VclPtr<formula::RefButton> pRbDataArea;
- ListBox* pLbDestArea;
- formula::RefEdit* pEdDestArea;
- formula::RefButton* pRbDestArea;
+ VclPtr<ListBox> pLbDestArea;
+ VclPtr<formula::RefEdit> pEdDestArea;
+ VclPtr<formula::RefButton> pRbDestArea;
- VclExpander* pExpander;
- CheckBox* pBtnByRow;
- CheckBox* pBtnByCol;
+ VclPtr<VclExpander> pExpander;
+ VclPtr<CheckBox> pBtnByRow;
+ VclPtr<CheckBox> pBtnByCol;
- CheckBox* pBtnRefs;
+ VclPtr<CheckBox> pBtnRefs;
- OKButton* pBtnOk;
- CancelButton* pBtnCancel;
- PushButton* pBtnAdd;
- PushButton* pBtnRemove;
+ VclPtr<OKButton> pBtnOk;
+ VclPtr<CancelButton> pBtnCancel;
+ VclPtr<PushButton> pBtnAdd;
+ VclPtr<PushButton> pBtnRemove;
OUString aStrUndefined;
@@ -83,7 +84,7 @@ private:
size_t nAreaDataCount;
sal_uInt16 nWhichCons;
- formula::RefEdit* pRefInputEdit;
+ VclPtr<formula::RefEdit> pRefInputEdit;
bool bDlgLostFocus;
void Init ();
diff --git a/sc/source/ui/inc/content.hxx b/sc/source/ui/inc/content.hxx
index d98bdb825053..11ff60501331 100644
--- a/sc/source/ui/inc/content.hxx
+++ b/sc/source/ui/inc/content.hxx
@@ -46,7 +46,7 @@ const sal_uLong SC_CONTENT_NOCHILD = ~0UL;
class ScContentTree : public SvTreeListBox
{
- ScNavigatorDlg* pParentWindow;
+ VclPtr<ScNavigatorDlg> pParentWindow;
ImageList aEntryImages;
SvTreeListEntry* pRootNodes[SC_CONTENT_COUNT];
sal_uInt16 nRootType; // set as Root
@@ -124,6 +124,7 @@ protected:
public:
ScContentTree( vcl::Window* pParent, const ResId& rResId );
virtual ~ScContentTree();
+ virtual void dispose() SAL_OVERRIDE;
OUString getAltLongDescText(SvTreeListEntry* pEntry, bool isAltText) const;
OUString GetEntryAltText( SvTreeListEntry* pEntry ) const SAL_OVERRIDE;
diff --git a/sc/source/ui/inc/corodlg.hxx b/sc/source/ui/inc/corodlg.hxx
index 1f6de3df6b05..dbc8dcc34f4f 100644
--- a/sc/source/ui/inc/corodlg.hxx
+++ b/sc/source/ui/inc/corodlg.hxx
@@ -37,13 +37,20 @@ public:
m_pBtnCol->Check(bCol);
m_pBtnRow->Check(bRow);
}
+ virtual ~ScColRowLabelDlg() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE
+ {
+ m_pBtnRow.clear();
+ m_pBtnCol.clear();
+ ModalDialog::dispose();
+ }
bool IsCol() const { return m_pBtnCol->IsChecked(); }
bool IsRow() const { return m_pBtnRow->IsChecked(); }
private:
- CheckBox* m_pBtnRow;
- CheckBox* m_pBtnCol;
+ VclPtr<CheckBox> m_pBtnRow;
+ VclPtr<CheckBox> m_pBtnCol;
};
#endif
diff --git a/sc/source/ui/inc/crdlg.hxx b/sc/source/ui/inc/crdlg.hxx
index 571d04a20bea..cc0b941e7da2 100644
--- a/sc/source/ui/inc/crdlg.hxx
+++ b/sc/source/ui/inc/crdlg.hxx
@@ -30,11 +30,13 @@ class ScColOrRowDlg : public ModalDialog
public:
ScColOrRowDlg(vcl::Window* pParent, const OUString& rStrTitle,
const OUString& rStrLabel, bool bColDefault = true);
+ virtual ~ScColOrRowDlg();
+ virtual void dispose() SAL_OVERRIDE;
private:
- VclFrame* m_pFrame;
- RadioButton* m_pBtnRows;
- RadioButton* m_pBtnCols;
- OKButton* m_pBtnOk;
+ VclPtr<VclFrame> m_pFrame;
+ VclPtr<RadioButton> m_pBtnRows;
+ VclPtr<RadioButton> m_pBtnCols;
+ VclPtr<OKButton> m_pBtnOk;
DECL_LINK(OkHdl, void *);
};
diff --git a/sc/source/ui/inc/crnrdlg.hxx b/sc/source/ui/inc/crnrdlg.hxx
index b2d97ab9035d..f23f5dd51d7e 100644
--- a/sc/source/ui/inc/crnrdlg.hxx
+++ b/sc/source/ui/inc/crnrdlg.hxx
@@ -36,6 +36,7 @@ public:
ScColRowNameRangesDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent,
ScViewData* ptrViewData );
virtual ~ScColRowNameRangesDlg();
+ virtual void dispose() SAL_OVERRIDE;
virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) SAL_OVERRIDE;
@@ -44,19 +45,19 @@ public:
virtual bool Close() SAL_OVERRIDE;
private:
- ListBox* pLbRange;
+ VclPtr<ListBox> pLbRange;
- formula::RefEdit* pEdAssign;
- formula::RefButton* pRbAssign;
- RadioButton* pBtnColHead;
- RadioButton* pBtnRowHead;
- formula::RefEdit* pEdAssign2;
- formula::RefButton* pRbAssign2;
+ VclPtr<formula::RefEdit> pEdAssign;
+ VclPtr<formula::RefButton> pRbAssign;
+ VclPtr<RadioButton> pBtnColHead;
+ VclPtr<RadioButton> pBtnRowHead;
+ VclPtr<formula::RefEdit> pEdAssign2;
+ VclPtr<formula::RefButton> pRbAssign2;
- OKButton* pBtnOk;
- CancelButton* pBtnCancel;
- PushButton* pBtnAdd;
- PushButton* pBtnRemove;
+ VclPtr<OKButton> pBtnOk;
+ VclPtr<CancelButton> pBtnCancel;
+ VclPtr<PushButton> pBtnAdd;
+ VclPtr<PushButton> pBtnRemove;
ScRange theCurArea;
ScRange theCurData;
@@ -68,7 +69,7 @@ private:
NameRangeMap aRangeMap;
ScViewData* pViewData;
ScDocument* pDoc;
- formula::RefEdit* pEdActive;
+ VclPtr<formula::RefEdit> pEdActive;
bool bDlgLostFocus;
void Init ();
diff --git a/sc/source/ui/inc/csvcontrol.hxx b/sc/source/ui/inc/csvcontrol.hxx
index c66bac55d988..fee07ecba715 100644
--- a/sc/source/ui/inc/csvcontrol.hxx
+++ b/sc/source/ui/inc/csvcontrol.hxx
@@ -241,6 +241,7 @@ public:
explicit ScCsvControl( ScCsvControl& rParent );
explicit ScCsvControl( vcl::Window* pParent, const ScCsvLayoutData& rData, WinBits nBits );
virtual ~ScCsvControl();
+ virtual void dispose() SAL_OVERRIDE;
// event handling ---------------------------------------------------------
diff --git a/sc/source/ui/inc/csvgrid.hxx b/sc/source/ui/inc/csvgrid.hxx
index bab6dda53287..1c5b1dcab4db 100644
--- a/sc/source/ui/inc/csvgrid.hxx
+++ b/sc/source/ui/inc/csvgrid.hxx
@@ -75,8 +75,8 @@ class SC_DLLPUBLIC ScCsvGrid : public ScCsvControl, public utl::ConfigurationLis
private:
typedef ::std::unique_ptr< ScEditEngineDefaulter > ScEditEnginePtr;
- VirtualDevice maBackgrDev; /// Grid background, headers, cell texts.
- VirtualDevice maGridDev; /// Data grid with selection and cursor.
+ VclPtr<VirtualDevice> mpBackgrDev; /// Grid background, headers, cell texts.
+ VclPtr<VirtualDevice> mpGridDev; /// Data grid with selection and cursor.
PopupMenu maPopup; /// Popup menu for column types.
::svtools::ColorConfig* mpColorConfig; /// Application color configuration.
@@ -109,6 +109,7 @@ private:
public:
explicit ScCsvGrid( ScCsvControl& rParent );
virtual ~ScCsvGrid();
+ virtual void dispose() SAL_OVERRIDE;
/** Finishes initialization. Must be called after constructing a new object. */
void Init();
diff --git a/sc/source/ui/inc/csvruler.hxx b/sc/source/ui/inc/csvruler.hxx
index ef73cae674c4..991111525b02 100644
--- a/sc/source/ui/inc/csvruler.hxx
+++ b/sc/source/ui/inc/csvruler.hxx
@@ -32,8 +32,8 @@ class ScAccessibleCsvControl;
class SC_DLLPUBLIC ScCsvRuler : public ScCsvControl
{
private:
- VirtualDevice maBackgrDev; /// Ruler background, scaling.
- VirtualDevice maRulerDev; /// Ruler with splits and cursor.
+ ScopedVclPtr<VirtualDevice> maBackgrDev; /// Ruler background, scaling.
+ ScopedVclPtr<VirtualDevice> maRulerDev; /// Ruler with splits and cursor.
Color maBackColor; /// Background color.
Color maActiveColor; /// Color for active part of ruler.
@@ -55,6 +55,7 @@ private:
public:
explicit ScCsvRuler( ScCsvControl& rParent );
virtual ~ScCsvRuler();
+ virtual void dispose() SAL_OVERRIDE;
// common ruler handling --------------------------------------------------
public:
diff --git a/sc/source/ui/inc/csvtablebox.hxx b/sc/source/ui/inc/csvtablebox.hxx
index cda528abf86c..2c5b458b5fcc 100644
--- a/sc/source/ui/inc/csvtablebox.hxx
+++ b/sc/source/ui/inc/csvtablebox.hxx
@@ -22,6 +22,7 @@
#include <vcl/ctrl.hxx>
#include <vcl/scrbar.hxx>
+#include <vcl/vclptr.hxx>
#include "scdllapi.h"
#include "csvcontrol.hxx"
#include "csvruler.hxx"
@@ -44,11 +45,11 @@ class SC_DLLPUBLIC ScCsvTableBox : public ScCsvControl
private:
ScCsvLayoutData maData; /// Current layout data of the controls.
- ScCsvRuler maRuler; /// The ruler for fixed width mode.
- ScCsvGrid maGrid; /// Calc-like data table for fixed width mode.
- ScrollBar maHScroll; /// Horizontal scroll bar.
- ScrollBar maVScroll; /// Vertical scroll bar.
- ScrollBarBox maScrollBox; /// For the bottom right edge.
+ VclPtr<ScCsvRuler> maRuler; /// The ruler for fixed width mode.
+ VclPtr<ScCsvGrid> maGrid; /// Calc-like data table for fixed width mode.
+ VclPtr<ScrollBar> maHScroll; /// Horizontal scroll bar.
+ VclPtr<ScrollBar> maVScroll; /// Vertical scroll bar.
+ VclPtr<ScrollBarBox> maScrollBox; /// For the bottom right edge.
Link maUpdateTextHdl; /// Updates all cell texts.
Link maColTypeHdl; /// Handler for exporting the column type.
@@ -62,6 +63,8 @@ private:
public:
explicit ScCsvTableBox( vcl::Window* pParent, WinBits nBits );
+ virtual ~ScCsvTableBox();
+ virtual void dispose() SAL_OVERRIDE;
/** Finishes initialization. Must be called after constructing a new object. */
void Init();
@@ -102,7 +105,7 @@ public:
/** Reads UI strings for data types from the list box. */
void InitTypes( const ListBox& rListBox );
/** Returns the data type of the selected columns. */
- inline sal_Int32 GetSelColumnType() const { return maGrid.GetSelColumnType(); }
+ inline sal_Int32 GetSelColumnType() const { return maGrid->GetSelColumnType(); }
/** Fills the options object with current column data. */
void FillColumnData( ScAsciiOptions& rOptions ) const;
diff --git a/sc/source/ui/inc/dapidata.hxx b/sc/source/ui/inc/dapidata.hxx
index b157c05cf6e4..02c76e0dc8ae 100644
--- a/sc/source/ui/inc/dapidata.hxx
+++ b/sc/source/ui/inc/dapidata.hxx
@@ -30,9 +30,9 @@ struct ScImportSourceDesc;
class ScDataPilotDatabaseDlg : public ModalDialog
{
private:
- ListBox* m_pLbDatabase;
- ComboBox* m_pCbObject;
- ListBox* m_pLbType;
+ VclPtr<ListBox> m_pLbDatabase;
+ VclPtr<ComboBox> m_pCbObject;
+ VclPtr<ListBox> m_pLbType;
void FillObjects();
@@ -40,6 +40,8 @@ private:
public:
ScDataPilotDatabaseDlg(vcl::Window* pParent);
+ virtual ~ScDataPilotDatabaseDlg();
+ virtual void dispose() SAL_OVERRIDE;
void GetValues( ScImportSourceDesc& rDesc );
};
diff --git a/sc/source/ui/inc/dapitype.hxx b/sc/source/ui/inc/dapitype.hxx
index e024ba3f5451..fb85f0e47687 100644
--- a/sc/source/ui/inc/dapitype.hxx
+++ b/sc/source/ui/inc/dapitype.hxx
@@ -30,16 +30,16 @@
class ScDataPilotSourceTypeDlg : public ModalDialog
{
private:
- RadioButton* m_pBtnSelection;
- RadioButton* m_pBtnNamedRange;
- RadioButton* m_pBtnDatabase;
- RadioButton* m_pBtnExternal;
- ListBox* m_pLbNamedRange;
+ VclPtr<RadioButton> m_pBtnSelection;
+ VclPtr<RadioButton> m_pBtnNamedRange;
+ VclPtr<RadioButton> m_pBtnDatabase;
+ VclPtr<RadioButton> m_pBtnExternal;
+ VclPtr<ListBox> m_pLbNamedRange;
public:
ScDataPilotSourceTypeDlg(vcl::Window* pParent, bool bEnableExternal);
virtual ~ScDataPilotSourceTypeDlg();
-
+ virtual void dispose() SAL_OVERRIDE;
bool IsDatabase() const;
bool IsExternal() const;
bool IsNamedRange() const;
@@ -53,16 +53,17 @@ private:
class ScDataPilotServiceDlg : public ModalDialog
{
private:
- ListBox *m_pLbService;
- Edit *m_pEdSource;
- Edit *m_pEdName;
- Edit *m_pEdUser;
- Edit *m_pEdPasswd;
+ VclPtr<ListBox> m_pLbService;
+ VclPtr<Edit> m_pEdSource;
+ VclPtr<Edit> m_pEdName;
+ VclPtr<Edit> m_pEdUser;
+ VclPtr<Edit> m_pEdPasswd;
public:
ScDataPilotServiceDlg( vcl::Window* pParent,
const com::sun::star::uno::Sequence<OUString>& rServices );
virtual ~ScDataPilotServiceDlg();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetServiceName() const;
OUString GetParSource() const;
diff --git a/sc/source/ui/inc/datafdlg.hxx b/sc/source/ui/inc/datafdlg.hxx
index 00460ece6b8f..762b0cd5d761 100644
--- a/sc/source/ui/inc/datafdlg.hxx
+++ b/sc/source/ui/inc/datafdlg.hxx
@@ -20,8 +20,6 @@
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
-#include <boost/ptr_container/ptr_vector.hpp>
-
#define MAX_DATAFORM_COLS 256
#define MAX_DATAFORM_ROWS 32000
@@ -29,15 +27,15 @@ class ScDataFormDlg : public ModalDialog
{
private:
- PushButton* m_pBtnNew;
- PushButton* m_pBtnDelete;
- PushButton* m_pBtnRestore;
- PushButton* m_pBtnPrev;
- PushButton* m_pBtnNext;
- PushButton* m_pBtnClose;
- ScrollBar* m_pSlider;
- VclGrid* m_pGrid;
- FixedText* m_pFixedText;
+ VclPtr<PushButton> m_pBtnNew;
+ VclPtr<PushButton> m_pBtnDelete;
+ VclPtr<PushButton> m_pBtnRestore;
+ VclPtr<PushButton> m_pBtnPrev;
+ VclPtr<PushButton> m_pBtnNext;
+ VclPtr<PushButton> m_pBtnClose;
+ VclPtr<ScrollBar> m_pSlider;
+ VclPtr<VclGrid> m_pGrid;
+ VclPtr<FixedText> m_pFixedText;
OUString sNewRecord;
ScTabViewShell* pTabViewShell;
@@ -51,12 +49,13 @@ private:
SCTAB nTab;
bool bNoSelection;
- boost::ptr_vector<boost::nullable<FixedText> > maFixedTexts;
- boost::ptr_vector<boost::nullable<Edit> > maEdits;
+ std::vector<VclPtr<FixedText> > maFixedTexts;
+ std::vector<VclPtr<Edit> > maEdits;
public:
ScDataFormDlg( vcl::Window* pParent, ScTabViewShell* pTabViewShell);
virtual ~ScDataFormDlg();
+ virtual void dispose() SAL_OVERRIDE;
void FillCtrls(SCROW nCurrentRow);
private:
diff --git a/sc/source/ui/inc/datastreamdlg.hxx b/sc/source/ui/inc/datastreamdlg.hxx
index 09b461fa8635..0b8bf8c38966 100644
--- a/sc/source/ui/inc/datastreamdlg.hxx
+++ b/sc/source/ui/inc/datastreamdlg.hxx
@@ -28,23 +28,23 @@ class DataStreamDlg : public ModalDialog
{
ScDocShell *mpDocShell;
- SvtURLBox* m_pCbUrl;
- PushButton* m_pBtnBrowse;
- RadioButton* m_pRBDirectData;
- RadioButton* m_pRBScriptData;
- RadioButton* m_pRBValuesInLine;
- RadioButton* m_pRBAddressValue;
- CheckBox* m_pCBRefreshOnEmpty;
- RadioButton* m_pRBDataDown;
- RadioButton* m_pRBRangeDown;
- RadioButton* m_pRBNoMove;
- RadioButton* m_pRBMaxLimit;
- RadioButton* m_pRBUnlimited;
- Edit* m_pEdRange;
- Edit* m_pEdLimit;
- OKButton* m_pBtnOk;
- VclFrame* m_pVclFrameLimit;
- VclFrame* m_pVclFrameMove;
+ VclPtr<SvtURLBox> m_pCbUrl;
+ VclPtr<PushButton> m_pBtnBrowse;
+ VclPtr<RadioButton> m_pRBDirectData;
+ VclPtr<RadioButton> m_pRBScriptData;
+ VclPtr<RadioButton> m_pRBValuesInLine;
+ VclPtr<RadioButton> m_pRBAddressValue;
+ VclPtr<CheckBox> m_pCBRefreshOnEmpty;
+ VclPtr<RadioButton> m_pRBDataDown;
+ VclPtr<RadioButton> m_pRBRangeDown;
+ VclPtr<RadioButton> m_pRBNoMove;
+ VclPtr<RadioButton> m_pRBMaxLimit;
+ VclPtr<RadioButton> m_pRBUnlimited;
+ VclPtr<Edit> m_pEdRange;
+ VclPtr<Edit> m_pEdLimit;
+ VclPtr<OKButton> m_pBtnOk;
+ VclPtr<VclFrame> m_pVclFrameLimit;
+ VclPtr<VclFrame> m_pVclFrameMove;
DECL_LINK(UpdateHdl, void *);
DECL_LINK(BrowseHdl, void *);
@@ -54,6 +54,8 @@ class DataStreamDlg : public ModalDialog
public:
DataStreamDlg(ScDocShell *pDocShell, vcl::Window* pParent);
+ virtual ~DataStreamDlg();
+ virtual void dispose() SAL_OVERRIDE;
void Init( const DataStream& rStrm );
diff --git a/sc/source/ui/inc/dbnamdlg.hxx b/sc/source/ui/inc/dbnamdlg.hxx
index 6b6d68384a0a..032b8e9df704 100644
--- a/sc/source/ui/inc/dbnamdlg.hxx
+++ b/sc/source/ui/inc/dbnamdlg.hxx
@@ -38,6 +38,7 @@ public:
ScDbNameDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent,
ScViewData* ptrViewData );
virtual ~ScDbNameDlg();
+ virtual void dispose() SAL_OVERRIDE;
virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) SAL_OVERRIDE;
@@ -46,24 +47,24 @@ public:
virtual bool Close() SAL_OVERRIDE;
private:
- ComboBox* m_pEdName;
-
- VclFrame* m_pAssignFrame;
- formula::RefEdit* m_pEdAssign;
- formula::RefButton* m_pRbAssign;
-
- VclContainer* m_pOptions;
- CheckBox* m_pBtnHeader;
- CheckBox* m_pBtnDoSize;
- CheckBox* m_pBtnKeepFmt;
- CheckBox* m_pBtnStripData;
- FixedText* m_pFTSource;
- FixedText* m_pFTOperations;
-
- OKButton* m_pBtnOk;
- CancelButton* m_pBtnCancel;
- PushButton* m_pBtnAdd;
- PushButton* m_pBtnRemove;
+ VclPtr<ComboBox> m_pEdName;
+
+ VclPtr<VclFrame> m_pAssignFrame;
+ VclPtr<formula::RefEdit> m_pEdAssign;
+ VclPtr<formula::RefButton> m_pRbAssign;
+
+ VclPtr<VclContainer> m_pOptions;
+ VclPtr<CheckBox> m_pBtnHeader;
+ VclPtr<CheckBox> m_pBtnDoSize;
+ VclPtr<CheckBox> m_pBtnKeepFmt;
+ VclPtr<CheckBox> m_pBtnStripData;
+ VclPtr<FixedText> m_pFTSource;
+ VclPtr<FixedText> m_pFTOperations;
+
+ VclPtr<OKButton> m_pBtnOk;
+ VclPtr<CancelButton> m_pBtnCancel;
+ VclPtr<PushButton> m_pBtnAdd;
+ VclPtr<PushButton> m_pBtnRemove;
bool bSaved;
diff --git a/sc/source/ui/inc/delcldlg.hxx b/sc/source/ui/inc/delcldlg.hxx
index 6683fcb81a02..676d93b242cc 100644
--- a/sc/source/ui/inc/delcldlg.hxx
+++ b/sc/source/ui/inc/delcldlg.hxx
@@ -29,13 +29,15 @@
class ScDeleteCellDlg : public ModalDialog
{
private:
- RadioButton* m_pBtnCellsUp;
- RadioButton* m_pBtnCellsLeft;
- RadioButton* m_pBtnDelRows;
- RadioButton* m_pBtnDelCols;
+ VclPtr<RadioButton> m_pBtnCellsUp;
+ VclPtr<RadioButton> m_pBtnCellsLeft;
+ VclPtr<RadioButton> m_pBtnDelRows;
+ VclPtr<RadioButton> m_pBtnDelCols;
public:
ScDeleteCellDlg(vcl::Window* pParent, bool bDisallowCellMove = false);
+ virtual ~ScDeleteCellDlg();
+ virtual void dispose() SAL_OVERRIDE;
DelCellCmd GetDelCellCmd() const;
};
diff --git a/sc/source/ui/inc/delcodlg.hxx b/sc/source/ui/inc/delcodlg.hxx
index 6bc898a82134..a2741a6448a5 100644
--- a/sc/source/ui/inc/delcodlg.hxx
+++ b/sc/source/ui/inc/delcodlg.hxx
@@ -27,15 +27,15 @@
class ScDeleteContentsDlg : public ModalDialog
{
private:
- CheckBox* aBtnDelAll;
- CheckBox* aBtnDelStrings;
- CheckBox* aBtnDelNumbers;
- CheckBox* aBtnDelDateTime;
- CheckBox* aBtnDelFormulas;
- CheckBox* aBtnDelNotes;
- CheckBox* aBtnDelAttrs;
- CheckBox* aBtnDelObjects;
- OKButton* aBtnOk;
+ VclPtr<CheckBox> aBtnDelAll;
+ VclPtr<CheckBox> aBtnDelStrings;
+ VclPtr<CheckBox> aBtnDelNumbers;
+ VclPtr<CheckBox> aBtnDelDateTime;
+ VclPtr<CheckBox> aBtnDelFormulas;
+ VclPtr<CheckBox> aBtnDelNotes;
+ VclPtr<CheckBox> aBtnDelAttrs;
+ VclPtr<CheckBox> aBtnDelObjects;
+ VclPtr<OKButton> aBtnOk;
bool bObjectsDisabled;
@@ -49,6 +49,7 @@ public:
ScDeleteContentsDlg( vcl::Window* pParent,
InsertDeleteFlags nCheckDefaults = IDF_NONE );
virtual ~ScDeleteContentsDlg();
+ virtual void dispose() SAL_OVERRIDE;
void DisableObjects();
InsertDeleteFlags GetDelContentsCmdBits() const;
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index 5cd1d00d04fc..f0c8be5e8374 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -224,7 +224,7 @@ public:
void SetVisAreaOrSize( const Rectangle& rVisArea, bool bModifyStart );
- virtual SfxDocumentInfoDialog* CreateDocumentInfoDialog( vcl::Window *pParent,
+ virtual VclPtr<SfxDocumentInfoDialog> CreateDocumentInfoDialog( vcl::Window *pParent,
const SfxItemSet &rSet ) SAL_OVERRIDE;
void GetDocStat( ScDocStat& rDocStat );
diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx
index e574f672429b..e4030752386a 100644
--- a/sc/source/ui/inc/dpcontrol.hxx
+++ b/sc/source/ui/inc/dpcontrol.hxx
@@ -23,6 +23,7 @@
#include <rtl/ustring.hxx>
#include <tools/gen.hxx>
#include <tools/fract.hxx>
+#include <vcl/vclptr.hxx>
class OutputDevice;
class Point;
@@ -62,7 +63,7 @@ private:
Fraction maZoomX;
Fraction maZoomY;
ScDocument* mpDoc;
- OutputDevice* mpOutDev;
+ VclPtr<OutputDevice> mpOutDev;
const StyleSettings* mpStyle;
bool mbBaseButton;
bool mbPopupButton;
diff --git a/sc/source/ui/inc/dpgroupdlg.hxx b/sc/source/ui/inc/dpgroupdlg.hxx
index 3066f41a610c..3ba0db194083 100644
--- a/sc/source/ui/inc/dpgroupdlg.hxx
+++ b/sc/source/ui/inc/dpgroupdlg.hxx
@@ -49,9 +49,9 @@ private:
DECL_LINK( ClickHdl, RadioButton* );
private:
- RadioButton* mpRbAuto;
- RadioButton* mpRbMan;
- Edit* mpEdValue;
+ VclPtr<RadioButton> mpRbAuto;
+ VclPtr<RadioButton> mpRbMan;
+ VclPtr<Edit> mpEdValue;
};
class ScDPNumGroupEditHelper : public ScDPGroupEditHelper
@@ -61,14 +61,13 @@ public:
RadioButton* pRbAuto, RadioButton* pRbMan,
ScDoubleField* pEdValue );
- virtual ~ScDPNumGroupEditHelper() {}
-
+ virtual ~ScDPNumGroupEditHelper() {}
private:
virtual bool ImplGetValue( double& rfValue ) const SAL_OVERRIDE;
virtual void ImplSetValue( double fValue ) SAL_OVERRIDE;
private:
- ScDoubleField* mpEdValue;
+ VclPtr<ScDoubleField> mpEdValue;
};
class ScDPDateGroupEditHelper : public ScDPGroupEditHelper
@@ -85,7 +84,7 @@ private:
virtual void ImplSetValue( double fValue ) SAL_OVERRIDE;
private:
- DateField* mpEdValue;
+ VclPtr<DateField> mpEdValue;
Date maNullDate;
};
@@ -93,17 +92,18 @@ class ScDPNumGroupDlg : public ModalDialog
{
public:
explicit ScDPNumGroupDlg( vcl::Window* pParent, const ScDPNumGroupInfo& rInfo );
-
+ virtual ~ScDPNumGroupDlg();
+ virtual void dispose() SAL_OVERRIDE;
ScDPNumGroupInfo GetGroupInfo() const;
private:
- RadioButton* mpRbAutoStart;
- RadioButton* mpRbManStart;
- ScDoubleField* mpEdStart;
- RadioButton* mpRbAutoEnd;
- RadioButton* mpRbManEnd;
- ScDoubleField* mpEdEnd;
- ScDoubleField* mpEdBy;
+ VclPtr<RadioButton> mpRbAutoStart;
+ VclPtr<RadioButton> mpRbManStart;
+ VclPtr<ScDoubleField> mpEdStart;
+ VclPtr<RadioButton> mpRbAutoEnd;
+ VclPtr<RadioButton> mpRbManEnd;
+ VclPtr<ScDoubleField> mpEdEnd;
+ VclPtr<ScDoubleField> mpEdBy;
ScDPNumGroupEditHelper maStartHelper;
ScDPNumGroupEditHelper maEndHelper;
};
@@ -113,7 +113,8 @@ class ScDPDateGroupDlg : public ModalDialog
public:
explicit ScDPDateGroupDlg( vcl::Window* pParent, const ScDPNumGroupInfo& rInfo,
sal_Int32 nDatePart, const Date& rNullDate );
-
+ virtual ~ScDPDateGroupDlg();
+ virtual void dispose() SAL_OVERRIDE;
ScDPNumGroupInfo GetGroupInfo() const;
sal_Int32 GetDatePart() const;
@@ -122,17 +123,17 @@ private:
DECL_LINK( CheckHdl, SvxCheckListBox* );
private:
- RadioButton* mpRbAutoStart;
- RadioButton* mpRbManStart;
- DateField* mpEdStart;
- RadioButton* mpRbAutoEnd;
- RadioButton* mpRbManEnd;
- DateField* mpEdEnd;
- RadioButton* mpRbNumDays;
- RadioButton* mpRbUnits;
- NumericField* mpEdNumDays;
- SvxCheckListBox* mpLbUnits;
- OKButton* mpBtnOk;
+ VclPtr<RadioButton> mpRbAutoStart;
+ VclPtr<RadioButton> mpRbManStart;
+ VclPtr<DateField> mpEdStart;
+ VclPtr<RadioButton> mpRbAutoEnd;
+ VclPtr<RadioButton> mpRbManEnd;
+ VclPtr<DateField> mpEdEnd;
+ VclPtr<RadioButton> mpRbNumDays;
+ VclPtr<RadioButton> mpRbUnits;
+ VclPtr<NumericField> mpEdNumDays;
+ VclPtr<SvxCheckListBox> mpLbUnits;
+ VclPtr<OKButton> mpBtnOk;
ScDPDateGroupEditHelper maStartHelper;
ScDPDateGroupEditHelper maEndHelper;
};
diff --git a/sc/source/ui/inc/drawview.hxx b/sc/source/ui/inc/drawview.hxx
index baf0fa89e295..54f20bde7eba 100644
--- a/sc/source/ui/inc/drawview.hxx
+++ b/sc/source/ui/inc/drawview.hxx
@@ -34,7 +34,7 @@ class SdrUndoManager;
class ScDrawView: public FmFormView
{
ScViewData* pViewData;
- OutputDevice* pDev; //! needed ?
+ VclPtr<OutputDevice> pDev; //! needed ?
ScDocument* pDoc;
SCTAB nTab;
Fraction aScaleX; // Factor for Drawing-MapMode
diff --git a/sc/source/ui/inc/dwfunctr.hxx b/sc/source/ui/inc/dwfunctr.hxx
index 07b532f58718..bef700938a8f 100644
--- a/sc/source/ui/inc/dwfunctr.hxx
+++ b/sc/source/ui/inc/dwfunctr.hxx
@@ -47,16 +47,16 @@ class ScFunctionDockWin : public SfxDockingWindow, public SfxListener
private:
Idle aIdle;
- ScPrivatSplit aPrivatSplit;
- ListBox aCatBox;
- ListBox aFuncList;
- ListBox aDDFuncList;
- ListBox* pAllFuncList;
+ VclPtr<ScPrivatSplit> aPrivatSplit;
+ VclPtr<ListBox> aCatBox;
+ VclPtr<ListBox> aFuncList;
+ VclPtr<ListBox> aDDFuncList;
+ VclPtr<ListBox> pAllFuncList;
SfxChildAlignment eSfxNewAlignment;
SfxChildAlignment eSfxOldAlignment;
- ImageButton aInsertButton;
- FixedText aFiFuncDesc;
+ VclPtr<ImageButton> aInsertButton;
+ VclPtr<FixedText> aFiFuncDesc;
sal_uLong nMinWidth;
sal_uLong nMinHeight;
Size aOldSize;
@@ -105,6 +105,7 @@ public:
const ResId& rResId );
virtual ~ScFunctionDockWin();
+ virtual void dispose() SAL_OVERRIDE;
using SfxDockingWindow::Notify;
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
diff --git a/sc/source/ui/inc/filldlg.hxx b/sc/source/ui/inc/filldlg.hxx
index c68b604cee46..70a2d086bb45 100644
--- a/sc/source/ui/inc/filldlg.hxx
+++ b/sc/source/ui/inc/filldlg.hxx
@@ -43,6 +43,7 @@ public:
double fMax,
sal_uInt16 nPossDir );
virtual ~ScFillSeriesDlg();
+ virtual void dispose() SAL_OVERRIDE;
FillDir GetFillDir() const { return theFillDir; }
FillCmd GetFillCmd() const { return theFillCmd; }
@@ -56,32 +57,32 @@ public:
void SetEdStartValEnabled(bool bFlag = false);
private:
- FixedText* m_pFtStartVal;
- Edit* m_pEdStartVal;
+ VclPtr<FixedText> m_pFtStartVal;
+ VclPtr<Edit> m_pEdStartVal;
const OUString aStartStrVal;
- FixedText* m_pFtEndVal;
- Edit* m_pEdEndVal;
+ VclPtr<FixedText> m_pFtEndVal;
+ VclPtr<Edit> m_pEdEndVal;
- FixedText* m_pFtIncrement;
- Edit* m_pEdIncrement;
- RadioButton* m_pBtnDown;
- RadioButton* m_pBtnRight;
- RadioButton* m_pBtnUp;
- RadioButton* m_pBtnLeft;
+ VclPtr<FixedText> m_pFtIncrement;
+ VclPtr<Edit> m_pEdIncrement;
+ VclPtr<RadioButton> m_pBtnDown;
+ VclPtr<RadioButton> m_pBtnRight;
+ VclPtr<RadioButton> m_pBtnUp;
+ VclPtr<RadioButton> m_pBtnLeft;
- RadioButton* m_pBtnArithmetic;
- RadioButton* m_pBtnGeometric;
- RadioButton* m_pBtnDate;
- RadioButton* m_pBtnAutoFill;
+ VclPtr<RadioButton> m_pBtnArithmetic;
+ VclPtr<RadioButton> m_pBtnGeometric;
+ VclPtr<RadioButton> m_pBtnDate;
+ VclPtr<RadioButton> m_pBtnAutoFill;
- FixedText* m_pFtTimeUnit;
- RadioButton* m_pBtnDay;
- RadioButton* m_pBtnDayOfWeek;
- RadioButton* m_pBtnMonth;
- RadioButton* m_pBtnYear;
+ VclPtr<FixedText> m_pFtTimeUnit;
+ VclPtr<RadioButton> m_pBtnDay;
+ VclPtr<RadioButton> m_pBtnDayOfWeek;
+ VclPtr<RadioButton> m_pBtnMonth;
+ VclPtr<RadioButton> m_pBtnYear;
- OKButton* m_pBtnOk;
+ VclPtr<OKButton> m_pBtnOk;
const OUString aErrMsgInvalidVal;
diff --git a/sc/source/ui/inc/filtdlg.hxx b/sc/source/ui/inc/filtdlg.hxx
index e7e89cc9fcab..44d48c228524 100644
--- a/sc/source/ui/inc/filtdlg.hxx
+++ b/sc/source/ui/inc/filtdlg.hxx
@@ -56,6 +56,7 @@ public:
ScFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent,
const SfxItemSet& rArgSet );
virtual ~ScFilterDlg();
+ virtual void dispose() SAL_OVERRIDE;
virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) SAL_OVERRIDE;
@@ -68,43 +69,43 @@ public:
void RefreshEditRow( size_t nOffset );
private:
- ListBox* pLbConnect1;
- ListBox* pLbField1;
- ListBox* pLbCond1;
- ComboBox* pEdVal1;
-
- ListBox* pLbConnect2;
- ListBox* pLbField2;
- ListBox* pLbCond2;
- ComboBox* pEdVal2;
-
- ListBox* pLbConnect3;
- ListBox* pLbField3;
- ListBox* pLbCond3;
- ComboBox* pEdVal3;
-
- ListBox* pLbConnect4;
- ListBox* pLbField4;
- ListBox* pLbCond4;
- ComboBox* pEdVal4;
-
- ScrollBar* pScrollBar;
- VclExpander* pExpander;
-
- OKButton* pBtnOk;
- CancelButton* pBtnCancel;
-
- CheckBox* pBtnCase;
- CheckBox* pBtnRegExp;
- CheckBox* pBtnHeader;
- CheckBox* pBtnUnique;
- CheckBox* pBtnCopyResult;
- ListBox* pLbCopyArea;
- formula::RefEdit* pEdCopyArea;
- formula::RefButton* pRbCopyArea;
- CheckBox* pBtnDestPers;
- FixedText* pFtDbAreaLabel;
- FixedText* pFtDbArea;
+ VclPtr<ListBox> pLbConnect1;
+ VclPtr<ListBox> pLbField1;
+ VclPtr<ListBox> pLbCond1;
+ VclPtr<ComboBox> pEdVal1;
+
+ VclPtr<ListBox> pLbConnect2;
+ VclPtr<ListBox> pLbField2;
+ VclPtr<ListBox> pLbCond2;
+ VclPtr<ComboBox> pEdVal2;
+
+ VclPtr<ListBox> pLbConnect3;
+ VclPtr<ListBox> pLbField3;
+ VclPtr<ListBox> pLbCond3;
+ VclPtr<ComboBox> pEdVal3;
+
+ VclPtr<ListBox> pLbConnect4;
+ VclPtr<ListBox> pLbField4;
+ VclPtr<ListBox> pLbCond4;
+ VclPtr<ComboBox> pEdVal4;
+
+ VclPtr<ScrollBar> pScrollBar;
+ VclPtr<VclExpander> pExpander;
+
+ VclPtr<OKButton> pBtnOk;
+ VclPtr<CancelButton> pBtnCancel;
+
+ VclPtr<CheckBox> pBtnCase;
+ VclPtr<CheckBox> pBtnRegExp;
+ VclPtr<CheckBox> pBtnHeader;
+ VclPtr<CheckBox> pBtnUnique;
+ VclPtr<CheckBox> pBtnCopyResult;
+ VclPtr<ListBox> pLbCopyArea;
+ VclPtr<formula::RefEdit> pEdCopyArea;
+ VclPtr<formula::RefButton> pRbCopyArea;
+ VclPtr<CheckBox> pBtnDestPers;
+ VclPtr<FixedText> pFtDbAreaLabel;
+ VclPtr<FixedText> pFtDbArea;
const OUString aStrUndefined;
const OUString aStrNone;
@@ -121,10 +122,10 @@ private:
ScDocument* pDoc;
SCTAB nSrcTab;
- std::vector<ComboBox*> maValueEdArr;
- std::vector<ListBox*> maFieldLbArr;
- std::vector<ListBox*> maCondLbArr;
- std::vector<ListBox*> maConnLbArr;
+ std::vector<VclPtr<ComboBox>> maValueEdArr;
+ std::vector<VclPtr<ListBox>> maFieldLbArr;
+ std::vector<VclPtr<ListBox>> maCondLbArr;
+ std::vector<VclPtr<ListBox>> maConnLbArr;
std::deque<bool> maHasDates;
std::deque<bool> maRefreshExceptQuery;
@@ -163,6 +164,7 @@ public:
ScSpecialFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent,
const SfxItemSet& rArgSet );
virtual ~ScSpecialFilterDlg();
+ virtual void dispose() SAL_OVERRIDE;
virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) SAL_OVERRIDE;
@@ -172,27 +174,27 @@ public:
virtual bool Close() SAL_OVERRIDE;
private:
- ListBox* pLbFilterArea;
- formula::RefEdit* pEdFilterArea;
- formula::RefButton* pRbFilterArea;
-
- VclExpander* pExpander;
- CheckBox* pBtnCase;
- CheckBox* pBtnRegExp;
- CheckBox* pBtnHeader;
- CheckBox* pBtnUnique;
- CheckBox* pBtnCopyResult;
- ListBox* pLbCopyArea;
- formula::RefEdit* pEdCopyArea;
- formula::RefButton* pRbCopyArea;
- CheckBox* pBtnDestPers;
- FixedText* pFtDbAreaLabel;
- FixedText* pFtDbArea;
+ VclPtr<ListBox> pLbFilterArea;
+ VclPtr<formula::RefEdit> pEdFilterArea;
+ VclPtr<formula::RefButton> pRbFilterArea;
+
+ VclPtr<VclExpander> pExpander;
+ VclPtr<CheckBox> pBtnCase;
+ VclPtr<CheckBox> pBtnRegExp;
+ VclPtr<CheckBox> pBtnHeader;
+ VclPtr<CheckBox> pBtnUnique;
+ VclPtr<CheckBox> pBtnCopyResult;
+ VclPtr<ListBox> pLbCopyArea;
+ VclPtr<formula::RefEdit> pEdCopyArea;
+ VclPtr<formula::RefButton> pRbCopyArea;
+ VclPtr<CheckBox> pBtnDestPers;
+ VclPtr<FixedText> pFtDbAreaLabel;
+ VclPtr<FixedText> pFtDbArea;
const OUString aStrUndefined;
const OUString aStrNoName;
- OKButton* pBtnOk;
- CancelButton* pBtnCancel;
+ VclPtr<OKButton> pBtnOk;
+ VclPtr<CancelButton> pBtnCancel;
ScFilterOptionsMgr* pOptionsMgr;
@@ -202,7 +204,7 @@ private:
ScViewData* pViewData;
ScDocument* pDoc;
- formula::RefEdit* pRefInputEdit;
+ VclPtr<formula::RefEdit> pRefInputEdit;
bool bRefInputMode;
// Hack: RefInput control
diff --git a/sc/source/ui/inc/foptmgr.hxx b/sc/source/ui/inc/foptmgr.hxx
index fae7f16a8520..ee27b40f5fc5 100644
--- a/sc/source/ui/inc/foptmgr.hxx
+++ b/sc/source/ui/inc/foptmgr.hxx
@@ -46,7 +46,7 @@ public:
CheckBox* refBtnDestPers,
ListBox* refLbCopyArea,
Edit* refEdCopyArea,
- formula::RefButton* refRbCopyArea,
+ formula::RefButton* refRbCopyArea,
FixedText* refFtDbAreaLabel,
FixedText* refFtDbArea,
const OUString& refStrUndefined );
@@ -57,17 +57,17 @@ private:
ScViewData* pViewData;
ScDocument* pDoc;
- CheckBox* pBtnCase;
- CheckBox* pBtnRegExp;
- CheckBox* pBtnHeader;
- CheckBox* pBtnUnique;
- CheckBox* pBtnCopyResult;
- CheckBox* pBtnDestPers;
- ListBox* pLbCopyArea;
- Edit* pEdCopyArea;
- formula::RefButton* pRbCopyArea;
- FixedText* pFtDbAreaLabel;
- FixedText* pFtDbArea;
+ VclPtr<CheckBox> pBtnCase;
+ VclPtr<CheckBox> pBtnRegExp;
+ VclPtr<CheckBox> pBtnHeader;
+ VclPtr<CheckBox> pBtnUnique;
+ VclPtr<CheckBox> pBtnCopyResult;
+ VclPtr<CheckBox> pBtnDestPers;
+ VclPtr<ListBox> pLbCopyArea;
+ VclPtr<Edit> pEdCopyArea;
+ VclPtr<formula::RefButton> pRbCopyArea;
+ VclPtr<FixedText> pFtDbAreaLabel;
+ VclPtr<FixedText> pFtDbArea;
const OUString& rStrUndefined;
diff --git a/sc/source/ui/inc/formula.hxx b/sc/source/ui/inc/formula.hxx
index 66db8807c815..b525b189c18f 100644
--- a/sc/source/ui/inc/formula.hxx
+++ b/sc/source/ui/inc/formula.hxx
@@ -55,6 +55,7 @@ public:
ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
vcl::Window* pParent, ScViewData* pViewData ,formula::IFunctionManager* _pFunctionMgr);
virtual ~ScFormulaDlg();
+ virtual void dispose() SAL_OVERRIDE;
// IFormulaEditorHelper
virtual void notifyChange() SAL_OVERRIDE;
diff --git a/sc/source/ui/inc/fupoor.hxx b/sc/source/ui/inc/fupoor.hxx
index 131edf61ed68..e38ca5c08f74 100644
--- a/sc/source/ui/inc/fupoor.hxx
+++ b/sc/source/ui/inc/fupoor.hxx
@@ -43,11 +43,11 @@ class FuPoor
protected:
ScDrawView* pView;
ScTabViewShell* pViewShell;
- vcl::Window* pWindow;
+ VclPtr<vcl::Window> pWindow;
SdrModel* pDrDoc;
SfxRequest aSfxRequest;
- Dialog* pDialog;
+ VclPtr<Dialog> pDialog;
Timer aScrollTimer; // for Autoscrolling
DECL_LINK( ScrollHdl, void * );
diff --git a/sc/source/ui/inc/gridmerg.hxx b/sc/source/ui/inc/gridmerg.hxx
index f98d76fd8982..94e8994df881 100644
--- a/sc/source/ui/inc/gridmerg.hxx
+++ b/sc/source/ui/inc/gridmerg.hxx
@@ -25,7 +25,7 @@ class OutputDevice;
class ScGridMerger
{
private:
- OutputDevice* pDev;
+ VclPtr<OutputDevice> pDev;
long nOneX;
long nOneY;
long nFixStart;
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index a9d54d0e7426..8a0f5d4f7237 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -136,10 +136,10 @@ class ScGridWindow : public vcl::Window, public DropTargetHelper, public DragSou
std::unique_ptr<ScNoteMarker> mpNoteMarker;
- std::unique_ptr<ScFilterListBox> mpFilterBox;
- std::unique_ptr<FloatingWindow> mpFilterFloat;
- std::unique_ptr<ScCheckListMenuWindow> mpAutoFilterPopup;
- std::unique_ptr<ScCheckListMenuWindow> mpDPFieldPopup;
+ VclPtr<ScFilterListBox> mpFilterBox;
+ VclPtr<FloatingWindow> mpFilterFloat;
+ VclPtr<ScCheckListMenuWindow> mpAutoFilterPopup;
+ VclPtr<ScCheckListMenuWindow> mpDPFieldPopup;
std::unique_ptr<ScDPFieldButton> mpFilterButton;
sal_uInt16 nCursorHideCount;
@@ -310,6 +310,7 @@ public:
ScGridWindow( vcl::Window* pParent, ScViewData* pData, ScSplitPos eWhichPos );
virtual ~ScGridWindow();
+ virtual void dispose() SAL_OVERRIDE;
virtual void KeyInput(const KeyEvent& rKEvt) SAL_OVERRIDE;
// #i70788# flush and get overlay
diff --git a/sc/source/ui/inc/groupdlg.hxx b/sc/source/ui/inc/groupdlg.hxx
index 04a98c6a15c5..2fdee6c08855 100644
--- a/sc/source/ui/inc/groupdlg.hxx
+++ b/sc/source/ui/inc/groupdlg.hxx
@@ -29,12 +29,12 @@ class ScGroupDlg : public ModalDialog
public:
ScGroupDlg(vcl::Window* pParent, bool bUnGroup = false, bool bRows = true);
virtual ~ScGroupDlg();
-
+ virtual void dispose() SAL_OVERRIDE;
bool GetColsChecked() const;
private:
- RadioButton* m_pBtnRows;
- RadioButton* m_pBtnCols;
+ VclPtr<RadioButton> m_pBtnRows;
+ VclPtr<RadioButton> m_pBtnCols;
};
#endif // INCLUDED_SC_SOURCE_UI_INC_GROUPDLG_HXX
diff --git a/sc/source/ui/inc/highred.hxx b/sc/source/ui/inc/highred.hxx
index 0b0039dd9ca6..d384c1caf23a 100644
--- a/sc/source/ui/inc/highred.hxx
+++ b/sc/source/ui/inc/highred.hxx
@@ -51,14 +51,14 @@ class ScDocument;
class ScHighlightChgDlg : public ScAnyRefDlg
{
private:
- CheckBox* m_pHighlightBox;
- SvxTPFilter* m_pFilterCtr;
- CheckBox* m_pCbAccept;
- CheckBox* m_pCbReject;
- OKButton* m_pOkButton;
+ VclPtr<CheckBox> m_pHighlightBox;
+ VclPtr<SvxTPFilter> m_pFilterCtr;
+ VclPtr<CheckBox> m_pCbAccept;
+ VclPtr<CheckBox> m_pCbReject;
+ VclPtr<OKButton> m_pOkButton;
- formula::RefEdit* m_pEdAssign;
- formula::RefButton* m_pRbAssign;
+ VclPtr<formula::RefEdit> m_pEdAssign;
+ VclPtr<formula::RefButton> m_pRbAssign;
ScViewData* pViewData;
ScDocument* pDoc;
@@ -81,6 +81,7 @@ public:
ScViewData* ptrViewData);
virtual ~ScHighlightChgDlg();
+ virtual void dispose() SAL_OVERRIDE;
virtual void SetActive() SAL_OVERRIDE;
virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) SAL_OVERRIDE;
diff --git a/sc/source/ui/inc/inputhdl.hxx b/sc/source/ui/inc/inputhdl.hxx
index 829ec975f875..dfad789dcf40 100644
--- a/sc/source/ui/inc/inputhdl.hxx
+++ b/sc/source/ui/inc/inputhdl.hxx
@@ -28,6 +28,7 @@
#include <tools/gen.hxx>
#include <tools/link.hxx>
#include <vcl/vclevent.hxx>
+#include <vcl/vclptr.hxx>
#include <editeng/svxenum.hxx>
#include <set>
@@ -54,7 +55,7 @@ struct ESelection;
class ScInputHandler : boost::noncopyable
{
private:
- ScInputWindow* pInputWin;
+ VclPtr<ScInputWindow> pInputWin;
ScEditEngineDefaulter* pEngine; ///< Edited data in the sheet (when the user clicks into the sheet, and starts writing there).
EditView* pTableView; // associated active EditView
@@ -66,9 +67,9 @@ private:
ScTypedCaseStrSet::const_iterator miAutoPosColumn;
ScTypedCaseStrSet::const_iterator miAutoPosFormula;
- vcl::Window* pTipVisibleParent;
+ VclPtr<vcl::Window> pTipVisibleParent;
sal_uLong nTipVisible;
- vcl::Window* pTipVisibleSecParent;
+ VclPtr<vcl::Window> pTipVisibleSecParent;
sal_uLong nTipVisibleSec;
OUString aManualTip;
OUString aAutoSearch;
@@ -240,7 +241,7 @@ public:
bool IsFormulaMode() const { return bFormulaMode; }
ScInputWindow* GetInputWindow() { return pInputWin; }
- void SetInputWindow( ScInputWindow* pNew ) { pInputWin = pNew; }
+ void SetInputWindow( ScInputWindow* pNew );
void StopInputWinEngine( bool bAll );
bool IsInEnterHandler() const { return bInEnterHandler; }
diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx
index a1c9478ff104..f846d7b9b8c0 100644
--- a/sc/source/ui/inc/inputwin.hxx
+++ b/sc/source/ui/inc/inputwin.hxx
@@ -62,6 +62,7 @@ class ScTextWnd : public ScTextWndBase, public DragSourceHelper // edit wind
public:
ScTextWnd( vcl::Window* pParent, ScTabViewShell* pViewSh );
virtual ~ScTextWnd();
+ virtual void dispose() SAL_OVERRIDE;
virtual void SetTextString( const OUString& rString ) SAL_OVERRIDE;
virtual const OUString& GetTextString() const SAL_OVERRIDE;
@@ -139,6 +140,7 @@ private:
public:
ScPosWnd( vcl::Window* pParent );
virtual ~ScPosWnd();
+ virtual void dispose() SAL_OVERRIDE;
void SetPos( const OUString& rPosStr ); // Displayed Text
void SetFormulaMode( bool bSet );
@@ -201,8 +203,9 @@ class ScInputBarGroup : public ScTextWndBase
public:
ScInputBarGroup( vcl::Window* Parent, ScTabViewShell* pViewSh );
virtual ~ScInputBarGroup();
- virtual void InsertAccessibleTextData( ScAccessibleEditLineTextData& rTextData ) SAL_OVERRIDE;
- virtual void RemoveAccessibleTextData( ScAccessibleEditLineTextData& rTextData ) SAL_OVERRIDE;
+ virtual void dispose() SAL_OVERRIDE;
+ virtual void InsertAccessibleTextData( ScAccessibleEditLineTextData& rTextData ) SAL_OVERRIDE;
+ virtual void RemoveAccessibleTextData( ScAccessibleEditLineTextData& rTextData ) SAL_OVERRIDE;
// virtual void Paint(const Rectangle& rRect );
void SetTextString( const OUString& rString ) SAL_OVERRIDE;
void StartEditEngine() SAL_OVERRIDE;
@@ -217,16 +220,16 @@ public:
bool IsFocus();
void MakeDialogEditView() SAL_OVERRIDE;
bool IsInputActive() SAL_OVERRIDE;
- ScrollBar& GetScrollBar() { return aScrollBar; }
+ ScrollBar& GetScrollBar() { return *aScrollBar.get(); }
void IncrementVerticalSize();
void DecrementVerticalSize();
- long GetNumLines() { return aMultiTextWnd.GetNumLines(); }
+ long GetNumLines() { return aMultiTextWnd->GetNumLines(); }
long GetVertOffset() { return nVertOffset; }
private:
void TriggerToolboxLayout();
- ScMultiTextWnd aMultiTextWnd;
- ImageButton aButton;
- ScrollBar aScrollBar;
+ VclPtr<ScMultiTextWnd> aMultiTextWnd;
+ VclPtr<ImageButton> aButton;
+ VclPtr<ScrollBar> aScrollBar;
long nVertOffset;
DECL_LINK( ClickHdl, void* );
DECL_LINK( Impl_ScrollHdl, void* );
@@ -238,6 +241,7 @@ class ScInputWindow : public ToolBox // Parent toolbox
public:
ScInputWindow( vcl::Window* pParent, SfxBindings* pBind );
virtual ~ScInputWindow();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
@@ -284,8 +288,8 @@ protected:
bool UseSubTotal( ScRangeList* pRangeList ) const;
bool IsPointerAtResizePos();
private:
- ScPosWnd aWndPos;
- std::unique_ptr<ScTextWndBase> pRuntimeWindow;
+ VclPtr<ScPosWnd> aWndPos;
+ VclPtr<ScTextWndBase> pRuntimeWindow;
ScTextWndBase& aTextWindow;
ScInputHandler* pInputHdl;
OUString aTextOk;
diff --git a/sc/source/ui/inc/inscldlg.hxx b/sc/source/ui/inc/inscldlg.hxx
index dd9a250f7acb..e89d68d9bdb3 100644
--- a/sc/source/ui/inc/inscldlg.hxx
+++ b/sc/source/ui/inc/inscldlg.hxx
@@ -29,14 +29,15 @@
class ScInsertCellDlg : public ModalDialog
{
private:
- RadioButton* m_pBtnCellsDown;
- RadioButton* m_pBtnCellsRight;
- RadioButton* m_pBtnInsRow;
- RadioButton* m_pBtnInsCol;
+ VclPtr<RadioButton> m_pBtnCellsDown;
+ VclPtr<RadioButton> m_pBtnCellsRight;
+ VclPtr<RadioButton> m_pBtnInsRow;
+ VclPtr<RadioButton> m_pBtnInsCol;
public:
ScInsertCellDlg( vcl::Window* pParent,bool bDisallowCellMove = false );
virtual ~ScInsertCellDlg();
+ virtual void dispose() SAL_OVERRIDE;
InsCellCmd GetInsCellCmd() const;
};
diff --git a/sc/source/ui/inc/inscodlg.hxx b/sc/source/ui/inc/inscodlg.hxx
index 30f89fe35eda..65ea1d9d5f6f 100644
--- a/sc/source/ui/inc/inscodlg.hxx
+++ b/sc/source/ui/inc/inscodlg.hxx
@@ -34,6 +34,7 @@ public:
InsertDeleteFlags nCheckDefaults = IDF_NONE,
const OUString* pStrTitle = NULL );
virtual ~ScInsertContentsDlg();
+ virtual void dispose() SAL_OVERRIDE;
InsertDeleteFlags GetInsContentsCmdBits() const;
sal_uInt16 GetFormulaCmdBits() const;
@@ -48,32 +49,32 @@ public:
void SetCellShiftDisabled( int nDisable );
private:
- CheckBox* mpBtnInsAll;
- CheckBox* mpBtnInsStrings;
- CheckBox* mpBtnInsNumbers;
- CheckBox* mpBtnInsDateTime;
- CheckBox* mpBtnInsFormulas;
- CheckBox* mpBtnInsNotes;
- CheckBox* mpBtnInsAttrs;
- CheckBox* mpBtnInsObjects;
-
- CheckBox* mpBtnSkipEmptyCells;
- CheckBox* mpBtnTranspose;
- CheckBox* mpBtnLink;
-
- RadioButton* mpRbNoOp;
- RadioButton* mpRbAdd;
- RadioButton* mpRbSub;
- RadioButton* mpRbMul;
- RadioButton* mpRbDiv;
-
- RadioButton* mpRbMoveNone;
- RadioButton* mpRbMoveDown;
- RadioButton* mpRbMoveRight;
-
- PushButton* mpBtnShortCutPasteValuesOnly;
- PushButton* mpBtnShortCutPasteValuesFormats;
- PushButton* mpBtnShortCutPasteTranspose;
+ VclPtr<CheckBox> mpBtnInsAll;
+ VclPtr<CheckBox> mpBtnInsStrings;
+ VclPtr<CheckBox> mpBtnInsNumbers;
+ VclPtr<CheckBox> mpBtnInsDateTime;
+ VclPtr<CheckBox> mpBtnInsFormulas;
+ VclPtr<CheckBox> mpBtnInsNotes;
+ VclPtr<CheckBox> mpBtnInsAttrs;
+ VclPtr<CheckBox> mpBtnInsObjects;
+
+ VclPtr<CheckBox> mpBtnSkipEmptyCells;
+ VclPtr<CheckBox> mpBtnTranspose;
+ VclPtr<CheckBox> mpBtnLink;
+
+ VclPtr<RadioButton> mpRbNoOp;
+ VclPtr<RadioButton> mpRbAdd;
+ VclPtr<RadioButton> mpRbSub;
+ VclPtr<RadioButton> mpRbMul;
+ VclPtr<RadioButton> mpRbDiv;
+
+ VclPtr<RadioButton> mpRbMoveNone;
+ VclPtr<RadioButton> mpRbMoveDown;
+ VclPtr<RadioButton> mpRbMoveRight;
+
+ VclPtr<PushButton> mpBtnShortCutPasteValuesOnly;
+ VclPtr<PushButton> mpBtnShortCutPasteValuesFormats;
+ VclPtr<PushButton> mpBtnShortCutPasteTranspose;
bool bOtherDoc;
bool bFillMode;
diff --git a/sc/source/ui/inc/instbdlg.hxx b/sc/source/ui/inc/instbdlg.hxx
index 7bc1dd590b7f..64bc24f5bc17 100644
--- a/sc/source/ui/inc/instbdlg.hxx
+++ b/sc/source/ui/inc/instbdlg.hxx
@@ -44,6 +44,7 @@ class ScInsertTableDlg : public ModalDialog
public:
ScInsertTableDlg( vcl::Window* pParent, ScViewData& rViewData, SCTAB nTabCount, bool bFromFile );
virtual ~ScInsertTableDlg();
+ virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE; // override to set parent dialog
@@ -57,19 +58,19 @@ public:
SCTAB GetTableCount() const { return nTableCount;}
private:
- RadioButton* m_pBtnBefore;
- RadioButton* m_pBtnBehind;
- RadioButton* m_pBtnNew;
- RadioButton* m_pBtnFromFile;
- FixedText* m_pFtCount;
- NumericField* m_pNfCount;
- FixedText* m_pFtName;
- Edit* m_pEdName;
- ListBox* m_pLbTables;
- FixedText* m_pFtPath;
- PushButton* m_pBtnBrowse;
- CheckBox* m_pBtnLink;
- OKButton* m_pBtnOk;
+ VclPtr<RadioButton> m_pBtnBefore;
+ VclPtr<RadioButton> m_pBtnBehind;
+ VclPtr<RadioButton> m_pBtnNew;
+ VclPtr<RadioButton> m_pBtnFromFile;
+ VclPtr<FixedText> m_pFtCount;
+ VclPtr<NumericField> m_pNfCount;
+ VclPtr<FixedText> m_pFtName;
+ VclPtr<Edit> m_pEdName;
+ VclPtr<ListBox> m_pLbTables;
+ VclPtr<FixedText> m_pFtPath;
+ VclPtr<PushButton> m_pBtnBrowse;
+ VclPtr<CheckBox> m_pBtnLink;
+ VclPtr<OKButton> m_pBtnOk;
Timer aBrowseTimer;
ScViewData& rViewData;
diff --git a/sc/source/ui/inc/lbseldlg.hxx b/sc/source/ui/inc/lbseldlg.hxx
index 39c2fd61a67b..ab52b76318fd 100644
--- a/sc/source/ui/inc/lbseldlg.hxx
+++ b/sc/source/ui/inc/lbseldlg.hxx
@@ -30,12 +30,14 @@
class ScSelEntryDlg : public ModalDialog
{
private:
- ListBox* m_pLb;
+ VclPtr<ListBox> m_pLb;
DECL_LINK( DblClkHdl, void * );
public:
ScSelEntryDlg(vcl::Window* pParent, const std::vector<OUString> &rEntryList);
+ virtual ~ScSelEntryDlg();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetSelectEntry() const;
};
diff --git a/sc/source/ui/inc/linkarea.hxx b/sc/source/ui/inc/linkarea.hxx
index 6c11b2f0053b..d88b17d76b41 100644
--- a/sc/source/ui/inc/linkarea.hxx
+++ b/sc/source/ui/inc/linkarea.hxx
@@ -37,13 +37,13 @@ class ScDocShell;
class ScLinkedAreaDlg : public ModalDialog
{
private:
- SvtURLBox* m_pCbUrl;
- PushButton* m_pBtnBrowse;
- ListBox* m_pLbRanges;
- CheckBox* m_pBtnReload;
- NumericField* m_pNfDelay;
- FixedText* m_pFtSeconds;
- OKButton* m_pBtnOk;
+ VclPtr<SvtURLBox> m_pCbUrl;
+ VclPtr<PushButton> m_pBtnBrowse;
+ VclPtr<ListBox> m_pLbRanges;
+ VclPtr<CheckBox> m_pBtnReload;
+ VclPtr<NumericField> m_pNfDelay;
+ VclPtr<FixedText> m_pFtSeconds;
+ VclPtr<OKButton> m_pBtnOk;
ScDocShell* pSourceShell;
sfx2::DocumentInserter* pDocInserter;
@@ -64,6 +64,7 @@ private:
public:
ScLinkedAreaDlg( vcl::Window* pParent );
virtual ~ScLinkedAreaDlg();
+ virtual void dispose() SAL_OVERRIDE;
void InitFromOldLink( const OUString& rFile, const OUString& rFilter,
const OUString& rOptions, const OUString& rSource,
diff --git a/sc/source/ui/inc/mtrindlg.hxx b/sc/source/ui/inc/mtrindlg.hxx
index ab422cf22819..72b106fd3504 100644
--- a/sc/source/ui/inc/mtrindlg.hxx
+++ b/sc/source/ui/inc/mtrindlg.hxx
@@ -38,12 +38,14 @@ public:
long nMinimum = 0,
long nFirst = 1,
long nLast = 100 );
+ virtual ~ScMetricInputDlg();
+ virtual void dispose() SAL_OVERRIDE;
long GetInputValue( FieldUnit eUnit = FUNIT_TWIP ) const;
private:
- MetricField* m_pEdValue;
- CheckBox* m_pBtnDefVal;
+ VclPtr<MetricField> m_pEdValue;
+ VclPtr<CheckBox> m_pBtnDefVal;
long nDefaultValue;
long nCurrentValue;
diff --git a/sc/source/ui/inc/mvtabdlg.hxx b/sc/source/ui/inc/mvtabdlg.hxx
index 0087e42927e6..cef3d5f8160b 100644
--- a/sc/source/ui/inc/mvtabdlg.hxx
+++ b/sc/source/ui/inc/mvtabdlg.hxx
@@ -32,6 +32,7 @@ class ScMoveTableDlg : public ModalDialog
public:
ScMoveTableDlg(vcl::Window* pParent, const OUString& rDefault);
virtual ~ScMoveTableDlg();
+ virtual void dispose() SAL_OVERRIDE;
sal_uInt16 GetSelectedDocument () const { return nDocument; }
SCTAB GetSelectedTable () const { return nTable; }
@@ -49,13 +50,13 @@ private:
bool IsCurrentDocSelected() const;
private:
- RadioButton* pBtnMove;
- RadioButton* pBtnCopy;
- ListBox* pLbDoc;
- ListBox* pLbTable;
- Edit* pEdTabName;
- FixedText* pFtWarn;
- OKButton* pBtnOk;
+ VclPtr<RadioButton> pBtnMove;
+ VclPtr<RadioButton> pBtnCopy;
+ VclPtr<ListBox> pLbDoc;
+ VclPtr<ListBox> pLbTable;
+ VclPtr<Edit> pEdTabName;
+ VclPtr<FixedText> pFtWarn;
+ VclPtr<OKButton> pBtnOk;
OUString msCurrentDoc;
OUString msNewDoc;
diff --git a/sc/source/ui/inc/namecrea.hxx b/sc/source/ui/inc/namecrea.hxx
index ef8762605dbc..7a53cd85a4a7 100644
--- a/sc/source/ui/inc/namecrea.hxx
+++ b/sc/source/ui/inc/namecrea.hxx
@@ -28,13 +28,14 @@
class ScNameCreateDlg : public ModalDialog
{
protected:
- CheckBox* m_pTopBox;
- CheckBox* m_pLeftBox;
- CheckBox* m_pBottomBox;
- CheckBox* m_pRightBox;
+ VclPtr<CheckBox> m_pTopBox;
+ VclPtr<CheckBox> m_pLeftBox;
+ VclPtr<CheckBox> m_pBottomBox;
+ VclPtr<CheckBox> m_pRightBox;
public:
ScNameCreateDlg( vcl::Window * pParent, sal_uInt16 nFlags );
-
+ virtual ~ScNameCreateDlg();
+ virtual void dispose() SAL_OVERRIDE;
sal_uInt16 GetFlags() const;
};
diff --git a/sc/source/ui/inc/namedefdlg.hxx b/sc/source/ui/inc/namedefdlg.hxx
index b21a0be4924b..acdb9ed31e52 100644
--- a/sc/source/ui/inc/namedefdlg.hxx
+++ b/sc/source/ui/inc/namedefdlg.hxx
@@ -26,21 +26,21 @@ class ScViewData;
class ScNameDefDlg : public ScAnyRefDlg
{
private:
- Edit* m_pEdName;
+ VclPtr<Edit> m_pEdName;
- formula::RefEdit* m_pEdRange;
- formula::RefButton* m_pRbRange;
+ VclPtr<formula::RefEdit> m_pEdRange;
+ VclPtr<formula::RefButton> m_pRbRange;
- ListBox* m_pLbScope;
+ VclPtr<ListBox> m_pLbScope;
- CheckBox* m_pBtnRowHeader;
- CheckBox* m_pBtnColHeader;
- CheckBox* m_pBtnPrintArea;
- CheckBox* m_pBtnCriteria;
+ VclPtr<CheckBox> m_pBtnRowHeader;
+ VclPtr<CheckBox> m_pBtnColHeader;
+ VclPtr<CheckBox> m_pBtnPrintArea;
+ VclPtr<CheckBox> m_pBtnCriteria;
- PushButton* m_pBtnAdd;
- PushButton* m_pBtnCancel;
- FixedText* m_pFtInfo;
+ VclPtr<PushButton> m_pBtnAdd;
+ VclPtr<PushButton> m_pBtnCancel;
+ VclPtr<FixedText> m_pFtInfo;
bool mbUndo; //if true we need to add an undo action after creating a range name
ScDocument* mpDoc;
@@ -77,7 +77,8 @@ public:
ScViewData* pViewData, const std::map<OUString, ScRangeName*>& aRangeMap,
const ScAddress& aCursorPos, const bool bUndo);
- virtual ~ScNameDefDlg() {};
+ virtual ~ScNameDefDlg();
+ virtual void dispose() SAL_OVERRIDE;
virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) SAL_OVERRIDE;
virtual bool IsRefInputMode() const SAL_OVERRIDE;
diff --git a/sc/source/ui/inc/namedlg.hxx b/sc/source/ui/inc/namedlg.hxx
index cb586b928554..cad2f9d8d364 100644
--- a/sc/source/ui/inc/namedlg.hxx
+++ b/sc/source/ui/inc/namedlg.hxx
@@ -43,24 +43,24 @@ class ScDocument;
class ScNameDlg : public ScAnyRefDlg, public ScRangeManagerTable::InitListener
{
private:
- Edit* m_pEdName;
- formula::RefEdit* m_pEdAssign;
- formula::RefButton* m_pRbAssign;
- ListBox* m_pLbScope;
+ VclPtr<Edit> m_pEdName;
+ VclPtr<formula::RefEdit> m_pEdAssign;
+ VclPtr<formula::RefButton> m_pRbAssign;
+ VclPtr<ListBox> m_pLbScope;
- CheckBox* m_pBtnPrintArea;
- CheckBox* m_pBtnColHeader;
- CheckBox* m_pBtnCriteria;
- CheckBox* m_pBtnRowHeader;
+ VclPtr<CheckBox> m_pBtnPrintArea;
+ VclPtr<CheckBox> m_pBtnColHeader;
+ VclPtr<CheckBox> m_pBtnCriteria;
+ VclPtr<CheckBox> m_pBtnRowHeader;
- PushButton* m_pBtnAdd;
- PushButton* m_pBtnDelete;
- PushButton* m_pBtnOk;
- PushButton* m_pBtnCancel;
+ VclPtr<PushButton> m_pBtnAdd;
+ VclPtr<PushButton> m_pBtnDelete;
+ VclPtr<PushButton> m_pBtnOk;
+ VclPtr<PushButton> m_pBtnCancel;
- FixedText* m_pFtInfo;
+ VclPtr<FixedText> m_pFtInfo;
- ScRangeManagerTable* m_pRangeManagerTable;
+ VclPtr<ScRangeManagerTable> m_pRangeManagerTable;
const OUString maGlobalNameStr;
const OUString maErrInvalidNameStr;
@@ -123,6 +123,7 @@ public:
ScViewData* ptrViewData,
const ScAddress& aCursorPos, boost::ptr_map<OUString, ScRangeName>* pRangeMap = NULL );
virtual ~ScNameDlg();
+ virtual void dispose() SAL_OVERRIDE;
virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) SAL_OVERRIDE;
virtual bool IsRefInputMode() const SAL_OVERRIDE;
diff --git a/sc/source/ui/inc/namemgrtable.hxx b/sc/source/ui/inc/namemgrtable.hxx
index f50b7bd8a47e..f87e3dd99519 100644
--- a/sc/source/ui/inc/namemgrtable.hxx
+++ b/sc/source/ui/inc/namemgrtable.hxx
@@ -66,6 +66,7 @@ private:
public:
ScRangeManagerTable( SvSimpleTableContainer& rParent, boost::ptr_map<OUString, ScRangeName>& aTabRangeNames, const ScAddress& rPos );
virtual ~ScRangeManagerTable();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
diff --git a/sc/source/ui/inc/namepast.hxx b/sc/source/ui/inc/namepast.hxx
index 866ffc79ee04..a71a95b23e9c 100644
--- a/sc/source/ui/inc/namepast.hxx
+++ b/sc/source/ui/inc/namepast.hxx
@@ -37,11 +37,11 @@ class ScNamePasteDlg : public ModalDialog
DECL_LINK( ButtonHdl, Button * );
private:
- PushButton* m_pBtnPasteAll;
- PushButton* m_pBtnPaste;
- PushButton* m_pBtnClose;
+ VclPtr<PushButton> m_pBtnPasteAll;
+ VclPtr<PushButton> m_pBtnPaste;
+ VclPtr<PushButton> m_pBtnClose;
- ScRangeManagerTable* mpTable;
+ VclPtr<ScRangeManagerTable> mpTable;
std::vector<OUString> maSelectedNames;
boost::ptr_map<OUString, ScRangeName> maRangeMap;
@@ -49,6 +49,7 @@ public:
ScNamePasteDlg( vcl::Window * pParent, ScDocShell* pShell, bool bInsList=true );
virtual ~ScNamePasteDlg();
+ virtual void dispose() SAL_OVERRIDE;
std::vector<OUString> GetSelectedNames() const;
};
diff --git a/sc/source/ui/inc/navipi.hxx b/sc/source/ui/inc/navipi.hxx
index f966fba1b9ff..8445a094019c 100644
--- a/sc/source/ui/inc/navipi.hxx
+++ b/sc/source/ui/inc/navipi.hxx
@@ -97,10 +97,11 @@ class ScScenarioWindow : public vcl::Window
public:
ScScenarioWindow( vcl::Window* pParent, const OUString& aQH_List, const OUString& aQH_Comment);
virtual ~ScScenarioWindow();
+ virtual void dispose() SAL_OVERRIDE;
void NotifyState( const SfxPoolItem* pState );
void SetComment( const OUString& rComment )
- { aEdComment.SetText( rComment ); }
+ { aEdComment->SetText( rComment ); }
void SetSizePixel( const Size& rNewSize ) SAL_OVERRIDE;
@@ -109,8 +110,8 @@ protected:
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
private:
- ScScenarioListBox aLbScenario;
- MultiLineEdit aEdComment;
+ VclPtr<ScScenarioListBox> aLbScenario;
+ VclPtr<MultiLineEdit> aEdComment;
};
// class ColumnEdit
@@ -220,14 +221,14 @@ private:
SfxBindings& rBindings; // must be first member
ImageList aCmdImageList; // must be before aTbxCmd
- FixedInfo aFtCol;
- ColumnEdit aEdCol;
- FixedInfo aFtRow;
- RowEdit aEdRow;
- CommandToolBox aTbxCmd;
- ScContentTree aLbEntries;
- ScScenarioWindow aWndScenarios;
- ScDocListBox aLbDocuments;
+ VclPtr<FixedInfo> aFtCol;
+ VclPtr<ColumnEdit> aEdCol;
+ VclPtr<FixedInfo> aFtRow;
+ VclPtr<RowEdit> aEdRow;
+ VclPtr<CommandToolBox> aTbxCmd;
+ VclPtr<ScContentTree> aLbEntries;
+ VclPtr<ScScenarioWindow> aWndScenarios;
+ VclPtr<ScDocListBox> aLbDocuments;
Idle aContentIdle;
@@ -309,6 +310,7 @@ public:
ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, vcl::Window* pParent,
const bool bUseStyleSettingsBackground);
virtual ~ScNavigatorDlg();
+ virtual void dispose() SAL_OVERRIDE;
using Window::Notify;
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
@@ -329,7 +331,7 @@ public:
virtual void Resizing( Size& rSize ) SAL_OVERRIDE;
private:
- ScNavigatorDlg* pNavigator;
+ VclPtr<ScNavigatorDlg> pNavigator;
};
#endif // INCLUDED_SC_SOURCE_UI_INC_NAVIPI_HXX
diff --git a/sc/source/ui/inc/notemark.hxx b/sc/source/ui/inc/notemark.hxx
index 537837aa7af3..ee8af56338f0 100644
--- a/sc/source/ui/inc/notemark.hxx
+++ b/sc/source/ui/inc/notemark.hxx
@@ -31,10 +31,10 @@ class SdrObject;
class ScNoteMarker
{
private:
- vcl::Window* pWindow;
- vcl::Window* pRightWin;
- vcl::Window* pBottomWin;
- vcl::Window* pDiagWin;
+ VclPtr<vcl::Window> pWindow;
+ VclPtr<vcl::Window> pRightWin;
+ VclPtr<vcl::Window> pBottomWin;
+ VclPtr<vcl::Window> pDiagWin;
ScDocument* pDoc;
ScAddress aDocPos;
OUString aUserText;
diff --git a/sc/source/ui/inc/olinewin.hxx b/sc/source/ui/inc/olinewin.hxx
index 107447d8529e..c95dffef4229 100644
--- a/sc/source/ui/inc/olinewin.hxx
+++ b/sc/source/ui/inc/olinewin.hxx
@@ -62,6 +62,7 @@ public:
ScViewData* pViewData,
ScSplitPos eWhich );
virtual ~ScOutlineWindow();
+ virtual void dispose() SAL_OVERRIDE;
/** Sets the size of the header area (width/height dep. on window type). */
void SetHeaderSize( long nNewSize );
diff --git a/sc/source/ui/inc/opredlin.hxx b/sc/source/ui/inc/opredlin.hxx
index 0e5e07c6b518..adfb4062a266 100644
--- a/sc/source/ui/inc/opredlin.hxx
+++ b/sc/source/ui/inc/opredlin.hxx
@@ -36,10 +36,10 @@
class ScRedlineOptionsTabPage : public SfxTabPage
{
- ColorListBox* m_pContentColorLB;
- ColorListBox* m_pRemoveColorLB;
- ColorListBox* m_pInsertColorLB;
- ColorListBox* m_pMoveColorLB;
+ VclPtr<ColorListBox> m_pContentColorLB;
+ VclPtr<ColorListBox> m_pRemoveColorLB;
+ VclPtr<ColorListBox> m_pInsertColorLB;
+ VclPtr<ColorListBox> m_pMoveColorLB;
OUString aAuthorStr;
DECL_LINK(ColorHdl, void *);
@@ -47,8 +47,8 @@ public:
ScRedlineOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~ScRedlineOptionsTabPage();
-
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
diff --git a/sc/source/ui/inc/optsolver.hxx b/sc/source/ui/inc/optsolver.hxx
index 6d1fd0f35f1b..1a9acfa1f072 100644
--- a/sc/source/ui/inc/optsolver.hxx
+++ b/sc/source/ui/inc/optsolver.hxx
@@ -96,6 +96,7 @@ public:
ScOptSolverDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent,
ScDocShell* pDocSh, ScAddress aCursorPos );
virtual ~ScOptSolverDlg();
+ virtual void dispose() SAL_OVERRIDE;
virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) SAL_OVERRIDE;
virtual bool IsRefInputMode() const SAL_OVERRIDE;
@@ -103,56 +104,56 @@ public:
virtual bool Close() SAL_OVERRIDE;
private:
- FixedText* m_pFtObjectiveCell;
- formula::RefEdit* m_pEdObjectiveCell;
- formula::RefButton* m_pRBObjectiveCell;
-
- RadioButton* m_pRbMax;
- RadioButton* m_pRbMin;
- RadioButton* m_pRbValue;
- formula::RefEdit* m_pEdTargetValue;
- formula::RefButton* m_pRBTargetValue;
-
- FixedText* m_pFtVariableCells;
- formula::RefEdit* m_pEdVariableCells;
- formula::RefButton* m_pRBVariableCells;
-
- FixedText* m_pFtCellRef; // labels are together with controls for the first row
- ScCursorRefEdit* m_pEdLeft1;
- formula::RefButton* m_pRBLeft1;
- FixedText* m_pFtOperator;
- ListBox* m_pLbOp1;
- FixedText* m_pFtConstraint;
- ScCursorRefEdit* m_pEdRight1;
- formula::RefButton* m_pRBRight1;
- PushButton* m_pBtnDel1;
-
- ScCursorRefEdit* m_pEdLeft2;
- formula::RefButton* m_pRBLeft2;
- ListBox* m_pLbOp2;
- ScCursorRefEdit* m_pEdRight2;
- formula::RefButton* m_pRBRight2;
- PushButton* m_pBtnDel2;
-
- ScCursorRefEdit* m_pEdLeft3;
- formula::RefButton* m_pRBLeft3;
- ListBox* m_pLbOp3;
- ScCursorRefEdit* m_pEdRight3;
- formula::RefButton* m_pRBRight3;
- PushButton* m_pBtnDel3;
-
- ScCursorRefEdit* m_pEdLeft4;
- formula::RefButton* m_pRBLeft4;
- ListBox* m_pLbOp4;
- ScCursorRefEdit* m_pEdRight4;
- formula::RefButton* m_pRBRight4;
- PushButton* m_pBtnDel4;
-
- ScrollBar* m_pScrollBar;
-
- PushButton* m_pBtnOpt;
- PushButton* m_pBtnCancel;
- PushButton* m_pBtnSolve;
+ VclPtr<FixedText> m_pFtObjectiveCell;
+ VclPtr<formula::RefEdit> m_pEdObjectiveCell;
+ VclPtr<formula::RefButton> m_pRBObjectiveCell;
+
+ VclPtr<RadioButton> m_pRbMax;
+ VclPtr<RadioButton> m_pRbMin;
+ VclPtr<RadioButton> m_pRbValue;
+ VclPtr<formula::RefEdit> m_pEdTargetValue;
+ VclPtr<formula::RefButton> m_pRBTargetValue;
+
+ VclPtr<FixedText> m_pFtVariableCells;
+ VclPtr<formula::RefEdit> m_pEdVariableCells;
+ VclPtr<formula::RefButton> m_pRBVariableCells;
+
+ VclPtr<FixedText> m_pFtCellRef; // labels are together with controls for the first row
+ VclPtr<ScCursorRefEdit> m_pEdLeft1;
+ VclPtr<formula::RefButton> m_pRBLeft1;
+ VclPtr<FixedText> m_pFtOperator;
+ VclPtr<ListBox> m_pLbOp1;
+ VclPtr<FixedText> m_pFtConstraint;
+ VclPtr<ScCursorRefEdit> m_pEdRight1;
+ VclPtr<formula::RefButton> m_pRBRight1;
+ VclPtr<PushButton> m_pBtnDel1;
+
+ VclPtr<ScCursorRefEdit> m_pEdLeft2;
+ VclPtr<formula::RefButton> m_pRBLeft2;
+ VclPtr<ListBox> m_pLbOp2;
+ VclPtr<ScCursorRefEdit> m_pEdRight2;
+ VclPtr<formula::RefButton> m_pRBRight2;
+ VclPtr<PushButton> m_pBtnDel2;
+
+ VclPtr<ScCursorRefEdit> m_pEdLeft3;
+ VclPtr<formula::RefButton> m_pRBLeft3;
+ VclPtr<ListBox> m_pLbOp3;
+ VclPtr<ScCursorRefEdit> m_pEdRight3;
+ VclPtr<formula::RefButton> m_pRBRight3;
+ VclPtr<PushButton> m_pBtnDel3;
+
+ VclPtr<ScCursorRefEdit> m_pEdLeft4;
+ VclPtr<formula::RefButton> m_pRBLeft4;
+ VclPtr<ListBox> m_pLbOp4;
+ VclPtr<ScCursorRefEdit> m_pEdRight4;
+ VclPtr<formula::RefButton> m_pRBRight4;
+ VclPtr<PushButton> m_pBtnDel4;
+
+ VclPtr<ScrollBar> m_pScrollBar;
+
+ VclPtr<PushButton> m_pBtnOpt;
+ VclPtr<PushButton> m_pBtnCancel;
+ VclPtr<PushButton> m_pBtnSolve;
OUString maInputError;
OUString maConditionError;
@@ -160,16 +161,16 @@ private:
ScDocShell* mpDocShell;
ScDocument& mrDoc;
const SCTAB mnCurTab;
- formula::RefEdit* mpEdActive;
+ VclPtr<formula::RefEdit> mpEdActive;
bool mbDlgLostFocus;
static const sal_uInt16 EDIT_ROW_COUNT = 4;
- ScCursorRefEdit* mpLeftEdit[EDIT_ROW_COUNT];
- formula::RefButton* mpLeftButton[EDIT_ROW_COUNT];
- ScCursorRefEdit* mpRightEdit[EDIT_ROW_COUNT];
- formula::RefButton* mpRightButton[EDIT_ROW_COUNT];
- ListBox* mpOperator[EDIT_ROW_COUNT];
- PushButton* mpDelButton[EDIT_ROW_COUNT];
+ VclPtr<ScCursorRefEdit> mpLeftEdit[EDIT_ROW_COUNT];
+ VclPtr<formula::RefButton> mpLeftButton[EDIT_ROW_COUNT];
+ VclPtr<ScCursorRefEdit> mpRightEdit[EDIT_ROW_COUNT];
+ VclPtr<formula::RefButton> mpRightButton[EDIT_ROW_COUNT];
+ VclPtr<ListBox> mpOperator[EDIT_ROW_COUNT];
+ VclPtr<PushButton> mpDelButton[EDIT_ROW_COUNT];
std::vector<ScOptConditionRow> maConditions;
long nScrollPos;
@@ -202,10 +203,12 @@ private:
class ScSolverProgressDialog : public ModelessDialog
{
- FixedText* m_pFtTime;
+ VclPtr<FixedText> m_pFtTime;
public:
ScSolverProgressDialog( vcl::Window* pParent );
+ virtual ~ScSolverProgressDialog();
+ virtual void dispose() SAL_OVERRIDE;
void HideTimeLimit();
void SetTimeLimit( sal_Int32 nSeconds );
@@ -213,22 +216,26 @@ public:
class ScSolverNoSolutionDialog : public ModalDialog
{
- FixedText* m_pFtErrorText;
+ VclPtr<FixedText> m_pFtErrorText;
public:
ScSolverNoSolutionDialog(vcl::Window* pParent, const OUString& rErrorText);
+ virtual ~ScSolverNoSolutionDialog();
+ virtual void dispose() SAL_OVERRIDE;
};
class ScSolverSuccessDialog : public ModalDialog
{
- FixedText* m_pFtResult;
- PushButton* m_pBtnOk;
- PushButton* m_pBtnCancel;
+ VclPtr<FixedText> m_pFtResult;
+ VclPtr<PushButton> m_pBtnOk;
+ VclPtr<PushButton> m_pBtnCancel;
DECL_LINK(ClickHdl, PushButton*);
public:
ScSolverSuccessDialog( vcl::Window* pParent, const OUString& rSolution );
+ virtual ~ScSolverSuccessDialog();
+ virtual void dispose() SAL_OVERRIDE;
};
#endif
diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx
index 7d8ef814651e..8873af7bd287 100644
--- a/sc/source/ui/inc/output.hxx
+++ b/sc/source/ui/inc/output.hxx
@@ -141,9 +141,9 @@ private:
void adjustForHyperlinkInPDF(Point aURLStart, OutputDevice* pDev);
};
- OutputDevice* mpDev; // Device
- OutputDevice* mpRefDevice; // printer if used for preview
- OutputDevice* pFmtDevice; // reference for text formatting
+ VclPtr<OutputDevice> mpDev; // Device
+ VclPtr<OutputDevice> mpRefDevice; // printer if used for preview
+ VclPtr<OutputDevice> pFmtDevice; // reference for text formatting
ScTableInfo& mrTabInfo;
RowInfo* pRowInfo; // Info block
SCSIZE nArrCount; // occupied lines in info block
diff --git a/sc/source/ui/inc/pfiltdlg.hxx b/sc/source/ui/inc/pfiltdlg.hxx
index 55b3fa8625c2..c2272b311c76 100644
--- a/sc/source/ui/inc/pfiltdlg.hxx
+++ b/sc/source/ui/inc/pfiltdlg.hxx
@@ -40,28 +40,29 @@ class ScPivotFilterDlg : public ModalDialog
public:
ScPivotFilterDlg(vcl::Window* pParent, const SfxItemSet& rArgSet, SCTAB nSourceTab);
virtual ~ScPivotFilterDlg();
+ virtual void dispose() SAL_OVERRIDE;
const ScQueryItem& GetOutputItem();
private:
- ListBox* m_pLbField1;
- ListBox* m_pLbCond1;
- ComboBox* m_pEdVal1;
-
- ListBox* m_pLbConnect1;
- ListBox* m_pLbField2;
- ListBox* m_pLbCond2;
- ComboBox* m_pEdVal2;
-
- ListBox* m_pLbConnect2;
- ListBox* m_pLbField3;
- ListBox* m_pLbCond3;
- ComboBox* m_pEdVal3;
-
- CheckBox* m_pBtnCase;
- CheckBox* m_pBtnRegExp;
- CheckBox* m_pBtnUnique;
- FixedText* m_pFtDbArea;
+ VclPtr<ListBox> m_pLbField1;
+ VclPtr<ListBox> m_pLbCond1;
+ VclPtr<ComboBox> m_pEdVal1;
+
+ VclPtr<ListBox> m_pLbConnect1;
+ VclPtr<ListBox> m_pLbField2;
+ VclPtr<ListBox> m_pLbCond2;
+ VclPtr<ComboBox> m_pEdVal2;
+
+ VclPtr<ListBox> m_pLbConnect2;
+ VclPtr<ListBox> m_pLbField3;
+ VclPtr<ListBox> m_pLbCond3;
+ VclPtr<ComboBox> m_pEdVal3;
+
+ VclPtr<CheckBox> m_pBtnCase;
+ VclPtr<CheckBox> m_pBtnRegExp;
+ VclPtr<CheckBox> m_pBtnUnique;
+ VclPtr<FixedText> m_pFtDbArea;
const OUString aStrNone;
const OUString aStrEmpty;
const OUString aStrNotEmpty;
@@ -75,9 +76,9 @@ private:
SCTAB nSrcTab;
sal_uInt16 nFieldCount;
- ComboBox* aValueEdArr[3];
- ListBox* aFieldLbArr[3];
- ListBox* aCondLbArr[3];
+ VclPtr<ComboBox> aValueEdArr[3];
+ VclPtr<ListBox> aFieldLbArr[3];
+ VclPtr<ListBox> aCondLbArr[3];
std::vector<ScTypedStrData>* pEntryLists[MAXCOLCOUNT];
diff --git a/sc/source/ui/inc/preview.hxx b/sc/source/ui/inc/preview.hxx
index bcf4fbc66d15..7be36eeca8a3 100644
--- a/sc/source/ui/inc/preview.hxx
+++ b/sc/source/ui/inc/preview.hxx
@@ -118,6 +118,7 @@ protected:
public:
ScPreview( vcl::Window* pParent, ScDocShell* pDocSh, ScPreviewShell* pViewSh );
virtual ~ScPreview();
+ virtual void dispose() SAL_OVERRIDE;
virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
diff --git a/sc/source/ui/inc/prevloc.hxx b/sc/source/ui/inc/prevloc.hxx
index 3a4b5bbbefee..3f59e330725e 100644
--- a/sc/source/ui/inc/prevloc.hxx
+++ b/sc/source/ui/inc/prevloc.hxx
@@ -82,7 +82,7 @@ public:
class ScPreviewLocationData
{
- OutputDevice* pWindow;
+ VclPtr<OutputDevice> pWindow;
ScDocument* pDoc;
MapMode aCellMapMode;
MapMode aDrawMapMode[SC_PREVIEW_MAXRANGES];
diff --git a/sc/source/ui/inc/prevwsh.hxx b/sc/source/ui/inc/prevwsh.hxx
index b17ff47669cc..448b3f514151 100644
--- a/sc/source/ui/inc/prevwsh.hxx
+++ b/sc/source/ui/inc/prevwsh.hxx
@@ -40,11 +40,11 @@ class ScPreviewShell: public SfxViewShell
{
ScDocShell* pDocShell;
- SystemWindow* mpFrameWindow;
- ScPreview* pPreview; // Output window
- ScrollBar* pHorScroll;
- ScrollBar* pVerScroll;
- vcl::Window* pCorner;
+ VclPtr<SystemWindow> mpFrameWindow;
+ VclPtr<ScPreview> pPreview; // Output window
+ VclPtr<ScrollBar> pHorScroll;
+ VclPtr<ScrollBar> pVerScroll;
+ VclPtr<vcl::Window> pCorner;
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aSourceData; // ViewData
TriState nSourceDesignMode; // form design mode from TabView
@@ -109,7 +109,7 @@ public:
virtual SfxPrinter* GetPrinter( bool bCreate = false ) SAL_OVERRIDE;
virtual sal_uInt16 SetPrinter( SfxPrinter* pNewPrinter, SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false ) SAL_OVERRIDE;
virtual bool HasPrintOptionsPage() const SAL_OVERRIDE;
- virtual SfxTabPage* CreatePrintOptionsPage( vcl::Window *pParent, const SfxItemSet &rOptions ) SAL_OVERRIDE;
+ virtual VclPtr<SfxTabPage> CreatePrintOptionsPage( vcl::Window *pParent, const SfxItemSet &rOptions ) SAL_OVERRIDE;
void AddAccessibilityObject( SfxListener& rObject );
void RemoveAccessibilityObject( SfxListener& rObject );
diff --git a/sc/source/ui/inc/printfun.hxx b/sc/source/ui/inc/printfun.hxx
index 2e8d51eb575e..265789578cca 100644
--- a/sc/source/ui/inc/printfun.hxx
+++ b/sc/source/ui/inc/printfun.hxx
@@ -130,8 +130,8 @@ class ScPrintFunc
private:
ScDocShell* pDocShell;
ScDocument* pDoc;
- SfxPrinter* pPrinter;
- OutputDevice* pDev;
+ VclPtr<SfxPrinter> pPrinter;
+ VclPtr<OutputDevice> pDev;
FmFormView* pDrawView;
MapMode aOldPrinterMode; // MapMode before the call
diff --git a/sc/source/ui/inc/protectiondlg.hxx b/sc/source/ui/inc/protectiondlg.hxx
index 812b40258dc7..32a0b724c466 100644
--- a/sc/source/ui/inc/protectiondlg.hxx
+++ b/sc/source/ui/inc/protectiondlg.hxx
@@ -35,6 +35,7 @@ class ScTableProtectionDlg : public ModalDialog
public:
explicit ScTableProtectionDlg(vcl::Window* pParent);
virtual ~ScTableProtectionDlg();
+ virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
@@ -49,16 +50,16 @@ private:
void EnableOptionalWidgets(bool bEnable = true);
- CheckBox* m_pBtnProtect;
+ VclPtr<CheckBox> m_pBtnProtect;
- VclContainer* m_pPasswords;
- VclContainer* m_pOptions;
- Edit* m_pPassword1Edit;
- Edit* m_pPassword2Edit;
+ VclPtr<VclContainer> m_pPasswords;
+ VclPtr<VclContainer> m_pOptions;
+ VclPtr<Edit> m_pPassword1Edit;
+ VclPtr<Edit> m_pPassword2Edit;
- SvxCheckListBox* m_pOptionsListBox;
+ VclPtr<SvxCheckListBox> m_pOptionsListBox;
- OKButton* m_pBtnOk;
+ VclPtr<OKButton> m_pBtnOk;
OUString m_aSelectLockedCells;
OUString m_aSelectUnlockedCells;
diff --git a/sc/source/ui/inc/pvfundlg.hxx b/sc/source/ui/inc/pvfundlg.hxx
index 4718e5e5e026..bfebea6b8439 100644
--- a/sc/source/ui/inc/pvfundlg.hxx
+++ b/sc/source/ui/inc/pvfundlg.hxx
@@ -60,7 +60,8 @@ class ScDPFunctionDlg : public ModalDialog
public:
explicit ScDPFunctionDlg( vcl::Window* pParent, const ScDPLabelDataVector& rLabelVec,
const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData );
-
+ virtual ~ScDPFunctionDlg();
+ virtual void dispose() SAL_OVERRIDE;
sal_uInt16 GetFuncMask() const;
::com::sun::star::sheet::DataPilotFieldReference GetFieldRef() const;
@@ -77,14 +78,14 @@ private:
DECL_LINK( DblClickHdl, void* );
private:
- ScDPFunctionListBox* mpLbFunc;
- FixedText* mpFtName;
- ListBox* mpLbType;
- FixedText* mpFtBaseField;
- ListBox* mpLbBaseField;
- FixedText* mpFtBaseItem;
- ListBox* mpLbBaseItem;
- OKButton* mpBtnOk;
+ VclPtr<ScDPFunctionListBox> mpLbFunc;
+ VclPtr<FixedText> mpFtName;
+ VclPtr<ListBox> mpLbType;
+ VclPtr<FixedText> mpFtBaseField;
+ VclPtr<ListBox> mpLbBaseField;
+ VclPtr<FixedText> mpFtBaseItem;
+ VclPtr<ListBox> mpLbBaseItem;
+ VclPtr<OKButton> mpBtnOk;
NameMapType maBaseFieldNameMap; // cache for base field display -> original name.
NameMapType maBaseItemNameMap; // cache for base item display -> original name.
@@ -101,8 +102,9 @@ public:
explicit ScDPSubtotalDlg( vcl::Window* pParent, ScDPObject& rDPObj,
const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData,
const ScDPNameVec& rDataFields, bool bEnableLayout );
-
- sal_uInt16 GetFuncMask() const;
+ virtual ~ScDPSubtotalDlg();
+ virtual void dispose() SAL_OVERRIDE;
+ sal_uInt16 GetFuncMask() const;
void FillLabelData( ScDPLabelData& rLabelData ) const;
@@ -114,14 +116,14 @@ private:
DECL_LINK( ClickHdl, PushButton* );
private:
- RadioButton* mpRbNone;
- RadioButton* mpRbAuto;
- RadioButton* mpRbUser;
- ScDPFunctionListBox* mpLbFunc;
- FixedText* mpFtName;
- CheckBox* mpCbShowAll;
- OKButton* mpBtnOk;
- PushButton* mpBtnOptions;
+ VclPtr<RadioButton> mpRbNone;
+ VclPtr<RadioButton> mpRbAuto;
+ VclPtr<RadioButton> mpRbUser;
+ VclPtr<ScDPFunctionListBox> mpLbFunc;
+ VclPtr<FixedText> mpFtName;
+ VclPtr<CheckBox> mpCbShowAll;
+ VclPtr<OKButton> mpBtnOk;
+ VclPtr<PushButton> mpBtnOptions;
ScDPObject& mrDPObj; /// The DataPilot object (for member names).
const ScDPNameVec& mrDataFields; /// The list of all data field names.
@@ -136,7 +138,8 @@ public:
explicit ScDPSubtotalOptDlg( vcl::Window* pParent, ScDPObject& rDPObj,
const ScDPLabelData& rLabelData, const ScDPNameVec& rDataFields,
bool bEnableLayout );
-
+ virtual ~ScDPSubtotalOptDlg();
+ virtual void dispose() SAL_OVERRIDE;
void FillLabelData( ScDPLabelData& rLabelData ) const;
private:
@@ -153,25 +156,25 @@ private:
DECL_LINK( SelectHdl, ListBox* );
private:
- ListBox* m_pLbSortBy;
- RadioButton* m_pRbSortAsc;
- RadioButton* m_pRbSortDesc;
- RadioButton* m_pRbSortMan;
- VclContainer* m_pLayoutFrame;
- ListBox* m_pLbLayout;
- CheckBox* m_pCbLayoutEmpty;
- CheckBox* m_pCbRepeatItemLabels;
- CheckBox* m_pCbShow;
- NumericField* m_pNfShow;
- FixedText* m_pFtShow;
- FixedText* m_pFtShowFrom;
- ListBox* m_pLbShowFrom;
- FixedText* m_pFtShowUsing;
- ListBox* m_pLbShowUsing;
- VclContainer* m_pHideFrame;
- SvxCheckListBox* m_pLbHide;
- FixedText* m_pFtHierarchy;
- ListBox* m_pLbHierarchy;
+ VclPtr<ListBox> m_pLbSortBy;
+ VclPtr<RadioButton> m_pRbSortAsc;
+ VclPtr<RadioButton> m_pRbSortDesc;
+ VclPtr<RadioButton> m_pRbSortMan;
+ VclPtr<VclContainer> m_pLayoutFrame;
+ VclPtr<ListBox> m_pLbLayout;
+ VclPtr<CheckBox> m_pCbLayoutEmpty;
+ VclPtr<CheckBox> m_pCbRepeatItemLabels;
+ VclPtr<CheckBox> m_pCbShow;
+ VclPtr<NumericField> m_pNfShow;
+ VclPtr<FixedText> m_pFtShow;
+ VclPtr<FixedText> m_pFtShowFrom;
+ VclPtr<ListBox> m_pLbShowFrom;
+ VclPtr<FixedText> m_pFtShowUsing;
+ VclPtr<ListBox> m_pLbShowUsing;
+ VclPtr<VclContainer> m_pHideFrame;
+ VclPtr<SvxCheckListBox> m_pLbHide;
+ VclPtr<FixedText> m_pFtHierarchy;
+ VclPtr<ListBox> m_pLbHierarchy;
boost::scoped_ptr<ScDPListBoxWrapper> m_xLbLayoutWrp; /// Wrapper for direct usage of API constants.
boost::scoped_ptr<ScDPListBoxWrapper> m_xLbShowFromWrp; /// Wrapper for direct usage of API constants.
@@ -187,7 +190,8 @@ class ScDPShowDetailDlg : public ModalDialog
{
public:
explicit ScDPShowDetailDlg( vcl::Window* pParent, ScDPObject& rDPObj, sal_uInt16 nOrient );
-
+ virtual ~ScDPShowDetailDlg();
+ virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
/**
@@ -201,8 +205,8 @@ private:
DECL_LINK( DblClickHdl, ListBox* );
private:
- ListBox* mpLbDims;
- OKButton* mpBtnOk;
+ VclPtr<ListBox> mpLbDims;
+ VclPtr<OKButton> mpBtnOk;
typedef std::unordered_map<OUString, long, OUStringHash> DimNameIndexMap;
DimNameIndexMap maNameIndexMap;
diff --git a/sc/source/ui/inc/reffact.hxx b/sc/source/ui/inc/reffact.hxx
index 1388bde13b5b..650ac840d8b7 100644
--- a/sc/source/ui/inc/reffact.hxx
+++ b/sc/source/ui/inc/reffact.hxx
@@ -173,7 +173,7 @@ class SC_DLLPUBLIC ScValidityRefChildWin : public SfxChildWindow
{
bool m_bVisibleLock:1;
bool m_bFreeWindowLock:1;
- vcl::Window * m_pSavedWndParent;
+ VclPtr<vcl::Window> m_pSavedWndParent;
public:
ScValidityRefChildWin( vcl::Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo* );
SFX_DECL_CHILDWINDOW_WITHID(ScValidityRefChildWin);
diff --git a/sc/source/ui/inc/retypepassdlg.hxx b/sc/source/ui/inc/retypepassdlg.hxx
index 2763202b0395..8c746c1438f0 100644
--- a/sc/source/ui/inc/retypepassdlg.hxx
+++ b/sc/source/ui/inc/retypepassdlg.hxx
@@ -46,6 +46,7 @@ public:
explicit ScRetypePassDlg(vcl::Window* pParent);
virtual ~ScRetypePassDlg();
+ virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
@@ -71,12 +72,12 @@ private:
void DeleteSheets();
private:
- OKButton* mpBtnOk;
- FixedText* mpTextDocStatus;
- PushButton* mpBtnRetypeDoc;
- VclVBox* mpSheetsBox;
+ VclPtr<OKButton> mpBtnOk;
+ VclPtr<FixedText> mpTextDocStatus;
+ VclPtr<PushButton> mpBtnRetypeDoc;
+ VclPtr<VclVBox> mpSheetsBox;
- std::vector<VclHBox*> maSheets;
+ std::vector<VclPtr<VclHBox>> maSheets;
OUString maTextNotProtected;
OUString maTextNotPassProtected;
@@ -104,6 +105,7 @@ class ScRetypePassInputDlg : public ModalDialog
public:
explicit ScRetypePassInputDlg(vcl::Window* pParent, ScPassHashProtectable* pProtected);
virtual ~ScRetypePassInputDlg();
+ virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
@@ -117,17 +119,17 @@ private:
void CheckPasswordInput();
private:
- OKButton* m_pBtnOk;
+ VclPtr<OKButton> m_pBtnOk;
- RadioButton* m_pBtnRetypePassword;
+ VclPtr<RadioButton> m_pBtnRetypePassword;
- VclContainer* m_pPasswordGrid;
- Edit* m_pPassword1Edit;
- Edit* m_pPassword2Edit;
+ VclPtr<VclContainer> m_pPasswordGrid;
+ VclPtr<Edit> m_pPassword1Edit;
+ VclPtr<Edit> m_pPassword2Edit;
- CheckBox* m_pBtnMatchOldPass;
+ VclPtr<CheckBox> m_pBtnMatchOldPass;
- RadioButton* m_pBtnRemovePassword;
+ VclPtr<RadioButton> m_pBtnRemovePassword;
DECL_LINK( OKHdl, void* );
DECL_LINK( RadioBtnHdl, RadioButton* );
diff --git a/sc/source/ui/inc/scendlg.hxx b/sc/source/ui/inc/scendlg.hxx
index 2675f3b346a3..96bc48d9add2 100644
--- a/sc/source/ui/inc/scendlg.hxx
+++ b/sc/source/ui/inc/scendlg.hxx
@@ -31,7 +31,8 @@ class ScNewScenarioDlg : public ModalDialog
{
public:
ScNewScenarioDlg(vcl::Window* pParent, const OUString& rName, bool bEdit = false, bool bSheetProtected = false);
-
+ virtual ~ScNewScenarioDlg();
+ virtual void dispose() SAL_OVERRIDE;
void SetScenarioData( const OUString& rName, const OUString& rComment,
const Color& rColor, sal_uInt16 nFlags );
@@ -39,14 +40,14 @@ public:
Color& rColor, sal_uInt16& rFlags ) const;
private:
- Edit* m_pEdName;
- VclMultiLineEdit* m_pEdComment;
- CheckBox* m_pCbShowFrame;
- ColorListBox* m_pLbColor;
- CheckBox* m_pCbTwoWay;
- CheckBox* m_pCbCopyAll;
- CheckBox* m_pCbProtect;
- OKButton* m_pBtnOk;
+ VclPtr<Edit> m_pEdName;
+ VclPtr<VclMultiLineEdit> m_pEdComment;
+ VclPtr<CheckBox> m_pCbShowFrame;
+ VclPtr<ColorListBox> m_pLbColor;
+ VclPtr<CheckBox> m_pCbTwoWay;
+ VclPtr<CheckBox> m_pCbCopyAll;
+ VclPtr<CheckBox> m_pCbProtect;
+ VclPtr<OKButton> m_pBtnOk;
const OUString aDefScenarioName;
bool bIsEdit;
diff --git a/sc/source/ui/inc/scuiasciiopt.hxx b/sc/source/ui/inc/scuiasciiopt.hxx
index 646e4ef4bf77..c05237a49984 100644
--- a/sc/source/ui/inc/scuiasciiopt.hxx
+++ b/sc/source/ui/inc/scuiasciiopt.hxx
@@ -32,38 +32,38 @@ class ScImportAsciiDlg : public ModalDialog
OUString maPreviewLine[ CSV_PREVIEW_LINES ];
- FixedText* pFtCharSet;
+ VclPtr<FixedText> pFtCharSet;
- SvxTextEncodingBox* pLbCharSet;
+ VclPtr<SvxTextEncodingBox> pLbCharSet;
- FixedText* pFtCustomLang;
+ VclPtr<FixedText> pFtCustomLang;
- SvxLanguageBox* pLbCustomLang;
+ VclPtr<SvxLanguageBox> pLbCustomLang;
- FixedText* pFtRow;
- NumericField* pNfRow;
+ VclPtr<FixedText> pFtRow;
+ VclPtr<NumericField> pNfRow;
- RadioButton* pRbFixed;
- RadioButton* pRbSeparated;
+ VclPtr<RadioButton> pRbFixed;
+ VclPtr<RadioButton> pRbSeparated;
- CheckBox* pCkbTab;
- CheckBox* pCkbSemicolon;
- CheckBox* pCkbComma;
- CheckBox* pCkbSpace;
- CheckBox* pCkbOther;
- Edit* pEdOther;
- CheckBox* pCkbAsOnce;
+ VclPtr<CheckBox> pCkbTab;
+ VclPtr<CheckBox> pCkbSemicolon;
+ VclPtr<CheckBox> pCkbComma;
+ VclPtr<CheckBox> pCkbSpace;
+ VclPtr<CheckBox> pCkbOther;
+ VclPtr<Edit> pEdOther;
+ VclPtr<CheckBox> pCkbAsOnce;
- FixedText* pFtTextSep;
- ComboBox* pCbTextSep;
+ VclPtr<FixedText> pFtTextSep;
+ VclPtr<ComboBox> pCbTextSep;
- CheckBox* pCkbQuotedAsText;
- CheckBox* pCkbDetectNumber;
+ VclPtr<CheckBox> pCkbQuotedAsText;
+ VclPtr<CheckBox> pCkbDetectNumber;
- FixedText* pFtType;
- ListBox* pLbType;
+ VclPtr<FixedText> pFtType;
+ VclPtr<ListBox> pLbType;
- ScCsvTableBox* mpTableBox;
+ VclPtr<ScCsvTableBox> mpTableBox;
OUString aCharSetUser;
OUString aColumnUser;
@@ -80,6 +80,7 @@ public:
vcl::Window* pParent, const OUString& aDatName,
SvStream* pInStream, ScImportAsciiCall eCall );
virtual ~ScImportAsciiDlg();
+ virtual void dispose() SAL_OVERRIDE;
void GetOptions( ScAsciiOptions& rOpt );
void SaveParameters();
diff --git a/sc/source/ui/inc/scuiautofmt.hxx b/sc/source/ui/inc/scuiautofmt.hxx
index b0460bb2bbbe..10bfe1f98752 100644
--- a/sc/source/ui/inc/scuiautofmt.hxx
+++ b/sc/source/ui/inc/scuiautofmt.hxx
@@ -27,24 +27,26 @@ public:
ScAutoFormat* pAutoFormat,
const ScAutoFormatData* pSelFormatData,
ScViewData *pViewData);
+ virtual ~ScAutoFormatDlg();
+ virtual void dispose() SAL_OVERRIDE;
sal_uInt16 GetIndex() const { return nIndex; }
OUString GetCurrFormatName();
private:
- ListBox* m_pLbFormat;
- ScAutoFmtPreview* m_pWndPreview;
- OKButton* m_pBtnOk;
- CancelButton* m_pBtnCancel;
- PushButton* m_pBtnAdd;
- PushButton* m_pBtnRemove;
- PushButton* m_pBtnRename;
- CheckBox* m_pBtnNumFormat;
- CheckBox* m_pBtnBorder;
- CheckBox* m_pBtnFont;
- CheckBox* m_pBtnPattern;
- CheckBox* m_pBtnAlignment;
- CheckBox* m_pBtnAdjust;
+ VclPtr<ListBox> m_pLbFormat;
+ VclPtr<ScAutoFmtPreview> m_pWndPreview;
+ VclPtr<OKButton> m_pBtnOk;
+ VclPtr<CancelButton> m_pBtnCancel;
+ VclPtr<PushButton> m_pBtnAdd;
+ VclPtr<PushButton> m_pBtnRemove;
+ VclPtr<PushButton> m_pBtnRename;
+ VclPtr<CheckBox> m_pBtnNumFormat;
+ VclPtr<CheckBox> m_pBtnBorder;
+ VclPtr<CheckBox> m_pBtnFont;
+ VclPtr<CheckBox> m_pBtnPattern;
+ VclPtr<CheckBox> m_pBtnAlignment;
+ VclPtr<CheckBox> m_pBtnAdjust;
OUString aStrTitle;
OUString aStrLabel;
OUString aStrClose;
diff --git a/sc/source/ui/inc/scuiimoptdlg.hxx b/sc/source/ui/inc/scuiimoptdlg.hxx
index adb8f2032725..348d27878dae 100644
--- a/sc/source/ui/inc/scuiimoptdlg.hxx
+++ b/sc/source/ui/inc/scuiimoptdlg.hxx
@@ -37,22 +37,23 @@ public:
bool bImport = true );
virtual ~ScImportOptionsDlg();
+ virtual void dispose() SAL_OVERRIDE;
void GetImportOptions( ScImportOptions& rOptions ) const;
private:
- VclFrame* m_pFieldFrame;
- FixedText* m_pFtCharset;
- SvxTextEncodingBox* m_pLbCharset;
- FixedText* m_pFtFieldSep;
- ComboBox* m_pEdFieldSep;
- FixedText* m_pFtTextSep;
- ComboBox* m_pEdTextSep;
- CheckBox* m_pCbShown;
- CheckBox* m_pCbFormulas;
- CheckBox* m_pCbQuoteAll;
- CheckBox* m_pCbFixed;
- OKButton* m_pBtnOk;
+ VclPtr<VclFrame> m_pFieldFrame;
+ VclPtr<FixedText> m_pFtCharset;
+ VclPtr<SvxTextEncodingBox> m_pLbCharset;
+ VclPtr<FixedText> m_pFtFieldSep;
+ VclPtr<ComboBox> m_pEdFieldSep;
+ VclPtr<FixedText> m_pFtTextSep;
+ VclPtr<ComboBox> m_pEdTextSep;
+ VclPtr<CheckBox> m_pCbShown;
+ VclPtr<CheckBox> m_pCbFormulas;
+ VclPtr<CheckBox> m_pCbQuoteAll;
+ VclPtr<CheckBox> m_pCbFixed;
+ VclPtr<OKButton> m_pBtnOk;
ScDelimiterTable* pFieldSepTab;
ScDelimiterTable* pTextSepTab;
diff --git a/sc/source/ui/inc/scuitphfedit.hxx b/sc/source/ui/inc/scuitphfedit.hxx
index b2d133c2cdb8..a5f25ec50955 100644
--- a/sc/source/ui/inc/scuitphfedit.hxx
+++ b/sc/source/ui/inc/scuitphfedit.hxx
@@ -57,29 +57,30 @@ protected:
sal_uInt16 nWhich,
bool bHeader );
virtual ~ScHFEditPage();
+ virtual void dispose() SAL_OVERRIDE;
private:
- ScEditWindow* m_pWndLeft;
- ScEditWindow* m_pWndCenter;
- ScEditWindow* m_pWndRight;
- FixedText* m_pFtDefinedHF;
- ListBox* m_pLbDefined;
- FixedText* m_pFtCustomHF;
- PushButton* m_pBtnText;
- ScExtIButton* m_pBtnFile;
- PushButton* m_pBtnTable;
- PushButton* m_pBtnPage;
- PushButton* m_pBtnLastPage;
- PushButton* m_pBtnDate;
- PushButton* m_pBtnTime;
-
- FixedText* m_pFtConfidential;
- FixedText* m_pFtPage;
- FixedText* m_pFtOfQuestion;
- FixedText* m_pFtOf;
- FixedText* m_pFtNone;
- FixedText* m_pFtCreatedBy;
- FixedText* m_pFtCustomized;
+ VclPtr<ScEditWindow> m_pWndLeft;
+ VclPtr<ScEditWindow> m_pWndCenter;
+ VclPtr<ScEditWindow> m_pWndRight;
+ VclPtr<FixedText> m_pFtDefinedHF;
+ VclPtr<ListBox> m_pLbDefined;
+ VclPtr<FixedText> m_pFtCustomHF;
+ VclPtr<PushButton> m_pBtnText;
+ VclPtr<ScExtIButton> m_pBtnFile;
+ VclPtr<PushButton> m_pBtnTable;
+ VclPtr<PushButton> m_pBtnPage;
+ VclPtr<PushButton> m_pBtnLastPage;
+ VclPtr<PushButton> m_pBtnDate;
+ VclPtr<PushButton> m_pBtnTime;
+
+ VclPtr<FixedText> m_pFtConfidential;
+ VclPtr<FixedText> m_pFtPage;
+ VclPtr<FixedText> m_pFtOfQuestion;
+ VclPtr<FixedText> m_pFtOf;
+ VclPtr<FixedText> m_pFtNone;
+ VclPtr<FixedText> m_pFtCreatedBy;
+ VclPtr<FixedText> m_pFtCustomized;
sal_uInt16 nWhich;
OUString aCmdArr[6];
@@ -104,7 +105,7 @@ private:
class ScRightHeaderEditPage : public ScHFEditPage
{
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rCoreSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rCoreSet );
private:
ScRightHeaderEditPage( vcl::Window* pParent, const SfxItemSet& rSet );
@@ -113,7 +114,7 @@ private:
class ScLeftHeaderEditPage : public ScHFEditPage
{
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rCoreSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rCoreSet );
private:
ScLeftHeaderEditPage( vcl::Window* pParent, const SfxItemSet& rSet );
@@ -122,7 +123,7 @@ private:
class ScRightFooterEditPage : public ScHFEditPage
{
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rCoreSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rCoreSet );
private:
ScRightFooterEditPage( vcl::Window* pParent, const SfxItemSet& rSet );
@@ -131,7 +132,7 @@ private:
class ScLeftFooterEditPage : public ScHFEditPage
{
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rCoreSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rCoreSet );
private:
ScLeftFooterEditPage( vcl::Window* pParent, const SfxItemSet& rSet );
diff --git a/sc/source/ui/inc/searchresults.hxx b/sc/source/ui/inc/searchresults.hxx
index 437d90a3adc8..22af42940f1c 100644
--- a/sc/source/ui/inc/searchresults.hxx
+++ b/sc/source/ui/inc/searchresults.hxx
@@ -21,7 +21,7 @@ namespace sc {
class SearchResultsDlg : public ModelessDialog
{
- SvSimpleTable *mpList;
+ VclPtr<SvSimpleTable> mpList;
SfxBindings* mpBindings;
ScDocument* mpDoc;
@@ -29,6 +29,7 @@ class SearchResultsDlg : public ModelessDialog
public:
SearchResultsDlg( SfxBindings* _pBindings, vcl::Window* pParent, sal_uInt16 nId );
virtual ~SearchResultsDlg();
+ virtual void dispose() SAL_OVERRIDE;
void FillResults( ScDocument* pDoc, const ScRangeList& rMatchedRanges );
diff --git a/sc/source/ui/inc/sharedocdlg.hxx b/sc/source/ui/inc/sharedocdlg.hxx
index f8d746fd4cc9..41f53111b40a 100644
--- a/sc/source/ui/inc/sharedocdlg.hxx
+++ b/sc/source/ui/inc/sharedocdlg.hxx
@@ -33,9 +33,9 @@ class ScDocShell;
class ScShareDocumentDlg : public ModalDialog
{
private:
- CheckBox* m_pCbShare;
- FixedText* m_pFtWarning;
- SvSimpleTable* m_pLbUsers;
+ VclPtr<CheckBox> m_pCbShare;
+ VclPtr<FixedText> m_pFtWarning;
+ VclPtr<SvSimpleTable> m_pLbUsers;
OUString m_aStrNoUserData;
OUString m_aStrUnknownUser;
@@ -49,6 +49,7 @@ private:
public:
ScShareDocumentDlg( vcl::Window* pParent, ScViewData* pViewData );
virtual ~ScShareDocumentDlg();
+ virtual void dispose() SAL_OVERRIDE;
bool IsShareDocumentChecked() const;
void UpdateView();
diff --git a/sc/source/ui/inc/shtabdlg.hxx b/sc/source/ui/inc/shtabdlg.hxx
index 6c55a64d51f7..d0109a2735d4 100644
--- a/sc/source/ui/inc/shtabdlg.hxx
+++ b/sc/source/ui/inc/shtabdlg.hxx
@@ -28,13 +28,15 @@
class ScShowTabDlg : public ModalDialog
{
private:
- VclFrame* m_pFrame;
- ListBox* m_pLb;
+ VclPtr<VclFrame> m_pFrame;
+ VclPtr<ListBox> m_pLb;
DECL_LINK( DblClkHdl, void * );
public:
ScShowTabDlg( vcl::Window* pParent );
+ virtual ~ScShowTabDlg();
+ virtual void dispose() SAL_OVERRIDE;
/** Sets dialog title, fixed text for listbox and help IDs. */
void SetDescription(
diff --git a/sc/source/ui/inc/simpref.hxx b/sc/source/ui/inc/simpref.hxx
index a78a9e13ed5a..9a4d66c3a173 100644
--- a/sc/source/ui/inc/simpref.hxx
+++ b/sc/source/ui/inc/simpref.hxx
@@ -40,12 +40,12 @@ private:
Link aAbortedHdl;
Link aChangeHdl;
- FixedText* m_pFtAssign;
- formula::RefEdit* m_pEdAssign;
- formula::RefButton* m_pRbAssign;
+ VclPtr<FixedText> m_pFtAssign;
+ VclPtr<formula::RefEdit> m_pEdAssign;
+ VclPtr<formula::RefButton> m_pRbAssign;
- OKButton* m_pBtnOk;
- CancelButton* m_pBtnCancel;
+ VclPtr<OKButton> m_pBtnOk;
+ VclPtr<CancelButton> m_pBtnCancel;
ScRange theCurArea;
bool bCloseFlag;
@@ -66,6 +66,7 @@ protected:
public:
ScSimpleRefDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent);
virtual ~ScSimpleRefDlg();
+ virtual void dispose() SAL_OVERRIDE;
virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) SAL_OVERRIDE;
diff --git a/sc/source/ui/inc/sizedev.hxx b/sc/source/ui/inc/sizedev.hxx
index 770279f0b2ca..95bfac3a44e0 100644
--- a/sc/source/ui/inc/sizedev.hxx
+++ b/sc/source/ui/inc/sizedev.hxx
@@ -27,17 +27,17 @@ class ScDocShell;
class ScSizeDeviceProvider
{
- OutputDevice* pDevice;
- bool bOwner;
- double nPPTX;
- double nPPTY;
- MapMode aOldMapMode;
+ VclPtr<OutputDevice> pDevice;
+ bool bOwner;
+ double nPPTX;
+ double nPPTY;
+ MapMode aOldMapMode;
public:
ScSizeDeviceProvider( ScDocShell* pDocSh );
~ScSizeDeviceProvider();
- OutputDevice* GetDevice() const { return pDevice; }
+ OutputDevice* GetDevice() const { return pDevice.get(); }
double GetPPTX() const { return nPPTX; }
double GetPPTY() const { return nPPTY; }
bool IsPrinter() const { return !bOwner; }
diff --git a/sc/source/ui/inc/solveroptions.hxx b/sc/source/ui/inc/solveroptions.hxx
index eb03c6e61e5f..28e557e08b3f 100644
--- a/sc/source/ui/inc/solveroptions.hxx
+++ b/sc/source/ui/inc/solveroptions.hxx
@@ -35,9 +35,9 @@ namespace com { namespace sun { namespace star {
class ScSolverOptionsDialog : public ModalDialog
{
- ListBox* m_pLbEngine;
- SvxCheckListBox* m_pLbSettings;
- PushButton* m_pBtnEdit;
+ VclPtr<ListBox> m_pLbEngine;
+ VclPtr<SvxCheckListBox> m_pLbSettings;
+ VclPtr<PushButton> m_pBtnEdit;
SvLBoxButtonData* mpCheckButtonData;
com::sun::star::uno::Sequence<OUString> maImplNames;
@@ -61,6 +61,7 @@ public:
const OUString& rEngine,
const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& rProperties );
virtual ~ScSolverOptionsDialog();
+ virtual void dispose() SAL_OVERRIDE;
// already updated in selection handler
const OUString& GetEngine() const { return maEngine; }
@@ -69,11 +70,13 @@ public:
class ScSolverIntegerDialog : public ModalDialog
{
- VclFrame* m_pFrame;
- NumericField* m_pNfValue;
+ VclPtr<VclFrame> m_pFrame;
+ VclPtr<NumericField> m_pNfValue;
public:
ScSolverIntegerDialog( vcl::Window * pParent );
+ virtual ~ScSolverIntegerDialog();
+ virtual void dispose() SAL_OVERRIDE;
void SetOptionName( const OUString& rName );
void SetValue( sal_Int32 nValue );
@@ -82,11 +85,13 @@ public:
class ScSolverValueDialog : public ModalDialog
{
- VclFrame* m_pFrame;
- Edit* m_pEdValue;
+ VclPtr<VclFrame> m_pFrame;
+ VclPtr<Edit> m_pEdValue;
public:
ScSolverValueDialog( vcl::Window * pParent );
+ virtual ~ScSolverValueDialog();
+ virtual void dispose() SAL_OVERRIDE;
void SetOptionName( const OUString& rName );
void SetValue( double fValue );
diff --git a/sc/source/ui/inc/solvrdlg.hxx b/sc/source/ui/inc/solvrdlg.hxx
index 2799c58975a8..253067a20d95 100644
--- a/sc/source/ui/inc/solvrdlg.hxx
+++ b/sc/source/ui/inc/solvrdlg.hxx
@@ -42,6 +42,7 @@ public:
ScDocument* pDocument,
ScAddress aCursorPos );
virtual ~ScSolverDlg();
+ virtual void dispose() SAL_OVERRIDE;
virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) SAL_OVERRIDE;
virtual bool IsRefInputMode() const SAL_OVERRIDE;
@@ -49,18 +50,18 @@ public:
virtual bool Close() SAL_OVERRIDE;
private:
- FixedText* m_pFtFormulaCell;
- formula::RefEdit* m_pEdFormulaCell;
- formula::RefButton* m_pRBFormulaCell;
+ VclPtr<FixedText> m_pFtFormulaCell;
+ VclPtr<formula::RefEdit> m_pEdFormulaCell;
+ VclPtr<formula::RefButton> m_pRBFormulaCell;
- Edit* m_pEdTargetVal;
+ VclPtr<Edit> m_pEdTargetVal;
- FixedText* m_pFtVariableCell;
- formula::RefEdit* m_pEdVariableCell;
- formula::RefButton* m_pRBVariableCell;
+ VclPtr<FixedText> m_pFtVariableCell;
+ VclPtr<formula::RefEdit> m_pEdVariableCell;
+ VclPtr<formula::RefButton> m_pRBVariableCell;
- OKButton* m_pBtnOk;
- CancelButton* m_pBtnCancel;
+ VclPtr<OKButton> m_pBtnOk;
+ VclPtr<CancelButton> m_pBtnCancel;
ScAddress theFormulaCell;
ScAddress theVariableCell;
@@ -68,7 +69,7 @@ private:
ScDocument* pDoc;
const SCTAB nCurTab;
- formula::RefEdit* pEdActive;
+ VclPtr<formula::RefEdit> pEdActive;
bool bDlgLostFocus;
const OUString errMsgInvalidVar;
const OUString errMsgInvalidForm;
diff --git a/sc/source/ui/inc/sortdlg.hxx b/sc/source/ui/inc/sortdlg.hxx
index d627f02623bb..c514aaffd8e9 100644
--- a/sc/source/ui/inc/sortdlg.hxx
+++ b/sc/source/ui/inc/sortdlg.hxx
@@ -45,11 +45,13 @@ class ScSortWarningDlg : public ModalDialog
{
public:
ScSortWarningDlg( vcl::Window* pParent, const OUString& rExtendText,const OUString& rCurrentText );
+ virtual ~ScSortWarningDlg();
+ virtual void dispose() SAL_OVERRIDE;
DECL_LINK( BtnHdl, PushButton* );
private:
- FixedText* aFtText;
- PushButton* aBtnExtSort;
- PushButton* aBtnCurSort;
+ VclPtr<FixedText> aFtText;
+ VclPtr<PushButton> aBtnExtSort;
+ VclPtr<PushButton> aBtnCurSort;
};
#endif // INCLUDED_SC_SOURCE_UI_INC_SORTDLG_HXX
diff --git a/sc/source/ui/inc/sortkeydlg.hxx b/sc/source/ui/inc/sortkeydlg.hxx
index 5c9c1fa833bc..a0a027c0f81d 100644
--- a/sc/source/ui/inc/sortkeydlg.hxx
+++ b/sc/source/ui/inc/sortkeydlg.hxx
@@ -25,11 +25,11 @@
struct ScSortKeyItem : public VclBuilderContainer
{
- VclFrame* m_pFrame;
- FixedText* m_pFlSort;
- ListBox* m_pLbSort;
- RadioButton* m_pBtnUp;
- RadioButton* m_pBtnDown;
+ VclPtr<VclFrame> m_pFrame;
+ VclPtr<FixedText> m_pFlSort;
+ VclPtr<ListBox> m_pLbSort;
+ VclPtr<RadioButton> m_pBtnUp;
+ VclPtr<RadioButton> m_pBtnDown;
ScSortKeyItem(vcl::Window* pParent);
@@ -44,7 +44,7 @@ typedef boost::ptr_vector<ScSortKeyItem> ScSortKeyItems;
class ScSortKeyWindow
{
private:
- VclBox* m_pBox;
+ VclPtr<VclBox> m_pBox;
sal_Int32 nItemHeight;
ScSortKeyItems& mrSortKeyItems;
diff --git a/sc/source/ui/inc/strindlg.hxx b/sc/source/ui/inc/strindlg.hxx
index 367d32d8811e..1863869203fb 100644
--- a/sc/source/ui/inc/strindlg.hxx
+++ b/sc/source/ui/inc/strindlg.hxx
@@ -32,15 +32,16 @@ public:
const OUString& rEditTitle,
const OUString& rDefault,
const OString& sHelpId, const OString& sEditHelpId);
-
+ virtual ~ScStringInputDlg();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetInputString() const
{
return m_pEdInput->GetText();
}
private:
- FixedText* m_pFtEditTitle;
- Edit* m_pEdInput;
+ VclPtr<FixedText> m_pFtEditTitle;
+ VclPtr<Edit> m_pEdInput;
};
#endif // INCLUDED_SC_SOURCE_UI_INC_STRINDLG_HXX
diff --git a/sc/source/ui/inc/subtdlg.hxx b/sc/source/ui/inc/subtdlg.hxx
index 6496689d3a75..749e9d94dfcb 100644
--- a/sc/source/ui/inc/subtdlg.hxx
+++ b/sc/source/ui/inc/subtdlg.hxx
@@ -28,8 +28,10 @@ class ScSubTotalDlg : public SfxTabDialog
{
public:
ScSubTotalDlg(vcl::Window* pParent, const SfxItemSet* pArgSet);
+ virtual ~ScSubTotalDlg();
+ virtual void dispose() SAL_OVERRIDE;
private:
- PushButton* m_pBtnRemove;
+ VclPtr<PushButton> m_pBtnRemove;
DECL_LINK( RemoveHdl, PushButton * );
};
diff --git a/sc/source/ui/inc/tabbgcolordlg.hxx b/sc/source/ui/inc/tabbgcolordlg.hxx
index 40dcca180920..122f112c068b 100644
--- a/sc/source/ui/inc/tabbgcolordlg.hxx
+++ b/sc/source/ui/inc/tabbgcolordlg.hxx
@@ -33,6 +33,8 @@ public:
const OUString& rTabBgColorNoColorText,
const Color& rDefaultColor,
const OString& nHelpId );
+ virtual ~ScTabBgColorDlg();
+ virtual void dispose() SAL_OVERRIDE;
void GetSelectedColor( Color& rColor ) const;
@@ -40,6 +42,9 @@ public:
{
public:
ScTabBgColorValueSet(vcl::Window* pParent, WinBits nStyle);
+ virtual ~ScTabBgColorValueSet();
+ virtual void dispose() SAL_OVERRIDE;
+
void SetDialog(ScTabBgColorDlg* pTabBgColorDlg)
{
m_pTabBgColorDlg = pTabBgColorDlg;
@@ -47,12 +52,12 @@ public:
virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
private:
- ScTabBgColorDlg* m_pTabBgColorDlg;
+ VclPtr<ScTabBgColorDlg> m_pTabBgColorDlg;
};
private:
- ScTabBgColorValueSet* m_pTabBgColorSet;
- OKButton* m_pBtnOk;
+ VclPtr<ScTabBgColorValueSet> m_pTabBgColorSet;
+ VclPtr<OKButton> m_pBtnOk;
Color m_aTabBgColor;
const OUString m_aTabBgColorNoColorText;
diff --git a/sc/source/ui/inc/tabopdlg.hxx b/sc/source/ui/inc/tabopdlg.hxx
index a1806c1153c9..33c247f7cfcd 100644
--- a/sc/source/ui/inc/tabopdlg.hxx
+++ b/sc/source/ui/inc/tabopdlg.hxx
@@ -44,6 +44,7 @@ public:
ScDocument* pDocument,
const ScRefAddress& rCursorPos );
virtual ~ScTabOpDlg();
+ virtual void dispose() SAL_OVERRIDE;
virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) SAL_OVERRIDE;
virtual bool IsRefInputMode() const SAL_OVERRIDE { return true; }
@@ -52,20 +53,20 @@ public:
virtual bool Close() SAL_OVERRIDE;
private:
- FixedText* m_pFtFormulaRange;
- formula::RefEdit* m_pEdFormulaRange;
- formula::RefButton* m_pRBFormulaRange;
+ VclPtr<FixedText> m_pFtFormulaRange;
+ VclPtr<formula::RefEdit> m_pEdFormulaRange;
+ VclPtr<formula::RefButton> m_pRBFormulaRange;
- FixedText* m_pFtRowCell;
- formula::RefEdit* m_pEdRowCell;
- formula::RefButton* m_pRBRowCell;
+ VclPtr<FixedText> m_pFtRowCell;
+ VclPtr<formula::RefEdit> m_pEdRowCell;
+ VclPtr<formula::RefButton> m_pRBRowCell;
- FixedText* m_pFtColCell;
- formula::RefEdit* m_pEdColCell;
- formula::RefButton* m_pRBColCell;
+ VclPtr<FixedText> m_pFtColCell;
+ VclPtr<formula::RefEdit> m_pEdColCell;
+ VclPtr<formula::RefButton> m_pRBColCell;
- OKButton* m_pBtnOk;
- CancelButton* m_pBtnCancel;
+ VclPtr<OKButton> m_pBtnOk;
+ VclPtr<CancelButton> m_pBtnCancel;
ScRefAddress theFormulaCell;
ScRefAddress theFormulaEnd;
@@ -74,7 +75,7 @@ private:
ScDocument* pDoc;
const SCTAB nCurTab;
- formula::RefEdit* pEdActive;
+ VclPtr<formula::RefEdit> pEdActive;
bool bDlgLostFocus;
const OUString errMsgNoFormula;
const OUString errMsgNoColRow;
diff --git a/sc/source/ui/inc/tabpages.hxx b/sc/source/ui/inc/tabpages.hxx
index 69f12bd23592..c2f9c38d1e66 100644
--- a/sc/source/ui/inc/tabpages.hxx
+++ b/sc/source/ui/inc/tabpages.hxx
@@ -28,12 +28,15 @@ class ScTabPageProtection : public SfxTabPage
{
static const sal_uInt16 pProtectionRanges[];
public:
- static SfxTabPage* Create ( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create ( vcl::Window* pParent,
const SfxItemSet* rAttrSet );
static const sal_uInt16* GetRanges () { return pProtectionRanges; }
virtual bool FillItemSet ( SfxItemSet* rCoreAttrs ) SAL_OVERRIDE;
virtual void Reset ( const SfxItemSet* ) SAL_OVERRIDE;
+ virtual ~ScTabPageProtection();
+ virtual void dispose() SAL_OVERRIDE;
+
protected:
using SfxTabPage::DeactivatePage;
virtual sfxpg DeactivatePage ( SfxItemSet* pSet = NULL ) SAL_OVERRIDE;
@@ -42,10 +45,10 @@ private:
ScTabPageProtection( vcl::Window* pParent,
const SfxItemSet& rCoreAttrs );
private:
- TriStateBox* m_pBtnHideCell;
- TriStateBox* m_pBtnProtect;
- TriStateBox* m_pBtnHideFormula;
- TriStateBox* m_pBtnHidePrint;
+ VclPtr<TriStateBox> m_pBtnHideCell;
+ VclPtr<TriStateBox> m_pBtnProtect;
+ VclPtr<TriStateBox> m_pBtnHideFormula;
+ VclPtr<TriStateBox> m_pBtnHidePrint;
// current status:
bool bTriEnabled; // if before - DontCare
bool bDontCare; // all in TriState
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index ddb45e281de8..bb06d01fe813 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -85,7 +85,7 @@ class ScTabView : boost::noncopyable
private:
enum BlockMode { None = 0, Normal = 1, Own = 2 };
- vcl::Window* pFrameWin; // First !!!
+ VclPtr<vcl::Window> pFrameWin; // First !!!
ScViewData aViewData; // must be at the front !
ScViewSelectionEngine* pSelEngine;
@@ -102,23 +102,23 @@ private:
FuPoor* pDrawActual;
FuPoor* pDrawOld;
- ScGridWindow* pGridWin[4];
- ScColBar* pColBar[2];
- ScRowBar* pRowBar[2];
- ScOutlineWindow* pColOutline[2];
- ScOutlineWindow* pRowOutline[2];
- ScTabSplitter* pHSplitter;
- ScTabSplitter* pVSplitter;
- ScTabControl* pTabControl;
- ScrollBar aVScrollTop;
- ScrollBar aVScrollBottom; // initially visible
- ScrollBar aHScrollLeft; // initially visible
- ScrollBar aHScrollRight;
- ScCornerButton aCornerButton;
- ScCornerButton aTopButton;
- ScrollBarBox aScrollBarBox;
-
- boost::scoped_ptr<ScHintWindow> mpInputHintWindow; // popup window for data validation
+ VclPtr<ScGridWindow> pGridWin[4];
+ VclPtr<ScColBar> pColBar[2];
+ VclPtr<ScRowBar> pRowBar[2];
+ VclPtr<ScOutlineWindow> pColOutline[2];
+ VclPtr<ScOutlineWindow> pRowOutline[2];
+ VclPtr<ScTabSplitter> pHSplitter;
+ VclPtr<ScTabSplitter> pVSplitter;
+ VclPtr<ScTabControl> pTabControl;
+ VclPtr<ScrollBar> aVScrollTop;
+ VclPtr<ScrollBar> aVScrollBottom; // initially visible
+ VclPtr<ScrollBar> aHScrollLeft; // initially visible
+ VclPtr<ScrollBar> aHScrollRight;
+ VclPtr<ScCornerButton> aCornerButton;
+ VclPtr<ScCornerButton> aTopButton;
+ VclPtr<ScrollBarBox> aScrollBarBox;
+
+ VclPtr<ScHintWindow> mpInputHintWindow; // popup window for data validation
ScPageBreakData* pPageBreakData;
std::vector<ScHighlightEntry> maHighlightRanges;
@@ -127,7 +127,7 @@ private:
SfxItemSet* pDrawBrushSet; // drawing object attributes for paint brush
Timer aScrollTimer;
- ScGridWindow* pTimerWindow;
+ VclPtr<ScGridWindow> pTimerWindow;
MouseEvent aTimerMEvt;
sal_uLong nTipVisible;
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 06476e3fe8d2..c06fdf2a44d9 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -348,7 +348,7 @@ public:
SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL, bool bIsApi=false ) SAL_OVERRIDE;
virtual bool HasPrintOptionsPage() const SAL_OVERRIDE;
- virtual SfxTabPage* CreatePrintOptionsPage( vcl::Window *pParent, const SfxItemSet &rOptions ) SAL_OVERRIDE;
+ virtual VclPtr<SfxTabPage> CreatePrintOptionsPage( vcl::Window *pParent, const SfxItemSet &rOptions ) SAL_OVERRIDE;
void ConnectObject( SdrOle2Obj* pObj );
bool ActivateObject( SdrOle2Obj* pObj, long nVerb );
diff --git a/sc/source/ui/inc/tbinsert.hxx b/sc/source/ui/inc/tbinsert.hxx
index d8880ad4716f..dda701868ab2 100644
--- a/sc/source/ui/inc/tbinsert.hxx
+++ b/sc/source/ui/inc/tbinsert.hxx
@@ -36,7 +36,7 @@ public:
virtual ~ScTbxInsertCtrl();
virtual SfxPopupWindowType GetPopupWindowType() const SAL_OVERRIDE;
- virtual SfxPopupWindow* CreatePopupWindow() SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> CreatePopupWindow() SAL_OVERRIDE;
virtual void StateChanged( sal_uInt16 nSID,
SfxItemState eState,
const SfxPoolItem* pState ) SAL_OVERRIDE;
diff --git a/sc/source/ui/inc/tbzoomsliderctrl.hxx b/sc/source/ui/inc/tbzoomsliderctrl.hxx
index d2c6cbccaaaf..0768db7dba2f 100644
--- a/sc/source/ui/inc/tbzoomsliderctrl.hxx
+++ b/sc/source/ui/inc/tbzoomsliderctrl.hxx
@@ -34,7 +34,7 @@ public:
virtual ~ScZoomSliderControl();
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) SAL_OVERRIDE;
- virtual vcl::Window* CreateItemWindow( vcl::Window *pParent ) SAL_OVERRIDE;
+ virtual VclPtr<vcl::Window> CreateItemWindow( vcl::Window *pParent ) SAL_OVERRIDE;
};
class ScZoomSliderWnd: public vcl::Window
@@ -54,6 +54,7 @@ public:
ScZoomSliderWnd( vcl::Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >& rDispatchProvider,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _xFrame , sal_uInt16 nCurrentZoom );
virtual ~ScZoomSliderWnd();
+ virtual void dispose() SAL_OVERRIDE;
void UpdateFromItem( const SvxZoomSliderItem* pZoomSliderItem );
protected:
diff --git a/sc/source/ui/inc/textimportoptions.hxx b/sc/source/ui/inc/textimportoptions.hxx
index b944ce19a8d3..d7c8a5dec970 100644
--- a/sc/source/ui/inc/textimportoptions.hxx
+++ b/sc/source/ui/inc/textimportoptions.hxx
@@ -31,7 +31,7 @@ class ScTextImportOptionsDlg : public ModalDialog
public:
ScTextImportOptionsDlg(vcl::Window* pParent);
virtual ~ScTextImportOptionsDlg();
-
+ virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
LanguageType getLanguageType() const;
@@ -41,14 +41,14 @@ private:
void init();
private:
- OKButton* m_pBtnOk;
+ VclPtr<OKButton> m_pBtnOk;
- RadioButton* m_pRbAutomatic;
- RadioButton* m_pRbCustom;
+ VclPtr<RadioButton> m_pRbAutomatic;
+ VclPtr<RadioButton> m_pRbCustom;
- SvxLanguageBox* m_pLbCustomLang;
+ VclPtr<SvxLanguageBox> m_pLbCustomLang;
- CheckBox* m_pBtnConvertDate;
+ VclPtr<CheckBox> m_pBtnConvertDate;
DECL_LINK(OKHdl, void *);
diff --git a/sc/source/ui/inc/tpcalc.hxx b/sc/source/ui/inc/tpcalc.hxx
index 034e49f22e1c..25bd390fed20 100644
--- a/sc/source/ui/inc/tpcalc.hxx
+++ b/sc/source/ui/inc/tpcalc.hxx
@@ -32,7 +32,7 @@ class ScDocOptions;
class ScTpCalcOptions : public SfxTabPage
{
public:
- static SfxTabPage* Create ( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create ( vcl::Window* pParent,
const SfxItemSet* rCoreSet );
virtual bool FillItemSet ( SfxItemSet* rCoreSet ) SAL_OVERRIDE;
virtual void Reset ( const SfxItemSet* rCoreSet ) SAL_OVERRIDE;
@@ -43,27 +43,28 @@ private:
ScTpCalcOptions( vcl::Window* pParent,
const SfxItemSet& rCoreSet );
virtual ~ScTpCalcOptions();
+ virtual void dispose() SAL_OVERRIDE;
private:
- CheckBox* m_pBtnIterate;
- FixedText* m_pFtSteps;
- NumericField* m_pEdSteps;
- FixedText* m_pFtEps;
- ScDoubleField* m_pEdEps;
+ VclPtr<CheckBox> m_pBtnIterate;
+ VclPtr<FixedText> m_pFtSteps;
+ VclPtr<NumericField> m_pEdSteps;
+ VclPtr<FixedText> m_pFtEps;
+ VclPtr<ScDoubleField> m_pEdEps;
- RadioButton* m_pBtnDateStd;
- RadioButton* m_pBtnDateSc10;
- RadioButton* m_pBtnDate1904;
+ VclPtr<RadioButton> m_pBtnDateStd;
+ VclPtr<RadioButton> m_pBtnDateSc10;
+ VclPtr<RadioButton> m_pBtnDate1904;
- CheckBox* m_pBtnCase;
- CheckBox* m_pBtnCalc;
- CheckBox* m_pBtnMatch;
- CheckBox* m_pBtnRegex;
- CheckBox* m_pBtnLookUp;
- CheckBox* m_pBtnGeneralPrec;
+ VclPtr<CheckBox> m_pBtnCase;
+ VclPtr<CheckBox> m_pBtnCalc;
+ VclPtr<CheckBox> m_pBtnMatch;
+ VclPtr<CheckBox> m_pBtnRegex;
+ VclPtr<CheckBox> m_pBtnLookUp;
+ VclPtr<CheckBox> m_pBtnGeneralPrec;
- FixedText* m_pFtPrec;
- NumericField* m_pEdPrec;
+ VclPtr<FixedText> m_pFtPrec;
+ VclPtr<NumericField> m_pEdPrec;
ScDocOptions* pOldOptions;
ScDocOptions* pLocalOptions;
diff --git a/sc/source/ui/inc/tpcompatibility.hxx b/sc/source/ui/inc/tpcompatibility.hxx
index 5ab6e547ee26..550bd9b0836c 100644
--- a/sc/source/ui/inc/tpcompatibility.hxx
+++ b/sc/source/ui/inc/tpcompatibility.hxx
@@ -19,18 +19,18 @@ class ScTpCompatOptions : public SfxTabPage
public:
using SfxTabPage::DeactivatePage;
- static SfxTabPage* Create (vcl::Window* pParent, const SfxItemSet* rCoreAttrs);
+ static VclPtr<SfxTabPage> Create (vcl::Window* pParent, const SfxItemSet* rCoreAttrs);
virtual bool FillItemSet(SfxItemSet* rCoreAttrs) SAL_OVERRIDE;
virtual void Reset(const SfxItemSet* rCoreAttrs) SAL_OVERRIDE;
virtual sfxpg DeactivatePage(SfxItemSet* pSet = NULL) SAL_OVERRIDE;
+ virtual ~ScTpCompatOptions();
+ virtual void dispose() SAL_OVERRIDE;
private:
explicit ScTpCompatOptions(vcl::Window* pParent, const SfxItemSet& rCoreAttrs);
- virtual ~ScTpCompatOptions();
-
private:
- ListBox* m_pLbKeyBindings;
+ VclPtr<ListBox> m_pLbKeyBindings;
};
#endif
diff --git a/sc/source/ui/inc/tpdefaults.hxx b/sc/source/ui/inc/tpdefaults.hxx
index 6580efd1e582..429cbabde87f 100644
--- a/sc/source/ui/inc/tpdefaults.hxx
+++ b/sc/source/ui/inc/tpdefaults.hxx
@@ -19,7 +19,7 @@ class ScTpDefaultsOptions : public SfxTabPage
public:
using SfxTabPage::DeactivatePage;
- static SfxTabPage* Create (vcl::Window* pParent, const SfxItemSet* rCoreSet);
+ static VclPtr<SfxTabPage> Create (vcl::Window* pParent, const SfxItemSet* rCoreSet);
virtual bool FillItemSet(SfxItemSet* rCoreSet) SAL_OVERRIDE;
virtual void Reset(const SfxItemSet* rCoreSet) SAL_OVERRIDE;
@@ -28,6 +28,7 @@ public:
private:
explicit ScTpDefaultsOptions(vcl::Window* pParent, const SfxItemSet& rCoreSet);
virtual ~ScTpDefaultsOptions();
+ virtual void dispose() SAL_OVERRIDE;
void CheckNumSheets();
void CheckPrefix(Edit* pEdit);
@@ -38,8 +39,8 @@ private:
DECL_LINK( PrefixEditOnFocusHdl, Edit* );
private:
- NumericField* m_pEdNSheets;
- Edit* m_pEdSheetPrefix;
+ VclPtr<NumericField> m_pEdNSheets;
+ VclPtr<Edit> m_pEdSheetPrefix;
// Stores old Sheet Prefix
OUString maOldPrefixValue;
diff --git a/sc/source/ui/inc/tpformula.hxx b/sc/source/ui/inc/tpformula.hxx
index cf901f130d4e..7397d062d31d 100644
--- a/sc/source/ui/inc/tpformula.hxx
+++ b/sc/source/ui/inc/tpformula.hxx
@@ -33,7 +33,7 @@ class ScTpFormulaOptions : public SfxTabPage
public:
using SfxTabPage::DeactivatePage;
- static SfxTabPage* Create (vcl::Window* pParent, const SfxItemSet* rCoreSet);
+ static VclPtr<SfxTabPage> Create (vcl::Window* pParent, const SfxItemSet* rCoreSet);
virtual bool FillItemSet(SfxItemSet* rCoreSet) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rCoreSet ) SAL_OVERRIDE;
@@ -42,7 +42,7 @@ public:
private:
explicit ScTpFormulaOptions(vcl::Window* pParent, const SfxItemSet& rCoreSet);
virtual ~ScTpFormulaOptions();
-
+ virtual void dispose() SAL_OVERRIDE;
void ResetSeparators();
void OnFocusSeparatorInput(Edit* pEdit);
void UpdateCustomCalcRadioButtons(bool bDefault);
@@ -56,20 +56,20 @@ private:
DECL_LINK( SepEditOnFocusHdl, Edit* );
private:
- ListBox* mpLbFormulaSyntax;
- CheckBox* mpCbEnglishFuncName;
+ VclPtr<ListBox> mpLbFormulaSyntax;
+ VclPtr<CheckBox> mpCbEnglishFuncName;
- RadioButton* mpBtnCustomCalcDefault;
- RadioButton* mpBtnCustomCalcCustom;
- PushButton* mpBtnCustomCalcDetails;
+ VclPtr<RadioButton> mpBtnCustomCalcDefault;
+ VclPtr<RadioButton> mpBtnCustomCalcCustom;
+ VclPtr<PushButton> mpBtnCustomCalcDetails;
- Edit* mpEdSepFuncArg;
- Edit* mpEdSepArrayCol;
- Edit* mpEdSepArrayRow;
- PushButton* mpBtnSepReset;
+ VclPtr<Edit> mpEdSepFuncArg;
+ VclPtr<Edit> mpEdSepArrayCol;
+ VclPtr<Edit> mpEdSepArrayRow;
+ VclPtr<PushButton> mpBtnSepReset;
- ListBox* mpLbOOXMLRecalcOptions;
- ListBox* mpLbODFRecalcOptions;
+ VclPtr<ListBox> mpLbOOXMLRecalcOptions;
+ VclPtr<ListBox> mpLbODFRecalcOptions;
/** Stores old separator value of currently focused separator edit box.
This value is used to revert undesired value change. */
diff --git a/sc/source/ui/inc/tphf.hxx b/sc/source/ui/inc/tphf.hxx
index c16d69b535de..da972cbd44a9 100644
--- a/sc/source/ui/inc/tphf.hxx
+++ b/sc/source/ui/inc/tphf.hxx
@@ -28,12 +28,13 @@ class ScHFPage : public SvxHFPage
{
public:
virtual ~ScHFPage();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
virtual bool FillItemSet( SfxItemSet* rOutSet ) SAL_OVERRIDE;
void SetPageStyle( const OUString& rName ) { aStrPageStyle = rName; }
- void SetStyleDlg ( const ScStyleDlg* pDlg ) { pStyleDlg = pDlg; }
+ void SetStyleDlg ( ScStyleDlg* pDlg ) { pStyleDlg = pDlg; }
protected:
ScHFPage( vcl::Window* pParent,
@@ -46,11 +47,11 @@ protected:
virtual sfxpg DeactivatePage( SfxItemSet* pSet = 0 ) SAL_OVERRIDE;
private:
- PushButton* m_pBtnEdit;
- SfxItemSet aDataSet;
- OUString aStrPageStyle;
- sal_uInt16 nPageUsage;
- const ScStyleDlg* pStyleDlg;
+ VclPtr<PushButton> m_pBtnEdit;
+ SfxItemSet aDataSet;
+ OUString aStrPageStyle;
+ sal_uInt16 nPageUsage;
+ VclPtr<ScStyleDlg> pStyleDlg;
DECL_LINK(BtnHdl, void *);
DECL_LINK( HFEditHdl, void* );
@@ -60,7 +61,7 @@ private:
class ScHeaderPage : public ScHFPage
{
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
static const sal_uInt16* GetRanges();
private:
@@ -70,7 +71,7 @@ private:
class ScFooterPage : public ScHFPage
{
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
static const sal_uInt16* GetRanges();
private:
diff --git a/sc/source/ui/inc/tphfedit.hxx b/sc/source/ui/inc/tphfedit.hxx
index f6c218162537..8a392d1a5b3a 100644
--- a/sc/source/ui/inc/tphfedit.hxx
+++ b/sc/source/ui/inc/tphfedit.hxx
@@ -55,6 +55,7 @@ class SC_DLLPUBLIC ScEditWindow : public Control
public:
ScEditWindow( vcl::Window* pParent, WinBits nBits , ScEditWindowLocation eLoc );
virtual ~ScEditWindow();
+ virtual void dispose() SAL_OVERRIDE;
using Control::SetFont;
void SetFont( const ScPatternAttr& rPattern );
diff --git a/sc/source/ui/inc/tpprint.hxx b/sc/source/ui/inc/tpprint.hxx
index f40137682c75..5b8370f13267 100644
--- a/sc/source/ui/inc/tpprint.hxx
+++ b/sc/source/ui/inc/tpprint.hxx
@@ -25,15 +25,15 @@
class ScTpPrintOptions : public SfxTabPage
{
- CheckBox* m_pSkipEmptyPagesCB;
- CheckBox* m_pSelectedSheetsCB;
- CheckBox* m_pForceBreaksCB;
+ VclPtr<CheckBox> m_pSkipEmptyPagesCB;
+ VclPtr<CheckBox> m_pSelectedSheetsCB;
+ VclPtr<CheckBox> m_pForceBreaksCB;
ScTpPrintOptions( vcl::Window* pParent, const SfxItemSet& rCoreSet );
- virtual ~ScTpPrintOptions();
-
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rCoreSet );
+ virtual ~ScTpPrintOptions();
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rCoreSet );
virtual bool FillItemSet( SfxItemSet* rCoreSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rCoreSet ) SAL_OVERRIDE;
using SfxTabPage::DeactivatePage;
diff --git a/sc/source/ui/inc/tpsort.hxx b/sc/source/ui/inc/tpsort.hxx
index d4ad19165103..82ad52ddddff 100644
--- a/sc/source/ui/inc/tpsort.hxx
+++ b/sc/source/ui/inc/tpsort.hxx
@@ -50,8 +50,8 @@ public:
ScTabPageSortFields( vcl::Window* pParent,
const SfxItemSet& rArgSet );
virtual ~ScTabPageSortFields();
-
- static SfxTabPage* Create ( vcl::Window* pParent,
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create ( vcl::Window* pParent,
const SfxItemSet* rArgSet );
virtual bool FillItemSet ( SfxItemSet* rArgSet ) SAL_OVERRIDE;
virtual void Reset ( const SfxItemSet* rArgSet ) SAL_OVERRIDE;
@@ -72,7 +72,7 @@ private:
OUString aStrRow;
const sal_uInt16 nWhichSort;
- ScSortDlg* pDlg;
+ VclPtr<ScSortDlg> pDlg;
ScViewData* pViewData;
ScSortParam aSortData;
std::vector<SCCOLROW> nFieldArr;
@@ -109,10 +109,11 @@ public:
ScTabPageSortOptions( vcl::Window* pParent,
const SfxItemSet& rArgSet );
virtual ~ScTabPageSortOptions();
+ virtual void dispose() SAL_OVERRIDE;
#undef SfxTabPage
#define SfxTabPage ::SfxTabPage
- static SfxTabPage* Create ( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create ( vcl::Window* pParent,
const SfxItemSet* rArgSet );
virtual bool FillItemSet ( SfxItemSet* rArgSet ) SAL_OVERRIDE;
virtual void Reset ( const SfxItemSet* rArgSet ) SAL_OVERRIDE;
@@ -125,24 +126,24 @@ protected:
private:
- CheckBox* m_pBtnCase;
- CheckBox* m_pBtnHeader;
- CheckBox* m_pBtnFormats;
- CheckBox* m_pBtnNaturalSort;
+ VclPtr<CheckBox> m_pBtnCase;
+ VclPtr<CheckBox> m_pBtnHeader;
+ VclPtr<CheckBox> m_pBtnFormats;
+ VclPtr<CheckBox> m_pBtnNaturalSort;
- CheckBox* m_pBtnCopyResult;
- ListBox* m_pLbOutPos;
- Edit* m_pEdOutPos;
+ VclPtr<CheckBox> m_pBtnCopyResult;
+ VclPtr<ListBox> m_pLbOutPos;
+ VclPtr<Edit> m_pEdOutPos;
- CheckBox* m_pBtnSortUser;
- ListBox* m_pLbSortUser;
+ VclPtr<CheckBox> m_pBtnSortUser;
+ VclPtr<ListBox> m_pLbSortUser;
- SvxLanguageBox* m_pLbLanguage;
- FixedText* m_pFtAlgorithm;
- ListBox* m_pLbAlgorithm;
+ VclPtr<SvxLanguageBox> m_pLbLanguage;
+ VclPtr<FixedText> m_pFtAlgorithm;
+ VclPtr<ListBox> m_pLbAlgorithm;
- RadioButton* m_pBtnTopDown;
- RadioButton* m_pBtnLeftRight;
+ VclPtr<RadioButton> m_pBtnTopDown;
+ VclPtr<RadioButton> m_pBtnLeftRight;
OUString aStrRowLabel;
OUString aStrColLabel;
@@ -153,7 +154,7 @@ private:
ScSortParam aSortData;
ScViewData* pViewData;
ScDocument* pDoc;
- ScSortDlg* pDlg;
+ VclPtr<ScSortDlg> pDlg;
ScAddress theOutPos;
CollatorResource* pColRes;
diff --git a/sc/source/ui/inc/tpstat.hxx b/sc/source/ui/inc/tpstat.hxx
index 96f141fdbdd8..a5cbdf7a925e 100644
--- a/sc/source/ui/inc/tpstat.hxx
+++ b/sc/source/ui/inc/tpstat.hxx
@@ -27,20 +27,20 @@
class ScDocStatPage: public SfxTabPage
{
public:
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ virtual ~ScDocStatPage();
+ virtual void dispose() SAL_OVERRIDE;
private:
ScDocStatPage( vcl::Window *pParent, const SfxItemSet& rSet );
- virtual ~ScDocStatPage();
-
protected:
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset ( const SfxItemSet* rSet ) SAL_OVERRIDE;
private:
- FixedText* m_pFtTables;
- FixedText* m_pFtCells;
- FixedText* m_pFtPages;
+ VclPtr<FixedText> m_pFtTables;
+ VclPtr<FixedText> m_pFtCells;
+ VclPtr<FixedText> m_pFtPages;
};
#endif
diff --git a/sc/source/ui/inc/tpsubt.hxx b/sc/source/ui/inc/tpsubt.hxx
index ffff1e061ba3..ecc8e0305483 100644
--- a/sc/source/ui/inc/tpsubt.hxx
+++ b/sc/source/ui/inc/tpsubt.hxx
@@ -41,15 +41,16 @@ protected:
public:
virtual ~ScTpSubTotalGroup();
+ virtual void dispose() SAL_OVERRIDE;
bool DoReset ( sal_uInt16 nGroupNo,
const SfxItemSet& rArgSet );
bool DoFillItemSet ( sal_uInt16 nGroupNo,
SfxItemSet& rArgSet );
protected:
- ListBox* mpLbGroup;
- SvxCheckListBox* mpLbColumns;
- ListBox* mpLbFunctions;
+ VclPtr<ListBox> mpLbGroup;
+ VclPtr<SvxCheckListBox> mpLbColumns;
+ VclPtr<ListBox> mpLbFunctions;
const OUString aStrNone;
const OUString aStrColumn;
@@ -82,7 +83,7 @@ protected:
public:
virtual ~ScTpSubTotalGroup1();
- static SfxTabPage* Create ( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create ( vcl::Window* pParent,
const SfxItemSet* rArgSet );
virtual bool FillItemSet ( SfxItemSet* rArgSet ) SAL_OVERRIDE;
virtual void Reset ( const SfxItemSet* rArgSet ) SAL_OVERRIDE;
@@ -97,7 +98,7 @@ protected:
public:
virtual ~ScTpSubTotalGroup2();
- static SfxTabPage* Create ( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create ( vcl::Window* pParent,
const SfxItemSet* rArgSet );
virtual bool FillItemSet ( SfxItemSet* rArgSet ) SAL_OVERRIDE;
virtual void Reset ( const SfxItemSet* rArgSet ) SAL_OVERRIDE;
@@ -112,7 +113,7 @@ protected:
public:
virtual ~ScTpSubTotalGroup3();
- static SfxTabPage* Create ( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create ( vcl::Window* pParent,
const SfxItemSet* rArgSet );
virtual bool FillItemSet ( SfxItemSet* rArgSet ) SAL_OVERRIDE;
virtual void Reset ( const SfxItemSet* rArgSet ) SAL_OVERRIDE;
@@ -126,22 +127,22 @@ protected:
public:
virtual ~ScTpSubTotalOptions();
-
- static SfxTabPage* Create ( vcl::Window* pParent,
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create ( vcl::Window* pParent,
const SfxItemSet* rArgSet );
virtual bool FillItemSet ( SfxItemSet* rArgSet ) SAL_OVERRIDE;
virtual void Reset ( const SfxItemSet* rArgSet ) SAL_OVERRIDE;
private:
- CheckBox* pBtnPagebreak;
- CheckBox* pBtnCase;
- CheckBox* pBtnSort;
- FixedText* pFlSort;
- RadioButton* pBtnAscending;
- RadioButton* pBtnDescending;
- CheckBox* pBtnFormats;
- CheckBox* pBtnUserDef;
- ListBox* pLbUserDef;
+ VclPtr<CheckBox> pBtnPagebreak;
+ VclPtr<CheckBox> pBtnCase;
+ VclPtr<CheckBox> pBtnSort;
+ VclPtr<FixedText> pFlSort;
+ VclPtr<RadioButton> pBtnAscending;
+ VclPtr<RadioButton> pBtnDescending;
+ VclPtr<CheckBox> pBtnFormats;
+ VclPtr<CheckBox> pBtnUserDef;
+ VclPtr<ListBox> pLbUserDef;
ScViewData* pViewData;
ScDocument* pDoc;
diff --git a/sc/source/ui/inc/tptable.hxx b/sc/source/ui/inc/tptable.hxx
index a1021b3b5911..e135c91ea4ef 100644
--- a/sc/source/ui/inc/tptable.hxx
+++ b/sc/source/ui/inc/tptable.hxx
@@ -29,7 +29,7 @@ class ScTablePage : public SfxTabPage
{
static const sal_uInt16 pPageTableRanges[];
public:
- static SfxTabPage* Create ( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create ( vcl::Window* pParent,
const SfxItemSet* rCoreSet );
static const sal_uInt16* GetRanges () { return pPageTableRanges; }
virtual bool FillItemSet ( SfxItemSet* rCoreSet ) SAL_OVERRIDE;
@@ -38,42 +38,42 @@ public:
virtual sfxpg DeactivatePage ( SfxItemSet* pSet = NULL ) SAL_OVERRIDE;
virtual void DataChanged ( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
+ virtual ~ScTablePage();
+ virtual void dispose() SAL_OVERRIDE;
private:
ScTablePage( vcl::Window* pParent, const SfxItemSet& rCoreSet );
- virtual ~ScTablePage();
-
void ShowImage();
private:
- RadioButton* m_pBtnTopDown;
- RadioButton* m_pBtnLeftRight;
- FixedImage* m_pBmpPageDir;
- CheckBox* m_pBtnPageNo;
- NumericField* m_pEdPageNo;
+ VclPtr<RadioButton> m_pBtnTopDown;
+ VclPtr<RadioButton> m_pBtnLeftRight;
+ VclPtr<FixedImage> m_pBmpPageDir;
+ VclPtr<CheckBox> m_pBtnPageNo;
+ VclPtr<NumericField> m_pEdPageNo;
- CheckBox* m_pBtnHeaders;
- CheckBox* m_pBtnGrid;
- CheckBox* m_pBtnNotes;
- CheckBox* m_pBtnObjects;
- CheckBox* m_pBtnCharts;
- CheckBox* m_pBtnDrawings;
- CheckBox* m_pBtnFormulas;
- CheckBox* m_pBtnNullVals;
+ VclPtr<CheckBox> m_pBtnHeaders;
+ VclPtr<CheckBox> m_pBtnGrid;
+ VclPtr<CheckBox> m_pBtnNotes;
+ VclPtr<CheckBox> m_pBtnObjects;
+ VclPtr<CheckBox> m_pBtnCharts;
+ VclPtr<CheckBox> m_pBtnDrawings;
+ VclPtr<CheckBox> m_pBtnFormulas;
+ VclPtr<CheckBox> m_pBtnNullVals;
- ListBox* m_pLbScaleMode;
- VclHBox* m_pBxScaleAll;
- MetricField* m_pEdScaleAll;
- VclGrid* m_pGrHeightWidth;
- NumericField* m_pEdScalePageWidth;
- NumericField* m_pEdScalePageHeight;
- VclHBox* m_pBxScalePageNum;
- NumericField* m_pEdScalePageNum;
+ VclPtr<ListBox> m_pLbScaleMode;
+ VclPtr<VclHBox> m_pBxScaleAll;
+ VclPtr<MetricField> m_pEdScaleAll;
+ VclPtr<VclGrid> m_pGrHeightWidth;
+ VclPtr<NumericField> m_pEdScalePageWidth;
+ VclPtr<NumericField> m_pEdScalePageHeight;
+ VclPtr<VclHBox> m_pBxScalePageNum;
+ VclPtr<NumericField> m_pEdScalePageNum;
private:
// Handler:
DECL_LINK(PageDirHdl, void *);
- DECL_LINK( PageNoHdl, CheckBox* );
+ DECL_LINK( PageNoHdl, CheckBox* );
DECL_LINK(ScaleHdl, void *);
};
diff --git a/sc/source/ui/inc/tpusrlst.hxx b/sc/source/ui/inc/tpusrlst.hxx
index c3286a23ad4d..682fc0c3421f 100644
--- a/sc/source/ui/inc/tpusrlst.hxx
+++ b/sc/source/ui/inc/tpusrlst.hxx
@@ -33,7 +33,7 @@ class ScRangeUtil;
class ScTpUserLists : public SfxTabPage
{
public:
- static SfxTabPage* Create ( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create ( vcl::Window* pParent,
const SfxItemSet* rAttrSet );
virtual bool FillItemSet ( SfxItemSet* rCoreAttrs ) SAL_OVERRIDE;
virtual void Reset ( const SfxItemSet* rCoreAttrs ) SAL_OVERRIDE;
@@ -44,24 +44,25 @@ private:
ScTpUserLists( vcl::Window* pParent,
const SfxItemSet& rArgSet );
virtual ~ScTpUserLists();
+ virtual void dispose() SAL_OVERRIDE;
private:
- FixedText* mpFtLists;
- ListBox* mpLbLists;
- FixedText* mpFtEntries;
- VclMultiLineEdit* mpEdEntries;
- FixedText* mpFtCopyFrom;
- Edit* mpEdCopyFrom;
+ VclPtr<FixedText> mpFtLists;
+ VclPtr<ListBox> mpLbLists;
+ VclPtr<FixedText> mpFtEntries;
+ VclPtr<VclMultiLineEdit> mpEdEntries;
+ VclPtr<FixedText> mpFtCopyFrom;
+ VclPtr<Edit> mpEdCopyFrom;
- PushButton* mpBtnNew;
- PushButton* mpBtnDiscard;
+ VclPtr<PushButton> mpBtnNew;
+ VclPtr<PushButton> mpBtnDiscard;
- PushButton* mpBtnAdd;
- PushButton* mpBtnModify;
+ VclPtr<PushButton> mpBtnAdd;
+ VclPtr<PushButton> mpBtnModify;
- PushButton* mpBtnRemove;
+ VclPtr<PushButton> mpBtnRemove;
- PushButton* mpBtnCopy;
+ VclPtr<PushButton> mpBtnCopy;
const OUString aStrQueryRemove;
const OUString aStrCopyList;
diff --git a/sc/source/ui/inc/tpview.hxx b/sc/source/ui/inc/tpview.hxx
index 28778a16f783..f31c850a5eb7 100644
--- a/sc/source/ui/inc/tpview.hxx
+++ b/sc/source/ui/inc/tpview.hxx
@@ -31,31 +31,31 @@ class ScViewOptions;
class ScTpContentOptions : public SfxTabPage
{
- ListBox* pGridLB;
- FixedText* pColorFT;
- ColorListBox* pColorLB;
- CheckBox* pBreakCB;
- CheckBox* pGuideLineCB;
-
- CheckBox* pFormulaCB;
- CheckBox* pNilCB;
- CheckBox* pAnnotCB;
- CheckBox* pValueCB;
- CheckBox* pAnchorCB;
- CheckBox* pClipMarkCB;
- CheckBox* pRangeFindCB;
-
- ListBox* pObjGrfLB;
- ListBox* pDiagramLB;
- ListBox* pDrawLB;
-
- CheckBox* pSyncZoomCB;
-
- CheckBox* pRowColHeaderCB;
- CheckBox* pHScrollCB;
- CheckBox* pVScrollCB;
- CheckBox* pTblRegCB;
- CheckBox* pOutlineCB;
+ VclPtr<ListBox> pGridLB;
+ VclPtr<FixedText> pColorFT;
+ VclPtr<ColorListBox> pColorLB;
+ VclPtr<CheckBox> pBreakCB;
+ VclPtr<CheckBox> pGuideLineCB;
+
+ VclPtr<CheckBox> pFormulaCB;
+ VclPtr<CheckBox> pNilCB;
+ VclPtr<CheckBox> pAnnotCB;
+ VclPtr<CheckBox> pValueCB;
+ VclPtr<CheckBox> pAnchorCB;
+ VclPtr<CheckBox> pClipMarkCB;
+ VclPtr<CheckBox> pRangeFindCB;
+
+ VclPtr<ListBox> pObjGrfLB;
+ VclPtr<ListBox> pDiagramLB;
+ VclPtr<ListBox> pDrawLB;
+
+ VclPtr<CheckBox> pSyncZoomCB;
+
+ VclPtr<CheckBox> pRowColHeaderCB;
+ VclPtr<CheckBox> pHScrollCB;
+ VclPtr<CheckBox> pVScrollCB;
+ VclPtr<CheckBox> pTblRegCB;
+ VclPtr<CheckBox> pOutlineCB;
ScViewOptions* pLocalOptions;
@@ -67,9 +67,10 @@ class ScTpContentOptions : public SfxTabPage
ScTpContentOptions( vcl::Window* pParent,
const SfxItemSet& rArgSet );
virtual ~ScTpContentOptions();
+ virtual void dispose() SAL_OVERRIDE;
public:
- static SfxTabPage* Create ( vcl::Window* pParent,
+ static VclPtr<SfxTabPage> Create ( vcl::Window* pParent,
const SfxItemSet* rCoreSet );
virtual bool FillItemSet ( SfxItemSet* rCoreSet ) SAL_OVERRIDE;
virtual void Reset ( const SfxItemSet* rCoreSet ) SAL_OVERRIDE;
@@ -83,23 +84,23 @@ public:
class ScDocument;
class ScTpLayoutOptions : public SfxTabPage
{
- ListBox* m_pUnitLB;
- MetricField* m_pTabMF;
-
- RadioButton* m_pAlwaysRB;
- RadioButton* m_pRequestRB;
- RadioButton* m_pNeverRB;
-
- CheckBox* m_pAlignCB;
- ListBox* m_pAlignLB;
- CheckBox* m_pEditModeCB;
- CheckBox* m_pFormatCB;
- CheckBox* m_pExpRefCB;
- CheckBox* m_pSortRefUpdateCB;
- CheckBox* m_pMarkHdrCB;
- CheckBox* m_pTextFmtCB;
- CheckBox* m_pReplWarnCB;
- CheckBox* m_pLegacyCellSelectionCB;
+ VclPtr<ListBox> m_pUnitLB;
+ VclPtr<MetricField> m_pTabMF;
+
+ VclPtr<RadioButton> m_pAlwaysRB;
+ VclPtr<RadioButton> m_pRequestRB;
+ VclPtr<RadioButton> m_pNeverRB;
+
+ VclPtr<CheckBox> m_pAlignCB;
+ VclPtr<ListBox> m_pAlignLB;
+ VclPtr<CheckBox> m_pEditModeCB;
+ VclPtr<CheckBox> m_pFormatCB;
+ VclPtr<CheckBox> m_pExpRefCB;
+ VclPtr<CheckBox> m_pSortRefUpdateCB;
+ VclPtr<CheckBox> m_pMarkHdrCB;
+ VclPtr<CheckBox> m_pTextFmtCB;
+ VclPtr<CheckBox> m_pReplWarnCB;
+ VclPtr<CheckBox> m_pLegacyCellSelectionCB;
SvxStringArray aUnitArr;
@@ -114,10 +115,10 @@ class ScTpLayoutOptions : public SfxTabPage
ScTpLayoutOptions( vcl::Window* pParent,
const SfxItemSet& rArgSet );
- virtual ~ScTpLayoutOptions();
-
public:
- static SfxTabPage* Create ( vcl::Window* pParent,
+ virtual ~ScTpLayoutOptions();
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create ( vcl::Window* pParent,
const SfxItemSet* rCoreSet );
virtual bool FillItemSet ( SfxItemSet* rCoreSet ) SAL_OVERRIDE;
virtual void Reset ( const SfxItemSet* rCoreSet ) SAL_OVERRIDE;
diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx
index ebc6d92ffa37..0cf1d9370e1f 100644
--- a/sc/source/ui/inc/validate.hxx
+++ b/sc/source/ui/inc/validate.hxx
@@ -85,8 +85,9 @@ class ScTPValidationValue : public ScRefHandlerCaller, public SfxTabPage
static const sal_uInt16 pValueRanges[];
public:
explicit ScTPValidationValue( vcl::Window* pParent, const SfxItemSet& rArgSet );
-
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rArgSet );
+ virtual ~ScTPValidationValue();
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rArgSet );
static const sal_uInt16* GetRanges() { return pValueRanges; }
virtual bool FillItemSet( SfxItemSet* rArgSet ) SAL_OVERRIDE;
@@ -104,19 +105,19 @@ private:
DECL_LINK(SelectHdl, void *);
DECL_LINK(CheckHdl, void *);
- ListBox* m_pLbAllow;
- CheckBox* m_pCbAllow; /// Allow blank cells.
- CheckBox* m_pCbShow; /// Show selection list in cell.
- CheckBox* m_pCbSort; /// Sort selection list in cell.
- FixedText* m_pFtValue;
- ListBox* m_pLbValue;
- FixedText* m_pFtMin;
- VclContainer* m_pMinGrid;
- formula::RefEdit* m_pEdMin;
- VclMultiLineEdit* m_pEdList; /// Entries for explicit list
- FixedText* m_pFtMax;
- formula::RefEdit* m_pEdMax;
- FixedText* m_pFtHint; /// Hint text for cell range validity.
+ VclPtr<ListBox> m_pLbAllow;
+ VclPtr<CheckBox> m_pCbAllow; /// Allow blank cells.
+ VclPtr<CheckBox> m_pCbShow; /// Show selection list in cell.
+ VclPtr<CheckBox> m_pCbSort; /// Sort selection list in cell.
+ VclPtr<FixedText> m_pFtValue;
+ VclPtr<ListBox> m_pLbValue;
+ VclPtr<FixedText> m_pFtMin;
+ VclPtr<VclContainer> m_pMinGrid;
+ VclPtr<formula::RefEdit> m_pEdMin;
+ VclPtr<VclMultiLineEdit> m_pEdList; /// Entries for explicit list
+ VclPtr<FixedText> m_pFtMax;
+ VclPtr<formula::RefEdit> m_pEdMax;
+ VclPtr<FixedText> m_pFtHint; /// Hint text for cell range validity.
OUString maStrMin;
OUString maStrMax;
@@ -128,11 +129,11 @@ private:
DECL_LINK(EditSetFocusHdl, void *);
DECL_LINK( KillFocusHdl, vcl::Window *);
void OnClick( Button *pBtn );
- formula::RefEdit* m_pRefEdit;
+ VclPtr<formula::RefEdit> m_pRefEdit;
public:
class ScRefButtonEx : public ::formula::RefButton
{
- ScTPValidationValue* m_pPage;
+ VclPtr<ScTPValidationValue> m_pPage;
virtual void Click() SAL_OVERRIDE;
public:
ScRefButtonEx(vcl::Window* pParent, WinBits nStyle)
@@ -140,6 +141,8 @@ public:
, m_pPage(NULL)
{
}
+ virtual ~ScRefButtonEx();
+ virtual void dispose() SAL_OVERRIDE;
void SetParentPage(ScTPValidationValue *pPage)
{
m_pPage = pPage;
@@ -150,8 +153,8 @@ public:
}
};
private:
- ScRefButtonEx* m_pBtnRef;
- VclContainer* m_pRefGrid;
+ VclPtr<ScRefButtonEx> m_pBtnRef;
+ VclPtr<VclContainer> m_pRefGrid;
friend class ScRefButtonEx;
void SetReferenceHdl( const ScRange& , ScDocument* );
void SetActiveHdl();
@@ -175,7 +178,7 @@ class ScValidationDlg
DECL_LINK( OkHdl, Button * );
ScTabViewShell *m_pTabVwSh;
- VclHBox* m_pHBox;
+ VclPtr<VclHBox> m_pHBox;
sal_uInt16 m_nValuePageId;
bool m_bOwnRefHdlr:1;
bool m_bRefInputting:1;
@@ -185,10 +188,13 @@ class ScValidationDlg
public:
explicit ScValidationDlg( vcl::Window* pParent, const SfxItemSet* pArgSet, ScTabViewShell * pTabViewSh, SfxBindings *pB = NULL );
- virtual ~ScValidationDlg()
+ virtual ~ScValidationDlg() { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE
{
if( m_bOwnRefHdlr )
RemoveRefDlg( false );
+ m_pHBox.clear();
+ ScRefHdlrImpl<ScValidationDlg, SfxTabDialog, false>::dispose();
}
static ScValidationDlg * Find1AliveObject( vcl::Window *pAncestor )
{
@@ -276,9 +282,9 @@ public:
class ScTPValidationHelp : public SfxTabPage
{
private:
- TriStateBox* pTsbHelp;
- Edit* pEdtTitle;
- VclMultiLineEdit* pEdInputHelp;
+ VclPtr<TriStateBox> pTsbHelp;
+ VclPtr<Edit> pEdtTitle;
+ VclPtr<VclMultiLineEdit> pEdInputHelp;
void Init();
@@ -288,8 +294,9 @@ private:
public:
ScTPValidationHelp( vcl::Window* pParent, const SfxItemSet& rArgSet );
virtual ~ScTPValidationHelp();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create ( vcl::Window* pParent, const SfxItemSet* rArgSet );
+ static VclPtr<SfxTabPage> Create ( vcl::Window* pParent, const SfxItemSet* rArgSet );
virtual bool FillItemSet ( SfxItemSet* rArgSet ) SAL_OVERRIDE;
virtual void Reset ( const SfxItemSet* rArgSet ) SAL_OVERRIDE;
};
@@ -297,12 +304,12 @@ public:
class ScTPValidationError : public SfxTabPage
{
private:
- TriStateBox* m_pTsbShow;
- ListBox* m_pLbAction;
- PushButton* m_pBtnSearch;
- Edit* m_pEdtTitle;
- FixedText* m_pFtError;
- VclMultiLineEdit* m_pEdError;
+ VclPtr<TriStateBox> m_pTsbShow;
+ VclPtr<ListBox> m_pLbAction;
+ VclPtr<PushButton> m_pBtnSearch;
+ VclPtr<Edit> m_pEdtTitle;
+ VclPtr<FixedText> m_pFtError;
+ VclPtr<VclMultiLineEdit> m_pEdError;
void Init();
@@ -313,8 +320,9 @@ private:
public:
ScTPValidationError( vcl::Window* pParent, const SfxItemSet& rArgSet );
virtual ~ScTPValidationError();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create ( vcl::Window* pParent, const SfxItemSet* rArgSet );
+ static VclPtr<SfxTabPage> Create ( vcl::Window* pParent, const SfxItemSet* rArgSet );
virtual bool FillItemSet ( SfxItemSet* rArgSet ) SAL_OVERRIDE;
virtual void Reset ( const SfxItemSet* rArgSet ) SAL_OVERRIDE;
};
diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index 1c90a1e7a4b3..c768dbcfc393 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -335,7 +335,7 @@ public:
DataFormPutData( SCROW nCurrentRow ,
SCROW nStartRow , SCCOL nStartCol ,
SCROW nEndRow , SCCOL nEndCol ,
- boost::ptr_vector<boost::nullable<Edit> >& aEdits,
+ std::vector<VclPtr<Edit> >& aEdits,
sal_uInt16 aColLength );
void UpdateSelectionArea( const ScMarkData& rSel, ScPatternAttr* pAttr = NULL );
// Internal helper functions
diff --git a/sc/source/ui/inc/xmlsourcedlg.hxx b/sc/source/ui/inc/xmlsourcedlg.hxx
index efabb35b024f..1bc0c375c936 100644
--- a/sc/source/ui/inc/xmlsourcedlg.hxx
+++ b/sc/source/ui/inc/xmlsourcedlg.hxx
@@ -28,17 +28,17 @@ class ScOrcusXMLContext;
class ScXMLSourceDlg : public ScAnyRefDlg
{
- PushButton* mpBtnSelectSource;
- FixedText* mpFtSourceFile;
+ VclPtr<PushButton> mpBtnSelectSource;
+ VclPtr<FixedText> mpFtSourceFile;
- VclContainer* mpMapGrid;
+ VclPtr<VclContainer> mpMapGrid;
- SvTreeListBox* mpLbTree;
- formula::RefEdit* mpRefEdit;
- formula::RefButton* mpRefBtn;
+ VclPtr<SvTreeListBox> mpLbTree;
+ VclPtr<formula::RefEdit> mpRefEdit;
+ VclPtr<formula::RefButton> mpRefBtn;
- PushButton* mpBtnOk;
- CancelButton* mpBtnCancel;
+ VclPtr<PushButton> mpBtnOk;
+ VclPtr<CancelButton> mpBtnCancel;
OUString maSrcPath;
@@ -51,12 +51,14 @@ class ScXMLSourceDlg : public ScAnyRefDlg
ScDocument* mpDoc;
- formula::RefEdit* mpActiveEdit;
+ VclPtr<formula::RefEdit> mpActiveEdit;
bool mbDlgLostFocus;
public:
ScXMLSourceDlg(
SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent, ScDocument* pDoc);
+ virtual ~ScXMLSourceDlg();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool IsRefInputMode() const SAL_OVERRIDE;
virtual void SetReference(const ScRange& rRange, ScDocument* pDoc) SAL_OVERRIDE;
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx
index 76363796d8de..ac1b5a4bb012 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -111,7 +111,7 @@ ScAcceptChgDlg::ScAcceptChgDlg(SfxBindings* pB, SfxChildWindow* pCW, vcl::Window
bHasFilterEntry(false),
bUseColor(false)
{
- m_pAcceptChgCtr = new SvxAcceptChgCtr(get_content_area(), this);
+ m_pAcceptChgCtr = VclPtr<SvxAcceptChgCtr>::Create(get_content_area(), this);
nAcceptCount=0;
nRejectCount=0;
aReOpenIdle.SetPriority(SchedulerPriority::MEDIUM);
@@ -154,6 +154,11 @@ ScAcceptChgDlg::ScAcceptChgDlg(SfxBindings* pB, SfxChildWindow* pCW, vcl::Window
ScAcceptChgDlg::~ScAcceptChgDlg()
{
+ disposeOnce();
+}
+
+void ScAcceptChgDlg::dispose()
+{
ClearView();
ScChangeTrack* pChanges=pDoc->GetChangeTrack();
@@ -163,7 +168,11 @@ ScAcceptChgDlg::~ScAcceptChgDlg()
pChanges->SetModifiedLink(aLink);
}
- delete m_pAcceptChgCtr;
+ m_pAcceptChgCtr.disposeAndClear();
+ pTPFilter.clear();
+ pTPView.clear();
+ pTheView.clear();
+ SfxModelessDialog::dispose();
}
void ScAcceptChgDlg::ReInit(ScViewData* ptrViewData)
diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx
index fc0d82c909b7..d2084b4b79e6 100644
--- a/sc/source/ui/miscdlgs/anyrefdg.cxx
+++ b/sc/source/ui/miscdlgs/anyrefdg.cxx
@@ -344,8 +344,6 @@ IMPL_LINK( ScFormulaReferenceHelper, AccelSelectHdl, Accelerator *, pSelAccel )
return long(true);
}
-typedef std::vector<vcl::Window*> winvec;
-
void ScFormulaReferenceHelper::RefInputDone( bool bForced )
{
if ( CanInputDone( bForced ) )
@@ -394,7 +392,7 @@ void ScFormulaReferenceHelper::RefInputDone( bool bForced )
pRefBtn->SetStartImage();
// All others: Show();
- for (winvec::iterator aI = m_aHiddenWidgets.begin(); aI != m_aHiddenWidgets.end(); ++aI)
+ for (auto aI = m_aHiddenWidgets.begin(); aI != m_aHiddenWidgets.end(); ++aI)
{
vcl::Window *pWindow = *aI;
pWindow->Show();
@@ -416,12 +414,12 @@ void ScFormulaReferenceHelper::RefInputDone( bool bForced )
}
}
-typedef std::set<vcl::Window*> winset;
+typedef std::set<VclPtr<vcl::Window> > winset;
namespace
{
void hideUnless(vcl::Window *pTop, const winset& rVisibleWidgets,
- winvec &rWasVisibleWidgets)
+ std::vector<VclPtr<vcl::Window> > &rWasVisibleWidgets)
{
for (vcl::Window* pChild = pTop->GetWindow(WINDOW_FIRSTCHILD); pChild;
pChild = pChild->GetWindow(WINDOW_NEXT))
@@ -759,14 +757,14 @@ static void lcl_HideAllReferences()
// class ScRefHandler
ScRefHandler::ScRefHandler( vcl::Window &rWindow, SfxBindings* pB, bool bBindRef ):
- m_rWindow( rWindow ),
+ m_rWindow( &rWindow ),
m_bInRefMode( false ),
m_aHelper(this,pB),
pMyBindings( pB ),
pActiveWin(NULL)
{
- m_aHelper.SetWindow(&m_rWindow);
- reverseUniqueHelpIdHack(m_rWindow);
+ m_aHelper.SetWindow(m_rWindow.get());
+ reverseUniqueHelpIdHack(*m_rWindow.get());
aIdle.SetPriority(SchedulerPriority::LOWER);
aIdle.SetIdleHdl(LINK( this, ScRefHandler, UpdateFocusHdl));
@@ -889,7 +887,7 @@ bool ScRefHandler::IsDocAllowed(SfxObjectShell* pDocSh) const // pDocSh may be
bool ScRefHandler::IsRefInputMode() const
{
- return m_rWindow.IsVisible(); // references can only be input to visible windows
+ return m_rWindow->IsVisible(); // references can only be input to visible windows
}
bool ScRefHandler::DoClose( sal_uInt16 nId )
@@ -951,7 +949,7 @@ void ScRefHandler::stateChanged(const StateChangedType nStateChange, const bool
if(nStateChange == StateChangedType::VISIBLE)
{
- if(m_rWindow.IsVisible())
+ if(m_rWindow->IsVisible())
{
ScFormulaReferenceHelper::enableInput( false );
m_aHelper.EnableSpreadsheets();
diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx
index ffd54c8547c8..f07d19594cde 100644
--- a/sc/source/ui/miscdlgs/autofmt.cxx
+++ b/sc/source/ui/miscdlgs/autofmt.cxx
@@ -58,7 +58,7 @@ ScAutoFmtPreview::ScAutoFmtPreview(vcl::Window* pParent)
: Window(pParent)
, pCurData(NULL)
, aVD(*this)
- , aScriptedText(aVD)
+ , aScriptedText(*aVD.get())
, bFitWidth(false)
, mbRTL(false)
, aStrJan(ScResId(STR_JAN))
@@ -90,7 +90,13 @@ void ScAutoFmtPreview::Resize()
ScAutoFmtPreview::~ScAutoFmtPreview()
{
+ disposeOnce();
+}
+
+void ScAutoFmtPreview::dispose()
+{
delete pNumFmt;
+ vcl::Window::dispose();
}
static void lcl_SetFontProperties(
@@ -376,11 +382,11 @@ void ScAutoFmtPreview::DrawBackground()
const SvxBrushItem* pItem = static_cast< const SvxBrushItem* >(
pCurData->GetItem( GetFormatIndex( nCol, nRow ), ATTR_BACKGROUND ) );
- aVD.Push( PushFlags::LINECOLOR | PushFlags::FILLCOLOR );
- aVD.SetLineColor();
- aVD.SetFillColor( pItem->GetColor() );
- aVD.DrawRect( maArray.GetCellRect( nCol, nRow ) );
- aVD.Pop();
+ aVD->Push( PushFlags::LINECOLOR | PushFlags::FILLCOLOR );
+ aVD->SetLineColor();
+ aVD->SetFillColor( pItem->GetColor() );
+ aVD->DrawRect( maArray.GetCellRect( nCol, nRow ) );
+ aVD->Pop();
}
}
}
@@ -399,7 +405,7 @@ void ScAutoFmtPreview::PaintCells()
// 3) border
if ( pCurData->GetIncludeFrame() )
- maArray.DrawArray( aVD );
+ maArray.DrawArray( *aVD.get() );
}
}
@@ -484,20 +490,20 @@ void ScAutoFmtPreview::NotifyChange( ScAutoFormatData* pNewData )
void ScAutoFmtPreview::DoPaint( const Rectangle& /* rRect */ )
{
- sal_uInt32 nOldDrawMode = aVD.GetDrawMode();
+ sal_uInt32 nOldDrawMode = aVD->GetDrawMode();
Size aWndSize( GetSizePixel() );
- vcl::Font aFont( aVD.GetFont() );
+ vcl::Font aFont( aVD->GetFont() );
Color aBackCol( GetSettings().GetStyleSettings().GetWindowColor() );
Point aTmpPoint;
Rectangle aRect( aTmpPoint, aWndSize );
aFont.SetTransparent( true );
- aVD.SetFont( aFont );
- aVD.SetLineColor();
- aVD.SetFillColor( aBackCol );
- aVD.SetOutputSize( aWndSize );
- aVD.DrawRect( aRect );
+ aVD->SetFont( aFont );
+ aVD->SetLineColor();
+ aVD->SetFillColor( aBackCol );
+ aVD->SetOutputSize( aWndSize );
+ aVD->DrawRect( aRect );
PaintCells();
SetLineColor();
@@ -507,9 +513,9 @@ void ScAutoFmtPreview::DoPaint( const Rectangle& /* rRect */ )
Point aPos( (aWndSize.Width() - aPrvSize.Width()) / 2, (aWndSize.Height() - aPrvSize.Height()) / 2 );
if (AllSettings::GetLayoutRTL())
aPos.X() = -aPos.X();
- DrawOutDev( aPos, aWndSize, Point(), aWndSize, aVD );
+ DrawOutDev( aPos, aWndSize, Point(), aWndSize, *aVD.get() );
- aVD.SetDrawMode( nOldDrawMode );
+ aVD->SetDrawMode( nOldDrawMode );
}
void ScAutoFmtPreview::Paint( const Rectangle& rRect )
diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx
index db83be927871..9c0b55637cb6 100644
--- a/sc/source/ui/miscdlgs/conflictsdlg.cxx
+++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx
@@ -374,7 +374,7 @@ void ScConflictsResolver::HandleAction( ScChangeAction* pAction, bool bIsSharedA
ScConflictsDlg::ScConflictsDlg( vcl::Window* pParent, ScViewData* pViewData, ScDocument* pSharedDoc, ScConflictsList& rConflictsList )
:ModalDialog( pParent, "ConflictsDialog", "modules/scalc/ui/conflictsdialog.ui" )
,m_pLbConflictsContainer ( get<SvSimpleTableContainer>("container") )
- ,m_pLbConflicts ( new SvxRedlinTable(*m_pLbConflictsContainer) )
+ ,m_pLbConflicts ( VclPtr<SvxRedlinTable>::Create(*m_pLbConflictsContainer) )
,maStrTitleConflict ( ScResId( STR_TITLE_CONFLICT ) )
,maStrTitleAuthor ( ScResId( STR_TITLE_AUTHOR ) )
,maStrTitleDate ( ScResId( STR_TITLE_DATE ) )
@@ -442,6 +442,18 @@ ScConflictsDlg::ScConflictsDlg( vcl::Window* pParent, ScViewData* pViewData, ScD
ScConflictsDlg::~ScConflictsDlg()
{
+ disposeOnce();
+}
+
+void ScConflictsDlg::dispose()
+{
+ m_pLbConflictsContainer.clear();
+ m_pLbConflicts.disposeAndClear();
+ m_pBtnKeepMine.clear();
+ m_pBtnKeepOther.clear();
+ m_pBtnKeepAllMine.clear();
+ m_pBtnKeepAllOthers.clear();
+ ModalDialog::dispose();
}
OUString ScConflictsDlg::GetConflictString( const ScConflictsListEntry& rConflictEntry )
diff --git a/sc/source/ui/miscdlgs/crdlg.cxx b/sc/source/ui/miscdlgs/crdlg.cxx
index 5d5e833ca768..497a76ecfa8a 100644
--- a/sc/source/ui/miscdlgs/crdlg.cxx
+++ b/sc/source/ui/miscdlgs/crdlg.cxx
@@ -44,6 +44,21 @@ ScColOrRowDlg::ScColOrRowDlg(vcl::Window* pParent, const OUString& rStrTitle,
m_pBtnOk->SetClickHdl( LINK( this, ScColOrRowDlg, OkHdl ) );
}
+ScColOrRowDlg::~ScColOrRowDlg()
+{
+ disposeOnce();
+}
+
+void ScColOrRowDlg::dispose()
+{
+ m_pFrame.clear();
+ m_pBtnRows.clear();
+ m_pBtnCols.clear();
+ m_pBtnOk.clear();
+ ModalDialog::dispose();
+}
+
+
IMPL_LINK_NOARG_INLINE_START(ScColOrRowDlg, OkHdl)
{
EndDialog( m_pBtnCols->IsChecked() ? SCRET_COLS : SCRET_ROWS );
diff --git a/sc/source/ui/miscdlgs/crnrdlg.cxx b/sc/source/ui/miscdlgs/crnrdlg.cxx
index 6510dc13290e..c2195145d446 100644
--- a/sc/source/ui/miscdlgs/crnrdlg.cxx
+++ b/sc/source/ui/miscdlgs/crnrdlg.cxx
@@ -74,6 +74,24 @@ ScColRowNameRangesDlg::ScColRowNameRangesDlg( SfxBindings* pB,
ScColRowNameRangesDlg::~ScColRowNameRangesDlg()
{
+ disposeOnce();
+}
+
+void ScColRowNameRangesDlg::dispose()
+{
+ pLbRange.clear();
+ pEdAssign.clear();
+ pRbAssign.clear();
+ pBtnColHead.clear();
+ pBtnRowHead.clear();
+ pEdAssign2.clear();
+ pRbAssign2.clear();
+ pBtnOk.clear();
+ pBtnCancel.clear();
+ pBtnAdd.clear();
+ pBtnRemove.clear();
+ pEdActive.clear();
+ ScAnyRefDlg::dispose();
}
// initialises event handlers and start parameters in the dialog
@@ -475,7 +493,7 @@ void ScColRowNameRangesDlg::UpdateRangeData( const ScRange& rRange, bool bColNam
bool ScColRowNameRangesDlg::IsRefInputMode() const
{
- return (pEdActive != NULL);
+ return (pEdActive != nullptr);
}
// Handler:
diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx b/sc/source/ui/miscdlgs/datafdlg.cxx
index 0d3f58d4fda0..5b1d6c8f2d6f 100644
--- a/sc/source/ui/miscdlgs/datafdlg.cxx
+++ b/sc/source/ui/miscdlgs/datafdlg.cxx
@@ -154,30 +154,30 @@ ScDataFormDlg::ScDataFormDlg(vcl::Window* pParent, ScTabViewShell* pTabViewShell
int nColWidth = pDoc->GetColWidth( nIndex + nStartCol, nTab );
if (nColWidth)
{
- maFixedTexts.push_back( new FixedText(m_pGrid) );
- maEdits.push_back( new Edit(m_pGrid, WB_BORDER) );
+ maFixedTexts.push_back( VclPtr<FixedText>::Create(m_pGrid) );
+ maEdits.push_back( VclPtr<Edit>::Create(m_pGrid, WB_BORDER) );
- maFixedTexts[nIndex].set_grid_left_attach(0);
- maEdits[nIndex].set_grid_left_attach(1);
- maFixedTexts[nIndex].set_grid_top_attach(nGridRow);
- maEdits[nIndex].set_grid_top_attach(nGridRow);
+ maFixedTexts[nIndex]->set_grid_left_attach(0);
+ maEdits[nIndex]->set_grid_left_attach(1);
+ maFixedTexts[nIndex]->set_grid_top_attach(nGridRow);
+ maEdits[nIndex]->set_grid_top_attach(nGridRow);
- maEdits[nIndex].SetWidthInChars(32);
- maEdits[nIndex].set_hexpand(true);
+ maEdits[nIndex]->SetWidthInChars(32);
+ maEdits[nIndex]->set_hexpand(true);
++nGridRow;
- maFixedTexts[nIndex].SetText(aFieldName);
- maFixedTexts[nIndex].Show();
- maEdits[nIndex].Show();
+ maFixedTexts[nIndex]->SetText(aFieldName);
+ maFixedTexts[nIndex]->Show();
+ maEdits[nIndex]->Show();
}
else
{
maFixedTexts.push_back( NULL );
maEdits.push_back( NULL );
}
- if (!maEdits.is_null(nIndex))
- maEdits[nIndex].SetModifyHdl( HDL(Impl_DataModifyHdl) );
+ if (maEdits[nIndex] != nullptr)
+ maEdits[nIndex]->SetModifyHdl( HDL(Impl_DataModifyHdl) );
}
}
@@ -204,22 +204,36 @@ ScDataFormDlg::ScDataFormDlg(vcl::Window* pParent, ScTabViewShell* pTabViewShell
ScDataFormDlg::~ScDataFormDlg()
{
+ disposeOnce();
+}
+void ScDataFormDlg::dispose()
+{
+ m_pBtnNew.clear();
+ m_pBtnDelete.clear();
+ m_pBtnRestore.clear();
+ m_pBtnPrev.clear();
+ m_pBtnNext.clear();
+ m_pBtnClose.clear();
+ m_pSlider.clear();
+ m_pGrid.clear();
+ m_pFixedText.clear();
+ ModalDialog::dispose();
}
void ScDataFormDlg::FillCtrls(SCROW /*nCurrentRow*/)
{
for (sal_uInt16 i = 0; i < aColLength; ++i)
{
- if (!maEdits.is_null(i))
+ if (maEdits[i] != nullptr)
{
if (nCurrentRow<=nEndRow && pDoc)
{
OUString aFieldName(pDoc->GetString(i + nStartCol, nCurrentRow, nTab));
- maEdits[i].SetText(aFieldName);
+ maEdits[i]->SetText(aFieldName);
}
else
- maEdits[i].SetText(OUString());
+ maEdits[i]->SetText(OUString());
}
}
@@ -251,10 +265,10 @@ IMPL_LINK_NOARG(ScDataFormDlg, Impl_NewHdl)
if ( pDoc )
{
bool bHasData = false;
- boost::ptr_vector<Edit>::iterator itr = maEdits.begin(), itrEnd = maEdits.end();
+ auto itr = maEdits.begin(), itrEnd = maEdits.end();
for(; itr != itrEnd; ++itr)
- if (!boost::is_null(itr))
- if ( !(*itr).GetText().isEmpty() )
+ if ((*itr) != nullptr)
+ if ( !(*itr)->GetText().isEmpty() )
{
bHasData = true;
break;
@@ -367,8 +381,8 @@ void ScDataFormDlg::SetButtonState()
m_pBtnPrev->Enable( true );
m_pBtnRestore->Enable( false );
- if ( maEdits.size()>=1 && !maEdits.is_null(0) )
- maEdits[0].GrabFocus();
+ if ( maEdits.size()>=1 && maEdits[0] != nullptr )
+ maEdits[0]->GrabFocus();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/datastreamdlg.cxx b/sc/source/ui/miscdlgs/datastreamdlg.cxx
index 345293b81201..7f6c826a46de 100644
--- a/sc/source/ui/miscdlgs/datastreamdlg.cxx
+++ b/sc/source/ui/miscdlgs/datastreamdlg.cxx
@@ -52,6 +52,33 @@ DataStreamDlg::DataStreamDlg(ScDocShell *pDocShell, vcl::Window* pParent)
UpdateEnable();
}
+DataStreamDlg::~DataStreamDlg()
+{
+ disposeOnce();
+}
+
+void DataStreamDlg::dispose()
+{
+ m_pCbUrl.clear();
+ m_pBtnBrowse.clear();
+ m_pRBDirectData.clear();
+ m_pRBScriptData.clear();
+ m_pRBValuesInLine.clear();
+ m_pRBAddressValue.clear();
+ m_pCBRefreshOnEmpty.clear();
+ m_pRBDataDown.clear();
+ m_pRBRangeDown.clear();
+ m_pRBNoMove.clear();
+ m_pRBMaxLimit.clear();
+ m_pRBUnlimited.clear();
+ m_pEdRange.clear();
+ m_pEdLimit.clear();
+ m_pBtnOk.clear();
+ m_pVclFrameLimit.clear();
+ m_pVclFrameMove.clear();
+ ModalDialog::dispose();
+}
+
IMPL_LINK_NOARG(DataStreamDlg, BrowseHdl)
{
sfx2::FileDialogHelper aFileDialog(0, 0);
diff --git a/sc/source/ui/miscdlgs/delcldlg.cxx b/sc/source/ui/miscdlgs/delcldlg.cxx
index 06e43a4b5e19..a618d802909f 100644
--- a/sc/source/ui/miscdlgs/delcldlg.cxx
+++ b/sc/source/ui/miscdlgs/delcldlg.cxx
@@ -57,6 +57,21 @@ ScDeleteCellDlg::ScDeleteCellDlg(vcl::Window* pParent, bool bDisallowCellMove)
}
}
+ScDeleteCellDlg::~ScDeleteCellDlg()
+{
+ disposeOnce();
+}
+
+void ScDeleteCellDlg::dispose()
+{
+ m_pBtnCellsUp.clear();
+ m_pBtnCellsLeft.clear();
+ m_pBtnDelRows.clear();
+ m_pBtnDelCols.clear();
+ ModalDialog::dispose();
+}
+
+
DelCellCmd ScDeleteCellDlg::GetDelCellCmd() const
{
DelCellCmd nReturn = DEL_NONE;
diff --git a/sc/source/ui/miscdlgs/delcodlg.cxx b/sc/source/ui/miscdlgs/delcodlg.cxx
index 21eccac2c1b1..911af874bcbb 100644
--- a/sc/source/ui/miscdlgs/delcodlg.cxx
+++ b/sc/source/ui/miscdlgs/delcodlg.cxx
@@ -71,6 +71,25 @@ ScDeleteContentsDlg::ScDeleteContentsDlg( vcl::Window* pParent,
aBtnDelAll->SetClickHdl( LINK( this, ScDeleteContentsDlg, DelAllHdl ) );
}
+ScDeleteContentsDlg::~ScDeleteContentsDlg()
+{
+ disposeOnce();
+}
+
+void ScDeleteContentsDlg::dispose()
+{
+ aBtnDelAll.clear();
+ aBtnDelStrings.clear();
+ aBtnDelNumbers.clear();
+ aBtnDelDateTime.clear();
+ aBtnDelFormulas.clear();
+ aBtnDelNotes.clear();
+ aBtnDelAttrs.clear();
+ aBtnDelObjects.clear();
+ aBtnOk.clear();
+ ModalDialog::dispose();
+}
+
InsertDeleteFlags ScDeleteContentsDlg::GetDelContentsCmdBits() const
{
ScDeleteContentsDlg::nPreviousChecks = IDF_NONE;
@@ -139,8 +158,4 @@ IMPL_LINK_NOARG_INLINE_START(ScDeleteContentsDlg, DelAllHdl)
}
IMPL_LINK_NOARG_INLINE_END(ScDeleteContentsDlg, DelAllHdl)
-ScDeleteContentsDlg::~ScDeleteContentsDlg()
-{
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/filldlg.cxx b/sc/source/ui/miscdlgs/filldlg.cxx
index 9067a15bb28c..4a0113d85e7d 100644
--- a/sc/source/ui/miscdlgs/filldlg.cxx
+++ b/sc/source/ui/miscdlgs/filldlg.cxx
@@ -76,6 +76,32 @@ ScFillSeriesDlg::ScFillSeriesDlg( vcl::Window* pParent,
ScFillSeriesDlg::~ScFillSeriesDlg()
{
+ disposeOnce();
+}
+
+void ScFillSeriesDlg::dispose()
+{
+ m_pFtStartVal.clear();
+ m_pEdStartVal.clear();
+ m_pFtEndVal.clear();
+ m_pEdEndVal.clear();
+ m_pFtIncrement.clear();
+ m_pEdIncrement.clear();
+ m_pBtnDown.clear();
+ m_pBtnRight.clear();
+ m_pBtnUp.clear();
+ m_pBtnLeft.clear();
+ m_pBtnArithmetic.clear();
+ m_pBtnGeometric.clear();
+ m_pBtnDate.clear();
+ m_pBtnAutoFill.clear();
+ m_pFtTimeUnit.clear();
+ m_pBtnDay.clear();
+ m_pBtnDayOfWeek.clear();
+ m_pBtnMonth.clear();
+ m_pBtnYear.clear();
+ m_pBtnOk.clear();
+ ModalDialog::dispose();
}
void ScFillSeriesDlg::SetEdStartValEnabled(bool bFlag)
diff --git a/sc/source/ui/miscdlgs/groupdlg.cxx b/sc/source/ui/miscdlgs/groupdlg.cxx
index 62b726b41570..0b85da75efd6 100644
--- a/sc/source/ui/miscdlgs/groupdlg.cxx
+++ b/sc/source/ui/miscdlgs/groupdlg.cxx
@@ -42,13 +42,21 @@ ScGroupDlg::ScGroupDlg(vcl::Window* pParent, bool bUngroup, bool bRows)
m_pBtnRows->GrabFocus();
}
-bool ScGroupDlg::GetColsChecked() const
+ScGroupDlg::~ScGroupDlg()
{
- return m_pBtnCols->IsChecked();
+ disposeOnce();
}
-ScGroupDlg::~ScGroupDlg()
+void ScGroupDlg::dispose()
{
+ m_pBtnRows.clear();
+ m_pBtnCols.clear();
+ ModalDialog::dispose();
+}
+
+bool ScGroupDlg::GetColsChecked() const
+{
+ return m_pBtnCols->IsChecked();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/highred.cxx b/sc/source/ui/miscdlgs/highred.cxx
index bddfdef57fc0..8141ca08aa03 100644
--- a/sc/source/ui/miscdlgs/highred.cxx
+++ b/sc/source/ui/miscdlgs/highred.cxx
@@ -46,7 +46,7 @@ ScHighlightChgDlg::ScHighlightChgDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl:
, pDoc(ptrViewData->GetDocument())
, aLocalRangeName(*(pDoc->GetRangeName()))
{
- m_pFilterCtr = new SvxTPFilter(get<VclContainer>("box"));
+ m_pFilterCtr = VclPtr<SvxTPFilter>::Create(get<VclContainer>("box"));
get(m_pHighlightBox, "showchanges");
get(m_pCbAccept, "showaccepted");
get(m_pCbReject, "showrejected");
@@ -69,8 +69,20 @@ ScHighlightChgDlg::ScHighlightChgDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl:
ScHighlightChgDlg::~ScHighlightChgDlg()
{
+ disposeOnce();
+}
+
+void ScHighlightChgDlg::dispose()
+{
SetDispatcherLock( false );
- delete m_pFilterCtr;
+ m_pFilterCtr.disposeAndClear();
+ m_pHighlightBox.clear();
+ m_pCbAccept.clear();
+ m_pCbReject.clear();
+ m_pOkButton.clear();
+ m_pEdAssign.clear();
+ m_pRbAssign.clear();
+ ScAnyRefDlg::dispose();
}
void ScHighlightChgDlg::Init()
diff --git a/sc/source/ui/miscdlgs/inscldlg.cxx b/sc/source/ui/miscdlgs/inscldlg.cxx
index b2f805974027..001d0778f931 100644
--- a/sc/source/ui/miscdlgs/inscldlg.cxx
+++ b/sc/source/ui/miscdlgs/inscldlg.cxx
@@ -58,6 +58,20 @@ ScInsertCellDlg::ScInsertCellDlg( vcl::Window* pParent,bool bDisallowCellMove) :
}
}
+ScInsertCellDlg::~ScInsertCellDlg()
+{
+ disposeOnce();
+}
+
+void ScInsertCellDlg::dispose()
+{
+ m_pBtnCellsDown.clear();
+ m_pBtnCellsRight.clear();
+ m_pBtnInsRow.clear();
+ m_pBtnInsCol.clear();
+ ModalDialog::dispose();
+}
+
InsCellCmd ScInsertCellDlg::GetInsCellCmd() const
{
InsCellCmd nReturn = INS_NONE;
@@ -86,8 +100,4 @@ InsCellCmd ScInsertCellDlg::GetInsCellCmd() const
return nReturn;
}
-ScInsertCellDlg::~ScInsertCellDlg()
-{
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/inscodlg.cxx b/sc/source/ui/miscdlgs/inscodlg.cxx
index 75e5bac2574f..6d7d1ce1249e 100644
--- a/sc/source/ui/miscdlgs/inscodlg.cxx
+++ b/sc/source/ui/miscdlgs/inscodlg.cxx
@@ -361,6 +361,11 @@ IMPL_LINK_NOARG(ScInsertContentsDlg, LinkBtnHdl)
ScInsertContentsDlg::~ScInsertContentsDlg()
{
+ disposeOnce();
+}
+
+void ScInsertContentsDlg::dispose()
+{
ScInsertContentsDlg::nPreviousChecks2 = 0;
if(mpBtnSkipEmptyCells->IsChecked())
ScInsertContentsDlg::nPreviousChecks2 |= INS_CONT_NOEMPTY;
@@ -378,6 +383,29 @@ ScInsertContentsDlg::~ScInsertContentsDlg()
else if ( mpRbMoveRight->IsChecked() )
ScInsertContentsDlg::nPreviousMoveMode = INS_CELLSRIGHT;
}
+ mpBtnInsAll.clear();
+ mpBtnInsStrings.clear();
+ mpBtnInsNumbers.clear();
+ mpBtnInsDateTime.clear();
+ mpBtnInsFormulas.clear();
+ mpBtnInsNotes.clear();
+ mpBtnInsAttrs.clear();
+ mpBtnInsObjects.clear();
+ mpBtnSkipEmptyCells.clear();
+ mpBtnTranspose.clear();
+ mpBtnLink.clear();
+ mpRbNoOp.clear();
+ mpRbAdd.clear();
+ mpRbSub.clear();
+ mpRbMul.clear();
+ mpRbDiv.clear();
+ mpRbMoveNone.clear();
+ mpRbMoveDown.clear();
+ mpRbMoveRight.clear();
+ mpBtnShortCutPasteValuesOnly.clear();
+ mpBtnShortCutPasteValuesFormats.clear();
+ mpBtnShortCutPasteTranspose.clear();
+ ModalDialog::dispose();
}
sal_uInt16 ScInsertContentsDlg::GetFormulaCmdBits() const
diff --git a/sc/source/ui/miscdlgs/instbdlg.cxx b/sc/source/ui/miscdlgs/instbdlg.cxx
index eda2e79bb4dd..27825d3198a9 100644
--- a/sc/source/ui/miscdlgs/instbdlg.cxx
+++ b/sc/source/ui/miscdlgs/instbdlg.cxx
@@ -64,9 +64,28 @@ ScInsertTableDlg::ScInsertTableDlg( vcl::Window* pParent, ScViewData& rData, SCT
ScInsertTableDlg::~ScInsertTableDlg()
{
+ disposeOnce();
+}
+
+void ScInsertTableDlg::dispose()
+{
if (pDocShTables)
pDocShTables->DoClose();
delete pDocInserter;
+ m_pBtnBefore.clear();
+ m_pBtnBehind.clear();
+ m_pBtnNew.clear();
+ m_pBtnFromFile.clear();
+ m_pFtCount.clear();
+ m_pNfCount.clear();
+ m_pFtName.clear();
+ m_pEdName.clear();
+ m_pLbTables.clear();
+ m_pFtPath.clear();
+ m_pBtnBrowse.clear();
+ m_pBtnLink.clear();
+ m_pBtnOk.clear();
+ ModalDialog::dispose();
}
void ScInsertTableDlg::Init_Impl( bool bFromFile )
diff --git a/sc/source/ui/miscdlgs/lbseldlg.cxx b/sc/source/ui/miscdlgs/lbseldlg.cxx
index 9fd2f570c257..2528212d3776 100644
--- a/sc/source/ui/miscdlgs/lbseldlg.cxx
+++ b/sc/source/ui/miscdlgs/lbseldlg.cxx
@@ -41,6 +41,18 @@ ScSelEntryDlg::ScSelEntryDlg(vcl::Window* pParent, const std::vector<OUString>
m_pLb->SelectEntryPos( 0 );
}
+ScSelEntryDlg::~ScSelEntryDlg()
+{
+ disposeOnce();
+}
+
+void ScSelEntryDlg::dispose()
+{
+ m_pLb.clear();
+ ModalDialog::dispose();
+}
+
+
OUString ScSelEntryDlg::GetSelectEntry() const
{
return m_pLb->GetSelectEntry();
diff --git a/sc/source/ui/miscdlgs/linkarea.cxx b/sc/source/ui/miscdlgs/linkarea.cxx
index cf09932f6247..51402b17cffb 100644
--- a/sc/source/ui/miscdlgs/linkarea.cxx
+++ b/sc/source/ui/miscdlgs/linkarea.cxx
@@ -62,7 +62,20 @@ ScLinkedAreaDlg::ScLinkedAreaDlg(vcl::Window* pParent)
ScLinkedAreaDlg::~ScLinkedAreaDlg()
{
+ disposeOnce();
+}
+
+void ScLinkedAreaDlg::dispose()
+{
// pSourceShell is deleted by aSourceRef
+ m_pCbUrl.clear();
+ m_pBtnBrowse.clear();
+ m_pLbRanges.clear();
+ m_pBtnReload.clear();
+ m_pNfDelay.clear();
+ m_pFtSeconds.clear();
+ m_pBtnOk.clear();
+ ModalDialog::dispose();
}
short ScLinkedAreaDlg::Execute()
diff --git a/sc/source/ui/miscdlgs/mtrindlg.cxx b/sc/source/ui/miscdlgs/mtrindlg.cxx
index 7651d8310bd8..ce23d3797014 100644
--- a/sc/source/ui/miscdlgs/mtrindlg.cxx
+++ b/sc/source/ui/miscdlgs/mtrindlg.cxx
@@ -58,6 +58,18 @@ ScMetricInputDlg::ScMetricInputDlg( vcl::Window* pParent,
m_pBtnDefVal->Check( nCurrentValue == nDefaultValue );
}
+ScMetricInputDlg::~ScMetricInputDlg()
+{
+ disposeOnce();
+}
+
+void ScMetricInputDlg::dispose()
+{
+ m_pEdValue.clear();
+ m_pBtnDefVal.clear();
+ ModalDialog::dispose();
+}
+
long ScMetricInputDlg::GetInputValue( FieldUnit eUnit ) const
{
/*
diff --git a/sc/source/ui/miscdlgs/mvtabdlg.cxx b/sc/source/ui/miscdlgs/mvtabdlg.cxx
index 32d997b971b2..995aa7267e49 100644
--- a/sc/source/ui/miscdlgs/mvtabdlg.cxx
+++ b/sc/source/ui/miscdlgs/mvtabdlg.cxx
@@ -65,6 +65,19 @@ ScMoveTableDlg::ScMoveTableDlg(vcl::Window* pParent, const OUString& rDefault)
ScMoveTableDlg::~ScMoveTableDlg()
{
+ disposeOnce();
+}
+
+void ScMoveTableDlg::dispose()
+{
+ pBtnMove.clear();
+ pBtnCopy.clear();
+ pLbDoc.clear();
+ pLbTable.clear();
+ pEdTabName.clear();
+ pFtWarn.clear();
+ pBtnOk.clear();
+ ModalDialog::dispose();
}
void ScMoveTableDlg::GetTabNameString( OUString& rString ) const
diff --git a/sc/source/ui/miscdlgs/namecrea.cxx b/sc/source/ui/miscdlgs/namecrea.cxx
index 4ae99df8007a..09c821c1c75d 100644
--- a/sc/source/ui/miscdlgs/namecrea.cxx
+++ b/sc/source/ui/miscdlgs/namecrea.cxx
@@ -35,6 +35,20 @@ ScNameCreateDlg::ScNameCreateDlg( vcl::Window * pParent, sal_uInt16 nFlags )
m_pRightBox->Check ( (nFlags & NAME_RIGHT) != 0 );
}
+ScNameCreateDlg::~ScNameCreateDlg()
+{
+ disposeOnce();
+}
+
+void ScNameCreateDlg::dispose()
+{
+ m_pTopBox.clear();
+ m_pLeftBox.clear();
+ m_pBottomBox.clear();
+ m_pRightBox.clear();
+ ModalDialog::dispose();
+}
+
sal_uInt16 ScNameCreateDlg::GetFlags() const
{
sal_uInt16 nResult = 0;
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx
index e65e0cbae03b..9b4f998f56fe 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -53,6 +53,18 @@ ScSolverProgressDialog::ScSolverProgressDialog(vcl::Window* pParent)
get(m_pFtTime, "progress");
}
+ScSolverProgressDialog::~ScSolverProgressDialog()
+{
+ disposeOnce();
+}
+
+void ScSolverProgressDialog::dispose()
+{
+ m_pFtTime.clear();
+ ModelessDialog::dispose();
+}
+
+
void ScSolverProgressDialog::HideTimeLimit()
{
m_pFtTime->Hide();
@@ -72,6 +84,17 @@ ScSolverNoSolutionDialog::ScSolverNoSolutionDialog( vcl::Window* pParent, const
m_pFtErrorText->SetText(rErrorText);
}
+ScSolverNoSolutionDialog::~ScSolverNoSolutionDialog()
+{
+ disposeOnce();
+}
+
+void ScSolverNoSolutionDialog::dispose()
+{
+ m_pFtErrorText.clear();
+ ModalDialog::dispose();
+}
+
ScSolverSuccessDialog::ScSolverSuccessDialog( vcl::Window* pParent, const OUString& rSolution )
: ModalDialog(pParent, "SolverSuccessDialog", "modules/scalc/ui/solversuccessdialog.ui")
{
@@ -84,6 +107,19 @@ ScSolverSuccessDialog::ScSolverSuccessDialog( vcl::Window* pParent, const OUStri
m_pFtResult->SetText(aMessage);
}
+ScSolverSuccessDialog::~ScSolverSuccessDialog()
+{
+ disposeOnce();
+}
+
+void ScSolverSuccessDialog::dispose()
+{
+ m_pFtResult.clear();
+ m_pBtnOk.clear();
+ m_pBtnCancel.clear();
+ ModalDialog::dispose();
+}
+
IMPL_LINK( ScSolverSuccessDialog, ClickHdl, PushButton*, pBtn )
{
if (pBtn == m_pBtnOk)
@@ -101,7 +137,7 @@ ScCursorRefEdit::ScCursorRefEdit( vcl::Window* pParent, vcl::Window *pLabel )
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeScCursorRefEdit(vcl::Window *pParent,
VclBuilder::stringmap &)
{
- return new ScCursorRefEdit(pParent, NULL);
+ return new ScCursorRefEdit(pParent, nullptr);
}
void ScCursorRefEdit::SetCursorLinks( const Link& rUp, const Link& rDown )
@@ -267,6 +303,63 @@ ScOptSolverDlg::ScOptSolverDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Windo
ScOptSolverDlg::~ScOptSolverDlg()
{
+ disposeOnce();
+}
+
+void ScOptSolverDlg::dispose()
+{
+ m_pFtObjectiveCell.clear();
+ m_pEdObjectiveCell.clear();
+ m_pRBObjectiveCell.clear();
+ m_pRbMax.clear();
+ m_pRbMin.clear();
+ m_pRbValue.clear();
+ m_pEdTargetValue.clear();
+ m_pRBTargetValue.clear();
+ m_pFtVariableCells.clear();
+ m_pEdVariableCells.clear();
+ m_pRBVariableCells.clear();
+ m_pFtCellRef.clear();
+ m_pEdLeft1.clear();
+ m_pRBLeft1.clear();
+ m_pFtOperator.clear();
+ m_pLbOp1.clear();
+ m_pFtConstraint.clear();
+ m_pEdRight1.clear();
+ m_pRBRight1.clear();
+ m_pBtnDel1.clear();
+ m_pEdLeft2.clear();
+ m_pRBLeft2.clear();
+ m_pLbOp2.clear();
+ m_pEdRight2.clear();
+ m_pRBRight2.clear();
+ m_pBtnDel2.clear();
+ m_pEdLeft3.clear();
+ m_pRBLeft3.clear();
+ m_pLbOp3.clear();
+ m_pEdRight3.clear();
+ m_pRBRight3.clear();
+ m_pBtnDel3.clear();
+ m_pEdLeft4.clear();
+ m_pRBLeft4.clear();
+ m_pLbOp4.clear();
+ m_pEdRight4.clear();
+ m_pRBRight4.clear();
+ m_pBtnDel4.clear();
+ m_pScrollBar.clear();
+ m_pBtnOpt.clear();
+ m_pBtnCancel.clear();
+ m_pBtnSolve.clear();
+ mpEdActive.clear();
+ for (auto p : mpLeftButton)
+ p.clear();
+ for (auto p : mpRightButton)
+ p.clear();
+ for (auto p : mpOperator)
+ p.clear();
+ for (auto p : mpDelButton)
+ p.clear();
+ ScAnyRefDlg::dispose();
}
void ScOptSolverDlg::Init(const ScAddress& rCursorPos)
@@ -506,7 +599,7 @@ void ScOptSolverDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
bool ScOptSolverDlg::IsRefInputMode() const
{
- return mpEdActive != NULL;
+ return mpEdActive != nullptr;
}
// Handler:
@@ -543,8 +636,8 @@ IMPL_LINK( ScOptSolverDlg, BtnHdl, PushButton*, pBtn )
else if ( pBtn == m_pBtnOpt )
{
//! move options dialog to UI lib?
- boost::scoped_ptr<ScSolverOptionsDialog> pOptDlg(
- new ScSolverOptionsDialog( this, maImplNames, maDescriptions, maEngine, maProperties ));
+ ScopedVclPtr<ScSolverOptionsDialog> pOptDlg(
+ VclPtr<ScSolverOptionsDialog>::Create( this, maImplNames, maDescriptions, maEngine, maProperties ));
if ( pOptDlg->Execute() == RET_OK )
{
maEngine = pOptDlg->GetEngine();
@@ -569,11 +662,11 @@ IMPL_LINK( ScOptSolverDlg, GetFocusHdl, Control*, pCtrl )
for ( sal_uInt16 nRow = 0; nRow < EDIT_ROW_COUNT; ++nRow )
{
if( pCtrl == mpLeftEdit[nRow] || pCtrl == mpLeftButton[nRow] )
- pEdit = mpEdActive = mpLeftEdit[nRow];
+ pEdit = mpEdActive = mpLeftEdit[nRow].get();
else if( pCtrl == mpRightEdit[nRow] || pCtrl == mpRightButton[nRow] )
- pEdit = mpEdActive = mpRightEdit[nRow];
+ pEdit = mpEdActive = mpRightEdit[nRow].get();
else if( pCtrl == mpOperator[nRow] ) // focus on "operator" list box
- mpEdActive = mpRightEdit[nRow]; // use right edit for ref input, but don't change selection
+ mpEdActive = mpRightEdit[nRow].get(); // use right edit for ref input, but don't change selection
}
if( pCtrl == m_pRbValue ) // focus on "Value of" radio button
mpEdActive = m_pEdTargetValue; // use value edit for ref input, but don't change selection
@@ -609,7 +702,7 @@ IMPL_LINK( ScOptSolverDlg, DelBtnHdl, PushButton*, pBtn )
// If the button is disabled, focus would normally move to the next control,
// (left edit of the next row). Move it to left edit of this row instead.
- mpEdActive = mpLeftEdit[nRow];
+ mpEdActive = mpLeftEdit[nRow].get();
mpEdActive->GrabFocus();
}
}
@@ -768,15 +861,15 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal
{
// show progress dialog
- ScSolverProgressDialog aProgress( this );
+ ScopedVclPtrInstance< ScSolverProgressDialog > aProgress( this );
sal_Int32 nTimeout = 0;
if ( FindTimeout( nTimeout ) )
- aProgress.SetTimeLimit( nTimeout );
+ aProgress->SetTimeLimit( nTimeout );
else
- aProgress.HideTimeLimit();
- aProgress.Show();
- aProgress.Update();
- aProgress.Sync();
+ aProgress->HideTimeLimit();
+ aProgress->Show();
+ aProgress->Update();
+ aProgress->Sync();
// try to make sure the progress dialog is painted before continuing
Application::Reschedule(true);
@@ -967,7 +1060,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal
xSolver->solve();
bool bSuccess = xSolver->getSuccess();
- aProgress.Hide();
+ aProgress->Hide();
bool bClose = false;
bool bRestore = true; // restore old values unless a solution is accepted
if ( bSuccess )
@@ -993,8 +1086,8 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal
static_cast<SCCOL>(aObjective.Column), static_cast<SCROW>(aObjective.Row),
static_cast<SCTAB>(aObjective.Sheet));
- ScSolverSuccessDialog aDialog( this, aResultStr );
- if ( aDialog.Execute() == RET_OK )
+ ScopedVclPtrInstance< ScSolverSuccessDialog > aDialog( this, aResultStr );
+ if ( aDialog->Execute() == RET_OK )
{
// keep results and close dialog
bRestore = false;
@@ -1007,8 +1100,8 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal
uno::Reference<sheet::XSolverDescription> xDesc( xSolver, uno::UNO_QUERY );
if ( xDesc.is() )
aError = xDesc->getStatusDescription(); // error description from component
- ScSolverNoSolutionDialog aDialog( this, aError );
- aDialog.Execute();
+ ScopedVclPtrInstance< ScSolverNoSolutionDialog > aDialog( this, aError );
+ aDialog->Execute();
}
if ( bRestore ) // restore old values
diff --git a/sc/source/ui/miscdlgs/protectiondlg.cxx b/sc/source/ui/miscdlgs/protectiondlg.cxx
index 5c2e89582887..cf552f41f0e7 100644
--- a/sc/source/ui/miscdlgs/protectiondlg.cxx
+++ b/sc/source/ui/miscdlgs/protectiondlg.cxx
@@ -50,6 +50,19 @@ ScTableProtectionDlg::ScTableProtectionDlg(vcl::Window* pParent)
ScTableProtectionDlg::~ScTableProtectionDlg()
{
+ disposeOnce();
+}
+
+void ScTableProtectionDlg::dispose()
+{
+ m_pBtnProtect.clear();
+ m_pPasswords.clear();
+ m_pOptions.clear();
+ m_pPassword1Edit.clear();
+ m_pPassword2Edit.clear();
+ m_pOptionsListBox.clear();
+ m_pBtnOk.clear();
+ ModalDialog::dispose();
}
short ScTableProtectionDlg::Execute()
diff --git a/sc/source/ui/miscdlgs/retypepassdlg.cxx b/sc/source/ui/miscdlgs/retypepassdlg.cxx
index d804ea16a353..60be4c415bcf 100644
--- a/sc/source/ui/miscdlgs/retypepassdlg.cxx
+++ b/sc/source/ui/miscdlgs/retypepassdlg.cxx
@@ -54,22 +54,32 @@ ScRetypePassDlg::ScRetypePassDlg(vcl::Window* pParent) :
ScRetypePassDlg::~ScRetypePassDlg()
{
+ disposeOnce();
+}
+
+void ScRetypePassDlg::dispose()
+{
DeleteSheets();
+ mpBtnOk.clear();
+ mpTextDocStatus.clear();
+ mpBtnRetypeDoc.clear();
+ mpSheetsBox.clear();
+ ModalDialog::dispose();
}
void ScRetypePassDlg::DeleteSheets()
{
- for(std::vector<VclHBox*>::iterator it = maSheets.begin(); it != maSheets.end(); ++it)
+ for(auto it = maSheets.begin(); it != maSheets.end(); ++it)
{
- vcl::Window *pWindow = (*it);
+ VclPtr<vcl::Window> pWindow = (*it);
vcl::Window *pChild = pWindow->GetWindow(WINDOW_FIRSTCHILD);
while (pChild)
{
- vcl::Window *pOldChild = pChild;
+ VclPtr<vcl::Window> pOldChild = pChild;
pChild = pChild->GetWindow(WINDOW_NEXT);
- delete pOldChild;
+ pOldChild.disposeAndClear();
}
- delete pWindow;
+ pWindow.disposeAndClear();
}
}
@@ -100,17 +110,17 @@ void ScRetypePassDlg::SetDataFromDocument(const ScDocument& rDoc)
aTabItem.mpProtect.reset(new ScTableProtection(*pTabProtect));
maTableItems.push_back(aTabItem);
- VclHBox* pSheet = new VclHBox(mpSheetsBox, false, 12);
+ VclPtr<VclHBox> pSheet = VclPtr<VclHBox>::Create(mpSheetsBox, false, 12);
pSheet->Show(true);
- FixedText* pFtSheetName = new FixedText(pSheet);
+ VclPtr<FixedText> pFtSheetName = VclPtr<FixedText>::Create(pSheet);
pFtSheetName->Show(true);
pFtSheetName->SetStyle(WB_VCENTER);
- FixedText* pFtSheetStatus = new FixedText(pSheet);
+ FixedText* pFtSheetStatus = VclPtr<FixedText>::Create(pSheet);
pFtSheetStatus->Show(true);
pFtSheetStatus->SetStyle(WB_VCENTER);
- PushButton* pBtnSheet = new PushButton(pSheet);
+ VclPtr<PushButton> pBtnSheet = VclPtr<PushButton>::Create((vcl::Window*)pSheet);
pBtnSheet->SetText(ScResId(STR_RETYPE));
pBtnSheet->SetClickHdl(LINK(this, ScRetypePassDlg, RetypeBtnHdl));
pBtnSheet->Disable();
@@ -283,11 +293,11 @@ IMPL_LINK( ScRetypePassDlg, RetypeBtnHdl, PushButton*, pBtn )
// What the ... !?
return 0;
- ScRetypePassInputDlg aDlg(this, pProtected);
- if (aDlg.Execute() == RET_OK)
+ ScopedVclPtrInstance< ScRetypePassInputDlg > aDlg(this, pProtected);
+ if (aDlg->Execute() == RET_OK)
{
// OK is pressed. Update the protected item.
- if (aDlg.IsRemovePassword())
+ if (aDlg->IsRemovePassword())
{
// Remove password from this item.
pProtected->setPassword(OUString());
@@ -295,7 +305,7 @@ IMPL_LINK( ScRetypePassDlg, RetypeBtnHdl, PushButton*, pBtn )
else
{
// Set a new password.
- OUString aNewPass = aDlg.GetNewPassword();
+ OUString aNewPass = aDlg->GetNewPassword();
pProtected->setPassword(aNewPass);
}
@@ -323,6 +333,19 @@ ScRetypePassInputDlg::ScRetypePassInputDlg(vcl::Window* pParent, ScPassHashProte
ScRetypePassInputDlg::~ScRetypePassInputDlg()
{
+ disposeOnce();
+}
+
+void ScRetypePassInputDlg::dispose()
+{
+ m_pBtnOk.clear();
+ m_pBtnRetypePassword.clear();
+ m_pPasswordGrid.clear();
+ m_pPassword1Edit.clear();
+ m_pPassword2Edit.clear();
+ m_pBtnMatchOldPass.clear();
+ m_pBtnRemovePassword.clear();
+ ModalDialog::dispose();
}
short ScRetypePassInputDlg::Execute()
diff --git a/sc/source/ui/miscdlgs/scuiautofmt.cxx b/sc/source/ui/miscdlgs/scuiautofmt.cxx
index b55b722294c0..6a115706e598 100644
--- a/sc/source/ui/miscdlgs/scuiautofmt.cxx
+++ b/sc/source/ui/miscdlgs/scuiautofmt.cxx
@@ -88,6 +88,29 @@ ScAutoFormatDlg::ScAutoFormatDlg(vcl::Window* pParent,
m_pWndPreview->NotifyChange(it->second);
}
+ScAutoFormatDlg::~ScAutoFormatDlg()
+{
+ disposeOnce();
+}
+
+void ScAutoFormatDlg::dispose()
+{
+ m_pLbFormat.clear();
+ m_pWndPreview.clear();
+ m_pBtnOk.clear();
+ m_pBtnCancel.clear();
+ m_pBtnAdd.clear();
+ m_pBtnRemove.clear();
+ m_pBtnRename.clear();
+ m_pBtnNumFormat.clear();
+ m_pBtnBorder.clear();
+ m_pBtnFont.clear();
+ m_pBtnPattern.clear();
+ m_pBtnAlignment.clear();
+ m_pBtnAdjust.clear();
+ ModalDialog::dispose();
+}
+
void ScAutoFormatDlg::Init()
{
m_pLbFormat->SetSelectHdl( LINK( this, ScAutoFormatDlg, SelFmtHdl ) );
@@ -201,11 +224,11 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, AddHdl)
while ( !bOk )
{
- boost::scoped_ptr<ScStringInputDlg> pDlg(new ScStringInputDlg( this,
- aStrTitle,
- aStrLabel,
- aFormatName,
- HID_SC_ADD_AUTOFMT, HID_SC_AUTOFMT_NAME ));
+ VclPtrInstance<ScStringInputDlg> pDlg( this,
+ aStrTitle,
+ aStrLabel,
+ aFormatName,
+ HID_SC_ADD_AUTOFMT, HID_SC_AUTOFMT_NAME );
if ( pDlg->Execute() == RET_OK )
{
@@ -308,11 +331,11 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, RenameHdl)
OUString aFormatName = m_pLbFormat->GetSelectEntry();
OUString aEntry;
- boost::scoped_ptr<ScStringInputDlg> pDlg(new ScStringInputDlg( this,
- aStrRename,
- aStrLabel,
- aFormatName,
- HID_SC_REN_AFMT_DLG, HID_SC_REN_AFMT_NAME ));
+ VclPtrInstance<ScStringInputDlg> pDlg( this,
+ aStrRename,
+ aStrLabel,
+ aFormatName,
+ HID_SC_REN_AFMT_DLG, HID_SC_REN_AFMT_NAME );
if( pDlg->Execute() == RET_OK )
{
bool bFmtRenamed = false;
diff --git a/sc/source/ui/miscdlgs/sharedocdlg.cxx b/sc/source/ui/miscdlgs/sharedocdlg.cxx
index 35b1fff147fa..9cb3ca29bccb 100644
--- a/sc/source/ui/miscdlgs/sharedocdlg.cxx
+++ b/sc/source/ui/miscdlgs/sharedocdlg.cxx
@@ -83,7 +83,7 @@ ScShareDocumentDlg::ScShareDocumentDlg( vcl::Window* pParent, ScViewData* pViewD
SvSimpleTableContainer *pCtrl = get<SvSimpleTableContainer>("users");
pCtrl->set_height_request(pCtrl->GetTextHeight()*9);
- m_pLbUsers = new ScShareTable(*pCtrl);
+ m_pLbUsers = VclPtr<ScShareTable>::Create(*pCtrl);
m_aStrNoUserData = get<FixedText>("nouserdata")->GetText();
m_aStrUnknownUser = get<FixedText>("unknownuser")->GetText();
@@ -108,7 +108,15 @@ ScShareDocumentDlg::ScShareDocumentDlg( vcl::Window* pParent, ScViewData* pViewD
ScShareDocumentDlg::~ScShareDocumentDlg()
{
- delete m_pLbUsers;
+ disposeOnce();
+}
+
+void ScShareDocumentDlg::dispose()
+{
+ m_pLbUsers.disposeAndClear();
+ m_pCbShare.clear();
+ m_pFtWarning.clear();
+ ModalDialog::dispose();
}
IMPL_LINK_NOARG(ScShareDocumentDlg, ToggleHandle)
diff --git a/sc/source/ui/miscdlgs/shtabdlg.cxx b/sc/source/ui/miscdlgs/shtabdlg.cxx
index 48ed2c95b5ce..7898fc904488 100644
--- a/sc/source/ui/miscdlgs/shtabdlg.cxx
+++ b/sc/source/ui/miscdlgs/shtabdlg.cxx
@@ -37,6 +37,18 @@ ScShowTabDlg::ScShowTabDlg(vcl::Window* pParent)
m_pLb->SetDoubleClickHdl( LINK( this, ScShowTabDlg, DblClkHdl ) );
}
+ScShowTabDlg::~ScShowTabDlg()
+{
+ disposeOnce();
+}
+
+void ScShowTabDlg::dispose()
+{
+ m_pFrame.clear();
+ m_pLb.clear();
+ ModalDialog::dispose();
+}
+
void ScShowTabDlg::SetDescription(
const OUString& rTitle, const OUString& rFixedText,
const OString& rDlgHelpId, const OString& sLbHelpId )
diff --git a/sc/source/ui/miscdlgs/simpref.cxx b/sc/source/ui/miscdlgs/simpref.cxx
index 93cb3e06d96d..866bb129af9d 100644
--- a/sc/source/ui/miscdlgs/simpref.cxx
+++ b/sc/source/ui/miscdlgs/simpref.cxx
@@ -59,7 +59,18 @@ ScSimpleRefDlg::ScSimpleRefDlg(SfxBindings* pB, SfxChildWindow* pCW, vcl::Window
ScSimpleRefDlg::~ScSimpleRefDlg()
{
+ disposeOnce();
+}
+
+void ScSimpleRefDlg::dispose()
+{
SetDispatcherLock( false ); // deactivate modal mode
+ m_pFtAssign.clear();
+ m_pEdAssign.clear();
+ m_pRbAssign.clear();
+ m_pBtnOk.clear();
+ m_pBtnCancel.clear();
+ ScAnyRefDlg::dispose();
}
void ScSimpleRefDlg::FillInfo(SfxChildWinInfo& rWinInfo) const
diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx
index 307bc6734974..447c6a0bd887 100644
--- a/sc/source/ui/miscdlgs/solveroptions.cxx
+++ b/sc/source/ui/miscdlgs/solveroptions.cxx
@@ -159,7 +159,16 @@ ScSolverOptionsDialog::ScSolverOptionsDialog( vcl::Window* pParent,
ScSolverOptionsDialog::~ScSolverOptionsDialog()
{
+ disposeOnce();
+}
+
+void ScSolverOptionsDialog::dispose()
+{
delete mpCheckButtonData;
+ m_pLbEngine.clear();
+ m_pLbSettings.clear();
+ m_pBtnEdit.clear();
+ ModalDialog::dispose();
}
const uno::Sequence<beans::PropertyValue>& ScSolverOptionsDialog::GetProperties()
@@ -308,23 +317,23 @@ void ScSolverOptionsDialog::EditOption()
{
if ( pStringItem->IsDouble() )
{
- ScSolverValueDialog aValDialog( this );
- aValDialog.SetOptionName( pStringItem->GetText() );
- aValDialog.SetValue( pStringItem->GetDoubleValue() );
- if ( aValDialog.Execute() == RET_OK )
+ ScopedVclPtrInstance< ScSolverValueDialog > aValDialog( this );
+ aValDialog->SetOptionName( pStringItem->GetText() );
+ aValDialog->SetValue( pStringItem->GetDoubleValue() );
+ if ( aValDialog->Execute() == RET_OK )
{
- pStringItem->SetDoubleValue( aValDialog.GetValue() );
+ pStringItem->SetDoubleValue( aValDialog->GetValue() );
m_pLbSettings->InvalidateEntry( pEntry );
}
}
else
{
- ScSolverIntegerDialog aIntDialog( this );
- aIntDialog.SetOptionName( pStringItem->GetText() );
- aIntDialog.SetValue( pStringItem->GetIntValue() );
- if ( aIntDialog.Execute() == RET_OK )
+ ScopedVclPtrInstance< ScSolverIntegerDialog > aIntDialog( this );
+ aIntDialog->SetOptionName( pStringItem->GetText() );
+ aIntDialog->SetValue( pStringItem->GetIntValue() );
+ if ( aIntDialog->Execute() == RET_OK )
{
- pStringItem->SetIntValue( aIntDialog.GetValue() );
+ pStringItem->SetIntValue( aIntDialog->GetValue() );
m_pLbSettings->InvalidateEntry( pEntry );
}
}
@@ -388,6 +397,18 @@ ScSolverIntegerDialog::ScSolverIntegerDialog(vcl::Window * pParent)
get(m_pNfValue, "value");
}
+ScSolverIntegerDialog::~ScSolverIntegerDialog()
+{
+ disposeOnce();
+}
+
+void ScSolverIntegerDialog::dispose()
+{
+ m_pFrame.clear();
+ m_pNfValue.clear();
+ ModalDialog::dispose();
+}
+
void ScSolverIntegerDialog::SetOptionName( const OUString& rName )
{
m_pFrame->set_label(rName);
@@ -416,6 +437,18 @@ ScSolverValueDialog::ScSolverValueDialog( vcl::Window * pParent )
get(m_pEdValue, "value");
}
+ScSolverValueDialog::~ScSolverValueDialog()
+{
+ disposeOnce();
+}
+
+void ScSolverValueDialog::dispose()
+{
+ m_pFrame.clear();
+ m_pEdValue.clear();
+ ModalDialog::dispose();
+}
+
void ScSolverValueDialog::SetOptionName( const OUString& rName )
{
m_pFrame->set_label(rName);
diff --git a/sc/source/ui/miscdlgs/solvrdlg.cxx b/sc/source/ui/miscdlgs/solvrdlg.cxx
index 10ffbfa0ca9b..45f6f453b83b 100644
--- a/sc/source/ui/miscdlgs/solvrdlg.cxx
+++ b/sc/source/ui/miscdlgs/solvrdlg.cxx
@@ -73,6 +73,22 @@ ScSolverDlg::ScSolverDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pPa
ScSolverDlg::~ScSolverDlg()
{
+ disposeOnce();
+}
+
+void ScSolverDlg::dispose()
+{
+ m_pFtFormulaCell.clear();
+ m_pEdFormulaCell.clear();
+ m_pRBFormulaCell.clear();
+ m_pEdTargetVal.clear();
+ m_pFtVariableCell.clear();
+ m_pEdVariableCell.clear();
+ m_pRBVariableCell.clear();
+ m_pBtnOk.clear();
+ m_pBtnCancel.clear();
+ pEdActive.clear();
+ ScAnyRefDlg::dispose();
}
void ScSolverDlg::Init()
@@ -170,7 +186,7 @@ void ScSolverDlg::RaiseError( ScSolverErr eError )
bool ScSolverDlg::IsRefInputMode() const
{
- return pEdActive != NULL;
+ return pEdActive != nullptr;
}
bool ScSolverDlg::CheckTargetValue( const OUString& rStrVal )
diff --git a/sc/source/ui/miscdlgs/strindlg.cxx b/sc/source/ui/miscdlgs/strindlg.cxx
index c053016f33fe..482ca29aed33 100644
--- a/sc/source/ui/miscdlgs/strindlg.cxx
+++ b/sc/source/ui/miscdlgs/strindlg.cxx
@@ -39,4 +39,16 @@ ScStringInputDlg::ScStringInputDlg( vcl::Window* pParent,
m_pEdInput->SetHelpId( sEditHelpId );
}
+ScStringInputDlg::~ScStringInputDlg()
+{
+ disposeOnce();
+}
+
+void ScStringInputDlg::dispose()
+{
+ m_pFtEditTitle.clear();
+ m_pEdInput.clear();
+ ModalDialog::dispose();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/miscdlgs/tabbgcolordlg.cxx b/sc/source/ui/miscdlgs/tabbgcolordlg.cxx
index b2299f777194..0387e31596f5 100644
--- a/sc/source/ui/miscdlgs/tabbgcolordlg.cxx
+++ b/sc/source/ui/miscdlgs/tabbgcolordlg.cxx
@@ -59,6 +59,18 @@ ScTabBgColorDlg::ScTabBgColorDlg(vcl::Window* pParent, const OUString& rTitle,
m_pBtnOk->SetClickHdl( HDL(TabBgColorOKHdl_Impl) );
}
+ScTabBgColorDlg::~ScTabBgColorDlg()
+{
+ disposeOnce();
+}
+
+void ScTabBgColorDlg::dispose()
+{
+ m_pTabBgColorSet.clear();
+ m_pBtnOk.clear();
+ ModalDialog::dispose();
+}
+
void ScTabBgColorDlg::GetSelectedColor( Color& rColor ) const
{
rColor = this->m_aTabBgColor;
@@ -135,6 +147,17 @@ ScTabBgColorDlg::ScTabBgColorValueSet::ScTabBgColorValueSet(vcl::Window* pParent
{
}
+ScTabBgColorDlg::ScTabBgColorValueSet::~ScTabBgColorValueSet()
+{
+ disposeOnce();
+}
+
+void ScTabBgColorDlg::ScTabBgColorValueSet::dispose()
+{
+ m_pTabBgColorDlg.clear();
+ SvxColorValueSet::dispose();
+}
+
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeScTabBgColorValueSet(vcl::Window *pParent, VclBuilder::stringmap &rMap)
{
WinBits nWinBits = WB_TABSTOP;
diff --git a/sc/source/ui/miscdlgs/tabopdlg.cxx b/sc/source/ui/miscdlgs/tabopdlg.cxx
index cbfeca17bce7..d4f8c17ece4a 100644
--- a/sc/source/ui/miscdlgs/tabopdlg.cxx
+++ b/sc/source/ui/miscdlgs/tabopdlg.cxx
@@ -76,9 +76,28 @@ ScTabOpDlg::ScTabOpDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pPare
ScTabOpDlg::~ScTabOpDlg()
{
+ disposeOnce();
+}
+
+void ScTabOpDlg::dispose()
+{
Hide();
+ m_pFtFormulaRange.clear();
+ m_pEdFormulaRange.clear();
+ m_pRBFormulaRange.clear();
+ m_pFtRowCell.clear();
+ m_pEdRowCell.clear();
+ m_pRBRowCell.clear();
+ m_pFtColCell.clear();
+ m_pEdColCell.clear();
+ m_pRBColCell.clear();
+ m_pBtnOk.clear();
+ m_pBtnCancel.clear();
+ pEdActive.clear();
+ ScAnyRefDlg::dispose();
}
+
void ScTabOpDlg::Init()
{
m_pBtnOk->SetClickHdl ( LINK( this, ScTabOpDlg, BtnHdl ) );
diff --git a/sc/source/ui/namedlg/namedefdlg.cxx b/sc/source/ui/namedlg/namedefdlg.cxx
index b784e93ddddb..0f80368c5377 100644
--- a/sc/source/ui/namedlg/namedefdlg.cxx
+++ b/sc/source/ui/namedlg/namedefdlg.cxx
@@ -93,6 +93,27 @@ ScNameDefDlg::ScNameDefDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* p
m_pEdName->SetSelection( aCurSel );
}
+ScNameDefDlg::~ScNameDefDlg()
+{
+ disposeOnce();
+}
+
+void ScNameDefDlg::dispose()
+{
+ m_pEdName.clear();
+ m_pEdRange.clear();
+ m_pRbRange.clear();
+ m_pLbScope.clear();
+ m_pBtnRowHeader.clear();
+ m_pBtnColHeader.clear();
+ m_pBtnPrintArea.clear();
+ m_pBtnCriteria.clear();
+ m_pBtnAdd.clear();
+ m_pBtnCancel.clear();
+ m_pFtInfo.clear();
+ ScAnyRefDlg::dispose();
+}
+
void ScNameDefDlg::CancelPushed()
{
if (mbUndo)
diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx
index 6cc2afc689d9..090738cbe436 100644
--- a/sc/source/ui/namedlg/namedlg.cxx
+++ b/sc/source/ui/namedlg/namedlg.cxx
@@ -102,7 +102,26 @@ ScNameDlg::ScNameDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent
ScNameDlg::~ScNameDlg()
{
- delete m_pRangeManagerTable;
+ disposeOnce();
+}
+
+void ScNameDlg::dispose()
+{
+ m_pRangeManagerTable.disposeAndClear();
+ m_pEdName.clear();
+ m_pEdAssign.clear();
+ m_pRbAssign.clear();
+ m_pLbScope.clear();
+ m_pBtnPrintArea.clear();
+ m_pBtnColHeader.clear();
+ m_pBtnCriteria.clear();
+ m_pBtnRowHeader.clear();
+ m_pBtnAdd.clear();
+ m_pBtnDelete.clear();
+ m_pBtnOk.clear();
+ m_pBtnCancel.clear();
+ m_pFtInfo.clear();
+ ScAnyRefDlg::dispose();
}
void ScNameDlg::Init()
@@ -117,7 +136,7 @@ void ScNameDlg::Init()
SvSimpleTableContainer *pCtrl = get<SvSimpleTableContainer>("names");
pCtrl->set_height_request(pCtrl->GetTextHeight()*12);
- m_pRangeManagerTable = new ScRangeManagerTable(*pCtrl, maRangeMap, maCursorPos);
+ m_pRangeManagerTable = VclPtr<ScRangeManagerTable>::Create(*pCtrl, maRangeMap, maCursorPos);
m_pRangeManagerTable->setInitListener(this);
m_pRangeManagerTable->SetSelectHdl( LINK( this, ScNameDlg, SelectionChangedHdl_Impl ) );
m_pRangeManagerTable->SetDeselectHdl( LINK( this, ScNameDlg, SelectionChangedHdl_Impl ) );
diff --git a/sc/source/ui/namedlg/namemgrtable.cxx b/sc/source/ui/namedlg/namemgrtable.cxx
index f534320e47ed..2df4743de41e 100644
--- a/sc/source/ui/namedlg/namemgrtable.cxx
+++ b/sc/source/ui/namedlg/namemgrtable.cxx
@@ -105,7 +105,13 @@ void ScRangeManagerTable::setColWidths()
ScRangeManagerTable::~ScRangeManagerTable()
{
+ disposeOnce();
+}
+
+void ScRangeManagerTable::dispose()
+{
Clear();
+ SvSimpleTable::dispose();
}
void ScRangeManagerTable::setInitListener( InitListener* pListener )
diff --git a/sc/source/ui/namedlg/namepast.cxx b/sc/source/ui/namedlg/namepast.cxx
index 841781575ed4..5f0c238327ef 100644
--- a/sc/source/ui/namedlg/namepast.cxx
+++ b/sc/source/ui/namedlg/namepast.cxx
@@ -50,7 +50,7 @@ ScNamePasteDlg::ScNamePasteDlg( vcl::Window * pParent, ScDocShell* pShell, bool
aControlSize = LogicToPixel(aControlSize, MAP_APPFONT);
pContainer->set_width_request(aControlSize.Width());
pContainer->set_height_request(10 * GetTextHeight());
- mpTable = new ScRangeManagerTable(*pContainer, maRangeMap, aPos);
+ mpTable = VclPtr<ScRangeManagerTable>::Create(*pContainer, maRangeMap, aPos);
m_pBtnPaste->SetClickHdl( LINK( this, ScNamePasteDlg, ButtonHdl) );
m_pBtnPasteAll->SetClickHdl( LINK( this, ScNamePasteDlg, ButtonHdl));
@@ -65,7 +65,16 @@ ScNamePasteDlg::ScNamePasteDlg( vcl::Window * pParent, ScDocShell* pShell, bool
ScNamePasteDlg::~ScNamePasteDlg()
{
- delete mpTable;
+ disposeOnce();
+}
+
+void ScNamePasteDlg::dispose()
+{
+ mpTable.disposeAndClear();
+ m_pBtnPasteAll.clear();
+ m_pBtnPaste.clear();
+ m_pBtnClose.clear();
+ ModalDialog::dispose();
}
IMPL_LINK( ScNamePasteDlg, ButtonHdl, Button *, pButton )
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index ddbde5f5ab37..867d41cb43d5 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -142,6 +142,13 @@ ScContentTree::ScContentTree( vcl::Window* pParent, const ResId& rResId ) :
ScContentTree::~ScContentTree()
{
+ disposeOnce();
+}
+
+void ScContentTree::dispose()
+{
+ pParentWindow.clear();
+ SvTreeListBox::dispose();
}
// helper function for GetEntryAltText and GetEntryLongDescription
diff --git a/sc/source/ui/navipi/navcitem.cxx b/sc/source/ui/navipi/navcitem.cxx
index 5b64b02115f4..ef981c99aaea 100644
--- a/sc/source/ui/navipi/navcitem.cxx
+++ b/sc/source/ui/navipi/navcitem.cxx
@@ -88,7 +88,7 @@ void ScNavigatorControllerItem::StateChanged( sal_uInt16 /* nSID */, SfxItemStat
break;
case SID_SELECT_SCENARIO:
- rNavigatorDlg.aWndScenarios.NotifyState( pItem );
+ rNavigatorDlg.aWndScenarios->NotifyState( pItem );
break;
default:
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index d3c47ccf9728..49f516cd35d0 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -174,7 +174,7 @@ void ColumnEdit::EvalText()
void ColumnEdit::ExecuteCol()
{
- SCROW nRow = rDlg.aEdRow.GetRow();
+ SCROW nRow = rDlg.aEdRow->GetRow();
EvalText(); // setzt nCol
@@ -285,7 +285,7 @@ void RowEdit::LoseFocus()
void RowEdit::ExecuteRow()
{
- SCCOL nCol = rDlg.aEdCol.GetCol();
+ SCCOL nCol = rDlg.aEdCol->GetCol();
SCROW nRow = (SCROW)GetValue();
if ( (nCol > 0) && (nRow > 0) )
@@ -309,7 +309,7 @@ void ScDocListBox::Select()
ScNavigatorDlg::ReleaseFocus();
OUString aDocName = GetSelectEntry();
- rDlg.aLbEntries.SelectDoc( aDocName );
+ rDlg.aLbEntries->SelectDoc( aDocName );
}
// class CommandToolBox
@@ -368,7 +368,7 @@ void CommandToolBox::Select( sal_uInt16 nSelId )
rDlg.EndOfDataArea();
break;
case IID_CHANGEROOT:
- rDlg.aLbEntries.ToggleRoot();
+ rDlg.aLbEntries->ToggleRoot();
UpdateButtons();
break;
}
@@ -424,7 +424,7 @@ void CommandToolBox::UpdateButtons()
else
{
EnableItem( IID_CHANGEROOT, true );
- bool bRootSet = rDlg.aLbEntries.GetRootType() != SC_CONTENT_ROOT;
+ bool bRootSet = rDlg.aLbEntries->GetRootType() != SC_CONTENT_ROOT;
CheckItem( IID_CHANGEROOT, bRootSet );
}
@@ -483,7 +483,7 @@ ScNavigatorDialogWrapper::ScNavigatorDialogWrapper(
SfxChildWinInfo* /* pInfo */ ) :
SfxChildWindowContext( nId )
{
- pNavigator = new ScNavigatorDlg( pBind, this, pParent, true );
+ pNavigator = VclPtr<ScNavigatorDlg>::Create( pBind, this, pParent, true );
SetWindow( pNavigator );
// handle configurations elsewhere,
@@ -531,7 +531,7 @@ ScNavigatorDialogWrapper::ScNavigatorDialogWrapper(
}
if (nCmdId)
{
- pNavigator->aTbxCmd.CheckItem( nCmdId );
+ pNavigator->aTbxCmd->CheckItem( nCmdId );
pNavigator->DoResize();
}
@@ -555,14 +555,14 @@ ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, vcl
Window( pParent, ScResId(RID_SCDLG_NAVIGATOR) ),
rBindings ( *pB ), // is used in CommandToolBox ctor
aCmdImageList( ScResId( IL_CMD ) ),
- aFtCol ( this, ScResId( FT_COL ) ),
- aEdCol ( this, ScResId( ED_COL ) ),
- aFtRow ( this, ScResId( FT_ROW ) ),
- aEdRow ( this, ScResId( ED_ROW ) ),
- aTbxCmd ( this, ScResId( TBX_CMD ) ),
- aLbEntries ( this, ScResId( LB_ENTRIES ) ),
- aWndScenarios( this,ScResId( STR_QHLP_SCEN_LISTBOX), ScResId(STR_QHLP_SCEN_COMMENT)),
- aLbDocuments( this, ScResId( LB_DOCUMENTS ) ),
+ aFtCol ( VclPtr<FixedInfo>::Create( this, ScResId( FT_COL ) ) ),
+ aEdCol ( VclPtr<ColumnEdit>::Create( this, ScResId( ED_COL ) ) ),
+ aFtRow ( VclPtr<FixedInfo>::Create( this, ScResId( FT_ROW ) ) ),
+ aEdRow ( VclPtr<RowEdit>::Create( this, ScResId( ED_ROW ) ) ),
+ aTbxCmd ( VclPtr<CommandToolBox>::Create( this, ScResId( TBX_CMD ) ) ),
+ aLbEntries ( VclPtr<ScContentTree>::Create( this, ScResId( LB_ENTRIES ) ) ),
+ aWndScenarios( VclPtr<ScScenarioWindow>::Create( this,ScResId( STR_QHLP_SCEN_LISTBOX), ScResId(STR_QHLP_SCEN_COMMENT)) ),
+ aLbDocuments( VclPtr<ScDocListBox>::Create( this, ScResId( LB_DOCUMENTS ) ) ),
aStrDragMode ( ScResId( STR_DRAGMODE ) ),
aStrDisplay ( ScResId( STR_DISPLAY ) ),
aStrActiveWin( ScResId( STR_ACTIVEWIN ) ),
@@ -583,7 +583,7 @@ ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, vcl
nDropMode = rCfg.GetDragMode();
// eListMode is set from outside, Root further below
- aLbDocuments.SetDropDownLineCount(9);
+ aLbDocuments->SetDropDownLineCount(9);
OUString aOpen(" (");
aStrActive = aOpen;
aStrActive += OUString( ScResId( STR_ACTIVE ) );
@@ -599,19 +599,19 @@ ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, vcl
const long nListboxYPos =
::std::max(
- (aTbxCmd.GetPosPixel().Y() + aTbxCmd.GetSizePixel().Height()),
- (aEdRow.GetPosPixel().Y() + aEdRow.GetSizePixel().Height()) )
+ (aTbxCmd->GetPosPixel().Y() + aTbxCmd->GetSizePixel().Height()),
+ (aEdRow->GetPosPixel().Y() + aEdRow->GetSizePixel().Height()) )
+ 4;
- aLbEntries.setPosSizePixel( 0, nListboxYPos, 0, 0, WINDOW_POSSIZE_Y);
+ aLbEntries->setPosSizePixel( 0, nListboxYPos, 0, 0, WINDOW_POSSIZE_Y);
- nBorderOffset = aLbEntries.GetPosPixel().X();
+ nBorderOffset = aLbEntries->GetPosPixel().X();
- aInitSize.Width() = aTbxCmd.GetPosPixel().X()
- + aTbxCmd.GetSizePixel().Width()
+ aInitSize.Width() = aTbxCmd->GetPosPixel().X()
+ + aTbxCmd->GetSizePixel().Width()
+ nBorderOffset;
- aInitSize.Height() = aLbEntries.GetPosPixel().Y();
+ aInitSize.Height() = aLbEntries->GetPosPixel().Y();
- nInitListHeight = aLbEntries.GetSizePixel().Height();
+ nInitListHeight = aLbEntries->GetSizePixel().Height();
nListModeHeight = aInitSize.Height()
+ nInitListHeight;
@@ -629,41 +629,41 @@ ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, vcl
StartListening( *(SfxGetpApp()) );
StartListening( rBindings );
- aLbDocuments.Hide(); // does not exist at NAV_LMODE_NONE
+ aLbDocuments->Hide(); // does not exist at NAV_LMODE_NONE
- aLbEntries.InitWindowBits(true);
+ aLbEntries->InitWindowBits(true);
- aLbEntries.SetSpaceBetweenEntries(0);
- aLbEntries.SetSelectionMode( SINGLE_SELECTION );
- aLbEntries.SetDragDropMode( DragDropMode::CTRL_MOVE |
- DragDropMode::CTRL_COPY |
- DragDropMode::ENABLE_TOP );
+ aLbEntries->SetSpaceBetweenEntries(0);
+ aLbEntries->SetSelectionMode( SINGLE_SELECTION );
+ aLbEntries->SetDragDropMode( DragDropMode::CTRL_MOVE |
+ DragDropMode::CTRL_COPY |
+ DragDropMode::ENABLE_TOP );
// was a category chosen as root?
sal_uInt16 nLastRoot = rCfg.GetRootType();
if ( nLastRoot )
- aLbEntries.SetRootType( nLastRoot );
+ aLbEntries->SetRootType( nLastRoot );
- aLbEntries.Refresh();
+ aLbEntries->Refresh();
GetDocNames();
- aTbxCmd.UpdateButtons();
+ aTbxCmd->UpdateButtons();
UpdateColumn();
UpdateRow();
UpdateTable();
- aLbEntries.Hide();
- aWndScenarios.Hide();
- aWndScenarios.SetPosPixel( aLbEntries.GetPosPixel() );
+ aLbEntries->Hide();
+ aWndScenarios->Hide();
+ aWndScenarios->SetPosPixel( aLbEntries->GetPosPixel() );
aContentIdle.SetIdleHdl( LINK( this, ScNavigatorDlg, TimeHdl ) );
aContentIdle.SetPriority( SchedulerPriority::LOWEST );
FreeResource();
- aLbEntries.SetAccessibleRelationLabeledBy(&aLbEntries);
- aTbxCmd.SetAccessibleRelationLabeledBy(&aTbxCmd);
- aLbDocuments.SetAccessibleName(aStrActiveWin);
+ aLbEntries->SetAccessibleRelationLabeledBy(aLbEntries.get());
+ aTbxCmd->SetAccessibleRelationLabeledBy(aTbxCmd.get());
+ aLbDocuments->SetAccessibleName(aStrActiveWin);
if (pContextWin == NULL)
{
@@ -671,14 +671,19 @@ ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, vcl
// displayed in the sidebar and has the whole deck to fill.
// Therefore hide the button that hides all controls below the
// top two rows of buttons.
- aTbxCmd.Select(IID_ZOOMOUT);
- aTbxCmd.RemoveItem(aTbxCmd.GetItemPos(IID_ZOOMOUT));
+ aTbxCmd->Select(IID_ZOOMOUT);
+ aTbxCmd->RemoveItem(aTbxCmd->GetItemPos(IID_ZOOMOUT));
}
- aLbEntries.SetNavigatorDlgFlag(true);
+ aLbEntries->SetNavigatorDlgFlag(true);
}
ScNavigatorDlg::~ScNavigatorDlg()
{
+ disposeOnce();
+}
+
+void ScNavigatorDlg::dispose()
+{
aContentIdle.Stop();
sal_uInt16 i;
@@ -690,6 +695,16 @@ ScNavigatorDlg::~ScNavigatorDlg()
EndListening( *(SfxGetpApp()) );
EndListening( rBindings );
+
+ aFtCol.disposeAndClear();
+ aEdCol.disposeAndClear();
+ aFtRow.disposeAndClear();
+ aEdRow.disposeAndClear();
+ aTbxCmd.disposeAndClear();
+ aLbEntries.disposeAndClear();
+ aWndScenarios.disposeAndClear();
+ aLbDocuments.disposeAndClear();
+ vcl::Window::dispose();
}
void ScNavigatorDlg::Resizing( Size& rNewSize ) // Size = Outputsize?
@@ -721,13 +736,13 @@ void ScNavigatorDlg::Paint( const Rectangle& rRect )
Wallpaper aBack( aBgColor );
SetBackground( aBack );
- aFtCol.SetBackground( aBack );
- aFtRow.SetBackground( aBack );
+ aFtCol->SetBackground( aBack );
+ aFtRow->SetBackground( aBack );
}
else
{
- aFtCol.SetBackground(Wallpaper());
- aFtRow.SetBackground(Wallpaper());
+ aFtCol->SetBackground(Wallpaper());
+ aFtRow->SetBackground(Wallpaper());
}
Window::Paint( rRect );
@@ -774,28 +789,28 @@ void ScNavigatorDlg::DoResize()
// even if the content is not visible, adapt the size,
// so the width fit
- Point aEntryPos = aLbEntries.GetPosPixel();
- Point aListPos = aLbDocuments.GetPosPixel();
+ Point aEntryPos = aLbEntries->GetPosPixel();
+ Point aListPos = aLbDocuments->GetPosPixel();
aNewSize.Width() -= 2*nBorderOffset;
- Size aDocSize = aLbDocuments.GetSizePixel();
+ Size aDocSize = aLbDocuments->GetSizePixel();
aDocSize.Width() = aNewSize.Width();
if(!bSmall)
{
- long nListHeight = aLbDocuments.GetSizePixel().Height();
+ long nListHeight = aLbDocuments->GetSizePixel().Height();
aNewSize.Height() -= ( aEntryPos.Y() + nListHeight + 2*nBorderOffset );
if(aNewSize.Height()<0) aNewSize.Height()=0;
aListPos.Y() = aEntryPos.Y() + aNewSize.Height() + nBorderOffset;
- if(aListPos.Y() > aLbEntries.GetPosPixel().Y())
- aLbDocuments.SetPosPixel( aListPos );
+ if(aListPos.Y() > aLbEntries->GetPosPixel().Y())
+ aLbDocuments->SetPosPixel( aListPos );
}
- aLbEntries.SetSizePixel( aNewSize );
- aWndScenarios.SetSizePixel( aNewSize );
- aLbDocuments.SetSizePixel( aDocSize );
+ aLbEntries->SetSizePixel( aNewSize );
+ aWndScenarios->SetSizePixel( aNewSize );
+ aLbDocuments->SetSizePixel( aDocSize );
bool bListMode = (eListMode != NAV_LMODE_NONE);
if (pContextWin != NULL)
@@ -815,7 +830,7 @@ void ScNavigatorDlg::Notify( SfxBroadcaster&, const SfxHint& rHint )
if ( nHintId == SC_HINT_DOCNAME_CHANGED )
{
- aLbEntries.ActiveDocChanged();
+ aLbEntries->ActiveDocChanged();
}
else if ( NAV_LMODE_NONE == eListMode )
{
@@ -826,25 +841,25 @@ void ScNavigatorDlg::Notify( SfxBroadcaster&, const SfxHint& rHint )
switch ( nHintId )
{
case SC_HINT_TABLES_CHANGED:
- aLbEntries.Refresh( SC_CONTENT_TABLE );
+ aLbEntries->Refresh( SC_CONTENT_TABLE );
break;
case SC_HINT_DBAREAS_CHANGED:
- aLbEntries.Refresh( SC_CONTENT_DBAREA );
+ aLbEntries->Refresh( SC_CONTENT_DBAREA );
break;
case SC_HINT_AREAS_CHANGED:
- aLbEntries.Refresh( SC_CONTENT_RANGENAME );
+ aLbEntries->Refresh( SC_CONTENT_RANGENAME );
break;
case SC_HINT_DRAW_CHANGED:
- aLbEntries.Refresh( SC_CONTENT_GRAPHIC );
- aLbEntries.Refresh( SC_CONTENT_OLEOBJECT );
- aLbEntries.Refresh( SC_CONTENT_DRAWING );
+ aLbEntries->Refresh( SC_CONTENT_GRAPHIC );
+ aLbEntries->Refresh( SC_CONTENT_OLEOBJECT );
+ aLbEntries->Refresh( SC_CONTENT_DRAWING );
break;
case SC_HINT_AREALINKS_CHANGED:
- aLbEntries.Refresh( SC_CONTENT_AREALINK );
+ aLbEntries->Refresh( SC_CONTENT_AREALINK );
break;
// SFX_HINT_DOCCHANGED not only at document change
@@ -858,9 +873,9 @@ void ScNavigatorDlg::Notify( SfxBroadcaster&, const SfxHint& rHint )
aContentIdle.Start(); // Do not search notes immediately
break;
case FID_KILLEDITVIEW:
- aLbEntries.ObjectFresh( SC_CONTENT_OLEOBJECT );
- aLbEntries.ObjectFresh( SC_CONTENT_DRAWING );
- aLbEntries.ObjectFresh( SC_CONTENT_GRAPHIC );
+ aLbEntries->ObjectFresh( SC_CONTENT_OLEOBJECT );
+ aLbEntries->ObjectFresh( SC_CONTENT_DRAWING );
+ aLbEntries->ObjectFresh( SC_CONTENT_GRAPHIC );
break;
default:
break;
@@ -872,7 +887,7 @@ void ScNavigatorDlg::Notify( SfxBroadcaster&, const SfxHint& rHint )
sal_uLong nEventId = static_cast<const SfxEventHint&>(rHint).GetEventId();
if ( nEventId == SFX_EVENT_ACTIVATEDOC )
{
- aLbEntries.ActiveDocChanged();
+ aLbEntries->ActiveDocChanged();
UpdateAll();
}
}
@@ -883,14 +898,14 @@ IMPL_LINK( ScNavigatorDlg, TimeHdl, Idle*, pIdle )
if ( pIdle != &aContentIdle )
return 0;
- aLbEntries.Refresh( SC_CONTENT_NOTE );
+ aLbEntries->Refresh( SC_CONTENT_NOTE );
return 0;
}
void ScNavigatorDlg::SetDropMode(sal_uInt16 nNew)
{
nDropMode = nNew;
- aTbxCmd.UpdateButtons();
+ aTbxCmd->UpdateButtons();
ScNavipiCfg& rCfg = SC_MOD()->GetNavipiCfg();
rCfg.SetDragMode(nDropMode);
@@ -1008,7 +1023,7 @@ void ScNavigatorDlg::UpdateColumn( const SCCOL* pCol )
else if ( GetViewData() )
nCurCol = pViewData->GetCurX() + 1;
- aEdCol.SetCol( nCurCol );
+ aEdCol->SetCol( nCurCol );
CheckDataArea();
}
@@ -1019,7 +1034,7 @@ void ScNavigatorDlg::UpdateRow( const SCROW* pRow )
else if ( GetViewData() )
nCurRow = pViewData->GetCurY() + 1;
- aEdRow.SetRow( nCurRow );
+ aEdRow->SetRow( nCurRow );
CheckDataArea();
}
@@ -1040,7 +1055,7 @@ void ScNavigatorDlg::UpdateAll()
case NAV_LMODE_DOCS:
case NAV_LMODE_DBAREAS:
case NAV_LMODE_AREAS:
- aLbEntries.Refresh();
+ aLbEntries->Refresh();
break;
case NAV_LMODE_NONE:
@@ -1072,7 +1087,7 @@ void ScNavigatorDlg::SetListMode( NavListMode eMode, bool bSetSize )
case NAV_LMODE_AREAS:
case NAV_LMODE_DBAREAS:
case NAV_LMODE_DOCS:
- aLbEntries.Refresh();
+ aLbEntries->Refresh();
ShowList( true, bSetSize );
break;
@@ -1081,7 +1096,7 @@ void ScNavigatorDlg::SetListMode( NavListMode eMode, bool bSetSize )
break;
}
- aTbxCmd.UpdateButtons();
+ aTbxCmd->UpdateButtons();
if ( eMode != NAV_LMODE_NONE )
{
@@ -1107,8 +1122,8 @@ void ScNavigatorDlg::ShowList( bool bShow, bool bSetSize )
if ( pFloat )
pFloat->SetMinOutputSizePixel( aMinSize );
aSize.Height() = nListModeHeight;
- aLbEntries.Show();
- aLbDocuments.Show();
+ aLbEntries->Show();
+ aLbDocuments->Show();
}
else
{
@@ -1118,10 +1133,10 @@ void ScNavigatorDlg::ShowList( bool bShow, bool bSetSize )
nListModeHeight = aSize.Height();
}
aSize.Height() = aInitSize.Height();
- aLbEntries.Hide();
- aLbDocuments.Hide();
+ aLbEntries->Hide();
+ aLbDocuments->Hide();
}
- aWndScenarios.Hide();
+ aWndScenarios->Hide();
if ( pFloat )
{
@@ -1156,8 +1171,8 @@ void ScNavigatorDlg::ShowScenarios( bool bShow, bool bSetSize )
rBindings.Invalidate( SID_SELECT_SCENARIO );
rBindings.Update( SID_SELECT_SCENARIO );
- aWndScenarios.Show();
- aLbDocuments.Show();
+ aWndScenarios->Show();
+ aLbDocuments->Show();
}
else
{
@@ -1167,10 +1182,10 @@ void ScNavigatorDlg::ShowScenarios( bool bShow, bool bSetSize )
nListModeHeight = aSize.Height();
}
aSize.Height() = aInitSize.Height();
- aWndScenarios.Hide();
- aLbDocuments.Hide();
+ aWndScenarios->Hide();
+ aLbDocuments->Hide();
}
- aLbEntries.Hide();
+ aLbEntries->Hide();
if ( pFloat )
{
@@ -1190,8 +1205,8 @@ void ScNavigatorDlg::ShowScenarios( bool bShow, bool bSetSize )
void ScNavigatorDlg::GetDocNames( const OUString* pManualSel )
{
- aLbDocuments.Clear();
- aLbDocuments.SetUpdateMode( false );
+ aLbDocuments->Clear();
+ aLbDocuments->SetUpdateMode( false );
ScDocShell* pCurrentSh = PTR_CAST( ScDocShell, SfxObjectShell::Current() );
@@ -1207,7 +1222,7 @@ void ScNavigatorDlg::GetDocNames( const OUString* pManualSel )
aEntry += aStrActive;
else
aEntry += aStrNotActive;
- aLbDocuments.InsertEntry( aEntry );
+ aLbDocuments->InsertEntry( aEntry );
if ( pManualSel ? ( aName == *pManualSel )
: ( pSh == pCurrentSh ) )
@@ -1217,22 +1232,22 @@ void ScNavigatorDlg::GetDocNames( const OUString* pManualSel )
pSh = SfxObjectShell::GetNext( *pSh );
}
- aLbDocuments.InsertEntry( aStrActiveWin );
+ aLbDocuments->InsertEntry( aStrActiveWin );
- OUString aHidden = aLbEntries.GetHiddenTitle();
+ OUString aHidden = aLbEntries->GetHiddenTitle();
if (!aHidden.isEmpty())
{
OUString aEntry = aHidden;
aEntry += aStrHidden;
- aLbDocuments.InsertEntry( aEntry );
+ aLbDocuments->InsertEntry( aEntry );
if ( pManualSel && aHidden == *pManualSel )
aSelEntry = aEntry;
}
- aLbDocuments.SetUpdateMode( true );
+ aLbDocuments->SetUpdateMode( true );
- aLbDocuments.SelectEntry( aSelEntry );
+ aLbDocuments->SelectEntry( aSelEntry );
}
void ScNavigatorDlg::MarkDataArea()
@@ -1268,7 +1283,7 @@ void ScNavigatorDlg::UnmarkDataArea()
void ScNavigatorDlg::CheckDataArea()
{
- if ( aTbxCmd.IsItemChecked( IID_DATA ) && pMarkArea )
+ if ( aTbxCmd->IsItemChecked( IID_DATA ) && pMarkArea )
{
if ( nCurTab != pMarkArea->nTab
|| nCurCol < pMarkArea->nColStart+1
@@ -1276,8 +1291,8 @@ void ScNavigatorDlg::CheckDataArea()
|| nCurRow < pMarkArea->nRowStart+1
|| nCurRow > pMarkArea->nRowEnd+1 )
{
- aTbxCmd.SetItemState( IID_DATA, TriState(TRISTATE_TRUE) );
- aTbxCmd.Select( IID_DATA );
+ aTbxCmd->SetItemState( IID_DATA, TriState(TRISTATE_TRUE) );
+ aTbxCmd->Select( IID_DATA );
}
}
}
@@ -1295,7 +1310,7 @@ void ScNavigatorDlg::StartOfDataArea()
SCCOL nCol = aMarkRange.aStart.Col();
SCROW nRow = aMarkRange.aStart.Row();
- if ( (nCol+1 != aEdCol.GetCol()) || (nRow+1 != aEdRow.GetRow()) )
+ if ( (nCol+1 != aEdCol->GetCol()) || (nRow+1 != aEdRow->GetRow()) )
SetCurrentCell( nCol, nRow );
}
}
@@ -1313,7 +1328,7 @@ void ScNavigatorDlg::EndOfDataArea()
SCCOL nCol = aMarkRange.aEnd.Col();
SCROW nRow = aMarkRange.aEnd.Row();
- if ( (nCol+1 != aEdCol.GetCol()) || (nRow+1 != aEdRow.GetRow()) )
+ if ( (nCol+1 != aEdCol->GetCol()) || (nRow+1 != aEdRow->GetRow()) )
SetCurrentCell( nCol, nRow );
}
}
diff --git a/sc/source/ui/navipi/scenwnd.cxx b/sc/source/ui/navipi/scenwnd.cxx
index 96b37d81602d..7791cfff9990 100644
--- a/sc/source/ui/navipi/scenwnd.cxx
+++ b/sc/source/ui/navipi/scenwnd.cxx
@@ -197,23 +197,23 @@ void ScScenarioListBox::DeleteScenario( bool bQueryBox )
ScScenarioWindow::ScScenarioWindow( vcl::Window* pParent, const OUString& aQH_List,
const OUString& aQH_Comment)
: Window ( pParent, WB_TABSTOP | WB_DIALOGCONTROL ),
- aLbScenario ( *this ),
- aEdComment ( this, WB_BORDER | WB_LEFT | WB_READONLY | WB_VSCROLL | WB_TABSTOP )
+ aLbScenario ( VclPtr<ScScenarioListBox>::Create(*this) ),
+ aEdComment ( VclPtr<MultiLineEdit>::Create(this, WB_BORDER | WB_LEFT | WB_READONLY | WB_VSCROLL | WB_TABSTOP) )
{
vcl::Font aFont( GetFont() );
aFont.SetTransparent( true );
aFont.SetWeight( WEIGHT_LIGHT );
- aEdComment.SetFont( aFont );
- aEdComment.SetMaxTextLen( 512 );
- aLbScenario.SetPosPixel( Point(0,0) );
- aLbScenario.SetHelpId(HID_SC_SCENWIN_TOP);
- aEdComment.SetHelpId(HID_SC_SCENWIN_BOTTOM);
- aLbScenario.Show();
- aEdComment.Show();
-
- aLbScenario.SetQuickHelpText(aQH_List);
- aEdComment.SetQuickHelpText(aQH_Comment);
- aEdComment.SetBackground( Color( COL_LIGHTGRAY ) );
+ aEdComment->SetFont( aFont );
+ aEdComment->SetMaxTextLen( 512 );
+ aLbScenario->SetPosPixel( Point(0,0) );
+ aLbScenario->SetHelpId(HID_SC_SCENWIN_TOP);
+ aEdComment->SetHelpId(HID_SC_SCENWIN_BOTTOM);
+ aLbScenario->Show();
+ aEdComment->Show();
+
+ aLbScenario->SetQuickHelpText(aQH_List);
+ aEdComment->SetQuickHelpText(aQH_Comment);
+ aEdComment->SetBackground( Color( COL_LIGHTGRAY ) );
SfxViewFrame* pViewFrm = SfxViewFrame::Current();
if (pViewFrm)
@@ -226,6 +226,14 @@ ScScenarioWindow::ScScenarioWindow( vcl::Window* pParent, const OUString& aQH_Li
ScScenarioWindow::~ScScenarioWindow()
{
+ disposeOnce();
+}
+
+void ScScenarioWindow::dispose()
+{
+ aLbScenario.disposeAndClear();
+ aEdComment.disposeAndClear();
+ vcl::Window::dispose();
}
void ScScenarioWindow::Paint( const Rectangle& rRect )
@@ -242,26 +250,26 @@ void ScScenarioWindow::NotifyState( const SfxPoolItem* pState )
{
if( pState )
{
- aLbScenario.Enable();
+ aLbScenario->Enable();
if ( pState->ISA(SfxStringItem) )
{
OUString aNewEntry( static_cast<const SfxStringItem*>(pState)->GetValue() );
if ( !aNewEntry.isEmpty() )
- aLbScenario.SelectEntry( aNewEntry );
+ aLbScenario->SelectEntry( aNewEntry );
else
- aLbScenario.SetNoSelection();
+ aLbScenario->SetNoSelection();
}
else if ( pState->ISA(SfxStringListItem) )
{
- aLbScenario.UpdateEntries( static_cast<const SfxStringListItem*>(pState)->GetList() );
+ aLbScenario->UpdateEntries( static_cast<const SfxStringListItem*>(pState)->GetList() );
}
}
else
{
- aLbScenario.Disable();
- aLbScenario.SetNoSelection();
+ aLbScenario->Disable();
+ aLbScenario->SetNoSelection();
}
}
@@ -273,10 +281,10 @@ void ScScenarioWindow::SetSizePixel( const Size& rNewSize )
Window::SetSizePixel( aSize );
aSize.Height() = nHeight;
- aLbScenario.SetSizePixel( aSize );
+ aLbScenario->SetSizePixel( aSize );
aSize.Height() -= 4;
- aEdComment.SetPosSizePixel( Point( 0, nHeight+4 ), aSize );
+ aEdComment->SetPosSizePixel( Point( 0, nHeight+4 ), aSize );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx
index af06513fa587..92d88f6471ff 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.cxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx
@@ -109,7 +109,25 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi
mpTestButton->SetClickHdl(LINK(this, ScCalcOptionsDialog, TestClickHdl));
}
-ScCalcOptionsDialog::~ScCalcOptionsDialog() {}
+ScCalcOptionsDialog::~ScCalcOptionsDialog()
+{
+ disposeOnce();
+}
+
+void ScCalcOptionsDialog::dispose()
+{
+ mpUseOpenCL.clear();
+ mpSpinButton.clear();
+ mpEditField.clear();
+ mpTestButton.clear();
+ mpFtFrequency.clear();
+ mpFtComputeUnits.clear();
+ mpFtMemory.clear();
+ mpOpenclInfoList.clear();
+ mpBtnAutomaticSelectionTrue.clear();
+ mpBtnAutomaticSelectionFalse.clear();
+ ModalDialog::dispose();
+}
void ScCalcOptionsDialog::OpenCLAutomaticSelectionChanged()
{
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.hxx b/sc/source/ui/optdlg/calcoptionsdlg.hxx
index 08fad6cf17c3..254a18c1e0a2 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.hxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.hxx
@@ -36,6 +36,7 @@ class ScCalcOptionsDialog : public ModalDialog
public:
ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfig& rConfig);
virtual ~ScCalcOptionsDialog();
+ virtual void dispose() SAL_OVERRIDE;
DECL_LINK( BtnAutomaticSelectHdl, void* );
DECL_LINK( DeviceSelHdl, void* );
@@ -62,22 +63,22 @@ private:
#endif
private:
-
- CheckBox* mpEmptyAsZero;
- ListBox* mpConversion;
- ListBox* mpSyntax;
- CheckBox* mpUseOpenCL;
- NumericField* mpSpinButton;
- VclMultiLineEdit* mpEditField;
- PushButton* mpTestButton;
-
- FixedText* mpFtFrequency;
- FixedText* mpFtComputeUnits;
- FixedText* mpFtMemory;
-
- SvTreeListBox* mpOpenclInfoList;
- RadioButton* mpBtnAutomaticSelectionTrue;
- RadioButton* mpBtnAutomaticSelectionFalse;
+ VclPtr<CheckBox> mpEmptyAsZero;
+ VclPtr<ListBox> mpConversion;
+ VclPtr<ListBox> mpSyntax;
+
+ VclPtr<CheckBox> mpUseOpenCL;
+ VclPtr<NumericField> mpSpinButton;
+ VclPtr<VclMultiLineEdit> mpEditField;
+ VclPtr<PushButton> mpTestButton;
+
+ VclPtr<FixedText> mpFtFrequency;
+ VclPtr<FixedText> mpFtComputeUnits;
+ VclPtr<FixedText> mpFtMemory;
+
+ VclPtr<SvTreeListBox> mpOpenclInfoList;
+ VclPtr<RadioButton> mpBtnAutomaticSelectionTrue;
+ VclPtr<RadioButton> mpBtnAutomaticSelectionFalse;
OUString maSoftware;
diff --git a/sc/source/ui/optdlg/opredlin.cxx b/sc/source/ui/optdlg/opredlin.cxx
index b19eac983ea9..f0deec661e62 100644
--- a/sc/source/ui/optdlg/opredlin.cxx
+++ b/sc/source/ui/optdlg/opredlin.cxx
@@ -57,11 +57,21 @@ ScRedlineOptionsTabPage::ScRedlineOptionsTabPage( vcl::Window* pParent,
ScRedlineOptionsTabPage::~ScRedlineOptionsTabPage()
{
+ disposeOnce();
}
-SfxTabPage* ScRedlineOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
+void ScRedlineOptionsTabPage::dispose()
{
- return new ScRedlineOptionsTabPage( pParent, *rSet );
+ m_pContentColorLB.clear();
+ m_pRemoveColorLB.clear();
+ m_pInsertColorLB.clear();
+ m_pMoveColorLB.clear();
+ SfxTabPage::dispose();
+}
+
+VclPtr<SfxTabPage> ScRedlineOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
+{
+ return VclPtr<ScRedlineOptionsTabPage>::Create( pParent, *rSet );
}
bool ScRedlineOptionsTabPage::FillItemSet( SfxItemSet* /* rSet */ )
diff --git a/sc/source/ui/optdlg/tpcalc.cxx b/sc/source/ui/optdlg/tpcalc.cxx
index 2bbb450b7482..74cbf8878709 100644
--- a/sc/source/ui/optdlg/tpcalc.cxx
+++ b/sc/source/ui/optdlg/tpcalc.cxx
@@ -66,8 +66,30 @@ ScTpCalcOptions::ScTpCalcOptions(vcl::Window* pParent, const SfxItemSet& rCoreAt
ScTpCalcOptions::~ScTpCalcOptions()
{
+ disposeOnce();
+}
+
+void ScTpCalcOptions::dispose()
+{
delete pOldOptions;
delete pLocalOptions;
+ m_pBtnIterate.clear();
+ m_pFtSteps.clear();
+ m_pEdSteps.clear();
+ m_pFtEps.clear();
+ m_pEdEps.clear();
+ m_pBtnDateStd.clear();
+ m_pBtnDateSc10.clear();
+ m_pBtnDate1904.clear();
+ m_pBtnCase.clear();
+ m_pBtnCalc.clear();
+ m_pBtnMatch.clear();
+ m_pBtnRegex.clear();
+ m_pBtnLookUp.clear();
+ m_pBtnGeneralPrec.clear();
+ m_pFtPrec.clear();
+ m_pEdPrec.clear();
+ SfxTabPage::dispose();
}
void ScTpCalcOptions::Init()
@@ -79,9 +101,9 @@ void ScTpCalcOptions::Init()
m_pBtnDate1904->SetClickHdl( LINK( this, ScTpCalcOptions, RadioClickHdl ) );
}
-SfxTabPage* ScTpCalcOptions::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> ScTpCalcOptions::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return ( new ScTpCalcOptions( pParent, *rAttrSet ) );
+ return VclPtr<SfxTabPage>( new ScTpCalcOptions ( pParent, *rAttrSet ), SAL_NO_ACQUIRE );
}
void ScTpCalcOptions::Reset( const SfxItemSet* /* rCoreAttrs */ )
diff --git a/sc/source/ui/optdlg/tpcompatibility.cxx b/sc/source/ui/optdlg/tpcompatibility.cxx
index cceae3f5a8e0..ca828292c7db 100644
--- a/sc/source/ui/optdlg/tpcompatibility.cxx
+++ b/sc/source/ui/optdlg/tpcompatibility.cxx
@@ -23,11 +23,18 @@ ScTpCompatOptions::ScTpCompatOptions(vcl::Window *pParent, const SfxItemSet &rCo
ScTpCompatOptions::~ScTpCompatOptions()
{
+ disposeOnce();
}
-SfxTabPage* ScTpCompatOptions::Create(vcl::Window *pParent, const SfxItemSet *rCoreAttrs)
+void ScTpCompatOptions::dispose()
{
- return new ScTpCompatOptions(pParent, *rCoreAttrs);
+ m_pLbKeyBindings.clear();
+ SfxTabPage::dispose();
+}
+
+VclPtr<SfxTabPage> ScTpCompatOptions::Create(vcl::Window *pParent, const SfxItemSet *rCoreAttrs)
+{
+ return VclPtr<SfxTabPage>(new ScTpCompatOptions(pParent, *rCoreAttrs), SAL_NO_ACQUIRE);
}
bool ScTpCompatOptions::FillItemSet(SfxItemSet *rCoreAttrs)
diff --git a/sc/source/ui/optdlg/tpdefaults.cxx b/sc/source/ui/optdlg/tpdefaults.cxx
index d9123a424ccf..79b8475a5145 100644
--- a/sc/source/ui/optdlg/tpdefaults.cxx
+++ b/sc/source/ui/optdlg/tpdefaults.cxx
@@ -30,11 +30,19 @@ ScTpDefaultsOptions::ScTpDefaultsOptions(vcl::Window *pParent, const SfxItemSet
ScTpDefaultsOptions::~ScTpDefaultsOptions()
{
+ disposeOnce();
}
-SfxTabPage* ScTpDefaultsOptions::Create(vcl::Window *pParent, const SfxItemSet *rCoreAttrs)
+void ScTpDefaultsOptions::dispose()
{
- return new ScTpDefaultsOptions(pParent, *rCoreAttrs);
+ m_pEdNSheets.clear();
+ m_pEdSheetPrefix.clear();
+ SfxTabPage::dispose();
+}
+
+VclPtr<SfxTabPage> ScTpDefaultsOptions::Create(vcl::Window *pParent, const SfxItemSet *rCoreAttrs)
+{
+ return VclPtr<SfxTabPage>(new ScTpDefaultsOptions(pParent, *rCoreAttrs), SAL_NO_ACQUIRE);
}
bool ScTpDefaultsOptions::FillItemSet(SfxItemSet *rCoreSet)
diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx
index 63a807db14cc..1f6416fc7197 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -81,6 +81,23 @@ ScTpFormulaOptions::ScTpFormulaOptions(vcl::Window* pParent, const SfxItemSet& r
ScTpFormulaOptions::~ScTpFormulaOptions()
{
+ disposeOnce();
+}
+
+void ScTpFormulaOptions::dispose()
+{
+ mpLbFormulaSyntax.clear();
+ mpCbEnglishFuncName.clear();
+ mpBtnCustomCalcDefault.clear();
+ mpBtnCustomCalcCustom.clear();
+ mpBtnCustomCalcDetails.clear();
+ mpEdSepFuncArg.clear();
+ mpEdSepArrayCol.clear();
+ mpEdSepArrayRow.clear();
+ mpBtnSepReset.clear();
+ mpLbOOXMLRecalcOptions.clear();
+ mpLbODFRecalcOptions.clear();
+ SfxTabPage::dispose();
}
void ScTpFormulaOptions::ResetSeparators()
@@ -122,10 +139,10 @@ void ScTpFormulaOptions::UpdateCustomCalcRadioButtons(bool bDefault)
void ScTpFormulaOptions::LaunchCustomCalcSettings()
{
- ScCalcOptionsDialog aDlg(this, maCurrentConfig);
- if (aDlg.Execute() == RET_OK)
+ ScopedVclPtrInstance< ScCalcOptionsDialog > aDlg(this, maCurrentConfig);
+ if (aDlg->Execute() == RET_OK)
{
- maCurrentConfig = aDlg.GetConfig();
+ maCurrentConfig = aDlg->GetConfig();
}
}
@@ -220,9 +237,9 @@ IMPL_LINK( ScTpFormulaOptions, SepEditOnFocusHdl, Edit*, pEdit )
return 0;
}
-SfxTabPage* ScTpFormulaOptions::Create(vcl::Window* pParent, const SfxItemSet* rCoreSet)
+VclPtr<SfxTabPage> ScTpFormulaOptions::Create(vcl::Window* pParent, const SfxItemSet* rCoreSet)
{
- return new ScTpFormulaOptions(pParent, *rCoreSet);
+ return VclPtr<SfxTabPage>(new ScTpFormulaOptions(pParent, *rCoreSet), SAL_NO_ACQUIRE);
}
bool ScTpFormulaOptions::FillItemSet(SfxItemSet* rCoreSet)
diff --git a/sc/source/ui/optdlg/tpprint.cxx b/sc/source/ui/optdlg/tpprint.cxx
index c3f640cdfeb8..e38c830431d0 100644
--- a/sc/source/ui/optdlg/tpprint.cxx
+++ b/sc/source/ui/optdlg/tpprint.cxx
@@ -41,11 +41,20 @@ ScTpPrintOptions::ScTpPrintOptions( vcl::Window* pParent,
ScTpPrintOptions::~ScTpPrintOptions()
{
+ disposeOnce();
}
-SfxTabPage* ScTpPrintOptions::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+void ScTpPrintOptions::dispose()
{
- return new ScTpPrintOptions( pParent, *rAttrSet );
+ m_pSkipEmptyPagesCB.clear();
+ m_pSelectedSheetsCB.clear();
+ m_pForceBreaksCB.clear();
+ SfxTabPage::dispose();
+}
+
+VclPtr<SfxTabPage> ScTpPrintOptions::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+{
+ return VclPtr<SfxTabPage>(new ScTpPrintOptions( pParent, *rAttrSet ), SAL_NO_ACQUIRE);
}
SfxTabPage::sfxpg ScTpPrintOptions::DeactivatePage( SfxItemSet* pSetP )
diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx
index cc97343c182b..fc96ec7aca05 100644
--- a/sc/source/ui/optdlg/tpusrlst.cxx
+++ b/sc/source/ui/optdlg/tpusrlst.cxx
@@ -84,8 +84,26 @@ ScTpUserLists::ScTpUserLists( vcl::Window* pParent,
ScTpUserLists::~ScTpUserLists()
{
+ disposeOnce();
+}
+
+void ScTpUserLists::dispose()
+{
delete pUserLists;
delete pRangeUtil;
+ mpFtLists.clear();
+ mpLbLists.clear();
+ mpFtEntries.clear();
+ mpEdEntries.clear();
+ mpFtCopyFrom.clear();
+ mpEdCopyFrom.clear();
+ mpBtnNew.clear();
+ mpBtnDiscard.clear();
+ mpBtnAdd.clear();
+ mpBtnModify.clear();
+ mpBtnRemove.clear();
+ mpBtnCopy.clear();
+ SfxTabPage::dispose();
}
void ScTpUserLists::Init()
@@ -135,9 +153,9 @@ void ScTpUserLists::Init()
}
-SfxTabPage* ScTpUserLists::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+VclPtr<SfxTabPage> ScTpUserLists::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return ( new ScTpUserLists( pParent, *rAttrSet ) );
+ return VclPtr<SfxTabPage>( new ScTpUserLists( pParent, *rAttrSet ), SAL_NO_ACQUIRE );
}
void ScTpUserLists::Reset( const SfxItemSet* rCoreAttrs )
diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx
index a8a1532d2e17..251285e85f64 100644
--- a/sc/source/ui/optdlg/tpview.cxx
+++ b/sc/source/ui/optdlg/tpview.cxx
@@ -95,13 +95,40 @@ ScTpContentOptions::ScTpContentOptions( vcl::Window* pParent,
ScTpContentOptions::~ScTpContentOptions()
{
+ disposeOnce();
+}
+
+void ScTpContentOptions::dispose()
+{
delete pLocalOptions;
+ pGridLB.clear();
+ pColorFT.clear();
+ pColorLB.clear();
+ pBreakCB.clear();
+ pGuideLineCB.clear();
+ pFormulaCB.clear();
+ pNilCB.clear();
+ pAnnotCB.clear();
+ pValueCB.clear();
+ pAnchorCB.clear();
+ pClipMarkCB.clear();
+ pRangeFindCB.clear();
+ pObjGrfLB.clear();
+ pDiagramLB.clear();
+ pDrawLB.clear();
+ pSyncZoomCB.clear();
+ pRowColHeaderCB.clear();
+ pHScrollCB.clear();
+ pVScrollCB.clear();
+ pTblRegCB.clear();
+ pOutlineCB.clear();
+ SfxTabPage::dispose();
}
-SfxTabPage* ScTpContentOptions::Create( vcl::Window* pParent,
- const SfxItemSet* rCoreSet )
+VclPtr<SfxTabPage> ScTpContentOptions::Create( vcl::Window* pParent,
+ const SfxItemSet* rCoreSet )
{
- return new ScTpContentOptions(pParent, *rCoreSet);
+ return VclPtr<SfxTabPage>( new ScTpContentOptions (pParent, *rCoreSet), SAL_NO_ACQUIRE );
}
bool ScTpContentOptions::FillItemSet( SfxItemSet* rCoreSet )
@@ -406,12 +433,34 @@ ScTpLayoutOptions::ScTpLayoutOptions( vcl::Window* pParent,
ScTpLayoutOptions::~ScTpLayoutOptions()
{
+ disposeOnce();
}
-SfxTabPage* ScTpLayoutOptions::Create( vcl::Window* pParent,
- const SfxItemSet* rCoreSet )
+void ScTpLayoutOptions::dispose()
+{
+ m_pUnitLB.clear();
+ m_pTabMF.clear();
+ m_pAlwaysRB.clear();
+ m_pRequestRB.clear();
+ m_pNeverRB.clear();
+ m_pAlignCB.clear();
+ m_pAlignLB.clear();
+ m_pEditModeCB.clear();
+ m_pFormatCB.clear();
+ m_pExpRefCB.clear();
+ m_pSortRefUpdateCB.clear();
+ m_pMarkHdrCB.clear();
+ m_pTextFmtCB.clear();
+ m_pReplWarnCB.clear();
+ m_pLegacyCellSelectionCB.clear();
+ SfxTabPage::dispose();
+}
+
+
+VclPtr<SfxTabPage> ScTpLayoutOptions::Create( vcl::Window* pParent,
+ const SfxItemSet* rCoreSet )
{
- ScTpLayoutOptions* pNew = new ScTpLayoutOptions(pParent, *rCoreSet);
+ VclPtr<ScTpLayoutOptions> pNew( new ScTpLayoutOptions( pParent, *rCoreSet), SAL_NO_ACQUIRE );
ScDocShell* pDocSh = PTR_CAST(ScDocShell,SfxObjectShell::Current());
if(pDocSh!=NULL)
diff --git a/sc/source/ui/pagedlg/areasdlg.cxx b/sc/source/ui/pagedlg/areasdlg.cxx
index c95aa13cc69b..1985e09eb118 100644
--- a/sc/source/ui/pagedlg/areasdlg.cxx
+++ b/sc/source/ui/pagedlg/areasdlg.cxx
@@ -136,6 +136,11 @@ ScPrintAreasDlg::ScPrintAreasDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Win
ScPrintAreasDlg::~ScPrintAreasDlg()
{
+ disposeOnce();
+}
+
+void ScPrintAreasDlg::dispose()
+{
// Extra-Data an ListBox-Entries abraeumen
ListBox* aLb[3] = { pLbPrintArea, pLbRepeatRow, pLbRepeatCol };
@@ -145,6 +150,19 @@ ScPrintAreasDlg::~ScPrintAreasDlg()
for ( sal_uInt16 j=0; j<nCount; j++ )
delete static_cast<OUString*>(aLb[i]->GetEntryData(j));
}
+ pLbPrintArea.clear();
+ pEdPrintArea.clear();
+ pRbPrintArea.clear();
+ pLbRepeatRow.clear();
+ pEdRepeatRow.clear();
+ pRbRepeatRow.clear();
+ pLbRepeatCol.clear();
+ pEdRepeatCol.clear();
+ pRbRepeatCol.clear();
+ pBtnOk.clear();
+ pBtnCancel.clear();
+ pRefInputEdit.clear();
+ ScAnyRefDlg::dispose();
}
bool ScPrintAreasDlg::Close()
diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx
index dcac934968eb..f5c4fe85799b 100644
--- a/sc/source/ui/pagedlg/scuitphfedit.cxx
+++ b/sc/source/ui/pagedlg/scuitphfedit.cxx
@@ -152,6 +152,32 @@ IMPL_LINK( ScHFEditPage, ObjectSelectHdl, ScEditWindow*, pEdit )
ScHFEditPage::~ScHFEditPage()
{
+ disposeOnce();
+}
+
+void ScHFEditPage::dispose()
+{
+ m_pWndLeft.clear();
+ m_pWndCenter.clear();
+ m_pWndRight.clear();
+ m_pFtDefinedHF.clear();
+ m_pLbDefined.clear();
+ m_pFtCustomHF.clear();
+ m_pBtnText.clear();
+ m_pBtnFile.clear();
+ m_pBtnTable.clear();
+ m_pBtnPage.clear();
+ m_pBtnLastPage.clear();
+ m_pBtnDate.clear();
+ m_pBtnTime.clear();
+ m_pFtConfidential.clear();
+ m_pFtPage.clear();
+ m_pFtOfQuestion.clear();
+ m_pFtOf.clear();
+ m_pFtNone.clear();
+ m_pFtCreatedBy.clear();
+ m_pFtCustomized.clear();
+ SfxTabPage::dispose();
}
void ScHFEditPage::SetNumType(SvxNumType eNumType)
@@ -834,8 +860,8 @@ ScRightHeaderEditPage::ScRightHeaderEditPage( vcl::Window* pParent, const SfxIte
true )
{}
-SfxTabPage* ScRightHeaderEditPage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
- { return ( new ScRightHeaderEditPage( pParent, *rCoreSet ) ); };
+VclPtr<SfxTabPage> ScRightHeaderEditPage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
+ { return VclPtr<SfxTabPage>( new ScRightHeaderEditPage( pParent, *rCoreSet ), SAL_NO_ACQUIRE ); }
// class ScLeftHeaderEditPage
@@ -846,8 +872,8 @@ ScLeftHeaderEditPage::ScLeftHeaderEditPage( vcl::Window* pParent, const SfxItemS
true )
{}
-SfxTabPage* ScLeftHeaderEditPage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
- { return ( new ScLeftHeaderEditPage( pParent, *rCoreSet ) ); };
+VclPtr<SfxTabPage> ScLeftHeaderEditPage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
+ { return VclPtr<SfxTabPage>( new ScLeftHeaderEditPage( pParent, *rCoreSet ), SAL_NO_ACQUIRE ); };
// class ScRightFooterEditPage
@@ -858,8 +884,8 @@ ScRightFooterEditPage::ScRightFooterEditPage( vcl::Window* pParent, const SfxIte
false )
{}
-SfxTabPage* ScRightFooterEditPage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
- { return ( new ScRightFooterEditPage( pParent, *rCoreSet ) ); };
+VclPtr<SfxTabPage> ScRightFooterEditPage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
+ { return VclPtr<SfxTabPage>( new ScRightFooterEditPage( pParent, *rCoreSet ), SAL_NO_ACQUIRE ); };
// class ScLeftFooterEditPage
@@ -870,7 +896,7 @@ ScLeftFooterEditPage::ScLeftFooterEditPage( vcl::Window* pParent, const SfxItemS
false )
{}
-SfxTabPage* ScLeftFooterEditPage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
- { return ( new ScLeftFooterEditPage( pParent, *rCoreSet ) ); };
+VclPtr<SfxTabPage> ScLeftFooterEditPage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
+ { return VclPtr<SfxTabPage>( new ScLeftFooterEditPage( pParent, *rCoreSet ), SAL_NO_ACQUIRE ); };
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx
index c09f0cd2be99..70a5efcdcfbb 100644
--- a/sc/source/ui/pagedlg/tphf.cxx
+++ b/sc/source/ui/pagedlg/tphf.cxx
@@ -78,6 +78,14 @@ ScHFPage::ScHFPage( vcl::Window* pParent, const SfxItemSet& rSet, sal_uInt16 nSe
ScHFPage::~ScHFPage()
{
+ disposeOnce();
+}
+
+void ScHFPage::dispose()
+{
+ m_pBtnEdit.clear();
+ pStyleDlg.clear();
+ SvxHFPage::dispose();
}
void ScHFPage::Reset( const SfxItemSet* rSet )
@@ -193,7 +201,7 @@ IMPL_LINK_NOARG(ScHFPage, HFEditHdl)
else
{
OUString aText;
- boost::scoped_ptr<SfxSingleTabDialog> pDlg(new SfxSingleTabDialog(this, aDataSet));
+ VclPtrInstance< SfxSingleTabDialog > pDlg(this, aDataSet);
const int nSettingsId = 42;
bool bRightPage = m_pCntSharedBox->IsChecked()
|| ( SVX_PAGE_LEFT != SvxPageUsage(nPageUsage) );
@@ -239,9 +247,9 @@ ScHeaderPage::ScHeaderPage( vcl::Window* pParent, const SfxItemSet& rSet )
{
}
-SfxTabPage* ScHeaderPage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
+VclPtr<SfxTabPage> ScHeaderPage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
{
- return ( new ScHeaderPage( pParent, *rCoreSet ) );
+ return VclPtr<SfxTabPage>( new ScHeaderPage( pParent, *rCoreSet ), SAL_NO_ACQUIRE );
}
const sal_uInt16* ScHeaderPage::GetRanges()
@@ -256,9 +264,9 @@ ScFooterPage::ScFooterPage( vcl::Window* pParent, const SfxItemSet& rSet )
{
}
-SfxTabPage* ScFooterPage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
+VclPtr<SfxTabPage> ScFooterPage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
{
- return ( new ScFooterPage( pParent, *rCoreSet ) );
+ return VclPtr<SfxTabPage>( new ScFooterPage( pParent, *rCoreSet ), SAL_NO_ACQUIRE );
}
const sal_uInt16* ScFooterPage::GetRanges()
diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx
index 8f0a1b4a578b..87eded513c08 100644
--- a/sc/source/ui/pagedlg/tphfedit.cxx
+++ b/sc/source/ui/pagedlg/tphfedit.cxx
@@ -118,6 +118,11 @@ void ScEditWindow::Resize()
ScEditWindow::~ScEditWindow()
{
+ disposeOnce();
+}
+
+void ScEditWindow::dispose()
+{
// delete Accessible object before deleting EditEngine and EditView
if (pAcc)
{
@@ -127,6 +132,7 @@ ScEditWindow::~ScEditWindow()
}
delete pEdEngine;
delete pEdView;
+ Control::dispose();
}
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeScEditWindow(vcl::Window *pParent, VclBuilder::stringmap &)
diff --git a/sc/source/ui/pagedlg/tptable.cxx b/sc/source/ui/pagedlg/tptable.cxx
index 6de677e6cb52..910bc3f4423b 100644
--- a/sc/source/ui/pagedlg/tptable.cxx
+++ b/sc/source/ui/pagedlg/tptable.cxx
@@ -125,11 +125,38 @@ void ScTablePage::ShowImage()
ScTablePage::~ScTablePage()
{
+ disposeOnce();
}
-SfxTabPage* ScTablePage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
+void ScTablePage::dispose()
{
- return ( new ScTablePage( pParent, *rCoreSet ) );
+ m_pBtnTopDown.clear();
+ m_pBtnLeftRight.clear();
+ m_pBmpPageDir.clear();
+ m_pBtnPageNo.clear();
+ m_pEdPageNo.clear();
+ m_pBtnHeaders.clear();
+ m_pBtnGrid.clear();
+ m_pBtnNotes.clear();
+ m_pBtnObjects.clear();
+ m_pBtnCharts.clear();
+ m_pBtnDrawings.clear();
+ m_pBtnFormulas.clear();
+ m_pBtnNullVals.clear();
+ m_pLbScaleMode.clear();
+ m_pBxScaleAll.clear();
+ m_pEdScaleAll.clear();
+ m_pGrHeightWidth.clear();
+ m_pEdScalePageWidth.clear();
+ m_pEdScalePageHeight.clear();
+ m_pBxScalePageNum.clear();
+ m_pEdScalePageNum.clear();
+ SfxTabPage::dispose();
+}
+
+VclPtr<SfxTabPage> ScTablePage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
+{
+ return VclPtr<SfxTabPage>( new ScTablePage( pParent, *rCoreSet ), SAL_NO_ACQUIRE );
}
void ScTablePage::Reset( const SfxItemSet* rCoreSet )
diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
index e10b53830ffb..d1da58a3cd47 100644
--- a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
+++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
@@ -68,6 +68,28 @@ AlignmentPropertyPanel::AlignmentPropertyPanel(
AlignmentPropertyPanel::~AlignmentPropertyPanel()
{
+ disposeOnce();
+}
+
+void AlignmentPropertyPanel::dispose()
+{
+ mpFTLeftIndent.clear();
+ mpMFLeftIndent.clear();
+ mpCBXWrapText.clear();
+ mpCBXMergeCell.clear();
+ mpFtRotate.clear();
+ mpCtrlDial.clear();
+ mpMtrAngle.clear();
+ mpCbStacked.clear();
+
+ maAlignHorControl.dispose();
+ maLeftIndentControl.dispose();
+ maMergeCellControl.dispose();
+ maWrapTextControl.dispose();
+ maAngleControl.dispose();
+ maStackControl.dispose();
+
+ PanelLayout::dispose();
}
void AlignmentPropertyPanel::Initialize()
@@ -204,7 +226,7 @@ IMPL_LINK(AlignmentPropertyPanel, CBOXWrapTextClkHdl, void*, EMPTYARG)
return 0;
}
-AlignmentPropertyPanel* AlignmentPropertyPanel::Create (
+VclPtr<vcl::Window> AlignmentPropertyPanel::Create (
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings)
@@ -216,10 +238,8 @@ AlignmentPropertyPanel* AlignmentPropertyPanel::Create (
if (pBindings == NULL)
throw lang::IllegalArgumentException("no SfxBindings given to AlignmentPropertyPanel::Create", NULL, 2);
- return new AlignmentPropertyPanel(
- pParent,
- rxFrame,
- pBindings);
+ return VclPtr<AlignmentPropertyPanel>::Create(
+ pParent, rxFrame, pBindings);
}
void AlignmentPropertyPanel::DataChanged(
diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx
index 050c79d48b63..dab38a72a3ef 100644
--- a/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx
+++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx
@@ -39,7 +39,7 @@ class AlignmentPropertyPanel
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
public:
- static AlignmentPropertyPanel* Create(
+ static VclPtr<vcl::Window> Create(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings);
@@ -58,16 +58,24 @@ public:
SfxBindings* GetBindings() { return mpBindings;}
+ // constructor/destuctor
+ AlignmentPropertyPanel(
+ vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ SfxBindings* pBindings);
+ virtual ~AlignmentPropertyPanel();
+ virtual void dispose() SAL_OVERRIDE;
+
private:
//ui controls
- FixedText* mpFTLeftIndent;
- MetricField* mpMFLeftIndent;
- CheckBox* mpCBXWrapText;
- CheckBox* mpCBXMergeCell;
- FixedText* mpFtRotate;
- svx::sidebar::SidebarDialControl* mpCtrlDial;
- MetricBox* mpMtrAngle;
- CheckBox* mpCbStacked;
+ VclPtr<FixedText> mpFTLeftIndent;
+ VclPtr<MetricField> mpMFLeftIndent;
+ VclPtr<CheckBox> mpCBXWrapText;
+ VclPtr<CheckBox> mpCBXMergeCell;
+ VclPtr<FixedText> mpFtRotate;
+ VclPtr<svx::sidebar::SidebarDialControl> mpCtrlDial;
+ VclPtr<MetricBox> mpMtrAngle;
+ VclPtr<CheckBox> mpCbStacked;
::sfx2::sidebar::ControllerItem maAlignHorControl;
::sfx2::sidebar::ControllerItem maLeftIndentControl;
@@ -90,13 +98,6 @@ private:
DECL_LINK( RotationHdl, void * );
DECL_LINK( ClickStackHdl, void * );
- // constructor/destuctor
- AlignmentPropertyPanel(
- vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings);
- virtual ~AlignmentPropertyPanel();
-
void Initialize();
void FormatDegrees(double& dTmp);
};
diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
index 38c0154d3785..b3012fab9141 100644
--- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
+++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
@@ -142,6 +142,24 @@ CellAppearancePropertyPanel::CellAppearancePropertyPanel(
CellAppearancePropertyPanel::~CellAppearancePropertyPanel()
{
+ disposeOnce();
+}
+
+void CellAppearancePropertyPanel::dispose()
+{
+ mpTBCellBorder.clear();
+ mpTBLineStyle.clear();
+ mpTBLineColor.clear();
+ mpCBXShowGrid.clear();
+
+ maLineStyleControl.dispose();
+ maBorderOuterControl.dispose();
+ maBorderInnerControl.dispose();
+ maGridShowControl.dispose();
+ maBorderTLBRControl.dispose();
+ maBorderBLTRControl.dispose();
+
+ PanelLayout::dispose();
}
void CellAppearancePropertyPanel::Initialize()
@@ -225,7 +243,7 @@ IMPL_LINK(CellAppearancePropertyPanel, CBOXGridShowClkHdl, void*, EMPTYARG)
return 0;
}
-CellAppearancePropertyPanel* CellAppearancePropertyPanel::Create (
+VclPtr<vcl::Window> CellAppearancePropertyPanel::Create (
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings)
@@ -237,10 +255,8 @@ CellAppearancePropertyPanel* CellAppearancePropertyPanel::Create (
if (pBindings == NULL)
throw lang::IllegalArgumentException("no SfxBindings given to CellAppearancePropertyPanel::Create", NULL, 2);
- return new CellAppearancePropertyPanel(
- pParent,
- rxFrame,
- pBindings);
+ return VclPtr<CellAppearancePropertyPanel>::Create(
+ pParent, rxFrame, pBindings);
}
void CellAppearancePropertyPanel::DataChanged(
diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
index eb9e7dc45eb7..fc0395687e2a 100644
--- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
+++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
@@ -50,7 +50,7 @@ private:
friend class CellBorderStyleControl;
public:
- static CellAppearancePropertyPanel* Create(
+ static VclPtr<vcl::Window> Create(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings);
@@ -69,14 +69,22 @@ public:
SfxBindings* GetBindings() { return mpBindings;}
+ // constructor/destuctor
+ CellAppearancePropertyPanel(
+ vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ SfxBindings* pBindings);
+ virtual ~CellAppearancePropertyPanel();
+ virtual void dispose() SAL_OVERRIDE;
+
private:
//ui controls
- ToolBox* mpTBCellBorder;
- ToolBox* mpTBLineStyle;
- ToolBox* mpTBLineColor;
+ VclPtr<ToolBox> mpTBCellBorder;
+ VclPtr<ToolBox> mpTBLineStyle;
+ VclPtr<ToolBox> mpTBLineColor;
::boost::scoped_ptr< CellBorderUpdater > mpCellBorderUpdater;
- CheckBox* mpCBXShowGrid;
+ VclPtr<CheckBox> mpCBXShowGrid;
::sfx2::sidebar::ControllerItem maLineStyleControl;
::sfx2::sidebar::ControllerItem maBorderOuterControl;
@@ -145,13 +153,6 @@ private:
svx::sidebar::PopupControl* CreateCellBorderStylePopupControl(svx::sidebar::PopupContainer* pParent);
void EndCellBorderStylePopupMode();
- // constructor/destuctor
- CellAppearancePropertyPanel(
- vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings);
- virtual ~CellAppearancePropertyPanel();
-
void Initialize();
void SetStyleIcon();
void UpdateControlState();
diff --git a/sc/source/ui/sidebar/CellBorderStyleControl.cxx b/sc/source/ui/sidebar/CellBorderStyleControl.cxx
index ad6507dcda71..ff09bcf7b5b0 100644
--- a/sc/source/ui/sidebar/CellBorderStyleControl.cxx
+++ b/sc/source/ui/sidebar/CellBorderStyleControl.cxx
@@ -45,11 +45,11 @@ namespace sc { namespace sidebar {
CellBorderStyleControl::CellBorderStyleControl(vcl::Window* pParent, CellAppearancePropertyPanel& rPanel)
: svx::sidebar::PopupControl(pParent, ScResId(RID_POPUPPANEL_APPEARANCE_CELL_BORDERSTYLE)),
mrCellAppearancePropertyPanel(rPanel),
- maTBBorder1(this, ScResId(TB_BORDER1)),
- maTBBorder2(this, ScResId(TB_BORDER2)),
- maTBBorder3(this, ScResId(TB_BORDER3)),
- maFL1(this, ScResId(FL_1)),
- maFL2(this, ScResId(FL_2)),
+ maTBBorder1(VclPtr<ToolBox>::Create(this, ScResId(TB_BORDER1))),
+ maTBBorder2(VclPtr<ToolBox>::Create(this, ScResId(TB_BORDER2))),
+ maTBBorder3(VclPtr<ToolBox>::Create(this, ScResId(TB_BORDER3))),
+ maFL1(VclPtr<FixedLine>::Create(this, ScResId(FL_1))),
+ maFL2(VclPtr<FixedLine>::Create(this, ScResId(FL_2))),
mpImageList(0)
{
Initialize();
@@ -58,7 +58,18 @@ CellBorderStyleControl::CellBorderStyleControl(vcl::Window* pParent, CellAppeara
CellBorderStyleControl::~CellBorderStyleControl()
{
+ disposeOnce();
+}
+
+void CellBorderStyleControl::dispose()
+{
delete[] mpImageList;
+ maTBBorder1.disposeAndClear();
+ maTBBorder2.disposeAndClear();
+ maTBBorder3.disposeAndClear();
+ maFL1.disposeAndClear();
+ maFL2.disposeAndClear();
+ svx::sidebar::PopupControl::dispose();
}
void CellBorderStyleControl::Initialize()
@@ -81,60 +92,60 @@ void CellBorderStyleControl::Initialize()
mpImageList[14] = Image(ScResId(IMG_BORDER15));
mpImageList[15] = Image(ScResId(IMG_BORDER16));
- maTBBorder1.SetItemImage(TBI_BORDER1_NONE, mpImageList[0]);
- maTBBorder1.SetItemImage(TBI_BORDER1_ALL, mpImageList[1]);
- maTBBorder1.SetItemImage(TBI_BORDER1_OUTER, mpImageList[2]);
- maTBBorder1.SetItemImage(TBI_BORDER1_OUTERBOLD, mpImageList[3]);
- maTBBorder1.SetBackground(Wallpaper());
- maTBBorder1.SetPaintTransparent(true);
- Size aTbxSize( maTBBorder1.CalcWindowSizePixel() );
- maTBBorder1.SetOutputSizePixel( aTbxSize );
+ maTBBorder1->SetItemImage(TBI_BORDER1_NONE, mpImageList[0]);
+ maTBBorder1->SetItemImage(TBI_BORDER1_ALL, mpImageList[1]);
+ maTBBorder1->SetItemImage(TBI_BORDER1_OUTER, mpImageList[2]);
+ maTBBorder1->SetItemImage(TBI_BORDER1_OUTERBOLD, mpImageList[3]);
+ maTBBorder1->SetBackground(Wallpaper());
+ maTBBorder1->SetPaintTransparent(true);
+ Size aTbxSize( maTBBorder1->CalcWindowSizePixel() );
+ maTBBorder1->SetOutputSizePixel( aTbxSize );
Link aLink = LINK(this, CellBorderStyleControl, TB1SelectHdl);
- maTBBorder1.SetSelectHdl ( aLink );
+ maTBBorder1->SetSelectHdl ( aLink );
- maTBBorder2.SetLineCount(2);
- maTBBorder2.InsertItem(TBI_BORDER2_LEFT, mpImageList[4]);
- maTBBorder2.InsertItem(TBI_BORDER2_RIGHT, mpImageList[5]);
- maTBBorder2.InsertItem(TBI_BORDER2_TOP, mpImageList[6]);
- maTBBorder2.InsertItem(TBI_BORDER2_BOT, mpImageList[7]);
- maTBBorder2.InsertBreak();
- maTBBorder2.InsertItem(TBI_BORDER2_BLTR, mpImageList[8]);
- maTBBorder2.InsertItem(TBI_BORDER2_TLBR, mpImageList[9]);
- maTBBorder2.InsertItem(TBI_BORDER2_TOPBOT, mpImageList[10]);
- maTBBorder2.InsertItem(TBI_BORDER2_LEFTRIGHT, mpImageList[11]);
- maTBBorder2.SetBackground(Wallpaper());
- maTBBorder2.SetPaintTransparent(true);
- aTbxSize = maTBBorder2.CalcWindowSizePixel() ;
- maTBBorder2.SetOutputSizePixel( aTbxSize );
- maTBBorder2.SetHelpId(TBI_BORDER2_LEFT, HID_PROPERTYPANEL_SC_BORDER_TBI_LEFT);
- maTBBorder2.SetHelpId(TBI_BORDER2_RIGHT, HID_PROPERTYPANEL_SC_BORDER_TBI_RIGHT);
- maTBBorder2.SetHelpId(TBI_BORDER2_TOP, HID_PROPERTYPANEL_SC_BORDER_TBI_TOP);
- maTBBorder2.SetHelpId(TBI_BORDER2_BOT, HID_PROPERTYPANEL_SC_BORDER_TBI_BOT);
- maTBBorder2.SetHelpId(TBI_BORDER2_BLTR, HID_PROPERTYPANEL_SC_BORDER_TBI_BLTR);
- maTBBorder2.SetHelpId(TBI_BORDER2_TLBR, HID_PROPERTYPANEL_SC_BORDER_TBI_TLBR);
- maTBBorder2.SetHelpId(TBI_BORDER2_TOPBOT, HID_PROPERTYPANEL_SC_BORDER_TBI_TOPBOT);
- maTBBorder2.SetHelpId(TBI_BORDER2_LEFTRIGHT, HID_PROPERTYPANEL_SC_BORDER_TBI_LEFTRIGHT);
- maTBBorder2.SetItemText(TBI_BORDER2_LEFT, ScResId(STR_BORDER_1));
- maTBBorder2.SetItemText(TBI_BORDER2_RIGHT, ScResId(STR_BORDER_2));
- maTBBorder2.SetItemText(TBI_BORDER2_TOP, ScResId(STR_BORDER_3));
- maTBBorder2.SetItemText(TBI_BORDER2_BOT, ScResId(STR_BORDER_4));
- maTBBorder2.SetItemText(TBI_BORDER2_BLTR, ScResId(STR_BORDER_5));
- maTBBorder2.SetItemText(TBI_BORDER2_TLBR, ScResId(STR_BORDER_6));
- maTBBorder2.SetItemText(TBI_BORDER2_TOPBOT, ScResId(STR_BORDER_7));
- maTBBorder2.SetItemText(TBI_BORDER2_LEFTRIGHT, ScResId(STR_BORDER_8));
+ maTBBorder2->SetLineCount(2);
+ maTBBorder2->InsertItem(TBI_BORDER2_LEFT, mpImageList[4]);
+ maTBBorder2->InsertItem(TBI_BORDER2_RIGHT, mpImageList[5]);
+ maTBBorder2->InsertItem(TBI_BORDER2_TOP, mpImageList[6]);
+ maTBBorder2->InsertItem(TBI_BORDER2_BOT, mpImageList[7]);
+ maTBBorder2->InsertBreak();
+ maTBBorder2->InsertItem(TBI_BORDER2_BLTR, mpImageList[8]);
+ maTBBorder2->InsertItem(TBI_BORDER2_TLBR, mpImageList[9]);
+ maTBBorder2->InsertItem(TBI_BORDER2_TOPBOT, mpImageList[10]);
+ maTBBorder2->InsertItem(TBI_BORDER2_LEFTRIGHT, mpImageList[11]);
+ maTBBorder2->SetBackground(Wallpaper());
+ maTBBorder2->SetPaintTransparent(true);
+ aTbxSize = maTBBorder2->CalcWindowSizePixel() ;
+ maTBBorder2->SetOutputSizePixel( aTbxSize );
+ maTBBorder2->SetHelpId(TBI_BORDER2_LEFT, HID_PROPERTYPANEL_SC_BORDER_TBI_LEFT);
+ maTBBorder2->SetHelpId(TBI_BORDER2_RIGHT, HID_PROPERTYPANEL_SC_BORDER_TBI_RIGHT);
+ maTBBorder2->SetHelpId(TBI_BORDER2_TOP, HID_PROPERTYPANEL_SC_BORDER_TBI_TOP);
+ maTBBorder2->SetHelpId(TBI_BORDER2_BOT, HID_PROPERTYPANEL_SC_BORDER_TBI_BOT);
+ maTBBorder2->SetHelpId(TBI_BORDER2_BLTR, HID_PROPERTYPANEL_SC_BORDER_TBI_BLTR);
+ maTBBorder2->SetHelpId(TBI_BORDER2_TLBR, HID_PROPERTYPANEL_SC_BORDER_TBI_TLBR);
+ maTBBorder2->SetHelpId(TBI_BORDER2_TOPBOT, HID_PROPERTYPANEL_SC_BORDER_TBI_TOPBOT);
+ maTBBorder2->SetHelpId(TBI_BORDER2_LEFTRIGHT, HID_PROPERTYPANEL_SC_BORDER_TBI_LEFTRIGHT);
+ maTBBorder2->SetItemText(TBI_BORDER2_LEFT, ScResId(STR_BORDER_1));
+ maTBBorder2->SetItemText(TBI_BORDER2_RIGHT, ScResId(STR_BORDER_2));
+ maTBBorder2->SetItemText(TBI_BORDER2_TOP, ScResId(STR_BORDER_3));
+ maTBBorder2->SetItemText(TBI_BORDER2_BOT, ScResId(STR_BORDER_4));
+ maTBBorder2->SetItemText(TBI_BORDER2_BLTR, ScResId(STR_BORDER_5));
+ maTBBorder2->SetItemText(TBI_BORDER2_TLBR, ScResId(STR_BORDER_6));
+ maTBBorder2->SetItemText(TBI_BORDER2_TOPBOT, ScResId(STR_BORDER_7));
+ maTBBorder2->SetItemText(TBI_BORDER2_LEFTRIGHT, ScResId(STR_BORDER_8));
aLink = LINK(this, CellBorderStyleControl, TB2SelectHdl);
- maTBBorder2.SetSelectHdl ( aLink );
+ maTBBorder2->SetSelectHdl ( aLink );
- maTBBorder3.SetItemImage(TBI_BORDER3_S1, mpImageList[12]);
- maTBBorder3.SetItemImage(TBI_BORDER3_S2, mpImageList[13]);
- maTBBorder3.SetItemImage(TBI_BORDER3_S3, mpImageList[14]);
- maTBBorder3.SetItemImage(TBI_BORDER3_S4, mpImageList[15]);
- maTBBorder3.SetBackground(Wallpaper());
- maTBBorder3.SetPaintTransparent(true);
- aTbxSize = maTBBorder3.CalcWindowSizePixel() ;
- maTBBorder3.SetOutputSizePixel( aTbxSize );
+ maTBBorder3->SetItemImage(TBI_BORDER3_S1, mpImageList[12]);
+ maTBBorder3->SetItemImage(TBI_BORDER3_S2, mpImageList[13]);
+ maTBBorder3->SetItemImage(TBI_BORDER3_S3, mpImageList[14]);
+ maTBBorder3->SetItemImage(TBI_BORDER3_S4, mpImageList[15]);
+ maTBBorder3->SetBackground(Wallpaper());
+ maTBBorder3->SetPaintTransparent(true);
+ aTbxSize = maTBBorder3->CalcWindowSizePixel() ;
+ maTBBorder3->SetOutputSizePixel( aTbxSize );
aLink = LINK(this, CellBorderStyleControl, TB3SelectHdl);
- maTBBorder3.SetSelectHdl ( aLink );
+ maTBBorder3->SetSelectHdl ( aLink );
}
IMPL_LINK(CellBorderStyleControl, TB1SelectHdl, ToolBox*, pToolBox)
diff --git a/sc/source/ui/sidebar/CellBorderStyleControl.hxx b/sc/source/ui/sidebar/CellBorderStyleControl.hxx
index cf0db80ae3ef..706d10e7b11c 100644
--- a/sc/source/ui/sidebar/CellBorderStyleControl.hxx
+++ b/sc/source/ui/sidebar/CellBorderStyleControl.hxx
@@ -32,11 +32,11 @@ class CellBorderStyleControl : public svx::sidebar::PopupControl
{
private:
CellAppearancePropertyPanel& mrCellAppearancePropertyPanel;
- ToolBox maTBBorder1;
- ToolBox maTBBorder2;
- ToolBox maTBBorder3;
- FixedLine maFL1;
- FixedLine maFL2;
+ VclPtr<ToolBox> maTBBorder1;
+ VclPtr<ToolBox> maTBBorder2;
+ VclPtr<ToolBox> maTBBorder3;
+ VclPtr<FixedLine> maFL1;
+ VclPtr<FixedLine> maFL2;
Image* mpImageList;
void Initialize();
@@ -48,6 +48,7 @@ private:
public:
CellBorderStyleControl(vcl::Window* pParent, CellAppearancePropertyPanel& rPanel);
virtual ~CellBorderStyleControl();
+ virtual void dispose() SAL_OVERRIDE;
};
} } // end of namespace svx::sidebar
diff --git a/sc/source/ui/sidebar/CellLineStyleControl.cxx b/sc/source/ui/sidebar/CellLineStyleControl.cxx
index ac4d3467327b..0528df76bc98 100644
--- a/sc/source/ui/sidebar/CellLineStyleControl.cxx
+++ b/sc/source/ui/sidebar/CellLineStyleControl.cxx
@@ -36,27 +36,39 @@ namespace sc { namespace sidebar {
CellLineStyleControl::CellLineStyleControl(vcl::Window* pParent, CellAppearancePropertyPanel& rPanel)
: svx::sidebar::PopupControl(pParent, ScResId(RID_POPUPPANEL_APPEARANCE_CELL_LINESTYLE)),
mrCellAppearancePropertyPanel(rPanel),
- maPushButtonMoreOptions(this, ScResId(PB_OPTIONS)),
- maCellLineStyleValueSet(this, ScResId(VS_STYLE)),
+ maPushButtonMoreOptions(VclPtr<PushButton>::Create(this, ScResId(PB_OPTIONS))),
+ maCellLineStyleValueSet(VclPtr<sc::sidebar::CellLineStyleValueSet>::Create(this, ScResId(VS_STYLE))),
mbVSfocus(true)
{
Initialize();
FreeResource();
}
+CellLineStyleControl::~CellLineStyleControl()
+{
+ disposeOnce();
+}
+
+void CellLineStyleControl::dispose()
+{
+ maPushButtonMoreOptions.disposeAndClear();
+ maCellLineStyleValueSet.disposeAndClear();
+ svx::sidebar::PopupControl::dispose();
+}
+
void CellLineStyleControl::Initialize()
{
- //maPushButtonMoreOptions.SetIcoPosX(2);
+ //maPushButtonMoreOptions->SetIcoPosX(2);
Link aLink = LINK(this, CellLineStyleControl, PBClickHdl);
- maPushButtonMoreOptions.SetClickHdl(aLink);
+ maPushButtonMoreOptions->SetClickHdl(aLink);
- maCellLineStyleValueSet.SetStyle(maCellLineStyleValueSet.GetStyle()| WB_3DLOOK | WB_NO_DIRECTSELECT);
- maCellLineStyleValueSet.SetControlBackground(GetSettings().GetStyleSettings().GetMenuColor());
- maCellLineStyleValueSet.SetColor(GetSettings().GetStyleSettings().GetMenuColor());
+ maCellLineStyleValueSet->SetStyle(maCellLineStyleValueSet->GetStyle()| WB_3DLOOK | WB_NO_DIRECTSELECT);
+ maCellLineStyleValueSet->SetControlBackground(GetSettings().GetStyleSettings().GetMenuColor());
+ maCellLineStyleValueSet->SetColor(GetSettings().GetStyleSettings().GetMenuColor());
for(sal_uInt16 i = 1 ; i <= 9 ; i++)
{
- maCellLineStyleValueSet.InsertItem(i);
+ maCellLineStyleValueSet->InsertItem(i);
}
maStr[0] = GetSettings().GetLocaleI18nHelper().GetNum( 5, 2 ) + "pt";
@@ -68,46 +80,46 @@ void CellLineStyleControl::Initialize()
maStr[6] = GetSettings().GetLocaleI18nHelper().GetNum( 450, 2 ) + "pt";
maStr[7] = GetSettings().GetLocaleI18nHelper().GetNum( 505, 2 ) + "pt";
maStr[8] = GetSettings().GetLocaleI18nHelper().GetNum( 750, 2 ) + "pt";
- maCellLineStyleValueSet.SetUnit(&maStr[0]);
+ maCellLineStyleValueSet->SetUnit(&maStr[0]);
for (sal_uInt16 i = 1; i <= CELL_LINE_STYLE_ENTRIES; ++i)
{
- maCellLineStyleValueSet.SetItemText(i, maStr[i-1]);
+ maCellLineStyleValueSet->SetItemText(i, maStr[i-1]);
}
SetAllNoSel();
aLink = LINK(this, CellLineStyleControl, VSSelectHdl);
- maCellLineStyleValueSet.SetSelectHdl(aLink);
- maCellLineStyleValueSet.StartSelection();
- maCellLineStyleValueSet.Show();
+ maCellLineStyleValueSet->SetSelectHdl(aLink);
+ maCellLineStyleValueSet->StartSelection();
+ maCellLineStyleValueSet->Show();
}
void CellLineStyleControl::GetFocus()
{
if(!mbVSfocus)
{
- maPushButtonMoreOptions.GrabFocus();
+ maPushButtonMoreOptions->GrabFocus();
}
else
{
- maCellLineStyleValueSet.GrabFocus();
+ maCellLineStyleValueSet->GrabFocus();
}
}
void CellLineStyleControl::SetAllNoSel()
{
- maCellLineStyleValueSet.SelectItem(0);
- maCellLineStyleValueSet.SetNoSelection();
- maCellLineStyleValueSet.Format();
+ maCellLineStyleValueSet->SelectItem(0);
+ maCellLineStyleValueSet->SetNoSelection();
+ maCellLineStyleValueSet->Format();
Invalidate();
- maCellLineStyleValueSet.StartSelection();
+ maCellLineStyleValueSet->StartSelection();
}
IMPL_LINK(CellLineStyleControl, VSSelectHdl, void *, pControl)
{
if(pControl == &maCellLineStyleValueSet)
{
- const sal_uInt16 iPos(maCellLineStyleValueSet.GetSelectItemId());
+ const sal_uInt16 iPos(maCellLineStyleValueSet->GetSelectItemId());
SvxLineItem aLineItem(SID_FRAME_LINESTYLE);
using namespace ::com::sun::star::table::BorderLineStyle;
editeng::SvxBorderStyle nStyle = SOLID;
@@ -178,7 +190,7 @@ IMPL_LINK(CellLineStyleControl, VSSelectHdl, void *, pControl)
IMPL_LINK(CellLineStyleControl, PBClickHdl, PushButton *, pPBtn)
{
- if(pPBtn == &maPushButtonMoreOptions)
+ if(pPBtn == maPushButtonMoreOptions.get())
{
if(mrCellAppearancePropertyPanel.GetBindings())
{
@@ -200,48 +212,48 @@ void CellLineStyleControl::SetLineStyleSelect(sal_uInt16 out, sal_uInt16 in, sal
if(out == DEF_LINE_WIDTH_0 && in == 0 && dis == 0) //1
{
- maCellLineStyleValueSet.SetSelItem(1);
+ maCellLineStyleValueSet->SetSelItem(1);
}
else if(out == DEF_LINE_WIDTH_2 && in == 0 && dis == 0) //2
{
- maCellLineStyleValueSet.SetSelItem(2);
+ maCellLineStyleValueSet->SetSelItem(2);
}
else if(out == DEF_LINE_WIDTH_3 && in == 0 && dis == 0) //3
{
- maCellLineStyleValueSet.SetSelItem(3);
+ maCellLineStyleValueSet->SetSelItem(3);
}
else if(out == DEF_LINE_WIDTH_4 && in == 0 && dis == 0) //4
{
- maCellLineStyleValueSet.SetSelItem(4);
+ maCellLineStyleValueSet->SetSelItem(4);
}
else if(out == DEF_LINE_WIDTH_0 && in == DEF_LINE_WIDTH_0 && dis == DEF_LINE_WIDTH_1) //5
{
- maCellLineStyleValueSet.SetSelItem(5);
+ maCellLineStyleValueSet->SetSelItem(5);
}
else if(out == DEF_LINE_WIDTH_0 && in == DEF_LINE_WIDTH_0 && dis == DEF_LINE_WIDTH_2) //6
{
- maCellLineStyleValueSet.SetSelItem(6);
+ maCellLineStyleValueSet->SetSelItem(6);
}
else if(out == DEF_LINE_WIDTH_1 && in == DEF_LINE_WIDTH_2 && dis == DEF_LINE_WIDTH_1) //7
{
- maCellLineStyleValueSet.SetSelItem(7);
+ maCellLineStyleValueSet->SetSelItem(7);
}
else if(out == DEF_LINE_WIDTH_2 && in == DEF_LINE_WIDTH_0 && dis == DEF_LINE_WIDTH_2) //8
{
- maCellLineStyleValueSet.SetSelItem(8);
+ maCellLineStyleValueSet->SetSelItem(8);
}
else if(out == DEF_LINE_WIDTH_2 && in == DEF_LINE_WIDTH_2 && dis == DEF_LINE_WIDTH_2) //9
{
- maCellLineStyleValueSet.SetSelItem(9);
+ maCellLineStyleValueSet->SetSelItem(9);
}
else
{
- maCellLineStyleValueSet.SetSelItem(0);
+ maCellLineStyleValueSet->SetSelItem(0);
mbVSfocus = false;
}
- maCellLineStyleValueSet.Format();
- maCellLineStyleValueSet.StartSelection();
+ maCellLineStyleValueSet->Format();
+ maCellLineStyleValueSet->StartSelection();
}
} } // end of namespace svx::sidebar
diff --git a/sc/source/ui/sidebar/CellLineStyleControl.hxx b/sc/source/ui/sidebar/CellLineStyleControl.hxx
index a00079ac8dbd..3b772db89fd9 100644
--- a/sc/source/ui/sidebar/CellLineStyleControl.hxx
+++ b/sc/source/ui/sidebar/CellLineStyleControl.hxx
@@ -31,8 +31,8 @@ class CellLineStyleControl : public svx::sidebar::PopupControl
{
private:
CellAppearancePropertyPanel& mrCellAppearancePropertyPanel;
- PushButton maPushButtonMoreOptions;
- CellLineStyleValueSet maCellLineStyleValueSet;
+ VclPtr<PushButton> maPushButtonMoreOptions;
+ VclPtr<CellLineStyleValueSet> maCellLineStyleValueSet;
OUString maStr[CELL_LINE_STYLE_ENTRIES];
/// bitfield
@@ -46,18 +46,20 @@ private:
public:
CellLineStyleControl(vcl::Window* pParent, CellAppearancePropertyPanel& rPanel);
+ virtual ~CellLineStyleControl();
+ virtual void dispose() SAL_OVERRIDE;
void GetFocus() SAL_OVERRIDE;
void SetLineStyleSelect(sal_uInt16 out, sal_uInt16 in, sal_uInt16 dis);
ValueSet& GetValueSet()
{
- return maCellLineStyleValueSet;
+ return *maCellLineStyleValueSet.get();
}
Control& GetPushButton()
{
- return maPushButtonMoreOptions;
+ return *maPushButtonMoreOptions.get();
}
};
diff --git a/sc/source/ui/sidebar/CellLineStyleValueSet.cxx b/sc/source/ui/sidebar/CellLineStyleValueSet.cxx
index eae59d67fa17..800c8b3ddc69 100644
--- a/sc/source/ui/sidebar/CellLineStyleValueSet.cxx
+++ b/sc/source/ui/sidebar/CellLineStyleValueSet.cxx
@@ -34,7 +34,13 @@ CellLineStyleValueSet::CellLineStyleValueSet( vcl::Window* pParent, const ResId&
CellLineStyleValueSet::~CellLineStyleValueSet()
{
- delete pVDev;
+ disposeOnce();
+}
+
+void CellLineStyleValueSet::dispose()
+{
+ pVDev.disposeAndClear();
+ ValueSet::dispose();
}
void CellLineStyleValueSet::SetUnit(const OUString* str)
diff --git a/sc/source/ui/sidebar/CellLineStyleValueSet.hxx b/sc/source/ui/sidebar/CellLineStyleValueSet.hxx
index 969f346005d4..45cbb91fd509 100644
--- a/sc/source/ui/sidebar/CellLineStyleValueSet.hxx
+++ b/sc/source/ui/sidebar/CellLineStyleValueSet.hxx
@@ -29,12 +29,13 @@ namespace sc { namespace sidebar {
class CellLineStyleValueSet : public ValueSet
{
private:
- VirtualDevice* pVDev;
+ VclPtr<VirtualDevice> pVDev;
sal_uInt16 nSelItem;
OUString maStrUnit[CELL_LINE_STYLE_ENTRIES];
public:
CellLineStyleValueSet( vcl::Window* pParent, const ResId& rResId);
virtual ~CellLineStyleValueSet();
+ virtual void dispose() SAL_OVERRIDE;
void SetUnit(const OUString* str);
void SetSelItem(sal_uInt16 nSel);
diff --git a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
index c37fc116b58b..3d59a6dfce51 100644
--- a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
+++ b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
@@ -70,6 +70,22 @@ NumberFormatPropertyPanel::NumberFormatPropertyPanel(
NumberFormatPropertyPanel::~NumberFormatPropertyPanel()
{
+ disposeOnce();
+}
+
+void NumberFormatPropertyPanel::dispose()
+{
+ mpLbCategory.clear();
+ mpTBCategory.clear();
+ mpEdDecimals.clear();
+ mpEdLeadZeroes.clear();
+ mpBtnNegRed.clear();
+ mpBtnThousand.clear();
+
+ maNumFormatControl.dispose();
+ maFormatControl.dispose();
+
+ PanelLayout::dispose();
}
void NumberFormatPropertyPanel::Initialize()
@@ -166,7 +182,7 @@ IMPL_LINK( NumberFormatPropertyPanel, NumFormatValueHdl, void*, EMPTYARG )
return 0L;
}
-NumberFormatPropertyPanel* NumberFormatPropertyPanel::Create (
+VclPtr<vcl::Window> NumberFormatPropertyPanel::Create (
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings)
@@ -178,10 +194,8 @@ NumberFormatPropertyPanel* NumberFormatPropertyPanel::Create (
if (pBindings == NULL)
throw lang::IllegalArgumentException("no SfxBindings given to NumberFormatPropertyPanel::Create", NULL, 2);
- return new NumberFormatPropertyPanel(
- pParent,
- rxFrame,
- pBindings);
+ return VclPtr<NumberFormatPropertyPanel>::Create(
+ pParent, rxFrame, pBindings);
}
void NumberFormatPropertyPanel::DataChanged(
diff --git a/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx b/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx
index 5fe5df1aeb63..9a162beaf1b5 100644
--- a/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx
+++ b/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx
@@ -37,7 +37,7 @@ class NumberFormatPropertyPanel
{
public:
public:
- static NumberFormatPropertyPanel* Create(
+ static VclPtr<vcl::Window> Create(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings);
@@ -56,14 +56,21 @@ public:
SfxBindings* GetBindings() { return mpBindings;}
+ // constructor/destuctor
+ NumberFormatPropertyPanel(
+ vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ SfxBindings* pBindings);
+ virtual ~NumberFormatPropertyPanel();
+ virtual void dispose() SAL_OVERRIDE;
private:
//ui controls
- ListBox* mpLbCategory;
- ToolBox* mpTBCategory;
- NumericField* mpEdDecimals;
- NumericField* mpEdLeadZeroes;
- CheckBox* mpBtnNegRed;
- CheckBox* mpBtnThousand;
+ VclPtr<ListBox> mpLbCategory;
+ VclPtr<ToolBox> mpTBCategory;
+ VclPtr<NumericField> mpEdDecimals;
+ VclPtr<NumericField> mpEdLeadZeroes;
+ VclPtr<CheckBox> mpBtnNegRed;
+ VclPtr<CheckBox> mpBtnThousand;
::sfx2::sidebar::ControllerItem maNumFormatControl;
::sfx2::sidebar::ControllerItem maFormatControl;
@@ -78,13 +85,6 @@ private:
DECL_LINK(NumFormatSelectHdl, ListBox*);
DECL_LINK(NumFormatValueHdl, void*);
- // constructor/destuctor
- NumberFormatPropertyPanel(
- vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings);
- virtual ~NumberFormatPropertyPanel();
-
void Initialize();
};
diff --git a/sc/source/ui/sidebar/ScPanelFactory.cxx b/sc/source/ui/sidebar/ScPanelFactory.cxx
index cb1c23852bdc..24cf2ede34df 100644
--- a/sc/source/ui/sidebar/ScPanelFactory.cxx
+++ b/sc/source/ui/sidebar/ScPanelFactory.cxx
@@ -108,51 +108,31 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement (
"PanelFactory::createUIElement called without SfxBindings",
NULL);
+ sal_Int32 nMinimumSize = -1;
+ VclPtr<vcl::Window> pPanel;
if (rsResourceURL.endsWith("/AlignmentPropertyPanel"))
- {
- AlignmentPropertyPanel* pPanel = AlignmentPropertyPanel::Create( pParentWindow, xFrame, pBindings );
- xElement = sfx2::sidebar::SidebarPanelBase::Create(
- rsResourceURL,
- xFrame,
- pPanel,
- ui::LayoutSize(-1,-1,-1));
- }
+ pPanel = AlignmentPropertyPanel::Create( pParentWindow, xFrame, pBindings );
else if (rsResourceURL.endsWith("/CellAppearancePropertyPanel"))
- {
- CellAppearancePropertyPanel* pPanel = CellAppearancePropertyPanel::Create( pParentWindow, xFrame, pBindings );
- xElement = sfx2::sidebar::SidebarPanelBase::Create(
- rsResourceURL,
- xFrame,
- pPanel,
- ui::LayoutSize(-1,-1,-1));
- }
+ pPanel = CellAppearancePropertyPanel::Create( pParentWindow, xFrame, pBindings );
else if (rsResourceURL.endsWith("/NumberFormatPropertyPanel"))
- {
- NumberFormatPropertyPanel* pPanel = NumberFormatPropertyPanel::Create( pParentWindow, xFrame, pBindings );
- xElement = sfx2::sidebar::SidebarPanelBase::Create(
- rsResourceURL,
- xFrame,
- pPanel,
- ui::LayoutSize(-1,-1,-1));
- }
+ pPanel = NumberFormatPropertyPanel::Create( pParentWindow, xFrame, pBindings );
else if (rsResourceURL.endsWith("/NavigatorPanel"))
{
- vcl::Window* pPanel = new ScNavigatorDlg(pBindings, NULL, pParentWindow, false);
- xElement = sfx2::sidebar::SidebarPanelBase::Create(
- rsResourceURL,
- xFrame,
- pPanel,
- ui::LayoutSize(0,-1,-1));
+ pPanel = VclPtr<vcl::Window>(new ScNavigatorDlg(pBindings, NULL, pParentWindow, false), SAL_NO_ACQUIRE);
+ nMinimumSize = 0;
}
else if (rsResourceURL.endsWith("/FunctionsPanel"))
{
- vcl::Window* pPanel = new ScFunctionDockWin(pBindings, NULL, pParentWindow, ScResId(FID_FUNCTION_BOX));
+ pPanel = VclPtr<vcl::Window>(new ScFunctionDockWin(pBindings, NULL, pParentWindow, ScResId(FID_FUNCTION_BOX)), SAL_NO_ACQUIRE);;
+ nMinimumSize = 0;
+ }
+
+ if (pPanel)
xElement = sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL,
xFrame,
pPanel,
- ui::LayoutSize(0,-1,-1));
- }
+ ui::LayoutSize(nMinimumSize,-1,-1));
}
catch (const uno::RuntimeException &)
{
diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx
index 23fa4ed4d7b3..a383eed17f2f 100644
--- a/sc/source/ui/undo/undobase.cxx
+++ b/sc/source/ui/undo/undobase.cxx
@@ -257,7 +257,7 @@ bool ScBlockUndo::AdjustHeight()
{
ScDocument& rDoc = pDocShell->GetDocument();
- VirtualDevice aVirtDev;
+ ScopedVclPtrInstance< VirtualDevice > pVirtDev;
Fraction aZoomX( 1, 1 );
Fraction aZoomY = aZoomX;
double nPPTX, nPPTY;
@@ -277,7 +277,7 @@ bool ScBlockUndo::AdjustHeight()
nPPTY = ScGlobal::nScreenPPTY;
}
- sc::RowHeightContext aCxt(nPPTX, nPPTY, aZoomX, aZoomY, &aVirtDev);
+ sc::RowHeightContext aCxt(nPPTX, nPPTY, aZoomX, aZoomY, pVirtDev);
bool bRet = rDoc.SetOptimalHeight(
aCxt, aBlockRange.aStart.Row(), aBlockRange.aEnd.Row(), aBlockRange.aStart.Tab());
@@ -355,7 +355,7 @@ void ScMultiBlockUndo::AdjustHeight()
{
ScDocument& rDoc = pDocShell->GetDocument();
- VirtualDevice aVirtDev;
+ ScopedVclPtrInstance< VirtualDevice > pVirtDev;
Fraction aZoomX( 1, 1 );
Fraction aZoomY = aZoomX;
double nPPTX, nPPTY;
@@ -375,7 +375,7 @@ void ScMultiBlockUndo::AdjustHeight()
nPPTY = ScGlobal::nScreenPPTY;
}
- sc::RowHeightContext aCxt(nPPTX, nPPTY, aZoomX, aZoomY, &aVirtDev);
+ sc::RowHeightContext aCxt(nPPTX, nPPTY, aZoomX, aZoomY, pVirtDev);
for (size_t i = 0, n = maBlockRanges.size(); i < n; ++i)
{
const ScRange& r = *maBlockRanges[i];
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index 15e0a90533c6..fbf3d5a251a5 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -1182,11 +1182,11 @@ void ScUndoDragDrop::PaintArea( ScRange aRange, sal_uInt16 nExtFlags ) const
if (pViewShell)
{
- VirtualDevice aVirtDev;
+ ScopedVclPtrInstance< VirtualDevice > pVirtDev;
ScViewData& rViewData = pViewShell->GetViewData();
sc::RowHeightContext aCxt(
rViewData.GetPPTX(), rViewData.GetPPTY(), rViewData.GetZoomX(), rViewData.GetZoomY(),
- &aVirtDev);
+ pVirtDev);
if (rDoc.SetOptimalHeight(aCxt, aRange.aStart.Row(), aRange.aEnd.Row(), aRange.aStart.Tab()))
{
diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index c403ab43d0d1..764d7170f624 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -841,7 +841,7 @@ void ScUndoAutoFormat::Redo()
if (bSize)
{
- VirtualDevice aVirtDev;
+ ScopedVclPtrInstance< VirtualDevice > pVirtDev;
Fraction aZoomX(1,1);
Fraction aZoomY = aZoomX;
double nPPTX,nPPTY;
@@ -863,7 +863,7 @@ void ScUndoAutoFormat::Redo()
bool bFormula = false; // remember
- sc::RowHeightContext aCxt(nPPTX, nPPTY, aZoomX, aZoomY, &aVirtDev);
+ sc::RowHeightContext aCxt(nPPTX, nPPTY, aZoomX, aZoomY, pVirtDev);
for (SCTAB nTab=nStartZ; nTab<=nEndZ; nTab++)
{
ScMarkData aDestMark;
@@ -886,7 +886,7 @@ void ScUndoAutoFormat::Redo()
if (!rDoc.ColHidden(nCol, nTab))
{
sal_uInt16 nThisSize = STD_EXTRA_WIDTH + rDoc.GetOptimalColWidth( nCol, nTab,
- &aVirtDev, nPPTX, nPPTY, aZoomX, aZoomY, bFormula,
+ pVirtDev, nPPTX, nPPTY, aZoomX, aZoomY, bFormula,
&aDestMark );
rDoc.SetColWidth( nCol, nTab, nThisSize );
rDoc.ShowCol( nCol, nTab, true );
diff --git a/sc/source/ui/undo/undostyl.cxx b/sc/source/ui/undo/undostyl.cxx
index 41f733a1d6c1..6e9c5f61b902 100644
--- a/sc/source/ui/undo/undostyl.cxx
+++ b/sc/source/ui/undo/undostyl.cxx
@@ -106,12 +106,12 @@ static void lcl_DocStyleChanged( ScDocument* pDoc, SfxStyleSheetBase* pStyle, bo
{
//! move to document or docshell
- VirtualDevice aVDev;
- Point aLogic = aVDev.LogicToPixel( Point(1000,1000), MAP_TWIP );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
+ Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP );
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
Fraction aZoom(1,1);
- pDoc->StyleSheetChanged( pStyle, bRemoved, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
+ pDoc->StyleSheetChanged( pStyle, bRemoved, pVDev, nPPTX, nPPTY, aZoom, aZoom );
ScInputHandler* pHdl = SC_MOD()->GetInputHdl();
if (pHdl)
diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx
index c7f19d4f4b93..728d17c5f8fd 100644
--- a/sc/source/ui/unoobj/confuno.cxx
+++ b/sc/source/ui/unoobj/confuno.cxx
@@ -191,11 +191,11 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue(
{
if (pPrinter->GetName() != sPrinterName)
{
- SfxPrinter* pNewPrinter = new SfxPrinter( pPrinter->GetOptions().Clone(), sPrinterName );
+ VclPtrInstance<SfxPrinter> pNewPrinter( pPrinter->GetOptions().Clone(), sPrinterName );
if (pNewPrinter->IsKnown())
pDocShell->SetPrinter( pNewPrinter, SfxPrinterChangeFlags::PRINTER );
else
- delete pNewPrinter;
+ pNewPrinter.disposeAndClear();
}
}
else
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index 97cf5747f2c3..7bbce7a4b1cb 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -755,12 +755,12 @@ void SAL_CALL ScStyleFamilyObj::removeByName( const OUString& aName )
if ( eFamily == SFX_STYLE_FAMILY_PARA )
{
// wie ScViewFunc::RemoveStyleSheetInUse
- VirtualDevice aVDev;
- Point aLogic = aVDev.LogicToPixel( Point(1000,1000), MAP_TWIP );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
+ Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP );
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
Fraction aZoom(1,1);
- rDoc.StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
+ rDoc.StyleSheetChanged( pStyle, false, pVDev, nPPTX, nPPTY, aZoom, aZoom );
pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT );
pDocShell->SetDocumentModified();
@@ -1096,12 +1096,12 @@ void SAL_CALL ScStyleObj::setParentStyle( const OUString& rParentStyle )
{
// Zeilenhoehen anpassen...
- VirtualDevice aVDev;
- Point aLogic = aVDev.LogicToPixel( Point(1000,1000), MAP_TWIP );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
+ Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP );
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
Fraction aZoom(1,1);
- rDoc.StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
+ rDoc.StyleSheetChanged( pStyle, false, pVDev, nPPTX, nPPTY, aZoom, aZoom );
if (!rDoc.IsImportingXML())
{
@@ -1463,12 +1463,12 @@ void SAL_CALL ScStyleObj::setAllPropertiesToDefault()
{
// row heights
- VirtualDevice aVDev;
- Point aLogic = aVDev.LogicToPixel( Point(1000,1000), MAP_TWIP );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
+ Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP );
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
Fraction aZoom(1,1);
- rDoc.StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
+ rDoc.StyleSheetChanged( pStyle, false, pVDev, nPPTX, nPPTY, aZoom, aZoom );
if (!rDoc.IsImportingXML())
{
@@ -1845,12 +1845,12 @@ void ScStyleObj::SetOnePropertyValue( const OUString& rPropertyName, const SfxIt
{
// Zeilenhoehen anpassen...
- VirtualDevice aVDev;
- Point aLogic = aVDev.LogicToPixel( Point(1000,1000), MAP_TWIP );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
+ Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP );
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
Fraction aZoom(1,1);
- rDoc.StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom );
+ rDoc.StyleSheetChanged( pStyle, false, pVDev, nPPTX, nPPTY, aZoom, aZoom );
if (!rDoc.IsImportingXML())
{
diff --git a/sc/source/ui/vba/vbaeventshelper.cxx b/sc/source/ui/vba/vbaeventshelper.cxx
index 0c8eaf4f5263..078060d87e25 100644
--- a/sc/source/ui/vba/vbaeventshelper.cxx
+++ b/sc/source/ui/vba/vbaeventshelper.cxx
@@ -162,14 +162,14 @@ private:
DECL_LINK( processWindowResizeEvent, vcl::Window* );
private:
- typedef ::std::map< vcl::Window*, uno::Reference< frame::XController > > WindowControllerMap;
+ typedef ::std::map< VclPtr<vcl::Window>, uno::Reference< frame::XController > > WindowControllerMap;
::osl::Mutex maMutex;
ScVbaEventsHelper& mrVbaEvents;
uno::Reference< frame::XModel > mxModel;
ScDocShell* mpDocShell;
WindowControllerMap maControllers; /// Maps VCL top windows to their controllers.
- vcl::Window* mpActiveWindow; /// Currently activated window, to prevent multiple (de)activation.
+ VclPtr<vcl::Window> mpActiveWindow; /// Currently activated window, to prevent multiple (de)activation.
bool mbWindowResized; /// True = window resize system event processed.
bool mbBorderChanged; /// True = borders changed system event processed.
bool mbDisposed;
@@ -274,7 +274,7 @@ void SAL_CALL ScVbaEventListener::windowActivated( const lang::EventObject& rEve
{
uno::Reference< awt::XWindow > xWindow( rEvent.Source, uno::UNO_QUERY );
vcl::Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
- OSL_TRACE( "ScVbaEventListener::windowActivated - pWindow = 0x%p, mpActiveWindow = 0x%p", pWindow, mpActiveWindow );
+ OSL_TRACE( "ScVbaEventListener::windowActivated - pWindow = 0x%p, mpActiveWindow = 0x%p", pWindow, mpActiveWindow.get() );
// do not fire activation event multiple time for the same window
if( pWindow && (pWindow != mpActiveWindow) )
{
@@ -296,7 +296,7 @@ void SAL_CALL ScVbaEventListener::windowDeactivated( const lang::EventObject& rE
{
uno::Reference< awt::XWindow > xWindow( rEvent.Source, uno::UNO_QUERY );
vcl::Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
- OSL_TRACE( "ScVbaEventListener::windowDeactivated - pWindow = 0x%p, mpActiveWindow = 0x%p", pWindow, mpActiveWindow );
+ OSL_TRACE( "ScVbaEventListener::windowDeactivated - pWindow = 0x%p, mpActiveWindow = 0x%p", pWindow, mpActiveWindow.get() );
// do not fire the deactivation event, if the window is not active (prevent multiple deactivation)
if( pWindow && (pWindow == mpActiveWindow) )
processWindowActivateEvent( pWindow, false );
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 2d7639f2e95a..1145e2bd5633 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -1931,7 +1931,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
const ScPatternAttr* pPattern = pDoc->GetPattern(aPos.Col(), aPos.Row(), aPos.Tab());
const std::vector<sal_uInt32>& rCondFormats = static_cast<const ScCondFormatItem&>(pPattern->GetItem(ATTR_CONDITIONAL)).GetCondFormatData();
bool bContainsCondFormat = !rCondFormats.empty();
- boost::scoped_ptr<ScCondFormatDlg> pCondFormatDlg;
+ VclPtr<ScCondFormatDlg> pCondFormatDlg;
if(bContainsCondFormat)
{
bool bContainsExistingCondFormat = false;
@@ -1950,7 +1950,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
{
// found a matching range, edit this conditional format
nKey = pCondFormat->GetKey();
- pCondFormatDlg.reset( new ScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, pCondFormat, rCondFormatRange, aPos, condformat::dialog::NONE ) );
+ pCondFormatDlg.reset( VclPtr<ScCondFormatDlg>::Create( pTabViewShell->GetDialogParent(), pDoc, pCondFormat, rCondFormatRange, aPos, condformat::dialog::NONE ) );
break;
}
}
@@ -1960,9 +1960,9 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
if(!pCondFormatDlg && bContainsExistingCondFormat)
{
- QueryBox aBox( pTabViewShell->GetDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ),
+ ScopedVclPtrInstance<QueryBox> aBox( pTabViewShell->GetDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ),
ScGlobal::GetRscString(STR_EDIT_EXISTING_COND_FORMATS) );
- bool bEditExisting = aBox.Execute() == RET_YES;
+ bool bEditExisting = aBox->Execute() == RET_YES;
if(bEditExisting)
{
// differentiate between ranges where one conditional format is defined
@@ -1975,7 +1975,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
assert(pCondFormat);
const ScRangeList& rCondFormatRange = pCondFormat->GetRange();
nKey = pCondFormat->GetKey();
- pCondFormatDlg.reset( new ScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, pCondFormat, rCondFormatRange, aPos, condformat::dialog::NONE ) );
+ pCondFormatDlg.reset( VclPtr<ScCondFormatDlg>::Create( pTabViewShell->GetDialogParent(), pDoc, pCondFormat, rCondFormatRange, aPos, condformat::dialog::NONE ) );
}
else
{
@@ -2023,7 +2023,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
assert(false);
break;
}
- pCondFormatDlg.reset( new ScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, NULL, aRangeList, aRangeList.GetTopLeftCorner(), eType ) );
+ pCondFormatDlg.reset( VclPtr<ScCondFormatDlg>::Create( pTabViewShell->GetDialogParent(), pDoc, nullptr, aRangeList, aRangeList.GetTopLeftCorner(), eType ) );
}
sal_uInt16 nId = 1;
@@ -2652,10 +2652,10 @@ void ScCellShell::ExecuteDataPilotDialog()
{
// confirm selection if it contains SubTotal cells
- QueryBox aBox( pTabViewShell->GetDialogParent(),
+ ScopedVclPtrInstance<QueryBox> aBox( pTabViewShell->GetDialogParent(),
WinBits(WB_YES_NO | WB_DEF_YES),
ScGlobal::GetRscString(STR_DATAPILOT_SUBTOTAL) );
- if (aBox.Execute() == RET_NO)
+ if (aBox->Execute() == RET_NO)
bOK = false;
}
if (bOK)
@@ -2682,8 +2682,8 @@ void ScCellShell::ExecuteDataPilotDialog()
if (nSrcErrorId)
{
// Error occurred during data creation. Launch an error and bail out.
- InfoBox aBox(pTabViewShell->GetDialogParent(), ScGlobal::GetRscString(nSrcErrorId));
- aBox.Execute();
+ ScopedVclPtrInstance< InfoBox > aBox(pTabViewShell->GetDialogParent(), ScGlobal::GetRscString(nSrcErrorId));
+ aBox->Execute();
return;
}
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 974c9a1eddc6..2b427c3023ca 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -740,15 +740,15 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
break;
case SID_DATA_STREAMS:
{
- sc::DataStreamDlg aDialog( GetViewData()->GetDocShell(), pTabViewShell->GetDialogParent() );
+ ScopedVclPtrInstance< sc::DataStreamDlg > aDialog( GetViewData()->GetDocShell(), pTabViewShell->GetDialogParent() );
ScDocument *pDoc = GetViewData()->GetDocument();
sc::DocumentLinkManager& rMgr = pDoc->GetDocLinkManager();
sc::DataStream* pStrm = rMgr.getDataStream();
if (pStrm)
- aDialog.Init(*pStrm);
+ aDialog->Init(*pStrm);
- if (aDialog.Execute() == RET_OK)
- aDialog.StartStream();
+ if (aDialog->Execute() == RET_OK)
+ aDialog->StartStream();
}
break;
case SID_DATA_STREAMS_PLAY:
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 295ed340f94e..77be8cf171a4 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -422,9 +422,9 @@ void ScCellShell::Execute( SfxRequest& rReq )
}
else if( ! rReq.IsAPI() )
{
- MessageDialog aErrorBox(pTabViewShell->GetDialogParent(),
+ ScopedVclPtrInstance<MessageDialog> aErrorBox(pTabViewShell->GetDialogParent(),
ScGlobal::GetRscString(STR_NOAREASELECTED));
- aErrorBox.Execute();
+ aErrorBox->Execute();
}
}
else
diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx
index b2099de5cb7b..83224c957fbb 100644
--- a/sc/source/ui/view/dbfunc.cxx
+++ b/sc/source/ui/view/dbfunc.cxx
@@ -383,9 +383,9 @@ void ScDBFunc::ToggleAutoFilter()
}
else
{
- MessageDialog aErrorBox(GetViewData().GetDialogParent(),
+ ScopedVclPtrInstance<MessageDialog> aErrorBox(GetViewData().GetDialogParent(),
ScGlobal::GetRscString(STR_ERR_AUTOFILTER));
- aErrorBox.Execute();
+ aErrorBox->Execute();
}
}
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index a39603115070..94f629c2f696 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -205,7 +205,7 @@ bool ScGridWindow::VisibleRange::set(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCRO
class ScFilterListBox : public ListBox
{
private:
- ScGridWindow* pGridWin;
+ VclPtr<ScGridWindow> pGridWin;
SCCOL nCol;
SCROW nRow;
bool bButtonDown;
@@ -224,6 +224,7 @@ public:
ScFilterListBox( vcl::Window* pParent, ScGridWindow* pGrid,
SCCOL nNewCol, SCROW nNewRow, ScFilterBoxMode eNewMode );
virtual ~ScFilterListBox();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual void Select() SAL_OVERRIDE;
@@ -258,8 +259,15 @@ ScFilterListBox::ScFilterListBox( vcl::Window* pParent, ScGridWindow* pGrid,
ScFilterListBox::~ScFilterListBox()
{
+ disposeOnce();
+}
+
+void ScFilterListBox::dispose()
+{
if (IsMouseCaptured())
ReleaseMouse();
+ pGridWin.clear();
+ ListBox::dispose();
}
void ScFilterListBox::EndInit()
@@ -337,6 +345,7 @@ class ScFilterFloatingWindow : public FloatingWindow
public:
ScFilterFloatingWindow( vcl::Window* pParent, WinBits nStyle = WB_STDFLOATWIN );
virtual ~ScFilterFloatingWindow();
+ virtual void dispose() SAL_OVERRIDE;
// required for System FloatingWindows that will not process KeyInput by themselves
virtual vcl::Window* GetPreferredKeyInputWindow() SAL_OVERRIDE;
};
@@ -347,7 +356,13 @@ ScFilterFloatingWindow::ScFilterFloatingWindow( vcl::Window* pParent, WinBits nS
ScFilterFloatingWindow::~ScFilterFloatingWindow()
{
+ disposeOnce();
+}
+
+void ScFilterFloatingWindow::dispose()
+{
EndPopupMode();
+ FloatingWindow::dispose();
}
vcl::Window* ScFilterFloatingWindow::GetPreferredKeyInputWindow()
@@ -522,6 +537,21 @@ ScGridWindow::ScGridWindow( vcl::Window* pParent, ScViewData* pData, ScSplitPos
ScGridWindow::~ScGridWindow()
{
+ disposeOnce();
+}
+
+void ScGridWindow::dispose()
+{
+ // #114409#
+ ImpDestroyOverlayObjects();
+
+ mpFilterBox.disposeAndClear();
+ mpFilterFloat.disposeAndClear();
+ mpNoteMarker.reset();
+ mpAutoFilterPopup.disposeAndClear();
+ mpDPFieldPopup.disposeAndClear();
+
+ vcl::Window::dispose();
}
void ScGridWindow::ClickExtern()
@@ -535,8 +565,8 @@ void ScGridWindow::ClickExtern()
{
break;
}
- mpFilterBox.reset();
- mpFilterFloat.reset();
+ mpFilterBox.disposeAndClear();
+ mpFilterFloat.disposeAndClear();
}
while (false);
@@ -612,7 +642,7 @@ struct AutoFilterData : public ScCheckListMenuWindow::ExtendedData
class AutoFilterAction : public ScMenuFloatingWindow::Action
{
- ScGridWindow* mpWindow;
+ VclPtr<ScGridWindow> mpWindow;
ScGridWindow::AutoFilterMode meMode;
public:
AutoFilterAction(ScGridWindow* p, ScGridWindow::AutoFilterMode eMode) :
@@ -625,7 +655,7 @@ public:
class AutoFilterPopupEndAction : public ScMenuFloatingWindow::Action
{
- ScGridWindow* mpWindow;
+ VclPtr<ScGridWindow> mpWindow;
ScAddress maPos;
public:
AutoFilterPopupEndAction(ScGridWindow* p, const ScAddress& rPos) :
@@ -673,7 +703,7 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow)
SCTAB nTab = pViewData->GetTabNo();
ScDocument* pDoc = pViewData->GetDocument();
- mpAutoFilterPopup.reset(new ScCheckListMenuWindow(this, pDoc));
+ mpAutoFilterPopup.reset(VclPtr<ScCheckListMenuWindow>::Create(this, pDoc));
mpAutoFilterPopup->setOKAction(new AutoFilterAction(this, Normal));
mpAutoFilterPopup->setPopupEndAction(
new AutoFilterPopupEndAction(this, ScAddress(nCol, nRow, nTab)));
@@ -933,8 +963,8 @@ void ScGridWindow::LaunchDPFieldMenu( SCCOL nCol, SCROW nRow )
void ScGridWindow::DoScenarioMenu( const ScRange& rScenRange )
{
- mpFilterBox.reset();
- mpFilterFloat.reset();
+ mpFilterBox.disposeAndClear();
+ mpFilterFloat.disposeAndClear();
SCCOL nCol = rScenRange.aEnd.Col(); // Zelle unterhalb des Buttons
SCROW nRow = rScenRange.aStart.Row();
@@ -964,9 +994,9 @@ void ScGridWindow::DoScenarioMenu( const ScRange& rScenRange )
// Die ListBox direkt unter der schwarzen Linie auf dem Zellgitter
// (wenn die Linie verdeckt wird, sieht es komisch aus...)
- mpFilterFloat.reset(new ScFilterFloatingWindow(this, WinBits(WB_BORDER)));
+ mpFilterFloat.reset(VclPtr<ScFilterFloatingWindow>::Create(this, WinBits(WB_BORDER)));
mpFilterFloat->SetPopupModeEndHdl( LINK( this, ScGridWindow, PopupModeEndHdl ) );
- mpFilterBox.reset(new ScFilterListBox(mpFilterFloat.get(), this, nCol, nRow, SC_FILTERBOX_SCENARIO));
+ mpFilterBox.reset(VclPtr<ScFilterListBox>::Create(mpFilterFloat.get(), this, nCol, nRow, SC_FILTERBOX_SCENARIO));
if (bLayoutRTL)
mpFilterBox->EnableMirroring();
@@ -1069,8 +1099,8 @@ void ScGridWindow::DoScenarioMenu( const ScRange& rScenRange )
void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow, bool bDataSelect )
{
- mpFilterBox.reset();
- mpFilterFloat.reset();
+ mpFilterBox.disposeAndClear();
+ mpFilterFloat.disposeAndClear();
sal_uInt16 i;
ScDocument* pDoc = pViewData->GetDocument();
@@ -1090,10 +1120,10 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow, bool bDataSelec
aPos.X() -= 1;
aPos.Y() += nSizeY - 1;
- mpFilterFloat.reset(new ScFilterFloatingWindow(this, WinBits(WB_BORDER)));
+ mpFilterFloat.reset(VclPtr<ScFilterFloatingWindow>::Create(this, WinBits(WB_BORDER)));
mpFilterFloat->SetPopupModeEndHdl(LINK( this, ScGridWindow, PopupModeEndHdl));
ScFilterBoxMode eFilterMode = bDataSelect ? SC_FILTERBOX_DATASELECT : SC_FILTERBOX_FILTER;
- mpFilterBox.reset(new ScFilterListBox(mpFilterFloat.get(), this, nCol, nRow, eFilterMode));
+ mpFilterBox.reset(VclPtr<ScFilterListBox>::Create(mpFilterFloat.get(), this, nCol, nRow, eFilterMode));
// Fix for bug fdo#44925
if (AllSettings::GetLayoutRTL() != bLayoutRTL)
mpFilterBox->EnableMirroring();
@@ -1305,8 +1335,8 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow, bool bDataSelec
if ( bEmpty )
{
- mpFilterBox.reset();
- mpFilterFloat.reset();
+ mpFilterBox.disposeAndClear();
+ mpFilterFloat.disposeAndClear();
}
else
{
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index 60b27acf04d9..04194904e382 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -395,7 +395,7 @@ public:
mpGridWindow->UpdateDPFromFieldPopupMenu();
}
private:
- ScGridWindow* mpGridWindow;
+ VclPtr<ScGridWindow> mpGridWindow;
};
class PopupSortAction : public ScMenuFloatingWindow::Action
@@ -455,7 +455,7 @@ void ScGridWindow::DPLaunchFieldPopupMenu(
const ScDPLabelData& rLabelData = pDPData->maLabels;
- mpDPFieldPopup.reset(new ScCheckListMenuWindow(this, pViewData->GetDocument()));
+ mpDPFieldPopup.reset(VclPtr<ScCheckListMenuWindow>::Create(this, pViewData->GetDocument()));
mpDPFieldPopup->setName("DataPilot field member popup");
mpDPFieldPopup->setExtendedData(pDPData.release());
mpDPFieldPopup->setOKAction(new DPFieldPopupOKAction(this));
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 9a78d1067690..9c4f7c6fbd48 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -482,7 +482,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
aOutputData.SetMirrorWidth( nMirrorWidth ); // needed for RTL
aOutputData.SetSpellCheckContext(mpSpellCheckCxt.get());
- std::unique_ptr<VirtualDevice> xFmtVirtDev;
+ ScopedVclPtr< VirtualDevice > xFmtVirtDev;
bool bLogicText = bTextWysiwyg; // call DrawStrings in logic MapMode?
if ( bTextWysiwyg )
diff --git a/sc/source/ui/view/olinewin.cxx b/sc/source/ui/view/olinewin.cxx
index 4752e567f4de..5e5f46dfc892 100644
--- a/sc/source/ui/view/olinewin.cxx
+++ b/sc/source/ui/view/olinewin.cxx
@@ -71,10 +71,16 @@ ScOutlineWindow::ScOutlineWindow( vcl::Window* pParent, ScOutlineMode eMode, ScV
ScOutlineWindow::~ScOutlineWindow()
{
+ disposeOnce();
+}
+
+void ScOutlineWindow::dispose()
+{
// remove the window from task pane list
if( SystemWindow* pSysWin = GetSystemWindow() )
if( TaskPaneList* pTaskPaneList = pSysWin->GetTaskPaneList() )
pTaskPaneList->RemoveWindow( this );
+ vcl::Window::dispose();
}
void ScOutlineWindow::SetHeaderSize( long nNewSize )
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index 14e16b366e41..3267fb8a6296 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -143,8 +143,14 @@ ScPreview::ScPreview( vcl::Window* pParent, ScDocShell* pDocSh, ScPreviewShell*
ScPreview::~ScPreview()
{
+ disposeOnce();
+}
+
+void ScPreview::dispose()
+{
delete pDrawView;
delete pLocationData;
+ vcl::Window::dispose();
}
void ScPreview::UpdateDrawView() // nTab must be right
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index 49500b78eaed..ef3ef07d8078 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -119,10 +119,10 @@ void ScPreviewShell::Construct( vcl::Window* pParent )
eZoom = SvxZoomType::WHOLEPAGE;
- pCorner = new ScrollBarBox( pParent, WB_SIZEABLE );
+ pCorner = VclPtr<ScrollBarBox>::Create( pParent, WB_SIZEABLE );
- pHorScroll = new ScrollBar(pParent, WB_HSCROLL );
- pVerScroll = new ScrollBar(pParent, WB_VSCROLL);
+ pHorScroll = VclPtr<ScrollBar>::Create(pParent, WB_HSCROLL );
+ pVerScroll = VclPtr<ScrollBar>::Create(pParent, WB_VSCROLL);
// SSA: --- RTL --- no mirroring for horizontal scrollbars
pHorScroll->EnableRTL( false );
@@ -130,7 +130,7 @@ void ScPreviewShell::Construct( vcl::Window* pParent )
pHorScroll->SetEndScrollHdl( LINK( this, ScPreviewShell, ScrollHandler ) );
pVerScroll->SetEndScrollHdl( LINK( this, ScPreviewShell, ScrollHandler ) );
- pPreview = new ScPreview( pParent, pDocShell, this );
+ pPreview = VclPtr<ScPreview>::Create( pParent, pDocShell, this );
SetPool( &SC_MOD()->GetPool() );
SetWindow( pPreview );
@@ -197,10 +197,10 @@ ScPreviewShell::~ScPreviewShell()
EndListening(*pDocShell);
SetWindow(0);
- delete pPreview;
- delete pHorScroll;
- delete pVerScroll;
- delete pCorner;
+ pPreview.disposeAndClear();
+ pHorScroll.disposeAndClear();
+ pVerScroll.disposeAndClear();
+ pCorner.disposeAndClear();
// normal mode of operation is switching back to default view in the same frame,
// so there's no need to activate any other window here anymore
@@ -532,14 +532,15 @@ bool ScPreviewShell::HasPrintOptionsPage() const
return true;
}
-SfxTabPage* ScPreviewShell::CreatePrintOptionsPage( vcl::Window *pParent, const SfxItemSet &rOptions )
+VclPtr<SfxTabPage> ScPreviewShell::CreatePrintOptionsPage( vcl::Window *pParent, const SfxItemSet &rOptions )
{
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- ::CreateTabPage ScTpPrintOptionsCreate = pFact->GetTabPageCreatorFunc( RID_SCPAGE_PRINT );
+ ::CreateTabPage ScTpPrintOptionsCreate = pFact->GetTabPageCreatorFunc( RID_SCPAGE_PRINT );
if ( ScTpPrintOptionsCreate )
- return (*ScTpPrintOptionsCreate)( pParent, &rOptions);
- return 0;
+ return VclPtr<SfxTabPage>((*ScTpPrintOptionsCreate)( pParent, &rOptions),
+ SAL_NO_ACQUIRE);
+ return VclPtr<SfxTabPage>();
}
void ScPreviewShell::Activate(bool bMDI)
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 55bfb1d6b5a9..ff34a7b7a79e 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -231,7 +231,7 @@ ScPrintFunc::ScPrintFunc( ScDocShell* pShell, SfxPrinter* pNewPrinter, SCTAB nTa
nTotalY(0),
pPageData ( pData )
{
- pDev = pPrinter;
+ pDev = pPrinter.get();
aSrcOffset = pPrinter->PixelToLogic( pPrinter->GetPageOffsetPixel(), MAP_100TH_MM );
Construct( pOptions );
}
diff --git a/sc/source/ui/view/reffact.cxx b/sc/source/ui/view/reffact.cxx
index d6a1258d14f4..3b0e96224d29 100644
--- a/sc/source/ui/view/reffact.cxx
+++ b/sc/source/ui/view/reffact.cxx
@@ -187,42 +187,42 @@ void ScSimpleRefDlgWrapper::SetAutoReOpen(bool bFlag)
void ScSimpleRefDlgWrapper::SetRefString(const OUString& rStr)
{
- if(pWindow!=NULL)
+ if(pWindow!=nullptr)
{
- static_cast<ScSimpleRefDlg*>(pWindow)->SetRefString(rStr);
+ static_cast<ScSimpleRefDlg*>(pWindow.get())->SetRefString(rStr);
}
}
void ScSimpleRefDlgWrapper::SetCloseHdl( const Link& rLink )
{
- if(pWindow!=NULL)
+ if(pWindow!=nullptr)
{
- static_cast<ScSimpleRefDlg*>(pWindow)->SetCloseHdl( rLink );
+ static_cast<ScSimpleRefDlg*>(pWindow.get())->SetCloseHdl( rLink );
}
}
void ScSimpleRefDlgWrapper::SetUnoLinks( const Link& rDone,
const Link& rAbort, const Link& rChange )
{
- if(pWindow!=NULL)
+ if(pWindow!=nullptr)
{
- static_cast<ScSimpleRefDlg*>(pWindow)->SetUnoLinks( rDone, rAbort, rChange );
+ static_cast<ScSimpleRefDlg*>(pWindow.get())->SetUnoLinks( rDone, rAbort, rChange );
}
}
void ScSimpleRefDlgWrapper::SetFlags( bool bCloseOnButtonUp, bool bSingleCell, bool bMultiSelection )
{
- if(pWindow!=NULL)
+ if(pWindow!=nullptr)
{
- static_cast<ScSimpleRefDlg*>(pWindow)->SetFlags( bCloseOnButtonUp, bSingleCell, bMultiSelection );
+ static_cast<ScSimpleRefDlg*>(pWindow.get())->SetFlags( bCloseOnButtonUp, bSingleCell, bMultiSelection );
}
}
void ScSimpleRefDlgWrapper::StartRefInput()
{
- if(pWindow!=NULL)
+ if(pWindow!=nullptr)
{
- static_cast<ScSimpleRefDlg*>(pWindow)->StartRefInput();
+ static_cast<ScSimpleRefDlg*>(pWindow.get())->StartRefInput();
}
}
@@ -237,12 +237,13 @@ ScAcceptChgDlgWrapper::ScAcceptChgDlgWrapper( vcl::Window* pParentP,
ScTabViewShell* pViewShell =
PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
OSL_ENSURE( pViewShell, "missing view shell :-(" );
- pWindow = pViewShell ?
- new ScAcceptChgDlg( pBindings, this, pParentP, &pViewShell->GetViewData() ) :
- NULL;
- if(pWindow!=NULL)
+ if (pViewShell)
+ pWindow = VclPtr<ScAcceptChgDlg>::Create( pBindings, this, pParentP, &pViewShell->GetViewData() );
+ else
+ pWindow = NULL;
+ if(pWindow!=nullptr)
{
- static_cast<ScAcceptChgDlg*>(pWindow)->Initialize( pInfo );
+ static_cast<ScAcceptChgDlg*>(pWindow.get())->Initialize( pInfo );
}
if (pViewShell && !pWindow)
pViewShell->GetViewFrame()->SetChildWindow( nId, false );
@@ -254,9 +255,9 @@ void ScAcceptChgDlgWrapper::ReInitDlg()
PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
OSL_ENSURE( pViewShell, "missing view shell :-(" );
- if(pWindow!=NULL && pViewShell)
+ if(pWindow!=nullptr && pViewShell)
{
- static_cast<ScAcceptChgDlg*>(pWindow)->ReInit(&pViewShell->GetViewData());
+ static_cast<ScAcceptChgDlg*>(pWindow.get())->ReInit(&pViewShell->GetViewData());
}
}
@@ -289,7 +290,7 @@ ScValidityRefChildWin::ScValidityRefChildWin( vcl::Window* pParent
{
SetWantsFocus( false );
ScTabViewShell* pViewShell =
- NULL != ( pWindow = ScValidationDlg::Find1AliveObject( pParentP ) ) ? static_cast<ScValidationDlg*>(pWindow)->GetTabViewShell() :
+ nullptr != ( pWindow = ScValidationDlg::Find1AliveObject( pParentP ) ) ? static_cast<ScValidationDlg*>(pWindow.get())->GetTabViewShell() :
lcl_GetTabViewShell( p );
if (!pViewShell)
pViewShell = PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
diff --git a/sc/source/ui/view/spelleng.cxx b/sc/source/ui/view/spelleng.cxx
index ad7e6bc54b1e..3ea3d0dfeafd 100644
--- a/sc/source/ui/view/spelleng.cxx
+++ b/sc/source/ui/view/spelleng.cxx
@@ -305,10 +305,10 @@ bool ScSpellingEngine::ShowTableWrapDialog()
{
vcl::Window* pParent = GetDialogParent();
ScWaitCursorOff aWaitOff( pParent );
- MessBox aMsgBox( pParent, WinBits( WB_YES_NO | WB_DEF_YES ),
+ ScopedVclPtrInstance<MessBox> aMsgBox( pParent, WinBits( WB_YES_NO | WB_DEF_YES ),
ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ),
ScGlobal::GetRscString( STR_SPELLING_BEGIN_TAB) );
- return aMsgBox.Execute() == RET_YES;
+ return aMsgBox->Execute() == RET_YES;
}
void ScSpellingEngine::ShowFinishDialog()
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 706856f4cfe0..57b71dd50d08 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -199,13 +199,13 @@ ScTabView::ScTabView( vcl::Window* pParent, ScDocShell& rDocSh, ScTabViewShell*
pHdrSelEng( NULL ),
aHdrFunc( &aViewData ),
pDrawView( NULL ),
- aVScrollTop( pFrameWin, WinBits( WB_VSCROLL | WB_DRAG ) ),
- aVScrollBottom( pFrameWin, WinBits( WB_VSCROLL | WB_DRAG ) ),
- aHScrollLeft( pFrameWin, WinBits( WB_HSCROLL | WB_DRAG ) ),
- aHScrollRight( pFrameWin, WinBits( WB_HSCROLL | WB_DRAG ) ),
- aCornerButton( pFrameWin, &aViewData, false ),
- aTopButton( pFrameWin, &aViewData, true ),
- aScrollBarBox( pFrameWin, WB_SIZEABLE ),
+ aVScrollTop( VclPtr<ScrollBar>::Create( pFrameWin, WinBits( WB_VSCROLL | WB_DRAG ) ) ),
+ aVScrollBottom( VclPtr<ScrollBar>::Create( pFrameWin, WinBits( WB_VSCROLL | WB_DRAG ) ) ),
+ aHScrollLeft( VclPtr<ScrollBar>::Create( pFrameWin, WinBits( WB_HSCROLL | WB_DRAG ) ) ),
+ aHScrollRight( VclPtr<ScrollBar>::Create( pFrameWin, WinBits( WB_HSCROLL | WB_DRAG ) ) ),
+ aCornerButton( VclPtr<ScCornerButton>::Create( pFrameWin, &aViewData, false ) ),
+ aTopButton( VclPtr<ScCornerButton>::Create( pFrameWin, &aViewData, true ) ),
+ aScrollBarBox( VclPtr<ScrollBarBox>::Create( pFrameWin, WB_SIZEABLE ) ),
mpInputHintWindow( NULL ),
pPageBreakData( NULL ),
pBrushDocument( NULL ),
@@ -280,7 +280,7 @@ IMPL_LINK_NOARG(ScTabView, TimerHdl)
// --- Resize ---------------------------------------------------------------------
static void lcl_SetPosSize( vcl::Window& rWindow, const Point& rPos, const Size& rSize,
- long nTotalWidth, bool bLayoutRTL )
+ long nTotalWidth, bool bLayoutRTL )
{
Point aNewPos = rPos;
if ( bLayoutRTL )
@@ -394,7 +394,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
}
// window at the bottom right
- lcl_SetPosSize( aScrollBarBox, Point( nPosX+nSizeX, nPosY+nSizeY ), Size( nBarX, nBarY ),
+ lcl_SetPosSize( *aScrollBarBox.get(), Point( nPosX+nSizeX, nPosY+nSizeY ), Size( nBarX, nBarY ),
nTotalWidth, bLayoutRTL );
if (bHScroll) // Scrollbars horizontal
@@ -458,39 +458,39 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
{
Point aTabPoint(nPosX, nPosY + nSizeY);
Size aTabSize(nTabSize, nBarY);
- lcl_SetPosSize(*pTabControl, aTabPoint, aTabSize, nTotalWidth, bLayoutRTL);
+ lcl_SetPosSize(*pTabControl.get(), aTabPoint, aTabSize, nTotalWidth, bLayoutRTL);
pTabControl->SetSheetLayoutRTL(bLayoutRTL);
Point aHScrollLeftPoint(nPosX + nTabSize, nPosY + nSizeY);
Size aHScrollLeftSize(nSizeLt, nBarY);
- lcl_SetPosSize(aHScrollLeft, aHScrollLeftPoint, aHScrollLeftSize, nTotalWidth, bLayoutRTL);
+ lcl_SetPosSize(*aHScrollLeft.get(), aHScrollLeftPoint, aHScrollLeftSize, nTotalWidth, bLayoutRTL);
Point aHSplitterPoint(nPosX + nTabSize + nSizeLt, nPosY + nSizeY);
Size aHSplitterSize(nSizeSp, nBarY);
- lcl_SetPosSize(*pHSplitter, aHSplitterPoint, aHSplitterSize, nTotalWidth, bLayoutRTL);
+ lcl_SetPosSize(*pHSplitter.get(), aHSplitterPoint, aHSplitterSize, nTotalWidth, bLayoutRTL);
Point aHScrollRightPoint(nPosX + nTabSize + nSizeLt + nSizeSp, nPosY + nSizeY);
Size aHScrollRightSize(nSizeRt, nBarY);
- lcl_SetPosSize(aHScrollRight, aHScrollRightPoint, aHScrollRightSize, nTotalWidth, bLayoutRTL);
+ lcl_SetPosSize(*aHScrollRight.get(), aHScrollRightPoint, aHScrollRightSize, nTotalWidth, bLayoutRTL);
}
else
{
Point aTabPoint(nPosX, nPosY + nSizeY + nScrollBarSize);
Size aTabSize(nSizeX, nTabWidth);
- lcl_SetPosSize(*pTabControl, aTabPoint, aTabSize, nTotalWidth, bLayoutRTL);
+ lcl_SetPosSize(*pTabControl.get(), aTabPoint, aTabSize, nTotalWidth, bLayoutRTL);
pTabControl->SetSheetLayoutRTL(bLayoutRTL);
Point aHScrollLeftPoint(nPosX, nPosY + nSizeY);
Size aHScrollLeftSize(nSizeLt, nScrollBarSize);
- lcl_SetPosSize(aHScrollLeft, aHScrollLeftPoint, aHScrollLeftSize, nTotalWidth, bLayoutRTL);
+ lcl_SetPosSize(*aHScrollLeft.get(), aHScrollLeftPoint, aHScrollLeftSize, nTotalWidth, bLayoutRTL);
Point aHSplitterPoint(nPosX + nSizeLt, nPosY + nSizeY);
Size aHSplitterSize(nSizeSp, nScrollBarSize);
- lcl_SetPosSize(*pHSplitter, aHSplitterPoint, aHSplitterSize, nTotalWidth, bLayoutRTL);
+ lcl_SetPosSize(*pHSplitter.get(), aHSplitterPoint, aHSplitterSize, nTotalWidth, bLayoutRTL);
Point aHScrollRightPoint(nPosX + nSizeLt + nSizeSp, nPosY + nSizeY);
Size aHScrollRightSize(nSizeRt, nScrollBarSize);
- lcl_SetPosSize(aHScrollRight, aHScrollRightPoint, aHScrollRightSize, nTotalWidth, bLayoutRTL);
+ lcl_SetPosSize(*aHScrollRight.get(), aHScrollRightPoint, aHScrollRightSize, nTotalWidth, bLayoutRTL);
}
// SetDragRectPixel is done below
}
@@ -518,11 +518,11 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
}
nSizeDn = nSizeY - nSizeUp - nSizeSp;
- lcl_SetPosSize( aVScrollTop, Point(nPosX + nSizeX, nPosY),
+ lcl_SetPosSize( *aVScrollTop.get(), Point(nPosX + nSizeX, nPosY),
Size(nBarX, nSizeUp), nTotalWidth, bLayoutRTL );
lcl_SetPosSize( *pVSplitter, Point( nPosX + nSizeX, nPosY+nSizeUp ),
Size( nBarX, nSizeSp ), nTotalWidth, bLayoutRTL );
- lcl_SetPosSize( aVScrollBottom, Point(nPosX + nSizeX,
+ lcl_SetPosSize( *aVScrollBottom.get(), Point(nPosX + nSizeX,
nPosY + nSizeUp + nSizeSp),
Size(nBarX, nSizeDn), nTotalWidth, bLayoutRTL );
@@ -540,25 +540,25 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
if (bTabControl && ! bHScroll )
{
- nBarY = aHScrollLeft.GetSizePixel().Height();
- nBarX = aVScrollBottom.GetSizePixel().Width();
+ nBarY = aHScrollLeft->GetSizePixel().Height();
+ nBarX = aVScrollBottom->GetSizePixel().Width();
long nSize1 = nSizeX;
long nTabSize = nSize1;
if (nTabSize < 0) nTabSize = 0;
- lcl_SetPosSize( *pTabControl, Point(nPosX, nPosY+nSizeY-nBarY),
+ lcl_SetPosSize( *pTabControl.get(), Point(nPosX, nPosY+nSizeY-nBarY),
Size(nTabSize, nBarY), nTotalWidth, bLayoutRTL );
nSizeY -= nBarY;
- lcl_SetPosSize( aScrollBarBox, Point( nPosX+nSizeX, nPosY+nSizeY ), Size( nBarX, nBarY ),
+ lcl_SetPosSize( *aScrollBarBox.get(), Point( nPosX+nSizeX, nPosY+nSizeY ), Size( nBarX, nBarY ),
nTotalWidth, bLayoutRTL );
if( bVScroll )
{
- Size aVScrSize = aVScrollBottom.GetSizePixel();
+ Size aVScrSize = aVScrollBottom->GetSizePixel();
aVScrSize.Height() -= nBarY;
- aVScrollBottom.SetSizePixel( aVScrSize );
+ aVScrollBottom->SetSizePixel( aVScrSize );
}
}
@@ -607,7 +607,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
{
// Fixier-Splitter nicht mit Scrollbar/TabBar ueberlappen lassen
if ( bHScroll )
- nSplitHeight -= aHScrollLeft.GetSizePixel().Height();
+ nSplitHeight -= aHScrollLeft->GetSizePixel().Height();
else if ( bTabControl && pTabControl )
nSplitHeight -= pTabControl->GetSizePixel().Height();
}
@@ -623,7 +623,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
{
long nSplitWidth = rSize.Width();
if ( aViewData.GetVSplitMode() == SC_SPLIT_FIX && bVScroll )
- nSplitWidth -= aVScrollBottom.GetSizePixel().Width();
+ nSplitWidth -= aVScrollBottom->GetSizePixel().Width();
nSplitPosY = aViewData.GetVSplitPos();
lcl_SetPosSize( *pVSplitter,
Point( nOutPosX, nSplitPosY ), Size( nSplitWidth, nSplitSizeY ), nTotalWidth, bLayoutRTL );
@@ -672,11 +672,11 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
}
if (bHOutline && bVOutline)
{
- lcl_SetPosSize( aTopButton, Point(nOutPosX,nOutPosY), Size(nOutlineX,nOutlineY), nTotalWidth, bLayoutRTL );
- aTopButton.Show();
+ lcl_SetPosSize( *aTopButton.get(), Point(nOutPosX,nOutPosY), Size(nOutlineX,nOutlineY), nTotalWidth, bLayoutRTL );
+ aTopButton->Show();
}
else
- aTopButton.Hide();
+ aTopButton->Hide();
if (bHeaders) // Spalten/Zeilen-Header
{
@@ -692,14 +692,14 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner )
lcl_SetPosSize( *pRowBar[SC_SPLIT_BOTTOM],
Point(nPosX-nBarX,nSplitPosY), Size(nBarX,nBottomSize), nTotalWidth, bLayoutRTL );
- lcl_SetPosSize( aCornerButton, Point(nPosX-nBarX,nPosY-nBarY), Size(nBarX,nBarY), nTotalWidth, bLayoutRTL );
- aCornerButton.Show();
+ lcl_SetPosSize( *aCornerButton.get(), Point(nPosX-nBarX,nPosY-nBarY), Size(nBarX,nBarY), nTotalWidth, bLayoutRTL );
+ aCornerButton->Show();
pColBar[SC_SPLIT_LEFT]->Show();
pRowBar[SC_SPLIT_BOTTOM]->Show();
}
else
{
- aCornerButton.Hide();
+ aCornerButton->Hide();
pColBar[SC_SPLIT_LEFT]->Hide(); // immer da
pRowBar[SC_SPLIT_BOTTOM]->Hide();
}
@@ -822,8 +822,8 @@ void ScTabView::GetBorderSize( SvBorder& rBorder, const Size& /* rSize */ )
if (bScrollBars) // Scrollbars horizontal oder vertikal
{
- rBorder.Right() += aVScrollBottom.GetSizePixel().Width();
- rBorder.Bottom() += aHScrollLeft.GetSizePixel().Height();
+ rBorder.Right() += aVScrollBottom->GetSizePixel().Width();
+ rBorder.Bottom() += aHScrollLeft->GetSizePixel().Height();
}
// Outline-Controls
@@ -1015,8 +1015,8 @@ bool ScTabView::ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos )
{
ScHSplitPos eHPos = WhichH(ePos);
ScVSplitPos eVPos = WhichV(ePos);
- ScrollBar* pHScroll = ( eHPos == SC_SPLIT_LEFT ) ? &aHScrollLeft : &aHScrollRight;
- ScrollBar* pVScroll = ( eVPos == SC_SPLIT_TOP ) ? &aVScrollTop : &aVScrollBottom;
+ ScrollBar* pHScroll = ( eHPos == SC_SPLIT_LEFT ) ? aHScrollLeft.get() : aHScrollRight.get();
+ ScrollBar* pVScroll = ( eVPos == SC_SPLIT_TOP ) ? aVScrollTop.get() : aVScrollBottom.get();
if ( pGridWin[ePos] )
bDone = pGridWin[ePos]->HandleScrollCommand( rCEvt, pHScroll, pVScroll );
}
@@ -1035,13 +1035,13 @@ IMPL_LINK_NOARG(ScTabView, EndScrollHdl)
IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll )
{
- bool bHoriz = ( pScroll == &aHScrollLeft || pScroll == &aHScrollRight );
+ bool bHoriz = ( pScroll == aHScrollLeft.get() || pScroll == aHScrollRight.get() );
long nViewPos;
if ( bHoriz )
- nViewPos = aViewData.GetPosX( (pScroll == &aHScrollLeft) ?
+ nViewPos = aViewData.GetPosX( (pScroll == aHScrollLeft.get()) ?
SC_SPLIT_LEFT : SC_SPLIT_RIGHT );
else
- nViewPos = aViewData.GetPosY( (pScroll == &aVScrollTop) ?
+ nViewPos = aViewData.GetPosY( (pScroll == aVScrollTop.get()) ?
SC_SPLIT_TOP : SC_SPLIT_BOTTOM );
bool bLayoutRTL = aViewData.GetDocument()->IsLayoutRTL( aViewData.GetTabNo() );
@@ -1078,9 +1078,9 @@ IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll )
// get scrollbar scroll position for help text (row number/column name)
long nScrollMin = 0; // RangeMin simulieren
- if ( aViewData.GetHSplitMode()==SC_SPLIT_FIX && pScroll == &aHScrollRight )
+ if ( aViewData.GetHSplitMode()==SC_SPLIT_FIX && pScroll == aHScrollRight.get() )
nScrollMin = aViewData.GetFixPosX();
- if ( aViewData.GetVSplitMode()==SC_SPLIT_FIX && pScroll == &aVScrollBottom )
+ if ( aViewData.GetVSplitMode()==SC_SPLIT_FIX && pScroll == aVScrollBottom.get() )
nScrollMin = aViewData.GetFixPosY();
long nScrollPos = GetScrollBarPos( *pScroll ) + nScrollMin;
@@ -1123,17 +1123,17 @@ IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll )
nDelta = 1;
break;
case SCROLL_PAGEUP:
- if ( pScroll == &aHScrollLeft ) nDelta = -(long) aViewData.PrevCellsX( SC_SPLIT_LEFT );
- if ( pScroll == &aHScrollRight ) nDelta = -(long) aViewData.PrevCellsX( SC_SPLIT_RIGHT );
- if ( pScroll == &aVScrollTop ) nDelta = -(long) aViewData.PrevCellsY( SC_SPLIT_TOP );
- if ( pScroll == &aVScrollBottom ) nDelta = -(long) aViewData.PrevCellsY( SC_SPLIT_BOTTOM );
+ if ( pScroll == aHScrollLeft.get() ) nDelta = -(long) aViewData.PrevCellsX( SC_SPLIT_LEFT );
+ if ( pScroll == aHScrollRight.get() ) nDelta = -(long) aViewData.PrevCellsX( SC_SPLIT_RIGHT );
+ if ( pScroll == aVScrollTop.get() ) nDelta = -(long) aViewData.PrevCellsY( SC_SPLIT_TOP );
+ if ( pScroll == aVScrollBottom.get() ) nDelta = -(long) aViewData.PrevCellsY( SC_SPLIT_BOTTOM );
if (nDelta==0) nDelta=-1;
break;
case SCROLL_PAGEDOWN:
- if ( pScroll == &aHScrollLeft ) nDelta = aViewData.VisibleCellsX( SC_SPLIT_LEFT );
- if ( pScroll == &aHScrollRight ) nDelta = aViewData.VisibleCellsX( SC_SPLIT_RIGHT );
- if ( pScroll == &aVScrollTop ) nDelta = aViewData.VisibleCellsY( SC_SPLIT_TOP );
- if ( pScroll == &aVScrollBottom ) nDelta = aViewData.VisibleCellsY( SC_SPLIT_BOTTOM );
+ if ( pScroll == aHScrollLeft.get() ) nDelta = aViewData.VisibleCellsX( SC_SPLIT_LEFT );
+ if ( pScroll == aHScrollRight.get() ) nDelta = aViewData.VisibleCellsX( SC_SPLIT_RIGHT );
+ if ( pScroll == aVScrollTop.get() ) nDelta = aViewData.VisibleCellsY( SC_SPLIT_TOP );
+ if ( pScroll == aVScrollBottom.get() ) nDelta = aViewData.VisibleCellsY( SC_SPLIT_BOTTOM );
if (nDelta==0) nDelta=1;
break;
case SCROLL_DRAG:
@@ -1142,9 +1142,9 @@ IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll )
// Bereiche herumzittern
long nScrollMin = 0; // RangeMin simulieren
- if ( aViewData.GetHSplitMode()==SC_SPLIT_FIX && pScroll == &aHScrollRight )
+ if ( aViewData.GetHSplitMode()==SC_SPLIT_FIX && pScroll == aHScrollRight.get() )
nScrollMin = aViewData.GetFixPosX();
- if ( aViewData.GetVSplitMode()==SC_SPLIT_FIX && pScroll == &aVScrollBottom )
+ if ( aViewData.GetVSplitMode()==SC_SPLIT_FIX && pScroll == aVScrollBottom.get() )
nScrollMin = aViewData.GetFixPosY();
long nScrollPos = GetScrollBarPos( *pScroll ) + nScrollMin;
@@ -1172,9 +1172,9 @@ IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll )
{
bool bUpdate = ( eType != SCROLL_DRAG ); // bei Drag die Ranges nicht aendern
if ( bHoriz )
- ScrollX( nDelta, (pScroll == &aHScrollLeft) ? SC_SPLIT_LEFT : SC_SPLIT_RIGHT, bUpdate );
+ ScrollX( nDelta, (pScroll == aHScrollLeft.get()) ? SC_SPLIT_LEFT : SC_SPLIT_RIGHT, bUpdate );
else
- ScrollY( nDelta, (pScroll == &aVScrollTop) ? SC_SPLIT_TOP : SC_SPLIT_BOTTOM, bUpdate );
+ ScrollY( nDelta, (pScroll == aVScrollTop.get()) ? SC_SPLIT_TOP : SC_SPLIT_BOTTOM, bUpdate );
}
return 0;
@@ -1433,7 +1433,7 @@ void ScTabView::UpdateHeaderWidth( const ScVSplitPos* pWhich, const SCROW* pPosY
RepeatResize();
// auf VCL gibt's Update ohne Ende (jedes Update gilt fuer alle Fenster)
- //aCornerButton.Update(); // der bekommt sonst nie ein Update
+ //aCornerButton->Update(); // der bekommt sonst nie ein Update
bInUpdateHeader = false;
}
@@ -1466,44 +1466,44 @@ void ScTabView::UpdateShow()
if (bShowH && !pGridWin[SC_SPLIT_BOTTOMRIGHT])
{
- pGridWin[SC_SPLIT_BOTTOMRIGHT] = new ScGridWindow( pFrameWin, &aViewData, SC_SPLIT_BOTTOMRIGHT );
+ pGridWin[SC_SPLIT_BOTTOMRIGHT] = VclPtr<ScGridWindow>::Create( pFrameWin, &aViewData, SC_SPLIT_BOTTOMRIGHT );
DoAddWin( pGridWin[SC_SPLIT_BOTTOMRIGHT] );
}
if (bShowV && !pGridWin[SC_SPLIT_TOPLEFT])
{
- pGridWin[SC_SPLIT_TOPLEFT] = new ScGridWindow( pFrameWin, &aViewData, SC_SPLIT_TOPLEFT );
+ pGridWin[SC_SPLIT_TOPLEFT] = VclPtr<ScGridWindow>::Create( pFrameWin, &aViewData, SC_SPLIT_TOPLEFT );
DoAddWin( pGridWin[SC_SPLIT_TOPLEFT] );
}
if (bShowH && bShowV && !pGridWin[SC_SPLIT_TOPRIGHT])
{
- pGridWin[SC_SPLIT_TOPRIGHT] = new ScGridWindow( pFrameWin, &aViewData, SC_SPLIT_TOPRIGHT );
+ pGridWin[SC_SPLIT_TOPRIGHT] = VclPtr<ScGridWindow>::Create( pFrameWin, &aViewData, SC_SPLIT_TOPRIGHT );
DoAddWin( pGridWin[SC_SPLIT_TOPRIGHT] );
}
if (bHOutline && !pColOutline[SC_SPLIT_LEFT])
- pColOutline[SC_SPLIT_LEFT] = new ScOutlineWindow( pFrameWin, SC_OUTLINE_HOR, &aViewData, SC_SPLIT_BOTTOMLEFT );
+ pColOutline[SC_SPLIT_LEFT] = VclPtr<ScOutlineWindow>::Create( pFrameWin, SC_OUTLINE_HOR, &aViewData, SC_SPLIT_BOTTOMLEFT );
if (bShowH && bHOutline && !pColOutline[SC_SPLIT_RIGHT])
- pColOutline[SC_SPLIT_RIGHT] = new ScOutlineWindow( pFrameWin, SC_OUTLINE_HOR, &aViewData, SC_SPLIT_BOTTOMRIGHT );
+ pColOutline[SC_SPLIT_RIGHT] = VclPtr<ScOutlineWindow>::Create( pFrameWin, SC_OUTLINE_HOR, &aViewData, SC_SPLIT_BOTTOMRIGHT );
if (bVOutline && !pRowOutline[SC_SPLIT_BOTTOM])
- pRowOutline[SC_SPLIT_BOTTOM] = new ScOutlineWindow( pFrameWin, SC_OUTLINE_VER, &aViewData, SC_SPLIT_BOTTOMLEFT );
+ pRowOutline[SC_SPLIT_BOTTOM] = VclPtr<ScOutlineWindow>::Create( pFrameWin, SC_OUTLINE_VER, &aViewData, SC_SPLIT_BOTTOMLEFT );
if (bShowV && bVOutline && !pRowOutline[SC_SPLIT_TOP])
- pRowOutline[SC_SPLIT_TOP] = new ScOutlineWindow( pFrameWin, SC_OUTLINE_VER, &aViewData, SC_SPLIT_TOPLEFT );
+ pRowOutline[SC_SPLIT_TOP] = VclPtr<ScOutlineWindow>::Create( pFrameWin, SC_OUTLINE_VER, &aViewData, SC_SPLIT_TOPLEFT );
if (bShowH && bHeader && !pColBar[SC_SPLIT_RIGHT])
- pColBar[SC_SPLIT_RIGHT] = new ScColBar( pFrameWin, &aViewData, SC_SPLIT_RIGHT,
+ pColBar[SC_SPLIT_RIGHT] = VclPtr<ScColBar>::Create( pFrameWin, &aViewData, SC_SPLIT_RIGHT,
&aHdrFunc, pHdrSelEng );
if (bShowV && bHeader && !pRowBar[SC_SPLIT_TOP])
- pRowBar[SC_SPLIT_TOP] = new ScRowBar( pFrameWin, &aViewData, SC_SPLIT_TOP,
+ pRowBar[SC_SPLIT_TOP] = VclPtr<ScRowBar>::Create( pFrameWin, &aViewData, SC_SPLIT_TOP,
&aHdrFunc, pHdrSelEng );
// Windows anzeigen
- ShowHide( &aHScrollLeft, bHScrollMode );
- ShowHide( &aHScrollRight, bShowH && bHScrollMode );
- ShowHide( &aVScrollBottom, bVScrollMode );
- ShowHide( &aVScrollTop, bShowV && bVScrollMode );
- ShowHide( &aScrollBarBox, bVScrollMode || bHScrollMode );
+ ShowHide( aHScrollLeft.get(), bHScrollMode );
+ ShowHide( aHScrollRight.get(), bShowH && bHScrollMode );
+ ShowHide( aVScrollBottom.get(), bVScrollMode );
+ ShowHide( aVScrollTop.get(), bShowV && bVScrollMode );
+ ShowHide( aScrollBarBox.get(), bVScrollMode || bHScrollMode );
ShowHide( pHSplitter, bHScrollMode || bShowH ); // immer angelegt
ShowHide( pVSplitter, bVScrollMode || bShowV );
@@ -2221,27 +2221,27 @@ void ScTabView::StartDataSelect()
void ScTabView::EnableRefInput(bool bFlag)
{
- aHScrollLeft.EnableInput(bFlag);
- aHScrollRight.EnableInput(bFlag);
- aVScrollBottom.EnableInput(bFlag);
- aVScrollTop.EnableInput(bFlag);
- aScrollBarBox.EnableInput(bFlag);
+ aHScrollLeft->EnableInput(bFlag);
+ aHScrollRight->EnableInput(bFlag);
+ aVScrollBottom->EnableInput(bFlag);
+ aVScrollTop->EnableInput(bFlag);
+ aScrollBarBox->EnableInput(bFlag);
// ab hier dynamisch angelegte
- if(pTabControl!=NULL) pTabControl->EnableInput(bFlag,true);
+ if(pTabControl!=nullptr) pTabControl->EnableInput(bFlag,true);
- if(pGridWin[SC_SPLIT_BOTTOMLEFT]!=NULL)
+ if(pGridWin[SC_SPLIT_BOTTOMLEFT]!=nullptr)
pGridWin[SC_SPLIT_BOTTOMLEFT]->EnableInput(bFlag,false);
- if(pGridWin[SC_SPLIT_BOTTOMRIGHT]!=NULL)
+ if(pGridWin[SC_SPLIT_BOTTOMRIGHT]!=nullptr)
pGridWin[SC_SPLIT_BOTTOMRIGHT]->EnableInput(bFlag,false);
- if(pGridWin[SC_SPLIT_TOPLEFT]!=NULL)
+ if(pGridWin[SC_SPLIT_TOPLEFT]!=nullptr)
pGridWin[SC_SPLIT_TOPLEFT]->EnableInput(bFlag,false);
- if(pGridWin[SC_SPLIT_TOPRIGHT]!=NULL)
+ if(pGridWin[SC_SPLIT_TOPRIGHT]!=nullptr)
pGridWin[SC_SPLIT_TOPRIGHT]->EnableInput(bFlag,false);
- if(pColBar[SC_SPLIT_RIGHT]!=NULL)
+ if(pColBar[SC_SPLIT_RIGHT]!=nullptr)
pColBar[SC_SPLIT_RIGHT]->EnableInput(bFlag,false);
- if(pRowBar[SC_SPLIT_TOP]!=NULL)
+ if(pRowBar[SC_SPLIT_TOP]!=nullptr)
pRowBar[SC_SPLIT_TOP]->EnableInput(bFlag,false);
}
diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index 9e7d4d0b2809..6d355f70af20 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -1423,8 +1423,8 @@ void ScTabView::ErrorMessage( sal_uInt16 nGlobStrId )
}
}
- InfoBox aBox( pParent, ScGlobal::GetRscString( nGlobStrId ) );
- aBox.Execute();
+ ScopedVclPtrInstance< InfoBox > aBox( pParent, ScGlobal::GetRscString( nGlobStrId ) );
+ aBox->Execute();
if (bFocus)
pParent->GrabFocus();
}
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index b0db92dc355b..ecc9e2b81624 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -623,7 +623,7 @@ void ScTabView::TestHintWindow()
aPos.X() < aWinSize.Width() && aPos.Y() < aWinSize.Height() )
{
// HintWindow anlegen, bestimmt seine Groesse selbst
- mpInputHintWindow.reset(new ScHintWindow(pWin, aTitle, aMessage));
+ mpInputHintWindow.reset(VclPtr<ScHintWindow>::Create(pWin, aTitle, aMessage));
Size aHintWndSize = mpInputHintWindow->GetSizePixel();
long nCellSizeX = 0;
long nCellSizeY = 0;
diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx
index fba9ede166a2..8d21f9cd66bc 100644
--- a/sc/source/ui/view/tabview4.cxx
+++ b/sc/source/ui/view/tabview4.cxx
@@ -382,41 +382,41 @@ void ScTabView::UpdateScrollBars()
nVisXL = aViewData.VisibleCellsX( SC_SPLIT_LEFT );
long nMaxXL = lcl_GetScrollRange( nUsedX, aViewData.GetPosX(SC_SPLIT_LEFT), nVisXL, MAXCOL, 0 );
- SetScrollBar( aHScrollLeft, nMaxXL, nVisXL, aViewData.GetPosX( SC_SPLIT_LEFT ), bLayoutRTL );
+ SetScrollBar( *aHScrollLeft.get(), nMaxXL, nVisXL, aViewData.GetPosX( SC_SPLIT_LEFT ), bLayoutRTL );
nVisYB = aViewData.VisibleCellsY( SC_SPLIT_BOTTOM );
long nMaxYB = lcl_GetScrollRange( nUsedY, aViewData.GetPosY(SC_SPLIT_BOTTOM), nVisYB, MAXROW, nStartY );
- SetScrollBar( aVScrollBottom, nMaxYB, nVisYB, aViewData.GetPosY( SC_SPLIT_BOTTOM ) - nStartY, bLayoutRTL );
+ SetScrollBar( *aVScrollBottom.get(), nMaxYB, nVisYB, aViewData.GetPosY( SC_SPLIT_BOTTOM ) - nStartY, bLayoutRTL );
if (bRight)
{
nVisXR = aViewData.VisibleCellsX( SC_SPLIT_RIGHT );
long nMaxXR = lcl_GetScrollRange( nUsedX, aViewData.GetPosX(SC_SPLIT_RIGHT), nVisXR, MAXCOL, nStartX );
- SetScrollBar( aHScrollRight, nMaxXR, nVisXR, aViewData.GetPosX( SC_SPLIT_RIGHT ) - nStartX, bLayoutRTL );
+ SetScrollBar( *aHScrollRight.get(), nMaxXR, nVisXR, aViewData.GetPosX( SC_SPLIT_RIGHT ) - nStartX, bLayoutRTL );
}
if (bTop)
{
nVisYT = aViewData.VisibleCellsY( SC_SPLIT_TOP );
long nMaxYT = lcl_GetScrollRange( nUsedY, aViewData.GetPosY(SC_SPLIT_TOP), nVisYT, MAXROW, 0 );
- SetScrollBar( aVScrollTop, nMaxYT, nVisYT, aViewData.GetPosY( SC_SPLIT_TOP ), bLayoutRTL );
+ SetScrollBar( *aVScrollTop.get(), nMaxYT, nVisYT, aViewData.GetPosY( SC_SPLIT_TOP ), bLayoutRTL );
}
// Bereich testen
- nDiff = lcl_UpdateBar( aHScrollLeft, nVisXL );
+ nDiff = lcl_UpdateBar( *aHScrollLeft.get(), nVisXL );
if (nDiff) ScrollX( nDiff, SC_SPLIT_LEFT );
if (bRight)
{
- nDiff = lcl_UpdateBar( aHScrollRight, nVisXR );
+ nDiff = lcl_UpdateBar( *aHScrollRight.get(), nVisXR );
if (nDiff) ScrollX( nDiff, SC_SPLIT_RIGHT );
}
- nDiff = lcl_UpdateBar( aVScrollBottom, nVisYB );
+ nDiff = lcl_UpdateBar( *aVScrollBottom.get(), nVisYB );
if (nDiff) ScrollY( nDiff, SC_SPLIT_BOTTOM );
if (bTop)
{
- nDiff = lcl_UpdateBar( aVScrollTop, nVisYT );
+ nDiff = lcl_UpdateBar( *aVScrollTop.get(), nVisYT );
if (nDiff) ScrollY( nDiff, SC_SPLIT_TOP );
}
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index 033fae392d3c..07262e175ce4 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -74,7 +74,7 @@ void ScTabView::Init()
for (i=0; i<4; i++)
pGridWin[i] = NULL;
- pGridWin[SC_SPLIT_BOTTOMLEFT] = new ScGridWindow( pFrameWin, &aViewData, SC_SPLIT_BOTTOMLEFT );
+ pGridWin[SC_SPLIT_BOTTOMLEFT] = VclPtr<ScGridWindow>::Create( pFrameWin, &aViewData, SC_SPLIT_BOTTOMLEFT );
pSelEngine = new ScViewSelectionEngine( pGridWin[SC_SPLIT_BOTTOMLEFT], this,
SC_SPLIT_BOTTOMLEFT );
@@ -82,23 +82,23 @@ void ScTabView::Init()
pHdrSelEng = new ScHeaderSelectionEngine( pFrameWin, &aHdrFunc );
- pColBar[SC_SPLIT_LEFT] = new ScColBar( pFrameWin, &aViewData, SC_SPLIT_LEFT,
+ pColBar[SC_SPLIT_LEFT] = VclPtr<ScColBar>::Create( pFrameWin, &aViewData, SC_SPLIT_LEFT,
&aHdrFunc, pHdrSelEng );
pColBar[SC_SPLIT_RIGHT] = NULL;
- pRowBar[SC_SPLIT_BOTTOM] = new ScRowBar( pFrameWin, &aViewData, SC_SPLIT_BOTTOM,
+ pRowBar[SC_SPLIT_BOTTOM] = VclPtr<ScRowBar>::Create( pFrameWin, &aViewData, SC_SPLIT_BOTTOM,
&aHdrFunc, pHdrSelEng );
pRowBar[SC_SPLIT_TOP] = NULL;
for (i=0; i<2; i++)
pColOutline[i] = pRowOutline[i] = NULL;
- pHSplitter = new ScTabSplitter( pFrameWin, WinBits( WB_HSCROLL ), &aViewData );
- pVSplitter = new ScTabSplitter( pFrameWin, WinBits( WB_VSCROLL ), &aViewData );
+ pHSplitter = VclPtr<ScTabSplitter>::Create( pFrameWin, WinBits( WB_HSCROLL ), &aViewData );
+ pVSplitter = VclPtr<ScTabSplitter>::Create( pFrameWin, WinBits( WB_VSCROLL ), &aViewData );
// SSA: override default keyboard step size to allow snap to row/column
pHSplitter->SetKeyboardStepSize( 1 );
pVSplitter->SetKeyboardStepSize( 1 );
- pTabControl = new ScTabControl(pFrameWin, &aViewData);
+ pTabControl = VclPtr<ScTabControl>::Create(pFrameWin, &aViewData);
if (mbInlineWithScrollbar)
pTabControl->SetStyle(pTabControl->GetStyle() | WB_SIZEABLE);
@@ -108,10 +108,10 @@ void ScTabView::Init()
explicitly because the parent frame window is already RTL disabled. */
pTabControl->EnableRTL( AllSettings::GetLayoutRTL() );
- InitScrollBar( aHScrollLeft, MAXCOL+1 );
- InitScrollBar( aHScrollRight, MAXCOL+1 );
- InitScrollBar( aVScrollTop, MAXROW+1 );
- InitScrollBar( aVScrollBottom, MAXROW+1 );
+ InitScrollBar( *aHScrollLeft.get(), MAXCOL+1 );
+ InitScrollBar( *aHScrollRight.get(), MAXCOL+1 );
+ InitScrollBar( *aVScrollTop.get(), MAXROW+1 );
+ InitScrollBar( *aVScrollBottom.get(), MAXROW+1 );
/* #i97900# scrollbars remain in correct RTL mode, needed mirroring etc.
is now handled correctly at the respective places. */
@@ -176,24 +176,31 @@ ScTabView::~ScTabView()
delete pSelEngine;
// Delete this before the grid windows, since it's a child window of one of them.
- mpInputHintWindow.reset();
+ mpInputHintWindow.disposeAndClear();
for (i=0; i<4; i++)
- delete pGridWin[i];
+ pGridWin[i].disposeAndClear();
delete pHdrSelEng;
for (i=0; i<2; i++)
{
- delete pColBar[i];
- delete pRowBar[i];
- delete pColOutline[i];
- delete pRowOutline[i];
+ pColBar[i].disposeAndClear();
+ pRowBar[i].disposeAndClear();
+ pColOutline[i].disposeAndClear();
+ pRowOutline[i].disposeAndClear();
}
- delete pHSplitter;
- delete pVSplitter;
-
- delete pTabControl;
+ aScrollBarBox.disposeAndClear();
+ aCornerButton.disposeAndClear();
+ aTopButton.disposeAndClear();
+ aHScrollLeft.disposeAndClear();
+ aHScrollRight.disposeAndClear();
+ aVScrollTop.disposeAndClear();
+ aVScrollBottom.disposeAndClear();
+
+ pHSplitter.disposeAndClear();
+ pVSplitter.disposeAndClear();
+ pTabControl.disposeAndClear();
}
void ScTabView::MakeDrawView( TriState nForceDesignMode )
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index e4f1b71d91ff..d4d3068818d1 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -975,7 +975,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
{
OUString aText(ScResId(SCSTR_PASSWORD));
- boost::scoped_ptr<SfxPasswordDialog> pDlg(new SfxPasswordDialog(GetDialogParent(), &aText));
+ VclPtrInstance< SfxPasswordDialog > pDlg(GetDialogParent(), &aText);
pDlg->SetText( ScResId(SCSTR_UNPROTECTDOC) );
pDlg->SetMinLen( 0 );
pDlg->SetHelpId( GetStaticInterface()->GetSlot(FID_PROTECT_DOC)->GetCommand() );
@@ -997,7 +997,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
{
OUString aText(ScResId(SCSTR_PASSWORDOPT));
- boost::scoped_ptr<SfxPasswordDialog> pDlg(new SfxPasswordDialog(GetDialogParent(), &aText));
+ VclPtrInstance< SfxPasswordDialog > pDlg(GetDialogParent(), &aText);
pDlg->SetText( ScResId(SCSTR_PROTECTDOC) );
pDlg->SetMinLen( 0 );
pDlg->SetHelpId( GetStaticInterface()->GetSlot(FID_PROTECT_DOC)->GetCommand() );
@@ -1043,7 +1043,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
if (pProtect && pProtect->isProtectedWithPass())
{
OUString aText( ScResId(SCSTR_PASSWORDOPT) );
- boost::scoped_ptr<SfxPasswordDialog> pDlg(new SfxPasswordDialog(GetDialogParent(), &aText));
+ VclPtrInstance< SfxPasswordDialog > pDlg(GetDialogParent(), &aText);
pDlg->SetText( ScResId(SCSTR_UNPROTECTTAB) );
pDlg->SetMinLen( 0 );
pDlg->SetHelpId( GetStaticInterface()->GetSlot(FID_PROTECT_TABLE)->GetCommand() );
@@ -1069,7 +1069,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
{
// Protect a current sheet.
- boost::scoped_ptr<ScTableProtectionDlg> pDlg(new ScTableProtectionDlg(GetDialogParent()));
+ VclPtrInstance< ScTableProtectionDlg > pDlg(GetDialogParent());
ScTableProtection* pProtect = pDoc->GetTabProtection(nTab);
if (pProtect)
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 429314fd7a2e..71661bf301bb 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1063,14 +1063,15 @@ bool ScTabViewShell::HasPrintOptionsPage() const
return true;
}
-SfxTabPage* ScTabViewShell::CreatePrintOptionsPage( vcl::Window *pParent, const SfxItemSet &rOptions )
+VclPtr<SfxTabPage> ScTabViewShell::CreatePrintOptionsPage( vcl::Window *pParent, const SfxItemSet &rOptions )
{
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
::CreateTabPage ScTpPrintOptionsCreate = pFact->GetTabPageCreatorFunc( RID_SCPAGE_PRINT );
if ( ScTpPrintOptionsCreate )
- return (*ScTpPrintOptionsCreate)( pParent, &rOptions);
- return 0;
+ return VclPtr<SfxTabPage>((*ScTpPrintOptionsCreate)( pParent, &rOptions),
+ SAL_NO_ACQUIRE);
+ return VclPtr<SfxTabPage>();
}
void ScTabViewShell::StopEditShell()
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 3108c34a9774..fbbfa248d74e 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -145,14 +145,14 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
{
if (!mbInSwitch)
{
- pResult = new ScNameDlg( pB, pCW, pParent, &GetViewData(),
+ pResult = VclPtr<ScNameDlg>::Create( pB, pCW, pParent, &GetViewData(),
ScAddress( GetViewData().GetCurX(),
GetViewData().GetCurY(),
GetViewData().GetTabNo() ) );
}
else
{
- pResult = new ScNameDlg( pB, pCW, pParent, &GetViewData(),
+ pResult = VclPtr<ScNameDlg>::Create( pB, pCW, pParent, &GetViewData(),
ScAddress( GetViewData().GetCurX(),
GetViewData().GetCurY(),
GetViewData().GetTabNo() ), &maRangeMap);
@@ -168,7 +168,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
{
std::map<OUString, ScRangeName*> aRangeMap;
pDoc->GetRangeNameMap(aRangeMap);
- pResult = new ScNameDefDlg( pB, pCW, pParent, &GetViewData(), aRangeMap,
+ pResult = VclPtr<ScNameDefDlg>::Create( pB, pCW, pParent, &GetViewData(), aRangeMap,
ScAddress( GetViewData().GetCurX(),
GetViewData().GetCurY(),
GetViewData().GetTabNo() ), true );
@@ -181,7 +181,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
{
aRangeMap.insert(std::pair<OUString, ScRangeName*>(itr->first, itr->second));
}
- pResult = new ScNameDefDlg( pB, pCW, pParent, &GetViewData(), aRangeMap,
+ pResult = VclPtr<ScNameDefDlg>::Create( pB, pCW, pParent, &GetViewData(), aRangeMap,
ScAddress( GetViewData().GetCurX(),
GetViewData().GetCurY(),
GetViewData().GetTabNo() ), false );
@@ -191,7 +191,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
case SID_DEFINE_COLROWNAMERANGES:
{
- pResult = new ScColRowNameRangesDlg( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScColRowNameRangesDlg>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
@@ -229,7 +229,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
{
aArgSet.Put( ScConsolidateItem( SCITEM_CONSOLIDATEDATA, pDlgData ) );
}
- pResult = new ScConsolidateDlg( pB, pCW, pParent, aArgSet );
+ pResult = VclPtr<ScConsolidateDlg>::Create( pB, pCW, pParent, aArgSet );
}
break;
@@ -241,7 +241,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
if ( !rMark.IsMarked() && !rMark.IsMultiMarked() )
MarkDataArea( false );
- pResult = new ScDbNameDlg( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScDbNameDlg>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
@@ -270,7 +270,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
// aktuelle Tabelle merken (wg. RefInput im Dialog)
GetViewData().SetRefTabNo( GetViewData().GetTabNo() );
- pResult = new ScSpecialFilterDlg( pB, pCW, pParent, aArgSet );
+ pResult = VclPtr<ScSpecialFilterDlg>::Create( pB, pCW, pParent, aArgSet );
}
break;
@@ -297,7 +297,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
// aktuelle Tabelle merken (wg. RefInput im Dialog)
GetViewData().SetRefTabNo( GetViewData().GetTabNo() );
- pResult = new ScFilterDlg( pB, pCW, pParent, aArgSet );
+ pResult = VclPtr<ScFilterDlg>::Create( pB, pCW, pParent, aArgSet );
}
break;
@@ -309,7 +309,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
rViewData.GetTabNo(),
false, false, false );
- pResult = new ScTabOpDlg( pB, pCW, pParent, rViewData.GetDocument(), aCurPos );
+ pResult = VclPtr<ScTabOpDlg>::Create( pB, pCW, pParent, rViewData.GetDocument(), aCurPos );
}
break;
@@ -319,79 +319,79 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
ScAddress aCurPos( rViewData.GetCurX(),
rViewData.GetCurY(),
rViewData.GetTabNo());
- pResult = new ScSolverDlg( pB, pCW, pParent, rViewData.GetDocument(), aCurPos );
+ pResult = VclPtr<ScSolverDlg>::Create( pB, pCW, pParent, rViewData.GetDocument(), aCurPos );
}
break;
case SID_RANDOM_NUMBER_GENERATOR_DIALOG:
{
- pResult = new ScRandomNumberGeneratorDialog( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScRandomNumberGeneratorDialog>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_SAMPLING_DIALOG:
{
- pResult = new ScSamplingDialog( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScSamplingDialog>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_DESCRIPTIVE_STATISTICS_DIALOG:
{
- pResult = new ScDescriptiveStatisticsDialog( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScDescriptiveStatisticsDialog>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_ANALYSIS_OF_VARIANCE_DIALOG:
{
- pResult = new ScAnalysisOfVarianceDialog( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScAnalysisOfVarianceDialog>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_CORRELATION_DIALOG:
{
- pResult = new ScCorrelationDialog( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScCorrelationDialog>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_COVARIANCE_DIALOG:
{
- pResult = new ScCovarianceDialog( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScCovarianceDialog>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_EXPONENTIAL_SMOOTHING_DIALOG:
{
- pResult = new ScExponentialSmoothingDialog( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScExponentialSmoothingDialog>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_MOVING_AVERAGE_DIALOG:
{
- pResult = new ScMovingAverageDialog( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScMovingAverageDialog>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_TTEST_DIALOG:
{
- pResult = new ScTTestDialog( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScTTestDialog>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_FTEST_DIALOG:
{
- pResult = new ScFTestDialog( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScFTestDialog>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_ZTEST_DIALOG:
{
- pResult = new ScZTestDialog( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScZTestDialog>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
case SID_CHI_SQUARE_TEST_DIALOG:
{
- pResult = new ScChiSquareTestDialog( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScChiSquareTestDialog>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
@@ -399,7 +399,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
{
ScViewData& rViewData = GetViewData();
ScAddress aCurPos( rViewData.GetCurX(), rViewData.GetCurY(), rViewData.GetTabNo());
- pResult = new ScOptSolverDlg( pB, pCW, pParent, rViewData.GetDocShell(), aCurPos );
+ pResult = VclPtr<ScOptSolverDlg>::Create( pB, pCW, pParent, rViewData.GetDocShell(), aCurPos );
}
break;
@@ -413,14 +413,14 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
ScViewData& rViewData = GetViewData();
rViewData.SetRefTabNo( rViewData.GetTabNo() );
ScDPObject* pObj = pDoc->GetDPAtCursor(rViewData.GetCurX(), rViewData.GetCurY(), rViewData.GetTabNo());
- pResult = new ScPivotLayoutDialog(pB, pCW, pParent, &rViewData, pDialogDPObject, pObj == NULL);
+ pResult = VclPtr<ScPivotLayoutDialog>::Create(pB, pCW, pParent, &rViewData, pDialogDPObject, pObj == nullptr);
}
}
break;
case SID_OPENDLG_EDIT_PRINTAREA:
{
- pResult = new ScPrintAreasDlg( pB, pCW, pParent );
+ pResult = VclPtr<ScPrintAreasDlg>::Create( pB, pCW, pParent );
}
break;
@@ -428,14 +428,14 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
{
// Dialog schaut selber, was in der Zelle steht
- pResult = new ScFormulaDlg( pB, pCW, pParent, &GetViewData(),ScGlobal::GetStarCalcFunctionMgr() );
+ pResult = VclPtr<ScFormulaDlg>::Create( pB, pCW, pParent, &GetViewData(),ScGlobal::GetStarCalcFunctionMgr() );
}
break;
case SID_MANAGE_XML_SOURCE:
{
#if ENABLE_ORCUS
- pResult = new ScXMLSourceDlg(pB, pCW, pParent, pDoc);
+ pResult = VclPtr<ScXMLSourceDlg>::Create(pB, pCW, pParent, pDoc);
#endif
}
break;
@@ -444,7 +444,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
{
// Dialog schaut selber, was in der Zelle steht
- pResult = new ScHighlightChgDlg( pB, pCW, pParent, &GetViewData() );
+ pResult = VclPtr<ScHighlightChgDlg>::Create( pB, pCW, pParent, &GetViewData() );
}
break;
@@ -454,7 +454,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
ScViewData& rViewData = GetViewData();
rViewData.SetRefTabNo( rViewData.GetTabNo() );
- pResult = new ScSimpleRefDlg( pB, pCW, pParent );
+ pResult = VclPtr<ScSimpleRefDlg>::Create( pB, pCW, pParent );
}
break;
diff --git a/sc/source/ui/view/tabvwshh.cxx b/sc/source/ui/view/tabvwshh.cxx
index c5264dd1da70..17dbaa8d2831 100644
--- a/sc/source/ui/view/tabvwshh.cxx
+++ b/sc/source/ui/view/tabvwshh.cxx
@@ -263,7 +263,7 @@ bool ScTabViewShell::ExecuteRetypePassDlg(ScPasswordHash eDesiredHash)
{
ScDocument* pDoc = GetViewData().GetDocument();
- boost::scoped_ptr<ScRetypePassDlg> pDlg(new ScRetypePassDlg(GetDialogParent()));
+ VclPtrInstance< ScRetypePassDlg > pDlg(GetDialogParent());
pDlg->SetDataFromDocument(*pDoc);
pDlg->SetDesiredHash(eDesiredHash);
if (pDlg->Execute() != RET_OK)
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 7f303eaf9815..db445ce55c91 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -1074,11 +1074,11 @@ bool ScViewFunc::MergeCells( bool bApi, bool& rDoContents, bool bRecord, bool bC
{
if (!bApi)
{
- MessBox aBox( GetViewData().GetDialogParent(),
+ ScopedVclPtrInstance<MessBox> aBox( GetViewData().GetDialogParent(),
WinBits(WB_YES_NO_CANCEL | WB_DEF_NO),
ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ),
ScGlobal::GetRscString( STR_MERGE_NOTEMPTY ) );
- sal_uInt16 nRetVal = aBox.Execute();
+ sal_uInt16 nRetVal = aBox->Execute();
if ( nRetVal == RET_YES )
rDoContents = true;
@@ -1771,10 +1771,10 @@ void ScViewFunc::Solve( const ScSolveParam& rParam )
aMsgStr += ScGlobal::GetRscString( STR_MSSG_SOLVE_4 );
}
- MessBox aBox( GetViewData().GetDialogParent(),
+ ScopedVclPtrInstance<MessBox> aBox( GetViewData().GetDialogParent(),
WinBits(WB_YES_NO | WB_DEF_NO),
ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ), aMsgStr );
- sal_uInt16 nRetVal = aBox.Execute();
+ sal_uInt16 nRetVal = aBox->Execute();
if ( RET_YES == nRetVal )
EnterValue( nDestCol, nDestRow, nDestTab, nSolveResult );
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 992e480dd22e..f1dd83099799 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -832,8 +832,8 @@ bool checkDestRangeForOverwrite(const ScRangeList& rDestRanges, const ScDocument
if (!bIsEmpty)
{
- ScReplaceWarnBox aBox(pParentWnd);
- if (aBox.Execute() != RET_YES)
+ ScopedVclPtrInstance< ScReplaceWarnBox > aBox(pParentWnd);
+ if (aBox->Execute() != RET_YES)
{
// changing the configuration is within the ScReplaceWarnBox
return false;
@@ -1041,9 +1041,9 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc,
{
ScWaitCursorOff aWaitOff( GetFrameWin() );
OUString aMessage = ScGlobal::GetRscString( STR_PASTE_BIGGER );
- QueryBox aBox( GetViewData().GetDialogParent(),
+ ScopedVclPtrInstance<QueryBox> aBox( GetViewData().GetDialogParent(),
WinBits(WB_YES_NO | WB_DEF_NO), aMessage );
- if ( aBox.Execute() != RET_YES )
+ if ( aBox->Execute() != RET_YES )
{
return false;
}
@@ -1910,7 +1910,7 @@ bool ScViewFunc::LinkBlock( const ScRange& rSource, const ScAddress& rDestPos, b
void ScViewFunc::DataFormPutData( SCROW nCurrentRow ,
SCROW nStartRow , SCCOL nStartCol ,
SCROW nEndRow , SCCOL nEndCol ,
- boost::ptr_vector<boost::nullable<Edit> >& aEdits,
+ std::vector<VclPtr<Edit> >& aEdits,
sal_uInt16 aColLength )
{
ScDocument* pDoc = GetViewData().GetDocument();
@@ -1952,9 +1952,9 @@ void ScViewFunc::DataFormPutData( SCROW nCurrentRow ,
for(sal_uInt16 i = 0; i < aColLength; i++)
{
- if (!aEdits.is_null(i))
+ if (aEdits[i] != nullptr)
{
- OUString aFieldName=aEdits[i].GetText();
+ OUString aFieldName=aEdits[i]->GetText();
pDoc->SetString( nStartCol + i, nCurrentRow, nTab, aFieldName );
}
}
diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx
index 0317fa4d7201..0ccf18bd5b2b 100644
--- a/sc/source/ui/view/viewfun4.cxx
+++ b/sc/source/ui/view/viewfun4.cxx
@@ -99,8 +99,8 @@ void ScViewFunc::PasteRTF( SCCOL nStartCol, SCROW nStartRow,
if (pActWin)
{
pEngine->SetPaperSize(Size(100000,100000));
- vcl::Window aWin( pActWin );
- EditView aEditView( pEngine.get(), &aWin );
+ VclPtrInstance< vcl::Window > aWin( pActWin );
+ EditView aEditView( pEngine.get(), aWin.get() );
aEditView.SetOutputArea(Rectangle(0,0,100000,100000));
// same method now for clipboard or drag&drop
@@ -387,8 +387,8 @@ void ScViewFunc::DoThesaurus( bool bRecord )
LanguageType eLnge = ScViewUtil::GetEffLanguage( &rDoc, ScAddress( nCol, nRow, nTab ) );
OUString aErr = SvtLanguageTable::GetLanguageString(eLnge);
aErr += ScGlobal::GetRscString( STR_SPELLING_NO_LANG );
- InfoBox aBox( GetViewData().GetDialogParent(), aErr );
- aBox.Execute();
+ ScopedVclPtrInstance< InfoBox > aBox( GetViewData().GetDialogParent(), aErr );
+ aBox->Execute();
}
if (pThesaurusEngine->IsModified())
{
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 92ddab74a3b1..d2c9d38ab3a3 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -1403,9 +1403,9 @@ void ScViewFunc::RemoveStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet )
ScDocShellModificator aModificator( *pDocSh );
- VirtualDevice aVirtDev;
- aVirtDev.SetMapMode(MAP_PIXEL);
- pDoc->StyleSheetChanged( pStyleSheet, true, &aVirtDev,
+ ScopedVclPtrInstance< VirtualDevice > pVirtDev;
+ pVirtDev->SetMapMode(MAP_PIXEL);
+ pDoc->StyleSheetChanged( pStyleSheet, true, pVirtDev,
rViewData.GetPPTX(),
rViewData.GetPPTY(),
rViewData.GetZoomX(),
@@ -1429,9 +1429,9 @@ void ScViewFunc::UpdateStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet )
ScDocShellModificator aModificator( *pDocSh );
- VirtualDevice aVirtDev;
- aVirtDev.SetMapMode(MAP_PIXEL);
- pDoc->StyleSheetChanged( pStyleSheet, false, &aVirtDev,
+ ScopedVclPtrInstance< VirtualDevice > pVirtDev;
+ pVirtDev->SetMapMode(MAP_PIXEL);
+ pDoc->StyleSheetChanged( pStyleSheet, false, pVirtDev,
rViewData.GetPPTX(),
rViewData.GetPPTY(),
rViewData.GetZoomX(),
diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
index e789276d6a0b..0224565d322c 100644
--- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx
+++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
@@ -115,9 +115,28 @@ ScXMLSourceDlg::ScXMLSourceDlg(
mpBtnSelectSource->GrabFocus(); // Initial focus is on the select source button.
}
+ScXMLSourceDlg::~ScXMLSourceDlg()
+{
+ disposeOnce();
+}
+
+void ScXMLSourceDlg::dispose()
+{
+ mpBtnSelectSource.clear();
+ mpFtSourceFile.clear();
+ mpMapGrid.clear();
+ mpLbTree.clear();
+ mpRefEdit.clear();
+ mpRefBtn.clear();
+ mpBtnOk.clear();
+ mpBtnCancel.clear();
+ mpActiveEdit.clear();
+ ScAnyRefDlg::dispose();
+}
+
bool ScXMLSourceDlg::IsRefInputMode() const
{
- return mpActiveEdit != NULL && mpActiveEdit->IsEnabled();
+ return mpActiveEdit != nullptr && mpActiveEdit->IsEnabled();
}
void ScXMLSourceDlg::SetReference(const ScRange& rRange, ScDocument* pDoc)
diff --git a/sd/inc/Outliner.hxx b/sd/inc/Outliner.hxx
index f4b1a6f64deb..a23fa4463284 100644
--- a/sd/inc/Outliner.hxx
+++ b/sd/inc/Outliner.hxx
@@ -190,7 +190,7 @@ private:
*/
::boost::weak_ptr<ViewShell> mpWeakViewShell;
/// This window contains the view.
- ::sd::Window* mpWindow;
+ VclPtr<::sd::Window> mpWindow;
/// The document on whose objects and pages this class operates.
SdDrawDocument* mpDrawDocument;
diff --git a/sd/inc/sdmod.hxx b/sd/inc/sdmod.hxx
index 5ad63fd081ee..5dfaf5a96eb9 100644
--- a/sd/inc/sdmod.hxx
+++ b/sd/inc/sdmod.hxx
@@ -125,7 +125,7 @@ public:
// virtual methods for the option dialog
virtual SfxItemSet* CreateItemSet( sal_uInt16 nId ) SAL_OVERRIDE;
virtual void ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) SAL_OVERRIDE;
- virtual SfxTabPage* CreateTabPage( sal_uInt16 nId, vcl::Window* pParent, const SfxItemSet& rSet ) SAL_OVERRIDE;
+ virtual VclPtr<SfxTabPage> CreateTabPage( sal_uInt16 nId, vcl::Window* pParent, const SfxItemSet& rSet ) SAL_OVERRIDE;
SdExtPropertySetInfoCache gImplImpressPropertySetInfoCache;
SdExtPropertySetInfoCache gImplDrawPropertySetInfoCache;
@@ -144,7 +144,7 @@ protected:
in the sense that it does not represent a printer. The pointer may
be NULL when the virtual device could not be created.
*/
- OutputDevice* mpVirtualRefDevice;
+ VclPtr< OutputDevice > mpVirtualRefDevice;
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 33e457b03cc9..58c246f8035a 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -242,8 +242,8 @@ SdDrawDocument* SdDrawDocument::OpenBookmarkDoc(SfxMedium& rMedium)
if (!bOK)
{
- MessageDialog aErrorBox(NULL, SD_RESSTR(STR_READ_DATA_ERROR));
- aErrorBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(nullptr, SD_RESSTR(STR_READ_DATA_ERROR));
+ aErrorBox->Execute();
CloseBookmarkDoc();
pBookmarkDoc = NULL;
diff --git a/sd/source/filter/eppt/epptbase.hxx b/sd/source/filter/eppt/epptbase.hxx
index b012245b4132..e616a0524d38 100644
--- a/sd/source/filter/eppt/epptbase.hxx
+++ b/sd/source/filter/eppt/epptbase.hxx
@@ -35,6 +35,8 @@
#include <com/sun/star/presentation/XPresentationSupplier.hpp>
#include <com/sun/star/presentation/FadeEffect.hpp>
#include <com/sun/star/task/XStatusIndicatorSupplier.hpp>
+#include <vcl/vclptr.hxx>
+#include <vcl/outdev.hxx>
#include "grouptable.hxx"
@@ -176,7 +178,6 @@ struct FontCollectionEntry
void ImplInit( const OUString& rName );
};
-class VirtualDevice;
class FontCollection
{
public :
@@ -197,7 +198,7 @@ public :
private:
- VirtualDevice* pVDev;
+ VclPtr<VirtualDevice> pVDev;
boost::ptr_vector<FontCollectionEntry> maFonts;
};
diff --git a/sd/source/filter/eppt/pptx-text.cxx b/sd/source/filter/eppt/pptx-text.cxx
index 192d4eb31384..a8c3e90ef9a9 100644
--- a/sd/source/filter/eppt/pptx-text.cxx
+++ b/sd/source/filter/eppt/pptx-text.cxx
@@ -1396,7 +1396,7 @@ void FontCollectionEntry::ImplInit( const OUString& rName )
FontCollection::~FontCollection()
{
- delete pVDev;
+ pVDev.disposeAndClear();
xPPTBreakIter = NULL;
}
diff --git a/sd/source/filter/grf/sdgrffilter.cxx b/sd/source/filter/grf/sdgrffilter.cxx
index 727fba485427..c8ec3ee85e24 100644
--- a/sd/source/filter/grf/sdgrffilter.cxx
+++ b/sd/source/filter/grf/sdgrffilter.cxx
@@ -169,8 +169,8 @@ void SdGRFFilter::HandleGraphicFilterError( sal_uInt16 nFilterError, sal_uLong n
ErrorHandler::HandleError( ERRCODE_IO_GENERAL );
else
{
- MessageDialog aErrorBox(NULL, SD_RESSTR(nId));
- aErrorBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(nullptr, SD_RESSTR(nId));
+ aErrorBox->Execute();
}
}
diff --git a/sd/source/filter/html/buttonset.cxx b/sd/source/filter/html/buttonset.cxx
index fbc76de77900..ab7590f09bee 100644
--- a/sd/source/filter/html/buttonset.cxx
+++ b/sd/source/filter/html/buttonset.cxx
@@ -197,8 +197,8 @@ bool ButtonSetImpl::getPreview( int nSet, const std::vector< OUString >& rButton
std::vector< Graphic > aGraphics;
- VirtualDevice aDev;
- aDev.SetMapMode(MapMode(MAP_PIXEL));
+ ScopedVclPtrInstance< VirtualDevice > pDev;
+ pDev->SetMapMode(MapMode(MAP_PIXEL));
Size aSize;
std::vector< OUString >::const_iterator aIter( rButtons.begin() );
@@ -210,7 +210,7 @@ bool ButtonSetImpl::getPreview( int nSet, const std::vector< OUString >& rButton
aGraphics.push_back(aGraphic);
- Size aGraphicSize( aGraphic.GetSizePixel( &aDev ) );
+ Size aGraphicSize( aGraphic.GetSizePixel( pDev ) );
aSize.Width() += aGraphicSize.Width();
if( aSize.Height() < aGraphicSize.Height() )
@@ -220,7 +220,7 @@ bool ButtonSetImpl::getPreview( int nSet, const std::vector< OUString >& rButton
aSize.Width() += 3;
}
- aDev.SetOutputSizePixel( aSize );
+ pDev->SetOutputSizePixel( aSize );
Point aPos;
@@ -229,12 +229,12 @@ bool ButtonSetImpl::getPreview( int nSet, const std::vector< OUString >& rButton
{
Graphic aGraphic( (*aGraphIter++) );
- aGraphic.Draw( &aDev, aPos );
+ aGraphic.Draw( pDev, aPos );
aPos.X() += aGraphic.GetSizePixel().Width() + 3;
}
- rImage = Image( aDev.GetBitmapEx( Point(), aSize ) );
+ rImage = Image( pDev->GetBitmapEx( Point(), aSize ) );
return true;
}
return false;
diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx
index d743aeb854f2..d761c2367f1d 100644
--- a/sd/source/filter/html/htmlex.cxx
+++ b/sd/source/filter/html/htmlex.cxx
@@ -3113,9 +3113,9 @@ bool HtmlExport::checkForExistingFiles()
OUString aSystemPath;
osl::FileBase::getSystemPathFromFileURL( maExportPath, aSystemPath );
aMsg = aMsg.replaceFirst( "%FILENAME", aSystemPath );
- WarningBox aWarning( 0, WB_YES_NO | WB_DEF_YES, aMsg );
- aWarning.SetImage( WarningBox::GetStandardImage() );
- bFound = ( RET_NO == aWarning.Execute() );
+ ScopedVclPtrInstance< WarningBox > aWarning( nullptr, WB_YES_NO | WB_DEF_YES, aMsg );
+ aWarning->SetImage( WarningBox::GetStandardImage() );
+ bFound = ( RET_NO == aWarning->Execute() );
delete pResMgr;
}
diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx
index a581a66d82b6..033eeb0fe52b 100644
--- a/sd/source/filter/html/pubdlg.cxx
+++ b/sd/source/filter/html/pubdlg.cxx
@@ -347,12 +347,13 @@ SvStream& WriteSdPublishingDesign(SvStream& rOut, const SdPublishingDesign& rDes
class SdDesignNameDlg : public ModalDialog
{
private:
- Edit* m_pEdit;
- OKButton* m_pBtnOK;
+ VclPtr<Edit> m_pEdit;
+ VclPtr<OKButton> m_pBtnOK;
public:
SdDesignNameDlg(vcl::Window* pWindow, const OUString& aName );
-
+ virtual ~SdDesignNameDlg();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetDesignName();
DECL_LINK(ModifyHdl, void *);
};
@@ -483,8 +484,97 @@ SdPublishingDlg::SdPublishingDlg(vcl::Window* pWindow, DocumentType eDocType)
SdPublishingDlg::~SdPublishingDlg()
{
+ disposeOnce();
+}
+
+void SdPublishingDlg::dispose()
+{
+ pPage1.clear();
+ pPage1_Titel.clear();
+ pPage1_NewDesign.clear();
+ pPage1_OldDesign.clear();
+ pPage1_Designs.clear();
+ pPage1_DelDesign.clear();
+ pPage1_Desc.clear();
+ pPage2.clear();
+ pPage2Frame2.clear();
+ pPage2Frame3.clear();
+ pPage2Frame4.clear();
+ pPage2_Titel.clear();
+ pPage2_Standard.clear();
+ pPage2_Frames.clear();
+ pPage2_SingleDocument.clear();
+ pPage2_Kiosk.clear();
+ pPage2_WebCast.clear();
+ pPage2_Standard_FB.clear();
+ pPage2_Frames_FB.clear();
+ pPage2_Kiosk_FB.clear();
+ pPage2_WebCast_FB.clear();
+ pPage2_Titel_Html.clear();
+ pPage2_Content.clear();
+ pPage2_Notes.clear();
+ pPage2_Titel_WebCast.clear();
+ pPage2_ASP.clear();
+ pPage2_PERL.clear();
+ pPage2_URL_txt.clear();
+ pPage2_URL.clear();
+ pPage2_CGI_txt.clear();
+ pPage2_CGI.clear();
+ pPage2_Index_txt.clear();
+ pPage2_Index.clear();
+ pPage2_Titel_Kiosk.clear();
+ pPage2_ChgDefault.clear();
+ pPage2_ChgAuto.clear();
+ pPage2_Duration_txt.clear();
+ pPage2_Duration.clear();
+ pPage2_Endless.clear();
+ pPage3.clear();
+ pPage3_Titel1.clear();
+ pPage3_Png.clear();
+ pPage3_Gif.clear();
+ pPage3_Jpg.clear();
+ pPage3_Quality_txt.clear();
+ pPage3_Quality.clear();
+ pPage3_Titel2.clear();
+ pPage3_Resolution_1.clear();
+ pPage3_Resolution_2.clear();
+ pPage3_Resolution_3.clear();
+ pPage3_Titel3.clear();
+ pPage3_SldSound.clear();
+ pPage3_HiddenSlides.clear();
+ pPage4.clear();
+ pPage4_Titel1.clear();
+ pPage4_Author_txt.clear();
+ pPage4_Author.clear();
+ pPage4_Email_txt.clear();
+ pPage4_Email.clear();
+ pPage4_WWW_txt.clear();
+ pPage4_WWW.clear();
+ pPage4_Titel2.clear();
+ pPage4_Misc.clear();
+ pPage4_Download.clear();
+ pPage5.clear();
+ pPage5_Titel.clear();
+ pPage5_TextOnly.clear();
+ pPage5_Buttons.clear();
+ pPage6.clear();
+ pPage6_Titel.clear();
+ pPage6_Default.clear();
+ pPage6_User.clear();
+ pPage6_Back.clear();
+ pPage6_Text.clear();
+ pPage6_Link.clear();
+ pPage6_VLink.clear();
+ pPage6_ALink.clear();
+ pPage6_DocColors.clear();
+ pPage6_Preview.clear();
+ pLastPageButton.clear();
+ pNextPageButton.clear();
+ pFinishButton.clear();
+ ModalDialog::dispose();
}
+
// Generate dialog controls and embed them in the pages
void SdPublishingDlg::CreatePages()
{
@@ -1072,11 +1162,11 @@ IMPL_LINK_NOARG(SdPublishingDlg, FinishHdl)
{
bRetry = false;
- SdDesignNameDlg aDlg(this, aName );
+ ScopedVclPtrInstance< SdDesignNameDlg > aDlg(this, aName );
- if ( aDlg.Execute() == RET_OK )
+ if ( aDlg->Execute() == RET_OK )
{
- pDesign->m_aDesignName = aDlg.GetDesignName();
+ pDesign->m_aDesignName = aDlg->GetDesignName();
boost::ptr_vector<SdPublishingDesign>::iterator iter;
for (iter = m_aDesignList.begin(); iter != m_aDesignList.end(); ++iter)
@@ -1087,9 +1177,9 @@ IMPL_LINK_NOARG(SdPublishingDlg, FinishHdl)
if (iter != m_aDesignList.end())
{
- MessageDialog aErrorBox(this, SD_RESSTR(STR_PUBDLG_SAMENAME),
+ ScopedVclPtrInstance<MessageDialog> aErrorBox(this, SD_RESSTR(STR_PUBDLG_SAMENAME),
VCL_MESSAGE_ERROR, VCL_BUTTONS_YES_NO);
- bRetry = aErrorBox.Execute() == RET_NO;
+ bRetry = aErrorBox->Execute() == RET_NO;
if(!bRetry)
m_aDesignList.erase(iter);
@@ -1542,6 +1632,18 @@ SdDesignNameDlg::SdDesignNameDlg(vcl::Window* pWindow, const OUString& aName)
m_pBtnOK->Enable(!aName.isEmpty());
}
+SdDesignNameDlg::~SdDesignNameDlg()
+{
+ disposeOnce();
+}
+
+void SdDesignNameDlg::dispose()
+{
+ m_pEdit.clear();
+ m_pBtnOK.clear();
+ ModalDialog::dispose();
+}
+
OUString SdDesignNameDlg::GetDesignName()
{
return m_pEdit->GetText();
diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
index 6cde28c4d4f1..f2f4f4a9df0c 100644
--- a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
+++ b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
@@ -96,7 +96,7 @@ private:
sal_Int32 mnFirstVisibleChild;
sal_Int32 mnLastVisibleChild;
bool mbListeningToDocument;
- vcl::Window* mpWindow;
+ VclPtr<vcl::Window> mpWindow;
sal_Int32 mnFocusedIndex;
bool mbModelChangeLocked;
ImplSVEvent * mnUpdateChildrenUserEventId;
@@ -221,7 +221,7 @@ Reference<XAccessible > SAL_CALL AccessibleSlideSorterView::getAccessibleParent(
const SolarMutexGuard aSolarGuard;
Reference<XAccessible> xParent;
- if (mpContentWindow != NULL)
+ if (mpContentWindow != nullptr)
{
vcl::Window* pParent = mpContentWindow->GetAccessibleParentWindow();
if (pParent != NULL)
@@ -302,7 +302,7 @@ Reference<XAccessibleStateSet > SAL_CALL
pStateSet->AddState(AccessibleStateType::ACTIVE);
pStateSet->AddState(AccessibleStateType::MULTI_SELECTABLE);
pStateSet->AddState(AccessibleStateType::OPAQUE);
- if (mpContentWindow!=NULL)
+ if (mpContentWindow!=nullptr)
{
if (mpContentWindow->IsVisible())
pStateSet->AddState(AccessibleStateType::VISIBLE);
@@ -416,7 +416,7 @@ awt::Rectangle SAL_CALL AccessibleSlideSorterView::getBounds()
const SolarMutexGuard aSolarGuard;
awt::Rectangle aBBox;
- if (mpContentWindow != NULL)
+ if (mpContentWindow != nullptr)
{
const Point aPosition (mpContentWindow->GetPosPixel());
const Size aSize (mpContentWindow->GetOutputSizePixel());
@@ -436,7 +436,7 @@ awt::Point SAL_CALL AccessibleSlideSorterView::getLocation()
ThrowIfDisposed();
awt::Point aLocation;
- if (mpContentWindow != NULL)
+ if (mpContentWindow != nullptr)
{
const Point aPosition (mpContentWindow->GetPosPixel());
aLocation.X = aPosition.X();
@@ -478,7 +478,7 @@ awt::Size SAL_CALL AccessibleSlideSorterView::getSize()
ThrowIfDisposed();
awt::Size aSize;
- if (mpContentWindow != NULL)
+ if (mpContentWindow != nullptr)
{
const Size aOutputSize (mpContentWindow->GetOutputSizePixel());
aSize.Width = aOutputSize.Width();
@@ -813,7 +813,7 @@ void AccessibleSlideSorterView::Implementation::ConnectListeners()
StartListening (*mrSlideSorter.GetViewShell());
mbListeningToDocument = true;
- if (mpWindow != NULL)
+ if (mpWindow != nullptr)
mpWindow->AddEventListener(
LINK(this,AccessibleSlideSorterView::Implementation,WindowEventListener));
@@ -834,7 +834,7 @@ void AccessibleSlideSorterView::Implementation::ReleaseListeners()
mrSlideSorter.GetView().RemoveVisibilityChangeListener(
LINK(this,AccessibleSlideSorterView::Implementation,VisibilityChangeListener));
- if (mpWindow != NULL)
+ if (mpWindow != nullptr)
mpWindow->RemoveEventListener(
LINK(this,AccessibleSlideSorterView::Implementation,WindowEventListener));
diff --git a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx
index 239f19586dd9..59bcdecaceb0 100644
--- a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx
@@ -165,6 +165,7 @@ class CustomAnimationCreateTabPage : public TabPage
public:
CustomAnimationCreateTabPage( vcl::Window* pParent, CustomAnimationCreateDialog* pDialogParent, sal_uInt16 nTabId, const PresetCategoryList& rCategoryList, bool bHasText, bool bIsMotionPath = false );
virtual ~CustomAnimationCreateTabPage();
+ virtual void dispose() SAL_OVERRIDE;
PathKind getCreatePathKind() const;
CustomAnimationPresetPtr getSelectedPreset() const;
@@ -187,12 +188,12 @@ private:
void clearEffects();
private:
- CategoryListBox* mpLBEffects;
- FixedText* mpFTSpeed;
- ListBox* mpCBSpeed;
- CheckBox* mpCBXPReview;
+ VclPtr<CategoryListBox> mpLBEffects;
+ VclPtr<FixedText> mpFTSpeed;
+ VclPtr<ListBox> mpCBSpeed;
+ VclPtr<CheckBox> mpCBXPReview;
- CustomAnimationCreateDialog* mpParent;
+ VclPtr<CustomAnimationCreateDialog> mpParent;
sal_uInt16 mnId;
@@ -296,7 +297,18 @@ CustomAnimationCreateTabPage::CustomAnimationCreateTabPage( vcl::Window* pParent
CustomAnimationCreateTabPage::~CustomAnimationCreateTabPage()
{
+ disposeOnce();
+}
+
+void CustomAnimationCreateTabPage::dispose()
+{
clearEffects();
+ mpLBEffects.clear();
+ mpFTSpeed.clear();
+ mpCBSpeed.clear();
+ mpCBXPReview.clear();
+ mpParent.clear();
+ TabPage::dispose();
}
IMPL_LINK( CustomAnimationCreateTabPage, implSelectHdl, Control*, pControl )
@@ -497,15 +509,15 @@ CustomAnimationCreateDialog::CustomAnimationCreateDialog( vcl::Window* pParent,
mnMiscId = mpTabControl->GetPageId("misc_effects");
const CustomAnimationPresets& rPresets = CustomAnimationPresets::getCustomAnimationPresets();
- mpTabPages[ENTRANCE] = new CustomAnimationCreateTabPage( mpTabControl, this, mnEntranceId, rPresets.getEntrancePresets(), bHasText );
+ mpTabPages[ENTRANCE] = VclPtr<CustomAnimationCreateTabPage>::Create( mpTabControl, this, mnEntranceId, rPresets.getEntrancePresets(), bHasText );
mpTabControl->SetTabPage( mnEntranceId, mpTabPages[ENTRANCE] );
- mpTabPages[EMPHASIS] = new CustomAnimationCreateTabPage( mpTabControl, this, mnEmphasisId, rPresets.getEmphasisPresets(), bHasText );
+ mpTabPages[EMPHASIS] = VclPtr<CustomAnimationCreateTabPage>::Create( mpTabControl, this, mnEmphasisId, rPresets.getEmphasisPresets(), bHasText );
mpTabControl->SetTabPage( mnEmphasisId, mpTabPages[EMPHASIS] );
- mpTabPages[EXIT] = new CustomAnimationCreateTabPage( mpTabControl, this, mnExitId, rPresets.getExitPresets(), bHasText );
+ mpTabPages[EXIT] = VclPtr<CustomAnimationCreateTabPage>::Create( mpTabControl, this, mnExitId, rPresets.getExitPresets(), bHasText );
mpTabControl->SetTabPage( mnExitId, mpTabPages[EXIT] );
- mpTabPages[MOTIONPATH] = new CustomAnimationCreateTabPage( mpTabControl, this, mnMPathId, rPresets.getMotionPathsPresets(), bHasText, true );
+ mpTabPages[MOTIONPATH] = VclPtr<CustomAnimationCreateTabPage>::Create( mpTabControl, this, mnMPathId, rPresets.getMotionPathsPresets(), bHasText, true );
mpTabControl->SetTabPage( mnMPathId, mpTabPages[MOTIONPATH] );
- mpTabPages[MISCEFFECTS] = new CustomAnimationCreateTabPage( mpTabControl, this, mnMiscId, rPresets.getMiscPresets(), bHasText );
+ mpTabPages[MISCEFFECTS] = VclPtr<CustomAnimationCreateTabPage>::Create( mpTabControl, this, mnMiscId, rPresets.getMiscPresets(), bHasText );
mpTabControl->SetTabPage( mnMiscId, mpTabPages[MISCEFFECTS] );
getCurrentPage()->setDuration( mfDuration );
@@ -532,17 +544,25 @@ CustomAnimationCreateDialog::CustomAnimationCreateDialog( vcl::Window* pParent,
CustomAnimationCreateDialog::~CustomAnimationCreateDialog()
{
+ disposeOnce();
+}
+
+void CustomAnimationCreateDialog::dispose()
+{
storePosition();
SdOptions* pOptions = SD_MOD()->GetSdOptions(DOCUMENT_TYPE_IMPRESS);
pOptions->SetPreviewNewEffects( getCurrentPage()->getIsPreview() );
- delete mpTabPages[ENTRANCE];
- delete mpTabPages[EMPHASIS];
- delete mpTabPages[EXIT];
- delete mpTabPages[MOTIONPATH];
- delete mpTabPages[MISCEFFECTS];
+ mpTabPages[ENTRANCE].disposeAndClear();
+ mpTabPages[EMPHASIS].disposeAndClear();
+ mpTabPages[EXIT].disposeAndClear();
+ mpTabPages[MOTIONPATH].disposeAndClear();
+ mpTabPages[MISCEFFECTS].disposeAndClear();
+ mpTabControl.clear();
+ mpPane.clear();
+ TabDialog::dispose();
}
CustomAnimationCreateTabPage* CustomAnimationCreateDialog::getCurrentPage() const
diff --git a/sd/source/ui/animations/CustomAnimationCreateDialog.hxx b/sd/source/ui/animations/CustomAnimationCreateDialog.hxx
index b17be8894781..68a5c811bc87 100644
--- a/sd/source/ui/animations/CustomAnimationCreateDialog.hxx
+++ b/sd/source/ui/animations/CustomAnimationCreateDialog.hxx
@@ -41,6 +41,7 @@ class CustomAnimationCreateDialog : public TabDialog
public:
CustomAnimationCreateDialog( vcl::Window* pParent, CustomAnimationPane* pPane, const std::vector< ::com::sun::star::uno::Any >& rTargets, bool bHasText, const OUString& rsPresetId, double fDuration );
virtual ~CustomAnimationCreateDialog();
+ virtual void dispose() SAL_OVERRIDE;
PathKind getCreatePathKind() const;
CustomAnimationPresetPtr getSelectedPreset() const;
@@ -56,15 +57,15 @@ private:
DECL_LINK(implDeactivatePagekHdl, void *);
private:
- CustomAnimationPane* mpPane;
+ VclPtr<CustomAnimationPane> mpPane;
const std::vector< ::com::sun::star::uno::Any >& mrTargets;
double mfDuration;
bool mbIsPreview;
- TabControl* mpTabControl;
+ VclPtr<TabControl> mpTabControl;
- CustomAnimationCreateTabPage* mpTabPages[5];
+ VclPtr<CustomAnimationCreateTabPage> mpTabPages[5];
sal_uInt16 mnEntranceId, mnEmphasisId, mnExitId, mnMPathId, mnMiscId;
};
diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx
index 5a4577aeb74a..c2bd3292e100 100644
--- a/sd/source/ui/animations/CustomAnimationDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.cxx
@@ -107,13 +107,13 @@ public:
private:
std::map< sal_uInt16, OUString > maPropertyValues;
- ListBox* mpControl;
+ VclPtr<ListBox> mpControl;
};
PresetPropertyBox::PresetPropertyBox( sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const OUString& aPresetId, const Link& rModifyHdl )
: PropertySubControl( nControlType )
{
- mpControl = new ListBox( pParent, WB_BORDER|WB_TABSTOP|WB_DROPDOWN );
+ mpControl = VclPtr<ListBox>::Create( pParent, WB_BORDER|WB_TABSTOP|WB_DROPDOWN );
mpControl->SetDropDownLineCount( 10 );
mpControl->SetSelectHdl( rModifyHdl );
mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_PRESETPROPERTYBOX );
@@ -159,7 +159,7 @@ void PresetPropertyBox::setValue( const Any& rValue, const OUString& rPresetId )
PresetPropertyBox::~PresetPropertyBox()
{
- delete mpControl;
+ mpControl.disposeAndClear();
}
Any PresetPropertyBox::getValue()
@@ -183,13 +183,13 @@ public:
virtual Control* getControl() SAL_OVERRIDE;
private:
- ColorListBox* mpControl;
+ VclPtr<ColorListBox> mpControl;
};
ColorPropertyBox::ColorPropertyBox( sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const Link& rModifyHdl )
: PropertySubControl( nControlType )
{
- mpControl = new ColorListBox( pParent, WB_BORDER|WB_TABSTOP|WB_DROPDOWN );
+ mpControl = VclPtr<ColorListBox>::Create( pParent, WB_BORDER|WB_TABSTOP|WB_DROPDOWN );
mpControl->SetDropDownLineCount( 10 );
mpControl->SetSelectHdl( rModifyHdl );
mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_COLORPROPERTYBOX );
@@ -219,7 +219,7 @@ ColorPropertyBox::ColorPropertyBox( sal_Int32 nControlType, vcl::Window* pParent
ColorPropertyBox::~ColorPropertyBox()
{
- delete mpControl;
+ mpControl.disposeAndClear();
}
void ColorPropertyBox::setValue( const Any& rValue, const OUString& )
@@ -256,13 +256,13 @@ public:
virtual Control* getControl() SAL_OVERRIDE;
private:
- FontNameBox* mpControl;
+ VclPtr<FontNameBox> mpControl;
};
FontPropertyBox::FontPropertyBox( sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const Link& rModifyHdl )
: PropertySubControl( nControlType )
{
- mpControl = new FontNameBox( pParent, WB_BORDER|WB_TABSTOP|WB_DROPDOWN );
+ mpControl = VclPtr<FontNameBox>::Create( pParent, WB_BORDER|WB_TABSTOP|WB_DROPDOWN );
mpControl->SetDropDownLineCount( 10 );
mpControl->SetSelectHdl( rModifyHdl );
mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_FONTPROPERTYBOX );
@@ -303,7 +303,7 @@ void FontPropertyBox::setValue( const Any& rValue, const OUString& )
FontPropertyBox::~FontPropertyBox()
{
- delete mpControl;
+ mpControl.disposeAndClear();
}
Any FontPropertyBox::getValue()
@@ -322,6 +322,7 @@ class DropdownMenuBox : public Edit
public:
DropdownMenuBox( vcl::Window* pParent, Edit* pSubControl, PopupMenu* pMenu );
virtual ~DropdownMenuBox();
+ virtual void dispose() SAL_OVERRIDE;
void Resize() SAL_OVERRIDE;
bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -329,16 +330,16 @@ public:
void SetMenuSelectHdl( const Link& rLink ) { mpDropdownButton->SetSelectHdl( rLink ); }
private:
- Edit* mpSubControl;
- MenuButton* mpDropdownButton;
- PopupMenu* mpMenu;
+ VclPtr<Edit> mpSubControl;
+ VclPtr<MenuButton> mpDropdownButton;
+ PopupMenu* mpMenu;
};
DropdownMenuBox::DropdownMenuBox( vcl::Window* pParent, Edit* pSubControl, PopupMenu* pMenu )
: Edit( pParent, WB_BORDER|WB_TABSTOP| WB_DIALOGCONTROL ),
mpSubControl(pSubControl),mpDropdownButton(0),mpMenu(pMenu)
{
- mpDropdownButton = new MenuButton( this, WB_NOLIGHTBORDER | WB_RECTSTYLE | WB_NOTABSTOP);
+ mpDropdownButton = VclPtr<MenuButton>::Create( this, WB_NOLIGHTBORDER | WB_RECTSTYLE | WB_NOTABSTOP);
mpDropdownButton->SetSymbol(SymbolType::SPIN_DOWN);
mpDropdownButton->Show();
mpDropdownButton->SetPopupMenu( pMenu );
@@ -350,10 +351,16 @@ DropdownMenuBox::DropdownMenuBox( vcl::Window* pParent, Edit* pSubControl, Popup
DropdownMenuBox::~DropdownMenuBox()
{
- SetSubEdit( 0 );
- delete mpSubControl;
- delete mpDropdownButton;
+ disposeOnce();
+}
+
+void DropdownMenuBox::dispose()
+{
+ SetSubEdit(nullptr);
+ mpDropdownButton.disposeAndClear();
delete mpMenu;
+ mpSubControl.disposeAndClear();
+ Edit::dispose();
}
void DropdownMenuBox::Resize()
@@ -405,21 +412,21 @@ public:
DECL_LINK( implMenuSelectHdl, MenuButton* );
private:
- DropdownMenuBox* mpControl;
+ VclPtr<DropdownMenuBox> mpControl;
PopupMenu* mpMenu;
- MetricField* mpMetric;
+ VclPtr<MetricField> mpMetric;
};
CharHeightPropertyBox::CharHeightPropertyBox( sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const Link& rModifyHdl )
: PropertySubControl( nControlType )
{
- mpMetric = new MetricField( pParent, WB_TABSTOP|WB_IGNORETAB| WB_NOBORDER);
+ mpMetric.set( VclPtr<MetricField>::Create( pParent, WB_TABSTOP|WB_IGNORETAB| WB_NOBORDER) );
mpMetric->SetUnit( FUNIT_PERCENT );
mpMetric->SetMin( 0 );
mpMetric->SetMax( 1000 );
mpMenu = new PopupMenu(SdResId( RID_CUSTOMANIMATION_FONTSIZE_POPUP ) );
- mpControl = new DropdownMenuBox( pParent, mpMetric, mpMenu );
+ mpControl = VclPtr<DropdownMenuBox>::Create( pParent, mpMetric, mpMenu );
mpControl->SetMenuSelectHdl( LINK( this, CharHeightPropertyBox, implMenuSelectHdl ));
mpControl->SetModifyHdl( rModifyHdl );
mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_CHARHEIGHTPROPERTYBOX );
@@ -430,7 +437,7 @@ CharHeightPropertyBox::CharHeightPropertyBox( sal_Int32 nControlType, vcl::Windo
CharHeightPropertyBox::~CharHeightPropertyBox()
{
- delete mpControl;
+ mpControl.disposeAndClear();
}
IMPL_LINK( CharHeightPropertyBox, implMenuSelectHdl, MenuButton*, pPb )
@@ -450,7 +457,7 @@ IMPL_LINK( CharHeightPropertyBox, implMenuSelectHdl, MenuButton*, pPb )
void CharHeightPropertyBox::setValue( const Any& rValue, const OUString& )
{
- if( mpMetric )
+ if( mpMetric.get() )
{
double fValue = 0.0;
rValue >>= fValue;
@@ -485,9 +492,9 @@ public:
void updateMenu();
private:
- DropdownMenuBox* mpControl;
+ VclPtr<DropdownMenuBox> mpControl;
PopupMenu* mpMenu;
- MetricField* mpMetric;
+ VclPtr<MetricField> mpMetric;
Link maModifyHdl;
};
@@ -495,7 +502,7 @@ TransparencyPropertyBox::TransparencyPropertyBox( sal_Int32 nControlType, vcl::W
: PropertySubControl( nControlType )
, maModifyHdl( rModifyHdl )
{
- mpMetric = new MetricField( pParent ,WB_TABSTOP|WB_IGNORETAB| WB_NOBORDER);
+ mpMetric.set( VclPtr<MetricField>::Create( pParent ,WB_TABSTOP|WB_IGNORETAB| WB_NOBORDER) );
mpMetric->SetUnit( FUNIT_PERCENT );
mpMetric->SetMin( 0 );
mpMetric->SetMax( 100 );
@@ -508,7 +515,7 @@ TransparencyPropertyBox::TransparencyPropertyBox( sal_Int32 nControlType, vcl::W
mpMenu->InsertItem( i, aStr );
}
- mpControl = new DropdownMenuBox( pParent, mpMetric, mpMenu );
+ mpControl = VclPtr<DropdownMenuBox>::Create( pParent, mpMetric, mpMenu );
mpControl->SetMenuSelectHdl( LINK( this, TransparencyPropertyBox, implMenuSelectHdl ));
mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_TRANSPARENCYPROPERTYBOX );
@@ -521,7 +528,7 @@ TransparencyPropertyBox::TransparencyPropertyBox( sal_Int32 nControlType, vcl::W
TransparencyPropertyBox::~TransparencyPropertyBox()
{
- delete mpControl;
+ mpControl.disposeAndClear();
}
void TransparencyPropertyBox::updateMenu()
@@ -534,7 +541,7 @@ void TransparencyPropertyBox::updateMenu()
IMPL_LINK_NOARG(TransparencyPropertyBox, implModifyHdl)
{
updateMenu();
- maModifyHdl.Call(mpMetric);
+ maModifyHdl.Call(mpMetric.get());
return 0;
}
@@ -552,7 +559,7 @@ IMPL_LINK( TransparencyPropertyBox, implMenuSelectHdl, MenuButton*, pPb )
void TransparencyPropertyBox::setValue( const Any& rValue, const OUString& )
{
- if( mpMetric )
+ if( mpMetric.get() )
{
double fValue = 0.0;
rValue >>= fValue;
@@ -589,9 +596,9 @@ public:
void updateMenu();
private:
- DropdownMenuBox* mpControl;
+ VclPtr<DropdownMenuBox> mpControl;
PopupMenu* mpMenu;
- MetricField* mpMetric;
+ VclPtr<MetricField> mpMetric;
Link maModifyHdl;
};
@@ -599,14 +606,14 @@ RotationPropertyBox::RotationPropertyBox( sal_Int32 nControlType, vcl::Window* p
: PropertySubControl( nControlType )
, maModifyHdl( rModifyHdl )
{
- mpMetric = new MetricField( pParent ,WB_TABSTOP|WB_IGNORETAB| WB_NOBORDER);
+ mpMetric.set( VclPtr<MetricField>::Create( pParent ,WB_TABSTOP|WB_IGNORETAB| WB_NOBORDER) );
mpMetric->SetUnit( FUNIT_CUSTOM );
mpMetric->SetCustomUnitText( OUString( sal_Unicode(0xb0)) ); // degree sign
mpMetric->SetMin( -10000 );
mpMetric->SetMax( 10000 );
mpMenu = new PopupMenu(SdResId( RID_CUSTOMANIMATION_ROTATION_POPUP ) );
- mpControl = new DropdownMenuBox( pParent, mpMetric, mpMenu );
+ mpControl = VclPtr<DropdownMenuBox>::Create( pParent, mpMetric, mpMenu );
mpControl->SetMenuSelectHdl( LINK( this, RotationPropertyBox, implMenuSelectHdl ));
mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_ROTATIONPROPERTYBOX );
@@ -619,7 +626,7 @@ RotationPropertyBox::RotationPropertyBox( sal_Int32 nControlType, vcl::Window* p
RotationPropertyBox::~RotationPropertyBox()
{
- delete mpControl;
+ mpControl.disposeAndClear();
}
void RotationPropertyBox::updateMenu()
@@ -640,7 +647,7 @@ void RotationPropertyBox::updateMenu()
IMPL_LINK_NOARG(RotationPropertyBox, implModifyHdl)
{
updateMenu();
- maModifyHdl.Call(mpMetric);
+ maModifyHdl.Call(mpMetric.get());
return 0;
}
@@ -677,7 +684,7 @@ IMPL_LINK( RotationPropertyBox, implMenuSelectHdl, MenuButton*, pPb )
void RotationPropertyBox::setValue( const Any& rValue, const OUString& )
{
- if( mpMetric )
+ if( mpMetric.get() )
{
double fValue = 0.0;
rValue >>= fValue;
@@ -714,9 +721,9 @@ public:
void updateMenu();
private:
- DropdownMenuBox* mpControl;
+ VclPtr<DropdownMenuBox> mpControl;
PopupMenu* mpMenu;
- MetricField* mpMetric;
+ VclPtr<MetricField> mpMetric;
Link maModifyHdl;
int mnDirection;
};
@@ -725,13 +732,13 @@ ScalePropertyBox::ScalePropertyBox( sal_Int32 nControlType, vcl::Window* pParent
: PropertySubControl( nControlType )
, maModifyHdl( rModifyHdl )
{
- mpMetric = new MetricField( pParent ,WB_TABSTOP|WB_IGNORETAB| WB_NOBORDER);
+ mpMetric.set( VclPtr<MetricField>::Create( pParent ,WB_TABSTOP|WB_IGNORETAB| WB_NOBORDER) );
mpMetric->SetUnit( FUNIT_PERCENT );
mpMetric->SetMin( 0 );
mpMetric->SetMax( 10000 );
mpMenu = new PopupMenu(SdResId( RID_CUSTOMANIMATION_SCALE_POPUP ) );
- mpControl = new DropdownMenuBox( pParent, mpMetric, mpMenu );
+ mpControl = VclPtr<DropdownMenuBox>::Create( pParent, mpMetric, mpMenu );
mpControl->SetMenuSelectHdl( LINK( this, ScalePropertyBox, implMenuSelectHdl ));
mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_SCALEPROPERTYBOX );
@@ -744,7 +751,7 @@ ScalePropertyBox::ScalePropertyBox( sal_Int32 nControlType, vcl::Window* pParent
ScalePropertyBox::~ScalePropertyBox()
{
- delete mpControl;
+ mpControl.disposeAndClear();
}
void ScalePropertyBox::updateMenu()
@@ -764,7 +771,7 @@ void ScalePropertyBox::updateMenu()
IMPL_LINK_NOARG(ScalePropertyBox, implModifyHdl)
{
updateMenu();
- maModifyHdl.Call(mpMetric);
+ maModifyHdl.Call(mpMetric.get());
return 0;
}
@@ -810,7 +817,7 @@ IMPL_LINK( ScalePropertyBox, implMenuSelectHdl, MenuButton*, pPb )
void ScalePropertyBox::setValue( const Any& rValue, const OUString& )
{
- if( mpMetric )
+ if( mpMetric.get() )
{
ValuePair aValues;
rValue >>= aValues;
@@ -876,9 +883,9 @@ public:
void update();
private:
- DropdownMenuBox* mpControl;
+ VclPtr<DropdownMenuBox> mpControl;
PopupMenu* mpMenu;
- Edit* mpEdit;
+ VclPtr<Edit> mpEdit;
Link maModifyHdl;
float mfFontWeight;
@@ -890,11 +897,11 @@ FontStylePropertyBox::FontStylePropertyBox( sal_Int32 nControlType, vcl::Window*
: PropertySubControl( nControlType )
, maModifyHdl( rModifyHdl )
{
- mpEdit = new Edit( pParent, WB_TABSTOP|WB_IGNORETAB|WB_NOBORDER|WB_READONLY);
+ mpEdit.set( VclPtr<Edit>::Create( pParent, WB_TABSTOP|WB_IGNORETAB|WB_NOBORDER|WB_READONLY) );
mpEdit->SetText( SD_RESSTR(STR_CUSTOMANIMATION_SAMPLE) );
mpMenu = new PopupMenu(SdResId( RID_CUSTOMANIMATION_FONTSTYLE_POPUP ) );
- mpControl = new DropdownMenuBox( pParent, mpEdit, mpMenu );
+ mpControl = VclPtr<DropdownMenuBox>::Create( pParent, mpEdit, mpMenu );
mpControl->SetMenuSelectHdl( LINK( this, FontStylePropertyBox, implMenuSelectHdl ));
mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_FONTSTYLEPROPERTYBOX );
@@ -904,7 +911,7 @@ FontStylePropertyBox::FontStylePropertyBox( sal_Int32 nControlType, vcl::Window*
FontStylePropertyBox::~FontStylePropertyBox()
{
- delete mpControl;
+ mpControl.disposeAndClear();
}
void FontStylePropertyBox::update()
@@ -950,7 +957,7 @@ IMPL_LINK( FontStylePropertyBox, implMenuSelectHdl, MenuButton*, pPb )
}
update();
- maModifyHdl.Call(mpEdit);
+ maModifyHdl.Call(mpEdit.get());
return 0;
}
@@ -986,6 +993,7 @@ class CustomAnimationEffectTabPage : public TabPage
public:
CustomAnimationEffectTabPage( vcl::Window* pParent, const STLPropertySet* pSet );
virtual ~CustomAnimationEffectTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void update( STLPropertySet* pSet );
DECL_LINK( implSelectHdl, Control* );
@@ -1003,24 +1011,24 @@ private:
bool mbHasText;
const STLPropertySet* mpSet;
- VclFrame* mpSettings;
- FixedText* mpFTProperty1;
- PropertyControl* mpLBProperty1;
- VclHBox* mpPlaceholderBox;
- CheckBox* mpCBSmoothStart;
- CheckBox* mpCBSmoothEnd;
-
- FixedText* mpFTSound;
- ListBox* mpLBSound;
- PushButton* mpPBSoundPreview;
- FixedText* mpFTAfterEffect;
- ListBox* mpLBAfterEffect;
- FixedText* mpFTDimColor;
- ColorListBox* mpCLBDimColor;
- FixedText* mpFTTextAnim;
- ListBox* mpLBTextAnim;
- MetricField* mpMFTextDelay;
- FixedText* mpFTTextDelay;
+ VclPtr<VclFrame> mpSettings;
+ VclPtr<FixedText> mpFTProperty1;
+ VclPtr<PropertyControl> mpLBProperty1;
+ VclPtr<VclHBox> mpPlaceholderBox;
+ VclPtr<CheckBox> mpCBSmoothStart;
+ VclPtr<CheckBox> mpCBSmoothEnd;
+
+ VclPtr<FixedText> mpFTSound;
+ VclPtr<ListBox> mpLBSound;
+ VclPtr<PushButton> mpPBSoundPreview;
+ VclPtr<FixedText> mpFTAfterEffect;
+ VclPtr<ListBox> mpLBAfterEffect;
+ VclPtr<FixedText> mpFTDimColor;
+ VclPtr<ColorListBox> mpCLBDimColor;
+ VclPtr<FixedText> mpFTTextAnim;
+ VclPtr<ListBox> mpLBTextAnim;
+ VclPtr<MetricField> mpMFTextDelay;
+ VclPtr<FixedText> mpFTTextDelay;
::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > mxPlayer;
};
@@ -1255,7 +1263,30 @@ CustomAnimationEffectTabPage::CustomAnimationEffectTabPage( vcl::Window* pParent
CustomAnimationEffectTabPage::~CustomAnimationEffectTabPage()
{
+ disposeOnce();
+}
+
+void CustomAnimationEffectTabPage::dispose()
+{
clearSoundListBox();
+ mpSettings.clear();
+ mpFTProperty1.clear();
+ mpLBProperty1.clear();
+ mpPlaceholderBox.clear();
+ mpCBSmoothStart.clear();
+ mpCBSmoothEnd.clear();
+ mpFTSound.clear();
+ mpLBSound.clear();
+ mpPBSoundPreview.clear();
+ mpFTAfterEffect.clear();
+ mpLBAfterEffect.clear();
+ mpFTDimColor.clear();
+ mpCLBDimColor.clear();
+ mpFTTextAnim.clear();
+ mpLBTextAnim.clear();
+ mpMFTextDelay.clear();
+ mpFTTextDelay.clear();
+ TabPage::dispose();
}
void CustomAnimationEffectTabPage::updateControlStates()
@@ -1517,9 +1548,9 @@ void CustomAnimationEffectTabPage::openSoundFileDialog()
{
OUString aStrWarning(SD_RESSTR(STR_WARNING_NOSOUNDFILE));
aStrWarning = aStrWarning.replaceFirst("%", aFile);
- WarningBox aWarningBox( NULL, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning );
- aWarningBox.SetModalInputMode (true);
- bQuitLoop = aWarningBox.Execute() != RET_RETRY;
+ ScopedVclPtrInstance< WarningBox > aWarningBox( nullptr, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning );
+ aWarningBox->SetModalInputMode (true);
+ bQuitLoop = aWarningBox->Execute() != RET_RETRY;
bValidSoundFile=false;
}
@@ -1558,6 +1589,7 @@ class CustomAnimationDurationTabPage : public TabPage
public:
CustomAnimationDurationTabPage( vcl::Window* pParent, const STLPropertySet* pSet );
virtual ~CustomAnimationDurationTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void update( STLPropertySet* pSet );
@@ -1566,18 +1598,18 @@ public:
private:
const STLPropertySet* mpSet;
- FixedText* mpFTStart;
- ListBox* mpLBStart;
- FixedText* mpFTStartDelay;
- MetricField* mpMFStartDelay;
- FixedText* mpFTDuration;
- ListBox* mpCBDuration;
- FixedText* mpFTRepeat;
- ListBox* mpCBRepeat;
- CheckBox* mpCBXRewind;
- RadioButton* mpRBClickSequence;
- RadioButton* mpRBInteractive;
- ListBox* mpLBTrigger;
+ VclPtr<FixedText> mpFTStart;
+ VclPtr<ListBox> mpLBStart;
+ VclPtr<FixedText> mpFTStartDelay;
+ VclPtr<MetricField> mpMFStartDelay;
+ VclPtr<FixedText> mpFTDuration;
+ VclPtr<ListBox> mpCBDuration;
+ VclPtr<FixedText> mpFTRepeat;
+ VclPtr<ListBox> mpCBRepeat;
+ VclPtr<CheckBox> mpCBXRewind;
+ VclPtr<RadioButton> mpRBClickSequence;
+ VclPtr<RadioButton> mpRBInteractive;
+ VclPtr<ListBox> mpLBTrigger;
};
CustomAnimationDurationTabPage::CustomAnimationDurationTabPage(vcl::Window* pParent, const STLPropertySet* pSet)
@@ -1755,6 +1787,24 @@ CustomAnimationDurationTabPage::CustomAnimationDurationTabPage(vcl::Window* pPar
CustomAnimationDurationTabPage::~CustomAnimationDurationTabPage()
{
+ disposeOnce();
+}
+
+void CustomAnimationDurationTabPage::dispose()
+{
+ mpFTStart.clear();
+ mpLBStart.clear();
+ mpFTStartDelay.clear();
+ mpMFStartDelay.clear();
+ mpFTDuration.clear();
+ mpCBDuration.clear();
+ mpFTRepeat.clear();
+ mpCBRepeat.clear();
+ mpCBXRewind.clear();
+ mpRBClickSequence.clear();
+ mpRBInteractive.clear();
+ mpLBTrigger.clear();
+ TabPage::dispose();
}
IMPL_LINK( CustomAnimationDurationTabPage, implControlHdl, Control*, pControl )
@@ -1924,6 +1974,8 @@ class CustomAnimationTextAnimTabPage : public TabPage
{
public:
CustomAnimationTextAnimTabPage( vcl::Window* pParent, const STLPropertySet* pSet );
+ virtual ~CustomAnimationTextAnimTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void update( STLPropertySet* pSet );
@@ -1931,12 +1983,12 @@ public:
DECL_LINK(implSelectHdl, void *);
private:
- FixedText* maFTGroupText;
- ListBox* maLBGroupText;
- CheckBox* maCBXGroupAuto;
- MetricField* maMFGroupAuto;
- CheckBox* maCBXAnimateForm;
- CheckBox* maCBXReverse;
+ VclPtr<FixedText> maFTGroupText;
+ VclPtr<ListBox> maLBGroupText;
+ VclPtr<CheckBox> maCBXGroupAuto;
+ VclPtr<MetricField> maMFGroupAuto;
+ VclPtr<CheckBox> maCBXAnimateForm;
+ VclPtr<CheckBox> maCBXReverse;
const STLPropertySet* mpSet;
@@ -2023,6 +2075,22 @@ CustomAnimationTextAnimTabPage::CustomAnimationTextAnimTabPage(vcl::Window* pPar
updateControlStates();
}
+CustomAnimationTextAnimTabPage::~CustomAnimationTextAnimTabPage()
+{
+ disposeOnce();
+}
+
+void CustomAnimationTextAnimTabPage::dispose()
+{
+ maFTGroupText.clear();
+ maLBGroupText.clear();
+ maCBXGroupAuto.clear();
+ maMFGroupAuto.clear();
+ maCBXAnimateForm.clear();
+ maCBXReverse.clear();
+ TabPage::dispose();
+}
+
void CustomAnimationTextAnimTabPage::update( STLPropertySet* pSet )
{
sal_Int32 nPos = maLBGroupText->GetSelectEntryPos();
@@ -2113,9 +2181,9 @@ CustomAnimationDialog::CustomAnimationDialog(vcl::Window* pParent, STLPropertySe
sal_uInt16 mnTimingId = mpTabControl->GetPageId("timing");
sal_uInt16 mnTextAnimId = mpTabControl->GetPageId("textanim");
- mpEffectTabPage = new CustomAnimationEffectTabPage( mpTabControl, mpSet );
+ mpEffectTabPage = VclPtr<CustomAnimationEffectTabPage>::Create( mpTabControl, mpSet );
mpTabControl->SetTabPage( mnEffectId, mpEffectTabPage );
- mpDurationTabPage = new CustomAnimationDurationTabPage( mpTabControl, mpSet );
+ mpDurationTabPage = VclPtr<CustomAnimationDurationTabPage>::Create( mpTabControl, mpSet );
mpTabControl->SetTabPage( mnTimingId, mpDurationTabPage );
bool bHasText = false;
@@ -2124,7 +2192,7 @@ CustomAnimationDialog::CustomAnimationDialog(vcl::Window* pParent, STLPropertySe
if( bHasText )
{
- mpTextAnimTabPage = new CustomAnimationTextAnimTabPage( mpTabControl, mpSet );
+ mpTextAnimTabPage = VclPtr<CustomAnimationTextAnimTabPage>::Create( mpTabControl, mpSet );
mpTabControl->SetTabPage( mnTextAnimId, mpTextAnimTabPage );
}
else
@@ -2139,12 +2207,20 @@ CustomAnimationDialog::CustomAnimationDialog(vcl::Window* pParent, STLPropertySe
CustomAnimationDialog::~CustomAnimationDialog()
{
- delete mpEffectTabPage;
- delete mpDurationTabPage;
- delete mpTextAnimTabPage;
+ disposeOnce();
+}
+
+void CustomAnimationDialog::dispose()
+{
+ mpEffectTabPage.disposeAndClear();
+ mpDurationTabPage.disposeAndClear();
+ mpTextAnimTabPage.disposeAndClear();
delete mpSet;
delete mpResultSet;
+
+ mpTabControl.clear();
+ TabDialog::dispose();
}
STLPropertySet* CustomAnimationDialog::getResultSet()
@@ -2222,8 +2298,14 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makePropertyControl( vcl::
PropertyControl::~PropertyControl()
{
+ disposeOnce();
+}
+
+void PropertyControl::dispose()
+{
if( mpSubControl )
delete mpSubControl;
+ ListBox::dispose();
}
void PropertyControl::setSubControl( PropertySubControl* pSubControl )
diff --git a/sd/source/ui/animations/CustomAnimationDialog.hxx b/sd/source/ui/animations/CustomAnimationDialog.hxx
index 2fcdc742073a..3754d93ffdbf 100644
--- a/sd/source/ui/animations/CustomAnimationDialog.hxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.hxx
@@ -123,6 +123,7 @@ class PropertyControl : public ListBox
public:
PropertyControl( vcl::Window* pParent );
virtual ~PropertyControl();
+ virtual void dispose() SAL_OVERRIDE;
void setSubControl( PropertySubControl* pSubControl );
PropertySubControl* getSubControl() const { return mpSubControl; }
@@ -143,6 +144,7 @@ class CustomAnimationDialog : public TabDialog
public:
CustomAnimationDialog(vcl::Window* pParent, STLPropertySet* pSet, const OString& Page = OString());
virtual ~CustomAnimationDialog();
+ virtual void dispose() SAL_OVERRIDE;
STLPropertySet* getDefaultSet() { return mpSet; }
STLPropertySet* getResultSet();
@@ -154,11 +156,11 @@ private:
STLPropertySet* mpResultSet;
CustomAnimationEffectPtr mpEffect;
- TabControl* mpTabControl;
+ VclPtr<TabControl> mpTabControl;
- CustomAnimationDurationTabPage* mpDurationTabPage;
- CustomAnimationEffectTabPage* mpEffectTabPage;
- CustomAnimationTextAnimTabPage* mpTextAnimTabPage;
+ VclPtr<CustomAnimationDurationTabPage> mpDurationTabPage;
+ VclPtr<CustomAnimationEffectTabPage> mpEffectTabPage;
+ VclPtr<CustomAnimationTextAnimTabPage> mpTextAnimTabPage;
};
}
diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx
index c7f62dad3a59..dd4441aeebfb 100644
--- a/sd/source/ui/animations/CustomAnimationList.cxx
+++ b/sd/source/ui/animations/CustomAnimationList.cxx
@@ -210,7 +210,7 @@ public:
virtual void Paint(
const Point&, SvTreeListBox& rDev, const SvViewDataEntry* pView,const SvTreeListEntry* pEntry) SAL_OVERRIDE;
private:
- CustomAnimationList* mpParent;
+ VclPtr<CustomAnimationList> mpParent;
OUString maDescription;
CustomAnimationEffectPtr mpEffect;
};
@@ -444,10 +444,16 @@ const Image& CustomAnimationList::getImage( sal_uInt16 nId )
CustomAnimationList::~CustomAnimationList()
{
+ disposeOnce();
+}
+
+void CustomAnimationList::dispose()
+{
if( mpMainSequence.get() )
mpMainSequence->removeListener( this );
clear();
+ SvTreeListBox::dispose();
}
void CustomAnimationList::KeyInput( const KeyEvent& rKEvt )
diff --git a/sd/source/ui/animations/CustomAnimationList.hxx b/sd/source/ui/animations/CustomAnimationList.hxx
index 66301bb6f830..18fde3c2db14 100644
--- a/sd/source/ui/animations/CustomAnimationList.hxx
+++ b/sd/source/ui/animations/CustomAnimationList.hxx
@@ -48,6 +48,7 @@ class CustomAnimationList : public SvTreeListBox, public ISequenceListener
public:
CustomAnimationList( vcl::Window* pParent );
virtual ~CustomAnimationList();
+ virtual void dispose() SAL_OVERRIDE;
// methods
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index 6e36b0b64d84..431c75b661f5 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -225,6 +225,11 @@ CustomAnimationPane::CustomAnimationPane( Window* pParent, ViewShellBase& rBase,
CustomAnimationPane::~CustomAnimationPane()
{
+ disposeOnce();
+}
+
+void CustomAnimationPane::dispose()
+{
maLateInitTimer.Stop();
removeListener();
@@ -235,6 +240,24 @@ CustomAnimationPane::~CustomAnimationPane()
for( aIter = aTags.begin(); aIter != aTags.end(); ++aIter )
(*aIter)->Dispose();
+ mpPBAddEffect.clear();
+ mpPBChangeEffect.clear();
+ mpPBRemoveEffect.clear();
+ mpFTEffect.clear();
+ mpFTStart.clear();
+ mpLBStart.clear();
+ mpFTProperty.clear();
+ mpPlaceholderBox.clear();
+ mpLBProperty.clear();
+ mpPBPropertyMore.clear();
+ mpFTSpeed.clear();
+ mpCBSpeed.clear();
+ mpCustomAnimationList.clear();
+ mpPBMoveUp.clear();
+ mpPBMoveDown.clear();
+ mpPBPlay.clear();
+ mpCBAutoPreview.clear();
+ PanelLayout::dispose();
}
void CustomAnimationPane::addUndo()
@@ -809,11 +832,11 @@ void CustomAnimationPane::UpdateLook()
::sfx2::sidebar::Theme::GetWallpaper(
::sfx2::sidebar::Theme::Paint_PanelBackground));
SetBackground(aBackground);
- if (mpFTStart != NULL)
+ if (mpFTStart != nullptr)
mpFTStart->SetBackground(aBackground);
- if (mpFTProperty != NULL)
+ if (mpFTProperty != nullptr)
mpFTProperty->SetBackground(aBackground);
- if (mpFTSpeed != NULL)
+ if (mpFTSpeed != nullptr)
mpFTSpeed->SetBackground(aBackground);
}
@@ -1550,7 +1573,7 @@ void CustomAnimationPane::showOptions(const OString& sPage)
{
STLPropertySet* pSet = createSelectionSet();
- boost::scoped_ptr<CustomAnimationDialog> pDlg(new CustomAnimationDialog(this, pSet, sPage));
+ VclPtrInstance< CustomAnimationDialog > pDlg(this, pSet, sPage);
if( pDlg->Execute() )
{
addUndo();
@@ -1729,7 +1752,7 @@ void CustomAnimationPane::onChange( bool bCreate )
}
}
- boost::scoped_ptr<CustomAnimationCreateDialog> pDlg(new CustomAnimationCreateDialog( this, this, aTargets, bHasText, sPresetId, fDuration ));
+ VclPtrInstance< CustomAnimationCreateDialog > pDlg( this, this, aTargets, bHasText, sPresetId, fDuration );
if( pDlg->Execute() )
{
addUndo();
@@ -2263,7 +2286,7 @@ void CustomAnimationPane::updatePathFromMotionPathTag( const rtl::Reference< Mot
if( pDocSh )
{
const Size aMinSize( pParent->LogicToPixel( Size( 80, 256 ), MAP_APPFONT ) );
- pWindow = new CustomAnimationPane( pParent, rBase, rxFrame, aMinSize );
+ pWindow = VclPtr<CustomAnimationPane>::Create( pParent, rBase, rxFrame, aMinSize );
}
return pWindow;
diff --git a/sd/source/ui/animations/CustomAnimationPane.hxx b/sd/source/ui/animations/CustomAnimationPane.hxx
index 57d10c613611..0fd6f19a6595 100644
--- a/sd/source/ui/animations/CustomAnimationPane.hxx
+++ b/sd/source/ui/animations/CustomAnimationPane.hxx
@@ -64,6 +64,7 @@ class CustomAnimationPane : public PanelLayout, public ICustomAnimationListContr
public:
CustomAnimationPane( vcl::Window* pParent, ViewShellBase& rBase, const css::uno::Reference<css::frame::XFrame>& rxFrame, const Size& rMinSize );
virtual ~CustomAnimationPane();
+ virtual void dispose() SAL_OVERRIDE;
// callbacks
void onSelectionChanged();
@@ -125,23 +126,23 @@ private:
const CustomAnimationPresets* mpCustomAnimationPresets;
- PushButton* mpPBAddEffect;
- PushButton* mpPBChangeEffect;
- PushButton* mpPBRemoveEffect;
- FixedText* mpFTEffect;
- FixedText* mpFTStart;
- ListBox* mpLBStart;
- FixedText* mpFTProperty;
- VclHBox* mpPlaceholderBox;
- PropertyControl* mpLBProperty;
- PushButton* mpPBPropertyMore;
- FixedText* mpFTSpeed;
- ListBox* mpCBSpeed;
- CustomAnimationList* mpCustomAnimationList;
- PushButton* mpPBMoveUp;
- PushButton* mpPBMoveDown;
- PushButton* mpPBPlay;
- CheckBox* mpCBAutoPreview;
+ VclPtr<PushButton> mpPBAddEffect;
+ VclPtr<PushButton> mpPBChangeEffect;
+ VclPtr<PushButton> mpPBRemoveEffect;
+ VclPtr<FixedText> mpFTEffect;
+ VclPtr<FixedText> mpFTStart;
+ VclPtr<ListBox> mpLBStart;
+ VclPtr<FixedText> mpFTProperty;
+ VclPtr<VclHBox> mpPlaceholderBox;
+ VclPtr<PropertyControl> mpLBProperty;
+ VclPtr<PushButton> mpPBPropertyMore;
+ VclPtr<FixedText> mpFTSpeed;
+ VclPtr<ListBox> mpCBSpeed;
+ VclPtr<CustomAnimationList> mpCustomAnimationList;
+ VclPtr<PushButton> mpPBMoveUp;
+ VclPtr<PushButton> mpPBMoveDown;
+ VclPtr<PushButton> mpPBPlay;
+ VclPtr<CheckBox> mpCBAutoPreview;
OUString maStrModify;
OUString maStrProperty;
diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx
index 56bf1437dcb3..917a53e03b77 100644
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -386,7 +386,7 @@ struct lcl_AppendSoundToListBox : public ::std::unary_function< OUString, void >
}
private:
- ListBox* mrListBox;
+ VclPtr<ListBox> mrListBox;
};
void lcl_FillSoundListBox(
@@ -483,8 +483,27 @@ SlideTransitionPane::SlideTransitionPane(
SlideTransitionPane::~SlideTransitionPane()
{
+ disposeOnce();
+}
+
+void SlideTransitionPane::dispose()
+{
maLateInitTimer.Stop();
removeListener();
+ mpLB_SLIDE_TRANSITIONS.clear();
+ mpFT_SPEED.clear();
+ mpLB_SPEED.clear();
+ mpFT_SOUND.clear();
+ mpLB_SOUND.clear();
+ mpCB_LOOP_SOUND.clear();
+ mpRB_ADVANCE_ON_MOUSE.clear();
+ mpRB_ADVANCE_AUTO.clear();
+ mpMF_ADVANCE_AUTO_AFTER.clear();
+ mpPB_APPLY_TO_ALL.clear();
+ mpPB_PLAY.clear();
+ mpPB_SLIDE_SHOW.clear();
+ mpCB_AUTO_PREVIEW.clear();
+ PanelLayout::dispose();
}
void SlideTransitionPane::DataChanged (const DataChangedEvent& rEvent)
@@ -724,9 +743,9 @@ void SlideTransitionPane::openSoundFileDialog()
{
OUString aStrWarning(SD_RESSTR(STR_WARNING_NOSOUNDFILE));
aStrWarning = aStrWarning.replaceFirst("%", aFile);
- WarningBox aWarningBox( NULL, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning );
- aWarningBox.SetModalInputMode (true);
- bQuitLoop = (aWarningBox.Execute() != RET_RETRY);
+ ScopedVclPtrInstance< WarningBox > aWarningBox( nullptr, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning );
+ aWarningBox->SetModalInputMode (true);
+ bQuitLoop = (aWarningBox->Execute() != RET_RETRY);
bValidSoundFile = false;
}
@@ -1082,7 +1101,7 @@ IMPL_LINK_NOARG(SlideTransitionPane, LateInitCallback)
if( pDocSh )
{
Size aMinSize( pParent->LogicToPixel( Size( 72, 216 ), MAP_APPFONT ) );
- pWindow = new SlideTransitionPane( pParent, rBase, aMinSize, pDocSh->GetDoc(), rxFrame );
+ pWindow = VclPtr<SlideTransitionPane>::Create( pParent, rBase, aMinSize, pDocSh->GetDoc(), rxFrame );
}
return pWindow;
diff --git a/sd/source/ui/animations/SlideTransitionPane.hxx b/sd/source/ui/animations/SlideTransitionPane.hxx
index 3bb556d74112..63e76e3d1242 100644
--- a/sd/source/ui/animations/SlideTransitionPane.hxx
+++ b/sd/source/ui/animations/SlideTransitionPane.hxx
@@ -58,6 +58,7 @@ public:
SdDrawDocument* pDoc,
const css::uno::Reference<css::frame::XFrame>& rxFrame );
virtual ~SlideTransitionPane();
+ virtual void dispose() SAL_OVERRIDE;
// Window
virtual void DataChanged (const DataChangedEvent& rEvent) SAL_OVERRIDE;
@@ -104,19 +105,19 @@ private:
SdDrawDocument * mpDrawDoc;
Size maMinSize;
- ListBox* mpLB_SLIDE_TRANSITIONS;
- FixedText* mpFT_SPEED;
- ListBox* mpLB_SPEED;
- FixedText* mpFT_SOUND;
- ListBox* mpLB_SOUND;
- CheckBox* mpCB_LOOP_SOUND;
- RadioButton* mpRB_ADVANCE_ON_MOUSE;
- RadioButton* mpRB_ADVANCE_AUTO;
- MetricField* mpMF_ADVANCE_AUTO_AFTER;
- PushButton* mpPB_APPLY_TO_ALL;
- PushButton* mpPB_PLAY;
- PushButton* mpPB_SLIDE_SHOW;
- CheckBox* mpCB_AUTO_PREVIEW;
+ VclPtr<ListBox> mpLB_SLIDE_TRANSITIONS;
+ VclPtr<FixedText> mpFT_SPEED;
+ VclPtr<ListBox> mpLB_SPEED;
+ VclPtr<FixedText> mpFT_SOUND;
+ VclPtr<ListBox> mpLB_SOUND;
+ VclPtr<CheckBox> mpCB_LOOP_SOUND;
+ VclPtr<RadioButton> mpRB_ADVANCE_ON_MOUSE;
+ VclPtr<RadioButton> mpRB_ADVANCE_AUTO;
+ VclPtr<MetricField> mpMF_ADVANCE_AUTO_AFTER;
+ VclPtr<PushButton> mpPB_APPLY_TO_ALL;
+ VclPtr<PushButton> mpPB_PLAY;
+ VclPtr<PushButton> mpPB_SLIDE_SHOW;
+ VclPtr<CheckBox> mpCB_AUTO_PREVIEW;
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawView > mxView;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxModel;
diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx
index b856cb1e0b89..21614cd73662 100644
--- a/sd/source/ui/annotations/annotationmanager.cxx
+++ b/sd/source/ui/annotations/annotationmanager.cxx
@@ -694,10 +694,9 @@ void AnnotationManagerImpl::SelectNextAnnotation(bool bForeward)
// Pop up question box that asks the user whether to wrap around.
// The dialog is made modal with respect to the whole application.
- QueryBox aQuestionBox ( NULL, (WB_YES_NO | WB_DEF_YES), SD_RESSTR(nStringId));
- aQuestionBox.SetImage (QueryBox::GetStandardImage());
- short nBoxResult = aQuestionBox.Execute();
- if (nBoxResult != RET_YES)
+ ScopedVclPtrInstance< QueryBox > aQuestionBox( nullptr, (WB_YES_NO | WB_DEF_YES), SD_RESSTR(nStringId));
+ aQuestionBox->SetImage( QueryBox::GetStandardImage() );
+ if (aQuestionBox->Execute() != RET_YES)
break;
}
while( true );
diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx
index 610ed613588f..ae9dc833b3fe 100644
--- a/sd/source/ui/annotations/annotationtag.cxx
+++ b/sd/source/ui/annotations/annotationtag.cxx
@@ -515,19 +515,19 @@ void AnnotationTag::deselect()
BitmapEx AnnotationTag::CreateAnnotationBitmap( bool bSelected )
{
- VirtualDevice aVDev;
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
OUString sAuthor( getInitials( mxAnnotation->getAuthor() ) );
sAuthor += OUString( ' ' );
sAuthor += OUString::number( mnIndex );
- aVDev.SetFont( mrFont );
+ pVDev->SetFont( mrFont );
const int BORDER_X = 4; // pixels
const int BORDER_Y = 4; // pixels
- maSize = Size( aVDev.GetTextWidth( sAuthor ) + 2*BORDER_X, aVDev.GetTextHeight() + 2*BORDER_Y );
- aVDev.SetOutputSizePixel( maSize, false );
+ maSize = Size( pVDev->GetTextWidth( sAuthor ) + 2*BORDER_X, pVDev->GetTextHeight() + 2*BORDER_Y );
+ pVDev->SetOutputSizePixel( maSize, false );
Color aBorderColor( maColor );
@@ -549,14 +549,14 @@ BitmapEx AnnotationTag::CreateAnnotationBitmap( bool bSelected )
Point aPos;
Rectangle aBorderRect( aPos, maSize );
- aVDev.SetLineColor(aBorderColor);
- aVDev.SetFillColor(maColor);
- aVDev.DrawRect( aBorderRect );
+ pVDev->SetLineColor(aBorderColor);
+ pVDev->SetFillColor(maColor);
+ pVDev->DrawRect( aBorderRect );
- aVDev.SetTextColor( maColor.IsDark() ? COL_WHITE : COL_BLACK );
- aVDev.DrawText( Point( BORDER_X, BORDER_Y ), sAuthor );
+ pVDev->SetTextColor( maColor.IsDark() ? COL_WHITE : COL_BLACK );
+ pVDev->DrawText( Point( BORDER_X, BORDER_Y ), sAuthor );
- return aVDev.GetBitmapEx( aPos, maSize );
+ return pVDev->GetBitmapEx( aPos, maSize );
}
void AnnotationTag::OpenPopup( bool bEdit )
@@ -577,7 +577,7 @@ void AnnotationTag::OpenPopup( bool bEdit )
Rectangle aRect( aPos, maSize );
- mpAnnotationWindow.reset( new AnnotationWindow( mrManager, mrView.GetDocSh(), pWindow->GetWindow(WINDOW_FRAME) ) );
+ mpAnnotationWindow.reset( VclPtr<AnnotationWindow>::Create( mrManager, mrView.GetDocSh(), pWindow->GetWindow(WINDOW_FRAME) ) );
mpAnnotationWindow->InitControls();
mpAnnotationWindow->setAnnotation(mxAnnotation);
diff --git a/sd/source/ui/annotations/annotationtag.hxx b/sd/source/ui/annotations/annotationtag.hxx
index 96085f253fcb..d53c5445f4d7 100644
--- a/sd/source/ui/annotations/annotationtag.hxx
+++ b/sd/source/ui/annotations/annotationtag.hxx
@@ -79,13 +79,13 @@ protected:
private:
AnnotationManagerImpl& mrManager;
css::uno::Reference< css::office::XAnnotation > mxAnnotation;
- std::unique_ptr<AnnotationWindow> mpAnnotationWindow;
+ VclPtr<AnnotationWindow> mpAnnotationWindow;
Color maColor;
int mnIndex;
const ::vcl::Font& mrFont;
Size maSize;
ImplSVEvent * mnClosePopupEvent;
- vcl::Window* mpListenWindow;
+ VclPtr<vcl::Window> mpListenWindow;
Point maMouseDownPos;
};
diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx
index 9129ca8f952b..830180347e13 100644
--- a/sd/source/ui/annotations/annotationwindow.cxx
+++ b/sd/source/ui/annotations/annotationwindow.cxx
@@ -118,6 +118,13 @@ AnnotationTextWindow::AnnotationTextWindow( AnnotationWindow* pParent, WinBits n
AnnotationTextWindow::~AnnotationTextWindow()
{
+ disposeOnce();
+}
+
+void AnnotationTextWindow::dispose()
+{
+ mpAnnotationWindow.clear();
+ Control::dispose();
}
void AnnotationTextWindow::Paint( const Rectangle& rRect)
@@ -284,21 +291,27 @@ AnnotationWindow::AnnotationWindow( AnnotationManagerImpl& rManager, DrawDocShel
AnnotationWindow::~AnnotationWindow()
{
- delete mpMeta;
+ disposeOnce();
+}
+
+void AnnotationWindow::dispose()
+{
+ mpMeta.disposeAndClear();
delete mpOutlinerView;
delete mpOutliner;
- delete mpVScrollbar;
- delete mpTextWindow;
+ mpVScrollbar.disposeAndClear();
+ mpTextWindow.disposeAndClear();
+ FloatingWindow::dispose();
}
void AnnotationWindow::InitControls()
{
// actual window which holds the user text
- mpTextWindow = new AnnotationTextWindow(this, WB_NODIALOGCONTROL);
+ mpTextWindow = VclPtr<AnnotationTextWindow>::Create(this, WB_NODIALOGCONTROL);
mpTextWindow->SetPointer(Pointer(POINTER_TEXT));
// window control for author and date
- mpMeta = new MultiLineEdit(this,0);
+ mpMeta = VclPtr<MultiLineEdit>::Create(this,0);
mpMeta->SetReadOnly();
mpMeta->SetRightToLeft(AllSettings::GetLayoutRTL());
mpMeta->AlwaysDisableInput(true);
@@ -332,7 +345,7 @@ void AnnotationWindow::InitControls()
mpOutlinerView->SetOutputArea( PixelToLogic( Rectangle(0,0,1,1) ) );
//create Scrollbars
- mpVScrollbar = new ScrollBar(this, WB_3DLOOK |WB_VSCROLL|WB_DRAG);
+ mpVScrollbar = VclPtr<ScrollBar>::Create(this, WB_3DLOOK |WB_VSCROLL|WB_DRAG);
mpVScrollbar->EnableNativeWidget(false);
mpVScrollbar->EnableRTL( false );
mpVScrollbar->SetScrollHdl(LINK(this, AnnotationWindow, ScrollHdl));
diff --git a/sd/source/ui/annotations/annotationwindow.hxx b/sd/source/ui/annotations/annotationwindow.hxx
index f8adcdf99a81..766ea975b31f 100644
--- a/sd/source/ui/annotations/annotationwindow.hxx
+++ b/sd/source/ui/annotations/annotationwindow.hxx
@@ -50,7 +50,7 @@ class AnnotationTextWindow : public Control
{
private:
OutlinerView* mpOutlinerView;
- AnnotationWindow* mpAnnotationWindow;
+ VclPtr<AnnotationWindow> mpAnnotationWindow;
protected:
virtual void Paint( const Rectangle& rRect) SAL_OVERRIDE;
@@ -64,6 +64,7 @@ protected:
public:
AnnotationTextWindow( AnnotationWindow* pParent, WinBits nBits );
virtual ~AnnotationTextWindow();
+ virtual void dispose() SAL_OVERRIDE;
void SetOutlinerView( OutlinerView* pOutlinerView ) { mpOutlinerView = pOutlinerView; }
@@ -83,13 +84,13 @@ class AnnotationWindow : public FloatingWindow
OutlinerView* mpOutlinerView;
Outliner* mpOutliner;
- ScrollBar* mpVScrollbar;
+ VclPtr<ScrollBar> mpVScrollbar;
::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation > mxAnnotation;
bool mbReadonly;
bool mbProtected;
bool mbMouseOverButton;
- AnnotationTextWindow* mpTextWindow;
- MultiLineEdit* mpMeta;
+ VclPtr<AnnotationTextWindow> mpTextWindow;
+ VclPtr<MultiLineEdit> mpMeta;
Rectangle maRectMetaButton;
basegfx::B2DPolygon maPopupTriangle;
@@ -102,6 +103,7 @@ class AnnotationWindow : public FloatingWindow
public:
AnnotationWindow( AnnotationManagerImpl& rManager, DrawDocShell* pDocShell, vcl::Window* pParent );
virtual ~AnnotationWindow();
+ virtual void dispose() SAL_OVERRIDE;
void StartEdit();
diff --git a/sd/source/ui/app/sdmod.cxx b/sd/source/ui/app/sdmod.cxx
index b982264de845..5c3b2dde6ecd 100644
--- a/sd/source/ui/app/sdmod.cxx
+++ b/sd/source/ui/app/sdmod.cxx
@@ -119,7 +119,7 @@ SdModule::~SdModule()
(*ppShellPointer) = NULL;
delete mpErrorHdl;
- delete static_cast< VirtualDevice* >( mpVirtualRefDevice );
+ mpVirtualRefDevice.disposeAndClear();
}
/// get notifications
diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx
index 5d36c8f6b7dd..9e8ea11ddae4 100644
--- a/sd/source/ui/app/sdmod2.cxx
+++ b/sd/source/ui/app/sdmod2.cxx
@@ -727,9 +727,9 @@ void SdModule::ApplyItemSet( sal_uInt16 nSlot, const SfxItemSet& rSet )
pViewShell->GetViewFrame()->GetBindings().InvalidateAll( true );
}
-SfxTabPage* SdModule::CreateTabPage( sal_uInt16 nId, vcl::Window* pParent, const SfxItemSet& rSet )
+VclPtr<SfxTabPage> SdModule::CreateTabPage( sal_uInt16 nId, vcl::Window* pParent, const SfxItemSet& rSet )
{
- SfxTabPage* pRet = NULL;
+ VclPtr<SfxTabPage> pRet;
SfxAllItemSet aSet(*(rSet.GetPool()));
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
if( pFact )
diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx
index 283544f8aa99..ed424d464275 100644
--- a/sd/source/ui/app/sdxfer.cxx
+++ b/sd/source/ui/app/sdxfer.cxx
@@ -141,7 +141,7 @@ SdTransferable::~SdTransferable()
delete mpBookmark;
delete mpImageMap;
- delete mpVDev;
+ mpVDev.disposeAndClear();
delete mpObjDesc;
//call explicitly at end of dtor to be covered by above SolarMutex
@@ -262,7 +262,7 @@ void SdTransferable::CreateData()
if( 1 == pPage->GetObjCount() )
CreateObjectReplacement( pPage->GetObj( 0 ) );
- mpVDev = new VirtualDevice( *Application::GetDefaultDevice() );
+ mpVDev = VclPtr<VirtualDevice>::Create( *Application::GetDefaultDevice() );
mpVDev->SetMapMode( MapMode( mpSdDrawDocumentIntern->GetScaleUnit(), Point(), mpSdDrawDocumentIntern->GetScaleFraction(), mpSdDrawDocumentIntern->GetScaleFraction() ) );
mpSdViewIntern = new ::sd::View( *mpSdDrawDocumentIntern, mpVDev );
mpSdViewIntern->EndListening(*mpSdDrawDocumentIntern );
diff --git a/sd/source/ui/app/tbxww.cxx b/sd/source/ui/app/tbxww.cxx
index cbf40156aa4b..2aed6b89c96e 100644
--- a/sd/source/ui/app/tbxww.cxx
+++ b/sd/source/ui/app/tbxww.cxx
@@ -62,7 +62,7 @@ SfxPopupWindowType SdTbxControl::GetPopupWindowType() const
* rItemRect are screen coordinates
*/
-SfxPopupWindow* SdTbxControl::CreatePopupWindow()
+VclPtr<SfxPopupWindow> SdTbxControl::CreatePopupWindow()
{
SfxPopupWindow *pWin = NULL;
OUString aToolBarResStr;
diff --git a/sd/source/ui/controller/slidelayoutcontroller.cxx b/sd/source/ui/controller/slidelayoutcontroller.cxx
index 7c8d02a46819..468428081523 100644
--- a/sd/source/ui/controller/slidelayoutcontroller.cxx
+++ b/sd/source/ui/controller/slidelayoutcontroller.cxx
@@ -67,6 +67,7 @@ class LayoutToolbarMenu : public svtools::ToolbarMenu
public:
LayoutToolbarMenu( SlideLayoutController& rController, const Reference< XFrame >& xFrame, vcl::Window* pParent, const bool bInsertPage );
virtual ~LayoutToolbarMenu();
+ virtual void dispose() SAL_OVERRIDE;
protected:
DECL_LINK( SelectHdl, void * );
@@ -75,8 +76,8 @@ private:
SlideLayoutController& mrController;
Reference< XFrame > mxFrame;
bool mbInsertPage;
- ValueSet* mpLayoutSet1;
- ValueSet* mpLayoutSet2;
+ VclPtr<ValueSet> mpLayoutSet1;
+ VclPtr<ValueSet> mpLayoutSet2;
};
struct snewfoil_value_info
@@ -210,7 +211,7 @@ LayoutToolbarMenu::LayoutToolbarMenu( SlideLayoutController& rController, const
if( bVerticalEnabled && (eMode == DrawViewMode_DRAW) )
{
- mpLayoutSet2 = new ValueSet( this, WB_TABSTOP | WB_MENUSTYLEVALUESET | WB_FLATVALUESET | WB_NOBORDER | WB_NO_DIRECTSELECT );
+ mpLayoutSet2 = VclPtr<ValueSet>::Create( this, WB_TABSTOP | WB_MENUSTYLEVALUESET | WB_FLATVALUESET | WB_NOBORDER | WB_NO_DIRECTSELECT );
mpLayoutSet2->SetSelectHdl( LINK( this, LayoutToolbarMenu, SelectHdl ) );
mpLayoutSet2->SetColCount( 4 );
@@ -256,6 +257,14 @@ LayoutToolbarMenu::LayoutToolbarMenu( SlideLayoutController& rController, const
LayoutToolbarMenu::~LayoutToolbarMenu()
{
+ disposeOnce();
+}
+
+void LayoutToolbarMenu::dispose()
+{
+ mpLayoutSet1.clear();
+ mpLayoutSet2.clear();
+ svtools::ToolbarMenu::dispose();
}
IMPL_LINK( LayoutToolbarMenu, SelectHdl, void *, pControl )
@@ -342,9 +351,9 @@ void SAL_CALL SlideLayoutController::initialize( const css::uno::Sequence< css::
}
}
-::vcl::Window* SlideLayoutController::createPopupWindow( ::vcl::Window* pParent )
+VclPtr<::vcl::Window> SlideLayoutController::createPopupWindow( ::vcl::Window* pParent )
{
- return new sd::LayoutToolbarMenu( *this, m_xFrame, pParent, mbInsertPage );
+ return VclPtr<sd::LayoutToolbarMenu>::Create( *this, m_xFrame, pParent, mbInsertPage );
}
// XServiceInfo
diff --git a/sd/source/ui/controller/slidelayoutcontroller.hxx b/sd/source/ui/controller/slidelayoutcontroller.hxx
index 0104119dc45d..d97656cef5dc 100644
--- a/sd/source/ui/controller/slidelayoutcontroller.hxx
+++ b/sd/source/ui/controller/slidelayoutcontroller.hxx
@@ -32,7 +32,7 @@ public:
const OUString& sCommandURL,
bool bInsertPage );
- virtual vcl::Window* createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE;
+ virtual VclPtr<vcl::Window> createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE;
// XInitialization
virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
diff --git a/sd/source/ui/dlg/AnimationChildWindow.cxx b/sd/source/ui/dlg/AnimationChildWindow.cxx
index 7e7ec61574db..d59f0ac2a083 100644
--- a/sd/source/ui/dlg/AnimationChildWindow.cxx
+++ b/sd/source/ui/dlg/AnimationChildWindow.cxx
@@ -39,7 +39,7 @@ AnimationChildWindow::AnimationChildWindow(
SfxChildWinInfo* pInfo )
: SfxChildWindow( _pParent, nId )
{
- AnimationWindow* pAnimWin = new AnimationWindow(pBindings, this, _pParent);
+ VclPtr<AnimationWindow> pAnimWin = VclPtr<AnimationWindow>::Create(pBindings, this, _pParent);
pWindow = pAnimWin;
eChildAlignment = SfxChildAlignment::NOALIGNMENT;
diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx
index cfc97fd3a543..934c5bbf89f9 100644
--- a/sd/source/ui/dlg/LayerTabBar.cxx
+++ b/sd/source/ui/dlg/LayerTabBar.cxx
@@ -203,9 +203,9 @@ TabBarAllowRenamingReturnCode LayerTabBar::AllowRenaming()
(rLayerAdmin.GetLayer( aNewName, false ) && aLayerName != aNewName) )
{
// Name already exists
- WarningBox aWarningBox( &pDrViewSh->GetViewFrame()->GetWindow(), WinBits( WB_OK ),
+ ScopedVclPtrInstance<WarningBox> aWarningBox( &pDrViewSh->GetViewFrame()->GetWindow(), WinBits( WB_OK ),
SD_RESSTR( STR_WARN_NAME_DUPLICATE ) );
- aWarningBox.Execute();
+ aWarningBox->Execute();
bOK = false;
}
diff --git a/sd/source/ui/dlg/NavigatorChildWindow.cxx b/sd/source/ui/dlg/NavigatorChildWindow.cxx
index 480a5f74e0e7..0beb6d1f38e0 100644
--- a/sd/source/ui/dlg/NavigatorChildWindow.cxx
+++ b/sd/source/ui/dlg/NavigatorChildWindow.cxx
@@ -52,7 +52,8 @@ NavigatorChildWindow::NavigatorChildWindow (
SfxChildWinInfo* )
: SfxChildWindowContext( nId )
{
- SdNavigatorWin* pNavWin = new SdNavigatorWin(
+ VclPtr<SdNavigatorWin> pNavWin = VclPtr<SdNavigatorWin>::Create(
+
pParent,
this,
SdResId( FLT_NAVIGATOR ),
diff --git a/sd/source/ui/dlg/PaneChildWindows.cxx b/sd/source/ui/dlg/PaneChildWindows.cxx
index 364a4dc47b4b..b004e766131a 100644
--- a/sd/source/ui/dlg/PaneChildWindows.cxx
+++ b/sd/source/ui/dlg/PaneChildWindows.cxx
@@ -56,13 +56,14 @@ PaneChildWindow::PaneChildWindow (
SfxChildAlignment eAlignment)
: SfxChildWindow (pParentWindow, nId)
{
- pWindow = new PaneDockingWindow(
+ pWindow = VclPtr<PaneDockingWindow>::Create(
+
pBindings,
this,
pParentWindow,
SD_RESSTR(nTitleBarResId));
eChildAlignment = eAlignment;
- static_cast<SfxDockingWindow*>(pWindow)->Initialize(pInfo);
+ static_cast<SfxDockingWindow*>(pWindow.get())->Initialize(pInfo);
SetHideNotDelete(true);
ViewShellBase* pBase = ViewShellBase::GetViewShellBase(pBindings->GetDispatcher()->GetFrame());
@@ -75,7 +76,7 @@ PaneChildWindow::PaneChildWindow (
PaneChildWindow::~PaneChildWindow()
{
ViewShellBase* pBase = NULL;
- PaneDockingWindow* pDockingWindow = dynamic_cast<PaneDockingWindow*>(pWindow);
+ PaneDockingWindow* pDockingWindow = dynamic_cast<PaneDockingWindow*>(pWindow.get());
if (pDockingWindow != NULL)
pBase = ViewShellBase::GetViewShellBase(
pDockingWindow->GetBindings().GetDispatcher()->GetFrame());
diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
index a3da722b97e5..ecf89cf9054f 100644
--- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx
+++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
@@ -76,6 +76,23 @@ SdPhotoAlbumDialog::SdPhotoAlbumDialog(vcl::Window* pWindow, SdDrawDocument* pAc
SdPhotoAlbumDialog::~SdPhotoAlbumDialog()
{
+ disposeOnce();
+}
+
+void SdPhotoAlbumDialog::dispose()
+{
+ pCancelBtn.clear();
+ pCreateBtn.clear();
+ pAddBtn.clear();
+ pUpBtn.clear();
+ pDownBtn.clear();
+ pRemoveBtn.clear();
+ pImagesLst.clear();
+ pImg.clear();
+ pInsTypeCombo.clear();
+ pASRCheck.clear();
+ pCapCheck.clear();
+ ModalDialog::dispose();
}
IMPL_LINK_NOARG(SdPhotoAlbumDialog, CancelHdl)
@@ -88,8 +105,8 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, CreateHdl)
{
if (pImagesLst->GetEntryCount() == 0)
{
- WarningBox aWarning(this, WB_OK, SD_RESSTR(STR_PHOTO_ALBUM_EMPTY_WARNING));
- aWarning.Execute();
+ ScopedVclPtrInstance< WarningBox > aWarning(this, WB_OK, SD_RESSTR(STR_PHOTO_ALBUM_EMPTY_WARNING));
+ aWarning->Execute();
}
else
{
@@ -445,8 +462,8 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, CreateHdl)
}
else
{
- InfoBox aInfo(this, OUString("Function is not implemented!"));
- aInfo.Execute();
+ ScopedVclPtrInstance< InfoBox > aInfo(this, OUString("Function is not implemented!"));
+ aInfo->Execute();
}
EndDialog();
return 0;
diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.hxx b/sd/source/ui/dlg/PhotoAlbumDialog.hxx
index c7d12e47bcc8..44b1f5c97a1e 100644
--- a/sd/source/ui/dlg/PhotoAlbumDialog.hxx
+++ b/sd/source/ui/dlg/PhotoAlbumDialog.hxx
@@ -46,25 +46,27 @@ class SdPhotoAlbumDialog : public ModalDialog
public:
SdPhotoAlbumDialog(vcl::Window* pWindow, SdDrawDocument* pActDoc);
virtual ~SdPhotoAlbumDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
private:
static OUString sDirUrl;
- CancelButton* pCancelBtn;
- PushButton* pCreateBtn;
+ VclPtr<CancelButton> pCancelBtn;
+ VclPtr<PushButton> pCreateBtn;
- PushButton* pAddBtn;
- PushButton* pUpBtn;
- PushButton* pDownBtn;
- PushButton* pRemoveBtn;
+ VclPtr<PushButton> pAddBtn;
+ VclPtr<PushButton> pUpBtn;
+ VclPtr<PushButton> pDownBtn;
+ VclPtr<PushButton> pRemoveBtn;
- ListBox* pImagesLst;
- FixedImage* pImg;
+ VclPtr<ListBox> pImagesLst;
+ VclPtr<FixedImage> pImg;
+
+ VclPtr<ListBox> pInsTypeCombo;
+ VclPtr<CheckBox> pASRCheck;
+ VclPtr<CheckBox> pCapCheck;
- ListBox* pInsTypeCombo;
- CheckBox* pASRCheck;
- CheckBox* pCapCheck;
SdDrawDocument* pDoc;
GraphicFilter* mpGraphicFilter;
diff --git a/sd/source/ui/dlg/RemoteDialog.cxx b/sd/source/ui/dlg/RemoteDialog.cxx
index f9cd67cb8dad..62c9d3eaffe7 100644
--- a/sd/source/ui/dlg/RemoteDialog.cxx
+++ b/sd/source/ui/dlg/RemoteDialog.cxx
@@ -30,6 +30,19 @@ RemoteDialog::RemoteDialog( vcl::Window *pWindow )
m_pButtonClose->SetClickHdl( LINK( this, RemoteDialog, CloseHdl ) );
}
+RemoteDialog::~RemoteDialog()
+{
+ disposeOnce();
+}
+
+void RemoteDialog::dispose()
+{
+ m_pButtonConnect.clear();
+ m_pButtonClose.clear();
+ m_pClientBox.clear();
+ ModalDialog::dispose();
+}
+
IMPL_LINK_NOARG(RemoteDialog, HandleConnectButton)
{
// setBusy( true );
diff --git a/sd/source/ui/dlg/RemoteDialog.hxx b/sd/source/ui/dlg/RemoteDialog.hxx
index 7334c4bea548..3c936eb10a1a 100644
--- a/sd/source/ui/dlg/RemoteDialog.hxx
+++ b/sd/source/ui/dlg/RemoteDialog.hxx
@@ -24,14 +24,16 @@ namespace sd
class RemoteDialog : public ModalDialog
{
private:
- PushButton* m_pButtonConnect;
- CloseButton* m_pButtonClose;
- ClientBox* m_pClientBox;
+ VclPtr<PushButton> m_pButtonConnect;
+ VclPtr<CloseButton> m_pButtonClose;
+ VclPtr<ClientBox> m_pClientBox;
DECL_DLLPRIVATE_LINK( HandleConnectButton, void * );
DECL_LINK( CloseHdl, void * );
public:
RemoteDialog( vcl::Window* pWindow );
+ virtual ~RemoteDialog();
+ virtual void dispose() SAL_OVERRIDE;
};
}
diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.cxx b/sd/source/ui/dlg/RemoteDialogClientBox.cxx
index c3f4ebafb86b..83abb22a0184 100644
--- a/sd/source/ui/dlg/RemoteDialogClientBox.cxx
+++ b/sd/source/ui/dlg/RemoteDialogClientBox.cxx
@@ -73,16 +73,16 @@ ClientBox::ClientBox( vcl::Window* pParent, WinBits nStyle ) :
m_nTopIndex( 0 ),
m_nActiveHeight( 0 ),
m_nExtraHeight( 2 ),
- m_aPinBox( this, 0 ),
- m_aDeauthoriseButton( this ),
- m_aScrollBar( this, WB_VERT )
+ m_aPinBox( VclPtr<NumericBox>::Create( this, 0 ) ),
+ m_aDeauthoriseButton( VclPtr<PushButton>::Create( this ) ),
+ m_aScrollBar( VclPtr<ScrollBar>::Create( this, WB_VERT ) )
{
- m_aScrollBar.SetScrollHdl( LINK( this, ClientBox, ScrollHdl ) );
- m_aScrollBar.EnableDrag();
+ m_aScrollBar->SetScrollHdl( LINK( this, ClientBox, ScrollHdl ) );
+ m_aScrollBar->EnableDrag();
- m_aPinBox.SetUseThousandSep(false);
- m_aDeauthoriseButton.SetText( SD_RESSTR(STR_DEAUTHORISE_CLIENT) );
- m_aDeauthoriseButton.SetClickHdl( LINK( this, ClientBox, DeauthoriseHdl ) );
+ m_aPinBox->SetUseThousandSep(false);
+ m_aDeauthoriseButton->SetText( SD_RESSTR(STR_DEAUTHORISE_CLIENT) );
+ m_aDeauthoriseButton->SetClickHdl( LINK( this, ClientBox, DeauthoriseHdl ) );
SetPosPixel( Point( RSC_SP_DLG_INNERBORDER_LEFT, RSC_SP_DLG_INNERBORDER_TOP ) );
long nIconHeight = 2*TOP_OFFSET + SMALL_ICON_SIZE;
@@ -124,6 +124,11 @@ Size ClientBox::GetOptimalSize() const
ClientBox::~ClientBox()
{
+ disposeOnce();
+}
+
+void ClientBox::dispose()
+{
if ( ! m_bInDelete )
DeleteRemoved();
@@ -132,6 +137,11 @@ ClientBox::~ClientBox()
m_vEntries.clear();
m_xRemoveListener.clear();
+
+ m_aPinBox.disposeAndClear();
+ m_aDeauthoriseButton.disposeAndClear();
+ m_aScrollBar.disposeAndClear();
+ Control::dispose();
}
// Title + description
@@ -152,7 +162,7 @@ void ClientBox::CalcActiveHeight( const long nPos )
// Text entry height
Size aSize = GetOutputSizePixel();
if ( m_bHasScrollBar )
- aSize.Width() -= m_aScrollBar.GetSizePixel().Width();
+ aSize.Width() -= m_aScrollBar->GetSizePixel().Width();
aSize.Width() -= ICON_OFFSET;
@@ -173,7 +183,7 @@ Rectangle ClientBox::GetEntryRect( const long nPos ) const
Size aSize( GetOutputSizePixel() );
if ( m_bHasScrollBar )
- aSize.Width() -= m_aScrollBar.GetSizePixel().Width();
+ aSize.Width() -= m_aScrollBar->GetSizePixel().Width();
if ( m_vEntries[ nPos ]->m_bActive )
aSize.Height() = m_nActiveHeight;
@@ -246,7 +256,7 @@ void ClientBox::selectEntry( const long nPos )
// We empty the pin box now too, just in case the user previously
// entered a pin, but then changed their selected device.
- m_aPinBox.SetText( "" );
+ m_aPinBox->SetText( "" );
if ( m_bHasActive )
{
bool bAlreadyAuthorised =
@@ -254,11 +264,11 @@ void ClientBox::selectEntry( const long nPos )
if ( bAlreadyAuthorised )
{
- m_aDeauthoriseButton.GetFocus();
+ m_aDeauthoriseButton->GetFocus();
}
else
{
- m_aPinBox.GetFocus();
+ m_aPinBox->GetFocus();
}
}
@@ -350,19 +360,19 @@ void ClientBox::RecalcAll()
Size aPBSize = LogicToPixel(
Size( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ),
MapMode( MAP_APPFONT ) );
- m_aPinBox.SetSizePixel( aPBSize );
- m_aDeauthoriseButton.SetSizePixel( m_aDeauthoriseButton.GetOptimalSize() );
+ m_aPinBox->SetSizePixel( aPBSize );
+ m_aDeauthoriseButton->SetSizePixel( m_aDeauthoriseButton->GetOptimalSize() );
if ( !m_bHasActive )
{
- m_aPinBox.Show( false );
- m_aDeauthoriseButton.Show( false );
+ m_aPinBox->Show( false );
+ m_aDeauthoriseButton->Show( false );
}
else
{
Rectangle aEntryRect = GetEntryRect( m_nActive );
- Size aPinBoxSize( m_aPinBox.GetSizePixel() );
+ Size aPinBoxSize( m_aPinBox->GetSizePixel() );
Point aPos( aEntryRect.Left(),
aEntryRect.Bottom() - TOP_OFFSET - aPinBoxSize.Height() );
@@ -378,7 +388,7 @@ void ClientBox::RecalcAll()
aPos = Point( aEntryRect.Left() + GetTextWidth( sPinText ),
aEntryRect.Bottom() - TOP_OFFSET - aPinBoxSize.Height() );
- m_aPinBox.SetPosPixel( aPos );
+ m_aPinBox->SetPosPixel( aPos );
// The text would have it's TOP aligned with the top of
// the pin box -- hence we push it down to align baselines.
m_sPinTextRect += Point( 0, 4 );
@@ -386,11 +396,11 @@ void ClientBox::RecalcAll()
else
{
aPos += Point( 20, 0 );
- m_aDeauthoriseButton.SetPosPixel( aPos );
+ m_aDeauthoriseButton->SetPosPixel( aPos );
}
- m_aPinBox.Show( !bAlreadyAuthorised );
- m_aDeauthoriseButton.Show( bAlreadyAuthorised );
+ m_aPinBox->Show( !bAlreadyAuthorised );
+ m_aDeauthoriseButton->Show( bAlreadyAuthorised );
if ( m_bAdjustActive )
{
@@ -424,7 +434,7 @@ void ClientBox::RecalcAll()
}
if ( m_bHasScrollBar )
- m_aScrollBar.SetThumbPos( m_nTopIndex );
+ m_aScrollBar->SetThumbPos( m_nTopIndex );
}
}
@@ -487,7 +497,7 @@ void ClientBox::Paint( const Rectangle &/*rPaintRect*/ )
Size aSize( GetOutputSizePixel() );
if ( m_bHasScrollBar )
- aSize.Width() -= m_aScrollBar.GetSizePixel().Width();
+ aSize.Width() -= m_aScrollBar->GetSizePixel().Width();
const ::osl::MutexGuard aGuard( m_entriesMutex );
@@ -525,20 +535,20 @@ void ClientBox::SetupScrollBar()
if ( m_nTopIndex + aSize.Height() > nTotalHeight )
m_nTopIndex = nTotalHeight - aSize.Height();
- m_aScrollBar.SetPosSizePixel( Point( aSize.Width() - nScrBarSize, 0 ),
+ m_aScrollBar->SetPosSizePixel( Point( aSize.Width() - nScrBarSize, 0 ),
Size( nScrBarSize, aSize.Height() ) );
- m_aScrollBar.SetRangeMax( nTotalHeight );
- m_aScrollBar.SetVisibleSize( aSize.Height() );
- m_aScrollBar.SetPageSize( ( aSize.Height() * 4 ) / 5 );
- m_aScrollBar.SetLineSize( m_nStdHeight );
- m_aScrollBar.SetThumbPos( m_nTopIndex );
+ m_aScrollBar->SetRangeMax( nTotalHeight );
+ m_aScrollBar->SetVisibleSize( aSize.Height() );
+ m_aScrollBar->SetPageSize( ( aSize.Height() * 4 ) / 5 );
+ m_aScrollBar->SetLineSize( m_nStdHeight );
+ m_aScrollBar->SetThumbPos( m_nTopIndex );
if ( !m_bHasScrollBar )
- m_aScrollBar.Show();
+ m_aScrollBar->Show();
}
else if ( m_bHasScrollBar )
{
- m_aScrollBar.Hide();
+ m_aScrollBar->Hide();
m_nTopIndex = 0;
}
@@ -567,7 +577,7 @@ long ClientBox::PointToPos( const Point& rPos )
OUString ClientBox::getPin()
{
- return OUString::number( m_aPinBox.GetValue() );
+ return OUString::number( m_aPinBox->GetValue() );
}
void ClientBox::MouseButtonDown( const MouseEvent& rMEvt )
@@ -608,11 +618,11 @@ bool ClientBox::Notify( NotifyEvent& rNEvt )
const CommandWheelData* pData = rNEvt.GetCommandEvent()->GetWheelData();
if ( pData->GetMode() == CommandWheelMode::SCROLL )
{
- long nThumbPos = m_aScrollBar.GetThumbPos();
+ long nThumbPos = m_aScrollBar->GetThumbPos();
if ( pData->GetDelta() < 0 )
- m_aScrollBar.DoScroll( nThumbPos + m_nStdHeight );
+ m_aScrollBar->DoScroll( nThumbPos + m_nStdHeight );
else
- m_aScrollBar.DoScroll( nThumbPos - m_nStdHeight );
+ m_aScrollBar->DoScroll( nThumbPos - m_nStdHeight );
bHandled = true;
}
}
@@ -702,13 +712,13 @@ void ClientBox::populateEntries()
void ClientBox::DoScroll( long nDelta )
{
m_nTopIndex += nDelta;
- Point aNewSBPt( m_aScrollBar.GetPosPixel() );
+ Point aNewSBPt( m_aScrollBar->GetPosPixel() );
Rectangle aScrRect( Point(), GetOutputSizePixel() );
- aScrRect.Right() -= m_aScrollBar.GetSizePixel().Width();
+ aScrRect.Right() -= m_aScrollBar->GetSizePixel().Width();
Scroll( 0, -nDelta, aScrRect );
- m_aScrollBar.SetPosPixel( aNewSBPt );
+ m_aScrollBar->SetPosPixel( aNewSBPt );
}
IMPL_LINK( ClientBox, ScrollHdl, ScrollBar*, pScrBar )
diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.hxx b/sd/source/ui/dlg/RemoteDialogClientBox.hxx
index 1dc481ebd79a..63bf2db5a577 100644
--- a/sd/source/ui/dlg/RemoteDialogClientBox.hxx
+++ b/sd/source/ui/dlg/RemoteDialogClientBox.hxx
@@ -69,7 +69,7 @@ class ClientBox;
class ClientRemovedListener : public ::cppu::WeakImplHelper1< ::com::sun::star::lang::XEventListener >
{
- ClientBox *m_pParent;
+ VclPtr<ClientBox> m_pParent;
public:
@@ -101,11 +101,11 @@ class ClientBox:
Link m_aClickHdl;
Link m_aDeauthoriseHdl;
- NumericBox m_aPinBox;
- PushButton m_aDeauthoriseButton;
- Rectangle m_sPinTextRect;
+ VclPtr<NumericBox> m_aPinBox;
+ VclPtr<PushButton> m_aDeauthoriseButton;
+ Rectangle m_sPinTextRect;
- ScrollBar m_aScrollBar;
+ VclPtr<ScrollBar> m_aScrollBar;
com::sun::star::uno::Reference< ClientRemovedListener > m_xRemoveListener;
@@ -136,7 +136,8 @@ class ClientBox:
public:
ClientBox( vcl::Window* pParent, WinBits nStyle );
- virtual ~ClientBox();
+ virtual ~ClientBox();
+ virtual void dispose() SAL_OVERRIDE;
void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
void Paint( const Rectangle &rPaintRect ) SAL_OVERRIDE;
diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx
index 1eaf723dd3bd..272c2f6e16bd 100644
--- a/sd/source/ui/dlg/animobjs.cxx
+++ b/sd/source/ui/dlg/animobjs.cxx
@@ -158,7 +158,7 @@ AnimationWindow::AnimationWindow(SfxBindings* pInBindings, SfxChildWindow *pCW,
get(m_pLbAdjustment, "alignment");
get(m_pBtnCreateGroup, "create");
- m_pCtlDisplay = new SdDisplay(get<Window>("box"));
+ m_pCtlDisplay = VclPtr<SdDisplay>::Create(get<Window>("box"));
m_pCtlDisplay->set_hexpand(true);
m_pCtlDisplay->set_vexpand(true);
m_pCtlDisplay->Show();
@@ -206,6 +206,11 @@ AnimationWindow::AnimationWindow(SfxBindings* pInBindings, SfxChildWindow *pCW,
AnimationWindow::~AnimationWindow()
{
+ disposeOnce();
+}
+
+void AnimationWindow::dispose()
+{
delete pControllerItem;
for (size_t i = 0; i < m_FrameList.size(); ++i)
@@ -219,7 +224,27 @@ AnimationWindow::~AnimationWindow()
// delete the clones
delete pMyDoc;
- delete m_pCtlDisplay;
+ m_pCtlDisplay.disposeAndClear();
+ m_pBtnFirst.clear();
+ m_pBtnReverse.clear();
+ m_pBtnStop.clear();
+ m_pBtnPlay.clear();
+ m_pBtnLast.clear();
+ m_pNumFldBitmap.clear();
+ m_pTimeField.clear();
+ m_pLbLoopCount.clear();
+ m_pBtnGetOneObject.clear();
+ m_pBtnGetAllObjects.clear();
+ m_pBtnRemoveBitmap.clear();
+ m_pBtnRemoveAll.clear();
+ m_pFiCount.clear();
+ m_pRbtGroup.clear();
+ m_pRbtBitmap.clear();
+ m_pFtAdjustment.clear();
+ m_pLbAdjustment.clear();
+ m_pBtnCreateGroup.clear();
+ pWin.clear();
+ SfxDockingWindow::dispose();
}
IMPL_LINK_NOARG(AnimationWindow, ClickFirstHdl)
@@ -430,8 +455,8 @@ IMPL_LINK( AnimationWindow, ClickRemoveBitmapHdl, void *, pBtn )
}
else // delete everything
{
- WarningBox aWarnBox( this, WB_YES_NO, SD_RESSTR( STR_ASK_DELETE_ALL_PICTURES ) );
- short nReturn = aWarnBox.Execute();
+ ScopedVclPtrInstance< WarningBox > aWarnBox( this, WB_YES_NO, SD_RESSTR( STR_ASK_DELETE_ALL_PICTURES ) );
+ short nReturn = aWarnBox->Execute();
if( nReturn == RET_YES )
{
@@ -523,23 +548,23 @@ void AnimationWindow::UpdateControl(bool const bDisableCtrls)
static_cast<SdrObject*>(pPage->GetObj(m_nCurrentFrame));
if( pObject )
{
- VirtualDevice aVD;
+ ScopedVclPtrInstance< VirtualDevice > pVD;
Rectangle aObjRect( pObject->GetCurrentBoundRect() );
Size aObjSize( aObjRect.GetSize() );
Point aOrigin( Point( -aObjRect.Left(), -aObjRect.Top() ) );
- MapMode aMap( aVD.GetMapMode() );
+ MapMode aMap( pVD->GetMapMode() );
aMap.SetMapUnit( MAP_100TH_MM );
aMap.SetOrigin( aOrigin );
- aVD.SetMapMode( aMap );
- aVD.SetOutputSize( aObjSize );
+ pVD->SetMapMode( aMap );
+ pVD->SetOutputSize( aObjSize );
const StyleSettings& rStyles = Application::GetSettings().GetStyleSettings();
- aVD.SetBackground( Wallpaper( rStyles.GetFieldColor() ) );
- aVD.SetDrawMode( rStyles.GetHighContrastMode()
+ pVD->SetBackground( Wallpaper( rStyles.GetFieldColor() ) );
+ pVD->SetDrawMode( rStyles.GetHighContrastMode()
? ViewShell::OUTPUT_DRAWMODE_CONTRAST
: ViewShell::OUTPUT_DRAWMODE_COLOR );
- aVD.Erase();
- pObject->SingleObjectPainter( aVD );
- aBmp = BitmapEx( aVD.GetBitmap( aObjRect.TopLeft(), aObjSize ) );
+ pVD->Erase();
+ pObject->SingleObjectPainter( *pVD.get() );
+ aBmp = BitmapEx( pVD->GetBitmap( aObjRect.TopLeft(), aObjSize ) );
}
m_pCtlDisplay->SetBitmapEx(&aBmp);
diff --git a/sd/source/ui/dlg/assclass.cxx b/sd/source/ui/dlg/assclass.cxx
index e77375bb10a0..7049c5b10946 100644
--- a/sd/source/ui/dlg/assclass.cxx
+++ b/sd/source/ui/dlg/assclass.cxx
@@ -86,8 +86,8 @@ bool Assistent::GotoPage(const int nPageToGo)
{
int nIndex=mnCurrentPage-1;
- std::vector<vcl::Window*>::iterator iter = maPages[nIndex].begin();
- std::vector<vcl::Window*>::iterator iterEnd = maPages[nIndex].end();
+ auto iter = maPages[nIndex].begin();
+ auto iterEnd = maPages[nIndex].end();
for(; iter != iterEnd; ++iter)
{
diff --git a/sd/source/ui/dlg/brkdlg.cxx b/sd/source/ui/dlg/brkdlg.cxx
index ce7448d5caa2..eff19c5f365f 100644
--- a/sd/source/ui/dlg/brkdlg.cxx
+++ b/sd/source/ui/dlg/brkdlg.cxx
@@ -67,8 +67,20 @@ BreakDlg::BreakDlg(
BreakDlg::~BreakDlg()
{
+ disposeOnce();
+}
+
+void BreakDlg::dispose()
+{
delete mpProgress;
+ mpProgress = NULL;
delete pProgrInfo;
+ pProgrInfo = NULL;
+ m_pFiObjInfo.clear();
+ m_pFiActInfo.clear();
+ m_pFiInsInfo.clear();
+ m_pBtnCancel.clear();
+ SfxModalDialog::dispose();
}
// Control-Handler for cancel button
@@ -93,8 +105,8 @@ IMPL_LINK( BreakDlg, UpDate, void*, nInit )
// update status bar or show a error message?
if(nInit == reinterpret_cast<void*>(1L))
{
- MessageDialog aErrBox(this, SD_RESSTR(STR_BREAK_FAIL));
- aErrBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrBox(this, SD_RESSTR(STR_BREAK_FAIL));
+ aErrBox->Execute();
}
else
{
diff --git a/sd/source/ui/dlg/copydlg.cxx b/sd/source/ui/dlg/copydlg.cxx
index c0b9b05f0b02..b87f58e0908c 100644
--- a/sd/source/ui/dlg/copydlg.cxx
+++ b/sd/source/ui/dlg/copydlg.cxx
@@ -84,30 +84,23 @@ CopyDlg::CopyDlg(vcl::Window* pWindow, const SfxItemSet& rInAttrs,
CopyDlg::~CopyDlg()
{
- OUString& rStr = GetExtraData();
-
- rStr = OUString::number(m_pNumFldCopies->GetValue());
- rStr += OUString(TOKEN);
-
- rStr += OUString::number(m_pMtrFldMoveX->GetValue());
- rStr += OUString( TOKEN );
-
- rStr += OUString::number(m_pMtrFldMoveY->GetValue());
- rStr += OUString( TOKEN );
-
- rStr += OUString::number(m_pMtrFldAngle->GetValue());
- rStr += OUString( TOKEN );
-
- rStr += OUString::number(m_pMtrFldWidth->GetValue());
- rStr += OUString( TOKEN );
-
- rStr += OUString::number(m_pMtrFldHeight->GetValue());
- rStr += OUString( TOKEN );
-
- rStr += OUString::number( m_pLbStartColor->GetSelectEntryColor().GetColor() );
- rStr += OUString( TOKEN );
+ disposeOnce();
+}
- rStr += OUString::number( m_pLbEndColor->GetSelectEntryColor().GetColor() );
+void CopyDlg::dispose()
+{
+ m_pNumFldCopies.clear();
+ m_pBtnSetViewData.clear();
+ m_pMtrFldMoveX.clear();
+ m_pMtrFldMoveY.clear();
+ m_pMtrFldAngle.clear();
+ m_pMtrFldWidth.clear();
+ m_pMtrFldHeight.clear();
+ m_pLbStartColor.clear();
+ m_pFtEndColor.clear();
+ m_pLbEndColor.clear();
+ m_pBtnSetDefault.clear();
+ SfxModalDialog::dispose();
}
/**
diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx
index 45355fee5ad7..8de00aa58c42 100644
--- a/sd/source/ui/dlg/custsdlg.cxx
+++ b/sd/source/ui/dlg/custsdlg.cxx
@@ -85,6 +85,21 @@ SdCustomShowDlg::SdCustomShowDlg( vcl::Window* pWindow,
SdCustomShowDlg::~SdCustomShowDlg()
{
+ disposeOnce();
+}
+
+void SdCustomShowDlg::dispose()
+{
+ m_pLbCustomShows.clear();
+ m_pCbxUseCustomShow.clear();
+ m_pBtnNew.clear();
+ m_pBtnEdit.clear();
+ m_pBtnRemove.clear();
+ m_pBtnCopy.clear();
+ m_pBtnHelp.clear();
+ m_pBtnStartShow.clear();
+ m_pBtnOK.clear();
+ ModalDialog::dispose();
}
void SdCustomShowDlg::CheckState()
@@ -111,8 +126,8 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p )
if( p == m_pBtnNew )
{
pCustomShow = NULL;
- SdDefineCustomShowDlg aDlg( this, rDoc, pCustomShow );
- if( aDlg.Execute() == RET_OK )
+ ScopedVclPtrInstance< SdDefineCustomShowDlg > aDlg( this, rDoc, pCustomShow );
+ if( aDlg->Execute() == RET_OK )
{
if( pCustomShow )
{
@@ -125,7 +140,7 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p )
m_pLbCustomShows->SelectEntry( pCustomShow->GetName() );
}
- if( aDlg.IsModified() )
+ if( aDlg->IsModified() )
bModified = true;
}
else if( pCustomShow )
@@ -139,9 +154,9 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p )
{
DBG_ASSERT( pCustomShowList, "pCustomShowList does not exist" );
pCustomShow = (*pCustomShowList)[ nPos ];
- SdDefineCustomShowDlg aDlg( this, rDoc, pCustomShow );
+ ScopedVclPtrInstance< SdDefineCustomShowDlg > aDlg( this, rDoc, pCustomShow );
- if( aDlg.Execute() == RET_OK )
+ if( aDlg->Execute() == RET_OK )
{
if( pCustomShow )
{
@@ -151,7 +166,7 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p )
m_pLbCustomShows->InsertEntry( pCustomShow->GetName(), nPos );
m_pLbCustomShows->SelectEntryPos( nPos );
}
- if( aDlg.IsModified() )
+ if( aDlg->IsModified() )
bModified = true;
}
}
@@ -336,6 +351,20 @@ SdDefineCustomShowDlg::SdDefineCustomShowDlg( vcl::Window* pWindow,
SdDefineCustomShowDlg::~SdDefineCustomShowDlg()
{
+ disposeOnce();
+}
+
+void SdDefineCustomShowDlg::dispose()
+{
+ m_pEdtName.clear();
+ m_pLbPages.clear();
+ m_pBtnAdd.clear();
+ m_pBtnRemove.clear();
+ m_pLbCustomPages.clear();
+ m_pBtnOK.clear();
+ m_pBtnCancel.clear();
+ m_pBtnHelp.clear();
+ ModalDialog::dispose();
}
// CheckState
diff --git a/sd/source/ui/dlg/diactrl.cxx b/sd/source/ui/dlg/diactrl.cxx
index 41c2754c2a4f..e2307ac7c2c8 100644
--- a/sd/source/ui/dlg/diactrl.cxx
+++ b/sd/source/ui/dlg/diactrl.cxx
@@ -132,9 +132,9 @@ void SdTbxCtlDiaPages::StateChanged( sal_uInt16,
}
}
-vcl::Window* SdTbxCtlDiaPages::CreateItemWindow( vcl::Window* pParent )
+VclPtr<vcl::Window> SdTbxCtlDiaPages::CreateItemWindow( vcl::Window* pParent )
{
- return new SdPagesField( pParent, m_xFrame );
+ return VclPtrInstance<SdPagesField>( pParent, m_xFrame ).get();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx
index 98df35d60900..69219b06c354 100644
--- a/sd/source/ui/dlg/dlgass.cxx
+++ b/sd/source/ui/dlg/dlgass.cxx
@@ -101,8 +101,8 @@ public:
void Enable (bool bEnable);
private:
- PushButton* mpNextButton1;
- PushButton* mpNextButton2;
+ VclPtr<PushButton> mpNextButton1;
+ VclPtr<PushButton> mpNextButton2;
bool mbIsFirstButtonActive;
};
@@ -160,7 +160,7 @@ public:
*/
bool mbPreviewUpdating;
- vcl::Window* mpWindow;
+ VclPtr<vcl::Window> mpWindow;
void SavePassword( SfxObjectShellLock xDoc, const OUString& rPath );
void RestorePassword( SfxItemSet* pSet, const OUString& rPath );
@@ -247,74 +247,74 @@ public:
// Common
Assistent maAssistentFunc;
- CheckBox* mpPreviewFlag;
- CheckBox* mpStartWithFlag;
- PushButton* mpLastPageButton;
- NextButton* mpNextPageButton;
- PushButton* mpFinishButton;
- SdDocPreviewWin* mpPreview;
- VclContainer* mpPage1235;
+ VclPtr<CheckBox> mpPreviewFlag;
+ VclPtr<CheckBox> mpStartWithFlag;
+ VclPtr<PushButton> mpLastPageButton;
+ NextButton* mpNextPageButton;
+ VclPtr<PushButton> mpFinishButton;
+ VclPtr<SdDocPreviewWin> mpPreview;
+ VclPtr<VclContainer> mpPage1235;
// page 1
- VclContainer* mpPage1;
- FixedImage* mpPage1FB;
- FixedText* mpPage1ArtFL;
- RadioButton* mpPage1EmptyRB;
- RadioButton* mpPage1TemplateRB;
- ListBox* mpPage1RegionLB;
- ListBox* mpPage1TemplateLB;
- RadioButton* mpPage1OpenRB;
- ListBox* mpPage1OpenLB;
- PushButton* mpPage1OpenPB;
+ VclPtr<VclContainer> mpPage1;
+ VclPtr<FixedImage> mpPage1FB;
+ VclPtr<FixedText> mpPage1ArtFL;
+ VclPtr<RadioButton> mpPage1EmptyRB;
+ VclPtr<RadioButton> mpPage1TemplateRB;
+ VclPtr<ListBox> mpPage1RegionLB;
+ VclPtr<ListBox> mpPage1TemplateLB;
+ VclPtr<RadioButton> mpPage1OpenRB;
+ VclPtr<ListBox> mpPage1OpenLB;
+ VclPtr<PushButton> mpPage1OpenPB;
// page 2
- VclContainer* mpPage2;
- FixedImage* mpPage2FB;
- FixedText* mpPage2LayoutFL;
- ListBox* mpPage2RegionLB;
- ListBox* mpPage2LayoutLB;
- FixedText* mpPage2OutTypesFL;
- RadioButton* mpPage2Medium1RB;
- RadioButton* mpPage2Medium2RB;
- RadioButton* mpPage2Medium3RB;
- RadioButton* mpPage2Medium4RB;
- RadioButton* mpPage2Medium5RB;
- RadioButton* mpPage2Medium6RB;
+ VclPtr<VclContainer> mpPage2;
+ VclPtr<FixedImage> mpPage2FB;
+ VclPtr<FixedText> mpPage2LayoutFL;
+ VclPtr<ListBox> mpPage2RegionLB;
+ VclPtr<ListBox> mpPage2LayoutLB;
+ VclPtr<FixedText> mpPage2OutTypesFL;
+ VclPtr<RadioButton> mpPage2Medium1RB;
+ VclPtr<RadioButton> mpPage2Medium2RB;
+ VclPtr<RadioButton> mpPage2Medium3RB;
+ VclPtr<RadioButton> mpPage2Medium4RB;
+ VclPtr<RadioButton> mpPage2Medium5RB;
+ VclPtr<RadioButton> mpPage2Medium6RB;
// page 3
- VclContainer* mpPage3;
- FixedImage* mpPage3FB;
- FixedText* mpPage3EffectFL;
- FixedText* mpPage3EffectFT;
- FadeEffectLB* mpPage3EffectLB;
- FixedText* mpPage3SpeedFT;
- ListBox* mpPage3SpeedLB;
- FixedText* mpPage3PresTypeFL;
- RadioButton* mpPage3PresTypeLiveRB;
- RadioButton* mpPage3PresTypeKioskRB;
- FixedText* mpPage3PresTimeFT;
- TimeField* mpPage3PresTimeTMF;
- FixedText* mpPage3BreakFT;
- TimeField* mpPage3BreakTMF;
- CheckBox* mpPage3LogoCB;
+ VclPtr<VclContainer> mpPage3;
+ VclPtr<FixedImage> mpPage3FB;
+ VclPtr<FixedText> mpPage3EffectFL;
+ VclPtr<FixedText> mpPage3EffectFT;
+ VclPtr<FadeEffectLB> mpPage3EffectLB;
+ VclPtr<FixedText> mpPage3SpeedFT;
+ VclPtr<ListBox> mpPage3SpeedLB;
+ VclPtr<FixedText> mpPage3PresTypeFL;
+ VclPtr<RadioButton> mpPage3PresTypeLiveRB;
+ VclPtr<RadioButton> mpPage3PresTypeKioskRB;
+ VclPtr<FixedText> mpPage3PresTimeFT;
+ VclPtr<TimeField> mpPage3PresTimeTMF;
+ VclPtr<FixedText> mpPage3BreakFT;
+ VclPtr<TimeField> mpPage3BreakTMF;
+ VclPtr<CheckBox> mpPage3LogoCB;
// page 4
- VclContainer* mpPage4;
- FixedImage* mpPage4FB;
- FixedText* mpPage4PersonalFL;
- FixedText* mpPage4AskNameFT;
- Edit* mpPage4AskNameEDT;
- FixedText* mpPage4AskTopicFT;
- Edit* mpPage4AskTopicEDT;
- FixedText* mpPage4AskInfoFT;
- VclMultiLineEdit* mpPage4AskInfoEDT;
+ VclPtr<VclContainer> mpPage4;
+ VclPtr<FixedImage> mpPage4FB;
+ VclPtr<FixedText> mpPage4PersonalFL;
+ VclPtr<FixedText> mpPage4AskNameFT;
+ VclPtr<Edit> mpPage4AskNameEDT;
+ VclPtr<FixedText> mpPage4AskTopicFT;
+ VclPtr<Edit> mpPage4AskTopicEDT;
+ VclPtr<FixedText> mpPage4AskInfoFT;
+ VclPtr<VclMultiLineEdit> mpPage4AskInfoEDT;
// page 5
- VclContainer* mpPage5;
- FixedImage* mpPage5FB;
- FixedText* mpPage5PageListFT;
- SdPageListControl* mpPage5PageListCT;
- CheckBox* mpPage5SummaryCB;
+ VclPtr<VclContainer> mpPage5;
+ VclPtr<FixedImage> mpPage5FB;
+ VclPtr<FixedText> mpPage5PageListFT;
+ VclPtr<SdPageListControl> mpPage5PageListCT;
+ VclPtr<CheckBox> mpPage5SummaryCB;
};
@@ -1769,7 +1769,13 @@ IMPL_LINK_NOARG(AssistentDlg, FinishHdl)
AssistentDlg::~AssistentDlg()
{
+ disposeOnce();
+}
+
+void AssistentDlg::dispose()
+{
delete mpImpl;
+ ModalDialog::dispose();
}
SfxObjectShellLock AssistentDlg::GetDocument()
diff --git a/sd/source/ui/dlg/dlgassim.cxx b/sd/source/ui/dlg/dlgassim.cxx
index 5eaab0185c9f..652a2b232c26 100644
--- a/sd/source/ui/dlg/dlgassim.cxx
+++ b/sd/source/ui/dlg/dlgassim.cxx
@@ -78,7 +78,13 @@ IMPL_LINK_NOARG(SdPageListControl, CheckButtonClickHdl)
SdPageListControl::~SdPageListControl()
{
+ disposeOnce();
+}
+
+void SdPageListControl::dispose()
+{
delete m_pCheckButton;
+ SvTreeListBox::dispose();
}
void SdPageListControl::Clear()
diff --git a/sd/source/ui/dlg/dlgassim.hxx b/sd/source/ui/dlg/dlgassim.hxx
index 8e966f856323..ee39788cb136 100644
--- a/sd/source/ui/dlg/dlgassim.hxx
+++ b/sd/source/ui/dlg/dlgassim.hxx
@@ -37,6 +37,7 @@ private:
public:
SdPageListControl( vcl::Window* pParent, const WinBits nStyle );
virtual ~SdPageListControl();
+ virtual void dispose() SAL_OVERRIDE;
void Fill( SdDrawDocument* pDoc );
void Clear();
diff --git a/sd/source/ui/dlg/dlgctrls.cxx b/sd/source/ui/dlg/dlgctrls.cxx
index 10923287ac1b..cb9df95d7261 100644
--- a/sd/source/ui/dlg/dlgctrls.cxx
+++ b/sd/source/ui/dlg/dlgctrls.cxx
@@ -40,7 +40,13 @@ FadeEffectLB::FadeEffectLB(vcl::Window* pParent, WinBits nStyle)
FadeEffectLB::~FadeEffectLB()
{
+ disposeOnce();
+}
+
+void FadeEffectLB::dispose()
+{
delete mpImpl;
+ ListBox::dispose();
}
void FadeEffectLB::Fill()
diff --git a/sd/source/ui/dlg/dlgfield.cxx b/sd/source/ui/dlg/dlgfield.cxx
index 64e4d476baa7..7927f4d9f54a 100644
--- a/sd/source/ui/dlg/dlgfield.cxx
+++ b/sd/source/ui/dlg/dlgfield.cxx
@@ -53,6 +53,21 @@ SdModifyFieldDlg::SdModifyFieldDlg( vcl::Window* pWindow, const SvxFieldData* pI
FillControls();
}
+SdModifyFieldDlg::~SdModifyFieldDlg()
+{
+ disposeOnce();
+}
+
+void SdModifyFieldDlg::dispose()
+{
+ m_pRbtFix.clear();
+ m_pRbtVar.clear();
+ m_pLbLanguage.clear();
+ m_pLbFormat.clear();
+ ModalDialog::dispose();
+}
+
+
/**
* Returns the new field, owned by caller.
* Returns NULL if nothing has changed.
diff --git a/sd/source/ui/dlg/dlgolbul.cxx b/sd/source/ui/dlg/dlgolbul.cxx
index c3a77103b247..2582ca25c534 100644
--- a/sd/source/ui/dlg/dlgolbul.cxx
+++ b/sd/source/ui/dlg/dlgolbul.cxx
@@ -138,7 +138,13 @@ OutlineBulletDlg::OutlineBulletDlg(
OutlineBulletDlg::~OutlineBulletDlg()
{
+ disposeOnce();
+}
+
+void OutlineBulletDlg::dispose()
+{
delete pOutputSet;
+ SfxTabDialog::dispose();
}
void OutlineBulletDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
diff --git a/sd/source/ui/dlg/dlgsnap.cxx b/sd/source/ui/dlg/dlgsnap.cxx
index 07d6e2c2886d..aed2a1059f4a 100644
--- a/sd/source/ui/dlg/dlgsnap.cxx
+++ b/sd/source/ui/dlg/dlgsnap.cxx
@@ -111,6 +111,25 @@ SdSnapLineDlg::SdSnapLineDlg(
m_pRbPoint->Check();
}
+SdSnapLineDlg::~SdSnapLineDlg()
+{
+ disposeOnce();
+}
+
+void SdSnapLineDlg::dispose()
+{
+ m_pFtX.clear();
+ m_pMtrFldX.clear();
+ m_pFtY.clear();
+ m_pMtrFldY.clear();
+ m_pRadioGroup.clear();
+ m_pRbPoint.clear();
+ m_pRbVert.clear();
+ m_pRbHorz.clear();
+ m_pBtnDelete.clear();
+ ModalDialog::dispose();
+}
+
/**
* fills provided item sets with dialog box attributes
*/
diff --git a/sd/source/ui/dlg/docprev.cxx b/sd/source/ui/dlg/docprev.cxx
index e3f9a2a394c5..e0895092d7fb 100644
--- a/sd/source/ui/dlg/docprev.cxx
+++ b/sd/source/ui/dlg/docprev.cxx
@@ -83,7 +83,13 @@ SdDocPreviewWin::SdDocPreviewWin( vcl::Window* pParent, const WinBits nStyle )
SdDocPreviewWin::~SdDocPreviewWin()
{
+ disposeOnce();
+}
+
+void SdDocPreviewWin::dispose()
+{
delete pMetaFile;
+ Control::dispose();
}
Size SdDocPreviewWin::GetOptimalSize() const
@@ -235,17 +241,17 @@ void SdDocPreviewWin::updateViewSettings()
pMtf = new GDIMetaFile;
- VirtualDevice aVDev;
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
const Fraction aFrac( pDoc->GetScaleFraction() );
const MapMode aMap( pDoc->GetScaleUnit(), Point(), aFrac, aFrac );
- aVDev.SetMapMode( aMap );
+ pVDev->SetMapMode( aMap );
// Disable output, as we only want to record a metafile
- aVDev.EnableOutput( false );
+ pVDev->EnableOutput( false );
- pMtf->Record( &aVDev );
+ pMtf->Record( pVDev );
::sd::DrawView* pView = new ::sd::DrawView(pDocShell, this, NULL);
@@ -261,18 +267,18 @@ void SdDocPreviewWin::updateViewSettings()
const Rectangle aClipRect( aNewOrg, aNewSize );
MapMode aVMap( aMap );
- aVDev.Push();
+ pVDev->Push();
aVMap.SetOrigin( Point( -aNewOrg.X(), -aNewOrg.Y() ) );
- aVDev.SetRelativeMapMode( aVMap );
- aVDev.IntersectClipRegion( aClipRect );
+ pVDev->SetRelativeMapMode( aVMap );
+ pVDev->IntersectClipRegion( aClipRect );
// Use new StandardCheckVisisbilityRedirector
StandardCheckVisisbilityRedirector aRedirector;
const Rectangle aRedrawRectangle = Rectangle( Point(), aNewSize );
vcl::Region aRedrawRegion(aRedrawRectangle);
- pView->SdrPaintView::CompleteRedraw(&aVDev,aRedrawRegion,&aRedirector);
+ pView->SdrPaintView::CompleteRedraw(pVDev,aRedrawRegion,&aRedirector);
- aVDev.Pop();
+ pVDev->Pop();
pMtf->Stop();
pMtf->WindStart();
diff --git a/sd/source/ui/dlg/gluectrl.cxx b/sd/source/ui/dlg/gluectrl.cxx
index b21f7104b53c..181dd7af049f 100644
--- a/sd/source/ui/dlg/gluectrl.cxx
+++ b/sd/source/ui/dlg/gluectrl.cxx
@@ -160,14 +160,12 @@ void SdTbxCtlGlueEscDir::StateChanged( sal_uInt16 nSId,
SfxToolBoxControl::StateChanged( nSId, eState, pState );
}
-vcl::Window* SdTbxCtlGlueEscDir::CreateItemWindow( vcl::Window *pParent )
+VclPtr<vcl::Window> SdTbxCtlGlueEscDir::CreateItemWindow( vcl::Window *pParent )
{
if( GetSlotId() == SID_GLUE_ESCDIR )
- {
- return new GlueEscDirLB( pParent, m_xFrame );
- }
+ return VclPtr<GlueEscDirLB>::Create( pParent, m_xFrame ).get();
- return NULL;
+ return VclPtr<vcl::Window>();
}
/**
diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx
index e7590357f67e..84d0da17bd27 100644
--- a/sd/source/ui/dlg/headerfooterdlg.cxx
+++ b/sd/source/ui/dlg/headerfooterdlg.cxx
@@ -115,29 +115,29 @@ class HeaderFooterTabPage : public TabPage
{
private:
- FixedText* mpFTIncludeOn;
+ VclPtr<FixedText> mpFTIncludeOn;
- CheckBox* mpCBHeader;
- VclContainer* mpHeaderBox;
- Edit* mpTBHeader;
+ VclPtr<CheckBox> mpCBHeader;
+ VclPtr<VclContainer> mpHeaderBox;
+ VclPtr<Edit> mpTBHeader;
- CheckBox* mpCBDateTime;
- RadioButton* mpRBDateTimeFixed;
- RadioButton* mpRBDateTimeAutomatic;
- Edit* mpTBDateTimeFixed;
- ListBox* mpCBDateTimeFormat;
- FixedText* mpFTDateTimeLanguage;
- SvxLanguageBox* mpCBDateTimeLanguage;
+ VclPtr<CheckBox> mpCBDateTime;
+ VclPtr<RadioButton> mpRBDateTimeFixed;
+ VclPtr<RadioButton> mpRBDateTimeAutomatic;
+ VclPtr<Edit> mpTBDateTimeFixed;
+ VclPtr<ListBox> mpCBDateTimeFormat;
+ VclPtr<FixedText> mpFTDateTimeLanguage;
+ VclPtr<SvxLanguageBox> mpCBDateTimeLanguage;
- CheckBox* mpCBFooter;
- VclContainer* mpFooterBox;
- Edit* mpTBFooter;
+ VclPtr<CheckBox> mpCBFooter;
+ VclPtr<VclContainer> mpFooterBox;
+ VclPtr<Edit> mpTBFooter;
- CheckBox* mpCBSlideNumber;
+ VclPtr<CheckBox> mpCBSlideNumber;
- CheckBox* mpCBNotOnTitle;
+ VclPtr<CheckBox> mpCBNotOnTitle;
- PresLayoutPreview* mpCTPreview;
+ VclPtr<PresLayoutPreview> mpCTPreview;
SdDrawDocument* mpDoc;
LanguageType meOldLanguage;
@@ -155,6 +155,7 @@ private:
public:
HeaderFooterTabPage( vcl::Window* pParent, SdDrawDocument* pDoc, SdPage* pActualPage, bool bHandoutMode );
virtual ~HeaderFooterTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void init( const HeaderFooterSettings& rSettings, bool bNotOnTitle );
void getData( HeaderFooterSettings& rSettings, bool& rNotOnTitle );
@@ -198,7 +199,7 @@ HeaderFooterDialog::HeaderFooterDialog( ViewShell* pViewShell, vcl::Window* pPar
mpTabCtrl->Show();
mnSlidesId = mpTabCtrl->GetPageId("slides");
- mpSlideTabPage = new HeaderFooterTabPage( mpTabCtrl, pDoc, pSlide, false );
+ mpSlideTabPage = VclPtr<HeaderFooterTabPage>::Create( mpTabCtrl, pDoc, pSlide, false );
mpTabCtrl->SetTabPage( mnSlidesId, mpSlideTabPage );
Size aSiz = mpSlideTabPage->GetSizePixel();
@@ -211,7 +212,7 @@ HeaderFooterDialog::HeaderFooterDialog( ViewShell* pViewShell, vcl::Window* pPar
}
mnNotesId = mpTabCtrl->GetPageId("notes");
- mpNotesHandoutsTabPage = new HeaderFooterTabPage( mpTabCtrl, pDoc, pNotes, true );
+ mpNotesHandoutsTabPage = VclPtr<HeaderFooterTabPage>::Create( mpTabCtrl, pDoc, pNotes, true );
mpTabCtrl->SetTabPage( mnNotesId, mpNotesHandoutsTabPage );
get(maPBApplyToAll, "apply_all" );
@@ -240,8 +241,18 @@ HeaderFooterDialog::HeaderFooterDialog( ViewShell* pViewShell, vcl::Window* pPar
HeaderFooterDialog::~HeaderFooterDialog()
{
- delete mpSlideTabPage;
- delete mpNotesHandoutsTabPage;
+ disposeOnce();
+}
+
+void HeaderFooterDialog::dispose()
+{
+ mpSlideTabPage.disposeAndClear();
+ mpNotesHandoutsTabPage.disposeAndClear();
+ mpTabCtrl.clear();
+ maPBApplyToAll.clear();
+ maPBApply.clear();
+ maPBCancel.clear();
+ TabDialog::dispose();
}
IMPL_LINK( HeaderFooterDialog, ActivatePageHdl, TabControl *, pTabCtrl )
@@ -451,6 +462,29 @@ HeaderFooterTabPage::HeaderFooterTabPage( vcl::Window* pWindow, SdDrawDocument*
HeaderFooterTabPage::~HeaderFooterTabPage()
{
+ disposeOnce();
+}
+
+void HeaderFooterTabPage::dispose()
+{
+ mpFTIncludeOn.clear();
+ mpCBHeader.clear();
+ mpHeaderBox.clear();
+ mpTBHeader.clear();
+ mpCBDateTime.clear();
+ mpRBDateTimeFixed.clear();
+ mpRBDateTimeAutomatic.clear();
+ mpTBDateTimeFixed.clear();
+ mpCBDateTimeFormat.clear();
+ mpFTDateTimeLanguage.clear();
+ mpCBDateTimeLanguage.clear();
+ mpCBFooter.clear();
+ mpFooterBox.clear();
+ mpTBFooter.clear();
+ mpCBSlideNumber.clear();
+ mpCBNotOnTitle.clear();
+ mpCTPreview.clear();
+ TabPage::dispose();
}
IMPL_LINK_NOARG(HeaderFooterTabPage, LanguageChangeHdl)
diff --git a/sd/source/ui/dlg/ins_paste.cxx b/sd/source/ui/dlg/ins_paste.cxx
index a256990697e0..ad9e9821e4e0 100644
--- a/sd/source/ui/dlg/ins_paste.cxx
+++ b/sd/source/ui/dlg/ins_paste.cxx
@@ -28,6 +28,18 @@ SdInsertPasteDlg::SdInsertPasteDlg(vcl::Window* pWindow)
m_pRbAfter->Check( true );
}
+SdInsertPasteDlg::~SdInsertPasteDlg()
+{
+ disposeOnce();
+}
+
+void SdInsertPasteDlg::dispose()
+{
+ m_pRbBefore.clear();
+ m_pRbAfter.clear();
+ ModalDialog::dispose();
+}
+
bool SdInsertPasteDlg::IsInsertBefore() const
{
return( m_pRbBefore->IsChecked() );
diff --git a/sd/source/ui/dlg/inspagob.cxx b/sd/source/ui/dlg/inspagob.cxx
index 5593562947c1..c77ba67a4c40 100644
--- a/sd/source/ui/dlg/inspagob.cxx
+++ b/sd/source/ui/dlg/inspagob.cxx
@@ -55,6 +55,15 @@ SdInsertPagesObjsDlg::SdInsertPagesObjsDlg(
SdInsertPagesObjsDlg::~SdInsertPagesObjsDlg()
{
+ disposeOnce();
+}
+
+void SdInsertPagesObjsDlg::dispose()
+{
+ m_pLbTree.clear();
+ m_pCbxLink.clear();
+ m_pCbxMasters.clear();
+ ModalDialog::dispose();
}
/**
diff --git a/sd/source/ui/dlg/layeroptionsdlg.cxx b/sd/source/ui/dlg/layeroptionsdlg.cxx
index 86df27c22cb1..a1e5d7f1a03b 100644
--- a/sd/source/ui/dlg/layeroptionsdlg.cxx
+++ b/sd/source/ui/dlg/layeroptionsdlg.cxx
@@ -50,6 +50,22 @@ SdInsertLayerDlg::SdInsertLayerDlg( vcl::Window* pWindow, const SfxItemSet& rInA
get<VclContainer>("nameframe")->Enable(bDeletable);
}
+SdInsertLayerDlg::~SdInsertLayerDlg()
+{
+ disposeOnce();
+}
+
+void SdInsertLayerDlg::dispose()
+{
+ m_pEdtName.clear();
+ m_pEdtTitle.clear();
+ m_pEdtDesc.clear();
+ m_pCbxVisible.clear();
+ m_pCbxPrintable.clear();
+ m_pCbxLocked.clear();
+ ModalDialog::dispose();
+}
+
void SdInsertLayerDlg::GetAttr( SfxItemSet& rAttrs )
{
rAttrs.Put( SdAttrLayerName( m_pEdtName->GetText() ) );
diff --git a/sd/source/ui/dlg/masterlayoutdlg.cxx b/sd/source/ui/dlg/masterlayoutdlg.cxx
index d10f8224ad8b..e1cce5c63ec6 100644
--- a/sd/source/ui/dlg/masterlayoutdlg.cxx
+++ b/sd/source/ui/dlg/masterlayoutdlg.cxx
@@ -75,6 +75,21 @@ MasterLayoutDialog::MasterLayoutDialog( vcl::Window* pParent, SdDrawDocument* pD
mpCBPageNumber->Check( mbOldPageNumber );
}
+MasterLayoutDialog::~MasterLayoutDialog()
+{
+ disposeOnce();
+}
+
+void MasterLayoutDialog::dispose()
+{
+ mpCBDate.clear();
+ mpCBPageNumber.clear();
+ mpCBSlideNumber.clear();
+ mpCBHeader.clear();
+ mpCBFooter.clear();
+ ModalDialog::dispose();
+}
+
short MasterLayoutDialog::Execute()
{
if ( ModalDialog::Execute() )
diff --git a/sd/source/ui/dlg/morphdlg.cxx b/sd/source/ui/dlg/morphdlg.cxx
index db55129d3f8a..ebd28b18dad1 100644
--- a/sd/source/ui/dlg/morphdlg.cxx
+++ b/sd/source/ui/dlg/morphdlg.cxx
@@ -66,6 +66,15 @@ MorphDlg::MorphDlg( vcl::Window* pParent, const SdrObject* pObj1, const SdrObjec
MorphDlg::~MorphDlg()
{
+ disposeOnce();
+}
+
+void MorphDlg::dispose()
+{
+ m_pMtfSteps.clear();
+ m_pCbxAttributes.clear();
+ m_pCbxOrientation.clear();
+ ModalDialog::dispose();
}
void MorphDlg::LoadSettings()
diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx
index 21fa0d9998d6..a37b13015a77 100644
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -68,9 +68,9 @@ SdNavigatorWin::SdNavigatorWin(
SfxBindings* pInBindings,
const UpdateRequestFunctor& rUpdateRequest)
: vcl::Window( pParent, rSdResId )
- , maToolbox ( this, SdResId( 1 ) )
- , maTlbObjects( this, SdResId( TLB_OBJECTS ) )
- , maLbDocs ( this, SdResId( LB_DOCS ) )
+ , maToolbox ( VclPtr<ToolBox>::Create( this, SdResId( 1 ) ) )
+ , maTlbObjects( VclPtr<SdPageObjsTLB>::Create( this, SdResId( TLB_OBJECTS ) ) )
+ , maLbDocs ( VclPtr<ListBox>::Create( this, SdResId( LB_DOCS ) ) )
, mpChildWinContext( pChWinCtxt )
, mbDocImported ( false )
// On changes of the DragType: adjust SelectionMode of TLB!
@@ -78,58 +78,58 @@ SdNavigatorWin::SdNavigatorWin(
, mpBindings ( pInBindings )
, maImageList ( SdResId( IL_NAVIGATR ) )
{
- maTlbObjects.SetViewFrame( mpBindings->GetDispatcher()->GetFrame() );
+ maTlbObjects->SetViewFrame( mpBindings->GetDispatcher()->GetFrame() );
FreeResource();
- maTlbObjects.SetAccessibleName(SD_RESSTR(STR_OBJECTS_TREE));
+ maTlbObjects->SetAccessibleName(SD_RESSTR(STR_OBJECTS_TREE));
mpNavigatorCtrlItem = new SdNavigatorControllerItem( SID_NAVIGATOR_STATE, this, mpBindings, rUpdateRequest);
mpPageNameCtrlItem = new SdPageNameControllerItem( SID_NAVIGATOR_PAGENAME, this, mpBindings, rUpdateRequest);
ApplyImageList(); // load images *before* calculating sizes to get something useful !!!
- Size aTbxSize( maToolbox.CalcWindowSizePixel() );
- maToolbox.SetOutputSizePixel( aTbxSize );
- maToolbox.SetSelectHdl( LINK( this, SdNavigatorWin, SelectToolboxHdl ) );
- maToolbox.SetClickHdl( LINK( this, SdNavigatorWin, ClickToolboxHdl ) );
- maToolbox.SetDropdownClickHdl( LINK(this, SdNavigatorWin, DropdownClickToolBoxHdl) );
- maToolbox.SetItemBits( TBI_DRAGTYPE, maToolbox.GetItemBits( TBI_DRAGTYPE ) | ToolBoxItemBits::DROPDOWNONLY );
+ Size aTbxSize( maToolbox->CalcWindowSizePixel() );
+ maToolbox->SetOutputSizePixel( aTbxSize );
+ maToolbox->SetSelectHdl( LINK( this, SdNavigatorWin, SelectToolboxHdl ) );
+ maToolbox->SetClickHdl( LINK( this, SdNavigatorWin, ClickToolboxHdl ) );
+ maToolbox->SetDropdownClickHdl( LINK(this, SdNavigatorWin, DropdownClickToolBoxHdl) );
+ maToolbox->SetItemBits( TBI_DRAGTYPE, maToolbox->GetItemBits( TBI_DRAGTYPE ) | ToolBoxItemBits::DROPDOWNONLY );
// Shape filter drop down menu.
- maToolbox.SetItemBits(
+ maToolbox->SetItemBits(
TBI_SHAPE_FILTER,
- maToolbox.GetItemBits(TBI_SHAPE_FILTER) | ToolBoxItemBits::DROPDOWNONLY);
+ maToolbox->GetItemBits(TBI_SHAPE_FILTER) | ToolBoxItemBits::DROPDOWNONLY);
// TreeListBox
// set position below toolbox
- long nListboxYPos = maToolbox.GetPosPixel().Y() + maToolbox.GetSizePixel().Height() + 4;
- maTlbObjects.setPosSizePixel( 0, nListboxYPos, 0, 0, WINDOW_POSSIZE_Y );
- maTlbObjects.SetDoubleClickHdl( LINK( this, SdNavigatorWin, ClickObjectHdl ) );
- maTlbObjects.SetSelectionMode( SINGLE_SELECTION );
+ long nListboxYPos = maToolbox->GetPosPixel().Y() + maToolbox->GetSizePixel().Height() + 4;
+ maTlbObjects->setPosSizePixel( 0, nListboxYPos, 0, 0, WINDOW_POSSIZE_Y );
+ maTlbObjects->SetDoubleClickHdl( LINK( this, SdNavigatorWin, ClickObjectHdl ) );
+ maTlbObjects->SetSelectionMode( SINGLE_SELECTION );
// set focus to listbox, otherwise it is in the toolbox which is only useful
// for keyboard navigation
- maTlbObjects.GrabFocus();
- maTlbObjects.SetSdNavigatorWinFlag(true);
+ maTlbObjects->GrabFocus();
+ maTlbObjects->SetSdNavigatorWinFlag(true);
// DragTypeListBox
- maLbDocs.SetSelectHdl( LINK( this, SdNavigatorWin, SelectDocumentHdl ) );
+ maLbDocs->SetSelectHdl( LINK( this, SdNavigatorWin, SelectDocumentHdl ) );
// set position below treelistbox
- nListboxYPos = maTlbObjects.GetPosPixel().Y() + maTlbObjects.GetSizePixel().Height() + 4;
- maLbDocs.setPosSizePixel( 0, nListboxYPos, 0, 0, WINDOW_POSSIZE_Y );
+ nListboxYPos = maTlbObjects->GetPosPixel().Y() + maTlbObjects->GetSizePixel().Height() + 4;
+ maLbDocs->setPosSizePixel( 0, nListboxYPos, 0, 0, WINDOW_POSSIZE_Y );
// assure that tool box is at least as wide as the tree list box
{
- const Size aTlbSize( maTlbObjects.GetOutputSizePixel() );
+ const Size aTlbSize( maTlbObjects->GetOutputSizePixel() );
if ( aTlbSize.Width() > aTbxSize.Width() )
{
- maToolbox.setPosSizePixel( 0, 0, aTlbSize.Width(), 0, WINDOW_POSSIZE_WIDTH );
- aTbxSize = maToolbox.GetOutputSizePixel();
+ maToolbox->setPosSizePixel( 0, 0, aTlbSize.Width(), 0, WINDOW_POSSIZE_WIDTH );
+ aTbxSize = maToolbox->GetOutputSizePixel();
}
}
// set min outputsize after all sizes are known
- const long nFullHeight = nListboxYPos + maLbDocs.GetSizePixel().Height() + 4;
+ const long nFullHeight = nListboxYPos + maLbDocs->GetSizePixel().Height() + 4;
maSize = GetOutputSizePixel();
if( maSize.Height() < nFullHeight )
{
@@ -137,7 +137,7 @@ SdNavigatorWin::SdNavigatorWin(
SetOutputSizePixel( maSize );
}
maMinSize = maSize;
- const long nMinWidth = 2*maToolbox.GetPosPixel().X() + aTbxSize.Width(); // never clip the toolbox
+ const long nMinWidth = 2*maToolbox->GetPosPixel().X() + aTbxSize.Width(); // never clip the toolbox
if( nMinWidth > maMinSize.Width() )
maMinSize.Width() = nMinWidth;
maMinSize.Height() -= 40;
@@ -152,8 +152,17 @@ SdNavigatorWin::SdNavigatorWin(
SdNavigatorWin::~SdNavigatorWin()
{
+ disposeOnce();
+}
+
+void SdNavigatorWin::dispose()
+{
delete mpNavigatorCtrlItem;
delete mpPageNameCtrlItem;
+ maToolbox.disposeAndClear();
+ maTlbObjects.disposeAndClear();
+ maLbDocs.disposeAndClear();
+ vcl::Window::dispose();
}
//when object is marked , fresh the corresponding entry tree .
@@ -163,17 +172,17 @@ void SdNavigatorWin::FreshTree( const SdDrawDocument* pDoc )
sd::DrawDocShell* pDocShell = pNonConstDoc->GetDocSh();
OUString aDocShName( pDocShell->GetName() );
OUString aDocName = pDocShell->GetMedium()->GetName();
- maTlbObjects.SetSaveTreeItemStateFlag(true); //Added by yanjun for sym2_6385
- maTlbObjects.Clear();
- maTlbObjects.Fill( pDoc, false, aDocName ); // Nur normale Seiten
- maTlbObjects.SetSaveTreeItemStateFlag(false); //Added by yanjun for sym2_6385
+ maTlbObjects->SetSaveTreeItemStateFlag(true); //Added by yanjun for sym2_6385
+ maTlbObjects->Clear();
+ maTlbObjects->Fill( pDoc, false, aDocName ); // Nur normale Seiten
+ maTlbObjects->SetSaveTreeItemStateFlag(false); //Added by yanjun for sym2_6385
RefreshDocumentLB();
- maLbDocs.SelectEntry( aDocShName );
+ maLbDocs->SelectEntry( aDocShName );
}
void SdNavigatorWin::FreshEntry( )
{
- maTlbObjects.FreshCurEntry();
+ maTlbObjects->FreshCurEntry();
}
void SdNavigatorWin::InitTreeLB( const SdDrawDocument* pDoc )
@@ -189,35 +198,35 @@ void SdNavigatorWin::InitTreeLB( const SdDrawDocument* pDoc )
{
::sd::FrameView* pFrameView = pViewShell->GetFrameView();
if (pFrameView != NULL)
- maTlbObjects.SetShowAllShapes(pFrameView->IsNavigatorShowingAllShapes(), false);
+ maTlbObjects->SetShowAllShapes(pFrameView->IsNavigatorShowingAllShapes(), false);
}
// Disable the shape filter drop down menu when there is a running slide
// show.
if (pViewShell!=NULL && sd::SlideShow::IsRunning( pViewShell->GetViewShellBase() ))
- maToolbox.EnableItem(TBI_SHAPE_FILTER, false);
+ maToolbox->EnableItem(TBI_SHAPE_FILTER, false);
else
- maToolbox.EnableItem(TBI_SHAPE_FILTER);
+ maToolbox->EnableItem(TBI_SHAPE_FILTER);
- if( !maTlbObjects.IsEqualToDoc( pDoc ) )
+ if( !maTlbObjects->IsEqualToDoc( pDoc ) )
{
OUString aDocName = pDocShell->GetMedium()->GetName();
- maTlbObjects.Clear();
- maTlbObjects.Fill( pDoc, false, aDocName ); // only normal pages
+ maTlbObjects->Clear();
+ maTlbObjects->Fill( pDoc, false, aDocName ); // only normal pages
RefreshDocumentLB();
- maLbDocs.SelectEntry( aDocShName );
+ maLbDocs->SelectEntry( aDocShName );
}
else
{
- maLbDocs.SetNoSelection();
- maLbDocs.SelectEntry( aDocShName );
+ maLbDocs->SetNoSelection();
+ maLbDocs->SelectEntry( aDocShName );
// commented in order to fix 30246
-// if( maLbDocs.GetSelectEntryCount() == 0 )
+// if( maLbDocs->GetSelectEntryCount() == 0 )
{
RefreshDocumentLB();
- maLbDocs.SelectEntry( aDocShName );
+ maLbDocs->SelectEntry( aDocShName );
}
}
@@ -235,7 +244,7 @@ NavigatorDragType SdNavigatorWin::GetNavigatorDragType()
NavigatorDragType eDT = meDragType;
NavDocInfo* pInfo = GetDocInfo();
- if( ( eDT == NAVIGATOR_DRAGTYPE_LINK ) && ( ( pInfo && !pInfo->HasName() ) || !maTlbObjects.IsLinkableSelected() ) )
+ if( ( eDT == NAVIGATOR_DRAGTYPE_LINK ) && ( ( pInfo && !pInfo->HasName() ) || !maTlbObjects->IsLinkableSelected() ) )
eDT = NAVIGATOR_DRAGTYPE_NONE;
return eDT;
@@ -252,7 +261,7 @@ sd::DrawDocShell* SdNavigatorWin::GetDrawDocShell( const SdDrawDocument* pDoc )
IMPL_LINK_NOARG(SdNavigatorWin, SelectToolboxHdl)
{
- sal_uInt16 nId = maToolbox.GetCurItemId();
+ sal_uInt16 nId = maToolbox->GetCurItemId();
sal_uInt16 nSId = 0;
PageJump ePage = PAGE_NONE;
@@ -307,7 +316,7 @@ IMPL_LINK_NOARG(SdNavigatorWin, ClickToolboxHdl)
IMPL_LINK( SdNavigatorWin, DropdownClickToolBoxHdl, ToolBox*, pBox )
{
- sal_uInt16 nId = maToolbox.GetCurItemId();
+ sal_uInt16 nId = maToolbox->GetCurItemId();
switch( nId )
{
@@ -339,7 +348,7 @@ IMPL_LINK( SdNavigatorWin, DropdownClickToolBoxHdl, ToolBox*, pBox )
}
NavDocInfo* pInfo = GetDocInfo();
- if( ( pInfo && !pInfo->HasName() ) || !maTlbObjects.IsLinkableSelected() )
+ if( ( pInfo && !pInfo->HasName() ) || !maTlbObjects->IsLinkableSelected() )
{
pMenu->EnableItem( NAVIGATOR_DRAGTYPE_LINK, false );
pMenu->EnableItem( NAVIGATOR_DRAGTYPE_URL, false );
@@ -349,7 +358,7 @@ IMPL_LINK( SdNavigatorWin, DropdownClickToolBoxHdl, ToolBox*, pBox )
pMenu->CheckItem( (sal_uInt16)meDragType );
pMenu->SetSelectHdl( LINK( this, SdNavigatorWin, MenuSelectHdl ) );
- pMenu->Execute( this, maToolbox.GetItemRect( nId ), POPUPMENU_EXECUTE_DOWN );
+ pMenu->Execute( this, maToolbox->GetItemRect( nId ), POPUPMENU_EXECUTE_DOWN );
pBox->EndSelection();
delete pMenu;
}
@@ -366,13 +375,13 @@ IMPL_LINK( SdNavigatorWin, DropdownClickToolBoxHdl, ToolBox*, pBox )
nShowAllShapesFilter,
SD_RESSTR(STR_NAVIGATOR_SHOW_ALL_SHAPES));
- if (maTlbObjects.GetShowAllShapes())
+ if (maTlbObjects->GetShowAllShapes())
pMenu->CheckItem(nShowAllShapesFilter);
else
pMenu->CheckItem(nShowNamedShapesFilter);
pMenu->SetSelectHdl( LINK( this, SdNavigatorWin, ShapeFilterCallback ) );
- pMenu->Execute( this, maToolbox.GetItemRect( nId ), POPUPMENU_EXECUTE_DOWN );
+ pMenu->Execute( this, maToolbox->GetItemRect( nId ), POPUPMENU_EXECUTE_DOWN );
pBox->EndSelection();
delete pMenu;
}
@@ -383,14 +392,14 @@ IMPL_LINK( SdNavigatorWin, DropdownClickToolBoxHdl, ToolBox*, pBox )
IMPL_LINK_NOARG(SdNavigatorWin, ClickObjectHdl)
{
- if( !mbDocImported || maLbDocs.GetSelectEntryPos() != 0 )
+ if( !mbDocImported || maLbDocs->GetSelectEntryPos() != 0 )
{
NavDocInfo* pInfo = GetDocInfo();
// if it is the active window, we jump to the page
if( pInfo && pInfo->IsActive() )
{
- OUString aStr( maTlbObjects.GetSelectEntry() );
+ OUString aStr( maTlbObjects->GetSelectEntry() );
if( !aStr.isEmpty() )
{
@@ -398,7 +407,7 @@ IMPL_LINK_NOARG(SdNavigatorWin, ClickObjectHdl)
mpBindings->GetDispatcher()->Execute(
SID_NAVIGATOR_OBJECT, SfxCallMode::SLOT | SfxCallMode::RECORD, &aItem, 0L );
//set sign variable
- maTlbObjects.MarkCurEntry(aStr);
+ maTlbObjects->MarkCurEntry(aStr);
// moved here from SetGetFocusHdl. Reset the
// focus only if something has been selected in the
@@ -419,8 +428,8 @@ IMPL_LINK_NOARG(SdNavigatorWin, ClickObjectHdl)
IMPL_LINK_NOARG(SdNavigatorWin, SelectDocumentHdl)
{
- OUString aStrLb = maLbDocs.GetSelectEntry();
- long nPos = maLbDocs.GetSelectEntryPos();
+ OUString aStrLb = maLbDocs->GetSelectEntry();
+ long nPos = maLbDocs->GetSelectEntryPos();
bool bFound = false;
::sd::DrawDocShell* pDocShell = NULL;
NavDocInfo* pInfo = GetDocInfo();
@@ -441,18 +450,18 @@ IMPL_LINK_NOARG(SdNavigatorWin, SelectDocumentHdl)
if( bFound )
{
SdDrawDocument* pDoc = pDocShell->GetDoc();
- if( !maTlbObjects.IsEqualToDoc( pDoc ) )
+ if( !maTlbObjects->IsEqualToDoc( pDoc ) )
{
SdDrawDocument* pNonConstDoc = (SdDrawDocument*) pDoc; // const as const can...
::sd::DrawDocShell* pNCDocShell = pNonConstDoc->GetDocSh();
OUString aDocName = pNCDocShell->GetMedium()->GetName();
- maTlbObjects.Clear();
- maTlbObjects.Fill( pDoc, false, aDocName ); // only normal pages
+ maTlbObjects->Clear();
+ maTlbObjects->Fill( pDoc, false, aDocName ); // only normal pages
}
}
// check if link or url is possible
- if( ( pInfo && !pInfo->HasName() ) || !maTlbObjects.IsLinkableSelected() || ( meDragType != NAVIGATOR_DRAGTYPE_EMBEDDED ) )
+ if( ( pInfo && !pInfo->HasName() ) || !maTlbObjects->IsLinkableSelected() || ( meDragType != NAVIGATOR_DRAGTYPE_EMBEDDED ) )
{
meDragType = NAVIGATOR_DRAGTYPE_EMBEDDED;
SetDragImage();
@@ -484,13 +493,13 @@ IMPL_LINK( SdNavigatorWin, MenuSelectHdl, Menu *, pMenu )
if( meDragType == NAVIGATOR_DRAGTYPE_URL )
{
// patch, prevents endless loop
- if( maTlbObjects.GetSelectionCount() > 1 )
- maTlbObjects.SelectAll( false );
+ if( maTlbObjects->GetSelectionCount() > 1 )
+ maTlbObjects->SelectAll( false );
- maTlbObjects.SetSelectionMode( SINGLE_SELECTION );
+ maTlbObjects->SetSelectionMode( SINGLE_SELECTION );
}
else
- maTlbObjects.SetSelectionMode( MULTIPLE_SELECTION );
+ maTlbObjects->SetSelectionMode( MULTIPLE_SELECTION );
}
}
return 0;
@@ -500,7 +509,7 @@ IMPL_LINK( SdNavigatorWin, ShapeFilterCallback, Menu *, pMenu )
{
if (pMenu != NULL)
{
- bool bShowAllShapes (maTlbObjects.GetShowAllShapes());
+ bool bShowAllShapes (maTlbObjects->GetShowAllShapes());
sal_uInt16 nMenuId (pMenu->GetCurItemId());
switch (nMenuId)
{
@@ -518,7 +527,7 @@ IMPL_LINK( SdNavigatorWin, ShapeFilterCallback, Menu *, pMenu )
break;
}
- maTlbObjects.SetShowAllShapes(bShowAllShapes, true);
+ maTlbObjects->SetShowAllShapes(bShowAllShapes, true);
// Remember the selection in the FrameView.
NavDocInfo* pInfo = GetDocInfo();
@@ -554,26 +563,26 @@ void SdNavigatorWin::Resize()
aDiffSize.Height() = aWinSize.Height() - maSize.Height();
// change size of Toolbox
- Size aObjSize( maToolbox.GetOutputSizePixel() );
+ Size aObjSize( maToolbox->GetOutputSizePixel() );
aObjSize.Width() += aDiffSize.Width();
- maToolbox.SetOutputSizePixel( aObjSize );
+ maToolbox->SetOutputSizePixel( aObjSize );
// change size of TreeLB
- aObjSize = maTlbObjects.GetSizePixel();
+ aObjSize = maTlbObjects->GetSizePixel();
aObjSize.Width() += aDiffSize.Width();
- aObjSize.Height() = maLbDocs.GetPosPixel().Y() + aDiffSize.Height() -
- maTlbObjects.GetPosPixel().Y() - 4;
- maTlbObjects.SetSizePixel( aObjSize );
+ aObjSize.Height() = maLbDocs->GetPosPixel().Y() + aDiffSize.Height() -
+ maTlbObjects->GetPosPixel().Y() - 4;
+ maTlbObjects->SetSizePixel( aObjSize );
Point aPt( 0, aDiffSize.Height() );
// move other controls (DocumentLB)
- maLbDocs.Hide();
- aObjSize = maLbDocs.GetOutputSizePixel();
+ maLbDocs->Hide();
+ aObjSize = maLbDocs->GetOutputSizePixel();
aObjSize.Width() += aDiffSize.Width();
- maLbDocs.SetPosPixel( maLbDocs.GetPosPixel() + aPt );
- maLbDocs.SetOutputSizePixel( aObjSize );
- maLbDocs.Show();
+ maLbDocs->SetPosPixel( maLbDocs->GetPosPixel() + aPt );
+ maLbDocs->SetOutputSizePixel( aObjSize );
+ maLbDocs->Show();
maSize = aWinSize;
}
@@ -623,19 +632,19 @@ bool SdNavigatorWin::InsertFile(const OUString& rFileName)
if (pMedium->IsStorage())
{
// Now depending on mode:
- // maTlbObjects.SetSelectionMode(MULTIPLE_SELECTION);
+ // maTlbObjects->SetSelectionMode(MULTIPLE_SELECTION);
// handover of ownership of pMedium;
- SdDrawDocument* pDropDoc = maTlbObjects.GetBookmarkDoc(pMedium);
+ SdDrawDocument* pDropDoc = maTlbObjects->GetBookmarkDoc(pMedium);
if (pDropDoc)
{
- maTlbObjects.Clear();
+ maTlbObjects->Clear();
maDropFileName = aFileName;
- if( !maTlbObjects.IsEqualToDoc( pDropDoc ) )
+ if( !maTlbObjects->IsEqualToDoc( pDropDoc ) )
{
// only normal pages
- maTlbObjects.Fill(pDropDoc, false, maDropFileName);
+ maTlbObjects->Fill(pDropDoc, false, maDropFileName);
RefreshDocumentLB( &maDropFileName );
}
}
@@ -662,28 +671,28 @@ void SdNavigatorWin::RefreshDocumentLB( const OUString* pDocName )
if( pDocName )
{
if( mbDocImported )
- maLbDocs.RemoveEntry( 0 );
+ maLbDocs->RemoveEntry( 0 );
- maLbDocs.InsertEntry( *pDocName, 0 );
+ maLbDocs->InsertEntry( *pDocName, 0 );
mbDocImported = true;
}
else
{
- nPos = maLbDocs.GetSelectEntryPos();
+ nPos = maLbDocs->GetSelectEntryPos();
if( nPos == LISTBOX_ENTRY_NOTFOUND )
nPos = 0;
OUString aStr;
if( mbDocImported )
- aStr = maLbDocs.GetEntry( 0 );
+ aStr = maLbDocs->GetEntry( 0 );
- maLbDocs.Clear();
+ maLbDocs->Clear();
// delete list of DocInfos
maDocList.clear();
if( mbDocImported )
- maLbDocs.InsertEntry( aStr, 0 );
+ maLbDocs->InsertEntry( aStr, 0 );
::sd::DrawDocShell* pCurrentDocShell =
PTR_CAST(::sd::DrawDocShell, SfxObjectShell::Current() );
@@ -707,7 +716,7 @@ void SdNavigatorWin::RefreshDocumentLB( const OUString* pDocName )
// is shown in url notation!
aStr = pDocShell->GetName();
- maLbDocs.InsertEntry( aStr, LISTBOX_APPEND );
+ maLbDocs->InsertEntry( aStr, LISTBOX_APPEND );
if( pDocShell == pCurrentDocShell )
aInfo.SetActive();
@@ -719,7 +728,7 @@ void SdNavigatorWin::RefreshDocumentLB( const OUString* pDocName )
pSfxDocShell = SfxObjectShell::GetNext( *pSfxDocShell, 0, false );
}
}
- maLbDocs.SelectEntryPos( nPos );
+ maLbDocs->SelectEntryPos( nPos );
}
sal_uInt16 SdNavigatorWin::GetDragTypeSdResId( NavigatorDragType eDT, bool bImage )
@@ -741,7 +750,7 @@ sal_uInt16 SdNavigatorWin::GetDragTypeSdResId( NavigatorDragType eDT, bool bImag
NavDocInfo* SdNavigatorWin::GetDocInfo()
{
- sal_uInt32 nPos = maLbDocs.GetSelectEntryPos();
+ sal_uInt32 nPos = maLbDocs->GetSelectEntryPos();
if( mbDocImported )
{
@@ -834,14 +843,14 @@ void SdNavigatorWin::DataChanged( const DataChangedEvent& rDCEvt )
void SdNavigatorWin::SetDragImage()
{
- maToolbox.SetItemImage( TBI_DRAGTYPE, maToolbox.GetImageList().GetImage( GetDragTypeSdResId( meDragType, true ) ) );
+ maToolbox->SetItemImage( TBI_DRAGTYPE, maToolbox->GetImageList().GetImage( GetDragTypeSdResId( meDragType, true ) ) );
}
void SdNavigatorWin::ApplyImageList()
{
- maToolbox.SetImageList( maImageList );
- maToolbox.SetItemImage(TBI_SHAPE_FILTER, Image(BitmapEx(SdResId(BMP_GRAPHIC))));
+ maToolbox->SetImageList( maImageList );
+ maToolbox->SetItemImage(TBI_SHAPE_FILTER, Image(BitmapEx(SdResId(BMP_GRAPHIC))));
SetDragImage();
}
@@ -871,17 +880,17 @@ void SdNavigatorControllerItem::StateChanged( sal_uInt16 nSId,
// pen
if( nState & NAVBTN_PEN_ENABLED &&
- !pNavigatorWin->maToolbox.IsItemEnabled( TBI_PEN ) )
- pNavigatorWin->maToolbox.EnableItem( TBI_PEN );
+ !pNavigatorWin->maToolbox->IsItemEnabled( TBI_PEN ) )
+ pNavigatorWin->maToolbox->EnableItem( TBI_PEN );
if( nState & NAVBTN_PEN_DISABLED &&
- pNavigatorWin->maToolbox.IsItemEnabled( TBI_PEN ) )
- pNavigatorWin->maToolbox.EnableItem( TBI_PEN, false );
+ pNavigatorWin->maToolbox->IsItemEnabled( TBI_PEN ) )
+ pNavigatorWin->maToolbox->EnableItem( TBI_PEN, false );
if( nState & NAVBTN_PEN_CHECKED &&
- !pNavigatorWin->maToolbox.IsItemChecked( TBI_PEN ) )
- pNavigatorWin->maToolbox.CheckItem( TBI_PEN );
+ !pNavigatorWin->maToolbox->IsItemChecked( TBI_PEN ) )
+ pNavigatorWin->maToolbox->CheckItem( TBI_PEN );
if( nState & NAVBTN_PEN_UNCHECKED &&
- pNavigatorWin->maToolbox.IsItemChecked( TBI_PEN ) )
- pNavigatorWin->maToolbox.CheckItem( TBI_PEN, false );
+ pNavigatorWin->maToolbox->IsItemChecked( TBI_PEN ) )
+ pNavigatorWin->maToolbox->CheckItem( TBI_PEN, false );
// only if doc in LB is the active
NavDocInfo* pInfo = pNavigatorWin->GetDocInfo();
@@ -889,35 +898,35 @@ void SdNavigatorControllerItem::StateChanged( sal_uInt16 nSId,
{
// First
if( nState & NAVBTN_FIRST_ENABLED &&
- !pNavigatorWin->maToolbox.IsItemEnabled( TBI_FIRST ) )
- pNavigatorWin->maToolbox.EnableItem( TBI_FIRST );
+ !pNavigatorWin->maToolbox->IsItemEnabled( TBI_FIRST ) )
+ pNavigatorWin->maToolbox->EnableItem( TBI_FIRST );
if( nState & NAVBTN_FIRST_DISABLED &&
- pNavigatorWin->maToolbox.IsItemEnabled( TBI_FIRST ) )
- pNavigatorWin->maToolbox.EnableItem( TBI_FIRST, false );
+ pNavigatorWin->maToolbox->IsItemEnabled( TBI_FIRST ) )
+ pNavigatorWin->maToolbox->EnableItem( TBI_FIRST, false );
// Prev
if( nState & NAVBTN_PREV_ENABLED &&
- !pNavigatorWin->maToolbox.IsItemEnabled( TBI_PREVIOUS ) )
- pNavigatorWin->maToolbox.EnableItem( TBI_PREVIOUS );
+ !pNavigatorWin->maToolbox->IsItemEnabled( TBI_PREVIOUS ) )
+ pNavigatorWin->maToolbox->EnableItem( TBI_PREVIOUS );
if( nState & NAVBTN_PREV_DISABLED &&
- pNavigatorWin->maToolbox.IsItemEnabled( TBI_PREVIOUS ) )
- pNavigatorWin->maToolbox.EnableItem( TBI_PREVIOUS, false );
+ pNavigatorWin->maToolbox->IsItemEnabled( TBI_PREVIOUS ) )
+ pNavigatorWin->maToolbox->EnableItem( TBI_PREVIOUS, false );
// Last
if( nState & NAVBTN_LAST_ENABLED &&
- !pNavigatorWin->maToolbox.IsItemEnabled( TBI_LAST ) )
- pNavigatorWin->maToolbox.EnableItem( TBI_LAST );
+ !pNavigatorWin->maToolbox->IsItemEnabled( TBI_LAST ) )
+ pNavigatorWin->maToolbox->EnableItem( TBI_LAST );
if( nState & NAVBTN_LAST_DISABLED &&
- pNavigatorWin->maToolbox.IsItemEnabled( TBI_LAST ) )
- pNavigatorWin->maToolbox.EnableItem( TBI_LAST, false );
+ pNavigatorWin->maToolbox->IsItemEnabled( TBI_LAST ) )
+ pNavigatorWin->maToolbox->EnableItem( TBI_LAST, false );
// Next
if( nState & NAVBTN_NEXT_ENABLED &&
- !pNavigatorWin->maToolbox.IsItemEnabled( TBI_NEXT ) )
- pNavigatorWin->maToolbox.EnableItem( TBI_NEXT );
+ !pNavigatorWin->maToolbox->IsItemEnabled( TBI_NEXT ) )
+ pNavigatorWin->maToolbox->EnableItem( TBI_NEXT );
if( nState & NAVBTN_NEXT_DISABLED &&
- pNavigatorWin->maToolbox.IsItemEnabled( TBI_NEXT ) )
- pNavigatorWin->maToolbox.EnableItem( TBI_NEXT, false );
+ pNavigatorWin->maToolbox->IsItemEnabled( TBI_NEXT ) )
+ pNavigatorWin->maToolbox->EnableItem( TBI_NEXT, false );
if( nState & NAVTLB_UPDATE )
{
@@ -956,14 +965,14 @@ void SdPageNameControllerItem::StateChanged( sal_uInt16 nSId,
DBG_ASSERT( pStateItem, "SfxStringItem expected");
OUString aPageName = pStateItem->GetValue();
- if( !pNavigatorWin->maTlbObjects.HasSelectedChildren( aPageName ) )
+ if( !pNavigatorWin->maTlbObjects->HasSelectedChildren( aPageName ) )
{
- if( pNavigatorWin->maTlbObjects.GetSelectionMode() == MULTIPLE_SELECTION )
+ if( pNavigatorWin->maTlbObjects->GetSelectionMode() == MULTIPLE_SELECTION )
{
// because otherwise it is always additional select
- pNavigatorWin->maTlbObjects.SelectAll( false );
+ pNavigatorWin->maTlbObjects->SelectAll( false );
}
- pNavigatorWin->maTlbObjects.SelectEntry( aPageName );
+ pNavigatorWin->maTlbObjects->SelectEntry( aPageName );
}
}
}
diff --git a/sd/source/ui/dlg/paragr.cxx b/sd/source/ui/dlg/paragr.cxx
index 53fb0adb873e..29bc961a7e41 100644
--- a/sd/source/ui/dlg/paragr.cxx
+++ b/sd/source/ui/dlg/paragr.cxx
@@ -39,17 +39,18 @@ class SdParagraphNumTabPage : public SfxTabPage
public:
SdParagraphNumTabPage(vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~SdParagraphNumTabPage();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window* pParent, const SfxItemSet* rSet );
+ static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
static const sal_uInt16* GetRanges();
virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
private:
- TriStateBox* m_pNewStartCB;
- TriStateBox* m_pNewStartNumberCB;
- NumericField* m_pNewStartNF;
+ VclPtr<TriStateBox> m_pNewStartCB;
+ VclPtr<TriStateBox> m_pNewStartNumberCB;
+ VclPtr<NumericField> m_pNewStartNF;
bool mbModified;
DECL_LINK( ImplNewStartHdl, void* );
@@ -72,11 +73,20 @@ SdParagraphNumTabPage::SdParagraphNumTabPage(vcl::Window* pParent, const SfxItem
SdParagraphNumTabPage::~SdParagraphNumTabPage()
{
+ disposeOnce();
}
-SfxTabPage* SdParagraphNumTabPage::Create(vcl::Window *pParent, const SfxItemSet * rAttrSet)
+void SdParagraphNumTabPage::dispose()
{
- return new SdParagraphNumTabPage( pParent, *rAttrSet );
+ m_pNewStartCB.clear();
+ m_pNewStartNumberCB.clear();
+ m_pNewStartNF.clear();
+ SfxTabPage::dispose();
+}
+
+VclPtr<SfxTabPage> SdParagraphNumTabPage::Create(vcl::Window *pParent, const SfxItemSet * rAttrSet)
+{
+ return VclPtr<SdParagraphNumTabPage>::Create( pParent, *rAttrSet );
}
const sal_uInt16* SdParagraphNumTabPage::GetRanges()
diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx
index c4b95a9d2458..bd635ad96676 100644
--- a/sd/source/ui/dlg/present.cxx
+++ b/sd/source/ui/dlg/present.cxx
@@ -150,6 +150,39 @@ SdStartPresentationDlg::SdStartPresentationDlg( vcl::Window* pWindow,
ChangePauseHdl( NULL );
}
+SdStartPresentationDlg::~SdStartPresentationDlg()
+{
+ disposeOnce();
+}
+
+void SdStartPresentationDlg::dispose()
+{
+ aRbtAll.clear();
+ aRbtAtDia.clear();
+ aRbtCustomshow.clear();
+ aLbDias.clear();
+ aLbCustomshow.clear();
+ aRbtStandard.clear();
+ aRbtWindow.clear();
+ aRbtAuto.clear();
+ aTmfPause.clear();
+ aCbxAutoLogo.clear();
+ aCbxManuel.clear();
+ aCbxMousepointer.clear();
+ aCbxPen.clear();
+ aCbxNavigator.clear();
+ aCbxAnimationAllowed.clear();
+ aCbxChangePage.clear();
+ aCbxAlwaysOnTop.clear();
+ maFtMonitor.clear();
+ maLBMonitor.clear();
+ msMonitor.clear();
+ msAllMonitors.clear();
+ msMonitorExternal.clear();
+ msExternal.clear();
+ ModalDialog::dispose();
+}
+
OUString SdStartPresentationDlg::GetDisplayName( sal_Int32 nDisplay,
DisplayType eType )
{
diff --git a/sd/source/ui/dlg/prltempl.cxx b/sd/source/ui/dlg/prltempl.cxx
index e2330f9f6b2f..42a02cc15734 100644
--- a/sd/source/ui/dlg/prltempl.cxx
+++ b/sd/source/ui/dlg/prltempl.cxx
@@ -223,7 +223,13 @@ SdPresLayoutTemplateDlg::SdPresLayoutTemplateDlg( SfxObjectShell* pDocSh,
SdPresLayoutTemplateDlg::~SdPresLayoutTemplateDlg()
{
+ disposeOnce();
+}
+
+void SdPresLayoutTemplateDlg::dispose()
+{
delete pOutSet;
+ SfxTabDialog::dispose();
}
void SdPresLayoutTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
diff --git a/sd/source/ui/dlg/prntopts.cxx b/sd/source/ui/dlg/prntopts.cxx
index 943144be7a53..3785de353d1f 100644
--- a/sd/source/ui/dlg/prntopts.cxx
+++ b/sd/source/ui/dlg/prntopts.cxx
@@ -30,7 +30,7 @@
*/
SdPrintOptions::SdPrintOptions( vcl::Window* pParent, const SfxItemSet& rInAttrs ) :
SfxTabPage ( pParent, "prntopts" , "modules/simpress/ui/prntopts.ui" , &rInAttrs ),
- rOutAttrs ( rInAttrs )
+ rOutAttrs ( rInAttrs )
{
get( m_pFrmContent , "contentframe" );
get( m_pCbxDraw , "drawingcb" );
@@ -74,6 +74,31 @@ SdPrintOptions::SdPrintOptions( vcl::Window* pParent, const SfxItemSet& rInAttrs
SdPrintOptions::~SdPrintOptions()
{
+ disposeOnce();
+}
+
+void SdPrintOptions::dispose()
+{
+ m_pFrmContent.clear();
+ m_pCbxDraw.clear();
+ m_pCbxNotes.clear();
+ m_pCbxHandout.clear();
+ m_pCbxOutline.clear();
+ m_pRbtColor.clear();
+ m_pRbtGrayscale.clear();
+ m_pRbtBlackWhite.clear();
+ m_pCbxPagename.clear();
+ m_pCbxDate.clear();
+ m_pCbxTime.clear();
+ m_pCbxHiddenPages.clear();
+ m_pRbtDefault.clear();
+ m_pRbtPagesize.clear();
+ m_pRbtPagetile.clear();
+ m_pRbtBooklet.clear();
+ m_pCbxFront.clear();
+ m_pCbxBack.clear();
+ m_pCbxPaperbin.clear();
+ SfxTabPage::dispose();
}
bool SdPrintOptions::FillItemSet( SfxItemSet* rAttrs )
@@ -182,10 +207,10 @@ void SdPrintOptions::Reset( const SfxItemSet* rAttrs )
ClickBookletHdl( NULL );
}
-SfxTabPage* SdPrintOptions::Create( vcl::Window* pWindow,
- const SfxItemSet* rOutAttrs )
+VclPtr<SfxTabPage> SdPrintOptions::Create( vcl::Window* pWindow,
+ const SfxItemSet* rOutAttrs )
{
- return( new SdPrintOptions( pWindow, *rOutAttrs ) );
+ return VclPtr<SdPrintOptions>::Create( pWindow, *rOutAttrs );
}
IMPL_LINK( SdPrintOptions, ClickCheckboxHdl, CheckBox *, pCbx )
diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx
index 8e5c87a381d3..ad902b933e38 100644
--- a/sd/source/ui/dlg/sddlgfact.cxx
+++ b/sd/source/ui/dlg/sddlgfact.cxx
@@ -121,37 +121,37 @@ OUString SdAbstractTabDialog_Impl::GetText() const
void AbstractBulletDialog_Impl::SetCurPageId( sal_uInt16 nId )
{
- static_cast< ::sd::OutlineBulletDlg*>(pDlg)->SetCurPageId( nId );
+ static_cast< ::sd::OutlineBulletDlg*>(pDlg.get())->SetCurPageId( nId );
}
void AbstractBulletDialog_Impl::SetCurPageId( const OString& rName )
{
- static_cast< ::sd::OutlineBulletDlg*>(pDlg)->SetCurPageId( rName );
+ static_cast< ::sd::OutlineBulletDlg*>(pDlg.get())->SetCurPageId( rName );
}
const SfxItemSet* AbstractBulletDialog_Impl::GetOutputItemSet() const
{
- return static_cast< ::sd::OutlineBulletDlg*>(pDlg)->GetOutputItemSet();
+ return static_cast< ::sd::OutlineBulletDlg*>(pDlg.get())->GetOutputItemSet();
}
const sal_uInt16* AbstractBulletDialog_Impl::GetInputRanges(const SfxItemPool& pItem )
{
- return static_cast< ::sd::OutlineBulletDlg*>(pDlg)->GetInputRanges( pItem );
+ return static_cast< ::sd::OutlineBulletDlg*>(pDlg.get())->GetInputRanges( pItem );
}
void AbstractBulletDialog_Impl::SetInputSet( const SfxItemSet* pInSet )
{
- static_cast< ::sd::OutlineBulletDlg*>(pDlg)->SetInputSet( pInSet );
+ static_cast< ::sd::OutlineBulletDlg*>(pDlg.get())->SetInputSet( pInSet );
}
void AbstractBulletDialog_Impl::SetText( const OUString& rStr )
{
- static_cast< ::sd::OutlineBulletDlg*>(pDlg)->SetText( rStr );
+ static_cast< ::sd::OutlineBulletDlg*>(pDlg.get())->SetText( rStr );
}
OUString AbstractBulletDialog_Impl::GetText() const
{
- return static_cast< ::sd::OutlineBulletDlg*>(pDlg)->GetText();
+ return static_cast< ::sd::OutlineBulletDlg*>(pDlg.get())->GetText();
}
void SdPresLayoutTemplateDlg_Impl::SetCurPageId( sal_uInt16 nId )
@@ -391,47 +391,47 @@ AbstractCopyDlg * SdAbstractDialogFactory_Impl::CreateCopyDlg(
AbstractSdCustomShowDlg * SdAbstractDialogFactory_Impl::CreateSdCustomShowDlg( vcl::Window* pWindow, SdDrawDocument& rDrawDoc )
{
- return new AbstractSdCustomShowDlg_Impl( new SdCustomShowDlg( pWindow, rDrawDoc ) );
+ return new AbstractSdCustomShowDlg_Impl( VclPtr<SdCustomShowDlg>::Create( pWindow, rDrawDoc ) );
}
SfxAbstractTabDialog * SdAbstractDialogFactory_Impl::CreateSdTabCharDialog( vcl::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell )
{
- return new SdAbstractTabDialog_Impl( new SdCharDlg( pParent, pAttr, pDocShell ) );
+ return new SdAbstractTabDialog_Impl( VclPtr<SdCharDlg>::Create( pParent, pAttr, pDocShell ) );
}
SfxAbstractTabDialog * SdAbstractDialogFactory_Impl::CreateSdTabPageDialog( vcl::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell, bool bAreaPage )
{
- return new SdAbstractTabDialog_Impl( new SdPageDlg( pDocShell, pParent, pAttr, bAreaPage ) );
+ return new SdAbstractTabDialog_Impl( VclPtr<SdPageDlg>::Create( pDocShell, pParent, pAttr, bAreaPage ) );
}
AbstractAssistentDlg * SdAbstractDialogFactory_Impl::CreateAssistentDlg( vcl::Window* pParent, bool bAutoPilot)
{
- return new AbstractAssistentDlg_Impl( new AssistentDlg( pParent, bAutoPilot ) );
+ return new AbstractAssistentDlg_Impl( VclPtr<AssistentDlg>::Create( pParent, bAutoPilot ) );
}
AbstractSdModifyFieldDlg * SdAbstractDialogFactory_Impl::CreateSdModifyFieldDlg( vcl::Window* pWindow, const SvxFieldData* pInField, const SfxItemSet& rSet )
{
- return new AbstractSdModifyFieldDlg_Impl( new SdModifyFieldDlg( pWindow, pInField, rSet ) );
+ return new AbstractSdModifyFieldDlg_Impl( VclPtr<SdModifyFieldDlg>::Create( pWindow, pInField, rSet ) );
}
AbstractSdSnapLineDlg * SdAbstractDialogFactory_Impl::CreateSdSnapLineDlg( vcl::Window* pWindow, const SfxItemSet& rInAttrs, ::sd::View* pView)
{
- return new AbstractSdSnapLineDlg_Impl( new SdSnapLineDlg( pWindow, rInAttrs, pView ) );
+ return new AbstractSdSnapLineDlg_Impl( VclPtr<SdSnapLineDlg>::Create( pWindow, rInAttrs, pView ) );
}
AbstractSdInsertLayerDlg * SdAbstractDialogFactory_Impl::CreateSdInsertLayerDlg( vcl::Window* pWindow, const SfxItemSet& rInAttrs, bool bDeletable, const OUString& aStr )
{
- return new AbstractSdInsertLayerDlg_Impl( new SdInsertLayerDlg( pWindow, rInAttrs, bDeletable, aStr ) );
+ return new AbstractSdInsertLayerDlg_Impl( VclPtr<SdInsertLayerDlg>::Create( pWindow, rInAttrs, bDeletable, aStr ) );
}
AbstractSdInsertPasteDlg * SdAbstractDialogFactory_Impl::CreateSdInsertPasteDlg( vcl::Window* pWindow )
{
- return new AbstractSdInsertPasteDlg_Impl( new SdInsertPasteDlg( pWindow ) );
+ return new AbstractSdInsertPasteDlg_Impl( VclPtr<SdInsertPasteDlg>::Create( pWindow ) );
}
AbstractSdInsertPagesObjsDlg * SdAbstractDialogFactory_Impl::CreateSdInsertPagesObjsDlg( vcl::Window* pParent, const SdDrawDocument* pDoc, SfxMedium* pSfxMedium, const OUString& rFileName )
{
- return new AbstractSdInsertPagesObjsDlg_Impl( new SdInsertPagesObjsDlg( pParent, pDoc, pSfxMedium, rFileName ) );
+ return new AbstractSdInsertPagesObjsDlg_Impl( VclPtr<SdInsertPagesObjsDlg>::Create( pParent, pDoc, pSfxMedium, rFileName ) );
}
AbstractMorphDlg * SdAbstractDialogFactory_Impl::CreateMorphDlg( vcl::Window* pParent, const SdrObject* pObj1, const SdrObject* pObj2)
@@ -446,13 +446,13 @@ SfxAbstractTabDialog * SdAbstractDialogFactory_Impl::CreateSdOutlineBulletTabDl
SfxAbstractTabDialog * SdAbstractDialogFactory_Impl::CreateSdParagraphTabDlg( vcl::Window* pParent, const SfxItemSet* pAttr )
{
- return new SdAbstractTabDialog_Impl( new SdParagraphDlg( pParent, pAttr ) );
+ return new SdAbstractTabDialog_Impl( VclPtr<SdParagraphDlg>::Create( pParent, pAttr ) );
}
AbstractSdStartPresDlg * SdAbstractDialogFactory_Impl::CreateSdStartPresentationDlg( vcl::Window* pWindow, const SfxItemSet& rInAttrs,
const std::vector<OUString> &rPageNames, SdCustomShowList* pCSList )
{
- return new AbstractSdStartPresDlg_Impl( new SdStartPresentationDlg( pWindow, rInAttrs, rPageNames, pCSList ) );
+ return new AbstractSdStartPresDlg_Impl( VclPtr<SdStartPresentationDlg>::Create( pWindow, rInAttrs, rPageNames, pCSList ) );
}
VclAbstractDialog * SdAbstractDialogFactory_Impl::CreateRemoteDialog( vcl::Window* pWindow )
@@ -462,32 +462,32 @@ VclAbstractDialog * SdAbstractDialogFactory_Impl::CreateRemoteDialog( vcl::Windo
SfxAbstractTabDialog * SdAbstractDialogFactory_Impl::CreateSdPresLayoutTemplateDlg( SfxObjectShell* pDocSh, vcl::Window* pParent, const SdResId& DlgId, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool )
{
- return new SdPresLayoutTemplateDlg_Impl( new SdPresLayoutTemplateDlg( pDocSh, pParent, DlgId, rStyleBase, ePO, pSSPool ) );
+ return new SdPresLayoutTemplateDlg_Impl( VclPtr<SdPresLayoutTemplateDlg>::Create( pDocSh, pParent, DlgId, rStyleBase, ePO, pSSPool ) );
}
AbstractSdPresLayoutDlg * SdAbstractDialogFactory_Impl::CreateSdPresLayoutDlg( ::sd::DrawDocShell* pDocShell, vcl::Window* pWindow, const SfxItemSet& rInAttrs)
{
- return new AbstractSdPresLayoutDlg_Impl( new SdPresLayoutDlg( pDocShell, pWindow, rInAttrs ) );
+ return new AbstractSdPresLayoutDlg_Impl( VclPtr<SdPresLayoutDlg>::Create( pDocShell, pWindow, rInAttrs ) );
}
SfxAbstractTabDialog * SdAbstractDialogFactory_Impl::CreateSdTabTemplateDlg( vcl::Window* pParent, const SfxObjectShell* pDocShell, SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView )
{
- return new SdAbstractTabDialog_Impl( new SdTabTemplateDlg( pParent, pDocShell, rStyleBase, pModel, pView ) );
+ return new SdAbstractTabDialog_Impl( VclPtr<SdTabTemplateDlg>::Create( pParent, pDocShell, rStyleBase, pModel, pView ) );
}
SfxAbstractDialog* SdAbstractDialogFactory_Impl::CreatSdActionDialog( vcl::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView )
{
- return new SdAbstractSfxDialog_Impl( new SdActionDlg( pParent, pAttr, pView ) );
+ return new SdAbstractSfxDialog_Impl( VclPtr<SdActionDlg>::Create( pParent, pAttr, pView ) );
}
AbstractSdVectorizeDlg * SdAbstractDialogFactory_Impl::CreateSdVectorizeDlg( vcl::Window* pParent, const Bitmap& rBmp, ::sd::DrawDocShell* pDocShell )
{
- return new AbstractSdVectorizeDlg_Impl( new SdVectorizeDlg( pParent, rBmp, pDocShell ) );
+ return new AbstractSdVectorizeDlg_Impl( VclPtr<SdVectorizeDlg>::Create( pParent, rBmp, pDocShell ) );
}
AbstractSdPublishingDlg * SdAbstractDialogFactory_Impl::CreateSdPublishingDlg( vcl::Window* pWindow, DocumentType eDocType)
{
- return new AbstractSdPublishingDlg_Impl( new SdPublishingDlg( pWindow, eDocType ) );
+ return new AbstractSdPublishingDlg_Impl( VclPtr<SdPublishingDlg>::Create( pWindow, eDocType ) );
}
// Factories for TabPages
diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx
index 38d6d1e4c1e7..3ba9b486d787 100644
--- a/sd/source/ui/dlg/sddlgfact.hxx
+++ b/sd/source/ui/dlg/sddlgfact.hxx
@@ -23,7 +23,7 @@
#include <sfx2/basedlgs.hxx>
#define DECL_ABSTDLG_BASE(Class,DialogClass) \
- DialogClass* pDlg; \
+ ScopedVclPtr<DialogClass> pDlg; \
public: \
Class( DialogClass* p) \
: pDlg(p) \
@@ -34,7 +34,6 @@ public: \
#define IMPL_ABSTDLG_BASE(Class) \
Class::~Class() \
{ \
- delete pDlg; \
} \
short Class::Execute() \
{ \
diff --git a/sd/source/ui/dlg/sdpreslt.cxx b/sd/source/ui/dlg/sdpreslt.cxx
index 21d8a89afb6f..51206936dd07 100644
--- a/sd/source/ui/dlg/sdpreslt.cxx
+++ b/sd/source/ui/dlg/sdpreslt.cxx
@@ -55,6 +55,16 @@ SdPresLayoutDlg::SdPresLayoutDlg(::sd::DrawDocShell* pDocShell,
SdPresLayoutDlg::~SdPresLayoutDlg()
{
+ disposeOnce();
+}
+
+void SdPresLayoutDlg::dispose()
+{
+ m_pVS.clear();
+ m_pCbxMasterPage.clear();
+ m_pCbxCheckMasters.clear();
+ m_pBtnLoad.clear();
+ ModalDialog::dispose();
}
/**
@@ -169,7 +179,7 @@ IMPL_LINK_NOARG(SdPresLayoutDlg, ClickLayoutHdl)
*/
IMPL_LINK_NOARG(SdPresLayoutDlg, ClickLoadHdl)
{
- boost::scoped_ptr<SfxNewFileDialog> pDlg(new SfxNewFileDialog(this, SFXWB_PREVIEW));
+ VclPtrInstance< SfxNewFileDialog > pDlg(this, SFXWB_PREVIEW);
pDlg->SetText(SD_RESSTR(STR_LOAD_PRESENTATION_LAYOUT));
if(!IsReallyVisible())
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 0a96dd736de3..5e358bf35578 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -255,11 +255,19 @@ SdPageObjsTLB::SdPageObjsTLB( vcl::Window* pParentWin, WinBits nStyle )
SdPageObjsTLB::~SdPageObjsTLB()
{
+ disposeOnce();
+}
+
+void SdPageObjsTLB::dispose()
+{
if ( mpBookmarkDoc )
CloseBookmarkDoc();
else
// no document was created from mpMedium, so this object is still the owner of it
delete mpMedium;
+ mpParent.clear();
+ mpDropNavWin.clear();
+ SvTreeListBox::dispose();
}
// helper function for GetEntryAltText and GetEntryLongDescription
@@ -1004,8 +1012,8 @@ SdDrawDocument* SdPageObjsTLB::GetBookmarkDoc(SfxMedium* pMed)
if ( !mpBookmarkDoc )
{
- MessageDialog aErrorBox(this, SD_RESSTR(STR_READ_DATA_ERROR));
- aErrorBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(this, SD_RESSTR(STR_READ_DATA_ERROR));
+ aErrorBox->Execute();
mpMedium = 0; //On failure the SfxMedium is invalid
}
}
@@ -1343,7 +1351,7 @@ sal_Int8 SdPageObjsTLB::ExecuteDrop( const ExecuteDropEvent& rEvt )
OUString aFile;
if( aDataHelper.GetString( SotClipboardFormatId::SIMPLE_FILE, aFile ) &&
- static_cast<SdNavigatorWin*>(mpParent)->InsertFile( aFile ) )
+ static_cast<SdNavigatorWin*>(mpParent.get())->InsertFile( aFile ) )
{
nRet = rEvt.mnAction;
}
diff --git a/sd/source/ui/dlg/sduiexp.cxx b/sd/source/ui/dlg/sduiexp.cxx
index 3c526380a538..84127950fcd2 100644
--- a/sd/source/ui/dlg/sduiexp.cxx
+++ b/sd/source/ui/dlg/sduiexp.cxx
@@ -18,6 +18,21 @@
*/
#include "sddlgfact.hxx"
+#include "morphdlg.hxx"
+#include "present.hxx"
+#include "inspagob.hxx"
+#include "vectdlg.hxx"
+#include "sdpreslt.hxx"
+#include "headerfooterdlg.hxx"
+#include "pubdlg.hxx"
+#include "ins_paste.hxx"
+#include "layeroptionsdlg.hxx"
+#include "dlgsnap.hxx"
+#include "dlgfield.hxx"
+#include "dlgass.hxx"
+#include "prltempl.hxx"
+#include "custsdlg.hxx"
+#include "copydlg.hxx"
#include "sal/types.h"
extern "C"
diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx
index 253e7142aa34..e038120c6a00 100644
--- a/sd/source/ui/dlg/tpaction.cxx
+++ b/sd/source/ui/dlg/tpaction.cxx
@@ -83,12 +83,12 @@ SdActionDlg::SdActionDlg (
, rOutAttrs(*pAttr)
{
// FreeResource();
- SfxTabPage* pNewPage = SdTPAction::Create(get_content_area(), rOutAttrs);
+ VclPtr<SfxTabPage> pNewPage = SdTPAction::Create(get_content_area(), rOutAttrs);
assert(pNewPage); //Unable to create page
// formerly in PageCreated
- static_cast<SdTPAction*>( pNewPage )->SetView( pView );
- static_cast<SdTPAction*>( pNewPage )->Construct();
+ static_cast<SdTPAction*>( pNewPage.get() )->SetView( pView );
+ static_cast<SdTPAction*>( pNewPage.get() )->Construct();
SetTabPage( pNewPage );
}
@@ -142,6 +142,25 @@ SdTPAction::SdTPAction(vcl::Window* pWindow, const SfxItemSet& rInAttrs)
SdTPAction::~SdTPAction()
{
+ disposeOnce();
+}
+
+void SdTPAction::dispose()
+{
+ m_pLbAction.clear();
+ m_pFtTree.clear();
+ m_pLbTree.clear();
+ m_pLbTreeDocument.clear();
+ m_pLbOLEAction.clear();
+ m_pFrame.clear();
+ m_pEdtSound.clear();
+ m_pEdtBookmark.clear();
+ m_pEdtDocument.clear();
+ m_pEdtProgram.clear();
+ m_pEdtMacro.clear();
+ m_pBtnSearch.clear();
+ m_pBtnSeek.clear();
+ SfxTabPage::dispose();
}
void SdTPAction::SetView( const ::sd::View* pSdView )
@@ -359,10 +378,10 @@ SfxTabPage::sfxpg SdTPAction::DeactivatePage( SfxItemSet* pPageSet )
return LEAVE_PAGE;
}
-SfxTabPage* SdTPAction::Create( vcl::Window* pWindow,
- const SfxItemSet& rAttrs )
+VclPtr<SfxTabPage> SdTPAction::Create( vcl::Window* pWindow,
+ const SfxItemSet& rAttrs )
{
- return new SdTPAction( pWindow, rAttrs );
+ return VclPtr<SdTPAction>::Create( pWindow, rAttrs );
}
void SdTPAction::UpdateTree()
diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx
index cc69f5e8627a..35c5cb3435af 100644
--- a/sd/source/ui/dlg/tpoption.cxx
+++ b/sd/source/ui/dlg/tpoption.cxx
@@ -99,10 +99,10 @@ void SdTpOptionsSnap::Reset( const SfxItemSet* rAttrs )
pCbxRotate->GetClickHdl().Call(0);
}
-SfxTabPage* SdTpOptionsSnap::Create( vcl::Window* pWindow,
- const SfxItemSet* rAttrs )
+VclPtr<SfxTabPage> SdTpOptionsSnap::Create( vcl::Window* pWindow,
+ const SfxItemSet* rAttrs )
{
- return new SdTpOptionsSnap( pWindow, *rAttrs );
+ return VclPtr<SdTpOptionsSnap>::Create( pWindow, *rAttrs );
}
/*************************************************************************
@@ -122,6 +122,16 @@ SdTpOptionsContents::SdTpOptionsContents( vcl::Window* pParent, const SfxItemSet
SdTpOptionsContents::~SdTpOptionsContents()
{
+ disposeOnce();
+}
+
+void SdTpOptionsContents::dispose()
+{
+ m_pCbxRuler.clear();
+ m_pCbxDragStripes.clear();
+ m_pCbxHandlesBezier.clear();
+ m_pCbxMoveOutline.clear();
+ SfxTabPage::dispose();
}
bool SdTpOptionsContents::FillItemSet( SfxItemSet* rAttrs )
@@ -165,10 +175,10 @@ void SdTpOptionsContents::Reset( const SfxItemSet* rAttrs )
m_pCbxHandlesBezier->SaveValue();
}
-SfxTabPage* SdTpOptionsContents::Create( vcl::Window* pWindow,
- const SfxItemSet* rAttrs )
+VclPtr<SfxTabPage> SdTpOptionsContents::Create( vcl::Window* pWindow,
+ const SfxItemSet* rAttrs )
{
- return new SdTpOptionsContents( pWindow, *rAttrs );
+ return VclPtr<SdTpOptionsContents>::Create( pWindow, *rAttrs );
}
/*************************************************************************
@@ -276,6 +286,38 @@ SdTpOptionsMisc::SdTpOptionsMisc(vcl::Window* pParent, const SfxItemSet& rInAttr
SdTpOptionsMisc::~SdTpOptionsMisc()
{
+ disposeOnce();
+}
+
+void SdTpOptionsMisc::dispose()
+{
+ m_pCbxQuickEdit.clear();
+ m_pCbxPickThrough.clear();
+ m_pNewDocumentFrame.clear();
+ m_pCbxStartWithTemplate.clear();
+ m_pCbxMasterPageCache.clear();
+ m_pCbxCopy.clear();
+ m_pCbxMarkedHitMovesAlways.clear();
+ m_pPresentationFrame.clear();
+ m_pLbMetric.clear();
+ m_pMtrFldTabstop.clear();
+ m_pCbxEnableSdremote.clear();
+ m_pCbxEnablePresenterScreen.clear();
+ m_pCbxUsePrinterMetrics.clear();
+ m_pCbxCompatibility.clear();
+ m_pScaleFrame.clear();
+ m_pCbScale.clear();
+ m_pNewDocLb.clear();
+ m_pFiInfo1.clear();
+ m_pMtrFldOriginalWidth.clear();
+ m_pWidthLb.clear();
+ m_pHeightLb.clear();
+ m_pFiInfo2.clear();
+ m_pMtrFldOriginalHeight.clear();
+ m_pCbxDistrot.clear();
+ m_pMtrFldInfo1.clear();
+ m_pMtrFldInfo2.clear();
+ SfxTabPage::dispose();
}
void SdTpOptionsMisc::ActivatePage( const SfxItemSet& rSet )
@@ -331,10 +373,9 @@ SfxTabPage::sfxpg SdTpOptionsMisc::DeactivatePage( SfxItemSet* pActiveSet )
FillItemSet( pActiveSet );
return LEAVE_PAGE;
}
- WarningBox aWarnBox( GetParent(), WB_YES_NO, SD_RESSTR( STR_WARN_SCALE_FAIL ) );
- short nReturn = aWarnBox.Execute();
+ ScopedVclPtrInstance< WarningBox > aWarnBox( GetParent(), WB_YES_NO, SD_RESSTR( STR_WARN_SCALE_FAIL ) );
- if( nReturn == RET_YES )
+ if( aWarnBox->Execute() == RET_YES )
return KEEP_PAGE;
if( pActiveSet )
@@ -488,10 +529,10 @@ void SdTpOptionsMisc::Reset( const SfxItemSet* rAttrs )
UpdateCompatibilityControls ();
}
-SfxTabPage* SdTpOptionsMisc::Create( vcl::Window* pWindow,
- const SfxItemSet* rAttrs )
+VclPtr<SfxTabPage> SdTpOptionsMisc::Create( vcl::Window* pWindow,
+ const SfxItemSet* rAttrs )
{
- return new SdTpOptionsMisc( pWindow, *rAttrs );
+ return VclPtr<SdTpOptionsMisc>::Create( pWindow, *rAttrs );
}
IMPL_LINK_NOARG(SdTpOptionsMisc, SelectMetricHdl_Impl)
diff --git a/sd/source/ui/dlg/vectdlg.cxx b/sd/source/ui/dlg/vectdlg.cxx
index f533073cfe32..d7cde0582f7e 100644
--- a/sd/source/ui/dlg/vectdlg.cxx
+++ b/sd/source/ui/dlg/vectdlg.cxx
@@ -72,6 +72,22 @@ SdVectorizeDlg::SdVectorizeDlg(vcl::Window* pParent, const Bitmap& rBmp, ::sd::D
SdVectorizeDlg::~SdVectorizeDlg()
{
+ disposeOnce();
+}
+
+void SdVectorizeDlg::dispose()
+{
+ m_pNmLayers.clear();
+ m_pMtReduce.clear();
+ m_pFtFillHoles.clear();
+ m_pMtFillHoles.clear();
+ m_pCbFillHoles.clear();
+ m_pBmpWin.clear();
+ m_pMtfWin.clear();
+ m_pPrgs.clear();
+ m_pBtnOK.clear();
+ m_pBtnPreview.clear();
+ ModalDialog::dispose();
}
Rectangle SdVectorizeDlg::GetRect( const Size& rDispSize, const Size& rBmpSize ) const
diff --git a/sd/source/ui/docshell/docshel2.cxx b/sd/source/ui/docshell/docshel2.cxx
index 1646ed348244..b4e66d5caf4c 100644
--- a/sd/source/ui/docshell/docshel2.cxx
+++ b/sd/source/ui/docshell/docshel2.cxx
@@ -193,26 +193,26 @@ Bitmap DrawDocShell::GetPagePreviewBitmap(SdPage* pPage, sal_uInt16 nMaxEdgePixe
MapMode aMapMode( MAP_100TH_MM );
const Size aSize( pPage->GetSize() );
const Point aNullPt;
- VirtualDevice aVDev( *Application::GetDefaultDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev( *Application::GetDefaultDevice() );
- aVDev.SetMapMode( aMapMode );
+ pVDev->SetMapMode( aMapMode );
- const Size aPixSize( aVDev.LogicToPixel( aSize ) );
+ const Size aPixSize( pVDev->LogicToPixel( aSize ) );
const sal_uLong nMaxEdgePix = std::max( aPixSize.Width(), aPixSize.Height() );
Fraction aFrac( nMaxEdgePixel, nMaxEdgePix );
aMapMode.SetScaleX( aFrac );
aMapMode.SetScaleY( aFrac );
- aVDev.SetMapMode( aMapMode );
- aVDev.SetOutputSize( aSize );
+ pVDev->SetMapMode( aMapMode );
+ pVDev->SetOutputSize( aSize );
// that we also get the dark lines at the right and bottom page margin
aFrac = Fraction( nMaxEdgePixel - 1, nMaxEdgePix );
aMapMode.SetScaleX( aFrac );
aMapMode.SetScaleY( aFrac );
- aVDev.SetMapMode( aMapMode );
+ pVDev->SetMapMode( aMapMode );
- ClientView* pView = new ClientView( this, &aVDev, NULL );
+ ClientView* pView = new ClientView( this, pVDev, NULL );
FrameView* pFrameView = GetFrameView();
pView->ShowSdrPage( pPage );
@@ -263,14 +263,14 @@ Bitmap DrawDocShell::GetPagePreviewBitmap(SdPage* pPage, sal_uInt16 nMaxEdgePixe
pView->SetActiveLayer( pFrameView->GetActiveLayer() );
}
- pView->CompleteRedraw( &aVDev, vcl::Region(Rectangle(aNullPt, aSize)) );
+ pView->CompleteRedraw( pVDev, vcl::Region(Rectangle(aNullPt, aSize)) );
// IsRedrawReady() always gives sal_True while ( !pView->IsRedrawReady() ) {}
delete pView;
- aVDev.SetMapMode( MapMode() );
+ pVDev->SetMapMode( MapMode() );
- Bitmap aPreview( aVDev.GetBitmap( aNullPt, aVDev.GetOutputSizePixel() ) );
+ Bitmap aPreview( pVDev->GetBitmap( aNullPt, pVDev->GetOutputSizePixel() ) );
DBG_ASSERT(!!aPreview, "Preview-Bitmap could not be generated");
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index 2705eaed58b6..05edd42ed21f 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -109,7 +109,7 @@ SfxPrinter* DrawDocShell::GetPrinter(bool bCreate)
pSet->Put( SfxBoolItem( SID_PRINTER_NOTFOUND_WARN, aPrintItem.GetOptionsPrint().IsWarningPrinter() ) );
pSet->Put( aFlagItem );
- mpPrinter = new SfxPrinter(pSet);
+ mpPrinter = VclPtr<SfxPrinter>::Create(pSet);
mbOwnPrinter = true;
// set output quality
@@ -144,10 +144,8 @@ void DrawDocShell::SetPrinter(SfxPrinter *pNewPrinter)
pView->SdrEndTextEdit();
}
- if ( mpPrinter && mbOwnPrinter && (mpPrinter != pNewPrinter) )
- {
- delete mpPrinter;
- }
+ if ( mpPrinter && mbOwnPrinter && (mpPrinter.get() != pNewPrinter) )
+ mpPrinter.disposeAndClear();
mpPrinter = pNewPrinter;
mbOwnPrinter = true;
@@ -204,11 +202,11 @@ void DrawDocShell::UpdateRefDevice()
if( mpDoc )
{
// Determine the device for which the output will be formatted.
- OutputDevice* pRefDevice = NULL;
+ VclPtr< OutputDevice > pRefDevice;
switch (mpDoc->GetPrinterIndependentLayout())
{
case ::com::sun::star::document::PrinterIndependentLayout::DISABLED:
- pRefDevice = mpPrinter;
+ pRefDevice = mpPrinter.get();
break;
case ::com::sun::star::document::PrinterIndependentLayout::ENABLED:
@@ -221,10 +219,10 @@ void DrawDocShell::UpdateRefDevice()
// as a fall-back.
DBG_ASSERT(false, "DrawDocShell::UpdateRefDevice(): Unexpected printer layout mode");
- pRefDevice = mpPrinter;
+ pRefDevice = mpPrinter.get();
break;
}
- mpDoc->SetRefDevice( pRefDevice );
+ mpDoc->SetRefDevice( pRefDevice.get() );
::sd::Outliner* pOutl = mpDoc->GetOutliner( false );
@@ -1132,9 +1130,9 @@ void DrawDocShell::OpenBookmark( const OUString& rBookmarkURL )
( mpViewShell ? mpViewShell->GetViewFrame() : SfxViewFrame::Current() )->GetBindings().Execute( SID_OPENHYPERLINK, ppArgs );
}
-SfxDocumentInfoDialog* DrawDocShell::CreateDocumentInfoDialog( vcl::Window *pParent, const SfxItemSet &rSet )
+VclPtr<SfxDocumentInfoDialog> DrawDocShell::CreateDocumentInfoDialog( vcl::Window *pParent, const SfxItemSet &rSet )
{
- SfxDocumentInfoDialog* pDlg = new SfxDocumentInfoDialog( pParent, rSet );
+ VclPtr<SfxDocumentInfoDialog> pDlg = VclPtr<SfxDocumentInfoDialog>::Create( pParent, rSet );
DrawDocShell* pDocSh = PTR_CAST(DrawDocShell,SfxObjectShell::Current());
if( pDocSh == this )
diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx
index f49f523eaec5..ca32796f60db 100644
--- a/sd/source/ui/docshell/docshell.cxx
+++ b/sd/source/ui/docshell/docshell.cxx
@@ -185,7 +185,7 @@ DrawDocShell::~DrawDocShell()
delete mpUndoManager;
if (mbOwnPrinter)
- delete mpPrinter;
+ mpPrinter.disposeAndClear();
if( mbOwnDocument )
delete mpDoc;
diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx b/sd/source/ui/framework/factories/BasicViewFactory.cxx
index 21be69f667a8..065499bac8e5 100644
--- a/sd/source/ui/framework/factories/BasicViewFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx
@@ -91,7 +91,7 @@ BasicViewFactory::BasicViewFactory (
mpViewShellContainer(new ViewShellContainer()),
mpBase(NULL),
mpFrameView(NULL),
- mpWindow(new WorkWindow(NULL,WB_STDWORK)),
+ mpWindow(VclPtr<WorkWindow>::Create(nullptr,WB_STDWORK)),
mpViewCache(new ViewCache()),
mxLocalPane(new Pane(Reference<XResourceId>(), mpWindow.get()))
{
diff --git a/sd/source/ui/framework/factories/BasicViewFactory.hxx b/sd/source/ui/framework/factories/BasicViewFactory.hxx
index 6d6d89591fa3..1f4cd342bdb9 100644
--- a/sd/source/ui/framework/factories/BasicViewFactory.hxx
+++ b/sd/source/ui/framework/factories/BasicViewFactory.hxx
@@ -34,6 +34,7 @@
#include <boost/shared_ptr.hpp>
#include <boost/scoped_ptr.hpp>
+#include <vcl/vclptr.hxx>
namespace sd {
class ViewShell;
@@ -104,7 +105,7 @@ private:
FrameView* mpFrameView;
class ViewCache;
- ::boost::shared_ptr<vcl::Window> mpWindow;
+ VclPtr<vcl::Window> mpWindow;
::boost::shared_ptr<ViewCache> mpViewCache;
css::uno::Reference<css::drawing::framework::XPane> mxLocalPane;
diff --git a/sd/source/ui/framework/factories/ChildWindowPane.cxx b/sd/source/ui/framework/factories/ChildWindowPane.cxx
index 69e79836ba6f..9f70355fb5f0 100644
--- a/sd/source/ui/framework/factories/ChildWindowPane.cxx
+++ b/sd/source/ui/framework/factories/ChildWindowPane.cxx
@@ -188,7 +188,7 @@ void SAL_CALL ChildWindowPane::disposing()
Reference<awt::XWindow> SAL_CALL ChildWindowPane::getWindow()
throw (RuntimeException, std::exception)
{
- if (mpWindow == NULL || ! mxWindow.is())
+ if (mpWindow == nullptr || ! mxWindow.is())
GetWindow();
return Pane::getWindow();
}
diff --git a/sd/source/ui/framework/factories/FullScreenPane.cxx b/sd/source/ui/framework/factories/FullScreenPane.cxx
index 009975465541..ba793b25961c 100644
--- a/sd/source/ui/framework/factories/FullScreenPane.cxx
+++ b/sd/source/ui/framework/factories/FullScreenPane.cxx
@@ -46,7 +46,8 @@ FullScreenPane::FullScreenPane (
mpWorkWindow(NULL)
{
vcl::Window* pParent = NULL;
- mpWorkWindow.reset(new WorkWindow(
+ mpWorkWindow.reset(VclPtr<WorkWindow>::Create(
+
pParent,
0)); // For debugging (non-fullscreen) use WB_BORDER | WB_MOVEABLE | WB_SIZEABLE));
@@ -86,7 +87,7 @@ FullScreenPane::FullScreenPane (
// For some reason the VCL canvas can not paint into a WorkWindow.
// Therefore a child window is created that covers the WorkWindow
// completely.
- mpWindow = new vcl::Window(mpWorkWindow.get());
+ mpWindow = VclPtr<vcl::Window>::Create(mpWorkWindow.get());
mpWindow->SetPosSizePixel(Point(0,0), mpWorkWindow->GetSizePixel());
mpWindow->SetBackground(Wallpaper());
mxWindow = VCLUnoHelper::GetInterface(mpWindow);
@@ -103,11 +104,7 @@ FullScreenPane::~FullScreenPane() throw()
void SAL_CALL FullScreenPane::disposing()
{
- // We have created the window pointed to by mpWindow, we delete it.
- if (mpWindow != NULL)
- {
- delete mpWindow;
- }
+ mpWindow.disposeAndClear();
if (mpWorkWindow.get() != NULL)
{
@@ -126,7 +123,7 @@ sal_Bool SAL_CALL FullScreenPane::isVisible()
{
ThrowIfDisposed();
- if (mpWindow != NULL)
+ if (mpWindow != nullptr)
return mpWindow->IsReallyVisible();
else
return false;
@@ -137,9 +134,9 @@ void SAL_CALL FullScreenPane::setVisible (const sal_Bool bIsVisible)
{
ThrowIfDisposed();
- if (mpWindow != NULL)
+ if (mpWindow != nullptr)
mpWindow->Show(bIsVisible);
- if (mpWorkWindow != 0)
+ if (mpWorkWindow != nullptr)
mpWorkWindow->Show(bIsVisible);
}
@@ -148,7 +145,7 @@ Reference<css::accessibility::XAccessible> SAL_CALL FullScreenPane::getAccessibl
{
ThrowIfDisposed();
- if (mpWorkWindow != 0)
+ if (mpWorkWindow != nullptr)
return mpWorkWindow->GetAccessible(false);
else
return NULL;
@@ -160,7 +157,7 @@ void SAL_CALL FullScreenPane::setAccessible (
{
ThrowIfDisposed();
- if (mpWindow != NULL)
+ if (mpWindow != nullptr)
{
Reference<lang::XInitialization> xInitializable (rxAccessible, UNO_QUERY);
if (xInitializable.is())
diff --git a/sd/source/ui/framework/factories/FullScreenPane.hxx b/sd/source/ui/framework/factories/FullScreenPane.hxx
index 0c2e1afac517..7e5e839f647e 100644
--- a/sd/source/ui/framework/factories/FullScreenPane.hxx
+++ b/sd/source/ui/framework/factories/FullScreenPane.hxx
@@ -80,7 +80,7 @@ protected:
private:
css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
- ::boost::scoped_ptr<WorkWindow> mpWorkWindow;
+ VclPtr<WorkWindow> mpWorkWindow;
void ExtractArguments (
const css::uno::Reference<css::drawing::framework::XResourceId>& rxPaneId,
diff --git a/sd/source/ui/framework/factories/Pane.cxx b/sd/source/ui/framework/factories/Pane.cxx
index 0fd14c668bb2..696724e4d863 100644
--- a/sd/source/ui/framework/factories/Pane.cxx
+++ b/sd/source/ui/framework/factories/Pane.cxx
@@ -175,7 +175,7 @@ Reference<rendering::XCanvas> Pane::CreateCanvas()
{
Reference<rendering::XCanvas> xCanvas;
- if (mpWindow != NULL)
+ if (mpWindow != nullptr)
{
::cppcanvas::SpriteCanvasSharedPtr pCanvas (
cppcanvas::VCLFactory::createSpriteCanvas(*mpWindow));
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index bd21323f0984..a12d8b2ed52a 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -151,8 +151,8 @@ void FuInsertGraphic::DoExecute( SfxRequest& )
// really store as link only?
if( SvtMiscOptions().ShowLinkWarningDialog() )
{
- SvxLinkWarningDialog aWarnDlg(mpWindow,aDlg.GetPath());
- if( aWarnDlg.Execute() != RET_OK )
+ ScopedVclPtrInstance< SvxLinkWarningDialog > aWarnDlg(mpWindow,aDlg.GetPath());
+ if( aWarnDlg->Execute() != RET_OK )
return; // don't store as link
}
diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx
index 7b554d2f74d7..c0bbd9f3deeb 100644
--- a/sd/source/ui/func/fuinsfil.cxx
+++ b/sd/source/ui/func/fuinsfil.cxx
@@ -317,8 +317,8 @@ void FuInsertFile::DoExecute( SfxRequest& rReq )
if( !bInserted )
{
- MessageDialog aErrorBox(mpWindow, SD_RESSTR( STR_READ_DATA_ERROR));
- aErrorBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(mpWindow, SD_RESSTR( STR_READ_DATA_ERROR));
+ aErrorBox->Execute();
delete pMedium;
}
}
@@ -467,8 +467,8 @@ void FuInsertFile::InsTextOrRTFinDrMode(SfxMedium* pMedium)
if (nErr || pOutliner->GetEditEngine().GetText().isEmpty())
{
- MessageDialog aErrorBox(mpWindow, SD_RESSTR(STR_READ_DATA_ERROR));
- aErrorBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(mpWindow, SD_RESSTR(STR_READ_DATA_ERROR));
+ aErrorBox->Execute();
}
else
{
@@ -611,8 +611,8 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium)
if (nErr || pOutliner->GetEditEngine().GetText().isEmpty())
{
- MessageDialog aErrorBox(mpWindow, SD_RESSTR(STR_READ_DATA_ERROR));
- aErrorBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(mpWindow, SD_RESSTR(STR_READ_DATA_ERROR));
+ aErrorBox->Execute();
}
else
{
diff --git a/sd/source/ui/func/fulinend.cxx b/sd/source/ui/func/fulinend.cxx
index e8f441cc7398..b963b06e5cf8 100644
--- a/sd/source/ui/func/fulinend.cxx
+++ b/sd/source/ui/func/fulinend.cxx
@@ -138,9 +138,9 @@ void FuLineEnd::DoExecute( SfxRequest& )
}
else
{
- WarningBox aWarningBox( mpWindow, WinBits( WB_OK ),
+ ScopedVclPtrInstance<WarningBox> aWarningBox( mpWindow, WinBits( WB_OK ),
SD_RESSTR( STR_WARN_NAME_DUPLICATE ) );
- aWarningBox.Execute();
+ aWarningBox->Execute();
}
}
}
diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx
index bbccfbcaa613..a099da6dc8ed 100644
--- a/sd/source/ui/func/fupage.cxx
+++ b/sd/source/ui/func/fupage.cxx
@@ -351,13 +351,13 @@ const SfxItemSet* FuPage::ExecuteDialog( ::vcl::Window* pParent )
// notice-masterpage (at the moment)
if( ePageKind != PK_NOTES )
{
- MessBox aQuestionBox (
+ ScopedVclPtrInstance<MessBox> aQuestionBox (
pParent,
WB_YES_NO | WB_DEF_YES,
SD_RESSTR(STR_PAGE_BACKGROUND_TITLE),
SD_RESSTR(STR_PAGE_BACKGROUND_TXT) );
- aQuestionBox.SetImage( QueryBox::GetStandardImage() );
- bSetToAllPages = ( RET_YES == aQuestionBox.Execute() );
+ aQuestionBox->SetImage( QueryBox::GetStandardImage() );
+ bSetToAllPages = ( RET_YES == aQuestionBox->Execute() );
}
if( mbPageBckgrdDeleted )
diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx
index f522f6eba3f2..8ea8462ceedc 100644
--- a/sd/source/ui/func/fupoor.cxx
+++ b/sd/source/ui/func/fupoor.cxx
@@ -100,10 +100,8 @@ FuPoor::~FuPoor()
{
aDragTimer.Stop();
aScrollTimer.Stop();
- aDelayToScrollTimer.Stop ();
-
- if (pDialog)
- delete pDialog;
+ aDelayToScrollTimer.Stop();
+ pDialog.disposeAndClear();
}
void FuPoor::Activate()
@@ -130,6 +128,11 @@ void FuPoor::Deactivate()
if (mpWindow) mpWindow->ReleaseMouse ();
}
+void FuPoor::SetWindow(::sd::Window* pWin)
+{
+ mpWindow = pWin;
+}
+
/**
* scroll when approached the border of the window; is called by MouseMove
*/
diff --git a/sd/source/ui/inc/AccessibleDocumentViewBase.hxx b/sd/source/ui/inc/AccessibleDocumentViewBase.hxx
index 8c4977b243c5..674a8c6e7bc4 100644
--- a/sd/source/ui/inc/AccessibleDocumentViewBase.hxx
+++ b/sd/source/ui/inc/AccessibleDocumentViewBase.hxx
@@ -278,7 +278,7 @@ private:
protected:
/// The core window that is made accessible.
- ::sd::Window* mpWindow;
+ VclPtr<::sd::Window> mpWindow;
/// The API window that is made accessible.
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow>
diff --git a/sd/source/ui/inc/AccessibleSlideSorterView.hxx b/sd/source/ui/inc/AccessibleSlideSorterView.hxx
index 68b044ef2666..f1ac5a189f33 100644
--- a/sd/source/ui/inc/AccessibleSlideSorterView.hxx
+++ b/sd/source/ui/inc/AccessibleSlideSorterView.hxx
@@ -31,6 +31,7 @@
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/awt/XFocusListener.hpp>
#include <com/sun/star/document/XEventListener.hpp>
+#include <vcl/vclptr.hxx>
#include <memory>
@@ -288,7 +289,7 @@ private:
sal_uInt32 mnClientId;
- vcl::Window* mpContentWindow;
+ VclPtr<vcl::Window> mpContentWindow;
/** Check whether or not the object has been disposed (or is in the
state of being disposed). If that is the case then
diff --git a/sd/source/ui/inc/BreakDlg.hxx b/sd/source/ui/inc/BreakDlg.hxx
index bddf639c16a3..40c650c5ee7f 100644
--- a/sd/source/ui/inc/BreakDlg.hxx
+++ b/sd/source/ui/inc/BreakDlg.hxx
@@ -53,14 +53,15 @@ public:
sal_uLong nSumActionCount,
sal_uLong nObjCount);
virtual ~BreakDlg();
+ virtual void dispose() SAL_OVERRIDE;
short Execute() SAL_OVERRIDE;
private:
- FixedText* m_pFiObjInfo;
- FixedText* m_pFiActInfo;
- FixedText* m_pFiInsInfo;
- CancelButton* m_pBtnCancel;
+ VclPtr<FixedText> m_pFiObjInfo;
+ VclPtr<FixedText> m_pFiActInfo;
+ VclPtr<FixedText> m_pFiInsInfo;
+ VclPtr<CancelButton> m_pBtnCancel;
DrawView* pDrView;
diff --git a/sd/source/ui/inc/DrawDocShell.hxx b/sd/source/ui/inc/DrawDocShell.hxx
index df23e0a35a56..df7e337c1f1b 100644
--- a/sd/source/ui/inc/DrawDocShell.hxx
+++ b/sd/source/ui/inc/DrawDocShell.hxx
@@ -102,7 +102,7 @@ public:
virtual Size GetFirstPageSize() SAL_OVERRIDE;
virtual void FillClass(SvGlobalName* pClassName, SotClipboardFormatId* pFormat, OUString* pAppName, OUString* pFullTypeName, OUString* pShortTypeName, sal_Int32 nFileFormat, bool bTemplate = false ) const SAL_OVERRIDE;
virtual void SetModified( bool = true ) SAL_OVERRIDE;
- virtual SfxDocumentInfoDialog* CreateDocumentInfoDialog( ::vcl::Window *pParent,
+ virtual VclPtr<SfxDocumentInfoDialog> CreateDocumentInfoDialog( ::vcl::Window *pParent,
const SfxItemSet &rSet ) SAL_OVERRIDE;
using SfxObjectShell::GetVisArea;
@@ -211,7 +211,7 @@ protected:
SdDrawDocument* mpDoc;
SfxUndoManager* mpUndoManager;
- SfxPrinter* mpPrinter;
+ VclPtr<SfxPrinter> mpPrinter;
::sd::ViewShell* mpViewShell;
FontList* mpFontList;
rtl::Reference<FuPoor> mxDocShellFunction;
diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx
index 0012c2a9d7fd..a54937f2fabf 100644
--- a/sd/source/ui/inc/DrawViewShell.hxx
+++ b/sd/source/ui/inc/DrawViewShell.hxx
@@ -279,7 +279,7 @@ public:
void UnlockInput();
bool IsInputLocked() const { return mnLockCount > 0UL; }
- sal_uInt16 GetCurPageId() { return( maTabControl.GetCurPageId() ); }
+ sal_uInt16 GetCurPageId() { return maTabControl->GetCurPageId(); }
/** Show controls of the UI or hide them, depending on the given flag.
Do not call this method directly. Call the method at ViewShellBase
@@ -345,7 +345,7 @@ public:
/** Return a pointer to the tab control for pages.
*/
- TabControl& GetPageTabControl() { return maTabControl;}
+ TabControl& GetPageTabControl() { return *maTabControl.get(); }
/** Return a pointer to the tab control for layers.
*/
@@ -384,7 +384,7 @@ protected:
Rectangle maMarkRect;
Point maMousePos;
bool mbMousePosFreezed;
- TabControl maTabControl;
+ VclPtr<TabControl> maTabControl;
EditMode meEditMode;
PageKind mePageKind;
bool mbZoomOnPage;
diff --git a/sd/source/ui/inc/FormShellManager.hxx b/sd/source/ui/inc/FormShellManager.hxx
index ef8a4212dcea..0c9c19660e6c 100644
--- a/sd/source/ui/inc/FormShellManager.hxx
+++ b/sd/source/ui/inc/FormShellManager.hxx
@@ -24,6 +24,7 @@
#include <tools/link.hxx>
#include <svl/lstner.hxx>
+#include <vcl/vclptr.hxx>
class VclWindowEvent;
class FmFormShell;
@@ -89,7 +90,7 @@ private:
bool mbIsMainViewChangePending;
- vcl::Window* mpMainViewShellWindow;
+ VclPtr<vcl::Window> mpMainViewShellWindow;
/** Register at window of center pane and at the form shell that
represents the form tool bar. The former informs this manager about
diff --git a/sd/source/ui/inc/OutlineBulletDlg.hxx b/sd/source/ui/inc/OutlineBulletDlg.hxx
index 19ae1f8cad0e..5a88788bfc73 100644
--- a/sd/source/ui/inc/OutlineBulletDlg.hxx
+++ b/sd/source/ui/inc/OutlineBulletDlg.hxx
@@ -38,6 +38,7 @@ public:
const SfxItemSet* pAttr,
::sd::View* pView );
virtual ~OutlineBulletDlg ();
+ virtual void dispose() SAL_OVERRIDE;
const SfxItemSet* GetOutputItemSet() const;
diff --git a/sd/source/ui/inc/PreviewRenderer.hxx b/sd/source/ui/inc/PreviewRenderer.hxx
index ec7c5fadcadc..7784b00630c7 100644
--- a/sd/source/ui/inc/PreviewRenderer.hxx
+++ b/sd/source/ui/inc/PreviewRenderer.hxx
@@ -126,7 +126,7 @@ protected:
virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) SAL_OVERRIDE;
private:
- ::std::unique_ptr<VirtualDevice> mpPreviewDevice;
+ ScopedVclPtr<VirtualDevice> mpPreviewDevice;
::std::unique_ptr<DrawView> mpView;
DrawDocShell* mpDocShellOfView;
const Color maFrameColor;
diff --git a/sd/source/ui/inc/Ruler.hxx b/sd/source/ui/inc/Ruler.hxx
index 64d214f77420..9186ebdf3f0e 100644
--- a/sd/source/ui/inc/Ruler.hxx
+++ b/sd/source/ui/inc/Ruler.hxx
@@ -41,6 +41,7 @@ public:
SfxBindings& rBindings,
WinBits nWinStyle);
virtual ~Ruler();
+ virtual void dispose() SAL_OVERRIDE;
void SetNullOffset(const Point& rOffset);
@@ -49,7 +50,7 @@ public:
using ::Ruler::SetNullOffset;
protected:
::sd::View* pSdView;
- ::sd::Window* pSdWin;
+ VclPtr<::sd::Window> pSdWin;
DrawViewShell* pDrViewShell;
RulerCtrlItem* pCtrlItem;
bool bHorz;
diff --git a/sd/source/ui/inc/SlideSorter.hxx b/sd/source/ui/inc/SlideSorter.hxx
index 8854e242eee1..940ec902a27d 100644
--- a/sd/source/ui/inc/SlideSorter.hxx
+++ b/sd/source/ui/inc/SlideSorter.hxx
@@ -29,6 +29,7 @@
#include <boost/shared_ptr.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/current_function.hpp>
+#include <vcl/scrbar.hxx>
class ScrollBar;
class ScrollBarBox;
@@ -55,8 +56,6 @@ class SlotManager;
class Properties;
} } }
-typedef ::boost::shared_ptr<sd::Window> SharedSdWindow;
-
namespace sd { namespace slidesorter {
/** Show previews for all the slides in a document and allow the user to
@@ -98,10 +97,10 @@ public:
*/
static ::boost::shared_ptr<SlideSorter> CreateSlideSorter (
ViewShell& rViewShell,
- const ::boost::shared_ptr<sd::Window>& rpContentWindow,
- const ::boost::shared_ptr<ScrollBar>& rpHorizontalScrollBar,
- const ::boost::shared_ptr<ScrollBar>& rpVerticalScrollBar,
- const ::boost::shared_ptr<ScrollBarBox>& rpScrollBarBox);
+ sd::Window* pContentWindow,
+ ScrollBar* pHorizontalScrollBar,
+ ScrollBar* pVerticalScrollBar,
+ ScrollBarBox* pScrollBarBox);
/** Create a new slide sorter that is losely coupled to the given view
shell. The view shell may even be missing.
@@ -120,21 +119,21 @@ public:
/** Return the control of the vertical scroll bar.
*/
- ::boost::shared_ptr<ScrollBar> GetVerticalScrollBar() const { return mpVerticalScrollBar;}
+ VclPtr<ScrollBar> GetVerticalScrollBar() const { return mpVerticalScrollBar;}
/** Return the control of the horizontal scroll bar.
*/
- ::boost::shared_ptr<ScrollBar> GetHorizontalScrollBar() const { return mpHorizontalScrollBar;}
+ VclPtr<ScrollBar> GetHorizontalScrollBar() const { return mpHorizontalScrollBar;}
/** Return the scroll bar filler that paints the little square that is
enclosed by the two scroll bars.
*/
- ::boost::shared_ptr<ScrollBarBox> GetScrollBarFiller() const { return mpScrollBarBox;}
+ VclPtr<ScrollBarBox> GetScrollBarFiller (void) const { return mpScrollBarBox;}
/** Return the content window. This is a sibling and is geometrically
enclosed by the scroll bars.
*/
- SharedSdWindow GetContentWindow() const { return mpContentWindow;}
+ VclPtr<sd::Window> GetContentWindow() const { return mpContentWindow;}
model::SlideSorterModel& GetModel() const;
@@ -222,11 +221,11 @@ private:
::com::sun::star::uno::WeakReference<com::sun::star::frame::XController> mxControllerWeak;
ViewShell* mpViewShell;
ViewShellBase* mpViewShellBase;
- SharedSdWindow mpContentWindow;
+ VclPtr<sd::Window> mpContentWindow;
bool mbOwnesContentWindow;
- ::boost::shared_ptr<ScrollBar> mpHorizontalScrollBar;
- ::boost::shared_ptr<ScrollBar> mpVerticalScrollBar;
- ::boost::shared_ptr<ScrollBarBox> mpScrollBarBox;
+ VclPtr<ScrollBar> mpHorizontalScrollBar;
+ VclPtr<ScrollBar> mpVerticalScrollBar;
+ VclPtr<ScrollBarBox> mpScrollBarBox;
/** Set this flag to <TRUE/> to force a layout before the next paint.
*/
@@ -240,10 +239,10 @@ private:
SlideSorter (
ViewShell& rViewShell,
- const ::boost::shared_ptr<sd::Window>& rpContentWindow,
- const ::boost::shared_ptr<ScrollBar>& rpHorizontalScrollBar,
- const ::boost::shared_ptr<ScrollBar>& rpVerticalScrollBar,
- const ::boost::shared_ptr<ScrollBarBox>& rpScrollBarBox);
+ sd::Window* pContentWindow,
+ ScrollBar* pHorizontalScrollBar,
+ ScrollBar* pVerticalScrollBar,
+ ScrollBarBox* pScrollBarBox);
SlideSorter (
ViewShellBase& rBase,
ViewShell* pViewShell,
diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx
index 1b22016d93e2..f4823faa8cdd 100644
--- a/sd/source/ui/inc/View.hxx
+++ b/sd/source/ui/inc/View.hxx
@@ -59,8 +59,8 @@ class ViewClipboard;
// SdViewRedrawRec
struct SdViewRedrawRec
{
- OutputDevice* mpOut;
- Rectangle aRect;
+ VclPtr<OutputDevice> mpOut;
+ Rectangle aRect;
};
//For master view we want to force that master
diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx
index 1b46129e1087..53ffbfd756f7 100644
--- a/sd/source/ui/inc/ViewShell.hxx
+++ b/sd/source/ui/inc/ViewShell.hxx
@@ -465,26 +465,26 @@ protected:
document.
*/
- ::boost::shared_ptr<sd::Window> mpContentWindow;
+ VclPtr<sd::Window> mpContentWindow;
/// Horizontal scroll bar for the current slide is displayed when needed.
- ::boost::shared_ptr<ScrollBar> mpHorizontalScrollBar;
+ VclPtr<ScrollBar> mpHorizontalScrollBar;
/// Vertical scroll bar for whole document is always visible.
- ::boost::shared_ptr<ScrollBar> mpVerticalScrollBar;
+ VclPtr<ScrollBar> mpVerticalScrollBar;
/// Horizontal ruler is not shown by default.
- ::std::unique_ptr<SvxRuler> mpHorizontalRuler;
+ VclPtr<SvxRuler> mpHorizontalRuler;
/// Vertical ruler is not shown by default.
- ::std::unique_ptr<SvxRuler> mpVerticalRuler;
+ VclPtr<SvxRuler> mpVerticalRuler;
/// Filler of the little square enclosed by the two scroll bars.
- ::boost::shared_ptr<ScrollBarBox> mpScrollBarBox;
+ VclPtr<ScrollBarBox> mpScrollBarBox;
/// Layer tab bar.
- ::std::unique_ptr<LayerTabBar> mpLayerTabBar;
+ VclPtr<LayerTabBar> mpLayerTabBar;
/// This flag controls whether the rulers are visible.
bool mbHasRulers;
/// The active window.
- ::sd::Window* mpActiveWindow;
+ VclPtr<::sd::Window> mpActiveWindow;
::sd::View* mpView;
FrameView* mpFrameView;
@@ -568,7 +568,7 @@ protected:
void doShow();
private:
- ::vcl::Window* mpParentWindow;
+ VclPtr<::vcl::Window> mpParentWindow;
/** This window updater is used to keep all relevant windows up to date
with reference to the digit language used to display digits in text
shapes.
diff --git a/sd/source/ui/inc/ViewTabBar.hxx b/sd/source/ui/inc/ViewTabBar.hxx
index f3b40694cc33..82ed1d584df2 100644
--- a/sd/source/ui/inc/ViewTabBar.hxx
+++ b/sd/source/ui/inc/ViewTabBar.hxx
@@ -67,7 +67,7 @@ public:
virtual void SAL_CALL disposing() SAL_OVERRIDE;
- ::boost::shared_ptr< ::TabControl> GetTabControl() const { return mpTabControl;}
+ VclPtr<::TabControl> GetTabControl() const { return mpTabControl;}
bool ActivatePage();
@@ -149,14 +149,14 @@ public:
GetTabBarButtons();
private:
- ::boost::shared_ptr< ::TabControl> mpTabControl;
+ VclPtr< ::TabControl> mpTabControl;
::com::sun::star::uno::Reference<
::com::sun::star::frame::XController> mxController;
::com::sun::star::uno::Reference<
::com::sun::star::drawing::framework::XConfigurationController> mxConfigurationController;
typedef ::std::vector<com::sun::star::drawing::framework::TabBarButton> TabBarButtonList;
TabBarButtonList maTabBarButtons;
- ::boost::scoped_ptr<TabPage> mpTabPage;
+ VclPtr<TabPage> mpTabPage;
::com::sun::star::uno::Reference<
::com::sun::star::drawing::framework::XResourceId> mxViewTabBarId;
ViewShellBase* mpViewShellBase;
diff --git a/sd/source/ui/inc/Window.hxx b/sd/source/ui/inc/Window.hxx
index 718c17842a5b..bd83e2146491 100644
--- a/sd/source/ui/inc/Window.hxx
+++ b/sd/source/ui/inc/Window.hxx
@@ -45,7 +45,8 @@ class Window
{
public:
Window (vcl::Window* pParent);
- virtual ~Window();
+ virtual ~Window ();
+ virtual void dispose() SAL_OVERRIDE;
void SetViewShell (ViewShell* pViewSh);
@@ -149,7 +150,7 @@ public:
void DropScroll (const Point& rMousePos);
virtual void KeyInput(const KeyEvent& rKEvt) SAL_OVERRIDE;
protected:
- ::sd::Window* mpShareWin;
+ VclPtr<::sd::Window> mpShareWin;
Point maWinPos;
Point maViewOrigin;
Size maViewSize;
diff --git a/sd/source/ui/inc/WindowUpdater.hxx b/sd/source/ui/inc/WindowUpdater.hxx
index f7f2a1830a64..626dda1bbe34 100644
--- a/sd/source/ui/inc/WindowUpdater.hxx
+++ b/sd/source/ui/inc/WindowUpdater.hxx
@@ -22,6 +22,7 @@
#include <svl/lstner.hxx>
#include <svl/ctloptions.hxx>
+#include <vcl/vclptr.hxx>
#include "sddllapi.h"
#include <vector>
@@ -120,7 +121,7 @@ private:
/** Type and data member for a list of devices that have to be kept
up-to-date.
*/
- typedef ::std::vector< vcl::Window*> tWindowList;
+ typedef ::std::vector< VclPtr<vcl::Window> > tWindowList;
tWindowList maWindowList;
/** The central method of this class. Update the given output device.
diff --git a/sd/source/ui/inc/animobjs.hxx b/sd/source/ui/inc/animobjs.hxx
index 45a9a3e8d354..20f3ffeccddd 100644
--- a/sd/source/ui/inc/animobjs.hxx
+++ b/sd/source/ui/inc/animobjs.hxx
@@ -85,6 +85,7 @@ class AnimationWindow : public SfxDockingWindow
public:
AnimationWindow(SfxBindings* pBindings, SfxChildWindow *pCW, vcl::Window* pParent);
virtual ~AnimationWindow();
+ virtual void dispose() SAL_OVERRIDE;
void AddObj( ::sd::View& rView );
void CreateAnimObj( ::sd::View& rView );
@@ -97,28 +98,28 @@ protected:
virtual void FillInfo( SfxChildWinInfo& ) const SAL_OVERRIDE;
private:
- SdDisplay* m_pCtlDisplay;
- PushButton* m_pBtnFirst;
- PushButton* m_pBtnReverse;
- PushButton* m_pBtnStop;
- PushButton* m_pBtnPlay;
- PushButton* m_pBtnLast;
- NumericField* m_pNumFldBitmap;
- TimeField* m_pTimeField;
- ListBox* m_pLbLoopCount;
- PushButton* m_pBtnGetOneObject;
- PushButton* m_pBtnGetAllObjects;
- PushButton* m_pBtnRemoveBitmap;
- PushButton* m_pBtnRemoveAll;
- FixedText* m_pFiCount;
-
- RadioButton* m_pRbtGroup;
- RadioButton* m_pRbtBitmap;
- FixedText* m_pFtAdjustment;
- ListBox* m_pLbAdjustment;
- PushButton* m_pBtnCreateGroup;
-
- vcl::Window* pWin;
+ VclPtr<SdDisplay> m_pCtlDisplay;
+ VclPtr<PushButton> m_pBtnFirst;
+ VclPtr<PushButton> m_pBtnReverse;
+ VclPtr<PushButton> m_pBtnStop;
+ VclPtr<PushButton> m_pBtnPlay;
+ VclPtr<PushButton> m_pBtnLast;
+ VclPtr<NumericField> m_pNumFldBitmap;
+ VclPtr<TimeField> m_pTimeField;
+ VclPtr<ListBox> m_pLbLoopCount;
+ VclPtr<PushButton> m_pBtnGetOneObject;
+ VclPtr<PushButton> m_pBtnGetAllObjects;
+ VclPtr<PushButton> m_pBtnRemoveBitmap;
+ VclPtr<PushButton> m_pBtnRemoveAll;
+ VclPtr<FixedText> m_pFiCount;
+
+ VclPtr<RadioButton> m_pRbtGroup;
+ VclPtr<RadioButton> m_pRbtBitmap;
+ VclPtr<FixedText> m_pFtAdjustment;
+ VclPtr<ListBox> m_pLbAdjustment;
+ VclPtr<PushButton> m_pBtnCreateGroup;
+
+ VclPtr<vcl::Window> pWin;
::std::vector< ::std::pair<BitmapEx*, ::tools::Time*> > m_FrameList;
static const size_t EMPTY_FRAMELIST;
size_t m_nCurrentFrame;
@@ -163,7 +164,7 @@ protected:
virtual void StateChanged( sal_uInt16 nSId, SfxItemState eState,
const SfxPoolItem* pState ) SAL_OVERRIDE;
private:
- AnimationWindow* pAnimationWin;
+ VclPtr<AnimationWindow> pAnimationWin;
};
} // end of namespace sd
diff --git a/sd/source/ui/inc/assclass.hxx b/sd/source/ui/inc/assclass.hxx
index 3e95415d7a9d..6a0709da717a 100644
--- a/sd/source/ui/inc/assclass.hxx
+++ b/sd/source/ui/inc/assclass.hxx
@@ -33,7 +33,7 @@ class SD_DLLPUBLIC Assistent
{
/** contains for every page the controls, which have to be
connected? correctly */
- std::vector<vcl::Window*> maPages[MAX_PAGES];
+ std::vector<VclPtr<vcl::Window> > maPages[MAX_PAGES];
/// number of pages
int mnPages;
diff --git a/sd/source/ui/inc/copydlg.hxx b/sd/source/ui/inc/copydlg.hxx
index 7a9d696f62e1..1da44c927a6c 100644
--- a/sd/source/ui/inc/copydlg.hxx
+++ b/sd/source/ui/inc/copydlg.hxx
@@ -42,26 +42,27 @@ public:
CopyDlg( vcl::Window* pWindow, const SfxItemSet& rInAttrs,
const XColorListRef &pColList, ::sd::View* pView );
virtual ~CopyDlg();
+ virtual void dispose() SAL_OVERRIDE;
void GetAttr( SfxItemSet& rOutAttrs );
void Reset();
private:
- NumericField* m_pNumFldCopies;
- Button* m_pBtnSetViewData;
+ VclPtr<NumericField> m_pNumFldCopies;
+ VclPtr<Button> m_pBtnSetViewData;
- MetricField* m_pMtrFldMoveX;
- MetricField* m_pMtrFldMoveY;
- MetricField* m_pMtrFldAngle;
+ VclPtr<MetricField> m_pMtrFldMoveX;
+ VclPtr<MetricField> m_pMtrFldMoveY;
+ VclPtr<MetricField> m_pMtrFldAngle;
- MetricField* m_pMtrFldWidth;
- MetricField* m_pMtrFldHeight;
+ VclPtr<MetricField> m_pMtrFldWidth;
+ VclPtr<MetricField> m_pMtrFldHeight;
- ColorLB* m_pLbStartColor;
- FixedText* m_pFtEndColor;
- ColorLB* m_pLbEndColor;
+ VclPtr<ColorLB> m_pLbStartColor;
+ VclPtr<FixedText> m_pFtEndColor;
+ VclPtr<ColorLB> m_pLbEndColor;
- PushButton* m_pBtnSetDefault;
+ VclPtr<PushButton> m_pBtnSetDefault;
const SfxItemSet& mrOutAttrs;
XColorListRef mpColorList;
diff --git a/sd/source/ui/inc/createtabledesignpanel.hxx b/sd/source/ui/inc/createtabledesignpanel.hxx
index 2d8f1c36f504..44fc06e19334 100644
--- a/sd/source/ui/inc/createtabledesignpanel.hxx
+++ b/sd/source/ui/inc/createtabledesignpanel.hxx
@@ -21,10 +21,11 @@
#define INCLUDED_SD_SOURCE_UI_INC_CREATETABLEDESIGNPANEL_HXX
#include <sal/config.h>
+#include <vcl/vclptr.hxx>
namespace sd {
-::vcl::Window * createTableDesignPanel (::vcl::Window* pParent, ViewShellBase& rBase);
+VclPtr<::vcl::Window> createTableDesignPanel (::vcl::Window* pParent, ViewShellBase& rBase);
}
diff --git a/sd/source/ui/inc/custsdlg.hxx b/sd/source/ui/inc/custsdlg.hxx
index 54f1cfe6b73b..4fcbc7d54c75 100644
--- a/sd/source/ui/inc/custsdlg.hxx
+++ b/sd/source/ui/inc/custsdlg.hxx
@@ -34,15 +34,15 @@ class SdCustomShowList;
class SdCustomShowDlg : public ModalDialog
{
private:
- ListBox* m_pLbCustomShows;
- CheckBox* m_pCbxUseCustomShow;
- PushButton* m_pBtnNew;
- PushButton* m_pBtnEdit;
- PushButton* m_pBtnRemove;
- PushButton* m_pBtnCopy;
- HelpButton* m_pBtnHelp;
- PushButton* m_pBtnStartShow;
- OKButton* m_pBtnOK;
+ VclPtr<ListBox> m_pLbCustomShows;
+ VclPtr<CheckBox> m_pCbxUseCustomShow;
+ VclPtr<PushButton> m_pBtnNew;
+ VclPtr<PushButton> m_pBtnEdit;
+ VclPtr<PushButton> m_pBtnRemove;
+ VclPtr<PushButton> m_pBtnCopy;
+ VclPtr<HelpButton> m_pBtnHelp;
+ VclPtr<PushButton> m_pBtnStartShow;
+ VclPtr<OKButton> m_pBtnOK;
SdDrawDocument& rDoc;
SdCustomShowList* pCustomShowList;
@@ -57,22 +57,22 @@ private:
public:
SdCustomShowDlg( vcl::Window* pWindow, SdDrawDocument& rDrawDoc );
virtual ~SdCustomShowDlg();
-
- bool IsModified() const { return bModified; }
- bool IsCustomShow() const;
+ virtual void dispose() SAL_OVERRIDE;
+ bool IsModified() const { return bModified; }
+ bool IsCustomShow() const;
};
class SdDefineCustomShowDlg : public ModalDialog
{
private:
- Edit* m_pEdtName;
- ListBox* m_pLbPages;
- PushButton* m_pBtnAdd;
- PushButton* m_pBtnRemove;
- SvTreeListBox* m_pLbCustomPages;
- OKButton* m_pBtnOK;
- CancelButton* m_pBtnCancel;
- HelpButton* m_pBtnHelp;
+ VclPtr<Edit> m_pEdtName;
+ VclPtr<ListBox> m_pLbPages;
+ VclPtr<PushButton> m_pBtnAdd;
+ VclPtr<PushButton> m_pBtnRemove;
+ VclPtr<SvTreeListBox> m_pLbCustomPages;
+ VclPtr<OKButton> m_pBtnOK;
+ VclPtr<CancelButton> m_pBtnCancel;
+ VclPtr<HelpButton> m_pBtnHelp;
SdDrawDocument& rDoc;
SdCustomShow*& rpCustomShow;
@@ -90,6 +90,7 @@ public:
SdDefineCustomShowDlg( vcl::Window* pWindow,
SdDrawDocument& rDrawDoc, SdCustomShow*& rpCS );
virtual ~SdDefineCustomShowDlg();
+ virtual void dispose() SAL_OVERRIDE;
bool IsModified() const { return bModified; }
};
diff --git a/sd/source/ui/inc/diactrl.hxx b/sd/source/ui/inc/diactrl.hxx
index fdb61e8dca23..a6f6006445ad 100644
--- a/sd/source/ui/inc/diactrl.hxx
+++ b/sd/source/ui/inc/diactrl.hxx
@@ -55,7 +55,7 @@ class SdTbxCtlDiaPages : public SfxToolBoxControl
public:
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState ) SAL_OVERRIDE;
- virtual vcl::Window* CreateItemWindow( vcl::Window *pParent ) SAL_OVERRIDE;
+ virtual VclPtr<vcl::Window> CreateItemWindow( vcl::Window *pParent ) SAL_OVERRIDE;
SFX_DECL_TOOLBOX_CONTROL();
diff --git a/sd/source/ui/inc/dlgass.hxx b/sd/source/ui/inc/dlgass.hxx
index 4ee19ec4abe2..b9f9136e2fd3 100644
--- a/sd/source/ui/inc/dlgass.hxx
+++ b/sd/source/ui/inc/dlgass.hxx
@@ -43,6 +43,7 @@ private:
public:
AssistentDlg(vcl::Window* pParent, bool bAutoPilot);
virtual ~AssistentDlg();
+ virtual void dispose() SAL_OVERRIDE;
DECL_LINK( FinishHdl, void * );
diff --git a/sd/source/ui/inc/dlgctrls.hxx b/sd/source/ui/inc/dlgctrls.hxx
index daa1ad28ac4f..5cb90587b76b 100644
--- a/sd/source/ui/inc/dlgctrls.hxx
+++ b/sd/source/ui/inc/dlgctrls.hxx
@@ -37,7 +37,8 @@ class SD_DLLPUBLIC FadeEffectLB : public ListBox
public:
FadeEffectLB(vcl::Window* pParent, WinBits nStyle);
virtual ~FadeEffectLB();
- void Fill();
+ virtual void dispose() SAL_OVERRIDE;
+ void Fill();
/* void selectEffectFromPage( SdPage* pPage ); */
void applySelected( SdPage* pSlide ) const;
diff --git a/sd/source/ui/inc/dlgfield.hxx b/sd/source/ui/inc/dlgfield.hxx
index b458b8df84b9..fe11b0768b45 100644
--- a/sd/source/ui/inc/dlgfield.hxx
+++ b/sd/source/ui/inc/dlgfield.hxx
@@ -34,10 +34,10 @@ class SvxFieldData;
class SdModifyFieldDlg : public ModalDialog
{
private:
- RadioButton* m_pRbtFix;
- RadioButton* m_pRbtVar;
- SvxLanguageBox* m_pLbLanguage;
- ListBox* m_pLbFormat;
+ VclPtr<RadioButton> m_pRbtFix;
+ VclPtr<RadioButton> m_pRbtVar;
+ VclPtr<SvxLanguageBox> m_pLbLanguage;
+ VclPtr<ListBox> m_pLbFormat;
SfxItemSet maInputSet;
const SvxFieldData* pField;
@@ -49,7 +49,8 @@ private:
public:
SdModifyFieldDlg( vcl::Window* pWindow, const SvxFieldData* pInField, const SfxItemSet& rSet );
- virtual ~SdModifyFieldDlg() {}
+ virtual ~SdModifyFieldDlg();
+ virtual void dispose() SAL_OVERRIDE;
SvxFieldData* GetField();
SfxItemSet GetItemSet();
diff --git a/sd/source/ui/inc/dlgsnap.hxx b/sd/source/ui/inc/dlgsnap.hxx
index ab431c856be3..f17a7c5c3413 100644
--- a/sd/source/ui/inc/dlgsnap.hxx
+++ b/sd/source/ui/inc/dlgsnap.hxx
@@ -41,15 +41,15 @@ namespace sd {
class SdSnapLineDlg : public ModalDialog
{
private:
- FixedText* m_pFtX;
- MetricField* m_pMtrFldX;
- FixedText* m_pFtY;
- MetricField* m_pMtrFldY;
- VclContainer* m_pRadioGroup;
- RadioButton* m_pRbPoint;
- RadioButton* m_pRbVert;
- RadioButton* m_pRbHorz;
- PushButton* m_pBtnDelete;
+ VclPtr<FixedText> m_pFtX;
+ VclPtr<MetricField> m_pMtrFldX;
+ VclPtr<FixedText> m_pFtY;
+ VclPtr<MetricField> m_pMtrFldY;
+ VclPtr<VclContainer> m_pRadioGroup;
+ VclPtr<RadioButton> m_pRbPoint;
+ VclPtr<RadioButton> m_pRbVert;
+ VclPtr<RadioButton> m_pRbHorz;
+ VclPtr<PushButton> m_pBtnDelete;
long nXValue;
long nYValue;
FieldUnit eUIUnit;
@@ -59,6 +59,8 @@ private:
public:
SdSnapLineDlg(vcl::Window* pWindow, const SfxItemSet& rInAttrs, ::sd::View* pView);
+ virtual ~SdSnapLineDlg();
+ virtual void dispose() SAL_OVERRIDE;
void GetAttr(SfxItemSet& rOutAttrs);
diff --git a/sd/source/ui/inc/docprev.hxx b/sd/source/ui/inc/docprev.hxx
index b4d3b28a8c73..ea1e5876211d 100644
--- a/sd/source/ui/inc/docprev.hxx
+++ b/sd/source/ui/inc/docprev.hxx
@@ -65,6 +65,7 @@ protected:
public:
SdDocPreviewWin( vcl::Window* pParent, const WinBits nStyle );
virtual ~SdDocPreviewWin();
+ virtual void dispose() SAL_OVERRIDE;
void SetObjectShell( SfxObjectShell* pObj, sal_uInt16 nShowPage = 0 );
virtual void Resize() SAL_OVERRIDE;
void startPreview();
diff --git a/sd/source/ui/inc/drawview.hxx b/sd/source/ui/inc/drawview.hxx
index 7d4ad1c6780a..d9fc8b5b7ec1 100644
--- a/sd/source/ui/inc/drawview.hxx
+++ b/sd/source/ui/inc/drawview.hxx
@@ -65,7 +65,7 @@ protected:
private:
DrawDocShell* mpDocShell;
DrawViewShell* mpDrawViewShell;
- VirtualDevice* mpVDev;
+ VclPtr<VirtualDevice> mpVDev;
sal_uInt16 mnPOCHSmph; ///< for blocking PageOrderChangedHint
};
diff --git a/sd/source/ui/inc/framework/Pane.hxx b/sd/source/ui/inc/framework/Pane.hxx
index e9c94df151db..a38ae7bb1103 100644
--- a/sd/source/ui/inc/framework/Pane.hxx
+++ b/sd/source/ui/inc/framework/Pane.hxx
@@ -29,6 +29,7 @@
#include <cppuhelper/compbase3.hxx>
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
+#include <vcl/vclptr.hxx>
namespace vcl { class Window; }
@@ -135,7 +136,7 @@ public:
protected:
::com::sun::star::uno::Reference<com::sun::star::drawing::framework::XResourceId> mxPaneId;
- vcl::Window* mpWindow;
+ VclPtr<vcl::Window> mpWindow;
::com::sun::star::uno::Reference<com::sun::star::awt::XWindow> mxWindow;
::com::sun::star::uno::Reference<com::sun::star::rendering::XCanvas> mxCanvas;
diff --git a/sd/source/ui/inc/fupoor.hxx b/sd/source/ui/inc/fupoor.hxx
index 9f50c75ed925..f127a167bf8e 100644
--- a/sd/source/ui/inc/fupoor.hxx
+++ b/sd/source/ui/inc/fupoor.hxx
@@ -82,7 +82,7 @@ public:
virtual void Activate(); ///< activates the function
virtual void Deactivate(); ///< deactivates the function
- void SetWindow(::sd::Window* pWin) { mpWindow = pWin; }
+ void SetWindow(::sd::Window* pWin);
virtual void SelectionHasChanged();
@@ -150,14 +150,14 @@ protected:
::sd::View* mpView;
ViewShell* mpViewShell;
- ::sd::Window* mpWindow;
+ VclPtr<::sd::Window> mpWindow;
DrawDocShell* mpDocSh;
SdDrawDocument* mpDoc;
sal_uInt16 nSlotId;
sal_uInt16 nSlotValue;
- Dialog* pDialog;
+ VclPtr<Dialog> pDialog;
Timer aScrollTimer; ///< for auto-scrolling
DECL_LINK( ScrollHdl, void * );
diff --git a/sd/source/ui/inc/gluectrl.hxx b/sd/source/ui/inc/gluectrl.hxx
index d3b2e0a8055b..fde273c0aaa3 100644
--- a/sd/source/ui/inc/gluectrl.hxx
+++ b/sd/source/ui/inc/gluectrl.hxx
@@ -51,7 +51,7 @@ private:
public:
virtual void StateChanged( sal_uInt16 nSId, SfxItemState eState,
const SfxPoolItem* pState ) SAL_OVERRIDE;
- virtual vcl::Window* CreateItemWindow( vcl::Window *pParent ) SAL_OVERRIDE;
+ virtual VclPtr<vcl::Window> CreateItemWindow( vcl::Window *pParent ) SAL_OVERRIDE;
SFX_DECL_TOOLBOX_CONTROL();
diff --git a/sd/source/ui/inc/headerfooterdlg.hxx b/sd/source/ui/inc/headerfooterdlg.hxx
index 6f19a555b962..4206cd4dc62b 100644
--- a/sd/source/ui/inc/headerfooterdlg.hxx
+++ b/sd/source/ui/inc/headerfooterdlg.hxx
@@ -44,17 +44,17 @@ private:
DECL_LINK( ClickApplyHdl, void * );
DECL_LINK( ClickCancelHdl, void * );
- TabControl* mpTabCtrl;
+ VclPtr<TabControl> mpTabCtrl;
- HeaderFooterTabPage* mpSlideTabPage;
- HeaderFooterTabPage* mpNotesHandoutsTabPage;
+ VclPtr<HeaderFooterTabPage> mpSlideTabPage;
+ VclPtr<HeaderFooterTabPage> mpNotesHandoutsTabPage;
sal_uInt16 mnSlidesId;
sal_uInt16 mnNotesId;
- PushButton* maPBApplyToAll;
- PushButton* maPBApply;
- CancelButton* maPBCancel;
+ VclPtr<PushButton> maPBApplyToAll;
+ VclPtr<PushButton> maPBApply;
+ VclPtr<CancelButton> maPBCancel;
HeaderFooterSettings maSlideSettings;
HeaderFooterSettings maNotesHandoutSettings;
@@ -69,6 +69,7 @@ private:
public:
HeaderFooterDialog( ViewShell* pViewShell, vcl::Window* pParent, SdDrawDocument* pDoc, SdPage* pCurrentPage );
virtual ~HeaderFooterDialog();
+ virtual void dispose() SAL_OVERRIDE;
void ApplyToAll();
void Apply();
diff --git a/sd/source/ui/inc/ins_paste.hxx b/sd/source/ui/inc/ins_paste.hxx
index 0cd396f4c31a..78362535242b 100644
--- a/sd/source/ui/inc/ins_paste.hxx
+++ b/sd/source/ui/inc/ins_paste.hxx
@@ -31,11 +31,13 @@
class SD_DLLPUBLIC SdInsertPasteDlg : public ModalDialog
{
private:
- RadioButton* m_pRbBefore;
- RadioButton* m_pRbAfter;
+ VclPtr<RadioButton> m_pRbBefore;
+ VclPtr<RadioButton> m_pRbAfter;
public:
SdInsertPasteDlg( vcl::Window* pWindow );
+ virtual ~SdInsertPasteDlg();
+ virtual void dispose() SAL_OVERRIDE;
bool IsInsertBefore() const;
};
diff --git a/sd/source/ui/inc/inspagob.hxx b/sd/source/ui/inc/inspagob.hxx
index f7a0e12ae859..7dd1c7541b94 100644
--- a/sd/source/ui/inc/inspagob.hxx
+++ b/sd/source/ui/inc/inspagob.hxx
@@ -29,9 +29,9 @@ class SdDrawDocument;
class SdInsertPagesObjsDlg : public ModalDialog
{
private:
- SdPageObjsTLB* m_pLbTree;
- CheckBox* m_pCbxLink;
- CheckBox* m_pCbxMasters;
+ VclPtr<SdPageObjsTLB> m_pLbTree;
+ VclPtr<CheckBox> m_pCbxLink;
+ VclPtr<CheckBox> m_pCbxMasters;
SfxMedium* pMedium;
const SdDrawDocument* mpDoc;
@@ -46,6 +46,7 @@ public:
SfxMedium* pSfxMedium,
const OUString& rFileName );
virtual ~SdInsertPagesObjsDlg();
+ virtual void dispose() SAL_OVERRIDE;
/** returns the list
nType == 0 -> pages
diff --git a/sd/source/ui/inc/layeroptionsdlg.hxx b/sd/source/ui/inc/layeroptionsdlg.hxx
index e3ad80873223..ec0b1d24ad30 100644
--- a/sd/source/ui/inc/layeroptionsdlg.hxx
+++ b/sd/source/ui/inc/layeroptionsdlg.hxx
@@ -35,12 +35,12 @@ class SfxItemSet;
class SD_DLLPUBLIC SdInsertLayerDlg : public ModalDialog
{
private:
- Edit* m_pEdtName;
- Edit* m_pEdtTitle;
- VclMultiLineEdit* m_pEdtDesc;
- CheckBox* m_pCbxVisible;
- CheckBox* m_pCbxPrintable;
- CheckBox* m_pCbxLocked;
+ VclPtr<Edit> m_pEdtName;
+ VclPtr<Edit> m_pEdtTitle;
+ VclPtr<VclMultiLineEdit> m_pEdtDesc;
+ VclPtr<CheckBox> m_pCbxVisible;
+ VclPtr<CheckBox> m_pCbxPrintable;
+ VclPtr<CheckBox> m_pCbxLocked;
const SfxItemSet& mrOutAttrs;
@@ -48,6 +48,9 @@ public:
SdInsertLayerDlg( vcl::Window* pWindow, const SfxItemSet& rInAttrs,
bool bDeletable, const OUString& rStr );
+ virtual ~SdInsertLayerDlg();
+ virtual void dispose() SAL_OVERRIDE;
+
void GetAttr( SfxItemSet& rOutAttrs );
};
diff --git a/sd/source/ui/inc/masterlayoutdlg.hxx b/sd/source/ui/inc/masterlayoutdlg.hxx
index b6c216944d8b..f6be32bc6ab1 100644
--- a/sd/source/ui/inc/masterlayoutdlg.hxx
+++ b/sd/source/ui/inc/masterlayoutdlg.hxx
@@ -37,11 +37,11 @@ private:
SdDrawDocument* mpDoc;
SdPage* mpCurrentPage;
- CheckBox* mpCBDate;
- CheckBox* mpCBPageNumber;
- CheckBox* mpCBSlideNumber;
- CheckBox* mpCBHeader;
- CheckBox* mpCBFooter;
+ VclPtr<CheckBox> mpCBDate;
+ VclPtr<CheckBox> mpCBPageNumber;
+ VclPtr<CheckBox> mpCBSlideNumber;
+ VclPtr<CheckBox> mpCBHeader;
+ VclPtr<CheckBox> mpCBFooter;
bool mbOldHeader;
bool mbOldFooter;
@@ -54,6 +54,8 @@ private:
public:
MasterLayoutDialog( vcl::Window* pParent, SdDrawDocument* pDoc, SdPage* pCurrentPage );
+ virtual ~MasterLayoutDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
};
diff --git a/sd/source/ui/inc/morphdlg.hxx b/sd/source/ui/inc/morphdlg.hxx
index 06b5b3624495..f675535a1ba1 100644
--- a/sd/source/ui/inc/morphdlg.hxx
+++ b/sd/source/ui/inc/morphdlg.hxx
@@ -39,6 +39,7 @@ public:
const SdrObject* pObj1,
const SdrObject* pObj2);
virtual ~MorphDlg();
+ virtual void dispose() SAL_OVERRIDE;
void SaveSettings() const;
sal_uInt16 GetFadeSteps() const { return (sal_uInt16) m_pMtfSteps->GetValue(); }
@@ -46,9 +47,9 @@ public:
bool IsOrientationFade() const { return m_pCbxOrientation->IsChecked(); }
private:
- NumericField* m_pMtfSteps;
- CheckBox* m_pCbxAttributes;
- CheckBox* m_pCbxOrientation;
+ VclPtr<NumericField> m_pMtfSteps;
+ VclPtr<CheckBox> m_pCbxAttributes;
+ VclPtr<CheckBox> m_pCbxOrientation;
void LoadSettings();
};
diff --git a/sd/source/ui/inc/navigatr.hxx b/sd/source/ui/inc/navigatr.hxx
index b5771f38b92e..e6dff433bc22 100644
--- a/sd/source/ui/inc/navigatr.hxx
+++ b/sd/source/ui/inc/navigatr.hxx
@@ -98,6 +98,7 @@ public:
SfxBindings* pBindings,
const UpdateRequestFunctor& rUpdateRequest);
virtual ~SdNavigatorWin();
+ virtual void dispose() SAL_OVERRIDE;
virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
@@ -118,9 +119,9 @@ private:
friend class SdNavigatorControllerItem;
friend class SdPageNameControllerItem;
- ToolBox maToolbox;
- SdPageObjsTLB maTlbObjects;
- ListBox maLbDocs;
+ VclPtr<ToolBox> maToolbox;
+ VclPtr<SdPageObjsTLB> maTlbObjects;
+ VclPtr<ListBox> maLbDocs;
::sd::NavigatorChildWindow* mpChildWinContext;
Size maSize;
@@ -177,7 +178,7 @@ protected:
const SfxPoolItem* pState ) SAL_OVERRIDE;
private:
- SdNavigatorWin* pNavigatorWin;
+ VclPtr<SdNavigatorWin> pNavigatorWin;
const SdNavigatorWin::UpdateRequestFunctor maUpdateRequest;
};
@@ -195,7 +196,7 @@ protected:
const SfxPoolItem* pState ) SAL_OVERRIDE;
private:
- SdNavigatorWin* pNavigatorWin;
+ VclPtr<SdNavigatorWin> pNavigatorWin;
const SdNavigatorWin::UpdateRequestFunctor maUpdateRequest;
};
diff --git a/sd/source/ui/inc/present.hxx b/sd/source/ui/inc/present.hxx
index ea2fcde3e25d..0398823c783d 100644
--- a/sd/source/ui/inc/present.hxx
+++ b/sd/source/ui/inc/present.hxx
@@ -37,37 +37,37 @@ class SdStartPresentationDlg : public ModalDialog
{
private:
- RadioButton* aRbtAll;
- RadioButton* aRbtAtDia;
- RadioButton* aRbtCustomshow;
- ListBox* aLbDias;
- ListBox* aLbCustomshow;
+ VclPtr<RadioButton> aRbtAll;
+ VclPtr<RadioButton> aRbtAtDia;
+ VclPtr<RadioButton> aRbtCustomshow;
+ VclPtr<ListBox> aLbDias;
+ VclPtr<ListBox> aLbCustomshow;
- RadioButton* aRbtStandard;
- RadioButton* aRbtWindow;
- RadioButton* aRbtAuto;
- TimeField* aTmfPause;
- CheckBox* aCbxAutoLogo;
+ VclPtr<RadioButton> aRbtStandard;
+ VclPtr<RadioButton> aRbtWindow;
+ VclPtr<RadioButton> aRbtAuto;
+ VclPtr<TimeField> aTmfPause;
+ VclPtr<CheckBox> aCbxAutoLogo;
- CheckBox* aCbxManuel;
- CheckBox* aCbxMousepointer;
- CheckBox* aCbxPen;
- CheckBox* aCbxNavigator;
- CheckBox* aCbxAnimationAllowed;
- CheckBox* aCbxChangePage;
- CheckBox* aCbxAlwaysOnTop;
+ VclPtr<CheckBox> aCbxManuel;
+ VclPtr<CheckBox> aCbxMousepointer;
+ VclPtr<CheckBox> aCbxPen;
+ VclPtr<CheckBox> aCbxNavigator;
+ VclPtr<CheckBox> aCbxAnimationAllowed;
+ VclPtr<CheckBox> aCbxChangePage;
+ VclPtr<CheckBox> aCbxAlwaysOnTop;
- FixedText* maFtMonitor;
- ListBox* maLBMonitor;
+ VclPtr<FixedText> maFtMonitor;
+ VclPtr<ListBox> maLBMonitor;
SdCustomShowList* pCustomShowList;
const SfxItemSet& rOutAttrs;
sal_Int32 mnMonitors;
- FixedText* msMonitor;
- FixedText* msAllMonitors;
- FixedText* msMonitorExternal;
- FixedText* msExternal;
+ VclPtr<FixedText> msMonitor;
+ VclPtr<FixedText> msAllMonitors;
+ VclPtr<FixedText> msMonitorExternal;
+ VclPtr<FixedText> msExternal;
DECL_LINK( ChangeRangeHdl, void * );
DECL_LINK( ClickWindowPresentationHdl, void * );
@@ -88,6 +88,8 @@ public:
const SfxItemSet& rInAttrs,
const std::vector<OUString> &rPageNames,
SdCustomShowList* pCSList );
+ virtual ~SdStartPresentationDlg();
+ virtual void dispose() SAL_OVERRIDE;
void GetAttr( SfxItemSet& rOutAttrs );
};
diff --git a/sd/source/ui/inc/prltempl.hxx b/sd/source/ui/inc/prltempl.hxx
index 71c6c3f9b8ef..a4e5cca4e2e8 100644
--- a/sd/source/ui/inc/prltempl.hxx
+++ b/sd/source/ui/inc/prltempl.hxx
@@ -86,6 +86,7 @@ private:
public:
SdPresLayoutTemplateDlg( SfxObjectShell* pDocSh, vcl::Window* pParent, SdResId DlgId, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool );
virtual ~SdPresLayoutTemplateDlg();
+ virtual void dispose() SAL_OVERRIDE;
const SfxItemSet* GetOutputItemSet() const;
};
diff --git a/sd/source/ui/inc/prntopts.hxx b/sd/source/ui/inc/prntopts.hxx
index 9ae6631f435e..4c013ce36db1 100644
--- a/sd/source/ui/inc/prntopts.hxx
+++ b/sd/source/ui/inc/prntopts.hxx
@@ -32,25 +32,25 @@ class SdPrintOptions : public SfxTabPage
friend class SdModule;
private:
- VclFrame *m_pFrmContent;
- CheckBox *m_pCbxDraw;
- CheckBox *m_pCbxNotes;
- CheckBox *m_pCbxHandout;
- CheckBox *m_pCbxOutline;
- RadioButton *m_pRbtColor;
- RadioButton *m_pRbtGrayscale;
- RadioButton *m_pRbtBlackWhite;
- CheckBox *m_pCbxPagename;
- CheckBox *m_pCbxDate;
- CheckBox *m_pCbxTime;
- CheckBox *m_pCbxHiddenPages;
- RadioButton *m_pRbtDefault;
- RadioButton *m_pRbtPagesize;
- RadioButton *m_pRbtPagetile;
- RadioButton *m_pRbtBooklet;
- CheckBox *m_pCbxFront;
- CheckBox *m_pCbxBack;
- CheckBox *m_pCbxPaperbin;
+ VclPtr<VclFrame> m_pFrmContent;
+ VclPtr<CheckBox> m_pCbxDraw;
+ VclPtr<CheckBox> m_pCbxNotes;
+ VclPtr<CheckBox> m_pCbxHandout;
+ VclPtr<CheckBox> m_pCbxOutline;
+ VclPtr<RadioButton> m_pRbtColor;
+ VclPtr<RadioButton> m_pRbtGrayscale;
+ VclPtr<RadioButton> m_pRbtBlackWhite;
+ VclPtr<CheckBox> m_pCbxPagename;
+ VclPtr<CheckBox> m_pCbxDate;
+ VclPtr<CheckBox> m_pCbxTime;
+ VclPtr<CheckBox> m_pCbxHiddenPages;
+ VclPtr<RadioButton> m_pRbtDefault;
+ VclPtr<RadioButton> m_pRbtPagesize;
+ VclPtr<RadioButton> m_pRbtPagetile;
+ VclPtr<RadioButton> m_pRbtBooklet;
+ VclPtr<CheckBox> m_pCbxFront;
+ VclPtr<CheckBox> m_pCbxBack;
+ VclPtr<CheckBox> m_pCbxPaperbin;
const SfxItemSet& rOutAttrs;
@@ -63,8 +63,9 @@ private:
public:
SdPrintOptions( vcl::Window* pParent, const SfxItemSet& rInAttrs);
virtual ~SdPrintOptions();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet * ) SAL_OVERRIDE;
diff --git a/sd/source/ui/inc/pubdlg.hxx b/sd/source/ui/inc/pubdlg.hxx
index bbb4f264d8ee..f9670c7b038f 100644
--- a/sd/source/ui/inc/pubdlg.hxx
+++ b/sd/source/ui/inc/pubdlg.hxx
@@ -53,104 +53,104 @@ class SdPublishingDlg : public ModalDialog
{
private:
// page 1 controls
- VclContainer* pPage1;
- FixedText* pPage1_Titel;
- RadioButton* pPage1_NewDesign;
- RadioButton* pPage1_OldDesign;
- ListBox* pPage1_Designs;
- PushButton* pPage1_DelDesign;
- FixedText* pPage1_Desc;
+ VclPtr<VclContainer> pPage1;
+ VclPtr<FixedText> pPage1_Titel;
+ VclPtr<RadioButton> pPage1_NewDesign;
+ VclPtr<RadioButton> pPage1_OldDesign;
+ VclPtr<ListBox> pPage1_Designs;
+ VclPtr<PushButton> pPage1_DelDesign;
+ VclPtr<FixedText> pPage1_Desc;
// page 2 controls
- VclContainer* pPage2;
- VclContainer* pPage2Frame2;
- VclContainer* pPage2Frame3;
- VclContainer* pPage2Frame4;
- FixedText* pPage2_Titel;
- RadioButton* pPage2_Standard;
- RadioButton* pPage2_Frames;
- RadioButton* pPage2_SingleDocument;
- RadioButton* pPage2_Kiosk;
- RadioButton* pPage2_WebCast;
- FixedImage* pPage2_Standard_FB;
- FixedImage* pPage2_Frames_FB;
- FixedImage* pPage2_Kiosk_FB;
- FixedImage* pPage2_WebCast_FB;
-
- FixedText* pPage2_Titel_Html;
- CheckBox* pPage2_Content;
- CheckBox* pPage2_Notes;
-
- FixedText* pPage2_Titel_WebCast;
- RadioButton* pPage2_ASP;
- RadioButton* pPage2_PERL;
- FixedText* pPage2_URL_txt;
- Edit* pPage2_URL;
- FixedText* pPage2_CGI_txt;
- Edit* pPage2_CGI;
- FixedText* pPage2_Index_txt;
- Edit* pPage2_Index;
- FixedText* pPage2_Titel_Kiosk;
- RadioButton* pPage2_ChgDefault;
- RadioButton* pPage2_ChgAuto;
- FixedText* pPage2_Duration_txt;
- TimeField* pPage2_Duration;
- CheckBox* pPage2_Endless;
+ VclPtr<VclContainer> pPage2;
+ VclPtr<VclContainer> pPage2Frame2;
+ VclPtr<VclContainer> pPage2Frame3;
+ VclPtr<VclContainer> pPage2Frame4;
+ VclPtr<FixedText> pPage2_Titel;
+ VclPtr<RadioButton> pPage2_Standard;
+ VclPtr<RadioButton> pPage2_Frames;
+ VclPtr<RadioButton> pPage2_SingleDocument;
+ VclPtr<RadioButton> pPage2_Kiosk;
+ VclPtr<RadioButton> pPage2_WebCast;
+ VclPtr<FixedImage> pPage2_Standard_FB;
+ VclPtr<FixedImage> pPage2_Frames_FB;
+ VclPtr<FixedImage> pPage2_Kiosk_FB;
+ VclPtr<FixedImage> pPage2_WebCast_FB;
+
+ VclPtr<FixedText> pPage2_Titel_Html;
+ VclPtr<CheckBox> pPage2_Content;
+ VclPtr<CheckBox> pPage2_Notes;
+
+ VclPtr<FixedText> pPage2_Titel_WebCast;
+ VclPtr<RadioButton> pPage2_ASP;
+ VclPtr<RadioButton> pPage2_PERL;
+ VclPtr<FixedText> pPage2_URL_txt;
+ VclPtr<Edit> pPage2_URL;
+ VclPtr<FixedText> pPage2_CGI_txt;
+ VclPtr<Edit> pPage2_CGI;
+ VclPtr<FixedText> pPage2_Index_txt;
+ VclPtr<Edit> pPage2_Index;
+ VclPtr<FixedText> pPage2_Titel_Kiosk;
+ VclPtr<RadioButton> pPage2_ChgDefault;
+ VclPtr<RadioButton> pPage2_ChgAuto;
+ VclPtr<FixedText> pPage2_Duration_txt;
+ VclPtr<TimeField> pPage2_Duration;
+ VclPtr<CheckBox> pPage2_Endless;
// page 3 controls
- VclContainer* pPage3;
- FixedText* pPage3_Titel1;
- RadioButton* pPage3_Png;
- RadioButton* pPage3_Gif;
- RadioButton* pPage3_Jpg;
- FixedText* pPage3_Quality_txt;
- ComboBox* pPage3_Quality;
- FixedText* pPage3_Titel2;
- RadioButton* pPage3_Resolution_1;
- RadioButton* pPage3_Resolution_2;
- RadioButton* pPage3_Resolution_3;
- FixedText* pPage3_Titel3;
- CheckBox* pPage3_SldSound;
- CheckBox* pPage3_HiddenSlides;
+ VclPtr<VclContainer> pPage3;
+ VclPtr<FixedText> pPage3_Titel1;
+ VclPtr<RadioButton> pPage3_Png;
+ VclPtr<RadioButton> pPage3_Gif;
+ VclPtr<RadioButton> pPage3_Jpg;
+ VclPtr<FixedText> pPage3_Quality_txt;
+ VclPtr<ComboBox> pPage3_Quality;
+ VclPtr<FixedText> pPage3_Titel2;
+ VclPtr<RadioButton> pPage3_Resolution_1;
+ VclPtr<RadioButton> pPage3_Resolution_2;
+ VclPtr<RadioButton> pPage3_Resolution_3;
+ VclPtr<FixedText> pPage3_Titel3;
+ VclPtr<CheckBox> pPage3_SldSound;
+ VclPtr<CheckBox> pPage3_HiddenSlides;
// page 4 controls
- VclContainer* pPage4;
- FixedText* pPage4_Titel1;
- FixedText* pPage4_Author_txt;
- Edit* pPage4_Author;
- FixedText* pPage4_Email_txt;
- Edit* pPage4_Email;
- FixedText* pPage4_WWW_txt;
- Edit* pPage4_WWW;
- FixedText* pPage4_Titel2;
- VclMultiLineEdit* pPage4_Misc;
- CheckBox* pPage4_Download;
+ VclPtr<VclContainer> pPage4;
+ VclPtr<FixedText> pPage4_Titel1;
+ VclPtr<FixedText> pPage4_Author_txt;
+ VclPtr<Edit> pPage4_Author;
+ VclPtr<FixedText> pPage4_Email_txt;
+ VclPtr<Edit> pPage4_Email;
+ VclPtr<FixedText> pPage4_WWW_txt;
+ VclPtr<Edit> pPage4_WWW;
+ VclPtr<FixedText> pPage4_Titel2;
+ VclPtr<VclMultiLineEdit> pPage4_Misc;
+ VclPtr<CheckBox> pPage4_Download;
// page 5 controls
- VclContainer* pPage5;
- FixedText* pPage5_Titel;
- CheckBox* pPage5_TextOnly;
- ValueSet* pPage5_Buttons;
+ VclPtr<VclContainer> pPage5;
+ VclPtr<FixedText> pPage5_Titel;
+ VclPtr<CheckBox> pPage5_TextOnly;
+ VclPtr<ValueSet> pPage5_Buttons;
// page 6 controls
- VclContainer* pPage6;
- FixedText* pPage6_Titel;
- RadioButton* pPage6_Default;
- RadioButton* pPage6_User;
- PushButton* pPage6_Back;
- PushButton* pPage6_Text;
- PushButton* pPage6_Link;
- PushButton* pPage6_VLink;
- PushButton* pPage6_ALink;
- RadioButton* pPage6_DocColors;
- SdHtmlAttrPreview* pPage6_Preview;
+ VclPtr<VclContainer> pPage6;
+ VclPtr<FixedText> pPage6_Titel;
+ VclPtr<RadioButton> pPage6_Default;
+ VclPtr<RadioButton> pPage6_User;
+ VclPtr<PushButton> pPage6_Back;
+ VclPtr<PushButton> pPage6_Text;
+ VclPtr<PushButton> pPage6_Link;
+ VclPtr<PushButton> pPage6_VLink;
+ VclPtr<PushButton> pPage6_ALink;
+ VclPtr<RadioButton> pPage6_DocColors;
+ VclPtr<SdHtmlAttrPreview> pPage6_Preview;
boost::scoped_ptr< ButtonSet > mpButtonSet;
// standard controls
- PushButton* pLastPageButton;
- PushButton* pNextPageButton;
- PushButton* pFinishButton;
+ VclPtr<PushButton> pLastPageButton;
+ VclPtr<PushButton> pNextPageButton;
+ VclPtr<PushButton> pFinishButton;
Assistent aAssistentFunc;
@@ -197,6 +197,7 @@ public:
SdPublishingDlg(vcl::Window* pWindow, DocumentType eDocType);
virtual ~SdPublishingDlg();
+ virtual void dispose() SAL_OVERRIDE;
void GetParameterSequence( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rParams );
};
diff --git a/sd/source/ui/inc/sdpreslt.hxx b/sd/source/ui/inc/sdpreslt.hxx
index bef6400329ff..69093c624a8c 100644
--- a/sd/source/ui/inc/sdpreslt.hxx
+++ b/sd/source/ui/inc/sdpreslt.hxx
@@ -41,8 +41,8 @@ public:
::sd::DrawDocShell* pDocShell,
vcl::Window* pWindow,
const SfxItemSet& rInAttrs);
-
virtual ~SdPresLayoutDlg();
+ virtual void dispose() SAL_OVERRIDE;
void GetAttr(SfxItemSet& rOutAttrs);
@@ -51,10 +51,10 @@ public:
private:
::sd::DrawDocShell* mpDocSh;
- ValueSet* m_pVS;
- CheckBox* m_pCbxMasterPage;
- CheckBox* m_pCbxCheckMasters;
- PushButton* m_pBtnLoad;
+ VclPtr<ValueSet> m_pVS;
+ VclPtr<CheckBox> m_pCbxMasterPage;
+ VclPtr<CheckBox> m_pCbxCheckMasters;
+ VclPtr<PushButton> m_pBtnLoad;
const SfxItemSet& mrOutAttrs;
diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx
index bbbfeed10c68..780b44c34368 100644
--- a/sd/source/ui/inc/sdtreelb.hxx
+++ b/sd/source/ui/inc/sdtreelb.hxx
@@ -121,7 +121,7 @@ public:
protected:
- vcl::Window* mpParent;
+ VclPtr<vcl::Window> mpParent;
const SdDrawDocument* mpDoc;
SdDrawDocument* mpBookmarkDoc;
SfxMedium* mpMedium;
@@ -131,7 +131,7 @@ protected:
bool mbLinkableSelected;
OUString maDocName;
::sd::DrawDocShellRef mxBookmarkDocShRef; ///< for the loading of bookmarks
- SdNavigatorWin* mpDropNavWin;
+ VclPtr<SdNavigatorWin> mpDropNavWin;
SfxViewFrame* mpFrame;
std::vector<OUString> maTreeItem;
bool mbSaveTreeItemState;
@@ -187,6 +187,7 @@ public:
SdPageObjsTLB( vcl::Window* pParent, const SdResId& rSdResId );
SdPageObjsTLB( vcl::Window* pParent, WinBits nStyle );
virtual ~SdPageObjsTLB();
+ virtual void dispose() SAL_OVERRIDE;
// helper function for GetEntryAltText and GetEntryLongDescription
OUString getAltLongDescText( SvTreeListEntry* pEntry , bool isAltText) const;
diff --git a/sd/source/ui/inc/sdxfer.hxx b/sd/source/ui/inc/sdxfer.hxx
index d249a1579e6a..640c20763b6a 100644
--- a/sd/source/ui/inc/sdxfer.hxx
+++ b/sd/source/ui/inc/sdxfer.hxx
@@ -123,7 +123,7 @@ private:
SdDrawDocument* mpSdDrawDocument;
SdDrawDocument* mpSdDrawDocumentIntern;
SdDrawDocument* mpSourceDoc;
- VirtualDevice* mpVDev;
+ VclPtr<VirtualDevice> mpVDev;
INetBookmark* mpBookmark;
Graphic* mpGraphic;
ImageMap* mpImageMap;
diff --git a/sd/source/ui/inc/taskpane/SlideSorterCacheDisplay.hxx b/sd/source/ui/inc/taskpane/SlideSorterCacheDisplay.hxx
index a5d1abef8580..d39b8bcfd028 100644
--- a/sd/source/ui/inc/taskpane/SlideSorterCacheDisplay.hxx
+++ b/sd/source/ui/inc/taskpane/SlideSorterCacheDisplay.hxx
@@ -86,7 +86,7 @@ private:
static void AddInstance (const SdDrawDocument* pDocument, SlideSorterCacheDisplay* pControl);
static void RemoveInstance (SlideSorterCacheDisplay* pControl);
- vcl::Window* mpWindow;
+ VclPtr<vcl::Window> mpWindow;
sal_Int32 mnPageCount;
sal_Int32 mnColumnCount;
sal_Int32 mnRowCount;
diff --git a/sd/source/ui/inc/tbx_ww.hxx b/sd/source/ui/inc/tbx_ww.hxx
index fb19bb3d6a69..9754107f4ee1 100644
--- a/sd/source/ui/inc/tbx_ww.hxx
+++ b/sd/source/ui/inc/tbx_ww.hxx
@@ -35,7 +35,7 @@ public:
virtual ~SdTbxControl() {}
virtual SfxPopupWindowType GetPopupWindowType() const SAL_OVERRIDE;
- virtual SfxPopupWindow* CreatePopupWindow() SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> CreatePopupWindow() SAL_OVERRIDE;
virtual void StateChanged( sal_uInt16 nSId, SfxItemState eState,
const SfxPoolItem* pState ) SAL_OVERRIDE;
};
diff --git a/sd/source/ui/inc/tpaction.hxx b/sd/source/ui/inc/tpaction.hxx
index 08abc0173b67..8865c0579141 100644
--- a/sd/source/ui/inc/tpaction.hxx
+++ b/sd/source/ui/inc/tpaction.hxx
@@ -53,21 +53,21 @@ public:
class SdTPAction : public SfxTabPage
{
private:
- ListBox* m_pLbAction;
-
- FixedText* m_pFtTree; // jump destination controls
- SdPageObjsTLB* m_pLbTree;
- SdPageObjsTLB* m_pLbTreeDocument;
- ListBox* m_pLbOLEAction;
-
- VclFrame* m_pFrame;
- Edit* m_pEdtSound;
- Edit* m_pEdtBookmark;
- Edit* m_pEdtDocument;
- Edit* m_pEdtProgram;
- Edit* m_pEdtMacro;
- PushButton* m_pBtnSearch;
- PushButton* m_pBtnSeek;
+ VclPtr<ListBox> m_pLbAction;
+
+ VclPtr<FixedText> m_pFtTree; // jump destination controls
+ VclPtr<SdPageObjsTLB> m_pLbTree;
+ VclPtr<SdPageObjsTLB> m_pLbTreeDocument;
+ VclPtr<ListBox> m_pLbOLEAction;
+
+ VclPtr<VclFrame> m_pFrame;
+ VclPtr<Edit> m_pEdtSound;
+ VclPtr<Edit> m_pEdtBookmark;
+ VclPtr<Edit> m_pEdtDocument;
+ VclPtr<Edit> m_pEdtProgram;
+ VclPtr<Edit> m_pEdtMacro;
+ VclPtr<PushButton> m_pBtnSearch;
+ VclPtr<PushButton> m_pBtnSeek;
const SfxItemSet& rOutAttrs;
const ::sd::View* mpView;
@@ -97,8 +97,9 @@ private:
public:
SdTPAction( vcl::Window* pParent, const SfxItemSet& rInAttrs );
virtual ~SdTPAction();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet& );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet& );
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet * ) SAL_OVERRIDE;
diff --git a/sd/source/ui/inc/tpoption.hxx b/sd/source/ui/inc/tpoption.hxx
index 5ef18f4c4452..ffb600ea8f3e 100644
--- a/sd/source/ui/inc/tpoption.hxx
+++ b/sd/source/ui/inc/tpoption.hxx
@@ -38,7 +38,7 @@ public:
SdTpOptionsSnap( vcl::Window* pParent, const SfxItemSet& rInAttrs );
virtual ~SdTpOptionsSnap();
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet * ) SAL_OVERRIDE;
@@ -50,16 +50,17 @@ public:
class SdTpOptionsContents : public SfxTabPage
{
private:
- CheckBox* m_pCbxRuler;
- CheckBox* m_pCbxDragStripes;
- CheckBox* m_pCbxHandlesBezier;
- CheckBox* m_pCbxMoveOutline;
+ VclPtr<CheckBox> m_pCbxRuler;
+ VclPtr<CheckBox> m_pCbxDragStripes;
+ VclPtr<CheckBox> m_pCbxHandlesBezier;
+ VclPtr<CheckBox> m_pCbxMoveOutline;
public:
SdTpOptionsContents( vcl::Window* pParent, const SfxItemSet& rInAttrs );
virtual ~SdTpOptionsContents();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet * ) SAL_OVERRIDE;
};
@@ -73,38 +74,38 @@ class SdTpOptionsMisc : public SfxTabPage
friend class SdModule;
private:
- CheckBox *m_pCbxQuickEdit;
- CheckBox *m_pCbxPickThrough;
+ VclPtr<CheckBox> m_pCbxQuickEdit;
+ VclPtr<CheckBox> m_pCbxPickThrough;
- VclFrame *m_pNewDocumentFrame;
- CheckBox *m_pCbxStartWithTemplate;
+ VclPtr<VclFrame> m_pNewDocumentFrame;
+ VclPtr<CheckBox> m_pCbxStartWithTemplate;
- CheckBox *m_pCbxMasterPageCache;
- CheckBox *m_pCbxCopy;
- CheckBox *m_pCbxMarkedHitMovesAlways;
- VclFrame *m_pPresentationFrame;
+ VclPtr<CheckBox> m_pCbxMasterPageCache;
+ VclPtr<CheckBox> m_pCbxCopy;
+ VclPtr<CheckBox> m_pCbxMarkedHitMovesAlways;
+ VclPtr<VclFrame> m_pPresentationFrame;
- ListBox *m_pLbMetric;
- MetricField *m_pMtrFldTabstop;
+ VclPtr<ListBox> m_pLbMetric;
+ VclPtr<MetricField> m_pMtrFldTabstop;
- CheckBox *m_pCbxEnableSdremote;
- CheckBox *m_pCbxEnablePresenterScreen;
- CheckBox *m_pCbxUsePrinterMetrics;
- CheckBox *m_pCbxCompatibility;
+ VclPtr<CheckBox> m_pCbxEnableSdremote;
+ VclPtr<CheckBox> m_pCbxEnablePresenterScreen;
+ VclPtr<CheckBox> m_pCbxUsePrinterMetrics;
+ VclPtr<CheckBox> m_pCbxCompatibility;
//Scale
- VclFrame *m_pScaleFrame;
- ComboBox *m_pCbScale;
- FixedText *m_pNewDocLb;
- FixedText *m_pFiInfo1;
- MetricField *m_pMtrFldOriginalWidth;
- FixedText *m_pWidthLb;
- FixedText *m_pHeightLb;
- FixedText *m_pFiInfo2;
- MetricField *m_pMtrFldOriginalHeight;
- CheckBox *m_pCbxDistrot;
- MetricField *m_pMtrFldInfo1;
- MetricField *m_pMtrFldInfo2;
+ VclPtr<VclFrame> m_pScaleFrame;
+ VclPtr<ComboBox> m_pCbScale;
+ VclPtr<FixedText> m_pNewDocLb;
+ VclPtr<FixedText> m_pFiInfo1;
+ VclPtr<MetricField> m_pMtrFldOriginalWidth;
+ VclPtr<FixedText> m_pWidthLb;
+ VclPtr<FixedText> m_pHeightLb;
+ VclPtr<FixedText> m_pFiInfo2;
+ VclPtr<MetricField> m_pMtrFldOriginalHeight;
+ VclPtr<CheckBox> m_pCbxDistrot;
+ VclPtr<MetricField> m_pMtrFldInfo1;
+ VclPtr<MetricField> m_pMtrFldInfo2;
sal_uInt32 nWidth;
sal_uInt32 nHeight;
@@ -131,8 +132,9 @@ protected:
public:
SdTpOptionsMisc( vcl::Window* pParent, const SfxItemSet& rInAttrs );
virtual ~SdTpOptionsMisc();
+ virtual void dispose() SAL_OVERRIDE;
- static SfxTabPage* Create( vcl::Window*, const SfxItemSet* );
+ static VclPtr<SfxTabPage> Create( vcl::Window*, const SfxItemSet* );
virtual bool FillItemSet( SfxItemSet* ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet * ) SAL_OVERRIDE;
diff --git a/sd/source/ui/inc/vectdlg.hxx b/sd/source/ui/inc/vectdlg.hxx
index 153343dae933..fefa8efe82ef 100644
--- a/sd/source/ui/inc/vectdlg.hxx
+++ b/sd/source/ui/inc/vectdlg.hxx
@@ -42,20 +42,20 @@ class DrawDocShell;
class SdVectorizeDlg : public ModalDialog
{
::sd::DrawDocShell * mpDocSh;
- NumericField* m_pNmLayers;
- MetricField* m_pMtReduce;
- FixedText* m_pFtFillHoles;
- MetricField* m_pMtFillHoles;
- CheckBox* m_pCbFillHoles;
+ VclPtr<NumericField> m_pNmLayers;
+ VclPtr<MetricField> m_pMtReduce;
+ VclPtr<FixedText> m_pFtFillHoles;
+ VclPtr<MetricField> m_pMtFillHoles;
+ VclPtr<CheckBox> m_pCbFillHoles;
- GraphCtrl* m_pBmpWin;
+ VclPtr<GraphCtrl> m_pBmpWin;
- GraphCtrl* m_pMtfWin;
+ VclPtr<GraphCtrl> m_pMtfWin;
- ProgressBar* m_pPrgs;
+ VclPtr<ProgressBar> m_pPrgs;
- OKButton* m_pBtnOK;
- PushButton* m_pBtnPreview;
+ VclPtr<OKButton> m_pBtnOK;
+ VclPtr<PushButton> m_pBtnPreview;
Bitmap aBmp;
Bitmap aPreviewBmp;
@@ -82,6 +82,7 @@ public:
SdVectorizeDlg( vcl::Window* pParent, const Bitmap& rBmp, ::sd::DrawDocShell* pDocShell );
virtual ~SdVectorizeDlg();
+ virtual void dispose() SAL_OVERRIDE;
const GDIMetaFile& GetGDIMetaFile() const { return aMtf; }
};
diff --git a/sd/source/ui/presenter/PresenterHelper.cxx b/sd/source/ui/presenter/PresenterHelper.cxx
index 79d9ef48cad2..60b7bcb701de 100644
--- a/sd/source/ui/presenter/PresenterHelper.cxx
+++ b/sd/source/ui/presenter/PresenterHelper.cxx
@@ -79,11 +79,11 @@ Reference<awt::XWindow> SAL_CALL PresenterHelper::createWindow (
vcl::Window* pWindow = NULL;
if (bCreateSystemChildWindow)
{
- pWindow = new WorkWindow(pParentWindow, WB_SYSTEMCHILDWINDOW);
+ pWindow = VclPtr<WorkWindow>::Create(pParentWindow, WB_SYSTEMCHILDWINDOW);
}
else
{
- pWindow = new vcl::Window(pParentWindow);
+ pWindow = VclPtr<vcl::Window>::Create(pParentWindow);
}
Reference<awt::XWindow> xWindow (pWindow->GetComponentInterface(), UNO_QUERY);
diff --git a/sd/source/ui/presenter/PresenterTextView.cxx b/sd/source/ui/presenter/PresenterTextView.cxx
index 7fde4a4c5e08..0df3b852583a 100644
--- a/sd/source/ui/presenter/PresenterTextView.cxx
+++ b/sd/source/ui/presenter/PresenterTextView.cxx
@@ -82,7 +82,7 @@ public:
private:
Reference<rendering::XBitmap> mxBitmap;
cppcanvas::CanvasSharedPtr mpCanvas;
- VirtualDevice* mpOutputDevice;
+ VclPtr<VirtualDevice> mpOutputDevice;
EditEngine* mpEditEngine;
SfxItemPool* mpEditEngineItemPool;
Size maSize;
@@ -242,7 +242,7 @@ PresenterTextView::Implementation::Implementation()
msTotalHeightPropertyName("TotalHeight"),
mxBitmap(),
mpCanvas(),
- mpOutputDevice(new VirtualDevice(*Application::GetDefaultDevice(), 0, 0)),
+ mpOutputDevice(VclPtr<VirtualDevice>::Create(*Application::GetDefaultDevice(), 0, 0)),
mpEditEngine(NULL),
mpEditEngineItemPool(EditEngine::CreatePool()),
maSize(100,100),
@@ -261,7 +261,7 @@ PresenterTextView::Implementation::~Implementation()
{
delete mpEditEngine;
SfxItemPool::Free(mpEditEngineItemPool);
- delete mpOutputDevice;
+ mpOutputDevice.disposeAndClear();
}
EditEngine * PresenterTextView::Implementation::GetEditEngine()
@@ -453,9 +453,8 @@ Reference<rendering::XBitmap> PresenterTextView::Implementation::GetBitmap()
if ( ! mxBitmap.is())
{
- if (mpOutputDevice != NULL)
- delete mpOutputDevice;
- mpOutputDevice = new VirtualDevice(*Application::GetDefaultDevice(), 0, 0);
+ mpOutputDevice.disposeAndClear();
+ mpOutputDevice = VclPtr<VirtualDevice>::Create(*Application::GetDefaultDevice(), 0, 0);
mpOutputDevice->SetMapMode(MAP_PIXEL);
mpOutputDevice->SetOutputSizePixel(maSize, true);
mpOutputDevice->SetLineColor();
diff --git a/sd/source/ui/sidebar/AllMasterPagesSelector.cxx b/sd/source/ui/sidebar/AllMasterPagesSelector.cxx
index 8e40ef1d0471..1ab67e2a63ef 100644
--- a/sd/source/ui/sidebar/AllMasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/AllMasterPagesSelector.cxx
@@ -77,7 +77,7 @@ public:
SortedMasterPageDescriptorList() {}
};
-MasterPagesSelector* AllMasterPagesSelector::Create (
+VclPtr<vcl::Window> AllMasterPagesSelector::Create (
vcl::Window* pParent,
ViewShellBase& rViewShellBase,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar)
@@ -88,13 +88,14 @@ MasterPagesSelector* AllMasterPagesSelector::Create (
::boost::shared_ptr<MasterPageContainer> pContainer (new MasterPageContainer());
- MasterPagesSelector* pSelector(
+ VclPtr<MasterPagesSelector> pSelector(
new AllMasterPagesSelector (
pParent,
*pDocument,
rViewShellBase,
pContainer,
- rxSidebar));
+ rxSidebar),
+ SAL_NO_ACQUIRE);
pSelector->LateInit();
pSelector->SetHelpId(HID_SD_TASK_PANE_PREVIEW_ALL);
diff --git a/sd/source/ui/sidebar/AllMasterPagesSelector.hxx b/sd/source/ui/sidebar/AllMasterPagesSelector.hxx
index 11bcb2640f65..58c958517bd6 100644
--- a/sd/source/ui/sidebar/AllMasterPagesSelector.hxx
+++ b/sd/source/ui/sidebar/AllMasterPagesSelector.hxx
@@ -37,7 +37,7 @@ class AllMasterPagesSelector
: public MasterPagesSelector
{
public:
- static MasterPagesSelector* Create (
+ static VclPtr<vcl::Window> Create (
vcl::Window* pParent,
ViewShellBase& rViewShellBase,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
diff --git a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx
index 5e8bdad96b52..de51f263dbf4 100644
--- a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx
@@ -42,7 +42,7 @@ using namespace ::com::sun::star;
namespace sd { namespace sidebar {
-MasterPagesSelector* CurrentMasterPagesSelector::Create (
+VclPtr<vcl::Window> CurrentMasterPagesSelector::Create (
vcl::Window* pParent,
ViewShellBase& rViewShellBase,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar)
@@ -53,13 +53,14 @@ MasterPagesSelector* CurrentMasterPagesSelector::Create (
::boost::shared_ptr<MasterPageContainer> pContainer (new MasterPageContainer());
- MasterPagesSelector* pSelector(
+ VclPtr<MasterPagesSelector> pSelector(
new CurrentMasterPagesSelector (
pParent,
*pDocument,
rViewShellBase,
pContainer,
- rxSidebar));
+ rxSidebar),
+ SAL_NO_ACQUIRE);
pSelector->LateInit();
pSelector->SetHelpId( HID_SD_TASK_PANE_PREVIEW_CURRENT );
@@ -91,6 +92,11 @@ CurrentMasterPagesSelector::CurrentMasterPagesSelector (
CurrentMasterPagesSelector::~CurrentMasterPagesSelector()
{
+ disposeOnce();
+}
+
+void CurrentMasterPagesSelector::dispose()
+{
if (mrDocument.GetDocSh() != NULL)
{
EndListening(*mrDocument.GetDocSh());
@@ -102,6 +108,8 @@ CurrentMasterPagesSelector::~CurrentMasterPagesSelector()
Link aLink (LINK(this,CurrentMasterPagesSelector,EventMultiplexerListener));
mrBase.GetEventMultiplexer()->RemoveEventListener(aLink);
+
+ MasterPagesSelector::dispose();
}
void CurrentMasterPagesSelector::LateInit()
diff --git a/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx b/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx
index e9a3cbe5d7d8..9443b991654c 100644
--- a/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx
+++ b/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx
@@ -35,7 +35,7 @@ class CurrentMasterPagesSelector
public SfxListener
{
public:
- static MasterPagesSelector* Create (
+ static VclPtr<vcl::Window> Create (
vcl::Window* pParent,
ViewShellBase& rViewShellBase,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
@@ -68,6 +68,7 @@ private:
const ::boost::shared_ptr<MasterPageContainer>& rpContainer,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
virtual ~CurrentMasterPagesSelector();
+ virtual void dispose() SAL_OVERRIDE;
virtual void LateInit() SAL_OVERRIDE;
diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx b/sd/source/ui/sidebar/LayoutMenu.cxx
index 1306ffbb8f13..c304b981bc45 100644
--- a/sd/source/ui/sidebar/LayoutMenu.cxx
+++ b/sd/source/ui/sidebar/LayoutMenu.cxx
@@ -194,8 +194,14 @@ void LayoutMenu::implConstruct( DrawDocShell& rDocumentShell )
LayoutMenu::~LayoutMenu()
{
+ disposeOnce();
+}
+
+void LayoutMenu::dispose()
+{
SAL_INFO("sd.ui", "destroying LayoutMenu at " << this);
Dispose();
+ ValueSet::dispose();
}
void LayoutMenu::Dispose()
diff --git a/sd/source/ui/sidebar/LayoutMenu.hxx b/sd/source/ui/sidebar/LayoutMenu.hxx
index 32c5819f9649..94e16a40ccaa 100644
--- a/sd/source/ui/sidebar/LayoutMenu.hxx
+++ b/sd/source/ui/sidebar/LayoutMenu.hxx
@@ -73,6 +73,7 @@ public:
ViewShellBase& rViewShellBase,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
virtual ~LayoutMenu();
+ virtual void dispose() SAL_OVERRIDE;
void Dispose();
diff --git a/sd/source/ui/sidebar/MasterPagesSelector.cxx b/sd/source/ui/sidebar/MasterPagesSelector.cxx
index 28d3abde2d9a..f17c15aecaee 100644
--- a/sd/source/ui/sidebar/MasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx
@@ -104,11 +104,17 @@ MasterPagesSelector::MasterPagesSelector (
MasterPagesSelector::~MasterPagesSelector()
{
+ disposeOnce();
+}
+
+void MasterPagesSelector::dispose()
+{
Clear();
UpdateLocks(ItemList());
Link aChangeListener (LINK(this,MasterPagesSelector,ContainerChangeListener));
mpContainer->RemoveChangeListener(aChangeListener);
+ PreviewValueSet::dispose();
}
void MasterPagesSelector::LateInit()
diff --git a/sd/source/ui/sidebar/MasterPagesSelector.hxx b/sd/source/ui/sidebar/MasterPagesSelector.hxx
index eab38546d57b..e5121791277c 100644
--- a/sd/source/ui/sidebar/MasterPagesSelector.hxx
+++ b/sd/source/ui/sidebar/MasterPagesSelector.hxx
@@ -63,6 +63,7 @@ public:
const ::boost::shared_ptr<MasterPageContainer>& rpContainer,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
virtual ~MasterPagesSelector();
+ virtual void dispose() SAL_OVERRIDE;
virtual void LateInit();
diff --git a/sd/source/ui/sidebar/NavigatorWrapper.cxx b/sd/source/ui/sidebar/NavigatorWrapper.cxx
index 6df0a2e01aa6..376d22b9152a 100644
--- a/sd/source/ui/sidebar/NavigatorWrapper.cxx
+++ b/sd/source/ui/sidebar/NavigatorWrapper.cxx
@@ -33,27 +33,34 @@ NavigatorWrapper::NavigatorWrapper (
SfxBindings* pBindings)
: Control(pParent, 0),
mrViewShellBase(rViewShellBase),
- maNavigator(
+ maNavigator(VclPtr<SdNavigatorWin>::Create(
this,
- NULL,
+ (::sd::NavigatorChildWindow*)NULL,
SdResId(FLT_NAVIGATOR),
pBindings,
- ::boost::bind(&NavigatorWrapper::UpdateNavigator, this))
+ ::boost::bind(&NavigatorWrapper::UpdateNavigator, this)))
{
- maNavigator.SetPosSizePixel(
+ maNavigator->SetPosSizePixel(
Point(0,0),
GetSizePixel());
- maNavigator.SetBackground(sfx2::sidebar::Theme::GetWallpaper(sfx2::sidebar::Theme::Paint_PanelBackground));
- maNavigator.Show();
+ maNavigator->SetBackground(sfx2::sidebar::Theme::GetWallpaper(sfx2::sidebar::Theme::Paint_PanelBackground));
+ maNavigator->Show();
}
NavigatorWrapper::~NavigatorWrapper()
{
+ disposeOnce();
+}
+
+void NavigatorWrapper::dispose()
+{
+ maNavigator.disposeAndClear();
+ Control::dispose();
}
void NavigatorWrapper::Resize()
{
- maNavigator.SetSizePixel(GetSizePixel());
+ maNavigator->SetSizePixel(GetSizePixel());
}
css::ui::LayoutSize NavigatorWrapper::GetHeightForWidth (const sal_Int32 nWidth)
@@ -65,12 +72,12 @@ css::ui::LayoutSize NavigatorWrapper::GetHeightForWidth (const sal_Int32 nWidth)
void NavigatorWrapper::UpdateNavigator()
{
- maNavigator.InitTreeLB(mrViewShellBase.GetDocument());
+ maNavigator->InitTreeLB(mrViewShellBase.GetDocument());
}
void NavigatorWrapper::GetFocus()
{
- maNavigator.GrabFocus();
+ maNavigator->GrabFocus();
}
} } // end of namespace sd::sidebar
diff --git a/sd/source/ui/sidebar/NavigatorWrapper.hxx b/sd/source/ui/sidebar/NavigatorWrapper.hxx
index 98c95aa72426..49ac6d0ee0f7 100644
--- a/sd/source/ui/sidebar/NavigatorWrapper.hxx
+++ b/sd/source/ui/sidebar/NavigatorWrapper.hxx
@@ -44,8 +44,8 @@ public:
vcl::Window* pParent,
sd::ViewShellBase& rViewShellBase,
SfxBindings* pBindings);
-
virtual ~NavigatorWrapper();
+ virtual void dispose() SAL_OVERRIDE;
// Control
virtual void Resize() SAL_OVERRIDE;
@@ -56,7 +56,7 @@ public:
private:
ViewShellBase& mrViewShellBase;
- SdNavigatorWin maNavigator;
+ VclPtr<SdNavigatorWin> maNavigator;
void UpdateNavigator();
};
diff --git a/sd/source/ui/sidebar/PanelBase.cxx b/sd/source/ui/sidebar/PanelBase.cxx
index f0366b7c329d..c7bcde32e36a 100644
--- a/sd/source/ui/sidebar/PanelBase.cxx
+++ b/sd/source/ui/sidebar/PanelBase.cxx
@@ -38,15 +38,19 @@ PanelBase::PanelBase (
PanelBase::~PanelBase()
{
- OSL_TRACE("deleting wrapped control at %p", mpWrappedControl.get());
- mpWrappedControl.reset();
- OSL_TRACE("deleting PanelBase at %p from parent %p", this, GetParent());
+ disposeOnce();
+}
+
+void PanelBase::dispose()
+{
+ mpWrappedControl.disposeAndClear();
+ Control::dispose();
}
void PanelBase::Dispose()
{
OSL_TRACE("PanelBase::DisposeL: deleting wrapped control at %p", mpWrappedControl.get());
- mpWrappedControl.reset();
+ mpWrappedControl.disposeAndClear();
}
css::ui::LayoutSize PanelBase::GetHeightForWidth (const sal_Int32 /*nWidth*/)
@@ -69,7 +73,7 @@ void PanelBase::Resize()
void PanelBase::SetSidebar (const css::uno::Reference<css::ui::XSidebar>& rxSidebar)
{
mxSidebar = rxSidebar;
- if (mxSidebar.is() && mpWrappedControl!=0)
+ if (mxSidebar.is() && mpWrappedControl!=nullptr)
mxSidebar->requestLayout();
}
diff --git a/sd/source/ui/sidebar/PanelBase.hxx b/sd/source/ui/sidebar/PanelBase.hxx
index dcef4732e521..b0f4fb0cfb5e 100644
--- a/sd/source/ui/sidebar/PanelBase.hxx
+++ b/sd/source/ui/sidebar/PanelBase.hxx
@@ -45,6 +45,7 @@ public:
vcl::Window* pParentWindow,
ViewShellBase& rViewShellBase);
virtual ~PanelBase();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
@@ -58,7 +59,7 @@ public:
virtual void SetSidebar (const css::uno::Reference<css::ui::XSidebar>& rxSidebar) SAL_OVERRIDE;
protected:
- ::boost::scoped_ptr< vcl::Window> mpWrappedControl;
+ VclPtr< vcl::Window> mpWrappedControl;
virtual vcl::Window* CreateWrappedControl (
vcl::Window* pParentWindow,
ViewShellBase& rViewShellBase) = 0;
diff --git a/sd/source/ui/sidebar/PanelFactory.cxx b/sd/source/ui/sidebar/PanelFactory.cxx
index f10290af8572..73013aa037a5 100644
--- a/sd/source/ui/sidebar/PanelFactory.cxx
+++ b/sd/source/ui/sidebar/PanelFactory.cxx
@@ -120,14 +120,14 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
SfxBindings* pBindings = reinterpret_cast<SfxBindings*>(nBindingsValue);
// Create a framework view.
- vcl::Window* pControl = NULL;
+ VclPtr<vcl::Window> pControl;
css::ui::LayoutSize aLayoutSize (-1,-1,-1);
#define EndsWith(s,t) s.endsWithAsciiL(t,strlen(t))
if (EndsWith(rsUIElementResourceURL, gsResourceNameCustomAnimations))
- pControl = new CustomAnimationPanel(pParentWindow, *pBase, xFrame);
+ pControl = VclPtr<vcl::Window>(new CustomAnimationPanel(pParentWindow, *pBase, xFrame), SAL_NO_ACQUIRE);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameLayouts))
- pControl = new LayoutMenu(pParentWindow, *pBase, xSidebar);
+ pControl = VclPtr<vcl::Window>(new LayoutMenu(pParentWindow, *pBase, xSidebar), SAL_NO_ACQUIRE);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameAllMasterPages))
pControl = AllMasterPagesSelector::Create(pParentWindow, *pBase, xSidebar);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameRecentMasterPages))
@@ -135,14 +135,14 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
else if (EndsWith(rsUIElementResourceURL, gsResourceNameUsedMasterPages))
pControl = CurrentMasterPagesSelector::Create(pParentWindow, *pBase, xSidebar);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameSlideTransitions))
- pControl = new SlideTransitionPanel(pParentWindow, *pBase, xFrame);
+ pControl = VclPtr<vcl::Window>(new SlideTransitionPanel(pParentWindow, *pBase, xFrame), SAL_NO_ACQUIRE);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameTableDesign))
- pControl = new TableDesignPanel(pParentWindow, *pBase);
+ pControl = VclPtr<vcl::Window>(new TableDesignPanel(pParentWindow, *pBase), SAL_NO_ACQUIRE);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameNavigator))
- pControl = new NavigatorWrapper(pParentWindow, *pBase, pBindings);
+ pControl = VclPtr<vcl::Window>(new NavigatorWrapper(pParentWindow, *pBase, pBindings), SAL_NO_ACQUIRE);
#undef EndsWith
- if (pControl == NULL)
+ if (!pControl)
throw lang::IllegalArgumentException();
// Create a wrapper around the control that implements the
diff --git a/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx b/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
index 6266e2e25f61..b31e139e22d6 100644
--- a/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
@@ -32,7 +32,7 @@
namespace sd { namespace sidebar {
-MasterPagesSelector* RecentMasterPagesSelector::Create (
+VclPtr<vcl::Window> RecentMasterPagesSelector::Create (
vcl::Window* pParent,
ViewShellBase& rViewShellBase,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar)
@@ -43,13 +43,14 @@ MasterPagesSelector* RecentMasterPagesSelector::Create (
::boost::shared_ptr<MasterPageContainer> pContainer (new MasterPageContainer());
- MasterPagesSelector* pSelector(
+ VclPtr<MasterPagesSelector> pSelector(
new RecentMasterPagesSelector (
pParent,
*pDocument,
rViewShellBase,
pContainer,
- rxSidebar));
+ rxSidebar),
+ SAL_NO_ACQUIRE);
pSelector->LateInit();
pSelector->SetHelpId(HID_SD_TASK_PANE_PREVIEW_RECENT);
@@ -68,8 +69,14 @@ RecentMasterPagesSelector::RecentMasterPagesSelector (
RecentMasterPagesSelector::~RecentMasterPagesSelector()
{
+ disposeOnce();
+}
+
+void RecentMasterPagesSelector::dispose()
+{
RecentlyUsedMasterPages::Instance().RemoveEventListener (
LINK(this,RecentMasterPagesSelector,MasterPageListListener));
+ MasterPagesSelector::dispose();
}
void RecentMasterPagesSelector::LateInit()
diff --git a/sd/source/ui/sidebar/RecentMasterPagesSelector.hxx b/sd/source/ui/sidebar/RecentMasterPagesSelector.hxx
index f690c7875674..a7f470317989 100644
--- a/sd/source/ui/sidebar/RecentMasterPagesSelector.hxx
+++ b/sd/source/ui/sidebar/RecentMasterPagesSelector.hxx
@@ -30,7 +30,7 @@ class RecentMasterPagesSelector
: public MasterPagesSelector
{
public:
- static MasterPagesSelector* Create (
+ static VclPtr<vcl::Window> Create (
vcl::Window* pParent,
ViewShellBase& rViewShellBase,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
@@ -65,6 +65,7 @@ private:
const ::boost::shared_ptr<MasterPageContainer>& rpContainer,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
virtual ~RecentMasterPagesSelector();
+ virtual void dispose() SAL_OVERRIDE;
virtual void LateInit() SAL_OVERRIDE;
};
diff --git a/sd/source/ui/slideshow/showwin.cxx b/sd/source/ui/slideshow/showwin.cxx
index 29c4031dc20d..cb49f89227e5 100644
--- a/sd/source/ui/slideshow/showwin.cxx
+++ b/sd/source/ui/slideshow/showwin.cxx
@@ -79,8 +79,14 @@ ShowWindow::ShowWindow( const ::rtl::Reference< SlideshowImpl >& xController, vc
ShowWindow::~ShowWindow()
{
+ disposeOnce();
+}
+
+void ShowWindow::dispose()
+{
maPauseTimer.Stop();
maMouseTimer.Stop();
+ ::sd::Window::dispose();
}
void ShowWindow::KeyInput(const KeyEvent& rKEvt)
@@ -498,18 +504,18 @@ void ShowWindow::DrawPauseScene( bool bTimeoutOnly )
if( SLIDE_NO_TIMEOUT != mnPauseTimeout )
{
MapMode aVMap( rMap );
- VirtualDevice aVDev( *this );
+ ScopedVclPtrInstance< VirtualDevice > pVDev( *this );
aVMap.SetOrigin( Point() );
- aVDev.SetMapMode( aVMap );
- aVDev.SetBackground( Wallpaper( Color( COL_BLACK ) ) );
+ pVDev->SetMapMode( aVMap );
+ pVDev->SetBackground( Wallpaper( Color( COL_BLACK ) ) );
// set font first, to determine real output height
- aVDev.SetFont( aFont );
+ pVDev->SetFont( aFont );
- const Size aVDevSize( aOutSize.Width(), aVDev.GetTextHeight() );
+ const Size aVDevSize( aOutSize.Width(), pVDev->GetTextHeight() );
- if( aVDev.SetOutputSize( aVDevSize ) )
+ if( pVDev->SetOutputSize( aVDevSize ) )
{
// Note: if performance gets an issue here, we can use NumberFormatter directly
SvtSysLocale aSysLocale;
@@ -518,8 +524,8 @@ void ShowWindow::DrawPauseScene( bool bTimeoutOnly )
aText += " ( ";
aText += aLocaleData.getDuration( ::tools::Time( 0, 0, mnPauseTimeout ) );
aText += " )";
- aVDev.DrawText( Point( aOffset.Width(), 0 ), aText );
- DrawOutDev( Point( aOutOrg.X(), aOffset.Height() ), aVDevSize, Point(), aVDevSize, aVDev );
+ pVDev->DrawText( Point( aOffset.Width(), 0 ), aText );
+ DrawOutDev( Point( aOutOrg.X(), aOffset.Height() ), aVDevSize, Point(), aVDevSize, *pVDev.get() );
bDrawn = true;
}
}
diff --git a/sd/source/ui/slideshow/showwindow.hxx b/sd/source/ui/slideshow/showwindow.hxx
index 81bfe0a437c3..827dd1054071 100644
--- a/sd/source/ui/slideshow/showwindow.hxx
+++ b/sd/source/ui/slideshow/showwindow.hxx
@@ -51,6 +51,7 @@ class ShowWindow
public:
ShowWindow ( const ::rtl::Reference< ::sd::SlideshowImpl >& xController, vcl::Window* pParent );
virtual ~ShowWindow();
+ virtual void dispose() SAL_OVERRIDE;
bool SetEndMode();
bool SetPauseMode( sal_Int32 nPageIndexToRestart, sal_Int32 nTimeoutSec = SLIDE_NO_TIMEOUT, Graphic* pLogo = NULL );
diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx
index d077853dfc65..36ca9d4b5eab 100644
--- a/sd/source/ui/slideshow/slideshow.cxx
+++ b/sd/source/ui/slideshow/slideshow.cxx
@@ -927,7 +927,7 @@ bool SlideShow::startPreview( const Reference< XDrawPage >& xDrawPage, const Ref
OutputDevice* SlideShow::getShowWindow()
{
- return mxController.is() ? mxController->mpShowWindow : 0;
+ return mxController.is() ? mxController->mpShowWindow.get() : 0;
}
int SlideShow::getAnimationMode()
@@ -1159,7 +1159,7 @@ void SlideShow::StartFullscreenPresentation( )
// will be created. This is done here explicitly so that we can make it
// fullscreen.
const sal_Int32 nDisplay (GetDisplay());
- WorkWindow* pWorkWindow = new FullScreenWorkWindow(this, mpCurrentViewShellBase);
+ VclPtr<WorkWindow> pWorkWindow = VclPtr<FullScreenWorkWindow>::Create(this, mpCurrentViewShellBase);
pWorkWindow->SetBackground(Wallpaper(COL_BLACK));
pWorkWindow->StartPresentationMode( true, mpDoc->getPresentationSettings().mbAlwaysOnTop ? PRESENTATION_HIDEALLAPPS : 0, nDisplay);
// pWorkWindow->ShowFullScreenMode(sal_False, nDisplay);
diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx
index 080f5da12cda..1d45a5b3d362 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -705,14 +705,12 @@ void SAL_CALL SlideshowImpl::disposing()
}
if( mpTimeButton )
- {
mpTimeButton->Hide();
- delete mpTimeButton;
- mpTimeButton = 0;
- }
+ mpTimeButton.disposeAndClear();
if( mpShowWindow )
mpShowWindow->Hide();
+ mpShowWindow.disposeAndClear();
if ( mpViewShell )
{
@@ -743,8 +741,7 @@ void SAL_CALL SlideshowImpl::disposing()
if( mpShowWindow )
{
- delete mpShowWindow;
- mpShowWindow = 0;
+ mpShowWindow.clear();
}
setActiveXToolbarsVisible( true );
@@ -805,7 +802,7 @@ bool SlideshowImpl::startPreview(
mpSlideController->insertSlideNumber( nSlideNumber-1 );
mpSlideController->setPreviewNode( xAnimationNode );
- mpShowWindow = new ShowWindow( this, ((pParent == 0) && mpViewShell) ? mpParentWindow : pParent );
+ mpShowWindow = VclPtr<ShowWindow>::Create( this, ((pParent == 0) && mpViewShell) ? mpParentWindow.get() : pParent );
if( mpViewShell )
{
mpViewShell->SetActiveWindow( mpShowWindow );
@@ -857,7 +854,7 @@ bool SlideshowImpl::startPreview(
bRet = startShowImpl( aProperties );
- if( mpShowWindow != 0 && meAnimationMode == ANIMATIONMODE_PREVIEW )
+ if( mpShowWindow != nullptr && meAnimationMode == ANIMATIONMODE_PREVIEW )
mpShowWindow->SetPreviewMode();
}
@@ -882,8 +879,8 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings )
DBG_ASSERT( !mxShow.is(), "sd::SlideshowImpl::startShow(), called twice!" );
if( mxShow.is() )
return true;
- DBG_ASSERT( mpParentWindow!=NULL, "sd::SlideshowImpl::startShow() called without parent window" );
- if (mpParentWindow == NULL)
+ DBG_ASSERT( mpParentWindow!=nullptr, "sd::SlideshowImpl::startShow() called without parent window" );
+ if (mpParentWindow == nullptr)
return false;
// Autoplay (pps/ppsx)
@@ -970,7 +967,7 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings )
// hide child windows
hideChildWindows();
- mpShowWindow = new ShowWindow( this, mpParentWindow );
+ mpShowWindow = VclPtr<ShowWindow>::Create( this, mpParentWindow );
mpShowWindow->SetMouseAutoHide( !maPresSettings.mbMouseVisible );
if( mpViewShell )
{
@@ -3346,7 +3343,8 @@ void PresentationSettingsEx::SetPropertyValue( const OUString& rProperty, const
Reference< XWindow > xWindow;
if( rValue >>= xWindow )
{
- mpParentWindow = xWindow.is() ? VCLUnoHelper::GetWindow( xWindow ) : 0;
+ mpParentWindow = xWindow.is() ? VCLUnoHelper::GetWindow( xWindow )
+ : VclPtr<vcl::Window>();
return;
}
}
diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx b/sd/source/ui/slideshow/slideshowimpl.hxx
index d9ddffb8a07a..a85e3ca526d4 100644
--- a/sd/source/ui/slideshow/slideshowimpl.hxx
+++ b/sd/source/ui/slideshow/slideshowimpl.hxx
@@ -92,7 +92,7 @@ struct PresentationSettingsEx : public PresentationSettings
{
bool mbRehearseTimings;
bool mbPreview;
- vcl::Window* mpParentWindow;
+ VclPtr<vcl::Window> mpParentWindow;
css::uno::Reference< css::drawing::XDrawPage > mxStartPage;
css::uno::Reference< css::animations::XAnimationNode > mxAnimationNode;
@@ -332,9 +332,9 @@ private:
SdDrawDocument* mpDoc;
SfxItemSet* mpNewAttr;
- vcl::Window* mpParentWindow;
- ShowWindow* mpShowWindow;
- PushButton* mpTimeButton;
+ VclPtr<vcl::Window> mpParentWindow;
+ VclPtr<ShowWindow> mpShowWindow;
+ VclPtr<PushButton> mpTimeButton;
boost::shared_ptr< AnimationSlideController > mpSlideController;
@@ -347,8 +347,8 @@ private:
OUString maCharBuffer;
Pointer maOldPointer;
Pointer maPencil;
- std::vector< ::sd::Window* > maDrawModeWindows;
- ::sd::Window* mpOldActiveWindow;
+ std::vector< VclPtr<::sd::Window> > maDrawModeWindows;
+ VclPtr<::sd::Window> mpOldActiveWindow;
Link maStarBASICGlobalErrorHdl;
unsigned long mnChildMask;
bool mbGridVisible;
diff --git a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
index aae8a7eec2b7..fcb7f44ecd7f 100644
--- a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
+++ b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
@@ -118,7 +118,7 @@ SlideSorterController::SlideSorterController (SlideSorter& rSlideSorter)
mnPaintEntranceCount(0),
mbIsContextMenuOpen(false)
{
- SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
+ sd::Window *pWindow (mrSlideSorter.GetContentWindow());
OSL_ASSERT(pWindow);
if (pWindow)
{
@@ -502,7 +502,7 @@ void SlideSorterController::PostModelChange()
mbPostModelChangePending = false;
mrModel.Resync();
- SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
+ sd::Window *pWindow (mrSlideSorter.GetContentWindow());
if (pWindow)
{
GetCurrentSlideManager()->HandleModelChange();
@@ -541,7 +541,7 @@ IMPL_LINK(SlideSorterController, WindowEventHandler, VclWindowEvent*, pEvent)
if (pEvent != NULL)
{
::vcl::Window* pWindow = pEvent->GetWindow();
- SharedSdWindow pActiveWindow (mrSlideSorter.GetContentWindow());
+ sd::Window *pActiveWindow (mrSlideSorter.GetContentWindow());
switch (pEvent->GetId())
{
case VCLEVENT_WINDOW_ACTIVATE:
@@ -557,12 +557,12 @@ IMPL_LINK(SlideSorterController, WindowEventHandler, VclWindowEvent*, pEvent)
case VCLEVENT_WINDOW_GETFOCUS:
if (pActiveWindow)
- if (pWindow == pActiveWindow.get())
+ if (pWindow == pActiveWindow)
GetFocusManager().ShowFocus(false);
break;
case VCLEVENT_WINDOW_LOSEFOCUS:
- if (pActiveWindow && pWindow == pActiveWindow.get())
+ if (pActiveWindow && pWindow == pActiveWindow)
{
GetFocusManager().HideFocus();
mrView.GetToolTip().Hide();
@@ -584,7 +584,7 @@ IMPL_LINK(SlideSorterController, WindowEventHandler, VclWindowEvent*, pEvent)
: ViewShell::OUTPUT_DRAWMODE_COLOR);
if (mrSlideSorter.GetViewShell() != NULL)
mrSlideSorter.GetViewShell()->GetFrameView()->SetDrawMode(nDrawMode);
- if (pActiveWindow != 0)
+ if (pActiveWindow != nullptr)
pActiveWindow->SetDrawMode(nDrawMode);
mrView.HandleDrawModeChange();
@@ -714,7 +714,7 @@ Rectangle SlideSorterController::Rearrange (bool bForce)
else
mbIsForcedRearrangePending = false;
- SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
+ sd::Window *pWindow (mrSlideSorter.GetContentWindow());
if (pWindow)
{
if (bForce)
@@ -864,7 +864,7 @@ void SlideSorterController::PageNameHasChanged (int nPageIndex, const OUString&
// Get a pointer to the corresponding accessible object and notify
// that of the name change.
- SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
+ sd::Window *pWindow (mrSlideSorter.GetContentWindow());
if ( ! pWindow)
return;
diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
index d7898c1a3d9f..9d6bdb8d0feb 100644
--- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
@@ -287,11 +287,11 @@ sal_Int32 Clipboard::GetInsertionPosition (::vcl::Window* pWindow)
else if (mrController.GetFocusManager().IsFocusShowing())
{
// Use the focus to determine the insertion position.
- SdInsertPasteDlg aDialog (pWindow);
- if (aDialog.Execute() == RET_OK)
+ ScopedVclPtrInstance< SdInsertPasteDlg > aDialog(pWindow);
+ if (aDialog->Execute() == RET_OK)
{
nInsertPosition = mrController.GetFocusManager().GetFocusedPageIndex();
- if ( ! aDialog.IsInsertBefore())
+ if ( ! aDialog->IsInsertBefore())
nInsertPosition ++;
}
}
diff --git a/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx b/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx
index 3faf316f1dda..1ee52e80f1d6 100644
--- a/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx
@@ -87,7 +87,7 @@ void DragAndDropContext::UpdatePosition (
// Convert window coordinates into model coordinates (we need the
// window coordinates for auto-scrolling because that remains
// constant while scrolling.)
- SharedSdWindow pWindow (mpTargetSlideSorter->GetContentWindow());
+ sd::Window *pWindow (mpTargetSlideSorter->GetContentWindow());
const Point aMouseModelPosition (pWindow->PixelToLogic(rMousePosition));
::boost::shared_ptr<InsertionIndicatorHandler> pInsertionIndicatorHandler (
mpTargetSlideSorter->GetController().GetInsertionIndicatorHandler());
diff --git a/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx b/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx
index 5fcebfb83746..ccf32ce708e5 100644
--- a/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx
@@ -72,12 +72,12 @@ ScrollBarManager::~ScrollBarManager()
void ScrollBarManager::Connect()
{
- if (mpVerticalScrollBar != 0)
+ if (mpVerticalScrollBar != nullptr)
{
mpVerticalScrollBar->SetScrollHdl (
LINK(this, ScrollBarManager, VerticalScrollBarHandler));
}
- if (mpHorizontalScrollBar != 0)
+ if (mpHorizontalScrollBar != nullptr)
{
mpHorizontalScrollBar->SetScrollHdl(
LINK(this, ScrollBarManager, HorizontalScrollBarHandler));
@@ -86,11 +86,11 @@ void ScrollBarManager::Connect()
void ScrollBarManager::Disconnect()
{
- if (mpVerticalScrollBar != 0)
+ if (mpVerticalScrollBar != nullptr)
{
mpVerticalScrollBar->SetScrollHdl (Link());
}
- if (mpHorizontalScrollBar != 0)
+ if (mpHorizontalScrollBar != nullptr)
{
mpHorizontalScrollBar->SetScrollHdl (Link());
}
@@ -117,13 +117,13 @@ Rectangle ScrollBarManager::PlaceScrollBars (
bIsHorizontalScrollBarAllowed,
bIsVerticalScrollBarAllowed));
- if (mpHorizontalScrollBar!=0 && mpHorizontalScrollBar->IsVisible())
+ if (mpHorizontalScrollBar!=nullptr && mpHorizontalScrollBar->IsVisible())
PlaceHorizontalScrollBar (rAvailableArea);
- if (mpVerticalScrollBar!=0 && mpVerticalScrollBar->IsVisible())
+ if (mpVerticalScrollBar!=nullptr && mpVerticalScrollBar->IsVisible())
PlaceVerticalScrollBar (rAvailableArea);
- if (mpScrollBarFiller!=0 && mpScrollBarFiller->IsVisible())
+ if (mpScrollBarFiller!=nullptr && mpScrollBarFiller->IsVisible())
PlaceFiller (rAvailableArea);
return aRemainingSpace;
@@ -177,12 +177,12 @@ void ScrollBarManager::PlaceFiller (const Rectangle& aArea)
void ScrollBarManager::UpdateScrollBars (bool bResetThumbPosition, bool bUseScrolling)
{
Rectangle aModelArea (mrSlideSorter.GetView().GetModelArea());
- SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
+ sd::Window *pWindow (mrSlideSorter.GetContentWindow());
Size aWindowModelSize (pWindow->PixelToLogic(pWindow->GetSizePixel()));
// The horizontal scroll bar is only shown when the window is
// horizontally smaller than the view.
- if (mpHorizontalScrollBar != 0 && mpHorizontalScrollBar->IsVisible())
+ if (mpHorizontalScrollBar != nullptr && mpHorizontalScrollBar->IsVisible())
{
mpHorizontalScrollBar->Show();
mpHorizontalScrollBar->SetRange (
@@ -212,7 +212,7 @@ void ScrollBarManager::UpdateScrollBars (bool bResetThumbPosition, bool bUseScro
}
// The vertical scroll bar is always shown.
- if (mpVerticalScrollBar != 0 && mpVerticalScrollBar->IsVisible())
+ if (mpVerticalScrollBar != nullptr && mpVerticalScrollBar->IsVisible())
{
mpVerticalScrollBar->SetRange (
Range(aModelArea.Top(), aModelArea.Bottom()));
@@ -257,7 +257,7 @@ IMPL_LINK(ScrollBarManager, VerticalScrollBarHandler, ScrollBar*, pScrollBar)
if (pScrollBar!=NULL
&& pScrollBar==mpVerticalScrollBar.get()
&& pScrollBar->IsVisible()
- && mrSlideSorter.GetContentWindow()!=0)
+ && mrSlideSorter.GetContentWindow())
{
double nRelativePosition = double(pScrollBar->GetThumbPos())
/ double(pScrollBar->GetRange().Len());
@@ -273,7 +273,7 @@ IMPL_LINK(ScrollBarManager, HorizontalScrollBarHandler, ScrollBar*, pScrollBar)
if (pScrollBar!=NULL
&& pScrollBar==mpHorizontalScrollBar.get()
&& pScrollBar->IsVisible()
- && mrSlideSorter.GetContentWindow()!=0)
+ && mrSlideSorter.GetContentWindow())
{
double nRelativePosition = double(pScrollBar->GetThumbPos())
/ double(pScrollBar->GetRange().Len());
@@ -291,7 +291,7 @@ void ScrollBarManager::SetWindowOrigin (
mnHorizontalPosition = nHorizontalPosition;
mnVerticalPosition = nVerticalPosition;
- SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
+ sd::Window *pWindow (mrSlideSorter.GetContentWindow());
Size aViewSize (pWindow->GetViewSize());
Point aOrigin (
(long int) (mnHorizontalPosition * aViewSize.Width()),
@@ -431,7 +431,7 @@ void ScrollBarManager::SetTopLeft(const Point& rNewTopLeft)
int ScrollBarManager::GetVerticalScrollBarWidth() const
{
- if (mpVerticalScrollBar != 0 && mpVerticalScrollBar->IsVisible())
+ if (mpVerticalScrollBar != nullptr && mpVerticalScrollBar->IsVisible())
return mpVerticalScrollBar->GetSizePixel().Width();
else
return 0;
@@ -439,7 +439,7 @@ int ScrollBarManager::GetVerticalScrollBarWidth() const
int ScrollBarManager::GetHorizontalScrollBarHeight() const
{
- if (mpHorizontalScrollBar != 0 && mpHorizontalScrollBar->IsVisible())
+ if (mpHorizontalScrollBar != nullptr && mpHorizontalScrollBar->IsVisible())
return mpHorizontalScrollBar->GetSizePixel().Height();
else
return 0;
@@ -447,7 +447,7 @@ int ScrollBarManager::GetHorizontalScrollBarHeight() const
void ScrollBarManager::CalcAutoScrollOffset (const Point& rMouseWindowPosition)
{
- SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
+ sd::Window *pWindow (mrSlideSorter.GetContentWindow());
int nDx = 0;
int nDy = 0;
@@ -458,7 +458,7 @@ void ScrollBarManager::CalcAutoScrollOffset (const Point& rMouseWindowPosition)
pWindow->LogicToPixel(mrSlideSorter.GetView().GetModelArea()));
if (aWindowSize.Width() > maScrollBorder.Width() * 3
- && mpHorizontalScrollBar != 0
+ && mpHorizontalScrollBar != nullptr
&& mpHorizontalScrollBar->IsVisible())
{
if (rMouseWindowPosition.X() < maScrollBorder.Width()
diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
index 8bef190c0ecf..1483befc1217 100644
--- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
@@ -318,7 +318,7 @@ SelectionFunction::SelectionFunction (
SfxRequest& rRequest)
: FuPoor (
rSlideSorter.GetViewShell(),
- rSlideSorter.GetContentWindow().get(),
+ rSlideSorter.GetContentWindow(),
&rSlideSorter.GetView(),
rSlideSorter.GetModel().GetDocument(),
rRequest),
@@ -1384,7 +1384,7 @@ void MultiSelectionModeHandler::UpdatePosition (
// Convert window coordinates into model coordinates (we need the
// window coordinates for auto-scrolling because that remains
// constant while scrolling.)
- SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
+ sd::Window *pWindow (mrSlideSorter.GetContentWindow());
const Point aMouseModelPosition (pWindow->PixelToLogic(rMousePosition));
bool bDoAutoScroll = bAllowAutoScroll && mrSlideSorter.GetController().GetScrollBarManager().AutoScroll(
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index 17eaee29fd1a..c2be4751a2f8 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -190,7 +190,7 @@ void SlotManager::FuTemporary (SfxRequest& rRequest)
case SID_PRESENTATION_DLG:
FuSlideShowDlg::Create (
pShell,
- mrSlideSorter.GetContentWindow().get(),
+ mrSlideSorter.GetContentWindow(),
&mrSlideSorter.GetView(),
pDocument,
rRequest);
@@ -199,7 +199,7 @@ void SlotManager::FuTemporary (SfxRequest& rRequest)
case SID_CUSTOMSHOW_DLG:
FuCustomShowDlg::Create (
pShell,
- mrSlideSorter.GetContentWindow().get(),
+ mrSlideSorter.GetContentWindow(),
&mrSlideSorter.GetView(),
pDocument,
rRequest);
@@ -208,7 +208,7 @@ void SlotManager::FuTemporary (SfxRequest& rRequest)
case SID_EXPAND_PAGE:
FuExpandPage::Create (
pShell,
- mrSlideSorter.GetContentWindow().get(),
+ mrSlideSorter.GetContentWindow(),
&mrSlideSorter.GetView(),
pDocument,
rRequest);
@@ -217,7 +217,7 @@ void SlotManager::FuTemporary (SfxRequest& rRequest)
case SID_SUMMARY_PAGE:
FuSummaryPage::Create (
pShell,
- mrSlideSorter.GetContentWindow().get(),
+ mrSlideSorter.GetContentWindow(),
&mrSlideSorter.GetView(),
pDocument,
rRequest);
@@ -263,7 +263,7 @@ void SlotManager::FuTemporary (SfxRequest& rRequest)
{
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
boost::scoped_ptr<VclAbstractDialog> pDlg(pFact ? pFact->CreateSdPhotoAlbumDialog(
- mrSlideSorter.GetContentWindow().get(),
+ mrSlideSorter.GetContentWindow(),
pDocument) : 0);
if (pDlg)
@@ -280,7 +280,7 @@ void SlotManager::FuTemporary (SfxRequest& rRequest)
#ifdef ENABLE_SDREMOTE
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
VclAbstractDialog* pDlg = pFact ?
- pFact->CreateRemoteDialog( mrSlideSorter.GetContentWindow().get() ) :
+ pFact->CreateRemoteDialog( mrSlideSorter.GetContentWindow() ) :
0;
if (pDlg)
pDlg->Execute();
@@ -904,7 +904,7 @@ void SlotManager::RenameSlide()
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
DBG_ASSERT(pFact, "Dialog creation failed!");
boost::scoped_ptr<AbstractSvxNameDialog> aNameDlg(pFact->CreateSvxNameDialog(
- mrSlideSorter.GetContentWindow().get(),
+ mrSlideSorter.GetContentWindow(),
aPageName, aDescr));
DBG_ASSERT(aNameDlg, "Dialog creation failed!");
aNameDlg->SetText( aTitle );
diff --git a/sd/source/ui/slidesorter/controller/SlsVisibleAreaManager.cxx b/sd/source/ui/slidesorter/controller/SlsVisibleAreaManager.cxx
index 4a29df00b43e..6ccc8afe539a 100644
--- a/sd/source/ui/slidesorter/controller/SlsVisibleAreaManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsVisibleAreaManager.cxx
@@ -104,7 +104,7 @@ void VisibleAreaManager::MakeVisible()
if (maVisibleRequests.empty())
return;
- SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
+ sd::Window *pWindow (mrSlideSorter.GetContentWindow());
if ( ! pWindow)
return;
const Point aCurrentTopLeft (pWindow->PixelToLogic(Point(0,0)));
@@ -148,7 +148,7 @@ void VisibleAreaManager::MakeVisible()
::boost::optional<Point> VisibleAreaManager::GetRequestedTopLeft() const
{
- SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
+ sd::Window *pWindow (mrSlideSorter.GetContentWindow());
if ( ! pWindow)
return ::boost::optional<Point>();
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx b/sd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx
index ca039c316a4f..d62acead1377 100644
--- a/sd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsScrollBarManager.hxx
@@ -25,7 +25,6 @@
#include <tools/link.hxx>
#include <tools/gen.hxx>
#include <vcl/timer.hxx>
-#include <boost/shared_ptr.hpp>
#include <boost/function.hpp>
class ScrollBar;
@@ -179,12 +178,12 @@ private:
/** The horizontal scroll bar. Note that is used but not owned by
objects of this class. It is given to the constructor.
*/
- ::boost::shared_ptr<ScrollBar> mpHorizontalScrollBar;
+ VclPtr<ScrollBar> mpHorizontalScrollBar;
/** The vertical scroll bar. Note that is used but not owned by
objects of this class. It is given to the constructor.
*/
- ::boost::shared_ptr<ScrollBar> mpVerticalScrollBar;
+ VclPtr<ScrollBar> mpVerticalScrollBar;
/// Relative horizontal position of the visible area in the view.
double mnHorizontalPosition;
@@ -200,7 +199,7 @@ private:
the bottom right corner left by the two scroll bars (when both are
visible).
*/
- ::boost::shared_ptr<ScrollBarBox> mpScrollBarFiller;
+ VclPtr<ScrollBarBox> mpScrollBarFiller;
/** The auto scroll timer is used for keep scrolling the window when the
mouse reaches its border while dragging a selection. When the mouse
@@ -213,7 +212,7 @@ private:
/** The content window is the one whose view port is controlled by the
scroll bars.
*/
- SharedSdWindow mpContentWindow;
+ VclPtr<sd::Window> mpContentWindow;
::boost::function<void()> maAutoScrollFunctor;
diff --git a/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx b/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx
index 88402e727395..38b5d4ac08c4 100644
--- a/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx
+++ b/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx
@@ -227,7 +227,7 @@ public:
void Dispose();
private:
view::SlideSorterView& mrView;
- SharedSdWindow mpWindow;
+ VclPtr<sd::Window> mpWindow;
};
ToolTip& GetToolTip() const;
diff --git a/sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx b/sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx
index eeba70945715..ff2c2a8d60ae 100644
--- a/sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx
+++ b/sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx
@@ -64,7 +64,7 @@ public:
enum Orientation { HORIZONTAL, VERTICAL, GRID };
Layouter (
- const SharedSdWindow& rpWindow,
+ sd::Window *rpWindow,
const ::boost::shared_ptr<Theme>& rpTheme);
~Layouter();
@@ -192,7 +192,7 @@ public:
private:
::boost::scoped_ptr<Implementation> mpImplementation;
- SharedSdWindow mpWindow;
+ VclPtr<sd::Window> mpWindow;
};
/** Collect all values concerning the logical and visual properties of the
diff --git a/sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx b/sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx
index 426e36c830fb..a6bb3345b532 100644
--- a/sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx
+++ b/sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx
@@ -48,7 +48,7 @@ public:
PageObjectLayouter(
const Size& rPageObjectWindowSize,
const Size& rPreviewModelSize,
- const SharedSdWindow& rpWindow,
+ sd::Window *pWindow,
const sal_Int32 nPageCount);
~PageObjectLayouter();
@@ -125,7 +125,7 @@ private:
const CoordinateSystem eCoordinateSystem);
private:
- SharedSdWindow mpWindow;
+ VclPtr<sd::Window> mpWindow;
Size maPageObjectSize;
Rectangle maFocusIndicatorBoundingBox;
Rectangle maPageObjectBoundingBox;
diff --git a/sd/source/ui/slidesorter/shell/SlideSorter.cxx b/sd/source/ui/slidesorter/shell/SlideSorter.cxx
index a49035773b2b..ed1dd0f235ef 100644
--- a/sd/source/ui/slidesorter/shell/SlideSorter.cxx
+++ b/sd/source/ui/slidesorter/shell/SlideSorter.cxx
@@ -71,18 +71,18 @@ private:
::boost::shared_ptr<SlideSorter> SlideSorter::CreateSlideSorter(
ViewShell& rViewShell,
- const ::boost::shared_ptr<sd::Window>& rpContentWindow,
- const ::boost::shared_ptr<ScrollBar>& rpHorizontalScrollBar,
- const ::boost::shared_ptr<ScrollBar>& rpVerticalScrollBar,
- const ::boost::shared_ptr<ScrollBarBox>& rpScrollBarBox)
+ sd::Window* pContentWindow,
+ ScrollBar* pHorizontalScrollBar,
+ ScrollBar* pVerticalScrollBar,
+ ScrollBarBox* pScrollBarBox)
{
::boost::shared_ptr<SlideSorter> pSlideSorter(
new SlideSorter(
rViewShell,
- rpContentWindow,
- rpHorizontalScrollBar,
- rpVerticalScrollBar,
- rpScrollBarBox));
+ pContentWindow,
+ pHorizontalScrollBar,
+ pVerticalScrollBar,
+ pScrollBarBox));
pSlideSorter->Init();
return pSlideSorter;
}
@@ -103,10 +103,10 @@ private:
SlideSorter::SlideSorter (
ViewShell& rViewShell,
- const ::boost::shared_ptr<sd::Window>& rpContentWindow,
- const ::boost::shared_ptr<ScrollBar>& rpHorizontalScrollBar,
- const ::boost::shared_ptr<ScrollBar>& rpVerticalScrollBar,
- const ::boost::shared_ptr<ScrollBarBox>& rpScrollBarBox)
+ sd::Window* pContentWindow,
+ ScrollBar* pHorizontalScrollBar,
+ ScrollBar* pVerticalScrollBar,
+ ScrollBarBox* pScrollBarBox)
: mbIsValid(false),
mpSlideSorterController(),
mpSlideSorterModel(),
@@ -114,11 +114,11 @@ SlideSorter::SlideSorter (
mxControllerWeak(),
mpViewShell(&rViewShell),
mpViewShellBase(&rViewShell.GetViewShellBase()),
- mpContentWindow(rpContentWindow),
+ mpContentWindow(pContentWindow),
mbOwnesContentWindow(false),
- mpHorizontalScrollBar(rpHorizontalScrollBar),
- mpVerticalScrollBar(rpVerticalScrollBar),
- mpScrollBarBox(rpScrollBarBox),
+ mpHorizontalScrollBar(pHorizontalScrollBar),
+ mpVerticalScrollBar(pVerticalScrollBar),
+ mpScrollBarBox(pScrollBarBox),
mbLayoutPending(true),
mpProperties(new controller::Properties()),
mpTheme(new view::Theme(mpProperties))
@@ -136,11 +136,11 @@ SlideSorter::SlideSorter (
mxControllerWeak(),
mpViewShell(pViewShell),
mpViewShellBase(&rBase),
- mpContentWindow(new ContentWindow(rParentWindow,*this )),
+ mpContentWindow(VclPtr<ContentWindow>::Create(rParentWindow,*this )),
mbOwnesContentWindow(true),
- mpHorizontalScrollBar(new ScrollBar(&rParentWindow,WinBits(WB_HSCROLL | WB_DRAG))),
- mpVerticalScrollBar(new ScrollBar(&rParentWindow,WinBits(WB_VSCROLL | WB_DRAG))),
- mpScrollBarBox(new ScrollBarBox(&rParentWindow)),
+ mpHorizontalScrollBar(VclPtr<ScrollBar>::Create(&rParentWindow,WinBits(WB_HSCROLL | WB_DRAG))),
+ mpVerticalScrollBar(VclPtr<ScrollBar>::Create(&rParentWindow,WinBits(WB_VSCROLL | WB_DRAG))),
+ mpScrollBarBox(VclPtr<ScrollBarBox>::Create(&rParentWindow)),
mbLayoutPending(true),
mpProperties(new controller::Properties()),
mpTheme(new view::Theme(mpProperties))
@@ -170,7 +170,7 @@ void SlideSorter::Init()
SetupListeners ();
// Initialize the window.
- SharedSdWindow pContentWindow (GetContentWindow());
+ sd::Window *pContentWindow (GetContentWindow());
if (pContentWindow)
{
::vcl::Window* pParentWindow = pContentWindow->GetParent();
@@ -211,18 +211,6 @@ SlideSorter::~SlideSorter()
mpHorizontalScrollBar.reset();
mpVerticalScrollBar.reset();
mpScrollBarBox.reset();
-
- if (mbOwnesContentWindow)
- {
- OSL_ASSERT(mpContentWindow.unique());
- }
- else
- {
- // Assume that outside this class only the owner holds a reference
- // to the content window.
- OSL_ASSERT(mpContentWindow.use_count()==2);
- }
- mpContentWindow.reset();
}
model::SlideSorterModel& SlideSorter::GetModel() const
@@ -253,7 +241,7 @@ void SlideSorter::Paint (const Rectangle& rRepaintArea)
{
GetController().Paint(
rRepaintArea,
- GetContentWindow().get());
+ GetContentWindow());
}
void SlideSorter::SetupControls (::vcl::Window* )
@@ -263,7 +251,7 @@ void SlideSorter::SetupControls (::vcl::Window* )
void SlideSorter::SetupListeners()
{
- SharedSdWindow pWindow (GetContentWindow());
+ sd::Window *pWindow (GetContentWindow());
if (pWindow)
{
::vcl::Window* pParentWindow = pWindow->GetParent();
@@ -292,7 +280,7 @@ void SlideSorter::ReleaseListeners()
{
mpSlideSorterController->GetScrollBarManager().Disconnect();
- SharedSdWindow pWindow (GetContentWindow());
+ sd::Window *pWindow (GetContentWindow());
if (pWindow)
{
pWindow->RemoveEventListener(
diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
index cbb9c3731875..2f2aa0d73505 100644
--- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
+++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
@@ -181,7 +181,7 @@ void SlideSorterViewShell::Initialize()
// the new view shell. (One is created earlier while the construtor
// of the base class is executed. At that time the correct
// accessibility object can not be constructed.)
- SharedSdWindow pWindow (mpSlideSorter->GetContentWindow());
+ sd::Window *pWindow (mpSlideSorter->GetContentWindow());
if (pWindow)
{
pWindow->Hide();
diff --git a/sd/source/ui/slidesorter/view/SlideSorterView.cxx b/sd/source/ui/slidesorter/view/SlideSorterView.cxx
index d4839971f2cc..33b9643073de 100644
--- a/sd/source/ui/slidesorter/view/SlideSorterView.cxx
+++ b/sd/source/ui/slidesorter/view/SlideSorterView.cxx
@@ -131,7 +131,7 @@ TYPEINIT1(SlideSorterView, ::sd::View);
SlideSorterView::SlideSorterView (SlideSorter& rSlideSorter)
: ::sd::View (
*rSlideSorter.GetModel().GetDocument(),
- rSlideSorter.GetContentWindow().get(),
+ rSlideSorter.GetContentWindow(),
rSlideSorter.GetViewShell()),
mrSlideSorter(rSlideSorter),
mrModel(rSlideSorter.GetModel()),
@@ -216,7 +216,7 @@ sal_Int32 SlideSorterView::GetPageIndexAtPoint (const Point& rWindowPosition) co
{
sal_Int32 nIndex (-1);
- SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
+ sd::Window *pWindow (mrSlideSorter.GetContentWindow());
if (pWindow)
{
nIndex = mpLayouter->GetIndexAtPoint(pWindow->PixelToLogic(rWindowPosition), false, false);
@@ -316,7 +316,7 @@ void SlideSorterView::Rearrange()
if (mrModel.GetPageCount() <= 0)
return;
- SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
+ sd::Window *pWindow (mrSlideSorter.GetContentWindow());
if ( ! pWindow)
return;
const Size aWindowSize (pWindow->GetSizePixel());
@@ -347,7 +347,7 @@ void SlideSorterView::UpdateOrientation()
else
{
// Get access to the docking window.
- vcl::Window* pWindow = mrSlideSorter.GetContentWindow().get();
+ vcl::Window* pWindow = mrSlideSorter.GetContentWindow();
PaneDockingWindow* pDockingWindow = NULL;
while (pWindow!=NULL && pDockingWindow==NULL)
{
@@ -408,7 +408,7 @@ void SlideSorterView::UpdateOrientation()
void SlideSorterView::Layout ()
{
- SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
+ sd::Window *pWindow (mrSlideSorter.GetContentWindow());
if (pWindow)
{
// Set the model area, i.e. the smallest rectangle that includes all
@@ -450,7 +450,7 @@ void SlideSorterView::InvalidatePageObjectVisibilities()
void SlideSorterView::DeterminePageObjectVisibilities()
{
- SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
+ sd::Window *pWindow (mrSlideSorter.GetContentWindow());
if (pWindow)
{
// Set this flag to true here so that an invalidate during the
@@ -547,7 +547,7 @@ bool SlideSorterView::SetOrientation (const Layouter::Orientation eOrientation)
void SlideSorterView::RequestRepaint()
{
- SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
+ sd::Window *pWindow (mrSlideSorter.GetContentWindow());
if (pWindow)
{
mpLayeredDevice->InvalidateAllLayers(
@@ -566,7 +566,7 @@ void SlideSorterView::RequestRepaint (const model::SharedPageDescriptor& rpDescr
void SlideSorterView::RequestRepaint (const Rectangle& rRepaintBox)
{
- SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
+ sd::Window *pWindow (mrSlideSorter.GetContentWindow());
if (pWindow)
{
mpLayeredDevice->InvalidateAllLayers(rRepaintBox);
@@ -576,7 +576,7 @@ void SlideSorterView::RequestRepaint (const Rectangle& rRepaintBox)
void SlideSorterView::RequestRepaint (const vcl::Region& rRepaintRegion)
{
- SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
+ sd::Window *pWindow (mrSlideSorter.GetContentWindow());
if (pWindow)
{
mpLayeredDevice->InvalidateAllLayers(rRepaintRegion);
@@ -612,7 +612,7 @@ void SlideSorterView::CompleteRedraw (
mnLockRedrawSmph ? "locked" : "");
#endif
- if (pDevice == NULL || pDevice!=mrSlideSorter.GetContentWindow().get())
+ if (pDevice == NULL || pDevice!=mrSlideSorter.GetContentWindow())
return;
// The parent implementation of CompleteRedraw is called only when
@@ -700,7 +700,7 @@ void SlideSorterView::ConfigurationChanged (
::boost::shared_ptr<cache::PageCache> SlideSorterView::GetPreviewCache()
{
- SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
+ sd::Window *pWindow (mrSlideSorter.GetContentWindow());
if (pWindow && mpPreviewCache.get() == NULL)
{
mpPreviewCache.reset(
@@ -764,8 +764,8 @@ void SlideSorterView::Notify (SfxBroadcaster& rBroadcaster, const SfxHint& rHint
void SlideSorterView::UpdatePageUnderMouse ()
{
- ::boost::shared_ptr<ScrollBar> pVScrollBar (mrSlideSorter.GetVerticalScrollBar());
- ::boost::shared_ptr<ScrollBar> pHScrollBar (mrSlideSorter.GetHorizontalScrollBar());
+ VclPtr<ScrollBar> pVScrollBar (mrSlideSorter.GetVerticalScrollBar());
+ VclPtr<ScrollBar> pHScrollBar (mrSlideSorter.GetHorizontalScrollBar());
if ((pVScrollBar && pVScrollBar->IsVisible() && pVScrollBar->IsTracking())
|| (pHScrollBar && pHScrollBar->IsVisible() && pHScrollBar->IsTracking()))
{
@@ -775,7 +775,7 @@ void SlideSorterView::UpdatePageUnderMouse ()
return;
}
- SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
+ sd::Window *pWindow (mrSlideSorter.GetContentWindow());
if (pWindow && pWindow->IsVisible() && ! pWindow->IsMouseCaptured())
{
const Window::PointerState aPointerState (pWindow->GetPointerState());
diff --git a/sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx b/sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx
index 980487e7d4e1..ad3a4a9ae83d 100644
--- a/sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx
+++ b/sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx
@@ -40,10 +40,10 @@ class AnimatorAccess
public:
virtual void AddRun (const ::boost::shared_ptr<PageObjectRun>& rRun) = 0;
virtual void RemoveRun (const ::boost::shared_ptr<PageObjectRun>& rRun) = 0;
- virtual model::SlideSorterModel& GetModel() const = 0;
- virtual view::SlideSorterView& GetView() const = 0;
- virtual ::boost::shared_ptr<controller::Animator> GetAnimator() = 0;
- virtual SharedSdWindow GetContentWindow() = 0;
+ virtual model::SlideSorterModel& GetModel (void) const = 0;
+ virtual view::SlideSorterView& GetView (void) const = 0;
+ virtual ::boost::shared_ptr<controller::Animator> GetAnimator (void) = 0;
+ virtual VclPtr<sd::Window> GetContentWindow (void) = 0;
protected:
~AnimatorAccess() {}
@@ -128,7 +128,7 @@ public:
virtual model::SlideSorterModel& GetModel() const SAL_OVERRIDE { return mrModel; }
virtual view::SlideSorterView& GetView() const SAL_OVERRIDE { return mrView; }
virtual ::boost::shared_ptr<controller::Animator> GetAnimator() SAL_OVERRIDE { return mpAnimator; }
- virtual SharedSdWindow GetContentWindow() SAL_OVERRIDE { return mrSlideSorter.GetContentWindow(); }
+ virtual VclPtr<sd::Window> GetContentWindow() SAL_OVERRIDE { return mrSlideSorter.GetContentWindow(); }
private:
model::SlideSorterModel& mrModel;
diff --git a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx
index 2675746f4306..2561c90c667c 100644
--- a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx
+++ b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx
@@ -134,19 +134,17 @@ void InsertionIndicatorOverlay::Create (
// Create virtual devices for bitmap and mask whose bitmaps later be
// combined to form the BitmapEx of the icon.
- VirtualDevice aContent (
- *mrSlideSorter.GetContentWindow(),
- 0,
- 0);
- aContent.SetOutputSizePixel(aIconSize);
+ ScopedVclPtrInstance<VirtualDevice> pContent(
+ *mrSlideSorter.GetContentWindow(), 0, 0);
+ pContent->SetOutputSizePixel(aIconSize);
- aContent.SetFillColor();
- aContent.SetLineColor(pTheme->GetColor(Theme::Color_PreviewBorder));
- const Point aOffset = PaintRepresentatives(aContent, aPreviewSize, nOffset, rRepresentatives);
+ pContent->SetFillColor();
+ pContent->SetLineColor(pTheme->GetColor(Theme::Color_PreviewBorder));
+ const Point aOffset = PaintRepresentatives(*pContent.get(), aPreviewSize, nOffset, rRepresentatives);
- PaintPageCount(aContent, nSelectionCount, aPreviewSize, aOffset);
+ PaintPageCount(*pContent.get(), nSelectionCount, aPreviewSize, aOffset);
- maIcon = aContent.GetBitmapEx(Point(0,0), aIconSize);
+ maIcon = pContent->GetBitmapEx(Point(0,0), aIconSize);
maIcon.Scale(aIconSize);
}
diff --git a/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx b/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx
index ffbd7d686c64..65086d7dead4 100644
--- a/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx
+++ b/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx
@@ -38,10 +38,10 @@ class LayerInvalidator : public ILayerInvalidator
public:
LayerInvalidator (
const ::boost::shared_ptr<LayeredDevice>& rpLayeredDevice,
- const SharedSdWindow& rpTargetWindow,
+ sd::Window *pTargetWindow,
const int nLayer)
: mpLayeredDevice(rpLayeredDevice),
- mpTargetWindow(rpTargetWindow),
+ mpTargetWindow(pTargetWindow),
mnLayer(nLayer)
{
}
@@ -58,7 +58,7 @@ public:
private:
const ::boost::shared_ptr<LayeredDevice> mpLayeredDevice;
- SharedSdWindow mpTargetWindow;
+ VclPtr<sd::Window> mpTargetWindow;
const int mnLayer;
};
@@ -107,7 +107,7 @@ public:
Layer();
~Layer();
- void Initialize (const SharedSdWindow& rpTargetWindow);
+ void Initialize (sd::Window *pTargetWindow);
void InvalidateRectangle (const Rectangle& rInvalidationBox);
void InvalidateRegion (const vcl::Region& rInvalidationRegion);
void Validate (const MapMode& rMapMode);
@@ -121,7 +121,7 @@ public:
void Dispose();
private:
- ::boost::shared_ptr<VirtualDevice> mpLayerDevice;
+ ScopedVclPtr<VirtualDevice> mpLayerDevice;
::std::vector<SharedILayerPainter> maPainters;
vcl::Region maInvalidationRegion;
@@ -159,11 +159,11 @@ private:
//===== LayeredDevice =========================================================
-LayeredDevice::LayeredDevice (const SharedSdWindow& rpTargetWindow)
- : mpTargetWindow(rpTargetWindow),
+LayeredDevice::LayeredDevice (VclPtr<sd::Window> pTargetWindow)
+ : mpTargetWindow(pTargetWindow),
mpLayers(new LayerContainer()),
- mpBackBuffer(new VirtualDevice(*mpTargetWindow)),
- maSavedMapMode(rpTargetWindow->GetMapMode())
+ mpBackBuffer(VclPtr<VirtualDevice>::Create(*mpTargetWindow)),
+ maSavedMapMode(pTargetWindow->GetMapMode())
{
mpBackBuffer->SetOutputSizePixel(mpTargetWindow->GetSizePixel());
}
@@ -379,15 +379,15 @@ Layer::~Layer()
{
}
-void Layer::Initialize (const SharedSdWindow& rpTargetWindow)
+void Layer::Initialize (sd::Window *pTargetWindow)
{
#if 0
- (void)rpTargetWindow;
+ (void)pTargetWindow;
#else
if ( ! mpLayerDevice)
{
- mpLayerDevice.reset(new VirtualDevice(*rpTargetWindow));
- mpLayerDevice->SetOutputSizePixel(rpTargetWindow->GetSizePixel());
+ mpLayerDevice.reset(VclPtr<VirtualDevice>::Create(*pTargetWindow));
+ mpLayerDevice->SetOutputSizePixel(pTargetWindow->GetSizePixel());
}
#endif
}
diff --git a/sd/source/ui/slidesorter/view/SlsLayeredDevice.hxx b/sd/source/ui/slidesorter/view/SlsLayeredDevice.hxx
index 4cbbf5b22d59..f614842afe33 100644
--- a/sd/source/ui/slidesorter/view/SlsLayeredDevice.hxx
+++ b/sd/source/ui/slidesorter/view/SlsLayeredDevice.hxx
@@ -45,8 +45,8 @@ class LayeredDevice
{
public:
- LayeredDevice (const SharedSdWindow& rpTargetWindow);
- ~LayeredDevice();
+ LayeredDevice (VclPtr<sd::Window> pTargetWindow);
+ ~LayeredDevice ();
void Invalidate (
const Rectangle& rInvalidationBox,
@@ -72,10 +72,10 @@ public:
void Dispose();
private:
- SharedSdWindow mpTargetWindow;
+ VclPtr<sd::Window> mpTargetWindow;
class LayerContainer;
::boost::scoped_ptr<LayerContainer> mpLayers;
- ::boost::scoped_ptr<VirtualDevice> mpBackBuffer;
+ ScopedVclPtr<VirtualDevice> mpBackBuffer;
MapMode maSavedMapMode;
void RepaintRectangle (const Rectangle& rRepaintRectangle);
diff --git a/sd/source/ui/slidesorter/view/SlsLayouter.cxx b/sd/source/ui/slidesorter/view/SlsLayouter.cxx
index fd85c1c61b9f..3d68dec61e4e 100644
--- a/sd/source/ui/slidesorter/view/SlsLayouter.cxx
+++ b/sd/source/ui/slidesorter/view/SlsLayouter.cxx
@@ -29,7 +29,7 @@ namespace sd { namespace slidesorter { namespace view {
class Layouter::Implementation
{
public:
- SharedSdWindow mpWindow;
+ VclPtr<sd::Window> mpWindow;
sal_Int32 mnRequestedLeftBorder;
sal_Int32 mnRequestedRightBorder;
sal_Int32 mnRequestedTopBorder;
@@ -200,7 +200,7 @@ public:
protected:
Implementation (
- const SharedSdWindow& rpWindow,
+ sd::Window *pWindow,
const ::boost::shared_ptr<view::Theme>& rpTheme);
Implementation (const Implementation& rImplementation);
@@ -271,7 +271,7 @@ class GridImplementation : public Layouter::Implementation
{
public:
GridImplementation (
- const SharedSdWindow& rpWindow,
+ sd::Window *pWindow,
const ::boost::shared_ptr<view::Theme>& rpTheme);
GridImplementation (const Implementation& rImplementation);
@@ -292,10 +292,10 @@ protected:
//===== Layouter ==============================================================
Layouter::Layouter (
- const SharedSdWindow& rpWindow,
+ sd::Window *pWindow,
const ::boost::shared_ptr<Theme>& rpTheme)
- : mpImplementation(new GridImplementation(rpWindow, rpTheme)),
- mpWindow(rpWindow)
+ : mpImplementation(new GridImplementation(pWindow, rpTheme)),
+ mpWindow(pWindow)
{
}
@@ -427,9 +427,9 @@ Layouter::Implementation* Layouter::Implementation::Create (
}
Layouter::Implementation::Implementation (
- const SharedSdWindow& rpWindow,
+ sd::Window *pWindow,
const ::boost::shared_ptr<view::Theme>& rpTheme)
- : mpWindow(rpWindow),
+ : mpWindow(pWindow),
mnRequestedLeftBorder(5),
mnRequestedRightBorder(5),
mnRequestedTopBorder(5),
@@ -1102,9 +1102,9 @@ void VerticalImplementation::CalculateLogicalInsertPosition (
//===== GridImplementation ================================================
GridImplementation::GridImplementation (
- const SharedSdWindow& rpWindow,
+ sd::Window *pWindow,
const ::boost::shared_ptr<view::Theme>& rpTheme)
- : Implementation(rpWindow, rpTheme)
+ : Implementation(pWindow, rpTheme)
{
}
diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx b/sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx
index 7a32476deb43..6940830fd94c 100644
--- a/sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx
+++ b/sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx
@@ -38,9 +38,9 @@ const static sal_Int32 gnInfoAreaMinWidth = 26;
PageObjectLayouter::PageObjectLayouter (
const Size& rPageObjectWindowSize,
const Size& rPageSize,
- const SharedSdWindow& rpWindow,
+ sd::Window *pWindow,
const sal_Int32 nPageCount)
- : mpWindow(rpWindow),
+ : mpWindow(pWindow),
maPageObjectSize(rPageObjectWindowSize.Width(), rPageObjectWindowSize.Height()),
maPageObjectBoundingBox(),
maPageNumberAreaBoundingBox(),
@@ -48,7 +48,7 @@ PageObjectLayouter::PageObjectLayouter (
maTransitionEffectBoundingBox(),
maTransitionEffectIcon(IconCache::Instance().GetIcon(BMP_FADE_EFFECT_INDICATOR)),
maCustomAnimationEffectIcon(IconCache::Instance().GetIcon(BMP_CUSTOM_ANIMATION_INDICATOR)),
- mpPageNumberFont(Theme::GetFont(Theme::Font_PageNumber, *rpWindow))
+ mpPageNumberFont(Theme::GetFont(Theme::Font_PageNumber, *pWindow))
{
const Size aPageNumberAreaSize (GetPageNumberAreaSize(nPageCount));
diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
index d5b9d8a92b36..d7f9393d467f 100644
--- a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
+++ b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
@@ -160,11 +160,11 @@ Bitmap PageObjectPainter::CreateMarkedPreview (
const BitmapEx& rOverlay,
const OutputDevice* pReferenceDevice) const
{
- ::boost::scoped_ptr<VirtualDevice> pDevice;
+ ScopedVclPtr<VirtualDevice> pDevice;
if (pReferenceDevice != NULL)
- pDevice.reset(new VirtualDevice(*pReferenceDevice));
+ pDevice.reset(VclPtr<VirtualDevice>::Create(*pReferenceDevice));
else
- pDevice.reset(new VirtualDevice());
+ pDevice.reset(VclPtr<VirtualDevice>::Create());
pDevice->SetOutputSizePixel(rSize);
pDevice->DrawBitmap(Point(0,0), rSize, rPreview);
diff --git a/sd/source/ui/slidesorter/view/SlsToolTip.cxx b/sd/source/ui/slidesorter/view/SlsToolTip.cxx
index 16ba566729be..97fa698bb7f7 100644
--- a/sd/source/ui/slidesorter/view/SlsToolTip.cxx
+++ b/sd/source/ui/slidesorter/view/SlsToolTip.cxx
@@ -37,7 +37,7 @@ ToolTip::ToolTip (SlideSorter& rSlideSorter)
maShowTimer(),
maHiddenTimer()
{
- SharedSdWindow window = rSlideSorter.GetContentWindow();
+ sd::Window *window = rSlideSorter.GetContentWindow();
const HelpSettings& rHelpSettings = window->GetSettings().GetHelpSettings();
maShowTimer.SetTimeout(rHelpSettings.GetTipDelay());
maShowTimer.SetTimeoutHdl(LINK(this, ToolTip, DelayTrigger));
@@ -109,7 +109,7 @@ void ToolTip::DoShow()
return;
}
- SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
+ sd::Window *pWindow (mrSlideSorter.GetContentWindow());
if (!msCurrentHelpText.isEmpty() && pWindow)
{
Rectangle aBox (
@@ -124,7 +124,7 @@ void ToolTip::DoShow()
if (aBox.Bottom() >= pWindow->GetSizePixel().Height())
return;
- vcl::Window* pParent (pWindow.get());
+ vcl::Window* pParent (pWindow);
while (pParent!=NULL && pParent->GetParent()!=NULL)
pParent = pParent->GetParent();
const Point aOffset (pWindow->GetWindowExtentsRelative(pParent).TopLeft());
@@ -135,7 +135,7 @@ void ToolTip::DoShow()
// tip at the top of a rectangle that is placed below the preview.
aBox.Move(aOffset.X(), aOffset.Y() + aBox.GetHeight() + 3);
mnHelpWindowHandle = Help::ShowTip(
- pWindow.get(),
+ pWindow,
aBox,
msCurrentHelpText,
QUICKHELP_CENTER | QUICKHELP_TOP);
diff --git a/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx b/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx
index e4f99d20a654..ffd9a825319c 100644
--- a/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx
+++ b/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx
@@ -65,7 +65,7 @@ void ViewCacheContext::NotifyPreviewCreation (
bool ViewCacheContext::IsIdle()
{
- sal_Int32 nIdleState (tools::IdleDetection::GetIdleState(mrSlideSorter.GetContentWindow().get()));
+ sal_Int32 nIdleState (tools::IdleDetection::GetIdleState(mrSlideSorter.GetContentWindow()));
if (nIdleState == tools::IdleDetection::IDET_IDLE)
return true;
else
diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx
index 8e9f65b1a5c7..7d337d17c159 100644
--- a/sd/source/ui/table/TableDesignPane.cxx
+++ b/sd/source/ui/table/TableDesignPane.cxx
@@ -806,14 +806,14 @@ short TableDesignDialog::Execute()
return RET_CANCEL;
}
-::vcl::Window * createTableDesignPanel( ::vcl::Window* pParent, ViewShellBase& rBase )
+VclPtr<::vcl::Window> createTableDesignPanel( ::vcl::Window* pParent, ViewShellBase& rBase )
{
- return new TableDesignPane( pParent, rBase );
+ return VclPtr<TableDesignPane>::Create( pParent, rBase );
}
void showTableDesignDialog( ::vcl::Window* pParent, ViewShellBase& rBase )
{
- boost::scoped_ptr< TableDesignDialog > xDialog( new TableDesignDialog( pParent, rBase ) );
+ ScopedVclPtrInstance< TableDesignDialog > xDialog( pParent, rBase );
xDialog->Execute();
}
diff --git a/sd/source/ui/table/TableDesignPane.hxx b/sd/source/ui/table/TableDesignPane.hxx
index 0fb256cc103c..ecf324078546 100644
--- a/sd/source/ui/table/TableDesignPane.hxx
+++ b/sd/source/ui/table/TableDesignPane.hxx
@@ -92,8 +92,8 @@ private:
private:
ViewShellBase& mrBase;
- TableValueSet* m_pValueSet;
- CheckBox* m_aCheckBoxes[CB_COUNT];
+ VclPtr<TableValueSet> m_pValueSet;
+ VclPtr<CheckBox> m_aCheckBoxes[CB_COUNT];
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxSelectedTable;
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawView > mxView;
diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx
index bff275971dde..c1c4b2185a7b 100644
--- a/sd/source/ui/tools/PreviewRenderer.cxx
+++ b/sd/source/ui/tools/PreviewRenderer.cxx
@@ -64,7 +64,7 @@ namespace {
PreviewRenderer::PreviewRenderer (
OutputDevice* pTemplate,
const bool bHasFrame)
- : mpPreviewDevice (new VirtualDevice()),
+ : mpPreviewDevice (VclPtr<VirtualDevice>::Create()),
mpDocShellOfView(NULL),
maFrameColor (svtools::ColorConfig().GetColorValue(svtools::DOCBOUNDARIES).nColor),
mbHasFrame(bHasFrame)
diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
index 7498fca7ff3f..2e00c231b758 100644
--- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx
+++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
@@ -730,7 +730,7 @@ throw (UnknownPropertyException, PropertyVetoException,
SfxPrinter *pTempPrinter = pDocSh->GetPrinter( true );
if (pTempPrinter)
{
- SfxPrinter *pNewPrinter = new SfxPrinter( pTempPrinter->GetOptions().Clone(), aPrinterName );
+ VclPtr<SfxPrinter> pNewPrinter = VclPtr<SfxPrinter>::Create( pTempPrinter->GetOptions().Clone(), aPrinterName );
pDocSh->SetPrinter( pNewPrinter );
}
}
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 369ae83699d7..3425148d3fc7 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -1885,8 +1885,8 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
if( xRenderDevice.is() && nPageNumber && ( nPageNumber <= mpDoc->GetSdPageCount( ePageKind ) ) )
{
- VCLXDevice* pDevice = VCLXDevice::GetImplementation( xRenderDevice );
- OutputDevice* pOut = pDevice ? pDevice->GetOutputDevice() : NULL;
+ VCLXDevice* pDevice = VCLXDevice::GetImplementation( xRenderDevice );
+ VclPtr< OutputDevice> pOut = pDevice ? pDevice->GetOutputDevice() : VclPtr< OutputDevice >();
if( pOut )
{
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx
index b49fffc24a82..d3e44fb3561e 100644
--- a/sd/source/ui/view/DocumentRenderer.cxx
+++ b/sd/source/ui/view/DocumentRenderer.cxx
@@ -256,7 +256,7 @@ namespace {
{
public:
PrintInfo (
- const Printer* pPrinter,
+ Printer* pPrinter,
const bool bPrintMarkedOnly)
: mpPrinter(pPrinter),
mnDrawMode(DRAWMODE_DEFAULT),
@@ -269,7 +269,7 @@ namespace {
mbPrintMarkedOnly(bPrintMarkedOnly)
{}
- const Printer* mpPrinter;
+ const VclPtr<Printer> mpPrinter;
sal_uLong mnDrawMode;
OUString msTimeDate;
OUString msPageString;
@@ -1201,8 +1201,9 @@ public:
if (aDev >>= xRenderDevice)
{
VCLXDevice* pDevice = VCLXDevice::GetImplementation(xRenderDevice);
- OutputDevice* pOut = pDevice ? pDevice->GetOutputDevice() : NULL;
- mpPrinter = dynamic_cast<Printer*>(pOut);
+ VclPtr< OutputDevice > pOut = pDevice ? pDevice->GetOutputDevice()
+ : VclPtr< OutputDevice >();
+ mpPrinter = dynamic_cast<Printer*>(pOut.get());
Size aPageSizePixel = mpPrinter ? mpPrinter->GetPaperSizePixel() : Size();
if( aPageSizePixel != maPrinterPageSizePixel )
{
@@ -1300,11 +1301,11 @@ public:
// Show warning that the orientation could not be set.
if (pViewShell)
{
- WarningBox aWarnBox(
+ ScopedVclPtrInstance<WarningBox> aWarnBox(
pViewShell->GetActiveWindow(),
(WinBits)(WB_OK_CANCEL | WB_DEF_CANCEL),
SD_RESSTR(STR_WARN_PRINTFORMAT_FAILURE));
- if (aWarnBox.Execute() != RET_OK)
+ if (aWarnBox->Execute() != RET_OK)
return;
}
}
@@ -1337,7 +1338,7 @@ private:
SfxObjectShellRef mxObjectShell; // destroying mpPrintView
ViewShellBase& mrBase;
bool mbIsDisposed;
- Printer* mpPrinter;
+ VclPtr<Printer> mpPrinter;
Size maPrinterPageSizePixel;
::boost::scoped_ptr<PrintOptions> mpOptions;
::std::vector< ::boost::shared_ptr< ::sd::PrinterPage> > maPrinterPages;
@@ -1422,7 +1423,7 @@ private:
PrintInfo aInfo (mpPrinter, mpOptions->IsPrintMarkedOnly());
- if (aInfo.mpPrinter!=NULL && pShell!=NULL)
+ if (aInfo.mpPrinter!=nullptr && pShell!=NULL)
{
MapMode aMap (aInfo.mpPrinter->GetMapMode());
@@ -1879,7 +1880,7 @@ private:
const PageKind ePageKind,
PrintInfo& rInfo)
{
- OSL_ASSERT(rInfo.mpPrinter != NULL);
+ OSL_ASSERT(rInfo.mpPrinter != nullptr);
// Fill in page kind specific data.
SdDrawDocument* pDocument = mrBase.GetMainViewShell()->GetDoc();
diff --git a/sd/source/ui/view/FormShellManager.cxx b/sd/source/ui/view/FormShellManager.cxx
index 989790d0fb42..03ac6c7045bd 100644
--- a/sd/source/ui/view/FormShellManager.cxx
+++ b/sd/source/ui/view/FormShellManager.cxx
@@ -138,7 +138,7 @@ void FormShellManager::RegisterAtCenterPane()
return;
mpMainViewShellWindow = pShell->GetActiveWindow();
- if (mpMainViewShellWindow == NULL)
+ if (mpMainViewShellWindow == nullptr)
return;
// Register at the window to get informed when to move the form
@@ -158,7 +158,7 @@ void FormShellManager::RegisterAtCenterPane()
void FormShellManager::UnregisterAtCenterPane()
{
- if (mpMainViewShellWindow != NULL)
+ if (mpMainViewShellWindow != nullptr)
{
// Unregister from the window.
mpMainViewShellWindow->RemoveEventListener(
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 1a08634b5851..3ec2a1bc92aa 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -1068,9 +1068,9 @@ void Outliner::ShowEndOfSearchDialog()
// Show the message in an info box that is modal with respect to the
// whole application.
- MessageDialog aInfoBox(NULL, aString, VCL_MESSAGE_INFO);
+ ScopedVclPtrInstance< MessageDialog > aInfoBox(nullptr, aString, VCL_MESSAGE_INFO);
- ShowModalMessageBox (aInfoBox);
+ ShowModalMessageBox (*aInfoBox.get());
mbWholeDocumentProcessed = true;
}
@@ -1109,12 +1109,10 @@ bool Outliner::ShowWrapArroundDialog()
// Pop up question box that asks the user whether to wrap around.
// The dialog is made modal with respect to the whole application.
- QueryBox aQuestionBox (
- NULL,
- WB_YES_NO | WB_DEF_YES,
- SD_RESSTR(nStringId));
- aQuestionBox.SetImage (QueryBox::GetStandardImage());
- sal_uInt16 nBoxResult = ShowModalMessageBox(aQuestionBox);
+ ScopedVclPtrInstance<QueryBox> aQuestionBox (
+ nullptr, WB_YES_NO | WB_DEF_YES, SD_RESSTR(nStringId));
+ aQuestionBox->SetImage (QueryBox::GetStandardImage());
+ sal_uInt16 nBoxResult = ShowModalMessageBox(*aQuestionBox.get());
bDoWrapArround = (nBoxResult == RET_YES);
}
@@ -1157,9 +1155,9 @@ void Outliner::PrepareSpellCheck()
{
mbError = true;
mbEndOfSearch = true;
- MessageDialog aErrorBox (NULL,
- SD_RESSTR(STR_NOLANGUAGE));
- ShowModalMessageBox (aErrorBox);
+ ScopedVclPtrInstance<MessageDialog> aErrorBox (
+ nullptr, SD_RESSTR(STR_NOLANGUAGE));
+ ShowModalMessageBox (*aErrorBox.get());
}
else if (eState != EE_SPELL_OK)
{
@@ -1376,8 +1374,8 @@ bool Outliner::HandleFailedSearch()
if (HasNoPreviousMatch ())
{
// No match found in the whole presentation. Tell the user.
- InfoBox aInfoBox (NULL, SD_RESSTR(STR_SAR_NOT_FOUND));
- ShowModalMessageBox (aInfoBox);
+ ScopedVclPtrInstance< InfoBox > aInfoBox(nullptr, SD_RESSTR(STR_SAR_NOT_FOUND));
+ ShowModalMessageBox (*aInfoBox.get());
}
else
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index c95dd452142d..1f1adb72fa89 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -139,7 +139,7 @@ public:
the content window.
It does not include the ViewTabBar.
*/
- ::boost::scoped_ptr< vcl::Window> mpViewWindow;
+ VclPtr<vcl::Window> mpViewWindow;
::boost::shared_ptr<ToolBarManager> mpToolBarManager;
::boost::shared_ptr<ViewShellManager> mpViewShellManager;
::boost::shared_ptr<tools::EventMultiplexer> mpEventMultiplexer;
@@ -204,6 +204,7 @@ class FocusForwardingWindow : public vcl::Window
public:
FocusForwardingWindow (vcl::Window& rParentWindow, ViewShellBase& rBase);
virtual ~FocusForwardingWindow();
+ virtual void dispose() SAL_OVERRIDE;
virtual void KeyInput (const KeyEvent& rEvent) SAL_OVERRIDE;
virtual void Command (const CommandEvent& rEvent) SAL_OVERRIDE;
@@ -239,7 +240,7 @@ ViewShellBase::ViewShellBase (
mpDocument (NULL)
{
mpImpl.reset(new Implementation(*this));
- mpImpl->mpViewWindow.reset(new FocusForwardingWindow(_pFrame->GetWindow(),*this));
+ mpImpl->mpViewWindow = VclPtr<FocusForwardingWindow>::Create(_pFrame->GetWindow(),*this);
mpImpl->mpViewWindow->SetBackground(Wallpaper());
_pFrame->GetWindow().SetBackground(Application::GetSettings().GetStyleSettings().GetLightColor());
@@ -532,11 +533,11 @@ sal_uInt16 ViewShellBase::SetPrinter (
bool bScaleAll = false;
if ( bIsAPI )
{
- WarningBox aWarnBox (
+ ScopedVclPtrInstance<WarningBox> aWarnBox (
GetWindow(),
(WinBits)(WB_YES_NO | WB_DEF_YES),
SD_RESSTR(STR_SCALE_OBJS_TO_PAGE));
- bScaleAll = (aWarnBox.Execute() == RET_YES);
+ bScaleAll = (aWarnBox->Execute() == RET_YES);
}
::boost::shared_ptr<DrawViewShell> pDrawViewShell (
@@ -1027,7 +1028,7 @@ ViewShellBase::Implementation::~Implementation()
{
mpController = NULL;
mpViewTabBar = NULL;
- mpViewWindow.reset();
+ mpViewWindow.disposeAndClear();
mpToolBarManager.reset();
}
@@ -1385,7 +1386,13 @@ FocusForwardingWindow::FocusForwardingWindow (
FocusForwardingWindow::~FocusForwardingWindow()
{
+ disposeOnce();
+}
+
+void FocusForwardingWindow::dispose()
+{
SAL_INFO("sd.view", "destroyed FocusForwardingWindow at " << this);
+ vcl::Window::dispose();
}
void FocusForwardingWindow::KeyInput (const KeyEvent& rKEvt)
diff --git a/sd/source/ui/view/ViewTabBar.cxx b/sd/source/ui/view/ViewTabBar.cxx
index f8ca2e57aae2..6fcd11a5f692 100644
--- a/sd/source/ui/view/ViewTabBar.cxx
+++ b/sd/source/ui/view/ViewTabBar.cxx
@@ -82,7 +82,7 @@ ViewTabBar::ViewTabBar (
const Reference<XResourceId>& rxViewTabBarId,
const Reference<frame::XController>& rxController)
: ViewTabBarInterfaceBase(maMutex),
- mpTabControl(new TabBarControl(GetAnchorWindow(rxViewTabBarId,rxController), this)),
+ mpTabControl(VclPtr<TabBarControl>::Create(GetAnchorWindow(rxViewTabBarId,rxController), this)),
mxController(rxController),
maTabBarButtons(),
mpTabPage(NULL),
@@ -167,8 +167,8 @@ void ViewTabBar::disposing()
// Set all references to the one tab page to NULL and delete the page.
for (sal_uInt16 nIndex=0; nIndex<mpTabControl->GetPageCount(); ++nIndex)
mpTabControl->SetTabPage(nIndex, NULL);
- mpTabPage.reset();
- mpTabControl.reset();
+ mpTabPage.disposeAndClear();
+ mpTabControl.disposeAndClear();
}
mxController = NULL;
diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx
index 55f8872bfb69..179529c4645b 100644
--- a/sd/source/ui/view/drawview.cxx
+++ b/sd/source/ui/view/drawview.cxx
@@ -91,7 +91,7 @@ DrawView::DrawView( DrawDocShell* pDocSh, OutputDevice* pOutDev, DrawViewShell*
DrawView::~DrawView()
{
- delete mpVDev;
+ mpVDev.disposeAndClear();
}
/**
@@ -459,8 +459,7 @@ void DrawView::CompleteRedraw(OutputDevice* pOutDev, const vcl::Region& rReg, sd
{
if( mpVDev )
{
- delete mpVDev;
- mpVDev = NULL;
+ mpVDev.disposeAndClear();
}
bool bStandardPaint = true;
diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index d275d61076f9..62b0b46b5c1a 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -105,7 +105,7 @@ void DrawViewShell::UIActivating( SfxInPlaceClient* pCli )
ViewShell::UIActivating(pCli);
// Disable own controls
- maTabControl.Disable();
+ maTabControl->Disable();
if (GetLayerTabControl() != NULL)
GetLayerTabControl()->Disable();
}
@@ -113,7 +113,7 @@ void DrawViewShell::UIActivating( SfxInPlaceClient* pCli )
void DrawViewShell::UIDeactivated( SfxInPlaceClient* pCli )
{
// Enable own controls
- maTabControl.Enable();
+ maTabControl->Enable();
if (GetLayerTabControl() != NULL)
GetLayerTabControl()->Enable();
@@ -339,7 +339,7 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
LayerTabBar* pLayerBar = GetLayerTabControl();
if (pLayerBar != NULL)
pLayerBar->EndEditMode();
- maTabControl.EndEditMode();
+ maTabControl->EndEditMode();
if (mePageKind == PK_HANDOUT)
{
@@ -379,7 +379,7 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
* PAGEMODE
******************************************************************/
- maTabControl.Clear();
+ maTabControl->Clear();
SdPage* pPage;
sal_uInt16 nPageCnt = GetDoc()->GetSdPageCount(mePageKind);
@@ -388,7 +388,7 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
{
pPage = GetDoc()->GetSdPage(i, mePageKind);
OUString aPageName = pPage->GetName();
- maTabControl.InsertPage(i + 1, aPageName);
+ maTabControl->InsertPage(i + 1, aPageName);
if ( pPage->IsSelected() && nActualPageNum == 0 )
{
@@ -396,7 +396,7 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
}
}
- maTabControl.SetCurPageId(nActualPageNum + 1);
+ maTabControl->SetCurPageId(nActualPageNum + 1);
SwitchPage(nActualPageNum);
}
@@ -414,7 +414,7 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
mpActualPage = GetDoc()->GetSdPage(0, mePageKind);
}
- maTabControl.Clear();
+ maTabControl->Clear();
sal_uInt16 nActualMasterPageNum = 0;
sal_uInt16 nMasterPageCnt = GetDoc()->GetMasterSdPageCount(mePageKind);
@@ -426,7 +426,7 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
if (nPos != -1)
aLayoutName = aLayoutName.copy(0, nPos);
- maTabControl.InsertPage(i + 1, aLayoutName);
+ maTabControl->InsertPage(i + 1, aLayoutName);
if (&(mpActualPage->TRG_GetMasterPage()) == pMaster)
{
@@ -434,7 +434,7 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
}
}
- maTabControl.SetCurPageId(nActualMasterPageNum + 1);
+ maTabControl->SetCurPageId(nActualMasterPageNum + 1);
SwitchPage(nActualMasterPageNum);
}
@@ -451,11 +451,11 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
if ( ! mbIsLayerModeActive)
{
- maTabControl.Show();
+ maTabControl->Show();
// Set the tab control only for draw pages. For master page
// this has been done already above.
if (meEditMode == EM_PAGE)
- maTabControl.SetCurPageId (nActualPageNum + 1);
+ maTabControl->SetCurPageId (nActualPageNum + 1);
}
ResetActualLayer();
@@ -526,7 +526,7 @@ SvxRuler* DrawViewShell::CreateVRuler(::sd::Window* pWin)
WinBits aWBits = WB_VSCROLL | WB_3DLOOK | WB_BORDER;
sal_uInt16 nFlags = SVXRULER_SUPPORT_OBJECT;
- pRuler = new Ruler(*this, GetParentWindow(), pWin, nFlags,
+ pRuler = VclPtr<Ruler>::Create(*this, GetParentWindow(), pWin, nFlags,
GetViewFrame()->GetBindings(), aWBits);
pRuler->SetSourceUnit(pWin->GetMapMode().GetMapUnit());
@@ -590,19 +590,19 @@ void DrawViewShell::SetUIUnit(FieldUnit eUnit)
IMPL_LINK( DrawViewShell, TabSplitHdl, TabBar *, pTab )
{
const long int nMax = maViewSize.Width() - maScrBarWH.Width()
- - maTabControl.GetPosPixel().X() ;
+ - maTabControl->GetPosPixel().X() ;
- Size aTabSize = maTabControl.GetSizePixel();
+ Size aTabSize = maTabControl->GetSizePixel();
aTabSize.Width() = std::min(pTab->GetSplitSize(), (long)(nMax-1));
- maTabControl.SetSizePixel(aTabSize);
+ maTabControl->SetSizePixel(aTabSize);
if(GetLayerTabControl()) // #i87182#
{
GetLayerTabControl()->SetSizePixel(aTabSize);
}
- Point aPos = maTabControl.GetPosPixel();
+ Point aPos = maTabControl->GetPosPixel();
aPos.X() += aTabSize.Width();
Size aScrSize(nMax - aTabSize.Width(), maScrBarWH.Height());
@@ -618,7 +618,7 @@ SdPage* DrawViewShell::getCurrentPage() const
GetDoc()->GetSdPageCount(mePageKind):
GetDoc()->GetMasterSdPageCount(mePageKind);
- sal_Int32 nCurrentPage = maTabControl.GetCurPageId() - 1;
+ sal_Int32 nCurrentPage = maTabControl->GetCurPageId() - 1;
DBG_ASSERT( (nPageCount>0) && (nCurrentPage<nPageCount), "sd::DrawViewShell::getCurrentPage(), illegal page index!" );
if( (nPageCount < 0) || (nCurrentPage>=nPageCount) )
nCurrentPage = 0; // play safe here
@@ -642,7 +642,7 @@ void DrawViewShell::ResetActualPage()
if (!GetDoc())
return;
- sal_uInt16 nCurrentPage = maTabControl.GetCurPageId() - 1;
+ sal_uInt16 nCurrentPage = maTabControl->GetCurPageId() - 1;
sal_uInt16 nPageCount = (meEditMode == EM_PAGE)?GetDoc()->GetSdPageCount(mePageKind):GetDoc()->GetMasterSdPageCount(mePageKind);
if (nPageCount > 0)
nCurrentPage = std::min((sal_uInt16)(nPageCount - 1), nCurrentPage);
@@ -653,7 +653,7 @@ void DrawViewShell::ResetActualPage()
{
// Update for TabControl
- maTabControl.Clear();
+ maTabControl->Clear();
SdPage* pPage = NULL;
@@ -661,18 +661,18 @@ void DrawViewShell::ResetActualPage()
{
pPage = GetDoc()->GetSdPage(i, mePageKind);
OUString aPageName = pPage->GetName();
- maTabControl.InsertPage(i + 1, aPageName);
+ maTabControl->InsertPage(i + 1, aPageName);
// correct selection recognition of the pages
GetDoc()->SetSelected(pPage, i == nCurrentPage);
}
- maTabControl.SetCurPageId(nCurrentPage + 1);
+ maTabControl->SetCurPageId(nCurrentPage + 1);
}
else // EM_MASTERPAGE
{
SdPage* pActualPage = GetDoc()->GetMasterSdPage(nCurrentPage, mePageKind);
- maTabControl.Clear();
+ maTabControl->Clear();
sal_uInt16 nActualMasterPageNum = 0;
sal_uInt16 nMasterPageCnt = GetDoc()->GetMasterSdPageCount(mePageKind);
@@ -683,13 +683,13 @@ void DrawViewShell::ResetActualPage()
sal_Int32 nPos = aLayoutName.indexOf(SD_LT_SEPARATOR);
if (nPos != -1)
aLayoutName = aLayoutName.copy(0, nPos);
- maTabControl.InsertPage(i + 1, aLayoutName);
+ maTabControl->InsertPage(i + 1, aLayoutName);
if (pActualPage == pMaster)
nActualMasterPageNum = i;
}
- maTabControl.SetCurPageId(nActualMasterPageNum + 1);
+ maTabControl->SetCurPageId(nActualMasterPageNum + 1);
SwitchPage(nActualMasterPageNum);
}
@@ -828,7 +828,7 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
sPageText = sPageText.copy(0, nPos);
if (pPV
&& pNewPage == dynamic_cast< SdPage* >( pPV->GetPage() )
- && sPageText == maTabControl.GetPageText(nSelectedPage+1))
+ && sPageText == maTabControl->GetPageText(nSelectedPage+1))
{
// this slide is already visible
return true;
@@ -850,7 +850,7 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
SdPage* pCurrentPage = pPV ? dynamic_cast<SdPage*>(pPV->GetPage()) : NULL;
if (pCurrentPage
&& pNewPage == pCurrentPage
- && maTabControl.GetPageText(nSelectedPage+1).equals(pNewPage->GetName()))
+ && maTabControl->GetPageText(nSelectedPage+1).equals(pNewPage->GetName()))
{
// this slide is already visible
return true;
@@ -979,12 +979,12 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
}
}
- maTabControl.SetCurPageId(nSelectedPage+1);
+ maTabControl->SetCurPageId(nSelectedPage+1);
OUString aPageName = mpActualPage->GetName();
- if (maTabControl.GetPageText(nSelectedPage+1) != aPageName)
+ if (maTabControl->GetPageText(nSelectedPage+1) != aPageName)
{
- maTabControl.SetPageText(nSelectedPage+1, aPageName);
+ maTabControl->SetPageText(nSelectedPage+1, aPageName);
}
}
else
@@ -1053,11 +1053,11 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage)
if (nPos != -1)
aLayoutName = aLayoutName.copy(0, nPos);
- maTabControl.SetCurPageId(nSelectedPage+1);
+ maTabControl->SetCurPageId(nSelectedPage+1);
- if (maTabControl.GetPageText(nSelectedPage+1) != aLayoutName)
+ if (maTabControl->GetPageText(nSelectedPage+1) != aLayoutName)
{
- maTabControl.SetPageText(nSelectedPage+1, aLayoutName);
+ maTabControl->SetPageText(nSelectedPage+1, aLayoutName);
}
if( mePageKind == PK_HANDOUT )
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index c1b2096778ae..9647e52c528f 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -373,7 +373,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
{
mpDrawView->SdrEndTextEdit();
}
- sal_uInt16 nPage = maTabControl.GetCurPageId() - 1;
+ sal_uInt16 nPage = maTabControl->GetCurPageId() - 1;
mpActualPage = GetDoc()->GetSdPage(nPage, mePageKind);
::sd::ViewShell::mpImpl->ProcessModifyPageSlot (
rReq,
@@ -410,7 +410,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
mpDrawView->SdrEndTextEdit();
}
- sal_uInt16 nPageId = maTabControl.GetCurPageId();
+ sal_uInt16 nPageId = maTabControl->GetCurPageId();
SdPage* pCurrentPage = ( GetEditMode() == EM_PAGE )
? GetDoc()->GetSdPage( nPageId - 1, GetPageKind() )
: GetDoc()->GetMasterSdPage( nPageId - 1, GetPageKind() );
@@ -456,7 +456,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
mpDrawView->SdrEndTextEdit();
}
- maTabControl.StartEditMode( maTabControl.GetCurPageId() );
+ maTabControl->StartEditMode( maTabControl->GetCurPageId() );
}
Cancel();
@@ -993,10 +993,10 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP )
{
SdrGrafObj* pGraphicObj = static_cast<SdrGrafObj*>(pObj);
- CompressGraphicsDialog dialog( GetParentWindow(), pGraphicObj, GetViewFrame()->GetBindings() );
- if ( dialog.Execute() == RET_OK )
+ ScopedVclPtrInstance< CompressGraphicsDialog > dialog( GetParentWindow(), pGraphicObj, GetViewFrame()->GetBindings() );
+ if ( dialog->Execute() == RET_OK )
{
- SdrGrafObj* pNewObject = dialog.GetCompressedSdrGrafObj();
+ SdrGrafObj* pNewObject = dialog->GetCompressedSdrGrafObj();
SdrPageView* pPageView = mpDrawView->GetSdrPageView();
OUString aUndoString = mpDrawView->GetDescriptionOfMarkedObjects();
aUndoString += " Compress";
@@ -1422,11 +1422,11 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
|| aLayerName.isEmpty() )
{
// name already exists
- WarningBox aWarningBox (
+ ScopedVclPtrInstance<WarningBox> aWarningBox (
GetParentWindow(),
WinBits( WB_OK ),
SD_RESSTR(STR_WARN_NAME_DUPLICATE));
- aWarningBox.Execute();
+ aWarningBox->Execute();
}
else
bLoop = false;
@@ -1591,11 +1591,11 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
aLayerName != aOldLayerName) || aLayerName.isEmpty() )
{
// name already exists
- WarningBox aWarningBox (
+ ScopedVclPtrInstance<WarningBox> aWarningBox (
GetParentWindow(),
WinBits( WB_OK ),
SD_RESSTR(STR_WARN_NAME_DUPLICATE));
- aWarningBox.Execute();
+ aWarningBox->Execute();
}
else
bLoop = false;
diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx
index 0b82950cfb3d..ac9ecbca1f6a 100644
--- a/sd/source/ui/view/drviews3.cxx
+++ b/sd/source/ui/view/drviews3.cxx
@@ -142,7 +142,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
if (! pArgs)
{
- nSelectedPage = maTabControl.GetCurPageId() - 1;
+ nSelectedPage = maTabControl->GetCurPageId() - 1;
}
else if (pArgs->Count () == 2)
{
diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx
index a4bf08bb6afa..9a6b58553aec 100644
--- a/sd/source/ui/view/drviews4.cxx
+++ b/sd/source/ui/view/drviews4.cxx
@@ -74,7 +74,7 @@ using namespace ::com::sun::star::drawing;
void DrawViewShell::DeleteActualPage()
{
- sal_uInt16 nPage = maTabControl.GetCurPageId() - 1;
+ sal_uInt16 nPage = maTabControl->GetCurPageId() - 1;
mpDrawView->SdrEndTextEdit();
diff --git a/sd/source/ui/view/drviews5.cxx b/sd/source/ui/view/drviews5.cxx
index 9fbdf055e37a..030c676bc3db 100644
--- a/sd/source/ui/view/drviews5.cxx
+++ b/sd/source/ui/view/drviews5.cxx
@@ -114,7 +114,7 @@ void DrawViewShell::ArrangeGUIElements()
ViewShell::ArrangeGUIElements ();
- maTabControl.Hide();
+ maTabControl->Hide();
OSL_ASSERT (GetViewShell()!=NULL);
Client* pIPClient = static_cast<Client*>(GetViewShell()->GetIPClient());
@@ -352,7 +352,7 @@ void DrawViewShell::WriteFrameViewData()
mpFrameView->SetSelectedPage(0);
else
{
- mpFrameView->SetSelectedPage( maTabControl.GetCurPageId() - 1 );
+ mpFrameView->SetSelectedPage( maTabControl->GetCurPageId() - 1 );
}
mpFrameView->SetViewShEditMode(meEditMode, mePageKind);
diff --git a/sd/source/ui/view/drviews6.cxx b/sd/source/ui/view/drviews6.cxx
index 31c9f08a6831..c6bdfed2a8f0 100644
--- a/sd/source/ui/view/drviews6.cxx
+++ b/sd/source/ui/view/drviews6.cxx
@@ -294,9 +294,9 @@ void DrawViewShell::ExecBmpMask( SfxRequest& rReq )
if( pNewObj->IsLinkedGraphic() )
{
- MessageDialog aQueryBox( (vcl::Window*) GetActiveWindow(),"QueryUnlinkImageDialog","modules/sdraw/ui/queryunlinkimagedialog.ui");
+ ScopedVclPtrInstance< MessageDialog > aQueryBox( (vcl::Window*) GetActiveWindow(),"QueryUnlinkImageDialog","modules/sdraw/ui/queryunlinkimagedialog.ui");
- if (RET_YES == aQueryBox.Execute())
+ if (RET_YES == aQueryBox->Execute())
pNewObj->ReleaseGraphicLink();
else
{
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index 27a6176313f8..4fbf8d725bf8 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -912,7 +912,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
if( SfxItemState::DEFAULT == rSet.GetItemState( SID_DELETE_PAGE )
|| SfxItemState::DEFAULT == rSet.GetItemState( SID_DELETE_MASTER_PAGE ) )
{
- if (maTabControl.GetPageCount() == 1 ||
+ if (maTabControl->GetPageCount() == 1 ||
meEditMode == EM_MASTERPAGE ||
mePageKind == PK_NOTES ||
mePageKind == PK_HANDOUT ||
diff --git a/sd/source/ui/view/drviews9.cxx b/sd/source/ui/view/drviews9.cxx
index d224c328122f..7b2137113e9c 100644
--- a/sd/source/ui/view/drviews9.cxx
+++ b/sd/source/ui/view/drviews9.cxx
@@ -87,11 +87,11 @@ void DrawViewShell::ExecGallery(SfxRequest& rReq)
Graphic aGraphic( pGalleryItem->GetGraphic() );
// reduce size if necessary
- Window aWindow (GetActiveWindow());
- aWindow.SetMapMode(aGraphic.GetPrefMapMode());
- Size aSizePix = aWindow.LogicToPixel(aGraphic.GetPrefSize());
- aWindow.SetMapMode( MapMode(MAP_100TH_MM) );
- Size aSize = aWindow.PixelToLogic(aSizePix);
+ ScopedVclPtrInstance< Window > aWindow(GetActiveWindow());
+ aWindow->SetMapMode(aGraphic.GetPrefMapMode());
+ Size aSizePix = aWindow->LogicToPixel(aGraphic.GetPrefSize());
+ aWindow->SetMapMode( MapMode(MAP_100TH_MM) );
+ Size aSize = aWindow->PixelToLogic(aSizePix);
// constrain size to page size if necessary
SdrPage* pPage = mpDrawView->GetSdrPageView()->GetPage();
diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx
index 6b66f374e1ae..34fca249cb20 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -109,7 +109,7 @@ void SAL_CALL ScannerEventListener::disposing( const lang::EventObject& rEventOb
DrawViewShell::DrawViewShell( SfxViewFrame* pFrame, ViewShellBase& rViewShellBase, vcl::Window* pParentWindow, PageKind ePageKind, FrameView* pFrameViewArgument )
: ViewShell (pFrame, pParentWindow, rViewShellBase)
- , maTabControl(this, pParentWindow)
+ , maTabControl(VclPtr<sd::TabControl>::Create(this, pParentWindow))
, mbIsLayerModeActive(false)
, mbIsInSwitchPage(false)
, mpSelectionChangeHandler(new svx::sidebar::SelectionChangeHandler(
@@ -191,6 +191,8 @@ DrawViewShell::~DrawViewShell()
mpFrameView->Disconnect();
delete [] mpSlotArray;
+
+ maTabControl.disposeAndClear();
}
/**
@@ -288,7 +290,7 @@ void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind)
GetDoc()->SetMaxObjSize(aSize);
// Split-Handler for TabControls
- maTabControl.SetSplitHdl( LINK( this, DrawViewShell, TabSplitHdl ) );
+ maTabControl->SetSplitHdl( LINK( this, DrawViewShell, TabSplitHdl ) );
/* In order to set the correct EditMode of the FrameView, we select another
one (small trick). */
@@ -702,7 +704,7 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet)
// Always show the slide/page number.
OUString aOUString = (nPageCount == nActivePageCount) ? SD_RESSTR(STR_SD_PAGE_COUNT) : SD_RESSTR(STR_SD_PAGE_COUNT_CUSTOM);
- aOUString = aOUString.replaceFirst("%1", OUString::number(maTabControl.GetCurPageId()));
+ aOUString = aOUString.replaceFirst("%1", OUString::number(maTabControl->GetCurPageId()));
aOUString = aOUString.replaceFirst("%2", OUString::number(nPageCount));
if(nPageCount != nActivePageCount)
aOUString = aOUString.replaceFirst("%3", OUString::number(nActivePageCount));
diff --git a/sd/source/ui/view/drviewsb.cxx b/sd/source/ui/view/drviewsb.cxx
index c3485e76ca9e..03c5a49e4cdd 100644
--- a/sd/source/ui/view/drviewsb.cxx
+++ b/sd/source/ui/view/drviewsb.cxx
@@ -114,7 +114,7 @@ bool DrawViewShell::RenameSlide( sal_uInt16 nPageId, const OUString & rName )
if( bSuccess )
{
// user edited page names may be changed by the page so update control
- maTabControl.SetPageText( nPageId, rName );
+ maTabControl->SetPageText( nPageId, rName );
// set document to modified state
GetDoc()->SetChanged( true );
@@ -146,7 +146,7 @@ IMPL_LINK( DrawViewShell, RenameSlideHdl, AbstractSvxNameDialog*, pDialog )
OUString aNewName;
pDialog->GetName( aNewName );
- SdPage* pCurrentPage = GetDoc()->GetSdPage( maTabControl.GetCurPageId() - 1, GetPageKind() );
+ SdPage* pCurrentPage = GetDoc()->GetSdPage( maTabControl->GetCurPageId() - 1, GetPageKind() );
return long(pCurrentPage && ( aNewName == pCurrentPage->GetName() || GetDocSh()->IsNewPageNameValid( aNewName ) ));
}
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 96b7c65adc77..402dbda474f4 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -1721,7 +1721,7 @@ void DrawViewShell::InsertURLButton(const OUString& rURL, const OUString& rText,
void DrawViewShell::ShowUIControls (bool bVisible)
{
ViewShell::ShowUIControls (bVisible);
- maTabControl.Show (bVisible);
+ maTabControl->Show (bVisible);
}
namespace slideshowhelp
diff --git a/sd/source/ui/view/drviewsi.cxx b/sd/source/ui/view/drviewsi.cxx
index e969c84a3a16..930e9b0305ce 100644
--- a/sd/source/ui/view/drviewsi.cxx
+++ b/sd/source/ui/view/drviewsi.cxx
@@ -164,10 +164,10 @@ void DrawViewShell::AssignFrom3DWindow()
}
else
{
- InfoBox aInfoBox (
+ ScopedVclPtrInstance<InfoBox> aInfoBox (
GetActiveWindow(),
SD_RESSTR(STR_ACTION_NOTPOSSIBLE));
- aInfoBox.Execute();
+ aInfoBox->Execute();
}
// get focus back
diff --git a/sd/source/ui/view/grviewsh.cxx b/sd/source/ui/view/grviewsh.cxx
index 751fb19e92e6..9f17bae6e0a1 100644
--- a/sd/source/ui/view/grviewsh.cxx
+++ b/sd/source/ui/view/grviewsh.cxx
@@ -52,7 +52,7 @@ void GraphicViewShell::ConstructGraphicViewShell()
{
meShellType = ST_DRAW;
- mpLayerTabBar.reset (new LayerTabBar(this, GetParentWindow()));
+ mpLayerTabBar.reset (VclPtr<LayerTabBar>::Create(this, GetParentWindow()));
// #i67363# no layer tabbar in preview mode
if ( !GetObjectShell()->IsPreview() )
diff --git a/sd/source/ui/view/sdruler.cxx b/sd/source/ui/view/sdruler.cxx
index ba5c97e66fb0..12e3a6089834 100644
--- a/sd/source/ui/view/sdruler.cxx
+++ b/sd/source/ui/view/sdruler.cxx
@@ -92,10 +92,17 @@ Ruler::Ruler( DrawViewShell& rViewSh, vcl::Window* pParent, ::sd::Window* pWin,
Ruler::~Ruler()
{
+ disposeOnce();
+}
+
+void Ruler::dispose()
+{
SfxBindings& rBindings = pCtrlItem->GetBindings();
rBindings.EnterRegistrations();
delete pCtrlItem;
rBindings.LeaveRegistrations();
+ pSdWin.clear();
+ SvxRuler::dispose();
}
void Ruler::MouseButtonDown(const MouseEvent& rMEvt)
diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx
index a229e4df2afa..0803ae9d43c1 100644
--- a/sd/source/ui/view/sdview2.cxx
+++ b/sd/source/ui/view/sdview2.cxx
@@ -76,7 +76,7 @@ using namespace ::com::sun::star;
struct SdNavigatorDropEvent : public ExecuteDropEvent
{
DropTargetHelper& mrTargetHelper;
- ::sd::Window* mpTargetWindow;
+ VclPtr<::sd::Window> mpTargetWindow;
sal_uInt16 mnPage;
sal_uInt16 mnLayer;
diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx
index 2165faaa8355..aea13b4434b4 100644
--- a/sd/source/ui/view/sdwindow.cxx
+++ b/sd/source/ui/view/sdwindow.cxx
@@ -94,12 +94,19 @@ Window::Window(vcl::Window* pParent)
Window::~Window()
{
+ disposeOnce();
+}
+
+void Window::dispose()
+{
if (mpViewShell != NULL)
{
WindowUpdater* pWindowUpdater = mpViewShell->GetWindowUpdater();
if (pWindowUpdater != NULL)
pWindowUpdater->UnregisterWindow (this);
}
+ mpShareWin.clear();
+ vcl::Window::dispose();
}
void Window::SetViewShell (ViewShell* pViewSh)
diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx
index ea5e50cd4ee5..7d0bed8e3cde 100644
--- a/sd/source/ui/view/viewshe2.cxx
+++ b/sd/source/ui/view/viewshe2.cxx
@@ -648,7 +648,7 @@ void ViewShell::SetActiveWindow (::sd::Window* pWin)
}
}
- if (mpActiveWindow != pWin)
+ if (mpActiveWindow.get() != pWin)
mpActiveWindow = pWin;
// The rest of this function is not guarded anymore against calling this
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index c55978711639..a620624fbd7f 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -151,7 +151,7 @@ ViewShell::~ViewShell()
delete mpZoomList;
- mpLayerTabBar.reset();
+ mpLayerTabBar.disposeAndClear();
if (mpImpl->mpSubShellFactory.get() != NULL)
GetViewShellBase().GetViewShellManager()->RemoveSubShellFactory(
@@ -163,8 +163,14 @@ ViewShell::~ViewShell()
"sd.ui",
"destroying mpContentWindow at " << mpContentWindow.get()
<< " with parent " << mpContentWindow->GetParent());
- mpContentWindow.reset();
+ mpContentWindow.disposeAndClear();
}
+
+ mpScrollBarBox.disposeAndClear();
+ mpVerticalRuler.disposeAndClear();
+ mpHorizontalRuler.disposeAndClear();
+ mpVerticalScrollBar.disposeAndClear();
+ mpHorizontalScrollBar.disposeAndClear();
}
/**
@@ -204,16 +210,16 @@ void ViewShell::construct()
if ( ! GetDocSh()->IsPreview())
{
// Create scroll bars and the filler between the scroll bars.
- mpHorizontalScrollBar.reset (new ScrollBar(GetParentWindow(), WinBits(WB_HSCROLL | WB_DRAG)));
+ mpHorizontalScrollBar.reset (VclPtr<ScrollBar>::Create(GetParentWindow(), WinBits(WB_HSCROLL | WB_DRAG)));
mpHorizontalScrollBar->EnableRTL (false);
mpHorizontalScrollBar->SetRange(Range(0, 32000));
mpHorizontalScrollBar->SetScrollHdl(LINK(this, ViewShell, HScrollHdl));
- mpVerticalScrollBar.reset (new ScrollBar(GetParentWindow(), WinBits(WB_VSCROLL | WB_DRAG)));
+ mpVerticalScrollBar.reset (VclPtr<ScrollBar>::Create(GetParentWindow(), WinBits(WB_VSCROLL | WB_DRAG)));
mpVerticalScrollBar->SetRange(Range(0, 32000));
mpVerticalScrollBar->SetScrollHdl(LINK(this, ViewShell, VScrollHdl));
- mpScrollBarBox.reset(new ScrollBarBox(GetParentWindow(), WB_SIZEABLE));
+ mpScrollBarBox.reset(VclPtr<ScrollBarBox>::Create(GetParentWindow(), WB_SIZEABLE));
}
OUString aName( "ViewShell" );
@@ -891,7 +897,7 @@ void ViewShell::Resize()
{
SetupRulers ();
- if (mpParentWindow == NULL)
+ if (mpParentWindow == nullptr)
return;
// Make sure that the new size is not degenerate.
diff --git a/sfx2/inc/inettbc.hxx b/sfx2/inc/inettbc.hxx
index 9bcfe6aeed57..dcc6b1120076 100644
--- a/sfx2/inc/inettbc.hxx
+++ b/sfx2/inc/inettbc.hxx
@@ -53,7 +53,7 @@ public:
SfxURLToolBoxControl_Impl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rBox );
virtual ~SfxURLToolBoxControl_Impl();
- virtual vcl::Window* CreateItemWindow( vcl::Window* pParent ) SAL_OVERRIDE;
+ virtual VclPtr<vcl::Window> CreateItemWindow( vcl::Window* pParent ) SAL_OVERRIDE;
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) SAL_OVERRIDE;
};
diff --git a/sfx2/inc/srchdlg.hxx b/sfx2/inc/srchdlg.hxx
index 95b7a00c8ada..2b71b76f7d99 100644
--- a/sfx2/inc/srchdlg.hxx
+++ b/sfx2/inc/srchdlg.hxx
@@ -36,12 +36,12 @@ namespace sfx2 {
class SearchDialog : public ModelessDialog
{
private:
- ComboBox* m_pSearchEdit;
- CheckBox* m_pWholeWordsBox;
- CheckBox* m_pMatchCaseBox;
- CheckBox* m_pWrapAroundBox;
- CheckBox* m_pBackwardsBox;
- PushButton* m_pFindBtn;
+ VclPtr<ComboBox> m_pSearchEdit;
+ VclPtr<CheckBox> m_pWholeWordsBox;
+ VclPtr<CheckBox> m_pMatchCaseBox;
+ VclPtr<CheckBox> m_pWrapAroundBox;
+ VclPtr<CheckBox> m_pBackwardsBox;
+ VclPtr<PushButton> m_pFindBtn;
Link m_aFindHdl;
Link m_aCloseHdl;
@@ -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/appopen.cxx b/sfx2/source/appl/appopen.cxx
index 582a4b8e935d..47938744425e 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -462,8 +462,8 @@ void SfxApplication::NewDocExec_Impl( SfxRequest& rReq )
bool bNewWin = false;
vcl::Window* pTopWin = GetTopWindow();
- SfxTemplateManagerDlg aTemplDlg;
- int nRet = aTemplDlg.Execute();
+ ScopedVclPtrInstance< SfxTemplateManagerDlg > aTemplDlg;
+ int nRet = aTemplDlg->Execute();
if ( nRet == RET_OK )
{
rReq.Done();
@@ -831,11 +831,11 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
SolarMutexGuard aGuard;
vcl::Window *pWindow = SfxGetpApp()->GetTopWindow();
- MessageDialog aSecurityWarningBox(pWindow,
+ ScopedVclPtrInstance<MessageDialog> aSecurityWarningBox(pWindow,
SfxResId(STR_SECURITY_WARNING_NO_HYPERLINKS),
VCL_MESSAGE_WARNING);
- aSecurityWarningBox.SetText( SfxResId(RID_SECURITY_WARNING_TITLE).toString() );
- aSecurityWarningBox.Execute();
+ aSecurityWarningBox->SetText( SfxResId(RID_SECURITY_WARNING_TITLE).toString() );
+ aSecurityWarningBox->Execute();
return;
}
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index d985a1efdc14..b60da280bf12 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -451,8 +451,8 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
case SID_SHOW_LICENSE:
{
- LicenseDialog aDialog;
- aDialog.Execute();
+ ScopedVclPtrInstance< LicenseDialog > aDialog;
+ aDialog->Execute();
break;
}
@@ -539,16 +539,16 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
case SID_TEMPLATE_MANAGER:
{
- SfxTemplateManagerDlg dlg;
- dlg.Execute();
+ ScopedVclPtrInstance< SfxTemplateManagerDlg > dlg;
+ dlg->Execute();
bDone = true;
break;
}
case SID_TEMPLATE_ADDRESSBOKSOURCE:
{
- svt::AddressBookSourceDialog aDialog(GetTopWindow(), ::comphelper::getProcessComponentContext());
- aDialog.Execute();
+ ScopedVclPtrInstance< svt::AddressBookSourceDialog > aDialog(GetTopWindow(), ::comphelper::getProcessComponentContext());
+ aDialog->Execute();
bDone = true;
break;
}
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index 2a904ca2421c..e1f2ecd40809 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -160,7 +160,6 @@ SfxChildWindow::SfxChildWindow(vcl::Window *pParentWindow, sal_uInt16 nId)
: pParent(pParentWindow)
, nType(nId)
, eChildAlignment(SfxChildAlignment::NOALIGNMENT)
- , pWindow(0L)
{
pImp = new SfxChildWindow_Impl;
pImp->pFact = 0L;
@@ -199,7 +198,7 @@ void SfxChildWindow::Destroy()
SfxChildWindow::~SfxChildWindow()
{
delete pContext;
- delete pWindow;
+ pWindow.disposeAndClear();
delete pImp;
}
@@ -336,16 +335,16 @@ SfxChildWinInfo SfxChildWindow::GetInfo() const
sal_uIntPtr nMask = WINDOWSTATE_MASK_POS | WINDOWSTATE_MASK_STATE;
if ( pWindow->GetStyle() & WB_SIZEABLE )
nMask |= ( WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT );
- aInfo.aWinState = static_cast<SystemWindow*>(pWindow)->GetWindowState( nMask );
+ aInfo.aWinState = static_cast<SystemWindow*>(pWindow.get())->GetWindowState( nMask );
}
else if ( pWindow->GetType() == RSC_DOCKINGWINDOW )
{
- if (static_cast<DockingWindow*>(pWindow)->GetFloatingWindow() )
- aInfo.aWinState = static_cast<DockingWindow*>(pWindow)->GetFloatingWindow()->GetWindowState();
+ if (static_cast<DockingWindow*>(pWindow.get())->GetFloatingWindow() )
+ aInfo.aWinState = static_cast<DockingWindow*>(pWindow.get())->GetFloatingWindow()->GetWindowState();
else
{
SfxChildWinInfo aTmpInfo;
- static_cast<SfxDockingWindow*>(pWindow)->FillInfo( aTmpInfo );
+ static_cast<SfxDockingWindow*>(pWindow.get())->FillInfo( aTmpInfo );
aInfo.aExtraString = aTmpInfo.aExtraString;
}
}
@@ -511,14 +510,13 @@ void SfxChildWindow::CreateContext( sal_uInt16 nContextId, SfxBindings& rBinding
}
SfxChildWindowContext::SfxChildWindowContext( sal_uInt16 nId )
- : pWindow( NULL )
- , nContextId( nId )
+ : nContextId( nId )
{
}
SfxChildWindowContext::~SfxChildWindowContext()
{
- delete pWindow;
+ pWindow.disposeAndClear();
}
FloatingWindow* SfxChildWindowContext::GetFloatingWindow() const
@@ -654,10 +652,10 @@ void SfxChildWindow::Hide()
switch ( pWindow->GetType() )
{
case RSC_DOCKINGWINDOW :
- static_cast<DockingWindow*>(pWindow)->Hide();
+ static_cast<DockingWindow*>(pWindow.get())->Hide();
break;
case RSC_TOOLBOX :
- static_cast<ToolBox*>(pWindow)->Hide();
+ static_cast<ToolBox*>(pWindow.get())->Hide();
break;
default:
pWindow->Hide();
@@ -670,10 +668,10 @@ void SfxChildWindow::Show( sal_uInt16 nFlags )
switch ( pWindow->GetType() )
{
case RSC_DOCKINGWINDOW :
- static_cast<DockingWindow*>(pWindow)->Show( true, nFlags );
+ static_cast<DockingWindow*>(pWindow.get())->Show( true, nFlags );
break;
case RSC_TOOLBOX :
- static_cast<ToolBox*>(pWindow)->Show( true, nFlags );
+ static_cast<ToolBox*>(pWindow.get())->Show( true, nFlags );
break;
default:
pWindow->Show( true, nFlags );
diff --git a/sfx2/source/appl/fileobj.hxx b/sfx2/source/appl/fileobj.hxx
index 85fb53b33a9c..5e2a5fddfcc1 100644
--- a/sfx2/source/appl/fileobj.hxx
+++ b/sfx2/source/appl/fileobj.hxx
@@ -35,7 +35,7 @@ class SvFileObject : public sfx2::SvLinkSource
SfxMediumRef xMed;
ImplSVEvent* nPostUserEventId;
SfxMediumRef* pDelMed;
- vcl::Window* pOldParent;
+ VclPtr<vcl::Window> pOldParent;
sal_uInt8 nType;
diff --git a/sfx2/source/appl/helpinterceptor.hxx b/sfx2/source/appl/helpinterceptor.hxx
index e34686e7b40d..a990518bc7a4 100644
--- a/sfx2/source/appl/helpinterceptor.hxx
+++ b/sfx2/source/appl/helpinterceptor.hxx
@@ -28,6 +28,7 @@
#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/frame/XStatusListener.hpp>
#include <tools/link.hxx>
+#include <vcl/vclptr.hxx>
#include <vector>
struct HelpHistoryEntry_Impl
@@ -63,7 +64,7 @@ friend class SfxHelpWindow_Impl;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > m_xListener;
HelpHistoryList_Impl* m_pHistory;
- SfxHelpWindow_Impl* m_pWindow;
+ VclPtr<SfxHelpWindow_Impl> m_pWindow;
sal_uIntPtr m_nCurPos;
OUString m_aCurrentURL;
com::sun::star::uno::Any m_aViewData;
diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx
index aa829e21a54f..11aecd90473f 100644
--- a/sfx2/source/appl/impldde.cxx
+++ b/sfx2/source/appl/impldde.cxx
@@ -57,14 +57,16 @@ namespace sfx2
class SvDDELinkEditDialog : public ModalDialog
{
- Edit *m_pEdDdeApp;
- Edit *m_pEdDdeTopic;
- Edit *m_pEdDdeItem;
- OKButton *m_pOKButton;
+ VclPtr<Edit> m_pEdDdeApp;
+ VclPtr<Edit> m_pEdDdeTopic;
+ VclPtr<Edit> m_pEdDdeItem;
+ VclPtr<OKButton> m_pOKButton;
DECL_STATIC_LINK( SvDDELinkEditDialog, EditHdl_Impl, Edit* );
public:
SvDDELinkEditDialog( vcl::Window* pParent, SvBaseLink* );
+ virtual ~SvDDELinkEditDialog();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetCmd() const;
};
@@ -90,6 +92,20 @@ SvDDELinkEditDialog::SvDDELinkEditDialog( vcl::Window* pParent, SvBaseLink* pLin
m_pOKButton->Enable( !sServer.isEmpty() && !sTopic.isEmpty() && !sItem.isEmpty() );
}
+SvDDELinkEditDialog::~SvDDELinkEditDialog()
+{
+ disposeOnce();
+}
+
+void SvDDELinkEditDialog::dispose()
+{
+ m_pEdDdeApp.clear();
+ m_pEdDdeTopic.clear();
+ m_pEdDdeItem.clear();
+ m_pOKButton.clear();
+ ModalDialog::dispose();
+}
+
OUString SvDDELinkEditDialog::GetCmd() const
{
OUString sCmd( m_pEdDdeApp->GetText() ), sRet;
@@ -255,10 +271,10 @@ bool SvDDEObject::Connect( SvBaseLink * pSvLink )
void SvDDEObject::Edit( vcl::Window* pParent, sfx2::SvBaseLink* pBaseLink, const Link& rEndEditHdl )
{
- SvDDELinkEditDialog aDlg( pParent, pBaseLink );
- if ( RET_OK == aDlg.Execute() && rEndEditHdl.IsSet() )
+ ScopedVclPtrInstance< SvDDELinkEditDialog > aDlg(pParent, pBaseLink);
+ if ( RET_OK == aDlg->Execute() && rEndEditHdl.IsSet() )
{
- OUString sCommand = aDlg.GetCmd();
+ OUString sCommand = aDlg->GetCmd();
rEndEditHdl.Call( &sCommand );
}
}
diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx
index d06c54df8e4f..8834962b8762 100644
--- a/sfx2/source/appl/lnkbase2.cxx
+++ b/sfx2/source/appl/lnkbase2.cxx
@@ -45,8 +45,8 @@ class ImplDdeItem;
struct BaseLink_Impl
{
Link m_aEndEditLink;
- LinkManager* m_pLinkMgr;
- vcl::Window* m_pParentWin;
+ LinkManager* m_pLinkMgr;
+ VclPtr<vcl::Window> m_pParentWin;
FileDialogHelper* m_pFileDlg;
bool m_bIsConnect;
diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx
index 7ea881fa76a8..150563429e07 100644
--- a/sfx2/source/appl/module.cxx
+++ b/sfx2/source/appl/module.cxx
@@ -33,6 +33,7 @@
#include <sfx2/docfac.hxx>
#include <sfx2/objface.hxx>
#include <sfx2/viewfrm.hxx>
+#include <sfx2/tabdlg.hxx>
#include <svl/intitem.hxx>
#include <sfx2/taskpane.hxx>
#include <tools/diagnose_ex.h>
@@ -331,9 +332,9 @@ ImageList* SfxModule::GetImageList_Impl( bool bBig )
return pImpl->GetImageList( pResMgr, bBig );
}
-SfxTabPage* SfxModule::CreateTabPage( sal_uInt16, vcl::Window*, const SfxItemSet& )
+VclPtr<SfxTabPage> SfxModule::CreateTabPage( sal_uInt16, vcl::Window*, const SfxItemSet& )
{
- return NULL;
+ return VclPtr<SfxTabPage>();
}
SfxModuleArr_Impl& SfxModule::GetModules_Impl()
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 9d92d78820cc..25a45ce97baf 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()
{
+ disposeOnce();
+}
+
+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()
@@ -426,6 +432,17 @@ HelpTabPage_Impl::HelpTabPage_Impl(vcl::Window* pParent, SfxHelpIndexWindow_Impl
{
}
+HelpTabPage_Impl::~HelpTabPage_Impl()
+{
+ disposeOnce();
+}
+
+void HelpTabPage_Impl::dispose()
+{
+ m_pIdxWin.clear();
+ TabPage::dispose();
+}
+
// class ContentTabPage_Impl ---------------------------------------------
ContentTabPage_Impl::ContentTabPage_Impl(vcl::Window* pParent, SfxHelpIndexWindow_Impl* _pIdxWin)
: HelpTabPage_Impl(pParent, _pIdxWin, "HelpContentPage",
@@ -437,6 +454,17 @@ ContentTabPage_Impl::ContentTabPage_Impl(vcl::Window* pParent, SfxHelpIndexWindo
m_pContentBox->set_height_request(aSize.Height());
}
+ContentTabPage_Impl::~ContentTabPage_Impl()
+{
+ disposeOnce();
+}
+
+void ContentTabPage_Impl::dispose()
+{
+ m_pContentBox.clear();
+ HelpTabPage_Impl::dispose();
+}
+
void ContentTabPage_Impl::ActivatePage()
{
if ( !m_pIdxWin->WasCursorLeftOrRight() )
@@ -545,7 +573,15 @@ IndexTabPage_Impl::IndexTabPage_Impl(vcl::Window* pParent, SfxHelpIndexWindow_Im
IndexTabPage_Impl::~IndexTabPage_Impl()
{
+ disposeOnce();
+}
+
+void IndexTabPage_Impl::dispose()
+{
ClearIndex();
+ m_pIndexCB.clear();
+ m_pOpenBtn.clear();
+ HelpTabPage_Impl::dispose();
}
@@ -946,6 +982,11 @@ SearchTabPage_Impl::SearchTabPage_Impl(vcl::Window* pParent, SfxHelpIndexWindow_
SearchTabPage_Impl::~SearchTabPage_Impl()
{
+ disposeOnce();
+}
+
+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 +1008,14 @@ SearchTabPage_Impl::~SearchTabPage_Impl()
aUserData = comphelper::string::stripEnd(aUserData, ';');
Any aUserItem = makeAny( OUString( aUserData ) );
aViewOpt.SetUserItem( USERITEM_NAME, aUserItem );
+
+ m_pSearchED.clear();
+ m_pSearchBtn.clear();
+ m_pFullWordsCB.clear();
+ m_pScopeCB.clear();
+ m_pResultsLB.clear();
+ m_pOpenBtn.clear();
+ HelpTabPage_Impl::dispose();
}
@@ -1030,8 +1079,8 @@ IMPL_LINK_NOARG(SearchTabPage_Impl, SearchHdl)
if ( aFactories.empty() )
{
- MessageDialog aBox( this, SfxResId( STR_INFO_NOSEARCHRESULTS ), VCL_MESSAGE_INFO );
- aBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aBox(this, SfxResId( STR_INFO_NOSEARCHRESULTS ), VCL_MESSAGE_INFO);
+ aBox->Execute();
}
}
return 0;
@@ -1141,6 +1190,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeBookmarksBox(vcl::Wind
BookmarksBox_Impl::~BookmarksBox_Impl()
{
+ disposeOnce();
+}
+
+void BookmarksBox_Impl::dispose()
+{
// save bookmarks to configuration
SvtHistoryOptions aHistOpt;
aHistOpt.Clear( eHELPBOOKMARKS );
@@ -1153,6 +1207,7 @@ BookmarksBox_Impl::~BookmarksBox_Impl()
aHistOpt.AppendItem(eHELPBOOKMARKS, *pURL, sEmpty, aTitle, sEmpty, sEmpty);
delete pURL;
}
+ ListBox::dispose();
}
@@ -1170,15 +1225,15 @@ void BookmarksBox_Impl::DoAction( sal_uInt16 nAction )
sal_Int32 nPos = GetSelectEntryPos();
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- SfxAddHelpBookmarkDialog_Impl aDlg( this, true );
- aDlg.SetTitle( GetEntry( nPos ) );
- if ( aDlg.Execute() == RET_OK )
+ ScopedVclPtrInstance< SfxAddHelpBookmarkDialog_Impl > aDlg(this, true);
+ aDlg->SetTitle( GetEntry( nPos ) );
+ if ( aDlg->Execute() == RET_OK )
{
OUString* pURL = static_cast<OUString*>(GetEntryData( nPos ));
RemoveEntry( nPos );
OUString aImageURL = IMAGE_URL;
aImageURL += INetURLObject( *pURL ).GetHost();
- nPos = InsertEntry( aDlg.GetTitle(), SvFileInformationManager::GetImage( INetURLObject(aImageURL), false ) );
+ nPos = InsertEntry( aDlg->GetTitle(), SvFileInformationManager::GetImage( INetURLObject(aImageURL), false ) );
SetEntryData( nPos, new OUString( *pURL ) );
SelectEntryPos( nPos );
delete pURL;
@@ -1271,6 +1326,17 @@ BookmarksTabPage_Impl::BookmarksTabPage_Impl(vcl::Window* pParent, SfxHelpIndexW
}
}
+BookmarksTabPage_Impl::~BookmarksTabPage_Impl()
+{
+ disposeOnce();
+}
+
+void BookmarksTabPage_Impl::dispose()
+{
+ m_pBookmarksBox.clear();
+ m_pBookmarksPB.clear();
+ HelpTabPage_Impl::dispose();
+}
IMPL_LINK_NOARG(BookmarksTabPage_Impl, OpenHdl)
@@ -1416,18 +1482,29 @@ SfxHelpIndexWindow_Impl::SfxHelpIndexWindow_Impl(SfxHelpWindow_Impl* _pParent)
SfxHelpIndexWindow_Impl::~SfxHelpIndexWindow_Impl()
{
+ disposeOnce();
+}
+
+void SfxHelpIndexWindow_Impl::dispose()
+{
sfx2::RemoveFromTaskPaneList( this );
- DELETEZ( pCPage );
- DELETEZ( pIPage );
- DELETEZ( pSPage );
- DELETEZ( pBPage );
+ pCPage.disposeAndClear();
+ pIPage.disposeAndClear();
+ pSPage.disposeAndClear();
+ pBPage.disposeAndClear();
for ( sal_uInt16 i = 0; i < m_pActiveLB->GetEntryCount(); ++i )
delete static_cast<OUString*>(m_pActiveLB->GetEntryData(i));
SvtViewOptions aViewOpt( E_TABDIALOG, CONFIGNAME_INDEXWIN );
aViewOpt.SetPageID( (sal_Int32)m_pTabCtrl->GetCurPageId() );
+
+ disposeBuilder();
+ m_pActiveLB.clear();
+ m_pTabCtrl.clear();
+ pParentWin.clear();
+ vcl::Window::dispose();
}
@@ -1805,10 +1882,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,15 +1903,15 @@ 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 ( VclPtr<ToolBox>::Create(this, 0) ),
+ aOnStartupCB ( VclPtr<CheckBox>::Create(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() ),
aIndexOffText ( SfxResId( STR_HELP_BUTTON_INDEX_OFF ).toString() ),
aOnStartupText ( SfxResId( RID_HELP_ONSTARTUP_TEXT ).toString() ),
pHelpWin ( pParent ),
- pTextWin ( new TextWin_Impl( this ) ),
+ pTextWin ( VclPtr<TextWin_Impl>::Create( this ) ),
pSrchDlg ( NULL ),
nMinPos ( 0 ),
bIsDebug ( false ),
@@ -1847,36 +1920,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 +1960,29 @@ 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 );
+ disposeOnce();
+}
+
+void SfxHelpTextWindow_Impl::dispose()
+{
+ sfx2::RemoveFromTaskPaneList( aToolBox.get() );
bIsInClose = true;
SvtMiscOptions().RemoveListenerLink( LINK( this, SfxHelpTextWindow_Impl, NotifyHdl ) );
- delete pSrchDlg;
+ pSrchDlg.disposeAndClear();
+ aToolBox.disposeAndClear();
+ aOnStartupCB.disposeAndClear();
+ pHelpWin.clear();
+ pTextWin.disposeAndClear();
+ vcl::Window::dispose();
}
@@ -1928,39 +2011,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 +2081,7 @@ void SfxHelpTextWindow_Impl::InitOnStartupBox( bool bOnlyText )
}
if ( bHideBox )
- aOnStartupCB.Hide();
+ aOnStartupCB->Hide();
else
{
// detect module name
@@ -2025,20 +2108,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 +2129,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 +2144,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 +2264,7 @@ IMPL_LINK( SfxHelpTextWindow_Impl, NotifyHdl, SvtMiscOptions*, pOptions )
(void)pOptions; // unused variable
InitToolBoxImages();
Resize();
- aToolBox.Invalidate();
+ aToolBox->Invalidate();
return 0;
}
@@ -2254,8 +2337,8 @@ IMPL_LINK( SfxHelpTextWindow_Impl, FindHdl, sfx2::SearchDialog*, pDlg )
else
{
DBG_ASSERT( pSrchDlg, "no search dialog" );
- MessageDialog aBox( pSrchDlg, SfxResId( STR_INFO_NOSEARCHTEXTFOUND ), VCL_MESSAGE_INFO );
- aBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aBox(pSrchDlg, SfxResId( STR_INFO_NOSEARCHTEXTFOUND ), VCL_MESSAGE_INFO);
+ aBox->Execute();
pSrchDlg->SetFocusOnEdit();
}
}
@@ -2271,11 +2354,9 @@ IMPL_LINK( SfxHelpTextWindow_Impl, FindHdl, sfx2::SearchDialog*, pDlg )
-IMPL_LINK( SfxHelpTextWindow_Impl, CloseHdl, sfx2::SearchDialog*, pDlg )
+IMPL_LINK( SfxHelpTextWindow_Impl, CloseHdl, sfx2::SearchDialog*, /*pDlg*/ )
{
- if ( pDlg )
- delete pSrchDlg;
- pSrchDlg = NULL;
+ pSrchDlg.clear();
return 0;
}
@@ -2308,7 +2389,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 +2406,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 +2511,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 +2565,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 );
}
}
@@ -2587,7 +2668,7 @@ void SfxHelpTextWindow_Impl::DoSearch()
if ( !pSrchDlg )
{
// create the search dialog
- pSrchDlg = new sfx2::SearchDialog( pTextWin, "HelpSearchDialog" );
+ pSrchDlg = VclPtr<sfx2::SearchDialog>::Create( pTextWin, "HelpSearchDialog" );
// set handler
pSrchDlg->SetFindHdl( LINK( this, SfxHelpTextWindow_Impl, FindHdl ) );
pSrchDlg->SetCloseHdl( LINK( this, SfxHelpTextWindow_Impl, CloseHdl ) );
@@ -2974,12 +3055,12 @@ SfxHelpWindow_Impl::SfxHelpWindow_Impl(
SetStyle( GetStyle() | WB_DIALOGCONTROL );
pHelpInterceptor->InitWaiter( this );
- pIndexWin = new SfxHelpIndexWindow_Impl( this );
+ pIndexWin = VclPtr<SfxHelpIndexWindow_Impl>::Create( this );
pIndexWin->SetDoubleClickHdl( LINK( this, SfxHelpWindow_Impl, OpenHdl ) );
pIndexWin->SetSelectFactoryHdl( LINK( this, SfxHelpWindow_Impl, SelectFactoryHdl ) );
pIndexWin->SetSizePixel(LogicToPixel(Size(120, 200), MAP_APPFONT));
pIndexWin->Show();
- pTextWin = new SfxHelpTextWindow_Impl( this );
+ pTextWin = VclPtr<SfxHelpTextWindow_Impl>::Create( this );
Reference < XFrames > xFrames = rFrame->getFrames();
xFrames->append( Reference<XFrame>(pTextWin->getFrame(), UNO_QUERY_THROW) );
pTextWin->SetSelectHdl( LINK( this, SfxHelpWindow_Impl, SelectHdl ) );
@@ -2993,13 +3074,16 @@ SfxHelpWindow_Impl::SfxHelpWindow_Impl(
SfxHelpWindow_Impl::~SfxHelpWindow_Impl()
{
- SaveConfig();
- vcl::Window* pDel = pIndexWin;
- pIndexWin = NULL;
- delete pDel;
+ disposeOnce();
+}
+void SfxHelpWindow_Impl::dispose()
+{
+ SaveConfig();
+ pIndexWin.disposeAndClear();
pTextWin->CloseFrame();
- delete pTextWin;
+ pTextWin.disposeAndClear();
+ SplitWindow::dispose();
}
bool SfxHelpWindow_Impl::PreNotify( NotifyEvent& rNEvt )
@@ -3127,11 +3211,11 @@ void SfxHelpWindow_Impl::DoAction( sal_uInt16 nActionId )
if ( aAny >>= aValue )
{
OUString aTitle( aValue );
- SfxAddHelpBookmarkDialog_Impl aDlg( this, false );
- aDlg.SetTitle( aTitle );
- if ( aDlg.Execute() == RET_OK )
+ ScopedVclPtrInstance< SfxAddHelpBookmarkDialog_Impl > aDlg(this, false);
+ aDlg->SetTitle( aTitle );
+ if ( aDlg->Execute() == RET_OK )
{
- aTitle = aDlg.GetTitle();
+ aTitle = aDlg->GetTitle();
pIndexWin->AddBookmarks( aTitle, aURL );
}
}
@@ -3206,7 +3290,16 @@ SfxAddHelpBookmarkDialog_Impl::SfxAddHelpBookmarkDialog_Impl(vcl::Window* pParen
SetText(get<FixedText>("alttitle")->GetText());
}
+SfxAddHelpBookmarkDialog_Impl::~SfxAddHelpBookmarkDialog_Impl()
+{
+ disposeOnce();
+}
+void SfxAddHelpBookmarkDialog_Impl::dispose()
+{
+ m_pTitleED.clear();
+ ModalDialog::dispose();
+}
void SfxAddHelpBookmarkDialog_Impl::SetTitle( const OUString& rTitle )
{
diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx
index 4ccf236b2049..add82d178f9b 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;
@@ -76,11 +76,13 @@ class SfxHelpIndexWindow_Impl;
class HelpTabPage_Impl : public TabPage
{
protected:
- SfxHelpIndexWindow_Impl* m_pIdxWin;
+ VclPtr<SfxHelpIndexWindow_Impl> m_pIdxWin;
public:
HelpTabPage_Impl(vcl::Window* pParent, SfxHelpIndexWindow_Impl* _pIdxWin,
const OString& rID, const OUString& rUIXMLDescription);
+ virtual ~HelpTabPage_Impl();
+ virtual void dispose() SAL_OVERRIDE;
virtual Control* GetLastFocusControl() = 0;
};
@@ -90,10 +92,12 @@ public:
class ContentTabPage_Impl : public HelpTabPage_Impl
{
private:
- ContentListBox_Impl* m_pContentBox;
+ VclPtr<ContentListBox_Impl> m_pContentBox;
public:
ContentTabPage_Impl(vcl::Window* pParent, SfxHelpIndexWindow_Impl* _pIdxWin);
+ virtual ~ContentTabPage_Impl();
+ virtual void dispose() SAL_OVERRIDE;
virtual void ActivatePage() SAL_OVERRIDE;
virtual Control* GetLastFocusControl() SAL_OVERRIDE;
@@ -119,8 +123,8 @@ public:
class IndexTabPage_Impl : public HelpTabPage_Impl
{
private:
- IndexBox_Impl* m_pIndexCB;
- PushButton* m_pOpenBtn;
+ VclPtr<IndexBox_Impl> m_pIndexCB;
+ VclPtr<PushButton> m_pOpenBtn;
Idle aFactoryIdle;
Timer aKeywordTimer;
@@ -141,6 +145,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;
@@ -195,12 +200,12 @@ public:
class SearchTabPage_Impl : public HelpTabPage_Impl
{
private:
- SearchBox_Impl* m_pSearchED;
- PushButton* m_pSearchBtn;
- CheckBox* m_pFullWordsCB;
- CheckBox* m_pScopeCB;
- SearchResultsBox_Impl* m_pResultsLB;
- PushButton* m_pOpenBtn;
+ VclPtr<SearchBox_Impl> m_pSearchED;
+ VclPtr<PushButton> m_pSearchBtn;
+ VclPtr<CheckBox> m_pFullWordsCB;
+ VclPtr<CheckBox> m_pScopeCB;
+ VclPtr<SearchResultsBox_Impl> m_pResultsLB;
+ VclPtr<PushButton> m_pOpenBtn;
OUString aFactory;
@@ -217,6 +222,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 +248,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;
};
@@ -249,13 +256,15 @@ public:
class BookmarksTabPage_Impl : public HelpTabPage_Impl
{
private:
- BookmarksBox_Impl* m_pBookmarksBox;
- PushButton* m_pBookmarksPB;
+ VclPtr<BookmarksBox_Impl> m_pBookmarksBox;
+ VclPtr<PushButton> m_pBookmarksPB;
DECL_LINK(OpenHdl, void *);
public:
BookmarksTabPage_Impl( vcl::Window* pParent, SfxHelpIndexWindow_Impl* _pIdxWin );
+ virtual ~BookmarksTabPage_Impl();
+ virtual void dispose() SAL_OVERRIDE;
virtual void ActivatePage() SAL_OVERRIDE;
virtual Control* GetLastFocusControl() SAL_OVERRIDE;
@@ -273,8 +282,8 @@ class SfxHelpWindow_Impl;
class SfxHelpIndexWindow_Impl : public vcl::Window, public VclBuilderContainer
{
private:
- ListBox* m_pActiveLB;
- TabControl* m_pTabCtrl;
+ VclPtr<ListBox> m_pActiveLB;
+ VclPtr<TabControl> m_pTabCtrl;
Idle aIdle;
@@ -283,12 +292,12 @@ private:
Link aIndexKeywordLink;
OUString sKeyword;
- SfxHelpWindow_Impl* pParentWin;
+ VclPtr<SfxHelpWindow_Impl> pParentWin;
- ContentTabPage_Impl* pCPage;
- IndexTabPage_Impl* pIPage;
- SearchTabPage_Impl* pSPage;
- BookmarksTabPage_Impl* pBPage;
+ VclPtr<ContentTabPage_Impl> pCPage;
+ VclPtr<IndexTabPage_Impl> pIPage;
+ VclPtr<SearchTabPage_Impl> pSPage;
+ VclPtr<BookmarksTabPage_Impl> pBPage;
long nMinWidth;
bool bWasCursorLeftOrRight;
@@ -312,6 +321,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;
@@ -343,7 +353,7 @@ ContentTabPage_Impl* SfxHelpIndexWindow_Impl::GetContentPage()
{
if ( !pCPage )
{
- pCPage = new ContentTabPage_Impl( m_pTabCtrl, this );
+ pCPage = VclPtr<ContentTabPage_Impl>::Create( m_pTabCtrl, this );
pCPage->SetOpenHdl( aPageDoubleClickLink );
}
return pCPage;
@@ -352,7 +362,7 @@ IndexTabPage_Impl* SfxHelpIndexWindow_Impl::GetIndexPage()
{
if ( !pIPage )
{
- pIPage = new IndexTabPage_Impl( m_pTabCtrl, this );
+ pIPage = VclPtr<IndexTabPage_Impl>::Create( m_pTabCtrl, this );
pIPage->SetDoubleClickHdl( aPageDoubleClickLink );
pIPage->SetKeywordHdl( aIndexKeywordLink );
}
@@ -363,7 +373,7 @@ SearchTabPage_Impl* SfxHelpIndexWindow_Impl::GetSearchPage()
{
if ( !pSPage )
{
- pSPage = new SearchTabPage_Impl( m_pTabCtrl, this );
+ pSPage = VclPtr<SearchTabPage_Impl>::Create( m_pTabCtrl, this );
pSPage->SetDoubleClickHdl( aPageDoubleClickLink );
}
return pSPage;
@@ -373,7 +383,7 @@ BookmarksTabPage_Impl* SfxHelpIndexWindow_Impl::GetBookmarksPage()
{
if ( !pBPage )
{
- pBPage = new BookmarksTabPage_Impl( m_pTabCtrl, this );
+ pBPage = VclPtr<BookmarksTabPage_Impl>::Create( m_pTabCtrl, this );
pBPage->SetDoubleClickHdl( aPageDoubleClickLink );
}
return pBPage;
@@ -392,7 +402,6 @@ class TextWin_Impl : public DockingWindow
{
public:
TextWin_Impl( vcl::Window* pParent );
- virtual ~TextWin_Impl();
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
};
@@ -405,8 +414,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;
@@ -416,9 +425,9 @@ private:
OUString aOnStartupText;
OUString sCurrentFactory;
- SfxHelpWindow_Impl* pHelpWin;
- vcl::Window* pTextWin;
- sfx2::SearchDialog* pSrchDlg;
+ VclPtr<SfxHelpWindow_Impl> pHelpWin;
+ VclPtr<vcl::Window> pTextWin;
+ VclPtr<sfx2::SearchDialog> pSrchDlg;
::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame2 >
xFrame;
::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator >
@@ -426,12 +435,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 +460,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 +470,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();
};
@@ -485,8 +495,8 @@ friend class SfxHelpIndexWindow_Impl;
::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame2 >
xFrame;
- SfxHelpIndexWindow_Impl* pIndexWin;
- SfxHelpTextWindow_Impl* pTextWin;
+ VclPtr<SfxHelpIndexWindow_Impl> pIndexWin;
+ VclPtr<SfxHelpTextWindow_Impl> pTextWin;
HelpInterceptor_Impl* pHelpInterceptor;
HelpListener_Impl* pHelpListener;
@@ -519,6 +529,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;
@@ -556,9 +567,11 @@ public:
class SfxAddHelpBookmarkDialog_Impl : public ModalDialog
{
private:
- Edit* m_pTitleED;
+ VclPtr<Edit> m_pTitleED;
public:
SfxAddHelpBookmarkDialog_Impl( vcl::Window* pParent, bool bRename = true );
+ virtual ~SfxAddHelpBookmarkDialog_Impl();
+ virtual void dispose() SAL_OVERRIDE;
void SetTitle( const OUString& rTitle );
OUString GetTitle() const { return m_pTitleED->GetText(); }
diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx
index 8c18f4028bf3..4c001886d296 100644
--- a/sfx2/source/appl/opengrf.cxx
+++ b/sfx2/source/appl/opengrf.cxx
@@ -158,8 +158,8 @@ short SvxOpenGraphicDialog::Execute()
// could not load?
if ( nFound == USHRT_MAX )
{
- WarningBox aWarningBox( NULL, WB_3DLOOK | WB_RETRY_CANCEL, SfxResId( SvxOpenGrfErr2ResId(nImpRet) ).toString() );
- bQuitLoop = aWarningBox.Execute() != RET_RETRY;
+ ScopedVclPtrInstance< WarningBox > aWarningBox(nullptr, WB_3DLOOK | WB_RETRY_CANCEL, SfxResId( SvxOpenGrfErr2ResId(nImpRet) ).toString());
+ bQuitLoop = aWarningBox->Execute() != RET_RETRY;
}
else
{
diff --git a/sfx2/source/appl/openuriexternally.cxx b/sfx2/source/appl/openuriexternally.cxx
index ecc347eddd27..beb4deed9ec3 100644
--- a/sfx2/source/appl/openuriexternally.cxx
+++ b/sfx2/source/appl/openuriexternally.cxx
@@ -44,10 +44,10 @@ bool sfx2::openUriExternally(
"unexpected IllegalArgumentException: " + e.Message);
}
SolarMutexGuard g;
- MessageDialog eb(
+ ScopedVclPtrInstance<MessageDialog> eb(
SfxGetpApp()->GetTopWindow(), SfxResId(STR_NO_ABS_URI_REF));
- eb.set_primary_text(eb.get_primary_text().replaceFirst("$(ARG1)", uri));
- eb.Execute();
+ eb->set_primary_text(eb->get_primary_text().replaceFirst("$(ARG1)", uri));
+ eb->Execute();
} catch (css::system::SystemShellExecuteException &) {
if (!handleSystemShellExecuteException) {
throw;
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 247e80e140af..21e56b4c1920 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -402,8 +402,8 @@ SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame2 >& rHelpTask ,
// create all internal windows and sub frames ...
Reference< ::com::sun::star::awt::XWindow > xParentWindow = xHelpTask->getContainerWindow();
- vcl::Window* pParentWindow = VCLUnoHelper::GetWindow( xParentWindow );
- SfxHelpWindow_Impl* pHelpWindow = new SfxHelpWindow_Impl( xHelpTask, pParentWindow, WB_DOCKBORDER );
+ vcl::Window* pParentWindow = VCLUnoHelper::GetWindow( xParentWindow );
+ VclPtrInstance<SfxHelpWindow_Impl> pHelpWindow( xHelpTask, pParentWindow, WB_DOCKBORDER );
Reference< ::com::sun::star::awt::XWindow > xHelpWindow = VCLUnoHelper::GetInterface( pHelpWindow );
Reference< XFrame > xHelpContent;
@@ -429,7 +429,7 @@ SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame2 >& rHelpTask ,
if (!xHelpContent.is())
{
- delete pHelpWindow;
+ pHelpWindow.disposeAndClear();
return NULL;
}
@@ -605,8 +605,8 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const
if ( impl_showOnlineHelp( aHelpURL ) )
return true;
- NoHelpErrorBox aErrBox( const_cast< vcl::Window* >( pWindow ) );
- aErrBox.Execute();
+ ScopedVclPtrInstance< NoHelpErrorBox > aErrBox(const_cast< vcl::Window* >( pWindow ));
+ aErrBox->Execute();
return false;
}
@@ -626,7 +626,7 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const
if (!xHelp.is())
pHelpWindow = impl_createHelp(xHelp, xHelpContent);
else
- pHelpWindow = static_cast<SfxHelpWindow_Impl*>(VCLUnoHelper::GetWindow(xHelp->getComponentWindow()));
+ pHelpWindow = static_cast<SfxHelpWindow_Impl*>(VCLUnoHelper::GetWindow(xHelp->getComponentWindow()).get());
if (!xHelp.is() || !xHelpContent.is() || !pHelpWindow)
return false;
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index 7f3920dcc088..d6ec61c5ff3c 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -569,7 +569,7 @@ SfxFrameWorkWin_Impl::SfxFrameWorkWin_Impl( vcl::Window *pWin, SfxFrame *pFrm, S
n == SFX_SPLITWINDOWS_RIGHT ? SfxChildAlignment::RIGHT :
n == SFX_SPLITWINDOWS_TOP ? SfxChildAlignment::TOP :
SfxChildAlignment::BOTTOM );
- SfxSplitWindow *pSplitWin = new SfxSplitWindow(pWorkWin, eAlign, this, pParent==0 );
+ VclPtr<SfxSplitWindow> pSplitWin = VclPtr<SfxSplitWindow>::Create(pWorkWin, eAlign, this, pParent==0 );
pSplit[n] = pSplitWin;
}
@@ -606,7 +606,6 @@ SfxWorkWindow::SfxWorkWindow( vcl::Window *pWin, SfxBindings& rB, SfxWorkWindow*
m_aTbxTypeName( "private:resource/toolbar/" ),
m_aProgressBarResName( "private:resource/progressbar/progressbar" )
{
- memset(pSplit, 0, sizeof(pSplit));
DBG_ASSERT (pBindings, "No Bindings!");
pBindings->SetWorkWindow_Impl( this );
@@ -633,10 +632,10 @@ SfxWorkWindow::~SfxWorkWindow()
// Delete SplitWindows
for ( sal_uInt16 n=0; n<SFX_SPLITWINDOWS_MAX; n++ )
{
- SfxSplitWindow *p = pSplit[n];
+ VclPtr<SfxSplitWindow> p = pSplit[n];
if (p->GetWindowCount())
ReleaseChild_Impl(*p);
- delete p;
+ pSplit[n].disposeAndClear();
}
// Delete help structure for Child-Windows
@@ -677,8 +676,8 @@ void SfxWorkWindow::DeleteControllers_Impl()
for ( n=0; n<SFX_SPLITWINDOWS_MAX; n++ )
{
SfxSplitWindow *p = pSplit[n];
- if (p->GetWindowCount())
- p->Lock();
+ if (p->GetWindowCount())
+ p->Lock();
}
// Delete Child-Windows
@@ -853,7 +852,7 @@ SvBorder SfxWorkWindow::Arrange_Impl()
case SfxChildAlignment::LOWESTTOP:
aSize.Width() = aTmp.GetWidth();
if ( pCli->pWin->GetType() == WINDOW_SPLITWINDOW )
- aSize = static_cast<SplitWindow *>(pCli->pWin)->CalcLayoutSizePixel( aSize );
+ aSize = static_cast<SplitWindow *>(pCli->pWin.get())->CalcLayoutSizePixel( aSize );
bAllowHiding = false;
aBorder.Top() += aSize.Height();
aPos = aTmp.TopLeft();
@@ -868,7 +867,7 @@ SvBorder SfxWorkWindow::Arrange_Impl()
case SfxChildAlignment::HIGHESTBOTTOM:
aSize.Width() = aTmp.GetWidth();
if ( pCli->pWin->GetType() == WINDOW_SPLITWINDOW )
- aSize = static_cast<SplitWindow *>(pCli->pWin)->CalcLayoutSizePixel( aSize );
+ aSize = static_cast<SplitWindow *>(pCli->pWin.get())->CalcLayoutSizePixel( aSize );
aBorder.Bottom() += aSize.Height();
aPos = aTmp.BottomLeft();
aPos.Y() -= (aSize.Height()-1);
@@ -883,7 +882,7 @@ SvBorder SfxWorkWindow::Arrange_Impl()
case SfxChildAlignment::TOOLBOXLEFT:
aSize.Height() = aTmp.GetHeight();
if ( pCli->pWin->GetType() == WINDOW_SPLITWINDOW )
- aSize = static_cast<SplitWindow *>(pCli->pWin)->CalcLayoutSizePixel( aSize );
+ aSize = static_cast<SplitWindow *>(pCli->pWin.get())->CalcLayoutSizePixel( aSize );
bAllowHiding = false;
aBorder.Left() += aSize.Width();
aPos = aTmp.TopLeft();
@@ -898,7 +897,7 @@ SvBorder SfxWorkWindow::Arrange_Impl()
case SfxChildAlignment::TOOLBOXRIGHT:
aSize.Height() = aTmp.GetHeight();
if ( pCli->pWin->GetType() == WINDOW_SPLITWINDOW )
- aSize = static_cast<SplitWindow *>(pCli->pWin)->CalcLayoutSizePixel( aSize );
+ aSize = static_cast<SplitWindow *>(pCli->pWin.get())->CalcLayoutSizePixel( aSize );
aBorder.Right() += aSize.Width();
aPos = aTmp.TopRight();
aPos.X() -= (aSize.Width()-1);
@@ -1071,10 +1070,10 @@ void SfxWorkWindow::ShowChildren_Impl()
switch ( pCli->pWin->GetType() )
{
case RSC_DOCKINGWINDOW :
- static_cast<DockingWindow*>(pCli->pWin)->Show( true, nFlags );
+ static_cast<DockingWindow*>(pCli->pWin.get())->Show( true, nFlags );
break;
case RSC_SPLITWINDOW :
- static_cast<SplitWindow*>(pCli->pWin)->Show( true, nFlags );
+ static_cast<SplitWindow*>(pCli->pWin.get())->Show( true, nFlags );
break;
default:
pCli->pWin->Show( true, nFlags );
@@ -1088,7 +1087,7 @@ void SfxWorkWindow::ShowChildren_Impl()
switch ( pCli->pWin->GetType() )
{
case RSC_DOCKINGWINDOW :
- static_cast<DockingWindow*>(pCli->pWin)->Hide();
+ static_cast<DockingWindow*>(pCli->pWin.get())->Hide();
break;
default:
pCli->pWin->Hide();
@@ -1111,7 +1110,7 @@ void SfxWorkWindow::HideChildren_Impl()
switch ( pChild->pWin->GetType() )
{
case RSC_DOCKINGWINDOW :
- static_cast<DockingWindow*>(pChild->pWin)->Hide();
+ static_cast<DockingWindow*>(pChild->pWin.get())->Hide();
break;
default:
pChild->pWin->Hide();
@@ -2534,7 +2533,7 @@ bool SfxWorkWindow::IsAutoHideMode( const SfxSplitWindow *pSplitWin )
{
for ( sal_uInt16 n=0; n<SFX_SPLITWINDOWS_MAX; n++ )
{
- if ( pSplit[n] != pSplitWin && pSplit[n]->IsAutoHide( true ) )
+ if ( pSplit[n].get() != pSplitWin && pSplit[n]->IsAutoHide( true ) )
return true;
}
return false;
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 9e0f8de67342..6db9950b47e0 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -534,8 +534,8 @@ bool SfxFilterMatcher::IsFilterInstalled_Impl( const SfxFilter* pFilter )
// Here could a re-installation be offered
OUString aText( SfxResId(STR_FILTER_NOT_INSTALLED).toString() );
aText = aText.replaceFirst( "$(FILTER)", pFilter->GetUIName() );
- QueryBox aQuery( NULL, WB_YES_NO | WB_DEF_YES, aText );
- short nRet = aQuery.Execute();
+ ScopedVclPtrInstance< QueryBox > aQuery(nullptr, WB_YES_NO | WB_DEF_YES, aText);
+ short nRet = aQuery->Execute();
if ( nRet == RET_YES )
{
#ifdef DBG_UTIL
diff --git a/sfx2/source/control/ctrlitem.cxx b/sfx2/source/control/ctrlitem.cxx
index c1fa1624daa5..0be5e36658b7 100644
--- a/sfx2/source/control/ctrlitem.cxx
+++ b/sfx2/source/control/ctrlitem.cxx
@@ -218,16 +218,19 @@ SfxControllerItem::SfxControllerItem( sal_uInt16 nID, SfxBindings &rBindings ):
}
-// unregisteres the item in the bindings
+// unregisters the item in the bindings
SfxControllerItem::~SfxControllerItem()
{
+ dispose();
+}
+
+void SfxControllerItem::dispose()
+{
if ( IsBound() )
pBindings->Release(*this);
}
-
-
void SfxControllerItem::StateChanged
(
sal_uInt16, // <SID> of the triggering slot
diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx
index 9b68a0e09908..dc22fddc1910 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 51b213d7d7e3..408fccb50059 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(VclPtr<PushButton>::Create(this, SfxResId(BTN_ALL_TEMPLATES))),
+ maFTName(VclPtr<FixedText>::Create(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(VclPtr<PushButton>::Create(this, SfxResId(BTN_ALL_TEMPLATES))),
+ maFTName(VclPtr<FixedText>::Create(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()
{
+ disposeOnce();
+}
+
+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 9e2f83a14378..3c42d29b508c 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 ad14ae841b50..c2e42d9a7eae 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()
{
+ disposeOnce();
+}
+
+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 0729a6bdf53c..f33407a8e5f8 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 fb21ac654812..582dd5ad2c2f 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 d85561438987..8c6a30e60d0b 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()
{
+ disposeOnce();
+}
+
+void ThumbnailView::dispose()
+{
com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent>
xComponent(GetAccessible(false),
com::sun::star::uno::UNO_QUERY);
@@ -73,11 +78,12 @@ ThumbnailView::~ThumbnailView()
if (xComponent.is())
xComponent->dispose ();
- delete mpScrBar;
+ mpScrBar.disposeAndClear();
delete mpItemAttrs;
delete mpProcessor;
ImplDeleteItems();
+ Control::dispose();
}
void ThumbnailView::MouseMove(const MouseEvent& rMEvt)
@@ -230,7 +236,7 @@ void ThumbnailView::ImplInitScrollBar()
{
if ( !mpScrBar )
{
- mpScrBar = new ScrollBar( this, WB_VSCROLL | WB_DRAG );
+ mpScrBar = VclPtr<ScrollBar>::Create( this, WB_VSCROLL | WB_DRAG );
mpScrBar->SetScrollHdl( LINK( this, ThumbnailView, ImplScrollHdl ) );
}
else
@@ -270,7 +276,7 @@ void ThumbnailView::CalculateItemPositions (bool bScrollBarUsed)
Size aWinSize = GetOutputSizePixel();
size_t nItemCount = mFilteredItemList.size();
WinBits nStyle = GetStyle();
- ScrollBar* pDelScrBar = NULL;
+ VclPtr<ScrollBar> pDelScrBar;
// consider the scrolling
if ( nStyle & WB_VSCROLL )
@@ -435,7 +441,7 @@ void ThumbnailView::CalculateItemPositions (bool bScrollBarUsed)
}
// delete ScrollBar
- delete pDelScrBar;
+ pDelScrBar.disposeAndClear();
}
size_t ThumbnailView::ImplGetItem( const Point& rPos ) const
diff --git a/sfx2/source/control/thumbnailviewacc.cxx b/sfx2/source/control/thumbnailviewacc.cxx
index c29e797b4c47..598e3034b4e2 100644
--- a/sfx2/source/control/thumbnailviewacc.cxx
+++ b/sfx2/source/control/thumbnailviewacc.cxx
@@ -593,7 +593,7 @@ void ThumbnailViewAcc::ThrowIfDisposed()
}
else
{
- DBG_ASSERT (mpParent!=NULL, "ValueSetAcc not disposed but mpParent == NULL");
+ DBG_ASSERT (mpParent!=nullptr, "ValueSetAcc not disposed but mpParent == NULL");
}
}
diff --git a/sfx2/source/control/thumbnailviewacc.hxx b/sfx2/source/control/thumbnailviewacc.hxx
index f6f8f1a7c090..dbff7e29048d 100644
--- a/sfx2/source/control/thumbnailviewacc.hxx
+++ b/sfx2/source/control/thumbnailviewacc.hxx
@@ -33,6 +33,7 @@
#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
+#include <vcl/vclptr.hxx>
#include <vector>
class ThumbnailView;
@@ -121,7 +122,7 @@ public:
private:
::std::vector< ::com::sun::star::uno::Reference<
::com::sun::star::accessibility::XAccessibleEventListener > > mxEventListeners;
- ThumbnailView* mpParent;
+ VclPtr<ThumbnailView> mpParent;
bool mbIsTransientChildrenDisabled;
/// The current FOCUSED state.
bool mbIsFocused;
diff --git a/sfx2/source/control/thumbnailviewitem.cxx b/sfx2/source/control/thumbnailviewitem.cxx
index 040eb186cce2..c6543906639c 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;
@@ -117,12 +112,12 @@ ThumbnailViewItem::ThumbnailViewItem(ThumbnailView &rView, sal_uInt16 nId)
, mpTitleED(NULL)
, maTextEditMaxArea()
{
- mpTitleED = new ResizableMultiLineEdit(&rView, this);
+ mpTitleED = VclPtr<ResizableMultiLineEdit>::Create(&rView, this);
}
ThumbnailViewItem::~ThumbnailViewItem()
{
- delete mpTitleED;
+ mpTitleED.disposeAndClear();
if( mpxAcc )
{
static_cast< ThumbnailViewItemAcc* >( mpxAcc->get() )->ParentDestroyed();
@@ -183,9 +178,9 @@ void ThumbnailViewItem::setEditTitle (bool edit, bool bChangeFocus)
{
mpTitleED->SetText(maTitle);
updateTitleEditSize();
- static_cast<ResizableMultiLineEdit*>(mpTitleED)->SetInGrabFocus(true);
+ static_cast<ResizableMultiLineEdit*>(mpTitleED.get())->SetInGrabFocus(true);
mpTitleED->GrabFocus();
- static_cast<ResizableMultiLineEdit*>(mpTitleED)->SetInGrabFocus(false);
+ static_cast<ResizableMultiLineEdit*>(mpTitleED.get())->SetInGrabFocus(false);
}
else if (bChangeFocus)
{
diff --git a/sfx2/source/dialog/alienwarn.cxx b/sfx2/source/dialog/alienwarn.cxx
index 09f59c14de94..7421173023f0 100644
--- a/sfx2/source/dialog/alienwarn.cxx
+++ b/sfx2/source/dialog/alienwarn.cxx
@@ -68,11 +68,20 @@ SfxAlienWarningDialog::SfxAlienWarningDialog(vcl::Window* pParent, const OUStrin
SfxAlienWarningDialog::~SfxAlienWarningDialog()
{
+ disposeOnce();
+}
+
+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 );
+ m_pKeepCurrentBtn.clear();
+ m_pUseDefaultFormatBtn.clear();
+ m_pWarningOnBox.clear();
+ MessageDialog::dispose();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/dialog/backingcomp.cxx b/sfx2/source/dialog/backingcomp.cxx
index e8f49fb42652..f11d9ffac79d 100644
--- a/sfx2/source/dialog/backingcomp.cxx
+++ b/sfx2/source/dialog/backingcomp.cxx
@@ -403,8 +403,8 @@ void SAL_CALL BackingComp::attachFrame( /*IN*/ const css::uno::Reference< css::f
// initialize the component and its parent window
css::uno::Reference< css::awt::XWindow > xParentWindow = xFrame->getContainerWindow();
- WorkWindow* pParent = static_cast<WorkWindow*>(VCLUnoHelper::GetWindow(xParentWindow));
- vcl::Window* pWindow = VCLUnoHelper::GetWindow(m_xWindow);
+ VclPtr< WorkWindow > pParent = static_cast<WorkWindow*>(VCLUnoHelper::GetWindow(xParentWindow).get());
+ VclPtr< vcl::Window > pWindow = VCLUnoHelper::GetWindow(m_xWindow);
// disable full screen mode of the frame!
if (pParent && pParent->IsFullScreenMode())
@@ -431,7 +431,7 @@ void SAL_CALL BackingComp::attachFrame( /*IN*/ const css::uno::Reference< css::f
}
// inform BackingWindow about frame
- BackingWindow* pBack = dynamic_cast<BackingWindow*>(pWindow );
+ BackingWindow* pBack = dynamic_cast<BackingWindow*>(pWindow.get());
if( pBack )
pBack->setOwningFrame( m_xFrame );
@@ -719,8 +719,8 @@ void SAL_CALL BackingComp::initialize( /*IN*/ const css::uno::Sequence< css::uno
// create the component window
vcl::Window* pParent = VCLUnoHelper::GetWindow(xParentWindow);
- vcl::Window* pWindow = new BackingWindow(pParent);
- m_xWindow = VCLUnoHelper::GetInterface(pWindow);
+ VclPtr<vcl::Window> pWindow = VclPtr<BackingWindow>::Create(pParent);
+ m_xWindow = VCLUnoHelper::GetInterface(pWindow);
if (!m_xWindow.is())
throw css::uno::RuntimeException(
@@ -800,7 +800,7 @@ void SAL_CALL BackingComp::dispatch( const css::util::URL& aURL, const css::uno:
// Recalculate minimum width
css::uno::Reference< css::awt::XWindow > xParentWindow = m_xFrame->getContainerWindow();
- WorkWindow* pParent = static_cast<WorkWindow*>(VCLUnoHelper::GetWindow(xParentWindow));
+ VclPtr< WorkWindow > pParent = static_cast<WorkWindow*>(VCLUnoHelper::GetWindow(xParentWindow).get());
if( pParent )
{
pParent->SetMinOutputSizePixel( Size(
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx
index ad9f98f769c2..103391877907 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -195,11 +195,15 @@ BackingWindow::BackingWindow( vcl::Window* i_pParent ) :
BackingWindow::~BackingWindow()
{
+ disposeOnce();
+}
+
+void BackingWindow::dispose()
+{
// deregister drag&drop helper
if (mxDropTargetListener.is())
{
- for (std::vector<vcl::Window*>::iterator aI = maDndWindows.begin(),
- aEnd = maDndWindows.end(); aI != aEnd; ++aI)
+ for (auto aI = maDndWindows.begin(), aEnd = maDndWindows.end(); aI != aEnd; ++aI)
{
vcl::Window *pDndWin = *aI;
css::uno::Reference< css::datatransfer::dnd::XDropTarget > xDropTarget =
@@ -212,6 +216,29 @@ BackingWindow::~BackingWindow()
}
mxDropTargetListener = css::uno::Reference< css::datatransfer::dnd::XDropTargetListener >();
}
+ disposeBuilder();
+ mpOpenButton.clear();
+ mpRecentButton.clear();
+ mpTemplateButton.clear();
+ mpCreateLabel.clear();
+ mpWriterAllButton.clear();
+ mpCalcAllButton.clear();
+ mpImpressAllButton.clear();
+ mpDrawAllButton.clear();
+ mpDBAllButton.clear();
+ mpMathAllButton.clear();
+ mpHelpButton.clear();
+ mpExtensionsButton.clear();
+ mpAllButtonsBox.clear();
+ mpButtonsBox.clear();
+ mpSmallButtonsBox.clear();
+ mpThinBox1.clear();
+ mpThinBox2.clear();
+ mpHelpBox.clear();
+ mpExtensionsBox.clear();
+ mpAllRecentThumbnails.clear();
+ mpLocalView.clear();
+ vcl::Window::dispose();
}
void BackingWindow::initControls()
@@ -368,15 +395,15 @@ void BackingWindow::Paint( const Rectangle& )
DrawWallpaper( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ), aBack );
Pop();
- VirtualDevice aDev( *this );
- aDev.EnableRTL( IsRTLEnabled() );
- aDev.SetOutputSizePixel( maStartCentButtons.GetSize() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev( *this );
+ pVDev->EnableRTL( IsRTLEnabled() );
+ pVDev->SetOutputSizePixel( maStartCentButtons.GetSize() );
Point aOffset( Point( 0, 0 ) - maStartCentButtons.TopLeft());
- aDev.DrawWallpaper( Rectangle( aOffset, GetOutputSizePixel() ), aBack );
+ pVDev->DrawWallpaper( Rectangle( aOffset, GetOutputSizePixel() ), aBack );
DrawOutDev( maStartCentButtons.TopLeft(), maStartCentButtons.GetSize(),
Point( 0, 0 ), maStartCentButtons.GetSize(),
- aDev );
+ *pVDev.get() );
}
bool BackingWindow::PreNotify( NotifyEvent& rNEvt )
@@ -462,8 +489,7 @@ void BackingWindow::setOwningFrame( const com::sun::star::uno::Reference< com::s
// establish drag&drop mode
mxDropTargetListener.set(new OpenFileDropTargetListener(mxContext, mxFrame));
- for (std::vector<vcl::Window*>::iterator aI = maDndWindows.begin(),
- aEnd = maDndWindows.end(); aI != aEnd; ++aI)
+ for (auto aI = maDndWindows.begin(), aEnd = maDndWindows.end(); aI != aEnd; ++aI)
{
vcl::Window *pDndWin = *aI;
css::uno::Reference< css::datatransfer::dnd::XDropTarget > xDropTarget =
diff --git a/sfx2/source/dialog/backingwindow.hxx b/sfx2/source/dialog/backingwindow.hxx
index aa6e498a281d..a9a07f662e45 100644
--- a/sfx2/source/dialog/backingwindow.hxx
+++ b/sfx2/source/dialog/backingwindow.hxx
@@ -61,35 +61,35 @@ class BackingWindow
/** helper for drag&drop. */
com::sun::star::uno::Reference< com::sun::star::datatransfer::dnd::XDropTargetListener > mxDropTargetListener;
- PushButton* mpOpenButton;
- PushButton* mpRecentButton;
- MenuButton* mpTemplateButton;
+ VclPtr<PushButton> mpOpenButton;
+ VclPtr<PushButton> mpRecentButton;
+ VclPtr<MenuButton> mpTemplateButton;
- FixedText* mpCreateLabel;
+ VclPtr<FixedText> mpCreateLabel;
- PushButton* mpWriterAllButton;
- PushButton* mpCalcAllButton;
- PushButton* mpImpressAllButton;
- PushButton* mpDrawAllButton;
- PushButton* mpDBAllButton;
- PushButton* mpMathAllButton;
+ VclPtr<PushButton> mpWriterAllButton;
+ VclPtr<PushButton> mpCalcAllButton;
+ VclPtr<PushButton> mpImpressAllButton;
+ VclPtr<PushButton> mpDrawAllButton;
+ VclPtr<PushButton> mpDBAllButton;
+ VclPtr<PushButton> mpMathAllButton;
- PushButton* mpHelpButton;
- PushButton* mpExtensionsButton;
+ VclPtr<PushButton> mpHelpButton;
+ VclPtr<PushButton> mpExtensionsButton;
- VclBox* mpAllButtonsBox;
- VclBox* mpButtonsBox;
- VclBox* mpSmallButtonsBox;
- VclBox* mpThinBox1;
- VclBox* mpThinBox2;
- VclBox* mpHelpBox;
- VclBox* mpExtensionsBox;
+ VclPtr<VclBox> mpAllButtonsBox;
+ VclPtr<VclBox> mpButtonsBox;
+ VclPtr<VclBox> mpSmallButtonsBox;
+ VclPtr<VclBox> mpThinBox1;
+ VclPtr<VclBox> mpThinBox2;
+ VclPtr<VclBox> mpHelpBox;
+ VclPtr<VclBox> mpExtensionsBox;
- RecentDocsView* mpAllRecentThumbnails;
- TemplateDefaultView* mpLocalView;
- bool mbLocalViewInitialized;
+ VclPtr<RecentDocsView> mpAllRecentThumbnails;
+ VclPtr<TemplateDefaultView> mpLocalView;
+ bool mbLocalViewInitialized;
- std::vector<vcl::Window*> maDndWindows;
+ std::vector<VclPtr<vcl::Window> > maDndWindows;
Rectangle maStartCentButtons;
@@ -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 566227863f72..285e618b398f 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -45,6 +45,12 @@ using namespace ::com::sun::star::uno;
#define USERITEM_NAME OUString("UserItem")
+SingleTabDlgImpl::SingleTabDlgImpl()
+ : m_pSfxPage(NULL)
+ , m_pLine(NULL)
+ {
+ }
+
class SfxModelessDialog_Impl : public SfxListener
{
public:
@@ -163,15 +169,15 @@ SfxModalDialog::SfxModalDialog(vcl::Window *pParent, const OUString& rID, const
}
SfxModalDialog::~SfxModalDialog()
+{
+ disposeOnce();
+}
-/* [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 +361,16 @@ bool SfxModelessDialog::Notify( NotifyEvent& rEvt )
SfxModelessDialog::~SfxModelessDialog()
+{
+ disposeOnce();
+}
-/* [Description]
-
- Destructor
-*/
-
+void SfxModelessDialog::dispose()
{
if ( pImp->pMgr->GetFrame().is() && pImp->pMgr->GetFrame() == pBindings->GetActiveFrame() )
pBindings->SetActiveFrame( NULL );
delete pImp;
+ ModelessDialog::dispose();
}
@@ -505,20 +511,19 @@ bool SfxFloatingWindow::Close()
SfxFloatingWindow::~SfxFloatingWindow()
+{
+ disposeOnce();
+}
-/* [Description]
-
- Destructor
-*/
-
+void SfxFloatingWindow::dispose()
{
- if ( pImp->pMgr->GetFrame() == pBindings->GetActiveFrame() )
+ if ( pImp && pImp->pMgr->GetFrame() == pBindings->GetActiveFrame() )
pBindings->SetActiveFrame( NULL );
delete pImp;
+ pImp = NULL;
+ FloatingWindow::dispose();
}
-
-
void SfxFloatingWindow::Resize()
/* [Description]
@@ -702,9 +707,18 @@ SfxSingleTabDialog::SfxSingleTabDialog(vcl::Window* pParent, const SfxItemSet* p
SfxSingleTabDialog::~SfxSingleTabDialog()
{
- delete pImpl->m_pSfxPage;
- delete pImpl->m_pLine;
+ disposeOnce();
+}
+
+void SfxSingleTabDialog::dispose()
+{
+ pImpl->m_pSfxPage.disposeAndClear();
+ pImpl->m_pLine.disposeAndClear();
delete pImpl;
+ pOKBtn.clear();
+ pCancelBtn.clear();
+ pHelpBtn.clear();
+ SfxModalDialog::dispose();
}
void SfxSingleTabDialog::SetTabPage(SfxTabPage* pTabPage,
@@ -718,7 +732,7 @@ void SfxSingleTabDialog::SetTabPage(SfxTabPage* pTabPage,
{
SetUniqId(nSettingsId);
- delete pImpl->m_pSfxPage;
+ pImpl->m_pSfxPage.disposeAndClear();
pImpl->m_pSfxPage = pTabPage;
fnGetRanges = pRangesFunc;
diff --git a/sfx2/source/dialog/checkin.cxx b/sfx2/source/dialog/checkin.cxx
index 61d963ef8a5e..e628476df652 100644
--- a/sfx2/source/dialog/checkin.cxx
+++ b/sfx2/source/dialog/checkin.cxx
@@ -20,6 +20,19 @@ SfxCheckinDialog::SfxCheckinDialog( vcl::Window* pParent ) :
m_pOKBtn->SetClickHdl( LINK( this, SfxCheckinDialog, OKHdl ) );
}
+SfxCheckinDialog::~SfxCheckinDialog()
+{
+ disposeOnce();
+}
+
+void SfxCheckinDialog::dispose()
+{
+ m_pCommentED.clear();
+ m_pMajorCB.clear();
+ m_pOKBtn.clear();
+ ModalDialog::dispose();
+}
+
OUString SfxCheckinDialog::GetComment( )
{
return m_pCommentED->GetText( );
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 5627c40bfc9a..55261037a376 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -626,11 +626,24 @@ SfxDocumentDescPage::SfxDocumentDescPage( vcl::Window * pParent, const SfxItemSe
m_pCommentEd->set_height_request(m_pCommentEd->GetTextHeight() * 16);
}
-SfxTabPage *SfxDocumentDescPage::Create(vcl::Window *pParent, const SfxItemSet *rItemSet)
+SfxDocumentDescPage::~SfxDocumentDescPage()
{
- return new SfxDocumentDescPage(pParent, *rItemSet);
+ disposeOnce();
}
+void SfxDocumentDescPage::dispose()
+{
+ m_pTitleEd.clear();
+ m_pThemaEd.clear();
+ m_pKeywordsEd.clear();
+ m_pCommentEd.clear();
+ SfxTabPage::dispose();
+}
+
+VclPtr<SfxTabPage> SfxDocumentDescPage::Create(vcl::Window *pParent, const SfxItemSet *rItemSet)
+{
+ return VclPtr<SfxDocumentDescPage>::Create(pParent, *rItemSet);
+}
bool SfxDocumentDescPage::FillItemSet(SfxItemSet *rSet)
{
@@ -789,6 +802,32 @@ SfxDocumentPage::SfxDocumentPage(vcl::Window* pParent, const SfxItemSet& rItemSe
m_pSignatureBtn->Disable();
}
+SfxDocumentPage::~SfxDocumentPage()
+{
+ disposeOnce();
+}
+
+void SfxDocumentPage::dispose()
+{
+ m_pBmp.clear();
+ m_pNameED.clear();
+ m_pChangePassBtn.clear();
+ m_pShowTypeFT.clear();
+ m_pFileValEd.clear();
+ m_pShowSizeFT.clear();
+ m_pCreateValFt.clear();
+ m_pChangeValFt.clear();
+ m_pSignedValFt.clear();
+ m_pSignatureBtn.clear();
+ m_pPrintValFt.clear();
+ m_pTimeLogValFt.clear();
+ m_pDocNoValFt.clear();
+ m_pUseUserDataCB.clear();
+ m_pDeleteBtn.clear();
+ m_pTemplFt.clear();
+ m_pTemplValFt.clear();
+ SfxTabPage::dispose();
+}
IMPL_LINK_NOARG(SfxDocumentPage, DeleteHdl)
@@ -901,11 +940,9 @@ void SfxDocumentPage::ImplCheckPasswordState()
m_pChangePassBtn->Disable();
}
-
-
-SfxTabPage* SfxDocumentPage::Create( vcl::Window* pParent, const SfxItemSet* rItemSet )
+VclPtr<SfxTabPage> SfxDocumentPage::Create( vcl::Window* pParent, const SfxItemSet* rItemSet )
{
- return new SfxDocumentPage( pParent, *rItemSet );
+ return VclPtr<SfxDocumentPage>::Create( pParent, *rItemSet );
}
void SfxDocumentPage::EnableUseUserData()
@@ -1182,33 +1219,47 @@ 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( VclPtr<RadioButton>::Create(this, ResId( RB_PROPERTY_YES, *rResId.GetResMgr() )) ),
+ m_aNoButton ( VclPtr<RadioButton>::Create(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()
+{
+ disposeOnce();
+}
+
+void CustomPropertiesYesNoButton::dispose()
+{
+ m_aYesButton.disposeAndClear();
+ m_aNoButton.disposeAndClear();
+ Control::dispose();
}
class DurationDialog_Impl : public ModalDialog
{
- CheckBox* m_pNegativeCB;
- NumericField* m_pYearNF;
- NumericField* m_pMonthNF;
- NumericField* m_pDayNF;
- NumericField* m_pHourNF;
- NumericField* m_pMinuteNF;
- NumericField* m_pSecondNF;
- NumericField* m_pMSecondNF;
+ VclPtr<CheckBox> m_pNegativeCB;
+ VclPtr<NumericField> m_pYearNF;
+ VclPtr<NumericField> m_pMonthNF;
+ VclPtr<NumericField> m_pDayNF;
+ VclPtr<NumericField> m_pHourNF;
+ VclPtr<NumericField> m_pMinuteNF;
+ VclPtr<NumericField> m_pSecondNF;
+ VclPtr<NumericField> m_pMSecondNF;
public:
DurationDialog_Impl( vcl::Window* pParent, const util::Duration& rDuration );
-
+ virtual ~DurationDialog_Impl();
+ virtual void dispose() SAL_OVERRIDE;
util::Duration GetDuration() const;
};
@@ -1236,6 +1287,24 @@ DurationDialog_Impl::DurationDialog_Impl(vcl::Window* pParent,
m_pMSecondNF->SetValue(rDuration.NanoSeconds);
}
+DurationDialog_Impl::~DurationDialog_Impl()
+{
+ disposeOnce();
+}
+
+void DurationDialog_Impl::dispose()
+{
+ m_pNegativeCB.clear();
+ m_pYearNF.clear();
+ m_pMonthNF.clear();
+ m_pDayNF.clear();
+ m_pHourNF.clear();
+ m_pMinuteNF.clear();
+ m_pSecondNF.clear();
+ m_pMSecondNF.clear();
+ ModalDialog::dispose();
+}
+
util::Duration DurationDialog_Impl::GetDuration() const
{
util::Duration aRet;
@@ -1259,10 +1328,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 +1364,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() ));
+ VclPtrInstance< DurationDialog_Impl > pDurationDlg( 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 +1377,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 ( VclPtr<ComboBox>::Create(pParent, SfxResId( SFX_CB_PROPERTY_NAME )) ),
+ m_aTypeBox ( VclPtr<CustomPropertiesTypeBox>::Create(pParent, SfxResId( SFX_LB_PROPERTY_TYPE ), this) ),
+ m_aValueEdit ( VclPtr<CustomPropertiesEdit>::Create(pParent, WB_BORDER|WB_TABSTOP|WB_LEFT, this ) ),
+ m_aDateField ( VclPtr<CustomPropertiesDateField>::Create(pParent, WB_BORDER|WB_TABSTOP|WB_SPIN|WB_LEFT, this ) ),
+ m_aTimeField ( VclPtr<CustomPropertiesTimeField>::Create(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( VclPtr<CustomPropertiesDurationField>::Create(pParent, WB_BORDER|WB_TABSTOP|WB_READONLY, this ) ),
+ m_aEditButton ( VclPtr<CustomPropertiesEditButton>::Create(pParent, WB_TABSTOP, this) ),
+ m_aYesNoButton ( VclPtr<CustomPropertiesYesNoButton>::Create(pParent, SfxResId( SFX_WIN_PROPERTY_YESNO )) ),
+ m_aRemoveButton ( VclPtr<CustomPropertiesRemoveButton>::Create(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,27 +1435,27 @@ 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 ( VclPtr<ComboBox>::Create( this, SfxResId( SFX_CB_PROPERTY_NAME ) ) ),
+ m_aTypeBox ( VclPtr<ListBox>::Create( this, SfxResId( SFX_LB_PROPERTY_TYPE ) ) ),
+ m_aValueEdit ( VclPtr<Edit>::Create( this, WB_BORDER|WB_TABSTOP|WB_LEFT ) ),
+ m_aDateField ( VclPtr<DateField>::Create( this, WB_BORDER|WB_TABSTOP|WB_SPIN|WB_LEFT ) ),
+ m_aTimeField ( VclPtr<TimeField>::Create( this, WB_BORDER|WB_TABSTOP|WB_SPIN|WB_LEFT ) ),
+ m_aDurationField( VclPtr<Edit>::Create( this, WB_BORDER|WB_TABSTOP|WB_READONLY ) ),
+ m_aEditButton ( VclPtr<PushButton>::Create( this, WB_TABSTOP ) ),
+ m_aYesNoButton ( VclPtr<CustomPropertiesYesNoButton>::Create( this, SfxResId( SFX_WIN_PROPERTY_YESNO )) ),
+ m_aRemoveButton ( VclPtr<ImageButton>::Create( this, 0 ) ),
m_nScrollPos (0),
m_pCurrentLine (NULL),
m_aNumberFormatter( ::comphelper::getProcessComponentContext(),
Application::GetSettings().GetLanguageTag().getLanguageType() )
{
- m_aEditButton.SetPosSizePixel(
+ m_aEditButton->SetPosSizePixel(
LogicToPixel(Point(159, 2), MAP_APPFONT),
LogicToPixel(Size(RSC_CD_TEXTBOX_HEIGHT, RSC_CD_TEXTBOX_HEIGHT), MAP_APPFONT));
- m_aRemoveButton.SetSizePixel(LogicToPixel(Size(RSC_CD_PUSHBUTTON_HEIGHT, RSC_CD_PUSHBUTTON_HEIGHT), MAP_APPFONT));
+ m_aRemoveButton->SetSizePixel(LogicToPixel(Size(RSC_CD_PUSHBUTTON_HEIGHT, RSC_CD_PUSHBUTTON_HEIGHT), MAP_APPFONT));
- m_aValueEdit.SetPosSizePixel(
+ m_aValueEdit->SetPosSizePixel(
LogicToPixel(Point(159, 2), MAP_APPFONT),
LogicToPixel(Size(61, RSC_CD_TEXTBOX_HEIGHT), MAP_APPFONT));
@@ -1403,57 +1464,75 @@ 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()
{
+ disposeOnce();
+}
+
+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();
+ m_pHeaderAccName.clear();
+ m_pHeaderAccType.clear();
+ m_pHeaderAccValue.clear();
+ 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 +1555,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 +1618,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 +1653,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 +1668,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 +1677,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 +1688,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 +1699,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();
- m_aEditButton.SetPosPixel(aDurationPos);
+ aDurationSize.Width() -= (m_aEditButton->GetSizePixel().Width() + 3 );
+ m_aDurationField->SetSizePixel(aDurationSize);
+ aDurationPos.X() = aPos.X() - m_aEditButton->GetSizePixel().Width() + aSize.Width();
+ m_aEditButton->SetPosPixel(aDurationPos);
- m_aYesNoButton.SetPosSizePixel( aPos, aSize );
+ m_aYesNoButton->SetPosSizePixel( aPos, aSize );
aSize.Width() /= 2;
aSize.Width() -= 2;
- m_aDateField.SetPosSizePixel( aPos, aSize );
+ m_aDateField->SetPosSizePixel( aPos, aSize );
aPos.X() += aSize.Width() + 4;
- m_aTimeField.SetPosSizePixel( aPos, aSize );
+ m_aTimeField->SetPosSizePixel( aPos, aSize );
}
pCurrent++;
@@ -1660,10 +1739,10 @@ sal_uInt16 CustomPropertiesWindow::GetVisibleLineCount() const
void CustomPropertiesWindow::updateLineWidth()
{
- vcl::Window* pWindows[] = { &m_aNameBox, &m_aTypeBox, &m_aValueEdit,
- &m_aDateField, &m_aTimeField,
- &m_aDurationField, &m_aEditButton,
- &m_aYesNoButton, &m_aRemoveButton, NULL };
+ vcl::Window* pWindows[] = { m_aNameBox.get(), m_aTypeBox.get(), m_aValueEdit.get(),
+ m_aDateField.get(), m_aTimeField.get(),
+ m_aDurationField.get(), m_aEditButton.get(),
+ m_aYesNoButton.get(), m_aRemoveButton.get(), NULL };
for (std::vector< CustomPropertyLine* >::iterator aI =
m_aCustomPropertiesLines.begin(), aEnd = m_aCustomPropertiesLines.end();
@@ -1672,10 +1751,10 @@ void CustomPropertiesWindow::updateLineWidth()
CustomPropertyLine* pNewLine = *aI;
vcl::Window* pNewWindows[] =
- { &pNewLine->m_aNameBox, &pNewLine->m_aTypeBox, &pNewLine->m_aValueEdit,
- &pNewLine->m_aDateField, &pNewLine->m_aTimeField,
- &pNewLine->m_aDurationField, &pNewLine->m_aEditButton,
- &pNewLine->m_aYesNoButton, &pNewLine->m_aRemoveButton, NULL };
+ { pNewLine->m_aNameBox.get(), pNewLine->m_aTypeBox.get(), pNewLine->m_aValueEdit.get(),
+ pNewLine->m_aDateField.get(), pNewLine->m_aTimeField.get(),
+ pNewLine->m_aDurationField.get(), pNewLine->m_aEditButton.get(),
+ pNewLine->m_aYesNoButton.get(), pNewLine->m_aRemoveButton.get(), NULL };
vcl::Window** pCurrent = pWindows;
vcl::Window** pNewCurrent = pNewWindows;
@@ -1691,38 +1770,38 @@ void CustomPropertiesWindow::updateLineWidth()
// if we have type "Date", we use the full width, not only the half
if (pNewLine->m_bIsDate)
- pNewLine->m_aDateField.SetSizePixel( pNewLine->m_aValueEdit.GetSizePixel() );
+ pNewLine->m_aDateField->SetSizePixel( pNewLine->m_aValueEdit->GetSizePixel() );
}
}
void CustomPropertiesWindow::AddLine( const OUString& sName, Any& rAny )
{
CustomPropertyLine* pNewLine = new CustomPropertyLine( this );
- pNewLine->m_aTypeBox.SetSelectHdl( LINK( this, CustomPropertiesWindow, TypeHdl ) );
- pNewLine->m_aRemoveButton.SetClickHdl( LINK( this, CustomPropertiesWindow, RemoveHdl ) );
- pNewLine->m_aValueEdit.SetLoseFocusHdl( LINK( this, CustomPropertiesWindow, EditLoseFocusHdl ) );
+ pNewLine->m_aTypeBox->SetSelectHdl( LINK( this, CustomPropertiesWindow, TypeHdl ) );
+ pNewLine->m_aRemoveButton->SetClickHdl( LINK( this, CustomPropertiesWindow, RemoveHdl ) );
+ pNewLine->m_aValueEdit->SetLoseFocusHdl( LINK( this, CustomPropertiesWindow, EditLoseFocusHdl ) );
//add lose focus handlers of date/time fields
- pNewLine->m_aTypeBox.SetLoseFocusHdl( LINK( this, CustomPropertiesWindow, BoxLoseFocusHdl ) );
+ pNewLine->m_aTypeBox->SetLoseFocusHdl( LINK( this, CustomPropertiesWindow, BoxLoseFocusHdl ) );
- pNewLine->m_aNameBox.add_mnemonic_label(m_pHeaderAccName);
- pNewLine->m_aNameBox.SetAccessibleName(m_pHeaderAccName->GetText());
- pNewLine->m_aTypeBox.add_mnemonic_label(m_pHeaderAccType);
- pNewLine->m_aTypeBox.SetAccessibleName(m_pHeaderAccType->GetText());
- pNewLine->m_aValueEdit.add_mnemonic_label(m_pHeaderAccValue);
- pNewLine->m_aValueEdit.SetAccessibleName(m_pHeaderAccValue->GetText());
+ pNewLine->m_aNameBox->add_mnemonic_label(m_pHeaderAccName);
+ pNewLine->m_aNameBox->SetAccessibleName(m_pHeaderAccName->GetText());
+ pNewLine->m_aTypeBox->add_mnemonic_label(m_pHeaderAccType);
+ pNewLine->m_aTypeBox->SetAccessibleName(m_pHeaderAccType->GetText());
+ pNewLine->m_aValueEdit->add_mnemonic_label(m_pHeaderAccValue);
+ pNewLine->m_aValueEdit->SetAccessibleName(m_pHeaderAccValue->GetText());
sal_Int32 nPos = GetVisibleLineCount() * GetLineHeight();
m_aCustomPropertiesLines.push_back( pNewLine );
- vcl::Window* pWindows[] = { &m_aNameBox, &m_aTypeBox, &m_aValueEdit,
- &m_aDateField, &m_aTimeField,
- &m_aDurationField, &m_aEditButton,
- &m_aYesNoButton, &m_aRemoveButton, NULL };
+ vcl::Window* pWindows[] = { m_aNameBox.get(), m_aTypeBox.get(), m_aValueEdit.get(),
+ m_aDateField.get(), m_aTimeField.get(),
+ m_aDurationField.get(), m_aEditButton.get(),
+ m_aYesNoButton.get(), m_aRemoveButton.get(), NULL };
vcl::Window* pNewWindows[] =
- { &pNewLine->m_aNameBox, &pNewLine->m_aTypeBox, &pNewLine->m_aValueEdit,
- &pNewLine->m_aDateField, &pNewLine->m_aTimeField,
- &pNewLine->m_aDurationField, &pNewLine->m_aEditButton,
- &pNewLine->m_aYesNoButton, &pNewLine->m_aRemoveButton, NULL };
+ { pNewLine->m_aNameBox.get(), pNewLine->m_aTypeBox.get(), pNewLine->m_aValueEdit.get(),
+ pNewLine->m_aDateField.get(), pNewLine->m_aTimeField.get(),
+ pNewLine->m_aDurationField.get(), pNewLine->m_aEditButton.get(),
+ pNewLine->m_aYesNoButton.get(), pNewLine->m_aRemoveButton.get(), NULL };
vcl::Window** pCurrent = pWindows;
vcl::Window** pNewCurrent = pNewWindows;
while ( *pCurrent )
@@ -1747,7 +1826,7 @@ void CustomPropertiesWindow::AddLine( const OUString& sName, Any& rAny )
util::Duration aTmpDuration;
SvtSysLocale aSysLocale;
const LocaleDataWrapper& rLocaleWrapper = aSysLocale.GetLocaleData();
- pNewLine->m_aNameBox.SetText( sName );
+ pNewLine->m_aNameBox->SetText( sName );
sal_IntPtr nType = CUSTOM_TYPE_UNKNOWN;
OUString sValue;
@@ -1755,7 +1834,7 @@ void CustomPropertiesWindow::AddLine( const OUString& sName, Any& rAny )
{
sal_uInt32 nIndex = m_aNumberFormatter.GetFormatIndex( NF_NUMBER_SYSTEM );
m_aNumberFormatter.GetInputLineString( nTmpValue, nIndex, sValue );
- pNewLine->m_aValueEdit.SetText( sValue );
+ pNewLine->m_aValueEdit->SetText( sValue );
nType = CUSTOM_TYPE_NUMBER;
}
else if ( rAny >>= bTmpValue )
@@ -1765,41 +1844,41 @@ void CustomPropertiesWindow::AddLine( const OUString& sName, Any& rAny )
}
else if ( rAny >>= sTmpValue )
{
- pNewLine->m_aValueEdit.SetText( sTmpValue );
+ pNewLine->m_aValueEdit->SetText( sTmpValue );
nType = CUSTOM_TYPE_TEXT;
}
else if ( rAny >>= aTmpDate )
{
- pNewLine->m_aDateField.SetDate( Date( aTmpDate ) );
+ pNewLine->m_aDateField->SetDate( Date( aTmpDate ) );
nType = CUSTOM_TYPE_DATE;
}
else if ( rAny >>= aTmpDateTime )
{
- pNewLine->m_aDateField.SetDate( Date( aTmpDateTime ) );
- pNewLine->m_aTimeField.SetTime( tools::Time( aTmpDateTime ) );
- pNewLine->m_aTimeField.m_isUTC = aTmpDateTime.IsUTC;
+ pNewLine->m_aDateField->SetDate( Date( aTmpDateTime ) );
+ pNewLine->m_aTimeField->SetTime( tools::Time( aTmpDateTime ) );
+ pNewLine->m_aTimeField->m_isUTC = aTmpDateTime.IsUTC;
nType = CUSTOM_TYPE_DATETIME;
}
else if ( rAny >>= aTmpDateTZ )
{
- pNewLine->m_aDateField.SetDate( Date( aTmpDateTZ.DateInTZ.Day,
+ pNewLine->m_aDateField->SetDate( Date( aTmpDateTZ.DateInTZ.Day,
aTmpDateTZ.DateInTZ.Month, aTmpDateTZ.DateInTZ.Year ) );
- pNewLine->m_aDateField.m_TZ = aTmpDateTZ.Timezone;
+ pNewLine->m_aDateField->m_TZ = aTmpDateTZ.Timezone;
nType = CUSTOM_TYPE_DATE;
}
else if ( rAny >>= aTmpDateTimeTZ )
{
util::DateTime const& rDT(aTmpDateTimeTZ.DateTimeInTZ);
- pNewLine->m_aDateField.SetDate( Date( rDT ) );
- pNewLine->m_aTimeField.SetTime( tools::Time( rDT ) );
- pNewLine->m_aTimeField.m_isUTC = rDT.IsUTC;
- pNewLine->m_aDateField.m_TZ = aTmpDateTimeTZ.Timezone;
+ pNewLine->m_aDateField->SetDate( Date( rDT ) );
+ pNewLine->m_aTimeField->SetTime( tools::Time( rDT ) );
+ pNewLine->m_aTimeField->m_isUTC = rDT.IsUTC;
+ pNewLine->m_aDateField->m_TZ = aTmpDateTimeTZ.Timezone;
nType = CUSTOM_TYPE_DATETIME;
}
else if ( rAny >>= aTmpDuration )
{
nType = CUSTOM_TYPE_DURATION;
- pNewLine->m_aDurationField.SetDuration( aTmpDuration );
+ pNewLine->m_aDurationField->SetDuration( aTmpDuration );
}
if ( nType != CUSTOM_TYPE_UNKNOWN )
@@ -1807,15 +1886,15 @@ void CustomPropertiesWindow::AddLine( const OUString& sName, Any& rAny )
if ( CUSTOM_TYPE_BOOLEAN == nType )
{
if ( bTmpValue )
- pNewLine->m_aYesNoButton.CheckYes();
+ pNewLine->m_aYesNoButton->CheckYes();
else
- pNewLine->m_aYesNoButton.CheckNo();
+ pNewLine->m_aYesNoButton->CheckNo();
}
- pNewLine->m_aTypeBox.SelectEntryPos( m_aTypeBox.GetEntryPos( reinterpret_cast<void*>(nType) ) );
+ pNewLine->m_aTypeBox->SelectEntryPos( m_aTypeBox->GetEntryPos( reinterpret_cast<void*>(nType) ) );
}
- TypeHdl( &pNewLine->m_aTypeBox );
- pNewLine->m_aNameBox.GrabFocus();
+ TypeHdl( pNewLine->m_aTypeBox.get() );
+ pNewLine->m_aNameBox->GrabFocus();
}
bool CustomPropertiesWindow::AreAllLinesValid() const
@@ -1861,8 +1940,8 @@ void CustomPropertiesWindow::DoScroll( sal_Int32 nNewPos )
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 )
{
@@ -1886,39 +1965,39 @@ Sequence< beans::PropertyValue > CustomPropertiesWindow::GetCustomProperties() c
if ( pLine->m_bIsRemoved )
continue;
- OUString sPropertyName = pLine->m_aNameBox.GetText();
+ OUString sPropertyName = pLine->m_aNameBox->GetText();
if ( !sPropertyName.isEmpty() )
{
aPropertiesSeq[i].Name = sPropertyName;
long nType = reinterpret_cast<long>(
- pLine->m_aTypeBox.GetSelectEntryData() );
+ pLine->m_aTypeBox->GetSelectEntryData() );
if ( CUSTOM_TYPE_NUMBER == nType )
{
double nValue = 0;
sal_uInt32 nIndex = const_cast< SvNumberFormatter& >(
m_aNumberFormatter ).GetFormatIndex( NF_NUMBER_SYSTEM );
bool bIsNum = const_cast< SvNumberFormatter& >( m_aNumberFormatter ).
- IsNumberFormat( pLine->m_aValueEdit.GetText(), nIndex, nValue );
+ IsNumberFormat( pLine->m_aValueEdit->GetText(), nIndex, nValue );
if ( bIsNum )
aPropertiesSeq[i].Value <<= makeAny( nValue );
}
else if ( CUSTOM_TYPE_BOOLEAN == nType )
{
- bool bValue = pLine->m_aYesNoButton.IsYesChecked();
+ bool bValue = pLine->m_aYesNoButton->IsYesChecked();
aPropertiesSeq[i].Value <<= makeAny( bValue );
}
else if ( CUSTOM_TYPE_DATETIME == nType )
{
- Date aTmpDate = pLine->m_aDateField.GetDate();
- tools::Time aTmpTime = pLine->m_aTimeField.GetTime();
+ Date aTmpDate = pLine->m_aDateField->GetDate();
+ tools::Time aTmpTime = pLine->m_aTimeField->GetTime();
util::DateTime const aDateTime(aTmpTime.GetNanoSec(),
aTmpTime.GetSec(), aTmpTime.GetMin(), aTmpTime.GetHour(),
aTmpDate.GetDay(), aTmpDate.GetMonth(), aTmpDate.GetYear(),
- pLine->m_aTimeField.m_isUTC);
- if (pLine->m_aDateField.m_TZ.is_initialized())
+ pLine->m_aTimeField->m_isUTC);
+ if (pLine->m_aDateField->m_TZ.is_initialized())
{
aPropertiesSeq[i].Value <<= util::DateTimeWithTimezone(
- aDateTime, pLine->m_aDateField.m_TZ.get());
+ aDateTime, pLine->m_aDateField->m_TZ.get());
}
else
{
@@ -1927,13 +2006,13 @@ Sequence< beans::PropertyValue > CustomPropertiesWindow::GetCustomProperties() c
}
else if ( CUSTOM_TYPE_DATE == nType )
{
- Date aTmpDate = pLine->m_aDateField.GetDate();
+ Date aTmpDate = pLine->m_aDateField->GetDate();
util::Date const aDate(aTmpDate.GetDay(), aTmpDate.GetMonth(),
aTmpDate.GetYear());
- if (pLine->m_aDateField.m_TZ.is_initialized())
+ if (pLine->m_aDateField->m_TZ.is_initialized())
{
aPropertiesSeq[i].Value <<= util::DateWithTimezone(
- aDate, pLine->m_aDateField.m_TZ.get());
+ aDate, pLine->m_aDateField->m_TZ.get());
}
else
{
@@ -1942,11 +2021,11 @@ Sequence< beans::PropertyValue > CustomPropertiesWindow::GetCustomProperties() c
}
else if ( CUSTOM_TYPE_DURATION == nType )
{
- aPropertiesSeq[i].Value <<= pLine->m_aDurationField.GetDuration();
+ aPropertiesSeq[i].Value <<= pLine->m_aDurationField->GetDuration();
}
else
{
- OUString sValue( pLine->m_aValueEdit.GetText() );
+ OUString sValue( pLine->m_aValueEdit->GetText() );
aPropertiesSeq[i].Value <<= makeAny( sValue );
}
}
@@ -1968,17 +2047,17 @@ CustomPropertiesControl::CustomPropertiesControl(vcl::Window* pParent)
void CustomPropertiesControl::Init(VclBuilderContainer& rBuilder)
{
- m_pVBox = new VclVBox(this);
- m_pHeaderBar = new HeaderBar(m_pVBox, WB_BUTTONSTYLE | WB_BOTTOMBORDER);
- m_pBody = new VclHBox(m_pVBox);
+ m_pVBox = VclPtr<VclVBox>::Create(this);
+ m_pHeaderBar = VclPtr<HeaderBar>::Create(m_pVBox, WB_BUTTONSTYLE | WB_BOTTOMBORDER);
+ m_pBody = VclPtr<VclHBox>::Create(m_pVBox);
FixedText* pName = rBuilder.get<FixedText>("name");
FixedText* pType = rBuilder.get<FixedText>("type");
FixedText* pValue = rBuilder.get<FixedText>("value");
OUString sName = pName->GetText();
OUString sType = pType->GetText();
OUString sValue = pValue->GetText();
- m_pPropertiesWin = new CustomPropertiesWindow(m_pBody, pName, pType, pValue);
- m_pVertScroll = new ScrollBar(m_pBody, WB_VERT);
+ m_pPropertiesWin = VclPtr<CustomPropertiesWindow>::Create(m_pBody, pName, pType, pValue);
+ m_pVertScroll = VclPtr<ScrollBar>::Create(m_pBody, WB_VERT);
set_hexpand(true);
set_vexpand(true);
@@ -2055,11 +2134,17 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeCustomPropertiesContro
CustomPropertiesControl::~CustomPropertiesControl()
{
- delete m_pVertScroll;
- delete m_pPropertiesWin;
- delete m_pBody;
- delete m_pHeaderBar;
- delete m_pVBox;
+ disposeOnce();
+}
+
+void CustomPropertiesControl::dispose()
+{
+ m_pVertScroll.disposeAndClear();
+ m_pPropertiesWin.disposeAndClear();
+ m_pBody.disposeAndClear();
+ m_pHeaderBar.disposeAndClear();
+ m_pVBox.disposeAndClear();
+ vcl::Window::dispose();
}
IMPL_LINK( CustomPropertiesControl, ScrollHdl, ScrollBar*, pScrollBar )
@@ -2098,6 +2183,17 @@ SfxCustomPropertiesPage::SfxCustomPropertiesPage( vcl::Window* pParent, const Sf
get<PushButton>("add")->SetClickHdl(LINK(this, SfxCustomPropertiesPage, AddHdl));
}
+SfxCustomPropertiesPage::~SfxCustomPropertiesPage()
+{
+ disposeOnce();
+}
+
+void SfxCustomPropertiesPage::dispose()
+{
+ m_pPropertiesCtrl.clear();
+ SfxTabPage::dispose();
+}
+
IMPL_LINK_NOARG(SfxCustomPropertiesPage, AddHdl)
{
Any aAny;
@@ -2175,9 +2271,9 @@ SfxTabPage::sfxpg SfxCustomPropertiesPage::DeactivatePage( SfxItemSet* /*pSet*/
return nRet;
}
-SfxTabPage* SfxCustomPropertiesPage::Create( vcl::Window* pParent, const SfxItemSet* rItemSet )
+VclPtr<SfxTabPage> SfxCustomPropertiesPage::Create( vcl::Window* pParent, const SfxItemSet* rItemSet )
{
- return new SfxCustomPropertiesPage( pParent, *rItemSet );
+ return VclPtr<SfxCustomPropertiesPage>::Create( pParent, *rItemSet );
}
CmisValue::CmisValue( vcl::Window* pParent, const OUString& aStr )
@@ -2274,7 +2370,7 @@ CmisPropertiesWindow::CmisPropertiesWindow(SfxTabPage* pParent):
pParent->get(m_pBox, "CmisWindow");
CmisPropertyLine aTemp( m_pBox );
m_nItemHeight = aTemp.getItemHeight();
-};
+}
CmisPropertiesWindow::~CmisPropertiesWindow()
{
@@ -2671,9 +2767,9 @@ SfxTabPage::sfxpg SfxCmisPropertiesPage::DeactivatePage( SfxItemSet* /*pSet*/ )
return LEAVE_PAGE;
}
-SfxTabPage* SfxCmisPropertiesPage::Create( vcl::Window* pParent, const SfxItemSet* rItemSet )
+VclPtr<SfxTabPage> SfxCmisPropertiesPage::Create( vcl::Window* pParent, const SfxItemSet* rItemSet )
{
- return new SfxCmisPropertiesPage( pParent, *rItemSet );
+ return VclPtr<SfxCmisPropertiesPage>::Create( pParent, *rItemSet );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx
index 7118b2824e74..0ad3e754ca40 100644
--- a/sfx2/source/dialog/dockwin.cxx
+++ b/sfx2/source/dialog/dockwin.cxx
@@ -62,7 +62,7 @@ static const int NUM_OF_DOCKINGWINDOWS = 10;
class SfxTitleDockingWindow : public SfxDockingWindow
{
- vcl::Window* m_pWrappedWindow;
+ VclPtr<vcl::Window> m_pWrappedWindow;
public:
SfxTitleDockingWindow(
@@ -71,8 +71,9 @@ public:
vcl::Window* pParent ,
WinBits nBits);
virtual ~SfxTitleDockingWindow();
+ virtual void dispose() SAL_OVERRIDE;
- vcl::Window* GetWrappedWindow() const { return m_pWrappedWindow; }
+ vcl::Window* GetWrappedWindow() const { return m_pWrappedWindow; }
void SetWrappedWindow(vcl::Window* const pWindow);
virtual void StateChanged( StateChangedType nType ) SAL_OVERRIDE;
@@ -129,7 +130,7 @@ SfxDockingWrapper::SfxDockingWrapper( vcl::Window* pParentWnd ,
uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
const OUString aDockWindowResourceURL( "private:resource/dockingwindow/" );
- SfxTitleDockingWindow* pTitleDockWindow = new SfxTitleDockingWindow( pBindings, this, pParentWnd,
+ VclPtr<SfxTitleDockingWindow> pTitleDockWindow = VclPtr<SfxTitleDockingWindow>::Create( pBindings, this, pParentWnd,
WB_STDDOCKWIN | WB_CLIPCHILDREN | WB_SIZEABLE | WB_3DLOOK | WB_ROLLABLE);
pWindow = pTitleDockWindow;
eChildAlignment = SfxChildAlignment::NOALIGNMENT;
@@ -207,7 +208,7 @@ SfxDockingWrapper::SfxDockingWrapper( vcl::Window* pParentWnd ,
pWindow->SetOutputSizePixel( Size( 270, 240 ) );
- static_cast<SfxDockingWindow*>( pWindow )->Initialize( pInfo );
+ static_cast<SfxDockingWindow*>( pWindow.get() )->Initialize( pInfo );
SetHideNotDelete( true );
}
@@ -252,7 +253,13 @@ SfxTitleDockingWindow::SfxTitleDockingWindow( SfxBindings* pBind ,
SfxTitleDockingWindow::~SfxTitleDockingWindow()
{
- delete m_pWrappedWindow;
+ disposeOnce();
+}
+
+void SfxTitleDockingWindow::dispose()
+{
+ m_pWrappedWindow.disposeAndClear();
+ SfxDockingWindow::dispose();
}
void SfxTitleDockingWindow::SetWrappedWindow( vcl::Window* const pWindow )
@@ -402,7 +409,7 @@ friend class SfxDockingWindow;
SfxChildAlignment eDockAlignment;
bool bConstructed;
Size aMinSize;
- SfxSplitWindow* pSplitWin;
+ VclPtr<SfxSplitWindow> pSplitWin;
bool bSplitable;
Idle aMoveIdle;
@@ -1267,8 +1274,14 @@ void SfxDockingWindow::FillInfo(SfxChildWinInfo& rInfo) const
SfxDockingWindow::~SfxDockingWindow()
{
+ disposeOnce();
+}
+
+void SfxDockingWindow::dispose()
+{
ReleaseChildWindow_Impl();
- delete pImp;
+ delete pImp; pImp = NULL;
+ DockingWindow::dispose();
}
void SfxDockingWindow::ReleaseChildWindow_Impl()
diff --git a/sfx2/source/dialog/documentfontsdialog.cxx b/sfx2/source/dialog/documentfontsdialog.cxx
index c942fd25c059..22b495c3cab3 100644
--- a/sfx2/source/dialog/documentfontsdialog.cxx
+++ b/sfx2/source/dialog/documentfontsdialog.cxx
@@ -23,9 +23,9 @@
using namespace ::com::sun::star;
-SfxTabPage* SfxDocumentFontsPage::Create( vcl::Window* parent, const SfxItemSet* set )
+VclPtr<SfxTabPage> SfxDocumentFontsPage::Create( vcl::Window* parent, const SfxItemSet* set )
{
- return new SfxDocumentFontsPage( parent, *set );
+ return VclPtr<SfxDocumentFontsPage>::Create( parent, *set );
}
SfxDocumentFontsPage::SfxDocumentFontsPage( vcl::Window* parent, const SfxItemSet& set )
@@ -34,6 +34,17 @@ SfxDocumentFontsPage::SfxDocumentFontsPage( vcl::Window* parent, const SfxItemSe
get( embedFontsCheckbox, "embedFonts" );
}
+SfxDocumentFontsPage::~SfxDocumentFontsPage()
+{
+ disposeOnce();
+}
+
+void SfxDocumentFontsPage::dispose()
+{
+ embedFontsCheckbox.clear();
+ SfxTabPage::dispose();
+}
+
void SfxDocumentFontsPage::Reset( const SfxItemSet* )
{
bool bVal = false;
diff --git a/sfx2/source/dialog/filedlgimpl.hxx b/sfx2/source/dialog/filedlgimpl.hxx
index 00c2d358d0c5..f07113288a37 100644
--- a/sfx2/source/dialog/filedlgimpl.hxx
+++ b/sfx2/source/dialog/filedlgimpl.hxx
@@ -54,7 +54,7 @@ namespace sfx2
SfxFilterMatcher* mpMatcher;
GraphicFilter* mpGraphicFilter;
FileDialogHelper* mpAntiImpl;
- vcl::Window* mpPreferredParentWindow;
+ VclPtr<vcl::Window> mpPreferredParentWindow;
::std::vector< OUString > mlLastURLs;
diff --git a/sfx2/source/dialog/infobar.cxx b/sfx2/source/dialog/infobar.cxx
index 6d3924ce5459..2bf43410a487 100644
--- a/sfx2/source/dialog/infobar.cxx
+++ b/sfx2/source/dialog/infobar.cxx
@@ -118,8 +118,8 @@ SfxInfoBarWindow::SfxInfoBarWindow(vcl::Window* pParent, const OUString& sId,
const OUString& sMessage) :
Window(pParent, 0),
m_sId(sId),
- m_pMessage(new FixedText(this, 0)),
- m_pCloseBtn(new SfxCloseButton(this)),
+ m_pMessage(VclPtr<FixedText>::Create(this, 0)),
+ m_pCloseBtn(VclPtr<SfxCloseButton>::Create(this)),
m_aActionBtns()
{
sal_Int32 nScaleFactor = GetDPIScaleFactor();
@@ -136,9 +136,6 @@ SfxInfoBarWindow::SfxInfoBarWindow(vcl::Window* pParent, const OUString& sId,
Resize();
}
-SfxInfoBarWindow::~SfxInfoBarWindow()
-{}
-
void SfxInfoBarWindow::addButton(PushButton* pButton) {
pButton->SetParent(this);
pButton->Show();
@@ -146,6 +143,22 @@ void SfxInfoBarWindow::addButton(PushButton* pButton) {
Resize();
}
+SfxInfoBarWindow::~SfxInfoBarWindow()
+{
+ disposeOnce();
+}
+
+void SfxInfoBarWindow::dispose()
+{
+ for ( auto it = m_aActionBtns.begin( ); it != m_aActionBtns.end( ); ++it )
+ it->disposeAndClear();
+
+ m_pMessage.disposeAndClear();
+ m_pCloseBtn.disposeAndClear();
+ m_aActionBtns.clear( );
+ vcl::Window::dispose();
+}
+
void SfxInfoBarWindow::Paint(const Rectangle& rPaintRect)
{
const ViewInformation2D aNewViewInfos;
@@ -203,12 +216,11 @@ void SfxInfoBarWindow::Resize()
long nX = m_pCloseBtn->GetPosPixel().getX() - 15 * nScaleFactor;
long nButtonGap = 5 * nScaleFactor;
- boost::ptr_vector<PushButton>::iterator it;
- for (it = m_aActionBtns.begin(); it != m_aActionBtns.end(); ++it)
+ for (auto it = m_aActionBtns.begin(); it != m_aActionBtns.end(); ++it)
{
- long nButtonWidth = it->GetSizePixel().getWidth();
+ long nButtonWidth = (*it)->GetSizePixel().getWidth();
nX -= nButtonWidth;
- it->SetPosSizePixel(Point(nX, 5 * nScaleFactor), Size(nButtonWidth, 30 * nScaleFactor));
+ (*it)->SetPosSizePixel(Point(nX, 5 * nScaleFactor), Size(nButtonWidth, 30 * nScaleFactor));
nX -= nButtonGap;
}
@@ -233,13 +245,22 @@ SfxInfoBarContainerWindow::SfxInfoBarContainerWindow(SfxInfoBarContainerChild* p
SfxInfoBarContainerWindow::~SfxInfoBarContainerWindow()
{
+ disposeOnce();
+}
+
+void SfxInfoBarContainerWindow::dispose()
+{
+ for ( auto it = m_pInfoBars.begin( ); it != m_pInfoBars.end( ); ++it )
+ it->disposeAndClear();
+ m_pInfoBars.clear( );
+ Window::dispose();
}
SfxInfoBarWindow* SfxInfoBarContainerWindow::appendInfoBar(const OUString& sId, const OUString& sMessage)
{
Size aSize = GetSizePixel();
- SfxInfoBarWindow* pInfoBar = new SfxInfoBarWindow(this, sId, sMessage);
+ VclPtrInstance<SfxInfoBarWindow> pInfoBar(this, sId, sMessage);
pInfoBar->SetPosPixel(Point(0, aSize.getHeight()));
pInfoBar->Show();
m_pInfoBars.push_back(pInfoBar);
@@ -252,32 +273,31 @@ SfxInfoBarWindow* SfxInfoBarContainerWindow::appendInfoBar(const OUString& sId,
SfxInfoBarWindow* SfxInfoBarContainerWindow::getInfoBar(const OUString& sId)
{
- boost::ptr_vector<SfxInfoBarWindow>::iterator it;
- for (it = m_pInfoBars.begin(); it != m_pInfoBars.end(); ++it)
+ for (auto it = m_pInfoBars.begin(); it != m_pInfoBars.end(); ++it)
{
- if (it->getId() == sId)
- return &(*it);
+ if ((*it)->getId() == sId)
+ return it->get();
}
return NULL;
}
void SfxInfoBarContainerWindow::removeInfoBar(SfxInfoBarWindow* pInfoBar)
{
- boost::ptr_vector<SfxInfoBarWindow>::iterator it;
- for (it = m_pInfoBars.begin(); it != m_pInfoBars.end(); ++it)
+ for (auto it = m_pInfoBars.begin(); it != m_pInfoBars.end(); ++it)
{
- if (pInfoBar == &(*it))
+ if (pInfoBar == it->get())
{
m_pInfoBars.erase(it);
break;
}
}
+ pInfoBar->disposeOnce();
long nY = 0;
- for (it = m_pInfoBars.begin(); it != m_pInfoBars.end(); ++it)
+ for (auto it = m_pInfoBars.begin(); it != m_pInfoBars.end(); ++it)
{
- it->SetPosPixel(Point(0, nY));
- nY += it->GetSizePixel().getHeight();
+ (*it)->SetPosPixel(Point(0, nY));
+ nY += (*it)->GetSizePixel().getHeight();
}
Size aSize = GetSizePixel();
@@ -292,13 +312,12 @@ void SfxInfoBarContainerWindow::Resize()
// Only need to change the width of the infobars
long nWidth = GetSizePixel().getWidth();
- boost::ptr_vector<SfxInfoBarWindow>::iterator it;
- for (it = m_pInfoBars.begin(); it != m_pInfoBars.end(); ++it)
+ for (auto it = m_pInfoBars.begin(); it != m_pInfoBars.end(); ++it)
{
- Size aSize = it->GetSizePixel();
+ Size aSize = (*it)->GetSizePixel();
aSize.setWidth(nWidth);
- it->SetSizePixel(aSize);
- it->Resize();
+ (*it)->SetSizePixel(aSize);
+ (*it)->Resize();
}
}
@@ -308,7 +327,7 @@ SfxInfoBarContainerChild::SfxInfoBarContainerChild( vcl::Window* _pParent, sal_u
SfxChildWindow(_pParent, nId),
m_pBindings(pBindings)
{
- pWindow = new SfxInfoBarContainerWindow(this);
+ pWindow = VclPtr<SfxInfoBarContainerWindow>::Create(this);
pWindow->SetPosSizePixel(Point(0, 0), Size(_pParent->GetSizePixel().getWidth(), 0));
pWindow->Show();
diff --git a/sfx2/source/dialog/inputdlg.cxx b/sfx2/source/dialog/inputdlg.cxx
index 6f1ab9288205..faa591d89f6a 100644
--- a/sfx2/source/dialog/inputdlg.cxx
+++ b/sfx2/source/dialog/inputdlg.cxx
@@ -26,6 +26,20 @@ InputDialog::InputDialog(const OUString &rLabelText, vcl::Window *pParent)
m_pCancel->SetClickHdl(LINK(this,InputDialog,ClickHdl));
}
+InputDialog::~InputDialog()
+{
+ disposeOnce();
+}
+
+void InputDialog::dispose()
+{
+ m_pEntry.clear();
+ m_pLabel.clear();
+ m_pOK.clear();
+ m_pCancel.clear();
+ ModalDialog::dispose();
+}
+
OUString InputDialog::getEntryText() const
{
return m_pEntry->GetText();
diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx
index 28233e47dcac..b0cdda7e85f9 100644
--- a/sfx2/source/dialog/mailmodel.cxx
+++ b/sfx2/source/dialog/mailmodel.cxx
@@ -858,8 +858,8 @@ SfxMailModel::SendMailResult SfxMailModel::Send( const css::uno::Reference< css:
SolarMutexGuard aGuard;
vcl::Window* pParentWindow = VCLUnoHelper::GetWindow( xParentWindow );
- MessageDialog aBox(pParentWindow, "ErrorFindEmailDialog", "sfx/ui/errorfindemaildialog.ui");
- aBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aBox(pParentWindow, "ErrorFindEmailDialog", "sfx/ui/errorfindemaildialog.ui");
+ aBox->Execute();
eResult = SEND_MAIL_CANCELLED;
}
else
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index 6ad49be51c67..47c59880a8b3 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -27,6 +27,7 @@
#include <sfx2/styfitem.hxx>
#include <sfx2/styledlg.hxx>
+#include <sfx2/tabdlg.hxx>
#include <sfx2/app.hxx>
#include <sfx2/mgetempl.hxx>
#include <sfx2/objsh.hxx>
@@ -249,19 +250,30 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(vcl::Window* pParent, const Sfx
SfxManageStyleSheetPage::~SfxManageStyleSheetPage()
+{
+ disposeOnce();
+}
-/* [Description]
-
- Destructor, release of the data
-*/
-
+void SfxManageStyleSheetPage::dispose()
{
m_pNameRw->SetGetFocusHdl( Link() );
m_pNameRw->SetLoseFocusHdl( Link() );
delete pFamilies;
pItem = 0;
pStyle = 0;
-
+ m_pNameRo.clear();
+ m_pNameRw.clear();
+ m_pAutoCB.clear();
+ m_pFollowFt.clear();
+ m_pFollowLb.clear();
+ m_pEditStyleBtn.clear();
+ m_pBaseFt.clear();
+ m_pBaseLb.clear();
+ m_pEditLinkStyleBtn.clear();
+ m_pFilterFt.clear();
+ m_pFilterLb.clear();
+ m_pDescFt.clear();
+ SfxTabPage::dispose();
}
@@ -558,20 +570,10 @@ void SfxManageStyleSheetPage::Reset( const SfxItemSet* /*rAttrSet*/ )
-SfxTabPage* SfxManageStyleSheetPage::Create( vcl::Window* pParent,
- const SfxItemSet *rAttrSet )
-
-/* [Description]
-
- Factory for the creation of the page.
-
- [Cross-reference]
-
- <class SfxTabDialog>
-*/
-
+VclPtr<SfxTabPage> SfxManageStyleSheetPage::Create( vcl::Window* pParent,
+ const SfxItemSet *rAttrSet )
{
- return new SfxManageStyleSheetPage( pParent, *rAttrSet );
+ return VclPtr<SfxManageStyleSheetPage>::Create( pParent, *rAttrSet );
}
@@ -634,8 +636,8 @@ SfxTabPage::sfxpg SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet
if (!pStyle->SetName(comphelper::string::stripStart(m_pNameRw->GetText(), ' ')))
{
- MessageDialog aBox( this, SfxResId( STR_TABPAGE_INVALIDNAME ), VCL_MESSAGE_INFO );
- aBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aBox(this, SfxResId( STR_TABPAGE_INVALIDNAME ), VCL_MESSAGE_INFO);
+ aBox->Execute();
m_pNameRw->GrabFocus();
m_pNameRw->SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) );
return SfxTabPage::KEEP_PAGE;
@@ -651,8 +653,8 @@ SfxTabPage::sfxpg SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet
{
if ( !pStyle->SetFollow( aFollowEntry ) )
{
- MessageDialog aBox( this, SfxResId( STR_TABPAGE_INVALIDSTYLE ), VCL_MESSAGE_INFO );
- aBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aBox(this, SfxResId( STR_TABPAGE_INVALIDSTYLE ), VCL_MESSAGE_INFO);
+ aBox->Execute();
m_pFollowLb->GrabFocus();
return SfxTabPage::KEEP_PAGE;
}
@@ -671,8 +673,8 @@ SfxTabPage::sfxpg SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet
{
if ( !pStyle->SetParent( aParentEntry ) )
{
- MessageDialog aBox( this, SfxResId( STR_TABPAGE_INVALIDPARENT ), VCL_MESSAGE_INFO );
- aBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aBox(this, SfxResId( STR_TABPAGE_INVALIDPARENT ), VCL_MESSAGE_INFO);
+ aBox->Execute();
m_pBaseLb->GrabFocus();
return SfxTabPage::KEEP_PAGE;
}
diff --git a/sfx2/source/dialog/navigat.cxx b/sfx2/source/dialog/navigat.cxx
index 415c347d4970..98870a6981f1 100644
--- a/sfx2/source/dialog/navigat.cxx
+++ b/sfx2/source/dialog/navigat.cxx
@@ -34,14 +34,14 @@ SfxNavigatorWrapper::SfxNavigatorWrapper( vcl::Window* pParentWnd ,
SfxChildWinInfo* pInfo )
: SfxChildWindow( pParentWnd , nId )
{
- pWindow = new SfxNavigator( pBindings, this, pParentWnd,
+ pWindow = VclPtr<SfxNavigator>::Create( pBindings, this, pParentWnd,
WB_STDDOCKWIN | WB_CLIPCHILDREN | WB_SIZEABLE | WB_3DLOOK | WB_ROLLABLE);
eChildAlignment = SfxChildAlignment::NOALIGNMENT;
pWindow->SetHelpId ( HID_NAVIGATOR_WINDOW );
pWindow->SetOutputSizePixel( Size( 270, 240 ) );
- static_cast<SfxDockingWindow*>( pWindow )->Initialize( pInfo );
+ static_cast<SfxDockingWindow*>( pWindow.get() )->Initialize( pInfo );
SetHideNotDelete( true );
}
diff --git a/sfx2/source/dialog/newstyle.cxx b/sfx2/source/dialog/newstyle.cxx
index a2f43fb10ab3..d3f26dc748cb 100644
--- a/sfx2/source/dialog/newstyle.cxx
+++ b/sfx2/source/dialog/newstyle.cxx
@@ -41,7 +41,7 @@ IMPL_LINK( SfxNewStyleDlg, OKHdl, Control *, pControl )
return 0;
}
- if ( RET_YES == aQueryOverwriteBox.Execute() )
+ if ( RET_YES == aQueryOverwriteBox->Execute() )
EndDialog( RET_OK );
}
else
@@ -59,8 +59,8 @@ IMPL_LINK_INLINE_END( SfxNewStyleDlg, ModifyHdl, ComboBox *, pBox )
SfxNewStyleDlg::SfxNewStyleDlg( vcl::Window* pParent, SfxStyleSheetBasePool& rInPool )
: ModalDialog(pParent, "CreateStyleDialog", "sfx/ui/newstyle.ui")
- , aQueryOverwriteBox(this, SfxResId(STR_QUERY_OVERWRITE),
- VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)
+ , aQueryOverwriteBox(VclPtr<MessageDialog>::Create(this, SfxResId(STR_QUERY_OVERWRITE),
+ VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO))
, rPool(rInPool)
{
get(m_pColBox, "stylename");
@@ -82,6 +82,15 @@ SfxNewStyleDlg::SfxNewStyleDlg( vcl::Window* pParent, SfxStyleSheetBasePool& rIn
SfxNewStyleDlg::~SfxNewStyleDlg()
{
+ disposeOnce();
+}
+
+void SfxNewStyleDlg::dispose()
+{
+ aQueryOverwriteBox.disposeAndClear();
+ m_pColBox.clear();
+ m_pOKBtn.clear();
+ ModalDialog::dispose();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/dialog/partwnd.cxx b/sfx2/source/dialog/partwnd.cxx
index 0a168d8305b1..f16288d4a1c7 100644
--- a/sfx2/source/dialog/partwnd.cxx
+++ b/sfx2/source/dialog/partwnd.cxx
@@ -59,16 +59,16 @@ SfxPartChildWnd_Impl::SfxPartChildWnd_Impl
: SfxChildWindow( pParentWnd, nId )
{
// Create Window
- pWindow = new SfxPartDockWnd_Impl( pBindings, this, pParentWnd, WB_STDDOCKWIN | WB_CLIPCHILDREN | WB_SIZEABLE | WB_3DLOOK );
+ pWindow = VclPtr<SfxPartDockWnd_Impl>::Create( pBindings, this, pParentWnd, WB_STDDOCKWIN | WB_CLIPCHILDREN | WB_SIZEABLE | WB_3DLOOK );
eChildAlignment = SfxChildAlignment::TOP;
assert(pInfo);
pInfo->nFlags |= SfxChildWindowFlags::FORCEDOCK;
- static_cast<SfxDockingWindow*>(pWindow)->SetFloatingSize( Size( 175, 175 ) );
+ static_cast<SfxDockingWindow*>(pWindow.get())->SetFloatingSize( Size( 175, 175 ) );
pWindow->SetSizePixel( Size( 175, 175 ) );
- static_cast<SfxDockingWindow*>(pWindow)->Initialize( pInfo );
+ static_cast<SfxDockingWindow*>(pWindow.get())->Initialize( pInfo );
SetHideNotDelete( true );
}
@@ -82,7 +82,7 @@ SfxPartChildWnd_Impl::~SfxPartChildWnd_Impl()
// But don't do it, if xFrame already exist. Then dispose() must come from inside ...
// and we need a valid pMgr for further operations ...
- SfxPartDockWnd_Impl* pWin = static_cast<SfxPartDockWnd_Impl*>(pWindow);
+ SfxPartDockWnd_Impl* pWin = static_cast<SfxPartDockWnd_Impl*>(pWindow.get());
if ( pWin && xFrame == pWin->GetBindings().GetActiveFrame() )
pWin->GetBindings().SetActiveFrame( NULL );
@@ -90,7 +90,7 @@ SfxPartChildWnd_Impl::~SfxPartChildWnd_Impl()
bool SfxPartChildWnd_Impl::QueryClose()
{
- return static_cast<SfxPartDockWnd_Impl*>(pWindow)->QueryClose();
+ return static_cast<SfxPartDockWnd_Impl*>(pWindow.get())->QueryClose();
}
@@ -140,12 +140,6 @@ SfxPartDockWnd_Impl::SfxPartDockWnd_Impl
-SfxPartDockWnd_Impl::~SfxPartDockWnd_Impl()
-{
-}
-
-
-
void SfxPartDockWnd_Impl::Resize()
/* [Description]
diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx
index 237f8eb7eb7c..0b6a20278a13 100644
--- a/sfx2/source/dialog/passwd.cxx
+++ b/sfx2/source/dialog/passwd.cxx
@@ -71,8 +71,8 @@ IMPL_LINK_NOARG(SfxPasswordDialog, OKHdl)
bConfirmFailed = true;
if ( bConfirmFailed )
{
- MessageDialog aBox(this, SfxResId(STR_ERROR_WRONG_CONFIRM));
- aBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aBox(this, SfxResId(STR_ERROR_WRONG_CONFIRM));
+ aBox->Execute();
mpConfirm1ED->SetText( OUString() );
mpConfirm1ED->GrabFocus();
}
@@ -125,7 +125,29 @@ SfxPasswordDialog::SfxPasswordDialog(vcl::Window* pParent, const OUString* pGrou
SetPasswdText();
}
+SfxPasswordDialog::~SfxPasswordDialog()
+{
+ disposeOnce();
+}
+void SfxPasswordDialog::dispose()
+{
+ mpPassword1Box.clear();
+ mpUserFT.clear();
+ mpUserED.clear();
+ mpPassword1FT.clear();
+ mpPassword1ED.clear();
+ mpConfirm1FT.clear();
+ mpConfirm1ED.clear();
+ mpPassword2Box.clear();
+ mpPassword2FT.clear();
+ mpPassword2ED.clear();
+ mpConfirm2FT.clear();
+ mpConfirm2ED.clear();
+ mpMinLengthFT.clear();
+ mpOKBtn.clear();
+ ModalDialog::dispose();
+}
void SfxPasswordDialog::SetPasswdText( )
{
diff --git a/sfx2/source/dialog/printopt.cxx b/sfx2/source/dialog/printopt.cxx
index 3a3ce1b75720..851509941889 100644
--- a/sfx2/source/dialog/printopt.cxx
+++ b/sfx2/source/dialog/printopt.cxx
@@ -87,11 +87,37 @@ SfxCommonPrintOptionsTabPage::SfxCommonPrintOptionsTabPage( vcl::Window* pParent
SfxCommonPrintOptionsTabPage::~SfxCommonPrintOptionsTabPage()
{
+ disposeOnce();
}
-SfxTabPage* SfxCommonPrintOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+void SfxCommonPrintOptionsTabPage::dispose()
{
- return( new SfxCommonPrintOptionsTabPage( pParent, *rAttrSet ) );
+ m_pPrinterOutputRB.clear();
+ m_pPrintFileOutputRB.clear();
+ m_pReduceTransparencyCB.clear();
+ m_pReduceTransparencyAutoRB.clear();
+ m_pReduceTransparencyNoneRB.clear();
+ m_pReduceGradientsCB.clear();
+ m_pReduceGradientsStripesRB.clear();
+ m_pReduceGradientsColorRB.clear();
+ m_pReduceGradientsStepCountNF.clear();
+ m_pReduceBitmapsCB.clear();
+ m_pReduceBitmapsOptimalRB.clear();
+ m_pReduceBitmapsNormalRB.clear();
+ m_pReduceBitmapsResolutionRB.clear();
+ m_pReduceBitmapsResolutionLB.clear();
+ m_pReduceBitmapsTransparencyCB.clear();
+ m_pConvertToGreyscalesCB.clear();
+ m_pPDFCB.clear();
+ m_pPaperSizeCB.clear();
+ m_pPaperOrientationCB.clear();
+ m_pTransparencyCB.clear();
+ SfxTabPage::dispose();
+}
+
+VclPtr<SfxTabPage> SfxCommonPrintOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
+{
+ return VclPtr<SfxCommonPrintOptionsTabPage>::Create( pParent, *rAttrSet );
}
vcl::Window* SfxCommonPrintOptionsTabPage::GetParentLabeledBy( const vcl::Window* pWindow ) const
diff --git a/sfx2/source/dialog/recfloat.cxx b/sfx2/source/dialog/recfloat.cxx
index d051bb3fa055..742aa883900a 100644
--- a/sfx2/source/dialog/recfloat.cxx
+++ b/sfx2/source/dialog/recfloat.cxx
@@ -131,10 +131,10 @@ SfxRecordingFloatWrapper_Impl::SfxRecordingFloatWrapper_Impl( vcl::Window* pPare
: SfxChildWindow( pParentWnd, nId )
, pBindings( pBind )
{
- pWindow = new SfxRecordingFloat_Impl( pBindings, this, pParentWnd );
+ pWindow = VclPtr<SfxRecordingFloat_Impl>::Create( pBindings, this, pParentWnd );
SetWantsFocus( false );
eChildAlignment = SfxChildAlignment::NOALIGNMENT;
- static_cast<SfxFloatingWindow*>(pWindow)->Initialize( pInfo );
+ static_cast<SfxFloatingWindow*>(pWindow.get())->Initialize( pInfo );
}
SfxRecordingFloatWrapper_Impl::~SfxRecordingFloatWrapper_Impl()
@@ -152,9 +152,9 @@ bool SfxRecordingFloatWrapper_Impl::QueryClose()
com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > xRecorder = pBindings->GetRecorder();
if ( xRecorder.is() && !xRecorder->getRecordedMacro().isEmpty() )
{
- QueryBox aBox( GetWindow(), WB_YES_NO | WB_DEF_NO , SfxResId(STR_MACRO_LOSS).toString() );
- aBox.SetText( SfxResId(STR_CANCEL_RECORDING).toString() );
- bRet = ( aBox.Execute() == RET_YES );
+ ScopedVclPtrInstance< QueryBox > aBox(GetWindow(), WB_YES_NO | WB_DEF_NO , SfxResId(STR_MACRO_LOSS).toString());
+ aBox->SetText( SfxResId(STR_CANCEL_RECORDING).toString() );
+ bRet = ( aBox->Execute() == RET_YES );
}
return bRet;
@@ -200,6 +200,11 @@ SfxRecordingFloat_Impl::SfxRecordingFloat_Impl(
SfxRecordingFloat_Impl::~SfxRecordingFloat_Impl()
{
+ disposeOnce();
+}
+
+void SfxRecordingFloat_Impl::dispose()
+{
try
{
if ( xStopRecTbxCtrl.is() )
@@ -211,6 +216,8 @@ SfxRecordingFloat_Impl::~SfxRecordingFloat_Impl()
catch ( uno::Exception& )
{
}
+ m_pTbx.clear();
+ SfxFloatingWindow::dispose();
}
bool SfxRecordingFloat_Impl::Close()
diff --git a/sfx2/source/dialog/securitypage.cxx b/sfx2/source/dialog/securitypage.cxx
index 7fb1d0c4cfb6..e5de1d3c99c5 100644
--- a/sfx2/source/dialog/securitypage.cxx
+++ b/sfx2/source/dialog/securitypage.cxx
@@ -99,13 +99,13 @@ static bool lcl_GetPassword(
/*out*/OUString &rPassword )
{
bool bRes = false;
- SfxPasswordDialog aPasswdDlg( pParent );
- aPasswdDlg.SetMinLen( 1 );
+ ScopedVclPtrInstance< SfxPasswordDialog > aPasswdDlg(pParent);
+ aPasswdDlg->SetMinLen( 1 );
if (bProtect)
- aPasswdDlg.ShowExtras( SfxShowExtras::CONFIRM );
- if (RET_OK == aPasswdDlg.Execute() && !aPasswdDlg.GetPassword().isEmpty())
+ aPasswdDlg->ShowExtras( SfxShowExtras::CONFIRM );
+ if (RET_OK == aPasswdDlg->Execute() && !aPasswdDlg->GetPassword().isEmpty())
{
- rPassword = aPasswdDlg.GetPassword();
+ rPassword = aPasswdDlg->GetPassword();
bRes = true;
}
return bRes;
@@ -136,10 +136,10 @@ struct SfxSecurityPage_Impl
{
SfxSecurityPage & m_rMyTabPage;
- CheckBox* m_pOpenReadonlyCB;
- CheckBox* m_pRecordChangesCB; // for record changes
- PushButton* m_pProtectPB; // for record changes
- PushButton* m_pUnProtectPB; // for record changes
+ VclPtr<CheckBox> m_pOpenReadonlyCB;
+ VclPtr<CheckBox> m_pRecordChangesCB; // for record changes
+ VclPtr<PushButton> m_pProtectPB; // for record changes
+ VclPtr<PushButton> m_pUnProtectPB; // for record changes
RedliningMode m_eRedlingMode; // for record changes
bool m_bOrigPasswordIsConfirmed;
@@ -335,9 +335,9 @@ IMPL_LINK_NOARG(SfxSecurityPage_Impl, RecordChangesCBToggleHdl)
bool bAlreadyDone = false;
if (!m_bEndRedliningWarningDone)
{
- WarningBox aBox( m_rMyTabPage.GetParent(), WinBits(WB_YES_NO | WB_DEF_NO),
+ ScopedVclPtrInstance<WarningBox> aBox(m_rMyTabPage.GetParent(), WinBits(WB_YES_NO | WB_DEF_NO),
m_aEndRedliningWarning );
- if (aBox.Execute() != RET_YES)
+ if (aBox->Execute() != RET_YES)
bAlreadyDone = true;
else
m_bEndRedliningWarningDone = true;
@@ -420,9 +420,9 @@ IMPL_LINK_NOARG(SfxSecurityPage_Impl, ChangeProtectionPBHdl)
}
-SfxTabPage* SfxSecurityPage::Create( vcl::Window * pParent, const SfxItemSet * rItemSet )
+VclPtr<SfxTabPage> SfxSecurityPage::Create( vcl::Window * pParent, const SfxItemSet * rItemSet )
{
- return new SfxSecurityPage( pParent, *rItemSet );
+ return VclPtr<SfxSecurityPage>::Create( pParent, *rItemSet );
}
@@ -433,10 +433,6 @@ SfxSecurityPage::SfxSecurityPage( vcl::Window* pParent, const SfxItemSet& rItemS
}
-SfxSecurityPage::~SfxSecurityPage()
-{
-}
-
bool SfxSecurityPage::FillItemSet( SfxItemSet * rItemSet )
{
diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx
index 461feacf5031..a3bcb853134c 100644
--- a/sfx2/source/dialog/splitwin.cxx
+++ b/sfx2/source/dialog/splitwin.cxx
@@ -87,15 +87,16 @@ class SfxEmptySplitWin_Impl : public SplitWindow
*/
friend class SfxSplitWindow;
- SfxSplitWindow* pOwner;
- bool bFadeIn;
- bool bAutoHide;
- bool bSplit;
- bool bEndAutoHide;
- Timer aTimer;
- Point aLastPos;
+ VclPtr<SfxSplitWindow> pOwner;
+ bool bFadeIn;
+ bool bAutoHide;
+ bool bSplit;
+ bool bEndAutoHide;
+ Timer aTimer;
+ Point aLastPos;
sal_uInt16 nState;
+public:
SfxEmptySplitWin_Impl( SfxSplitWindow *pParent )
: SplitWindow( pParent->GetParent(), WinBits( WB_BORDER | WB_3DLOOK ) )
, pOwner( pParent )
@@ -115,8 +116,12 @@ friend class SfxSplitWindow;
}
virtual ~SfxEmptySplitWin_Impl()
+ { disposeOnce(); }
+ virtual void dispose() SAL_OVERRIDE
{
aTimer.Stop();
+ pOwner.clear();
+ SplitWindow::dispose();
}
virtual void MouseMove( const MouseEvent& ) SAL_OVERRIDE;
@@ -232,7 +237,7 @@ SfxSplitWindow::SfxSplitWindow( vcl::Window* pParent, SfxChildAlignment eAl,
}
SetAlign (eTbxAlign);
- pEmptyWin = new SfxEmptySplitWin_Impl( this );
+ pEmptyWin = VclPtr<SfxEmptySplitWin_Impl>::Create( this );
if ( bPinned )
{
pEmptyWin->bFadeIn = true;
@@ -299,6 +304,11 @@ SfxSplitWindow::SfxSplitWindow( vcl::Window* pParent, SfxChildAlignment eAl,
SfxSplitWindow::~SfxSplitWindow()
{
+ disposeOnce();
+}
+
+void SfxSplitWindow::dispose()
+{
if ( !pWorkWin->GetParent_Impl() )
SaveConfig_Impl();
@@ -307,10 +317,12 @@ SfxSplitWindow::~SfxSplitWindow()
// Set pOwner to NULL, otherwise try to delete pEmptyWin once more. The
// window that is just being docked is always deleted from the outside.
pEmptyWin->pOwner = NULL;
- delete pEmptyWin;
}
+ pEmptyWin.disposeAndClear();
delete pDockArr;
+ pActive.clear();
+ SplitWindow::dispose();
}
void SfxSplitWindow::SaveConfig_Impl()
diff --git a/sfx2/source/dialog/srchdlg.cxx b/sfx2/source/dialog/srchdlg.cxx
index efc3c78009db..0da322cbbcfb 100644
--- a/sfx2/source/dialog/srchdlg.cxx
+++ b/sfx2/source/dialog/srchdlg.cxx
@@ -62,8 +62,20 @@ SearchDialog::SearchDialog(vcl::Window* pWindow, const OUString& rConfigName)
SearchDialog::~SearchDialog()
{
+ disposeOnce();
+}
+
+void SearchDialog::dispose()
+{
SaveConfig();
m_aCloseHdl.Call( NULL );
+ m_pSearchEdit.clear();
+ m_pWholeWordsBox.clear();
+ m_pMatchCaseBox.clear();
+ m_pWrapAroundBox.clear();
+ m_pBackwardsBox.clear();
+ m_pFindBtn.clear();
+ ModelessDialog::dispose();
}
void SearchDialog::LoadConfig()
diff --git a/sfx2/source/dialog/styledlg.cxx b/sfx2/source/dialog/styledlg.cxx
index dc0d5f00d774..1735f1b28371 100644
--- a/sfx2/source/dialog/styledlg.cxx
+++ b/sfx2/source/dialog/styledlg.cxx
@@ -71,6 +71,9 @@ SfxStyleDialog::SfxStyleDialog
SfxStyleDialog::~SfxStyleDialog()
+{
+ disposeOnce();
+}
/* [Description]
@@ -78,9 +81,11 @@ SfxStyleDialog::~SfxStyleDialog()
the Set from Style.
*/
+void SfxStyleDialog::dispose()
{
pExampleSet = 0;
pStyle = 0;
+ SfxTabDialog::dispose();
}
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 9434ab9184ed..af240ce76b44 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -60,7 +60,7 @@ struct Data_Impl
sal_uInt16 nId; // The ID
CreateTabPage fnCreatePage; // Pointer to Factory
GetTabPageRanges fnGetRanges; // Pointer to Ranges-Function
- SfxTabPage* pTabPage; // The TabPage itself
+ VclPtr<SfxTabPage> pTabPage; // The TabPage itself
bool bOnDemand; // Flag: ItemSet onDemand
bool bRefresh; // Flag: Page must be re-initialized
@@ -171,12 +171,14 @@ SfxTabPage::SfxTabPage(vcl::Window *pParent, const OString& rID, const OUString&
}
SfxTabPage::~SfxTabPage()
-/* [Description]
+{
+ disposeOnce();
+}
- Destructor
-*/
+void SfxTabPage::dispose()
{
delete pImpl;
+ TabPage::dispose();
}
bool SfxTabPage::FillItemSet( SfxItemSet* rSet )
@@ -363,6 +365,11 @@ SfxTabDialog::SfxTabDialog
SfxTabDialog::~SfxTabDialog()
{
+ disposeOnce();
+}
+
+void SfxTabDialog::dispose()
+{
SavePosAndId();
for ( SfxTabDlgData_Impl::const_iterator it = pImpl->aData.begin(); it != pImpl->aData.end(); ++it )
@@ -391,7 +398,7 @@ SfxTabDialog::~SfxTabDialog()
if ( pDataObject->bOnDemand )
delete &pDataObject->pTabPage->GetItemSet();
- delete pDataObject->pTabPage;
+ pDataObject->pTabPage.disposeAndClear();
}
delete pDataObject;
}
@@ -403,15 +410,26 @@ SfxTabDialog::~SfxTabDialog()
delete [] pRanges;
if (m_bOwnsBaseFmtBtn)
- delete m_pBaseFmtBtn;
+ m_pBaseFmtBtn.disposeAndClear();
if (m_bOwnsResetBtn)
- delete m_pResetBtn;
+ m_pResetBtn.disposeAndClear();
if (m_bOwnsHelpBtn)
- delete m_pHelpBtn;
+ m_pHelpBtn.disposeAndClear();
if (m_bOwnsCancelBtn)
- delete m_pCancelBtn;
+ m_pCancelBtn.disposeAndClear();
if (m_bOwnsOKBtn)
- delete m_pOKBtn;
+ m_pOKBtn.disposeAndClear();
+ m_pBox.clear();
+ m_pTabCtrl.clear();
+ m_pOKBtn.clear();
+ m_pApplyBtn.clear();
+ m_pUserBtn.clear();
+ m_pCancelBtn.clear();
+ m_pHelpBtn.clear();
+ m_pResetBtn.clear();
+ m_pBaseFmtBtn.clear();
+ m_pActionArea.clear();
+ TabDialog::dispose();
}
void SfxTabDialog::Init_Impl(bool bFmtFlag)
@@ -430,33 +448,33 @@ void SfxTabDialog::Init_Impl(bool bFmtFlag)
assert(m_pActionArea);
m_pOKBtn = m_pUIBuilder->get<PushButton>("ok");
- m_bOwnsOKBtn = m_pOKBtn == NULL;
+ m_bOwnsOKBtn = m_pOKBtn == nullptr;
if (m_bOwnsOKBtn)
- m_pOKBtn = new OKButton(m_pActionArea);
+ m_pOKBtn = VclPtr<OKButton>::Create(m_pActionArea);
m_pApplyBtn = m_pUIBuilder->get<PushButton>("apply");
m_pUserBtn = m_pUIBuilder->get<PushButton>("user");
m_pCancelBtn = m_pUIBuilder->get<CancelButton>("cancel");
- m_bOwnsCancelBtn = m_pCancelBtn == NULL;
+ m_bOwnsCancelBtn = m_pCancelBtn == nullptr;
if (m_bOwnsCancelBtn)
- m_pCancelBtn = new CancelButton(m_pActionArea);
+ m_pCancelBtn = VclPtr<CancelButton>::Create(m_pActionArea);
m_pHelpBtn = m_pUIBuilder->get<HelpButton>("help");
- m_bOwnsHelpBtn = m_pHelpBtn == NULL;
+ m_bOwnsHelpBtn = m_pHelpBtn == nullptr;
if (m_bOwnsHelpBtn)
- m_pHelpBtn = new HelpButton(m_pActionArea);
+ m_pHelpBtn = VclPtr<HelpButton>::Create(m_pActionArea);
m_pResetBtn = m_pUIBuilder->get<PushButton>("reset");
- m_bOwnsResetBtn = m_pResetBtn == NULL;
+ m_bOwnsResetBtn = m_pResetBtn == nullptr;
if (m_bOwnsResetBtn)
- m_pResetBtn = new PushButton(m_pActionArea);
+ m_pResetBtn = VclPtr<PushButton>::Create(m_pActionArea.get());
else
pImpl->bHideResetBtn = !m_pResetBtn->IsVisible();
m_pBaseFmtBtn = m_pUIBuilder->get<PushButton>("standard");
- m_bOwnsBaseFmtBtn = m_pBaseFmtBtn == NULL;
+ m_bOwnsBaseFmtBtn = m_pBaseFmtBtn == nullptr;
if (m_bOwnsBaseFmtBtn)
- m_pBaseFmtBtn = new PushButton(m_pActionArea);
+ m_pBaseFmtBtn = VclPtr<PushButton>::Create(m_pActionArea.get());
m_pOKBtn->SetClickHdl( LINK( this, SfxTabDialog, OkHdl ) );
m_pCancelBtn->SetClickHdl( LINK( this, SfxTabDialog, CancelHdl ) );
@@ -690,7 +708,7 @@ void SfxTabDialog::RemoveTabPage( sal_uInt16 nId )
if ( pDataObject->bOnDemand )
delete &pDataObject->pTabPage->GetItemSet();
- delete pDataObject->pTabPage;
+ pDataObject->pTabPage.disposeAndClear();
}
delete pDataObject;
@@ -1127,7 +1145,7 @@ IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl )
else
pTabPage = (pDataObject->fnCreatePage)
( pTabCtrl, CreateInputItemSet( nId ) );
- DBG_ASSERT( NULL == pDataObject->pTabPage, "create TabPage more than once" );
+ DBG_ASSERT( nullptr == pDataObject->pTabPage, "create TabPage more than once" );
pDataObject->pTabPage = pTabPage;
OUString sConfigId = OStringToOUString(pTabPage->GetConfigId(), RTL_TEXTENCODING_UTF8);
@@ -1247,7 +1265,7 @@ IMPL_LINK( SfxTabDialog, DeactivatePageHdl, TabControl *, pTabCtrl )
{
Data_Impl* pObj = *it;
- if ( pObj->pTabPage != pPage ) // Do not refresh own Page anymore
+ if ( pObj->pTabPage.get() != pPage ) // Do not refresh own Page anymore
pObj->bRefresh = true;
else
pObj->bRefresh = false;
diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx
index c5273b485fab..a032f1569690 100644
--- a/sfx2/source/dialog/taskpane.cxx
+++ b/sfx2/source/dialog/taskpane.cxx
@@ -202,13 +202,24 @@ namespace sfx2
TaskPaneDockingWindow::TaskPaneDockingWindow( SfxBindings* i_pBindings, TaskPaneWrapper& i_rWrapper, vcl::Window* i_pParent, WinBits i_nBits )
:TitledDockingWindow( i_pBindings, &i_rWrapper, i_pParent, i_nBits )
- ,m_aTaskPane( GetContentWindow(), lcl_getFrame( i_pBindings ) )
- ,m_aPaneController( m_aTaskPane, *this )
+ ,m_aTaskPane( VclPtr<ModuleTaskPane>::Create(GetContentWindow(), lcl_getFrame( i_pBindings )) )
+ ,m_aPaneController( *m_aTaskPane.get(), *this )
{
- m_aTaskPane.Show();
+ m_aTaskPane->Show();
SetText( SfxResId( SID_TASKPANE ).toString() );
}
+ TaskPaneDockingWindow::~TaskPaneDockingWindow()
+ {
+ disposeOnce();
+ }
+
+ void TaskPaneDockingWindow::dispose()
+ {
+ m_aTaskPane.disposeAndClear();
+ TitledDockingWindow::dispose();
+ }
+
void TaskPaneDockingWindow::ActivateToolPanel( const OUString& i_rPanelURL )
{
@@ -219,13 +230,13 @@ namespace sfx2
void TaskPaneDockingWindow::GetFocus()
{
TitledDockingWindow::GetFocus();
- m_aTaskPane.GrabFocus();
+ m_aTaskPane->GrabFocus();
}
void TaskPaneDockingWindow::onLayoutDone()
{
- m_aTaskPane.SetPosSizePixel( Point(), GetContentWindow().GetOutputSizePixel() );
+ m_aTaskPane->SetPosSizePixel( Point(), GetContentWindow().GetOutputSizePixel() );
}
@@ -238,7 +249,7 @@ namespace sfx2
TaskPaneWrapper::TaskPaneWrapper( vcl::Window* i_pParent, sal_uInt16 i_nId, SfxBindings* i_pBindings, SfxChildWinInfo* i_pInfo )
:SfxChildWindow( i_pParent, i_nId )
{
- pWindow = new TaskPaneDockingWindow( i_pBindings, *this, i_pParent,
+ pWindow = VclPtr<TaskPaneDockingWindow>::Create( i_pBindings, *this, i_pParent,
WB_STDDOCKWIN | WB_CLIPCHILDREN | WB_SIZEABLE | WB_3DLOOK | WB_ROLLABLE);
eChildAlignment = SfxChildAlignment::RIGHT;
@@ -507,9 +518,9 @@ namespace sfx2
:m_rAntiImpl( i_rAntiImpl )
,m_sModuleIdentifier( lcl_identifyModule( i_rDocumentFrame ) )
,m_xFrame( i_rDocumentFrame )
- ,m_aPanelDeck( i_rAntiImpl )
+ ,m_aPanelDeck( new ::svt::ToolPanelDeck(i_rAntiImpl) )
{
- m_aPanelDeck.Show();
+ m_aPanelDeck->Show();
OnResize();
impl_initFromConfiguration();
}
@@ -523,7 +534,7 @@ namespace sfx2
static bool ModuleHasToolPanels( const OUString& i_rModuleIdentifier );
- ::svt::ToolPanelDeck& GetPanelDeck() { return m_aPanelDeck; }
+ ::svt::ToolPanelDeck& GetPanelDeck() { return *m_aPanelDeck.get(); }
::boost::optional< size_t >
GetPanelPos( const OUString& i_rResourceURL );
@@ -540,28 +551,28 @@ namespace sfx2
DECL_LINK( OnActivatePanel, void* );
private:
- ModuleTaskPane& m_rAntiImpl;
- const OUString m_sModuleIdentifier;
- const Reference< XFrame > m_xFrame;
- ::svt::ToolPanelDeck m_aPanelDeck;
+ ModuleTaskPane& m_rAntiImpl;
+ const OUString m_sModuleIdentifier;
+ const Reference< XFrame > m_xFrame;
+ VclPtr<::svt::ToolPanelDeck> m_aPanelDeck;
};
void ModuleTaskPane_Impl::OnResize()
{
- m_aPanelDeck.SetPosSizePixel( Point(), m_rAntiImpl.GetOutputSizePixel() );
+ m_aPanelDeck->SetPosSizePixel( Point(), m_rAntiImpl.GetOutputSizePixel() );
}
void ModuleTaskPane_Impl::OnGetFocus()
{
- m_aPanelDeck.GrabFocus();
+ m_aPanelDeck->GrabFocus();
}
IMPL_LINK( ModuleTaskPane_Impl, OnActivatePanel, void*, i_pArg )
{
- m_aPanelDeck.ActivatePanel( reinterpret_cast< size_t >( i_pArg ) );
+ m_aPanelDeck->ActivatePanel( reinterpret_cast< size_t >( i_pArg ) );
return 1L;
}
@@ -595,8 +606,8 @@ namespace sfx2
::utl::OConfigurationNode aResourceNode( aWindowStateConfig.openNode( *resource ) );
::svt::PToolPanel pCustomPanel( new CustomToolPanel( aResourceNode, m_xFrame ) );
- size_t nPanelPos = m_aPanelDeck.GetPanelCount();
- nPanelPos = m_aPanelDeck.InsertPanel( pCustomPanel, nPanelPos );
+ size_t nPanelPos = m_aPanelDeck->GetPanelCount();
+ nPanelPos = m_aPanelDeck->InsertPanel( pCustomPanel, nPanelPos );
if ( ::comphelper::getBOOL( aResourceNode.getNodeValue( "Visible" ) ) )
sFirstVisiblePanelResource = *resource;
@@ -637,9 +648,9 @@ namespace sfx2
::boost::optional< size_t > ModuleTaskPane_Impl::GetPanelPos( const OUString& i_rResourceURL )
{
::boost::optional< size_t > aPanelPos;
- for ( size_t i = 0; i < m_aPanelDeck.GetPanelCount(); ++i )
+ for ( size_t i = 0; i < m_aPanelDeck->GetPanelCount(); ++i )
{
- const ::svt::PToolPanel pPanel( m_aPanelDeck.GetPanel( i ) );
+ const ::svt::PToolPanel pPanel( m_aPanelDeck->GetPanel( i ) );
const CustomToolPanel* pCustomPanel = dynamic_cast< const CustomToolPanel* >( pPanel.get() );
if ( !pCustomPanel )
{
@@ -656,21 +667,20 @@ namespace sfx2
return aPanelPos;
}
-
void ModuleTaskPane_Impl::SetDrawersLayout()
{
- const ::svt::PDeckLayouter pLayouter( m_aPanelDeck.GetLayouter() );
+ const ::svt::PDeckLayouter pLayouter( m_aPanelDeck->GetLayouter() );
const ::svt::DrawerDeckLayouter* pDrawerLayouter = dynamic_cast< const ::svt::DrawerDeckLayouter* >( pLayouter.get() );
if ( pDrawerLayouter != NULL )
// already have the proper layout
return;
- m_aPanelDeck.SetLayouter( new ::svt::DrawerDeckLayouter( m_aPanelDeck, m_aPanelDeck ) );
+ m_aPanelDeck->SetLayouter( new ::svt::DrawerDeckLayouter( *m_aPanelDeck.get(), *m_aPanelDeck.get() ) );
}
void ModuleTaskPane_Impl::SetTabsLayout( const ::svt::TabAlignment i_eTabAlignment, const ::svt::TabItemContent i_eTabContent )
{
- ::svt::PDeckLayouter pLayouter( m_aPanelDeck.GetLayouter() );
+ ::svt::PDeckLayouter pLayouter( m_aPanelDeck->GetLayouter() );
::svt::TabDeckLayouter* pTabLayouter = dynamic_cast< ::svt::TabDeckLayouter* >( pLayouter.get() );
if ( ( pTabLayouter != NULL )
&& ( pTabLayouter->GetTabAlignment() == i_eTabAlignment )
@@ -686,7 +696,7 @@ namespace sfx2
return;
}
- m_aPanelDeck.SetLayouter( new ::svt::TabDeckLayouter( m_aPanelDeck, m_aPanelDeck, i_eTabAlignment, i_eTabContent ) );
+ m_aPanelDeck->SetLayouter( new ::svt::TabDeckLayouter( *m_aPanelDeck.get(), *m_aPanelDeck.get(), i_eTabAlignment, i_eTabContent ) );
}
@@ -699,12 +709,11 @@ namespace sfx2
{
}
-
ModuleTaskPane::~ModuleTaskPane()
{
+ disposeOnce();
}
-
bool ModuleTaskPane::ModuleHasToolPanels( const Reference< XFrame >& i_rDocumentFrame )
{
return ModuleTaskPane_Impl::ModuleHasToolPanels( lcl_identifyModule( i_rDocumentFrame ) );
diff --git a/sfx2/source/dialog/templateinfodlg.cxx b/sfx2/source/dialog/templateinfodlg.cxx
index 1f6f9935aaf8..df195c8efdb2 100644
--- a/sfx2/source/dialog/templateinfodlg.cxx
+++ b/sfx2/source/dialog/templateinfodlg.cxx
@@ -38,7 +38,7 @@ SfxTemplateInfoDlg::SfxTemplateInfoDlg (vcl::Window *pParent)
get(mpBtnClose, "close");
get(mpBox, "box");
get(mpInfoView, "infoDrawingArea");
- mpPreviewView = new vcl::Window(mpBox);
+ mpPreviewView = VclPtr<vcl::Window>::Create(mpBox.get());
Size aSize(LogicToPixel(Size(250, 160), MAP_APPFONT));
mpBox->set_width_request(aSize.Width());
@@ -54,7 +54,17 @@ SfxTemplateInfoDlg::SfxTemplateInfoDlg (vcl::Window *pParent)
SfxTemplateInfoDlg::~SfxTemplateInfoDlg()
{
+ disposeOnce();
+}
+
+void SfxTemplateInfoDlg::dispose()
+{
m_xFrame->dispose();
+ mpBtnClose.clear();
+ mpBox.clear();
+ mpPreviewView.clear();
+ mpInfoView.clear();
+ ModalDialog::dispose();
}
void SfxTemplateInfoDlg::loadDocument(const OUString &rURL)
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 76ab7dbc9fc4..1a922bba75b8 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -355,6 +355,13 @@ SfxTemplatePanelControl::SfxTemplatePanelControl(SfxBindings* pBindings, vcl::Wi
SfxTemplatePanelControl::~SfxTemplatePanelControl()
{
+ disposeOnce();
+}
+
+void SfxTemplatePanelControl::dispose()
+{
+ pImpl.reset();
+ DockingWindow::dispose();
}
void SfxTemplatePanelControl::DataChanged( const DataChangedEvent& _rDCEvt )
@@ -657,8 +664,8 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, vcl
, xModuleManager(frame::ModuleManager::create(::comphelper::getProcessComponentContext()))
, m_pDeletionWatcher(NULL)
- , aFmtLb(this, WB_BORDER | WB_TABSTOP | WB_SORT | WB_QUICK_SEARCH)
- , aFilterLb(pW, WB_BORDER | WB_DROPDOWN | WB_TABSTOP)
+ , aFmtLb( VclPtr<SfxActionListBox>::Create(this, WB_BORDER | WB_TABSTOP | WB_SORT | WB_QUICK_SEARCH) )
+ , aFilterLb( VclPtr<ListBox>::Create(pW, WB_BORDER | WB_DROPDOWN | WB_TABSTOP) )
, nActFamily(0xffff)
, nActFilter(0)
@@ -682,13 +689,13 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, vcl
, m_bWantHierarchical(false)
, bBindingUpdate(true)
{
- aFmtLb.SetAccessibleName(SfxResId(STR_STYLE_ELEMTLIST).toString());
- aFmtLb.SetHelpId( HID_TEMPLATE_FMT );
- aFilterLb.SetHelpId( HID_TEMPLATE_FILTER );
- aFmtLb.SetStyle( aFmtLb.GetStyle() | WB_SORT | WB_HIDESELECTION );
- vcl::Font aFont = aFmtLb.GetFont();
+ aFmtLb->SetAccessibleName(SfxResId(STR_STYLE_ELEMTLIST).toString());
+ aFmtLb->SetHelpId( HID_TEMPLATE_FMT );
+ aFilterLb->SetHelpId( HID_TEMPLATE_FILTER );
+ aFmtLb->SetStyle( aFmtLb->GetStyle() | WB_SORT | WB_HIDESELECTION );
+ vcl::Font aFont = aFmtLb->GetFont();
aFont.SetWeight( WEIGHT_NORMAL );
- aFmtLb.SetFont( aFont );
+ aFmtLb->SetFont( aFont );
memset(pBoundItems, 0, sizeof(pBoundItems));
memset(pFamilyState, 0, sizeof(pFamilyState));
@@ -850,15 +857,15 @@ void SfxCommonTemplateDialog_Impl::Initialize()
Update_Impl();
- aFilterLb.SetSelectHdl( LINK( this, SfxCommonTemplateDialog_Impl, FilterSelectHdl ) );
- aFmtLb.SetDoubleClickHdl( LINK( this, SfxCommonTemplateDialog_Impl, ApplyHdl ) );
- aFmtLb.SetSelectHdl( LINK( this, SfxCommonTemplateDialog_Impl, FmtSelectHdl ) );
- aFmtLb.SetSelectionMode(MULTIPLE_SELECTION);
+ aFilterLb->SetSelectHdl( LINK( this, SfxCommonTemplateDialog_Impl, FilterSelectHdl ) );
+ aFmtLb->SetDoubleClickHdl( LINK( this, SfxCommonTemplateDialog_Impl, ApplyHdl ) );
+ aFmtLb->SetSelectHdl( LINK( this, SfxCommonTemplateDialog_Impl, FmtSelectHdl ) );
+ aFmtLb->SetSelectionMode(MULTIPLE_SELECTION);
- aFilterLb.Show();
+ aFilterLb->Show();
if (!bHierarchical)
- aFmtLb.Show();
+ aFmtLb->Show();
}
SfxCommonTemplateDialog_Impl::~SfxCommonTemplateDialog_Impl()
@@ -876,10 +883,12 @@ SfxCommonTemplateDialog_Impl::~SfxCommonTemplateDialog_Impl()
if ( pStyleSheetPool )
EndListening(*pStyleSheetPool);
pStyleSheetPool = NULL;
- delete pTreeBox;
+ pTreeBox.disposeAndClear();
delete pIdle;
if ( m_pDeletionWatcher )
m_pDeletionWatcher->signal();
+ aFmtLb.disposeAndClear();
+ aFilterLb.disposeAndClear();
}
namespace SfxTemplate
@@ -979,19 +988,19 @@ void SfxCommonTemplateDialog_Impl::SelectStyle(const OUString &rStr)
bool bSelect = ! rStr.isEmpty();
if ( bSelect )
{
- SvTreeListEntry* pEntry = (SvTreeListEntry*)aFmtLb.FirstVisible();
- while ( pEntry && aFmtLb.GetEntryText( pEntry ) != rStr )
- pEntry = (SvTreeListEntry*)aFmtLb.NextVisible( pEntry );
+ SvTreeListEntry* pEntry = (SvTreeListEntry*)aFmtLb->FirstVisible();
+ while ( pEntry && aFmtLb->GetEntryText( pEntry ) != rStr )
+ pEntry = (SvTreeListEntry*)aFmtLb->NextVisible( pEntry );
if ( !pEntry )
bSelect = false;
else
{
- if (!aFmtLb.IsSelected(pEntry))
+ if (!aFmtLb->IsSelected(pEntry))
{
- aFmtLb.MakeVisible( pEntry );
- aFmtLb.SelectAll(false);
- aFmtLb.Select( pEntry );
- bWaterDisabled = !(pTreeBox || aFmtLb.GetSelectionCount() <= 1);
+ aFmtLb->MakeVisible( pEntry );
+ aFmtLb->SelectAll(false);
+ aFmtLb->Select( pEntry );
+ bWaterDisabled = !(pTreeBox || aFmtLb->GetSelectionCount() <= 1);
FmtSelectHdl( NULL );
}
}
@@ -999,7 +1008,7 @@ void SfxCommonTemplateDialog_Impl::SelectStyle(const OUString &rStr)
if ( !bSelect )
{
- aFmtLb.SelectAll( false );
+ aFmtLb->SelectAll( false );
EnableEdit(false);
EnableHide( false );
EnableShow( false );
@@ -1018,9 +1027,9 @@ OUString SfxCommonTemplateDialog_Impl::GetSelectedEntry() const
}
else
{
- SvTreeListEntry* pEntry = aFmtLb.FirstSelected();
+ SvTreeListEntry* pEntry = aFmtLb->FirstSelected();
if ( pEntry )
- aRet = aFmtLb.GetEntryText( pEntry );
+ aRet = aFmtLb->GetEntryText( pEntry );
}
return aRet;
}
@@ -1104,7 +1113,7 @@ void SfxCommonTemplateDialog_Impl::FillTreeBox()
bool SfxCommonTemplateDialog_Impl::HasSelectedStyle() const
{
return pTreeBox? pTreeBox->FirstSelected() != 0:
- aFmtLb.GetSelectionCount() != 0;
+ aFmtLb->GetSelectionCount() != 0;
}
// internal: Refresh the display
@@ -1145,24 +1154,24 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags)
if((nFlags & UPDATE_FAMILY) == UPDATE_FAMILY) // Update view type list (Hierarchical, All, etc.
{
CheckItem(nActFamily, true); // check Button in Toolbox
- aFilterLb.SetUpdateMode(false);
- aFilterLb.Clear();
+ aFilterLb->SetUpdateMode(false);
+ aFilterLb->Clear();
//insert hierarchical at the beginning
- sal_uInt16 nPos = aFilterLb.InsertEntry(SfxResId(STR_STYLE_FILTER_HIERARCHICAL).toString(), 0);
- aFilterLb.SetEntryData( nPos, reinterpret_cast<void*>(SFXSTYLEBIT_ALL) );
+ sal_uInt16 nPos = aFilterLb->InsertEntry(SfxResId(STR_STYLE_FILTER_HIERARCHICAL).toString(), 0);
+ aFilterLb->SetEntryData( nPos, reinterpret_cast<void*>(SFXSTYLEBIT_ALL) );
const SfxStyleFilter& rFilter = pItem->GetFilterList();
for( size_t i = 0; i < rFilter.size(); ++i)
{
sal_uIntPtr nFilterFlags = rFilter[ i ]->nFlags;
- nPos = aFilterLb.InsertEntry( rFilter[ i ]->aName );
- aFilterLb.SetEntryData( nPos, reinterpret_cast<void*>(nFilterFlags) );
+ nPos = aFilterLb->InsertEntry( rFilter[ i ]->aName );
+ aFilterLb->SetEntryData( nPos, reinterpret_cast<void*>(nFilterFlags) );
}
- if(nActFilter < aFilterLb.GetEntryCount() - 1)
- aFilterLb.SelectEntryPos(nActFilter + 1);
+ if(nActFilter < aFilterLb->GetEntryCount() - 1)
+ aFilterLb->SelectEntryPos(nActFilter + 1);
else
{
nActFilter = 0;
- aFilterLb.SelectEntryPos(1);
+ aFilterLb->SelectEntryPos(1);
SfxFilterTupel* pActT = ( nActFilter < rFilter.size() ) ? rFilter[ nActFilter ] : NULL;
sal_uInt16 nFilterFlags = pActT ? pActT->nFlags : 0;
pStyleSheetPool->SetSearchMask(eFam, nFilterFlags);
@@ -1171,22 +1180,22 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags)
// if the tree view again, select family hierarchy
if (pTreeBox || m_bWantHierarchical)
{
- aFilterLb.SelectEntry(SfxResId(STR_STYLE_FILTER_HIERARCHICAL).toString());
+ aFilterLb->SelectEntry(SfxResId(STR_STYLE_FILTER_HIERARCHICAL).toString());
EnableHierarchical(true);
}
// show maximum 14 entries
- aFilterLb.SetDropDownLineCount( MAX_FILTER_ENTRIES );
- aFilterLb.SetUpdateMode(true);
+ aFilterLb->SetDropDownLineCount( MAX_FILTER_ENTRIES );
+ aFilterLb->SetUpdateMode(true);
}
else
{
- if (nActFilter < aFilterLb.GetEntryCount() - 1)
- aFilterLb.SelectEntryPos(nActFilter + 1);
+ if (nActFilter < aFilterLb->GetEntryCount() - 1)
+ aFilterLb->SelectEntryPos(nActFilter + 1);
else
{
nActFilter = 0;
- aFilterLb.SelectEntryPos(1);
+ aFilterLb->SelectEntryPos(1);
}
}
@@ -1195,7 +1204,7 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags)
EnableItem(SID_STYLE_WATERCAN,false);
SfxStyleSheetBase *pStyle = pStyleSheetPool->First();
- SvTreeListEntry* pEntry = aFmtLb.First();
+ SvTreeListEntry* pEntry = aFmtLb->First();
std::vector<OUString> aStrings;
comphelper::string::NaturalStringSorter aSorter(
@@ -1215,27 +1224,27 @@ void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags)
size_t nCount = aStrings.size();
size_t nPos = 0;
while(nPos < nCount && pEntry &&
- aStrings[nPos] == aFmtLb.GetEntryText(pEntry))
+ aStrings[nPos] == aFmtLb->GetEntryText(pEntry))
{
++nPos;
- pEntry = aFmtLb.Next( pEntry );
+ pEntry = aFmtLb->Next( pEntry );
}
if( nPos < nCount || pEntry )
{
// Fills the display box
- aFmtLb.SetUpdateMode(false);
- aFmtLb.Clear();
+ aFmtLb->SetUpdateMode(false);
+ aFmtLb->Clear();
for(nPos = 0; nPos < nCount; ++nPos)
{
- SvTreeListEntry* pTreeListEntry = aFmtLb.InsertEntry(aStrings[nPos], 0, false, nPos);
+ SvTreeListEntry* pTreeListEntry = aFmtLb->InsertEntry(aStrings[nPos], 0, false, nPos);
StyleLBoxString* pStyleLBoxString = new StyleLBoxString(pTreeListEntry, 0, aStrings[nPos], eFam);
pTreeListEntry->ReplaceItem(pStyleLBoxString, 1);
- aFmtLb.GetModel()->InvalidateEntry(pTreeListEntry);
+ aFmtLb->GetModel()->InvalidateEntry(pTreeListEntry);
}
- aFmtLb.Recalc();
- aFmtLb.SetUpdateMode(true);
+ aFmtLb->Recalc();
+ aFmtLb->SetUpdateMode(true);
}
// Selects the current style if any
SfxTemplateItem *pState = pFamilyState[nActFamily-1];
@@ -1262,7 +1271,7 @@ void SfxCommonTemplateDialog_Impl::SetWaterCanState(const SfxBoolItem *pItem)
if(!bWaterDisabled)
//make sure the watercan is only activated when there is (only) one selection
- bWaterDisabled = !(pTreeBox || aFmtLb.GetSelectionCount() <= 1);
+ bWaterDisabled = pTreeBox || aFmtLb->GetSelectionCount() <= 1;
if(pItem && !bWaterDisabled)
{
@@ -1597,7 +1606,7 @@ bool SfxCommonTemplateDialog_Impl::Execute_Impl(
if ( !pItem || aDeleted )
return false;
- if ( (nId == SID_STYLE_NEW || SID_STYLE_EDIT == nId) && (pTreeBox || aFmtLb.GetSelectionCount() <= 1) )
+ if ( (nId == SID_STYLE_NEW || SID_STYLE_EDIT == nId) && (pTreeBox || aFmtLb->GetSelectionCount() <= 1) )
{
const SfxUInt16Item *pFilterItem = PTR_CAST(SfxUInt16Item, pItem);
OSL_ENSURE(pFilterItem, "SfxUINT16Item expected");
@@ -1631,15 +1640,16 @@ void SfxCommonTemplateDialog_Impl::EnableHierarchical(bool const bEnable)
m_bWantHierarchical = true;
SaveSelection(); // fdo#61429 store "hierarchical"
const OUString aSelectEntry( GetSelectedEntry());
- aFmtLb.Hide();
+ aFmtLb->Hide();
+
+ pTreeBox = VclPtr<StyleTreeListBox_Impl>::Create(
- pTreeBox = new StyleTreeListBox_Impl(
this, WB_HASBUTTONS | WB_HASLINES |
WB_BORDER | WB_TABSTOP | WB_HASLINESATROOT |
WB_HASBUTTONSATROOT | WB_HIDESELECTION | WB_QUICK_SEARCH );
- pTreeBox->SetFont( aFmtLb.GetFont() );
+ pTreeBox->SetFont( aFmtLb->GetFont() );
- pTreeBox->SetPosSizePixel(aFmtLb.GetPosPixel(), aFmtLb.GetSizePixel());
+ pTreeBox->SetPosSizePixel(aFmtLb->GetPosPixel(), aFmtLb->GetSizePixel());
pTreeBox->SetNodeDefaultImages();
pTreeBox->SetSelectHdl(
LINK(this, SfxCommonTemplateDialog_Impl, FmtSelectHdl));
@@ -1655,12 +1665,12 @@ void SfxCommonTemplateDialog_Impl::EnableHierarchical(bool const bEnable)
}
else
{
- DELETEZ(pTreeBox);
- aFmtLb.Show();
+ pTreeBox.disposeAndClear();
+ aFmtLb->Show();
// If bHierarchical, then the family can have changed
// minus one since hierarchical is inserted at the start
m_bWantHierarchical = false; // before FilterSelect
- FilterSelect(aFilterLb.GetSelectEntryPos() - 1, bHierarchical );
+ FilterSelect(aFilterLb->GetSelectEntryPos() - 1, bHierarchical );
bHierarchical=false;
}
}
@@ -1742,8 +1752,8 @@ void SfxCommonTemplateDialog_Impl::ActionSelect(sal_uInt16 nEntry)
nFilter=pStyleSheetPool->GetSearchMask();
pStyleSheetPool->SetSearchMask( eFam, SFXSTYLEBIT_USERDEF );
- std::unique_ptr<SfxNewStyleDlg> pDlg(new SfxNewStyleDlg(pWindow, *pStyleSheetPool));
- // why? : FloatingWindow must not be parent of a modal dialog
+ ScopedVclPtrInstance< SfxNewStyleDlg > pDlg(pWindow, *pStyleSheetPool);
+ // why? : FloatingWindow must not be parent of a modal dialog
if(RET_OK == pDlg->Execute())
{
pStyleSheetPool->SetSearchMask(eFam, nFilter);
@@ -1847,7 +1857,7 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, DropHdl, StyleTreeListBox_Impl *, pBox
void SfxCommonTemplateDialog_Impl::NewHdl(void *)
{
OUString aEmpty;
- if ( nActFamily != 0xffff && (pTreeBox || aFmtLb.GetSelectionCount() <= 1))
+ if ( nActFamily != 0xffff && (pTreeBox || aFmtLb->GetSelectionCount() <= 1))
{
vcl::Window* pTmp;
pTmp = Application::GetDefDialogParent();
@@ -1910,7 +1920,7 @@ void SfxCommonTemplateDialog_Impl::DeleteHdl(void *)
bool bUsedStyle = false; // one of the selected styles are used in the document?
std::vector<SvTreeListEntry*> aList;
- SvTreeListEntry* pEntry = pTreeBox ? pTreeBox->FirstSelected() : aFmtLb.FirstSelected();
+ SvTreeListEntry* pEntry = pTreeBox ? pTreeBox->FirstSelected() : aFmtLb->FirstSelected();
const SfxStyleFamilyItem* pItem = GetFamilyItem_Impl();
OUString aMsg = SfxResId(STR_DELETE_STYLE_USED).toString();
@@ -1920,7 +1930,7 @@ void SfxCommonTemplateDialog_Impl::DeleteHdl(void *)
{
aList.push_back( pEntry );
// check the style is used or not
- const OUString aTemplName(pTreeBox ? pTreeBox->GetEntryText(pEntry) : aFmtLb.GetEntryText(pEntry));
+ const OUString aTemplName(pTreeBox ? pTreeBox->GetEntryText(pEntry) : aFmtLb->GetEntryText(pEntry));
SfxStyleSheetBase* pStyle = pStyleSheetPool->Find( aTemplName, pItem->GetFamily(), SFXSTYLEBIT_ALL );
@@ -1932,7 +1942,7 @@ void SfxCommonTemplateDialog_Impl::DeleteHdl(void *)
bUsedStyle = true;
}
- pEntry = pTreeBox ? pTreeBox->NextSelected(pEntry) : aFmtLb.NextSelected(pEntry);
+ pEntry = pTreeBox ? pTreeBox->NextSelected(pEntry) : aFmtLb->NextSelected(pEntry);
}
bool aApproved = false;
@@ -1941,13 +1951,13 @@ void SfxCommonTemplateDialog_Impl::DeleteHdl(void *)
if ( bUsedStyle )
{
#if defined UNX
- MessageDialog aBox(SfxGetpApp()->GetTopWindow(), aMsg,
+ ScopedVclPtrInstance<MessageDialog> aBox(SfxGetpApp()->GetTopWindow(), aMsg,
VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
#else
- MessageDialog aBox(GetWindow(), aMsg,
+ ScopedVclPtrInstance<MessageDialog> aBox(GetWindow(), aMsg,
VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
#endif
- aApproved = aBox.Execute() == RET_YES;
+ aApproved = aBox->Execute() == RET_YES;
}
// if there are no used styles selected or the user approved the changes
@@ -1957,7 +1967,7 @@ void SfxCommonTemplateDialog_Impl::DeleteHdl(void *)
for (; it != itEnd; ++it)
{
- const OUString aTemplName(pTreeBox ? pTreeBox->GetEntryText(*it) : aFmtLb.GetEntryText(*it));
+ const OUString aTemplName(pTreeBox ? pTreeBox->GetEntryText(*it) : aFmtLb->GetEntryText(*it));
bDontUpdate = true; // To prevent the Treelistbox to shut down while deleting
Execute_Impl( SID_STYLE_DELETE, aTemplName,
OUString(), (sal_uInt16)GetFamilyItem_Impl()->GetFamily() );
@@ -1978,16 +1988,16 @@ void SfxCommonTemplateDialog_Impl::HideHdl(void *)
{
if ( IsInitialized() && HasSelectedStyle() )
{
- SvTreeListEntry* pEntry = pTreeBox ? pTreeBox->FirstSelected() : aFmtLb.FirstSelected();
+ SvTreeListEntry* pEntry = pTreeBox ? pTreeBox->FirstSelected() : aFmtLb->FirstSelected();
while (pEntry)
{
- OUString aTemplName = pTreeBox ? pTreeBox->GetEntryText(pEntry) : aFmtLb.GetEntryText(pEntry);
+ OUString aTemplName = pTreeBox ? pTreeBox->GetEntryText(pEntry) : aFmtLb->GetEntryText(pEntry);
Execute_Impl( SID_STYLE_HIDE, aTemplName,
OUString(), (sal_uInt16)GetFamilyItem_Impl()->GetFamily() );
- pEntry = pTreeBox ? pTreeBox->NextSelected(pEntry) : aFmtLb.NextSelected(pEntry);
+ pEntry = pTreeBox ? pTreeBox->NextSelected(pEntry) : aFmtLb->NextSelected(pEntry);
}
}
}
@@ -1997,16 +2007,16 @@ void SfxCommonTemplateDialog_Impl::ShowHdl(void *)
if ( IsInitialized() && HasSelectedStyle() )
{
- SvTreeListEntry* pEntry = pTreeBox ? pTreeBox->FirstSelected() : aFmtLb.FirstSelected();
+ SvTreeListEntry* pEntry = pTreeBox ? pTreeBox->FirstSelected() : aFmtLb->FirstSelected();
while (pEntry)
{
- OUString aTemplName = pTreeBox ? pTreeBox->GetEntryText(pEntry) : aFmtLb.GetEntryText(pEntry);
+ OUString aTemplName = pTreeBox ? pTreeBox->GetEntryText(pEntry) : aFmtLb->GetEntryText(pEntry);
Execute_Impl( SID_STYLE_SHOW, aTemplName,
OUString(), (sal_uInt16)GetFamilyItem_Impl()->GetFamily() );
- pEntry = pTreeBox ? pTreeBox->NextSelected(pEntry) : aFmtLb.NextSelected(pEntry);
+ pEntry = pTreeBox ? pTreeBox->NextSelected(pEntry) : aFmtLb->NextSelected(pEntry);
}
}
}
@@ -2064,7 +2074,7 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, ApplyHdl, Control *, pControl )
if ( IsInitialized() && 0 != pFamilyState[nActFamily-1] &&
!GetSelectedEntry().isEmpty() )
{
- sal_uInt16 nModifier = aFmtLb.GetModifier();
+ sal_uInt16 nModifier = aFmtLb->GetModifier();
Execute_Impl(SID_STYLE_APPLY,
GetSelectedEntry(), OUString(),
( sal_uInt16 )GetFamilyItem_Impl()->GetFamily(),
@@ -2084,7 +2094,7 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, FmtSelectHdl, SvTreeListBox *, pListBox
if ( IsInitialized() &&
IsCheckedItem(SID_STYLE_WATERCAN) &&
// only if that region is allowed
- 0 != pFamilyState[nActFamily-1] && (pTreeBox || aFmtLb.GetSelectionCount() <= 1) )
+ 0 != pFamilyState[nActFamily-1] && (pTreeBox || aFmtLb->GetSelectionCount() <= 1) )
{
OUString aEmpty;
Execute_Impl(SID_STYLE_WATERCAN,
@@ -2100,7 +2110,7 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, FmtSelectHdl, SvTreeListBox *, pListBox
{
SelectStyle( pListBox->GetEntryText( pListBox->GetHdlEntry() ));
#if defined STYLESPREVIEW
- sal_uInt16 nModifier = aFmtLb.GetModifier();
+ sal_uInt16 nModifier = aFmtLb->GetModifier();
if ( mbIgnoreSelect )
{
Execute_Impl(SID_STYLE_END_PREVIEW,
@@ -2155,10 +2165,10 @@ void SfxCommonTemplateDialog_Impl::EnableExample_Impl(sal_uInt16 nId, bool bEnab
{
if( nId == SID_STYLE_NEW_BY_EXAMPLE )
{
- bNewByExampleDisabled = !(pTreeBox || aFmtLb.GetSelectionCount() <= 1) || !bEnable;
+ bNewByExampleDisabled = !(pTreeBox || aFmtLb->GetSelectionCount() <= 1) || !bEnable;
}
else if( nId == SID_STYLE_UPDATE_BY_EXAMPLE )
- bUpdateByExampleDisabled = !(pTreeBox || aFmtLb.GetSelectionCount() <= 1) || !bEnable;
+ bUpdateByExampleDisabled = !(pTreeBox || aFmtLb->GetSelectionCount() <= 1) || !bEnable;
EnableItem(nId, bEnable);
}
@@ -2186,8 +2196,8 @@ SfxTemplateDialog_Impl::SfxTemplateDialog_Impl(SfxBindings* pB, SfxTemplatePanel
: SfxCommonTemplateDialog_Impl(pB, pDlgWindow, true)
, m_pFloat(pDlgWindow)
, m_bZoomIn(false)
- , m_aActionTbL(pDlgWindow, this)
- , m_aActionTbR(pDlgWindow, SfxResId(TB_ACTION))
+ , m_aActionTbL(VclPtrInstance<DropToolBox_Impl>(pDlgWindow, this))
+ , m_aActionTbR(VclPtrInstance<ToolBox> (pDlgWindow, SfxResId(TB_ACTION)))
{
pDlgWindow->FreeResource();
Initialize();
@@ -2197,20 +2207,20 @@ void SfxTemplateDialog_Impl::Initialize()
{
SfxCommonTemplateDialog_Impl::Initialize();
- m_aActionTbL.SetSelectHdl(LINK(this, SfxTemplateDialog_Impl, ToolBoxLSelect));
- m_aActionTbR.SetSelectHdl(LINK(this, SfxTemplateDialog_Impl, ToolBoxRSelect));
- m_aActionTbR.SetDropdownClickHdl(LINK(this, SfxTemplateDialog_Impl, ToolBoxRClick));
- m_aActionTbL.Show();
- m_aActionTbR.Show();
- vcl::Font aFont = aFilterLb.GetFont();
- aFont.SetWeight(WEIGHT_NORMAL);
- aFilterLb.SetFont(aFont);
- m_aActionTbL.SetHelpId(HID_TEMPLDLG_TOOLBOX_LEFT);
+ m_aActionTbL->SetSelectHdl(LINK(this, SfxTemplateDialog_Impl, ToolBoxLSelect));
+ m_aActionTbR->SetSelectHdl(LINK(this, SfxTemplateDialog_Impl, ToolBoxRSelect));
+ m_aActionTbR->SetDropdownClickHdl(LINK(this, SfxTemplateDialog_Impl, ToolBoxRClick));
+ m_aActionTbL->Show();
+ m_aActionTbR->Show();
+ vcl::Font aFont = aFilterLb->GetFont();
+ aFont.SetWeight( WEIGHT_NORMAL );
+ aFilterLb->SetFont( aFont );
+ m_aActionTbL->SetHelpId( HID_TEMPLDLG_TOOLBOX_LEFT );
}
void SfxTemplateDialog_Impl::EnableFamilyItem( sal_uInt16 nId, bool bEnable )
{
- m_aActionTbL.EnableItem( nId, bEnable );
+ m_aActionTbL->EnableItem( nId, bEnable );
}
// Insert element into dropdown filter "Frame Styles", "List Styles", etc.
@@ -2226,15 +2236,15 @@ void SfxTemplateDialog_Impl::InsertFamilyItem(sal_uInt16 nId,const SfxStyleFamil
case SFX_STYLE_FAMILY_PSEUDO: sHelpId = ".uno:ListStyle"; break;
default: OSL_FAIL("unknown StyleFamily"); break;
}
- m_aActionTbL.InsertItem( nId, pItem->GetImage(), pItem->GetText(), ToolBoxItemBits::NONE, 0);
- m_aActionTbL.SetHelpId( nId, sHelpId );
+ m_aActionTbL->InsertItem( nId, pItem->GetImage(), pItem->GetText(), ToolBoxItemBits::NONE, 0);
+ m_aActionTbL->SetHelpId( nId, sHelpId );
}
void SfxTemplateDialog_Impl::ReplaceUpdateButtonByMenu()
{
- m_aActionTbR.HideItem(SID_STYLE_UPDATE_BY_EXAMPLE);
- m_aActionTbR.SetItemBits(SID_STYLE_NEW_BY_EXAMPLE,
- ToolBoxItemBits::DROPDOWNONLY | m_aActionTbR.GetItemBits( SID_STYLE_NEW_BY_EXAMPLE ));
+ m_aActionTbR->HideItem(SID_STYLE_UPDATE_BY_EXAMPLE);
+ m_aActionTbR->SetItemBits( SID_STYLE_NEW_BY_EXAMPLE,
+ ToolBoxItemBits::DROPDOWNONLY|m_aActionTbR->GetItemBits( SID_STYLE_NEW_BY_EXAMPLE ));
}
void SfxTemplateDialog_Impl::updateFamilyImages()
@@ -2252,18 +2262,18 @@ void SfxTemplateDialog_Impl::updateFamilyImages()
{
const SfxStyleFamilyItem *pItem = pStyleFamilies->at( nLoop );
sal_uInt16 nId = SfxTemplate::SfxFamilyIdToNId( pItem->GetFamily() );
- m_aActionTbL.SetItemImage( nId, pItem->GetImage() );
+ m_aActionTbL->SetItemImage( nId, pItem->GetImage() );
}
}
void SfxTemplateDialog_Impl::updateNonFamilyImages()
{
- m_aActionTbR.SetImageList( ImageList( SfxResId( DLG_STYLE_DESIGNER ) ) );
+ m_aActionTbR->SetImageList( ImageList( SfxResId( DLG_STYLE_DESIGNER ) ) );
}
void SfxTemplateDialog_Impl::ClearFamilyList()
{
- m_aActionTbL.Clear();
+ m_aActionTbL->Clear();
}
void SfxCommonTemplateDialog_Impl::InvalidateBindings()
@@ -2282,6 +2292,9 @@ void SfxCommonTemplateDialog_Impl::InvalidateBindings()
SfxTemplateDialog_Impl::~SfxTemplateDialog_Impl()
{
+ m_pFloat.clear();
+ m_aActionTbL.disposeAndClear();
+ m_aActionTbR.disposeAndClear();
}
void SfxTemplateDialog_Impl::LoadedFamilies()
@@ -2294,7 +2307,7 @@ void SfxTemplateDialog_Impl::LoadedFamilies()
// The size of the Listboxen is adjusted
void SfxTemplateDialog_Impl::Resize()
{
- SfxDockingWindow* pDockingWindow = dynamic_cast<SfxDockingWindow*>(m_pFloat);
+ SfxDockingWindow* pDockingWindow = dynamic_cast<SfxDockingWindow*>(m_pFloat.get());
FloatingWindow *pF = pDockingWindow!=NULL ? pDockingWindow->GetFloatingWindow() : NULL;
if (pF)
{
@@ -2303,30 +2316,30 @@ void SfxTemplateDialog_Impl::Resize()
return;
}
- if (m_pFloat == NULL)
+ if (m_pFloat == nullptr)
return;
Size aDlgSize=m_pFloat->PixelToLogic(m_pFloat->GetOutputSizePixel());
- Size aSizeATL=m_pFloat->PixelToLogic(m_aActionTbL.CalcWindowSizePixel());
- Size aSizeATR=m_pFloat->PixelToLogic(m_aActionTbR.CalcWindowSizePixel());
+ Size aSizeATL=m_pFloat->PixelToLogic(m_aActionTbL->CalcWindowSizePixel());
+ Size aSizeATR=m_pFloat->PixelToLogic(m_aActionTbR->CalcWindowSizePixel());
Size aMinSize = GetMinOutputSizePixel();
- long nListHeight = m_pFloat->PixelToLogic( aFilterLb.GetSizePixel() ).Height();
+ long nListHeight = m_pFloat->PixelToLogic( aFilterLb->GetSizePixel() ).Height();
long nWidth = aDlgSize.Width()- 2 * SFX_TEMPLDLG_HFRAME;
- m_aActionTbL.SetPosSizePixel(m_pFloat->LogicToPixel(Point(SFX_TEMPLDLG_HFRAME,SFX_TEMPLDLG_VTOPFRAME)),
+ m_aActionTbL->SetPosSizePixel(m_pFloat->LogicToPixel(Point(SFX_TEMPLDLG_HFRAME,SFX_TEMPLDLG_VTOPFRAME)),
m_pFloat->LogicToPixel(aSizeATL));
// only change the position of the right toolbox, when the window is wide
// enough
Point aPosATR(aDlgSize.Width()-SFX_TEMPLDLG_HFRAME-aSizeATR.Width(),SFX_TEMPLDLG_VTOPFRAME);
if(aDlgSize.Width() >= aMinSize.Width())
- m_aActionTbR.SetPosPixel(m_pFloat->LogicToPixel(aPosATR));
+ m_aActionTbR->SetPosPixel(m_pFloat->LogicToPixel(aPosATR));
else
- m_aActionTbR.SetPosPixel( m_pFloat->LogicToPixel(
+ m_aActionTbR->SetPosPixel( m_pFloat->LogicToPixel(
Point( SFX_TEMPLDLG_HFRAME + aSizeATL.Width() + SFX_TEMPLDLG_MIDHSPACE,
SFX_TEMPLDLG_VTOPFRAME ) ) );
- m_aActionTbR.SetSizePixel(m_pFloat->LogicToPixel(aSizeATR));
+ m_aActionTbR->SetSizePixel(m_pFloat->LogicToPixel(aSizeATR));
Point aFilterPos(
m_pFloat->LogicToPixel(Point(SFX_TEMPLDLG_HFRAME,
@@ -2347,26 +2360,26 @@ void SfxTemplateDialog_Impl::Resize()
// only change the position of the listbox, when the window is high enough
if(aDlgSize.Height() >= aMinSize.Height())
{
- aFilterLb.SetPosPixel(aFilterPos);
- aFmtLb.SetPosPixel( aFmtPos );
+ aFilterLb->SetPosPixel(aFilterPos);
+ aFmtLb->SetPosPixel( aFmtPos );
if(pTreeBox)
pTreeBox->SetPosPixel(aFmtPos);
}
else
aFmtSize.Height() += aFilterSize.Height();
- aFilterLb.SetSizePixel(aFilterSize);
- aFmtLb.SetSizePixel( aFmtSize );
+ aFilterLb->SetSizePixel(aFilterSize);
+ aFmtLb->SetSizePixel( aFmtSize );
if(pTreeBox)
pTreeBox->SetSizePixel(aFmtSize);
}
Size SfxTemplateDialog_Impl::GetMinOutputSizePixel()
{
- if (m_pFloat != NULL)
+ if (m_pFloat != nullptr)
{
- Size aSizeATL=m_pFloat->PixelToLogic(m_aActionTbL.CalcWindowSizePixel());
- Size aSizeATR=m_pFloat->PixelToLogic(m_aActionTbR.CalcWindowSizePixel());
+ Size aSizeATL=m_pFloat->PixelToLogic(m_aActionTbL->CalcWindowSizePixel());
+ Size aSizeATR=m_pFloat->PixelToLogic(m_aActionTbR->CalcWindowSizePixel());
Size aMinSize=Size(
aSizeATL.Width()+aSizeATR.Width()+
2*SFX_TEMPLDLG_HFRAME + SFX_TEMPLDLG_MIDHSPACE,
@@ -2388,7 +2401,7 @@ void SfxTemplateDialog_Impl::EnableItem(sal_uInt16 nMesId, bool bCheck)
//fall-through
case SID_STYLE_NEW_BY_EXAMPLE:
case SID_STYLE_UPDATE_BY_EXAMPLE:
- m_aActionTbR.EnableItem(nMesId,bCheck);
+ m_aActionTbR->EnableItem(nMesId,bCheck);
break;
}
}
@@ -2399,10 +2412,10 @@ void SfxTemplateDialog_Impl::CheckItem(sal_uInt16 nMesId, bool bCheck)
{
case SID_STYLE_WATERCAN :
bIsWater=bCheck;
- m_aActionTbR.CheckItem(SID_STYLE_WATERCAN,bCheck);
+ m_aActionTbR->CheckItem(SID_STYLE_WATERCAN,bCheck);
break;
default:
- m_aActionTbL.CheckItem(nMesId,bCheck); break;
+ m_aActionTbL->CheckItem(nMesId,bCheck); break;
}
}
@@ -2411,9 +2424,9 @@ bool SfxTemplateDialog_Impl::IsCheckedItem(sal_uInt16 nMesId)
switch(nMesId)
{
case SID_STYLE_WATERCAN :
- return m_aActionTbR.GetItemState(SID_STYLE_WATERCAN)==TRISTATE_TRUE;
+ return m_aActionTbR->GetItemState(SID_STYLE_WATERCAN)==TRISTATE_TRUE;
default:
- return m_aActionTbL.GetItemState(nMesId)==TRISTATE_TRUE;
+ return m_aActionTbL->GetItemState(nMesId)==TRISTATE_TRUE;
}
}
@@ -2542,7 +2555,7 @@ void SfxCommonTemplateDialog_Impl::UpdateFamily_Impl()
}
bWaterDisabled = false;
- bCanNew = pTreeBox || aFmtLb.GetSelectionCount() <= 1;
+ bCanNew = pTreeBox || aFmtLb->GetSelectionCount() <= 1;
bTreeDrag = true;
bUpdateByExampleDisabled = false;
@@ -2582,10 +2595,6 @@ DropToolBox_Impl::DropToolBox_Impl(vcl::Window* pParent, SfxTemplateDialog_Impl*
{
}
-DropToolBox_Impl::~DropToolBox_Impl()
-{
-}
-
sal_Int8 DropToolBox_Impl::AcceptDrop( const AcceptDropEvent& rEvt )
{
sal_Int8 nReturn = DND_ACTION_NONE;
@@ -2608,7 +2617,7 @@ sal_Int8 DropToolBox_Impl::AcceptDrop( const AcceptDropEvent& rEvt )
sal_Int8 DropToolBox_Impl::ExecuteDrop( const ExecuteDropEvent& rEvt )
{
- return rParent.aFmtLb.ExecuteDrop(rEvt);
+ return rParent.aFmtLb->ExecuteDrop(rEvt);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/dialog/titledockwin.cxx b/sfx2/source/dialog/titledockwin.cxx
index 66aa91b1f218..6b3c98945139 100644
--- a/sfx2/source/dialog/titledockwin.cxx
+++ b/sfx2/source/dialog/titledockwin.cxx
@@ -35,8 +35,8 @@ namespace sfx2
WinBits i_nStyle )
:SfxDockingWindow( i_pBindings, i_pChildWindow, i_pParent, i_nStyle )
,m_sTitle()
- ,m_aToolbox( this )
- ,m_aContentWindow( this, WB_DIALOGCONTROL )
+ ,m_aToolbox( VclPtr<ToolBox>::Create(this) )
+ ,m_aContentWindow( VclPtr<vcl::Window>::Create(this, WB_DIALOGCONTROL) )
,m_aBorder( 3, 1, 3, 3 )
,m_bLayoutPending( false )
,m_nTitleBarHeight(0)
@@ -48,19 +48,26 @@ namespace sfx2
{
SetBackground( Wallpaper() );
- m_aToolbox.SetSelectHdl( LINK( this, TitledDockingWindow, OnToolboxItemSelected ) );
- m_aToolbox.SetOutStyle( TOOLBOX_STYLE_FLAT );
- m_aToolbox.SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetDialogColor() ) );
- m_aToolbox.Show();
+ m_aToolbox->SetSelectHdl( LINK( this, TitledDockingWindow, OnToolboxItemSelected ) );
+ m_aToolbox->SetOutStyle( TOOLBOX_STYLE_FLAT );
+ m_aToolbox->SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetDialogColor() ) );
+ m_aToolbox->Show();
impl_resetToolBox();
- m_aContentWindow.Show();
+ m_aContentWindow->Show();
}
TitledDockingWindow::~TitledDockingWindow()
{
+ disposeOnce();
}
+ void TitledDockingWindow::dispose()
+ {
+ m_aToolbox.disposeAndClear();
+ m_aContentWindow.disposeAndClear();
+ SfxDockingWindow::dispose();
+ }
void TitledDockingWindow::SetTitle( const OUString& i_rTitle )
{
@@ -101,16 +108,16 @@ namespace sfx2
{
m_bLayoutPending = false;
- m_aToolbox.ShowItem( 1, !IsFloatingMode() );
+ m_aToolbox->ShowItem( 1, !IsFloatingMode() );
- const Size aToolBoxSize( m_aToolbox.CalcWindowSizePixel() );
+ const Size aToolBoxSize( m_aToolbox->CalcWindowSizePixel() );
Size aWindowSize( GetOutputSizePixel() );
// position the tool box
m_nTitleBarHeight = GetSettings().GetStyleSettings().GetTitleHeight();
if ( aToolBoxSize.Height() > m_nTitleBarHeight )
m_nTitleBarHeight = aToolBoxSize.Height();
- m_aToolbox.SetPosSizePixel(
+ m_aToolbox->SetPosSizePixel(
Point(
aWindowSize.Width() - aToolBoxSize.Width(),
( m_nTitleBarHeight - aToolBoxSize.Height() ) / 2
@@ -122,7 +129,7 @@ namespace sfx2
if ( m_nTitleBarHeight < aToolBoxSize.Height() )
m_nTitleBarHeight = aToolBoxSize.Height();
aWindowSize.Height() -= m_nTitleBarHeight;
- m_aContentWindow.SetPosSizePixel(
+ m_aContentWindow->SetPosSizePixel(
Point( m_aBorder.Left(), m_nTitleBarHeight + m_aBorder.Top() ),
Size(
aWindowSize.Width() - m_aBorder.Left() - m_aBorder.Right(),
@@ -209,24 +216,24 @@ namespace sfx2
void TitledDockingWindow::impl_resetToolBox()
{
- m_aToolbox.Clear();
+ m_aToolbox->Clear();
// Get the closer bitmap and set it as right most button.
Image aImage( SfxResId( SFX_IMG_CLOSE_DOC ) );
- m_aToolbox.InsertItem( 1, aImage );
- m_aToolbox.ShowItem( 1 );
+ m_aToolbox->InsertItem( 1, aImage );
+ m_aToolbox->ShowItem( 1 );
}
sal_uInt16 TitledDockingWindow::impl_addDropDownToolBoxItem( const OUString& i_rItemText, const OString& i_nHelpId, const Link& i_rCallback )
{
// Add the menu before the closer button.
- const sal_uInt16 nItemCount( m_aToolbox.GetItemCount() );
+ const sal_uInt16 nItemCount( m_aToolbox->GetItemCount() );
const sal_uInt16 nItemId( nItemCount + 1 );
- m_aToolbox.InsertItem( nItemId, i_rItemText, ToolBoxItemBits::DROPDOWNONLY, nItemCount > 0 ? nItemCount - 1 : TOOLBOX_APPEND );
- m_aToolbox.SetHelpId( nItemId, i_nHelpId );
- m_aToolbox.SetClickHdl( i_rCallback );
- m_aToolbox.SetDropdownClickHdl( i_rCallback );
+ m_aToolbox->InsertItem( nItemId, i_rItemText, ToolBoxItemBits::DROPDOWNONLY, nItemCount > 0 ? nItemCount - 1 : TOOLBOX_APPEND );
+ m_aToolbox->SetHelpId( nItemId, i_nHelpId );
+ m_aToolbox->SetClickHdl( i_rCallback );
+ m_aToolbox->SetDropdownClickHdl( i_rCallback );
// The tool box has likely changed its size. The title bar has to be
// resized.
diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx
index 8da102ca1355..687a6cdd298e 100644
--- a/sfx2/source/dialog/versdlg.cxx
+++ b/sfx2/source/dialog/versdlg.cxx
@@ -213,7 +213,7 @@ SfxVersionDialog::SfxVersionDialog ( SfxViewFrame* pVwFrame, bool bIsSaveVersion
pContainer->set_width_request(aControlSize.Width());
pContainer->set_height_request(aControlSize.Height());
- m_pVersionBox = new SfxVersionsTabListBox_Impl(*pContainer, WB_TABSTOP);
+ m_pVersionBox = VclPtr<SfxVersionsTabListBox_Impl>::Create(*pContainer, WB_TABSTOP);
Link aClickLink = LINK( this, SfxVersionDialog, ButtonHdl_Impl );
m_pViewButton->SetClickHdl ( aClickLink );
@@ -329,8 +329,21 @@ void SfxVersionDialog::Init_Impl()
SfxVersionDialog::~SfxVersionDialog()
{
+ disposeOnce();
+}
+
+void SfxVersionDialog::dispose()
+{
delete m_pTable;
- delete m_pVersionBox;
+ m_pVersionBox.disposeAndClear();
+ m_pSaveButton.clear();
+ m_pSaveCheckBox.clear();
+ m_pOpenButton.clear();
+ m_pViewButton.clear();
+ m_pDeleteButton.clear();
+ m_pCompareButton.clear();
+ m_pCmisButton.clear();
+ SfxModalDialog::dispose();
}
void SfxVersionDialog::Open_Impl()
@@ -394,7 +407,7 @@ IMPL_LINK( SfxVersionDialog, ButtonHdl_Impl, Button*, pButton )
{
SfxVersionInfo aInfo;
aInfo.aAuthor = SvtUserOptions().GetFullName();
- boost::scoped_ptr<SfxViewVersionDialog_Impl> pDlg(new SfxViewVersionDialog_Impl(this, aInfo, true));
+ VclPtrInstance< SfxViewVersionDialog_Impl > pDlg(this, aInfo, true);
short nRet = pDlg->Execute();
if ( nRet == RET_OK )
{
@@ -426,7 +439,7 @@ IMPL_LINK( SfxVersionDialog, ButtonHdl_Impl, Button*, pButton )
else if (pButton == m_pViewButton && pEntry)
{
SfxVersionInfo* pInfo = static_cast<SfxVersionInfo*>(pEntry->GetUserData());
- boost::scoped_ptr<SfxViewVersionDialog_Impl> pDlg(new SfxViewVersionDialog_Impl(this, *pInfo, false));
+ VclPtrInstance<SfxViewVersionDialog_Impl> pDlg(this, *pInfo, false);
pDlg->Execute();
}
else if (pEntry && pButton == m_pCompareButton)
@@ -449,7 +462,7 @@ IMPL_LINK( SfxVersionDialog, ButtonHdl_Impl, Button*, pButton )
}
else if (pButton == m_pCmisButton)
{
- boost::scoped_ptr<SfxCmisVersionsDialog> pDlg(new SfxCmisVersionsDialog(pViewFrame, false));
+ VclPtrInstance< SfxCmisVersionsDialog > pDlg(pViewFrame, false);
pDlg->Execute();
}
@@ -493,6 +506,22 @@ SfxViewVersionDialog_Impl::SfxViewVersionDialog_Impl(vcl::Window *pParent, SfxVe
}
}
+SfxViewVersionDialog_Impl::~SfxViewVersionDialog_Impl()
+{
+ disposeOnce();
+}
+
+void SfxViewVersionDialog_Impl::dispose()
+{
+ m_pDateTimeText.clear();
+ m_pSavedByText.clear();
+ m_pEdit.clear();
+ m_pOKButton.clear();
+ m_pCancelButton.clear();
+ m_pCloseButton.clear();
+ SfxModalDialog::dispose();
+}
+
IMPL_LINK(SfxViewVersionDialog_Impl, ButtonHdl, Button*, pButton)
{
assert(pButton == m_pOKButton);
@@ -519,7 +548,7 @@ SfxCmisVersionsDialog::SfxCmisVersionsDialog ( SfxViewFrame* pVwFrame, bool bIsS
pContainer->set_width_request(aControlSize.Width());
pContainer->set_height_request(aControlSize.Height());
- m_pVersionBox = new SfxVersionsTabListBox_Impl(*pContainer, WB_TABSTOP);
+ m_pVersionBox = VclPtr<SfxVersionsTabListBox_Impl>::Create(*pContainer, WB_TABSTOP);
m_pVersionBox->GrabFocus();
m_pVersionBox->SetStyle( m_pVersionBox->GetStyle() | WB_HSCROLL | WB_CLIPCHILDREN );
@@ -557,8 +586,18 @@ SfxCmisVersionsDialog::SfxCmisVersionsDialog ( SfxViewFrame* pVwFrame, bool bIsS
SfxCmisVersionsDialog::~SfxCmisVersionsDialog()
{
+ disposeOnce();
+}
+
+void SfxCmisVersionsDialog::dispose()
+{
delete m_pTable;
- delete m_pVersionBox;
+ m_pVersionBox.disposeAndClear();
+ m_pOpenButton.clear();
+ m_pViewButton.clear();
+ m_pDeleteButton.clear();
+ m_pCompareButton.clear();
+ SfxModalDialog::dispose();
}
void SfxCmisVersionsDialog::LoadVersions()
diff --git a/sfx2/source/doc/QuerySaveDocument.cxx b/sfx2/source/doc/QuerySaveDocument.cxx
index 63d458f1c955..a6f5ec97b73f 100644
--- a/sfx2/source/doc/QuerySaveDocument.cxx
+++ b/sfx2/source/doc/QuerySaveDocument.cxx
@@ -29,9 +29,9 @@ short ExecuteQuerySaveDocument(vcl::Window* _pParent, const OUString& _rTitle)
return RET_NO;
}
- MessageDialog aQBox(_pParent, "QuerySaveDialog", "sfx/ui/querysavedialog.ui");
- aQBox.set_primary_text(aQBox.get_primary_text().replaceFirst("$(DOC)", _rTitle));
- return aQBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aQBox(_pParent, "QuerySaveDialog", "sfx/ui/querysavedialog.ui");
+ aQBox->set_primary_text(aQBox->get_primary_text().replaceFirst("$(DOC)", _rTitle));
+ return aQBox->Execute();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/docinsert.cxx b/sfx2/source/doc/docinsert.cxx
index d114453f1ce3..bd3ba50f01e3 100644
--- a/sfx2/source/doc/docinsert.cxx
+++ b/sfx2/source/doc/docinsert.cxx
@@ -190,12 +190,12 @@ IMPL_LINK_NOARG(DocumentInserter, DialogClosedHdl)
if ( ( aValue >>= bPassWord ) && bPassWord )
{
// ask for the password
- SfxPasswordDialog aPasswordDlg( NULL );
- aPasswordDlg.ShowExtras( SfxShowExtras::CONFIRM );
- short nRet = aPasswordDlg.Execute();
+ ScopedVclPtrInstance< SfxPasswordDialog > aPasswordDlg(nullptr);
+ aPasswordDlg->ShowExtras( SfxShowExtras::CONFIRM );
+ short nRet = aPasswordDlg->Execute();
if ( RET_OK == nRet )
{
- OUString aPasswd = aPasswordDlg.GetPassword();
+ OUString aPasswd = aPasswordDlg->GetPassword();
m_pItemSet->Put( SfxStringItem( SID_PASSWORD, aPasswd ) );
}
else
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index b33e4f865f4d..a4d4ef71da69 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -138,7 +138,8 @@ class WaitWindow_Impl : public WorkWindow
public:
WaitWindow_Impl();
- virtual ~WaitWindow_Impl();
+ virtual ~WaitWindow_Impl();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Paint( const Rectangle& rRect ) SAL_OVERRIDE;
};
@@ -470,8 +471,7 @@ void SfxDocTplService_Impl::init_Impl()
aGuard.clear();
SolarMutexClearableGuard aSolarGuard;
- WaitWindow_Impl* pWin = new WaitWindow_Impl();
-
+ VclPtrInstance< WaitWindow_Impl > pWin;
aSolarGuard.clear();
::osl::ClearableMutexGuard anotherGuard( maMutex );
@@ -480,7 +480,7 @@ void SfxDocTplService_Impl::init_Impl()
anotherGuard.clear();
SolarMutexGuard aSecondSolarGuard;
- delete pWin;
+ pWin.disposeAndClear();
}
else if ( needsUpdate() )
// the UI should be shown only on the first update
@@ -2449,7 +2449,13 @@ WaitWindow_Impl::WaitWindow_Impl()
WaitWindow_Impl::~WaitWindow_Impl()
{
+ disposeOnce();
+}
+
+void WaitWindow_Impl::dispose()
+{
Hide();
+ WorkWindow::dispose();
}
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 9610a8bd222b..a3aef2d2a21a 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -667,9 +667,9 @@ sal_Int8 ModelData_Impl::CheckSaveAcceptable( sal_Int8 nCurStatus )
{
// notify the user that SaveAs is going to be done
vcl::Window* pWin = SfxStoringHelper::GetModelWindow( m_xModel );
- MessageDialog aMessageBox(pWin, SfxResId(STR_NEW_FILENAME_SAVE),
+ ScopedVclPtrInstance<MessageDialog> aMessageBox(pWin, SfxResId(STR_NEW_FILENAME_SAVE),
VCL_MESSAGE_QUESTION, VCL_BUTTONS_OK_CANCEL);
- if ( aMessageBox.Execute() == RET_OK )
+ if ( aMessageBox->Execute() == RET_OK )
nResult = STATUS_SAVEAS;
else
nResult = STATUS_NO_ACTION;
@@ -1882,9 +1882,9 @@ bool SfxStoringHelper::WarnUnacceptableFormat( const uno::Reference< frame::XMod
return true;
vcl::Window* pWin = SfxStoringHelper::GetModelWindow( xModel );
- SfxAlienWarningDialog aDlg( pWin, aOldUIName, aDefExtension, bDefIsAlien );
+ ScopedVclPtrInstance< SfxAlienWarningDialog > aDlg( pWin, aOldUIName, aDefExtension, bDefIsAlien );
- return aDlg.Execute() == RET_OK;
+ return aDlg->Execute() == RET_OK;
}
vcl::Window* SfxStoringHelper::GetModelWindow( const uno::Reference< frame::XModel >& xModel )
diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx
index a3dc009a9e38..0564141cb174 100644
--- a/sfx2/source/doc/iframe.cxx
+++ b/sfx2/source/doc/iframe.cxx
@@ -174,7 +174,7 @@ throw( uno::RuntimeException, std::exception )
{
DBG_ASSERT( !mxFrame.is(), "Frame already existing!" );
vcl::Window* pParent = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() );
- IFrameWindow_Impl* pWin = new IFrameWindow_Impl( pParent, maFrmDescr.IsFrameBorderOn() );
+ VclPtr<IFrameWindow_Impl> pWin = VclPtr<IFrameWindow_Impl>::Create( pParent, maFrmDescr.IsFrameBorderOn() );
pWin->SetSizePixel( pParent->GetOutputSizePixel() );
pWin->SetBackground();
pWin->Show();
diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx
index e62676bca661..1d4f8e6fa858 100644
--- a/sfx2/source/doc/new.cxx
+++ b/sfx2/source/doc/new.cxx
@@ -123,19 +123,19 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSfxPreviewWin(vcl::Win
class SfxNewFileDialog_Impl
{
- ListBox* m_pRegionLb;
- ListBox* m_pTemplateLb;
+ VclPtr<ListBox> m_pRegionLb;
+ VclPtr<ListBox> m_pTemplateLb;
- SfxPreviewWin_Impl* m_pPreviewWin;
+ VclPtr<SfxPreviewWin_Impl> m_pPreviewWin;
- CheckBox* m_pTextStyleCB;
- CheckBox* m_pFrameStyleCB;
- CheckBox* m_pPageStyleCB;
- CheckBox* m_pNumStyleCB;
- CheckBox* m_pMergeStyleCB;
- PushButton* m_pLoadFilePB;
+ VclPtr<CheckBox> m_pTextStyleCB;
+ VclPtr<CheckBox> m_pFrameStyleCB;
+ VclPtr<CheckBox> m_pPageStyleCB;
+ VclPtr<CheckBox> m_pNumStyleCB;
+ VclPtr<CheckBox> m_pMergeStyleCB;
+ VclPtr<PushButton> m_pLoadFilePB;
- VclExpander* m_pMoreBt;
+ VclPtr<VclExpander> m_pMoreBt;
Idle aPrevIdle;
OUString aNone;
OUString sLoadTemplate;
@@ -143,7 +143,7 @@ class SfxNewFileDialog_Impl
sal_uInt16 nFlags;
SfxDocumentTemplates aTemplates;
SfxObjectShellLock xDocShell;
- SfxNewFileDialog* pAntiImpl;
+ VclPtr<SfxNewFileDialog> pAntiImpl;
DECL_LINK( Update, void * );
@@ -454,7 +454,13 @@ SfxNewFileDialog::SfxNewFileDialog(vcl::Window *pParent, sal_uInt16 nFlags)
SfxNewFileDialog::~SfxNewFileDialog()
{
+ disposeOnce();
+}
+
+void SfxNewFileDialog::dispose()
+{
delete pImpl;
+ SfxModalDialog::dispose();
}
bool SfxNewFileDialog::IsTemplate() const
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index d2b4d3c8aacd..faf46aa367bd 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -131,11 +131,11 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( bool bFullContent ) const
std::shared_ptr<GDIMetaFile> xFile(new GDIMetaFile);
- VirtualDevice aDevice;
- aDevice.EnableOutput( false );
+ ScopedVclPtrInstance< VirtualDevice > pDevice;
+ pDevice->EnableOutput( false );
MapMode aMode( this->GetMapUnit() );
- aDevice.SetMapMode( aMode );
+ pDevice->SetMapMode( aMode );
xFile->SetPrefMapMode( aMode );
Size aTmpSize;
@@ -155,7 +155,7 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( bool bFullContent ) const
DBG_ASSERT( aTmpSize.Height()*aTmpSize.Width(),
"size of first page is 0, override GetFirstPageSize or set vis-area!" );
- xFile->Record( &aDevice );
+ xFile->Record( pDevice );
LanguageType eLang;
SvtCTLOptions aCTLOptions;
@@ -166,9 +166,9 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( bool bFullContent ) const
else
eLang = (LanguageType) Application::GetSettings().GetLanguageTag().getLanguageType();
- aDevice.SetDigitLanguage( eLang );
+ pDevice->SetDigitLanguage( eLang );
- const_cast<SfxObjectShell*>(this)->DoDraw( &aDevice, Point(0,0), aTmpSize, JobSetup(), nAspect );
+ const_cast<SfxObjectShell*>(this)->DoDraw( pDevice, Point(0,0), aTmpSize, JobSetup(), nAspect );
xFile->Stop();
@@ -286,13 +286,13 @@ void SfxObjectShell::UpdateTime_Impl(
-SfxDocumentInfoDialog* SfxObjectShell::CreateDocumentInfoDialog
+VclPtr<SfxDocumentInfoDialog> SfxObjectShell::CreateDocumentInfoDialog
(
vcl::Window* pParent,
const SfxItemSet& rSet
)
{
- return new SfxDocumentInfoDialog(pParent, rSet);
+ return VclPtr<SfxDocumentInfoDialog>::Create(pParent, rSet);
}
@@ -471,8 +471,8 @@ void SfxObjectShell::UpdateFromTemplate_Impl( )
{
OUString sMessage( SfxResId(STR_QRYTEMPL_MESSAGE).toString() );
sMessage = sMessage.replaceAll( "$(ARG1)", aTemplName );
- sfx2::QueryTemplateBox aBox( GetDialogParent(), sMessage );
- if ( RET_YES == aBox.Execute() )
+ ScopedVclPtrInstance< sfx2::QueryTemplateBox > aBox(GetDialogParent(), sMessage);
+ if ( RET_YES == aBox->Execute() )
bLoad = true;
}
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 8f10da507570..3711c68b7130 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -335,7 +335,7 @@ void SfxObjectShell::CheckOut( )
}
catch ( const uno::RuntimeException& e )
{
- boost::scoped_ptr<MessageDialog> pErrorBox(new MessageDialog( &GetFrame()->GetWindow(), e.Message ));
+ ScopedVclPtrInstance< MessageDialog > pErrorBox( &GetFrame()->GetWindow(), e.Message );
pErrorBox->Execute( );
}
}
@@ -353,7 +353,7 @@ void SfxObjectShell::CancelCheckOut( )
}
catch ( const uno::RuntimeException& e )
{
- boost::scoped_ptr<MessageDialog> pErrorBox(new MessageDialog(&GetFrame()->GetWindow(), e.Message));
+ ScopedVclPtrInstance< MessageDialog > pErrorBox(&GetFrame()->GetWindow(), e.Message);
pErrorBox->Execute( );
}
}
@@ -364,11 +364,11 @@ void SfxObjectShell::CheckIn( )
{
uno::Reference< document::XCmisDocument > xCmisDoc( GetModel(), uno::UNO_QUERY_THROW );
// Pop up dialog to ask for comment and major
- SfxCheckinDialog checkinDlg( &GetFrame( )->GetWindow( ) );
- if ( checkinDlg.Execute( ) == RET_OK )
+ ScopedVclPtrInstance< SfxCheckinDialog > checkinDlg(&GetFrame( )->GetWindow( ));
+ if ( checkinDlg->Execute( ) == RET_OK )
{
- OUString sComment = checkinDlg.GetComment( );
- bool bMajor = checkinDlg.IsMajor( );
+ OUString sComment = checkinDlg->GetComment( );
+ bool bMajor = checkinDlg->IsMajor( );
xCmisDoc->checkIn( bMajor, sComment );
uno::Reference< util::XModifiable > xModifiable( GetModel( ), uno::UNO_QUERY );
if ( xModifiable.is( ) )
@@ -377,7 +377,7 @@ void SfxObjectShell::CheckIn( )
}
catch ( const uno::RuntimeException& e )
{
- boost::scoped_ptr<MessageDialog> pErrorBox(new MessageDialog(&GetFrame()->GetWindow(), e.Message));
+ ScopedVclPtrInstance< MessageDialog > pErrorBox(&GetFrame()->GetWindow(), e.Message);
pErrorBox->Execute( );
}
}
@@ -391,7 +391,7 @@ uno::Sequence< document::CmisVersion > SfxObjectShell::GetCmisVersions( )
}
catch ( const uno::RuntimeException& e )
{
- boost::scoped_ptr<MessageDialog> pErrorBox(new MessageDialog(&GetFrame()->GetWindow(), e.Message));
+ ScopedVclPtrInstance< MessageDialog > pErrorBox(&GetFrame()->GetWindow(), e.Message);
pErrorBox->Execute( );
}
return uno::Sequence< document::CmisVersion > ( );
@@ -439,7 +439,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
if ( !IsOwnStorageFormat_Impl( *GetMedium() ) )
return;
- boost::scoped_ptr<SfxVersionDialog> pDlg(new SfxVersionDialog( pFrame, IsSaveVersionOnClose() ));
+ ScopedVclPtrInstance< SfxVersionDialog > pDlg( pFrame, IsSaveVersionOnClose() );
pDlg->Execute();
SetSaveVersionOnClose( pDlg->IsSaveVersionOnClose() );
rReq.Done();
@@ -499,7 +499,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
// creating dialog is done via virtual method; application will
// add its own statistics page
- boost::scoped_ptr<SfxDocumentInfoDialog> pDlg(CreateDocumentInfoDialog(0, aSet));
+ ScopedVclPtr<SfxDocumentInfoDialog> pDlg(CreateDocumentInfoDialog(0, aSet));
if ( RET_OK == pDlg->Execute() )
{
SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pDocInfoItem, SfxDocumentInfoItem, SID_DOCINFO, false);
@@ -857,10 +857,10 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
case SID_DOCTEMPLATE:
{
// save as document templates
- SfxTemplateManagerDlg aDlg;
- aDlg.setDocumentModel(GetModel());
- aDlg.setSaveMode();
- aDlg.Execute();
+ ScopedVclPtrInstance< SfxTemplateManagerDlg > aDlg;
+ aDlg->setDocumentModel(GetModel());
+ aDlg->setSaveMode();
+ aDlg->Execute();
break;
}
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index c609495d1462..d181c628cf5d 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -3019,8 +3019,8 @@ sal_Int16 SfxObjectShell::QueryHiddenInformation( HiddenWarningFact eFact, vcl::
{
sMessage += "\n";
sMessage += SfxResId(nResId).toString();
- WarningBox aWBox( pParent, WB_YES_NO | WB_DEF_NO, sMessage );
- nRet = aWBox.Execute();
+ ScopedVclPtrInstance< WarningBox > aWBox(pParent, WB_YES_NO | WB_DEF_NO, sMessage);
+ nRet = aWBox->Execute();
}
}
diff --git a/sfx2/source/doc/plugin.cxx b/sfx2/source/doc/plugin.cxx
index ca30f4563093..7c5d7157607a 100644
--- a/sfx2/source/doc/plugin.cxx
+++ b/sfx2/source/doc/plugin.cxx
@@ -152,7 +152,7 @@ throw( uno::RuntimeException, std::exception )
if ( SvtMiscOptions().IsPluginsEnabled() )
{
vcl::Window* pParent = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() );
- PluginWindow_Impl* pWin = new PluginWindow_Impl( pParent );
+ VclPtr<PluginWindow_Impl> pWin = VclPtr<PluginWindow_Impl>::Create( pParent );
pWin->SetSizePixel( pParent->GetOutputSizePixel() );
pWin->SetBackground();
pWin->Show();
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx
index 1d056eb69900..452f41435a54 100644
--- a/sfx2/source/doc/printhelper.cxx
+++ b/sfx2/source/doc/printhelper.cxx
@@ -346,7 +346,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue >
if ( aPrinterName != pPrinter->GetName() )
{
- pPrinter = new SfxPrinter( pPrinter->GetOptions().Clone(), aPrinterName );
+ pPrinter = VclPtr<SfxPrinter>::Create( pPrinter->GetOptions().Clone(), aPrinterName );
nChangeFlags = SfxPrinterChangeFlags::PRINTER;
}
break;
@@ -477,7 +477,7 @@ class ImplUCBPrintWatcher : public ::osl::Thread
{
private:
/// of course we must know the printer which execute the job
- SfxPrinter* m_pPrinter;
+ VclPtr<SfxPrinter> m_pPrinter;
/// this describes the target location for the printed temp file
OUString m_sTargetURL;
/// it holds the temp file alive, till the print job will finish and remove it from disk automatically if the object die
@@ -504,7 +504,7 @@ class ImplUCBPrintWatcher : public ::osl::Thread
SolarMutexGuard aGuard;
while( m_pPrinter->IsPrinting() )
Application::Yield();
- m_pPrinter = NULL; // don't delete it! It's borrowed only :-)
+ m_pPrinter.clear(); // don't delete it! It's borrowed only :-)
}
/* } SAFE */
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index fee3db0670df..3997e4f5f0e9 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -296,7 +296,12 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg(vcl::Window *parent)
mpLocalView->Show();
}
-SfxTemplateManagerDlg::~SfxTemplateManagerDlg ()
+SfxTemplateManagerDlg::~SfxTemplateManagerDlg()
+{
+ disposeOnce();
+}
+
+void SfxTemplateManagerDlg::dispose()
{
writeSettings();
@@ -316,6 +321,17 @@ SfxTemplateManagerDlg::~SfxTemplateManagerDlg ()
mpSearchView->setItemStateHdl(Link());
mpSearchView->setOpenTemplateHdl(Link());
+
+ mpTabControl.clear();
+ mpSearchEdit.clear();
+ mpViewBar.clear();
+ mpActionBar.clear();
+ mpTemplateBar.clear();
+ mpSearchView.clear();
+ mpCurView.clear();
+ mpLocalView.clear();
+ mpRemoteView.clear();
+ ModalDialog::dispose();
}
void SfxTemplateManagerDlg::setSaveMode()
@@ -608,11 +624,11 @@ IMPL_LINK(SfxTemplateManagerDlg, RepositoryMenuSelectHdl, Menu*, pMenu)
}
else if (nMenuId == MNI_REPOSITORY_NEW)
{
- PlaceEditDialog dlg(this);
+ ScopedVclPtrInstance< PlaceEditDialog > dlg(this);
- if (dlg.Execute())
+ if (dlg->Execute())
{
- std::shared_ptr<Place> xPlace = dlg.GetPlace();
+ std::shared_ptr<Place> xPlace = dlg->GetPlace();
if (insertRepository(xPlace->GetName(), xPlace->GetUrl()))
{
@@ -623,7 +639,7 @@ IMPL_LINK(SfxTemplateManagerDlg, RepositoryMenuSelectHdl, Menu*, pMenu)
{
OUString aMsg(SfxResId(STR_MSG_ERROR_REPOSITORY_NAME).toString());
aMsg = aMsg.replaceFirst("$1", xPlace->GetName());
- MessageDialog(this, aMsg).Execute();
+ ScopedVclPtrInstance<MessageDialog>(this, aMsg)->Execute();
}
}
}
@@ -1152,16 +1168,16 @@ void SfxTemplateManagerDlg::OnTemplateProperties ()
{
const TemplateViewItem *pItem = static_cast<const TemplateViewItem*>(*maSelTemplates.begin());
- SfxTemplateInfoDlg aDlg;
- aDlg.loadDocument(pItem->getPath());
- aDlg.Execute();
+ ScopedVclPtrInstance< SfxTemplateInfoDlg > aDlg;
+ aDlg->loadDocument(pItem->getPath());
+ aDlg->Execute();
}
void SfxTemplateManagerDlg::OnTemplateDelete ()
{
- MessageDialog aQueryDlg(this, SfxResId(STR_QMSG_SEL_TEMPLATE_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ ScopedVclPtrInstance< MessageDialog > aQueryDlg(this, SfxResId(STR_QMSG_SEL_TEMPLATE_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
- if ( aQueryDlg.Execute() != RET_YES )
+ if ( aQueryDlg->Execute() != RET_YES )
return;
OUString aTemplateList;
@@ -1230,13 +1246,13 @@ void SfxTemplateManagerDlg::OnTemplateAsDefault ()
void SfxTemplateManagerDlg::OnFolderNew()
{
- InputDialog dlg(SfxResId(STR_INPUT_NEW).toString(),this);
+ ScopedVclPtrInstance< InputDialog > dlg(SfxResId(STR_INPUT_NEW).toString(),this);
- int ret = dlg.Execute();
+ int ret = dlg->Execute();
if (ret)
{
- OUString aName = dlg.getEntryText();
+ OUString aName = dlg->getEntryText();
mpCurView->createRegion(aName);
}
@@ -1244,9 +1260,9 @@ void SfxTemplateManagerDlg::OnFolderNew()
void SfxTemplateManagerDlg::OnFolderDelete()
{
- MessageDialog aQueryDlg(this, SfxResId(STR_QMSG_SEL_FOLDER_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ ScopedVclPtrInstance< MessageDialog > aQueryDlg(this, SfxResId(STR_QMSG_SEL_FOLDER_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
- if ( aQueryDlg.Execute() != RET_YES )
+ if ( aQueryDlg->Execute() != RET_YES )
return;
OUString aFolderList;
@@ -1297,17 +1313,17 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs()
return;
}
- InputDialog aDlg(SfxResId(STR_INPUT_TEMPLATE_NEW).toString(),this);
+ ScopedVclPtrInstance< InputDialog > aDlg(SfxResId(STR_INPUT_TEMPLATE_NEW).toString(),this);
- if (aDlg.Execute())
+ if (aDlg->Execute())
{
- OUString aName = aDlg.getEntryText();
+ OUString aName = aDlg->getEntryText();
if (!aName.isEmpty())
{
OUString aFolderList;
OUString aQMsg(SfxResId(STR_QMSG_TEMPLATE_OVERWRITE).toString());
- MessageDialog aQueryDlg(this, OUString(), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ ScopedVclPtrInstance< MessageDialog > aQueryDlg(this, OUString(), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
if (mpLocalView->isNonRootRegionVisible())
{
@@ -1316,9 +1332,9 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs()
if (!mpLocalView->isTemplateNameUnique(nRegionItemId,aName))
{
aQMsg = aQMsg.replaceFirst("$1",aName);
- aQueryDlg.set_primary_text(aQMsg.replaceFirst("$2",mpLocalView->getCurRegionName()));
+ aQueryDlg->set_primary_text(aQMsg.replaceFirst("$2",mpLocalView->getCurRegionName()));
- if (aQueryDlg.Execute() == RET_NO)
+ if (aQueryDlg->Execute() == RET_NO)
return;
}
@@ -1335,9 +1351,9 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs()
if (!mpLocalView->isTemplateNameUnique(pItem->mnId,aName))
{
OUString aDQMsg = aQMsg.replaceFirst("$1",aName);
- aQueryDlg.set_primary_text(aDQMsg.replaceFirst("$2",pItem->maTitle));
+ aQueryDlg->set_primary_text(aDQMsg.replaceFirst("$2",pItem->maTitle));
- if (aQueryDlg.Execute() == RET_NO)
+ if (aQueryDlg->Execute() == RET_NO)
continue;
}
@@ -1403,7 +1419,7 @@ void SfxTemplateManagerDlg::switchMainView(bool bDisplayLocal)
{
if (bDisplayLocal)
{
- mpCurView = mpLocalView;
+ mpCurView = mpLocalView.get();
mpViewBar->HideItem(VIEWBAR_DELETE);
@@ -1416,7 +1432,7 @@ void SfxTemplateManagerDlg::switchMainView(bool bDisplayLocal)
}
else
{
- mpCurView = mpRemoteView;
+ mpCurView = mpRemoteView.get();
mpViewBar->ShowItem(VIEWBAR_DELETE);
@@ -1435,13 +1451,13 @@ void SfxTemplateManagerDlg::localMoveTo(sal_uInt16 nMenuId)
if (nMenuId == MNI_MOVE_NEW)
{
- InputDialog dlg(SfxResId(STR_INPUT_NEW).toString(),this);
+ ScopedVclPtrInstance< InputDialog > dlg(SfxResId(STR_INPUT_NEW).toString(),this);
- int ret = dlg.Execute();
+ int ret = dlg->Execute();
if (ret)
{
- OUString aName = dlg.getEntryText();
+ OUString aName = dlg->getEntryText();
if (!aName.isEmpty())
nItemId = mpLocalView->createRegion(aName);
@@ -1483,13 +1499,13 @@ void SfxTemplateManagerDlg::remoteMoveTo(const sal_uInt16 nMenuId)
if (nMenuId == MNI_MOVE_NEW)
{
- InputDialog dlg(SfxResId(STR_INPUT_NEW).toString(),this);
+ ScopedVclPtrInstance< InputDialog > dlg(SfxResId(STR_INPUT_NEW).toString(),this);
- int ret = dlg.Execute();
+ int ret = dlg->Execute();
if (ret)
{
- OUString aName = dlg.getEntryText();
+ OUString aName = dlg->getEntryText();
if (!aName.isEmpty())
nItemId = mpLocalView->createRegion(aName);
@@ -1537,13 +1553,13 @@ void SfxTemplateManagerDlg::localSearchMoveTo(sal_uInt16 nMenuId)
if (nMenuId == MNI_MOVE_NEW)
{
- InputDialog dlg(SfxResId(STR_INPUT_NEW).toString(),this);
+ ScopedVclPtrInstance< InputDialog > dlg(SfxResId(STR_INPUT_NEW).toString(),this);
- int ret = dlg.Execute();
+ int ret = dlg->Execute();
if (ret)
{
- OUString aName = dlg.getEntryText();
+ OUString aName = dlg->getEntryText();
if (!aName.isEmpty())
nItemId = mpLocalView->createRegion(aName);
diff --git a/sfx2/source/inc/alienwarn.hxx b/sfx2/source/inc/alienwarn.hxx
index 7e812d263a1b..82884a76ccdf 100644
--- a/sfx2/source/inc/alienwarn.hxx
+++ b/sfx2/source/inc/alienwarn.hxx
@@ -25,14 +25,15 @@
class SfxAlienWarningDialog : public MessageDialog
{
private:
- PushButton* m_pKeepCurrentBtn;
- PushButton* m_pUseDefaultFormatBtn;
- CheckBox* m_pWarningOnBox;
+ VclPtr<PushButton> m_pKeepCurrentBtn;
+ VclPtr<PushButton> m_pUseDefaultFormatBtn;
+ VclPtr<CheckBox> m_pWarningOnBox;
public:
SfxAlienWarningDialog(vcl::Window* pParent, const OUString& _rFormatName,
const OUString& _rDefaultExtension, bool rDefaultIsAlien);
virtual ~SfxAlienWarningDialog();
+ virtual void dispose() SAL_OVERRIDE;
};
#endif // INCLUDED_SFX2_SOURCE_INC_ALIENWARN_HXX
diff --git a/sfx2/source/inc/documentfontsdialog.hxx b/sfx2/source/inc/documentfontsdialog.hxx
index 360f88713010..1ac6c6ebcbe5 100644
--- a/sfx2/source/inc/documentfontsdialog.hxx
+++ b/sfx2/source/inc/documentfontsdialog.hxx
@@ -31,12 +31,14 @@ class SfxDocumentFontsPage: public SfxTabPage
{
public:
SfxDocumentFontsPage( vcl::Window* parent, const SfxItemSet& set );
- static SfxTabPage* Create( vcl::Window* parent, const SfxItemSet* set );
+ virtual ~SfxDocumentFontsPage();
+ virtual void dispose() SAL_OVERRIDE;
+ static VclPtr<SfxTabPage> Create( vcl::Window* parent, const SfxItemSet* set );
protected:
virtual bool FillItemSet( SfxItemSet* set ) SAL_OVERRIDE;
virtual void Reset( const SfxItemSet* set ) SAL_OVERRIDE;
private:
- CheckBox* embedFontsCheckbox;
+ VclPtr<CheckBox> embedFontsCheckbox;
};
#endif
diff --git a/sfx2/source/inc/inputdlg.hxx b/sfx2/source/inc/inputdlg.hxx
index 29b5c45b9453..41888d44d3c9 100644
--- a/sfx2/source/inc/inputdlg.hxx
+++ b/sfx2/source/inc/inputdlg.hxx
@@ -21,6 +21,8 @@ class InputDialog : public ModalDialog
public:
InputDialog (const OUString &labelText, vcl::Window *pParent = NULL);
OUString getEntryText () const;
+ virtual ~InputDialog();
+ virtual void dispose() SAL_OVERRIDE;
private:
@@ -28,10 +30,10 @@ private:
private:
- Edit *m_pEntry;
- FixedText *m_pLabel;
- PushButton *m_pOK;
- PushButton *m_pCancel;
+ VclPtr<Edit> m_pEntry;
+ VclPtr<FixedText> m_pLabel;
+ VclPtr<PushButton> m_pOK;
+ VclPtr<PushButton> m_pCancel;
};
#endif // INCLUDED_SFX2_SOURCE_INC_INPUTDLG_HXX
diff --git a/sfx2/source/inc/partwnd.hxx b/sfx2/source/inc/partwnd.hxx
index a065593d168d..b81a88fd084c 100644
--- a/sfx2/source/inc/partwnd.hxx
+++ b/sfx2/source/inc/partwnd.hxx
@@ -69,7 +69,6 @@ public:
vcl::Window* pParent,
WinBits nBits );
- virtual ~SfxPartDockWnd_Impl();
bool QueryClose();
virtual void FillInfo(SfxChildWinInfo&) const SAL_OVERRIDE;
::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame > ForgetFrame();
diff --git a/sfx2/source/inc/recfloat.hxx b/sfx2/source/inc/recfloat.hxx
index 06fc314a2795..50dd7f6dc9fd 100644
--- a/sfx2/source/inc/recfloat.hxx
+++ b/sfx2/source/inc/recfloat.hxx
@@ -39,13 +39,14 @@ public:
class SfxRecordingFloat_Impl : public SfxFloatingWindow
{
- ToolBox* m_pTbx;
+ VclPtr<ToolBox> m_pTbx;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XToolbarController > xStopRecTbxCtrl;
public:
SfxRecordingFloat_Impl( SfxBindings* pBindings ,
SfxChildWindow* pChildWin ,
vcl::Window* pParent );
virtual ~SfxRecordingFloat_Impl();
+ virtual void dispose() SAL_OVERRIDE;
virtual bool Close() SAL_OVERRIDE;
virtual void FillInfo( SfxChildWinInfo& rInfo ) const SAL_OVERRIDE;
virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
diff --git a/sfx2/source/inc/splitwin.hxx b/sfx2/source/inc/splitwin.hxx
index 1a332e8e5e58..177bd769c70c 100644
--- a/sfx2/source/inc/splitwin.hxx
+++ b/sfx2/source/inc/splitwin.hxx
@@ -31,9 +31,9 @@ class SfxEmptySplitWin_Impl;
struct SfxDock_Impl
{
sal_uInt16 nType;
- SfxDockingWindow* pWin; // SplitWindow has this window
- bool bNewLine;
- bool bHide; // SplitWindow had this window
+ VclPtr<SfxDockingWindow> pWin; // SplitWindow has this window
+ bool bNewLine;
+ bool bHide; // SplitWindow had this window
long nSize;
};
@@ -49,8 +49,8 @@ private:
SfxDockArr_Impl* pDockArr;
bool bLocked;
bool bPinned;
- SfxEmptySplitWin_Impl* pEmptyWin;
- SfxDockingWindow* pActive;
+ VclPtr<SfxEmptySplitWin_Impl> pEmptyWin;
+ VclPtr<SfxDockingWindow> pActive;
void InsertWindow_Impl( SfxDock_Impl* pDockWin,
const Size& rSize,
@@ -79,6 +79,7 @@ public:
WinBits nBits = WB_BORDER | WB_SIZEABLE | WB_3DLOOK );
virtual ~SfxSplitWindow();
+ virtual void dispose() SAL_OVERRIDE;
void ReleaseWindow_Impl(SfxDockingWindow *pWin, bool bSaveConfig=true);
diff --git a/sfx2/source/inc/templatesearchview.hxx b/sfx2/source/inc/templatesearchview.hxx
index 2845c409fcb6..e49ef3f81813 100644
--- a/sfx2/source/inc/templatesearchview.hxx
+++ b/sfx2/source/inc/templatesearchview.hxx
@@ -18,8 +18,6 @@ public:
TemplateSearchView ( vcl::Window* pParent, WinBits nWinStyle = WB_TABSTOP | WB_VSCROLL);
- virtual ~TemplateSearchView();
-
void setOpenTemplateHdl (const Link &rLink);
void AppendItem(sal_uInt16 nAssocItemId, sal_uInt16 nRegionId, sal_uInt16 nIdx,
diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx
index 0cf88b1e7077..249a1f32d827 100644
--- a/sfx2/source/inc/templdgi.hxx
+++ b/sfx2/source/inc/templdgi.hxx
@@ -176,7 +176,7 @@ protected:
SfxBindings* pBindings;
SfxTemplateControllerItem* pBoundItems[COUNT_BOUND_FUNC];
- vcl::Window* pWindow;
+ VclPtr<vcl::Window> pWindow;
SfxModule* pModule;
Idle* pIdle;
@@ -184,13 +184,13 @@ protected:
SfxStyleFamilies* pStyleFamilies;
SfxTemplateItem* pFamilyState[MAX_FAMILIES];
SfxStyleSheetBasePool* pStyleSheetPool;
- StyleTreeListBox_Impl* pTreeBox;
+ VclPtr<StyleTreeListBox_Impl> pTreeBox;
SfxObjectShell* pCurObjShell;
css::uno::Reference<css::frame::XModuleManager2> xModuleManager;
DeletionWatcher* m_pDeletionWatcher;
- SfxActionListBox aFmtLb;
- ListBox aFilterLb;
+ VclPtr<SfxActionListBox> aFmtLb;
+ VclPtr<ListBox> aFilterLb;
Size aSize;
sal_uInt16 nActFamily; // Id in the ToolBox = Position - 1
@@ -367,7 +367,6 @@ protected:
virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) SAL_OVERRIDE;
public:
DropToolBox_Impl(vcl::Window* pParent, SfxTemplateDialog_Impl* pTemplateDialog);
- virtual ~DropToolBox_Impl();
};
class SfxTemplateDialog_Impl : public SfxCommonTemplateDialog_Impl
@@ -377,10 +376,10 @@ private:
friend class DropToolBox_Impl;
friend class SfxTemplatePanelControl;
- vcl::Window* m_pFloat;
- bool m_bZoomIn;
- DropToolBox_Impl m_aActionTbL;
- ToolBox m_aActionTbR;
+ VclPtr<vcl::Window> m_pFloat;
+ bool m_bZoomIn;
+ VclPtr<DropToolBox_Impl> m_aActionTbL;
+ VclPtr<ToolBox> m_aActionTbR;
DECL_LINK( ToolBoxLSelect, ToolBox* );
DECL_LINK( ToolBoxRSelect, ToolBox* );
diff --git a/sfx2/source/inc/versdlg.hxx b/sfx2/source/inc/versdlg.hxx
index 3204e2d479bf..67453efa3a51 100644
--- a/sfx2/source/inc/versdlg.hxx
+++ b/sfx2/source/inc/versdlg.hxx
@@ -45,14 +45,14 @@ public:
class SfxVersionTableDtor;
class SfxVersionDialog : public SfxModalDialog
{
- PushButton* m_pSaveButton;
- CheckBox* m_pSaveCheckBox;
- SfxVersionsTabListBox_Impl* m_pVersionBox;
- PushButton* m_pOpenButton;
- PushButton* m_pViewButton;
- PushButton* m_pDeleteButton;
- PushButton* m_pCompareButton;
- PushButton* m_pCmisButton;
+ VclPtr<PushButton> m_pSaveButton;
+ VclPtr<CheckBox> m_pSaveCheckBox;
+ VclPtr<SfxVersionsTabListBox_Impl> m_pVersionBox;
+ VclPtr<PushButton> m_pOpenButton;
+ VclPtr<PushButton> m_pViewButton;
+ VclPtr<PushButton> m_pDeleteButton;
+ VclPtr<PushButton> m_pCompareButton;
+ VclPtr<PushButton> m_pCmisButton;
SfxViewFrame* pViewFrame;
SfxVersionTableDtor* m_pTable;
bool m_bIsSaveVersionOnClose;
@@ -66,32 +66,35 @@ class SfxVersionDialog : public SfxModalDialog
public:
SfxVersionDialog ( SfxViewFrame* pFrame, bool );
virtual ~SfxVersionDialog ();
+ virtual void dispose() SAL_OVERRIDE;
bool IsSaveVersionOnClose() const { return m_bIsSaveVersionOnClose; }
};
class SfxViewVersionDialog_Impl : public SfxModalDialog
{
- FixedText* m_pDateTimeText;
- FixedText* m_pSavedByText;
- VclMultiLineEdit* m_pEdit;
- OKButton* m_pOKButton;
- CancelButton* m_pCancelButton;
- CloseButton* m_pCloseButton;
+ VclPtr<FixedText> m_pDateTimeText;
+ VclPtr<FixedText> m_pSavedByText;
+ VclPtr<VclMultiLineEdit> m_pEdit;
+ VclPtr<OKButton> m_pOKButton;
+ VclPtr<CancelButton> m_pCancelButton;
+ VclPtr<CloseButton> m_pCloseButton;
SfxVersionInfo& m_rInfo;
DECL_LINK(ButtonHdl, Button*);
public:
SfxViewVersionDialog_Impl(vcl::Window *pParent, SfxVersionInfo& rInfo, bool bEdit);
+ virtual ~SfxViewVersionDialog_Impl();
+ virtual void dispose() SAL_OVERRIDE;
};
class SfxCmisVersionsDialog : public SfxModalDialog
{
- SfxVersionsTabListBox_Impl* m_pVersionBox;
- PushButton* m_pOpenButton;
- PushButton* m_pViewButton;
- PushButton* m_pDeleteButton;
- PushButton* m_pCompareButton;
+ VclPtr<SfxVersionsTabListBox_Impl> m_pVersionBox;
+ VclPtr<PushButton> m_pOpenButton;
+ VclPtr<PushButton> m_pViewButton;
+ VclPtr<PushButton> m_pDeleteButton;
+ VclPtr<PushButton> m_pCompareButton;
SfxViewFrame* pViewFrame;
SfxVersionTableDtor* m_pTable;
bool m_bIsSaveVersionOnClose;
@@ -104,6 +107,7 @@ class SfxCmisVersionsDialog : public SfxModalDialog
public:
SfxCmisVersionsDialog ( SfxViewFrame* pFrame, bool );
virtual ~SfxCmisVersionsDialog ();
+ virtual void dispose() SAL_OVERRIDE;
};
#endif
diff --git a/sfx2/source/inc/workwin.hxx b/sfx2/source/inc/workwin.hxx
index 7abf4d37cfb7..7233fe676838 100644
--- a/sfx2/source/inc/workwin.hxx
+++ b/sfx2/source/inc/workwin.hxx
@@ -96,7 +96,7 @@ namespace o3tl
struct SfxChild_Impl
{
- vcl::Window* pWin;
+ VclPtr<vcl::Window> pWin;
Size aSize;
SfxChildAlignment eAlign;
SfxChildVisibility nVisible;
@@ -222,16 +222,16 @@ protected:
Rectangle aClientArea;
Rectangle aUpperClientArea;
SfxWorkWindow* pParent;
- SfxSplitWindow* pSplit[SFX_SPLITWINDOWS_MAX];
+ VclPtr<SfxSplitWindow> pSplit[SFX_SPLITWINDOWS_MAX];
SfxChildList_Impl aChildren;
SfxChildWindows_Impl aChildWins;
SfxBindings* pBindings;
- vcl::Window* pWorkWin;
+ VclPtr<vcl::Window> pWorkWin;
SfxShell* pConfigShell;
- vcl::Window* pActiveChild;
- sal_uInt16 nUpdateMode;
- sal_uInt16 nChildren;
- sal_uInt16 nOrigMode;
+ VclPtr<vcl::Window> pActiveChild;
+ sal_uInt16 nUpdateMode;
+ sal_uInt16 nChildren;
+ sal_uInt16 nOrigMode;
bool bSorted : 1;
bool bDockingAllowed : 1;
bool bInternalDockingAllowed : 1;
diff --git a/sfx2/source/inet/inettbc.cxx b/sfx2/source/inet/inettbc.cxx
index 29a5168987f0..81f89fbf3aa3 100644
--- a/sfx2/source/inet/inettbc.cxx
+++ b/sfx2/source/inet/inettbc.cxx
@@ -152,13 +152,12 @@ IMPL_STATIC_LINK_NOINSTANCE( SfxURLToolBoxControl_Impl, ExecuteHdl_Impl, Execute
}
-vcl::Window* SfxURLToolBoxControl_Impl::CreateItemWindow( vcl::Window* pParent )
+VclPtr<vcl::Window> SfxURLToolBoxControl_Impl::CreateItemWindow( vcl::Window* pParent )
{
- SvtURLBox* pURLBox = new SvtURLBox( pParent );
+ VclPtrInstance<SvtURLBox> pURLBox( pParent );
pURLBox->SetOpenHdl( LINK( this, SfxURLToolBoxControl_Impl, OpenHdl ) );
pURLBox->SetSelectHdl( LINK( this, SfxURLToolBoxControl_Impl, SelectHdl ) );
-
- return pURLBox;
+ return pURLBox.get();
}
IMPL_LINK_NOARG(SfxURLToolBoxControl_Impl, SelectHdl)
diff --git a/sfx2/source/sidebar/ControlFactory.cxx b/sfx2/source/sidebar/ControlFactory.cxx
index 23e17a671deb..d8a49b3dd148 100644
--- a/sfx2/source/sidebar/ControlFactory.cxx
+++ b/sfx2/source/sidebar/ControlFactory.cxx
@@ -25,14 +25,14 @@
namespace sfx2 { namespace sidebar {
-CheckBox* ControlFactory::CreateMenuButton (vcl::Window* pParentWindow)
+VclPtr<CheckBox> ControlFactory::CreateMenuButton (vcl::Window* pParentWindow)
{
- return new MenuButton(pParentWindow);
+ return VclPtr<CheckBox>(new MenuButton(pParentWindow), SAL_NO_ACQUIRE);
}
-ImageRadioButton* ControlFactory::CreateTabItem (vcl::Window* pParentWindow)
+VclPtr<ImageRadioButton> ControlFactory::CreateTabItem (vcl::Window* pParentWindow)
{
- return new TabItem(pParentWindow);
+ return VclPtr<ImageRadioButton>(new TabItem(pParentWindow), SAL_NO_ACQUIRE);
}
} } // end of namespace sfx2::sidebar
diff --git a/sfx2/source/sidebar/ControllerItem.cxx b/sfx2/source/sidebar/ControllerItem.cxx
index 729e2b210164..22dd244e52e0 100644
--- a/sfx2/source/sidebar/ControllerItem.cxx
+++ b/sfx2/source/sidebar/ControllerItem.cxx
@@ -117,8 +117,16 @@ ControllerItem::ControllerItem (
ControllerItem::~ControllerItem()
{
+ dispose();
+}
+
+void ControllerItem::dispose()
+{
if (mxFrameActionListener.is())
mxFrameActionListener->dispose();
+ mxFrameActionListener.clear();
+
+ SfxControllerItem::dispose();
}
void ControllerItem::StateChanged (
diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index 831c05325d8c..de2066defd74 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx