diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-04-28 11:41:31 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-28 15:08:48 +0100 |
commit | e8b97a52c96df9c8e8055407b1e40ed7cb9cfc67 (patch) | |
tree | b322529f4a54a6427862cb20cb4cf87fb6a5d065 /chart2 | |
parent | 2b0be6c0e9d23f1b8535ba7033732ae2e3bfb5c9 (diff) | |
parent | 0cde74f788a054fa2b65107a030dd463b8d11c7a (diff) |
Merge remote-tracking branch 'origin/feature/vclptr'
Resolve several thousand lines of conflicts.
Conflicts:
accessibility/source/extended/accessiblelistbox.cxx
accessibility/source/standard/vclxaccessiblecombobox.cxx
accessibility/source/standard/vclxaccessibledropdowncombobox.cxx
accessibility/source/standard/vclxaccessibledropdownlistbox.cxx
accessibility/source/standard/vclxaccessiblelistbox.cxx
accessibility/source/standard/vclxaccessibletextfield.cxx
basctl/source/basicide/basidesh.cxx
cui/source/inc/chardlg.hxx
cui/source/tabpages/tpbitmap.cxx
dbaccess/source/ui/dlg/UserAdmin.cxx
dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx
extensions/source/propctrlr/propertyeditor.hxx
extensions/source/scanner/sanedlg.cxx
filter/source/pdf/impdialog.cxx
include/sfx2/mgetempl.hxx
include/sfx2/sidebar/SidebarToolBox.hxx
include/sfx2/viewsh.hxx
include/svtools/brwbox.hxx
include/svtools/filectrl.hxx
include/svtools/scrwin.hxx
include/svx/dlgctrl.hxx
include/svx/sidebar/Popup.hxx
include/svx/sidebar/PopupContainer.hxx
include/svx/sidebar/PopupControl.hxx
include/svx/sidebar/SidebarDialControl.hxx
include/svx/sidebar/ValueSetWithTextControl.hxx
sc/source/ui/condformat/condformatdlgentry.cxx
sc/source/ui/navipi/navipi.cxx
sc/source/ui/sidebar/CellBorderStyleControl.hxx
sd/source/ui/animations/CustomAnimationDialog.cxx
sd/source/ui/inc/DrawViewShell.hxx
sd/source/ui/inc/Ruler.hxx
sd/source/ui/inc/SlideSorter.hxx
sd/source/ui/inc/ViewTabBar.hxx
sd/source/ui/inc/Window.hxx
sd/source/ui/inc/morphdlg.hxx
sd/source/ui/inc/sdpreslt.hxx
sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx
sd/source/ui/sidebar/LayoutMenu.hxx
sd/source/ui/sidebar/MasterPagesSelector.hxx
sd/source/ui/sidebar/NavigatorWrapper.hxx
sd/source/ui/sidebar/PanelBase.hxx
sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
sd/source/ui/sidebar/RecentMasterPagesSelector.hxx
sd/source/ui/slideshow/showwindow.hxx
sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx
sd/source/ui/slidesorter/view/SlsLayeredDevice.hxx
sd/source/ui/view/ViewShellBase.cxx
sd/source/ui/view/drviewsa.cxx
sfx2/source/appl/fileobj.hxx
sfx2/source/appl/opengrf.cxx
sfx2/source/control/thumbnailviewacc.hxx
sfx2/source/dialog/securitypage.cxx
sfx2/source/dialog/templdlg.cxx
sfx2/source/doc/docinsert.cxx
sfx2/source/doc/guisaveas.cxx
sfx2/source/inc/alienwarn.hxx
sfx2/source/sidebar/Deck.cxx
sfx2/source/sidebar/Deck.hxx
sfx2/source/sidebar/DeckTitleBar.cxx
sfx2/source/sidebar/DeckTitleBar.hxx
sfx2/source/sidebar/MenuButton.cxx
sfx2/source/sidebar/MenuButton.hxx
sfx2/source/sidebar/Panel.cxx
sfx2/source/sidebar/Panel.hxx
sfx2/source/sidebar/PanelTitleBar.hxx
sfx2/source/sidebar/SidebarDockingWindow.hxx
sfx2/source/sidebar/SidebarToolBox.cxx
sfx2/source/sidebar/TabBar.hxx
sfx2/source/sidebar/TabItem.cxx
sfx2/source/sidebar/TabItem.hxx
sfx2/source/sidebar/TitleBar.hxx
sfx2/source/toolbox/imgmgr.cxx
starmath/inc/edit.hxx
starmath/inc/smmod.hxx
starmath/qa/cppunit/test_starmath.cxx
starmath/source/edit.cxx
starmath/source/smmod.cxx
svtools/source/brwbox/brwbox1.cxx
svtools/source/brwbox/datwin.hxx
svtools/source/contnr/fileview.cxx
svtools/source/contnr/simptabl.cxx
svtools/source/control/filectrl.cxx
svtools/source/control/valueimp.hxx
svx/inc/GalleryControl.hxx
svx/source/dialog/dlgctrl.cxx
svx/source/dialog/swframeexample.cxx
svx/source/fmcomp/fmgridif.cxx
svx/source/gallery2/GalleryControl.cxx
svx/source/sidebar/EmptyPanel.hxx
svx/source/sidebar/area/AreaPropertyPanel.hxx
svx/source/sidebar/area/AreaTransparencyGradientControl.hxx
svx/source/sidebar/graphic/GraphicPropertyPanel.hxx
svx/source/sidebar/insert/InsertPropertyPanel.cxx
svx/source/sidebar/insert/InsertPropertyPanel.hxx
svx/source/sidebar/line/LinePropertyPanel.hxx
svx/source/sidebar/line/LineWidthControl.cxx
svx/source/sidebar/line/LineWidthControl.hxx
svx/source/sidebar/line/LineWidthValueSet.hxx
svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
svx/source/sidebar/possize/SidebarDialControl.cxx
svx/source/sidebar/text/TextCharacterSpacingPopup.hxx
svx/source/sidebar/text/TextPropertyPanel.hxx
svx/source/sidebar/tools/PopupContainer.cxx
svx/source/sidebar/tools/PopupControl.cxx
svx/source/sidebar/tools/ValueSetWithTextControl.cxx
svx/source/svdraw/svdfmtf.hxx
svx/source/svdraw/svdibrow.cxx
svx/source/tbxctrls/colrctrl.cxx
svx/source/tbxctrls/tbcontrl.cxx
sw/source/ui/dbui/mmaddressblockpage.cxx
sw/source/ui/dialog/uiregionsw.cxx
sw/source/ui/index/cnttab.cxx
sw/source/uibase/inc/drpcps.hxx
sw/source/uibase/sidebar/PageColumnControl.hxx
sw/source/uibase/sidebar/PageMarginControl.hxx
sw/source/uibase/sidebar/PageOrientationControl.hxx
sw/source/uibase/sidebar/PagePropertyPanel.hxx
sw/source/uibase/sidebar/PageSizeControl.hxx
sw/source/uibase/uiview/view2.cxx
sw/source/uibase/utlui/navipi.cxx
vcl/inc/svdata.hxx
vcl/source/control/combobox.cxx
vcl/source/control/lstbox.cxx
vcl/source/window/dockwin.cxx
vcl/source/window/winproc.cxx
Change-Id: I056cf3026ff17d65cca0b6e6588bda4a88fa8d95
Diffstat (limited to 'chart2')
94 files changed, 896 insertions, 574 deletions
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; |