diff options
Diffstat (limited to 'chart2/source/controller/main')
11 files changed, 81 insertions, 71 deletions
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(); |