diff options
author | Noel Grandin <noel@peralex.com> | 2015-04-20 14:42:40 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-04-20 14:42:40 +0200 |
commit | 8e934e79407fba1b0ba564dbaf295a2102d557a4 (patch) | |
tree | f85e767823500e93e75c23d4a6977eb817782d13 /sc/source/ui/view | |
parent | 7819d49facfac7e241840ff9ea6932447e92a6f9 (diff) |
sc: convert new to ::Create
Change-Id: I38bf7fe0dafe2cfd2535055f764293070de9c42c
Diffstat (limited to 'sc/source/ui/view')
-rw-r--r-- | sc/source/ui/view/cellsh1.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin2.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/prevwsh.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/view/reffact.cxx | 7 | ||||
-rw-r--r-- | sc/source/ui/view/tabview.cxx | 32 | ||||
-rw-r--r-- | sc/source/ui/view/tabview3.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/tabview5.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwshc.cxx | 60 |
9 files changed, 70 insertions, 69 deletions
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 0f2624572b22..c28bb401cfff 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -1950,7 +1950,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) { // found a matching range, edit this conditional format nKey = pCondFormat->GetKey(); - pCondFormatDlg.reset( new ScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, pCondFormat, rCondFormatRange, aPos, condformat::dialog::NONE ) ); + pCondFormatDlg.reset( VclPtr<ScCondFormatDlg>::Create( pTabViewShell->GetDialogParent(), pDoc, pCondFormat, rCondFormatRange, aPos, condformat::dialog::NONE ) ); break; } } @@ -1975,7 +1975,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) assert(pCondFormat); const ScRangeList& rCondFormatRange = pCondFormat->GetRange(); nKey = pCondFormat->GetKey(); - pCondFormatDlg.reset( new ScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, pCondFormat, rCondFormatRange, aPos, condformat::dialog::NONE ) ); + pCondFormatDlg.reset( VclPtr<ScCondFormatDlg>::Create( pTabViewShell->GetDialogParent(), pDoc, pCondFormat, rCondFormatRange, aPos, condformat::dialog::NONE ) ); } else { @@ -2023,7 +2023,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) assert(false); break; } - pCondFormatDlg.reset( new ScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, NULL, aRangeList, aRangeList.GetTopLeftCorner(), eType ) ); + pCondFormatDlg.reset( VclPtr<ScCondFormatDlg>::Create( pTabViewShell->GetDialogParent(), pDoc, nullptr, aRangeList, aRangeList.GetTopLeftCorner(), eType ) ); } sal_uInt16 nId = 1; diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index a1ab73bc773b..159172b28a18 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -703,7 +703,7 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow) SCTAB nTab = pViewData->GetTabNo(); ScDocument* pDoc = pViewData->GetDocument(); - mpAutoFilterPopup.reset(new ScCheckListMenuWindow(this, pDoc)); + mpAutoFilterPopup.reset(VclPtr<ScCheckListMenuWindow>::Create(this, pDoc)); mpAutoFilterPopup->setOKAction(new AutoFilterAction(this, Normal)); mpAutoFilterPopup->setPopupEndAction( new AutoFilterPopupEndAction(this, ScAddress(nCol, nRow, nTab))); @@ -994,9 +994,9 @@ void ScGridWindow::DoScenarioMenu( const ScRange& rScenRange ) // Die ListBox direkt unter der schwarzen Linie auf dem Zellgitter // (wenn die Linie verdeckt wird, sieht es komisch aus...) - mpFilterFloat.reset(new ScFilterFloatingWindow(this, WinBits(WB_BORDER))); + mpFilterFloat.reset(VclPtr<ScFilterFloatingWindow>::Create(this, WinBits(WB_BORDER))); mpFilterFloat->SetPopupModeEndHdl( LINK( this, ScGridWindow, PopupModeEndHdl ) ); - mpFilterBox.reset(new ScFilterListBox(mpFilterFloat.get(), this, nCol, nRow, SC_FILTERBOX_SCENARIO)); + mpFilterBox.reset(VclPtr<ScFilterListBox>::Create(mpFilterFloat.get(), this, nCol, nRow, SC_FILTERBOX_SCENARIO)); if (bLayoutRTL) mpFilterBox->EnableMirroring(); @@ -1120,10 +1120,10 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow, bool bDataSelec aPos.X() -= 1; aPos.Y() += nSizeY - 1; - mpFilterFloat.reset(new ScFilterFloatingWindow(this, WinBits(WB_BORDER))); + mpFilterFloat.reset(VclPtr<ScFilterFloatingWindow>::Create(this, WinBits(WB_BORDER))); mpFilterFloat->SetPopupModeEndHdl(LINK( this, ScGridWindow, PopupModeEndHdl)); ScFilterBoxMode eFilterMode = bDataSelect ? SC_FILTERBOX_DATASELECT : SC_FILTERBOX_FILTER; - mpFilterBox.reset(new ScFilterListBox(mpFilterFloat.get(), this, nCol, nRow, eFilterMode)); + mpFilterBox.reset(VclPtr<ScFilterListBox>::Create(mpFilterFloat.get(), this, nCol, nRow, eFilterMode)); // Fix for bug fdo#44925 if (AllSettings::GetLayoutRTL() != bLayoutRTL) mpFilterBox->EnableMirroring(); diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx index 3200a0ee2b49..04194904e382 100644 --- a/sc/source/ui/view/gridwin2.cxx +++ b/sc/source/ui/view/gridwin2.cxx @@ -455,7 +455,7 @@ void ScGridWindow::DPLaunchFieldPopupMenu( const ScDPLabelData& rLabelData = pDPData->maLabels; - mpDPFieldPopup.reset(new ScCheckListMenuWindow(this, pViewData->GetDocument())); + mpDPFieldPopup.reset(VclPtr<ScCheckListMenuWindow>::Create(this, pViewData->GetDocument())); mpDPFieldPopup->setName("DataPilot field member popup"); mpDPFieldPopup->setExtendedData(pDPData.release()); mpDPFieldPopup->setOKAction(new DPFieldPopupOKAction(this)); diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index 5dc88fc466b6..aa55c61c285b 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -119,10 +119,10 @@ void ScPreviewShell::Construct( vcl::Window* pParent ) eZoom = SvxZoomType::WHOLEPAGE; - pCorner = new ScrollBarBox( pParent, WB_SIZEABLE ); + pCorner = VclPtr<ScrollBarBox>::Create( pParent, WB_SIZEABLE ); - pHorScroll = new ScrollBar(pParent, WB_HSCROLL ); - pVerScroll = new ScrollBar(pParent, WB_VSCROLL); + pHorScroll = VclPtr<ScrollBar>::Create(pParent, WB_HSCROLL ); + pVerScroll = VclPtr<ScrollBar>::Create(pParent, WB_VSCROLL); // SSA: --- RTL --- no mirroring for horizontal scrollbars pHorScroll->EnableRTL( false ); @@ -130,7 +130,7 @@ void ScPreviewShell::Construct( vcl::Window* pParent ) pHorScroll->SetEndScrollHdl( LINK( this, ScPreviewShell, ScrollHandler ) ); pVerScroll->SetEndScrollHdl( LINK( this, ScPreviewShell, ScrollHandler ) ); - pPreview = new ScPreview( pParent, pDocShell, this ); + pPreview = VclPtr<ScPreview>::Create( pParent, pDocShell, this ); SetPool( &SC_MOD()->GetPool() ); SetWindow( pPreview ); diff --git a/sc/source/ui/view/reffact.cxx b/sc/source/ui/view/reffact.cxx index c37898763699..3b0e96224d29 100644 --- a/sc/source/ui/view/reffact.cxx +++ b/sc/source/ui/view/reffact.cxx @@ -237,9 +237,10 @@ ScAcceptChgDlgWrapper::ScAcceptChgDlgWrapper( vcl::Window* pParentP, ScTabViewShell* pViewShell = PTR_CAST( ScTabViewShell, SfxViewShell::Current() ); OSL_ENSURE( pViewShell, "missing view shell :-(" ); - pWindow = pViewShell ? - new ScAcceptChgDlg( pBindings, this, pParentP, &pViewShell->GetViewData() ) : - NULL; + if (pViewShell) + pWindow = VclPtr<ScAcceptChgDlg>::Create( pBindings, this, pParentP, &pViewShell->GetViewData() ); + else + pWindow = NULL; if(pWindow!=nullptr) { static_cast<ScAcceptChgDlg*>(pWindow.get())->Initialize( pInfo ); diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 00c586cb33a0..57b71dd50d08 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -199,13 +199,13 @@ ScTabView::ScTabView( vcl::Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pHdrSelEng( NULL ), aHdrFunc( &aViewData ), pDrawView( NULL ), - aVScrollTop( new ScrollBar( pFrameWin, WinBits( WB_VSCROLL | WB_DRAG ) ) ), - aVScrollBottom( new ScrollBar( pFrameWin, WinBits( WB_VSCROLL | WB_DRAG ) ) ), - aHScrollLeft( new ScrollBar( pFrameWin, WinBits( WB_HSCROLL | WB_DRAG ) ) ), - aHScrollRight( new ScrollBar( pFrameWin, WinBits( WB_HSCROLL | WB_DRAG ) ) ), - aCornerButton( new ScCornerButton( pFrameWin, &aViewData, false ) ), - aTopButton( new ScCornerButton( pFrameWin, &aViewData, true ) ), - aScrollBarBox( new ScrollBarBox( pFrameWin, WB_SIZEABLE ) ), + aVScrollTop( VclPtr<ScrollBar>::Create( pFrameWin, WinBits( WB_VSCROLL | WB_DRAG ) ) ), + aVScrollBottom( VclPtr<ScrollBar>::Create( pFrameWin, WinBits( WB_VSCROLL | WB_DRAG ) ) ), + aHScrollLeft( VclPtr<ScrollBar>::Create( pFrameWin, WinBits( WB_HSCROLL | WB_DRAG ) ) ), + aHScrollRight( VclPtr<ScrollBar>::Create( pFrameWin, WinBits( WB_HSCROLL | WB_DRAG ) ) ), + aCornerButton( VclPtr<ScCornerButton>::Create( pFrameWin, &aViewData, false ) ), + aTopButton( VclPtr<ScCornerButton>::Create( pFrameWin, &aViewData, true ) ), + aScrollBarBox( VclPtr<ScrollBarBox>::Create( pFrameWin, WB_SIZEABLE ) ), mpInputHintWindow( NULL ), pPageBreakData( NULL ), pBrushDocument( NULL ), @@ -1466,35 +1466,35 @@ void ScTabView::UpdateShow() if (bShowH && !pGridWin[SC_SPLIT_BOTTOMRIGHT]) { - pGridWin[SC_SPLIT_BOTTOMRIGHT] = new ScGridWindow( pFrameWin, &aViewData, SC_SPLIT_BOTTOMRIGHT ); + pGridWin[SC_SPLIT_BOTTOMRIGHT] = VclPtr<ScGridWindow>::Create( pFrameWin, &aViewData, SC_SPLIT_BOTTOMRIGHT ); DoAddWin( pGridWin[SC_SPLIT_BOTTOMRIGHT] ); } if (bShowV && !pGridWin[SC_SPLIT_TOPLEFT]) { - pGridWin[SC_SPLIT_TOPLEFT] = new ScGridWindow( pFrameWin, &aViewData, SC_SPLIT_TOPLEFT ); + pGridWin[SC_SPLIT_TOPLEFT] = VclPtr<ScGridWindow>::Create( pFrameWin, &aViewData, SC_SPLIT_TOPLEFT ); DoAddWin( pGridWin[SC_SPLIT_TOPLEFT] ); } if (bShowH && bShowV && !pGridWin[SC_SPLIT_TOPRIGHT]) { - pGridWin[SC_SPLIT_TOPRIGHT] = new ScGridWindow( pFrameWin, &aViewData, SC_SPLIT_TOPRIGHT ); + pGridWin[SC_SPLIT_TOPRIGHT] = VclPtr<ScGridWindow>::Create( pFrameWin, &aViewData, SC_SPLIT_TOPRIGHT ); DoAddWin( pGridWin[SC_SPLIT_TOPRIGHT] ); } if (bHOutline && !pColOutline[SC_SPLIT_LEFT]) - pColOutline[SC_SPLIT_LEFT] = new ScOutlineWindow( pFrameWin, SC_OUTLINE_HOR, &aViewData, SC_SPLIT_BOTTOMLEFT ); + pColOutline[SC_SPLIT_LEFT] = VclPtr<ScOutlineWindow>::Create( pFrameWin, SC_OUTLINE_HOR, &aViewData, SC_SPLIT_BOTTOMLEFT ); if (bShowH && bHOutline && !pColOutline[SC_SPLIT_RIGHT]) - pColOutline[SC_SPLIT_RIGHT] = new ScOutlineWindow( pFrameWin, SC_OUTLINE_HOR, &aViewData, SC_SPLIT_BOTTOMRIGHT ); + pColOutline[SC_SPLIT_RIGHT] = VclPtr<ScOutlineWindow>::Create( pFrameWin, SC_OUTLINE_HOR, &aViewData, SC_SPLIT_BOTTOMRIGHT ); if (bVOutline && !pRowOutline[SC_SPLIT_BOTTOM]) - pRowOutline[SC_SPLIT_BOTTOM] = new ScOutlineWindow( pFrameWin, SC_OUTLINE_VER, &aViewData, SC_SPLIT_BOTTOMLEFT ); + pRowOutline[SC_SPLIT_BOTTOM] = VclPtr<ScOutlineWindow>::Create( pFrameWin, SC_OUTLINE_VER, &aViewData, SC_SPLIT_BOTTOMLEFT ); if (bShowV && bVOutline && !pRowOutline[SC_SPLIT_TOP]) - pRowOutline[SC_SPLIT_TOP] = new ScOutlineWindow( pFrameWin, SC_OUTLINE_VER, &aViewData, SC_SPLIT_TOPLEFT ); + pRowOutline[SC_SPLIT_TOP] = VclPtr<ScOutlineWindow>::Create( pFrameWin, SC_OUTLINE_VER, &aViewData, SC_SPLIT_TOPLEFT ); if (bShowH && bHeader && !pColBar[SC_SPLIT_RIGHT]) - pColBar[SC_SPLIT_RIGHT] = new ScColBar( pFrameWin, &aViewData, SC_SPLIT_RIGHT, + pColBar[SC_SPLIT_RIGHT] = VclPtr<ScColBar>::Create( pFrameWin, &aViewData, SC_SPLIT_RIGHT, &aHdrFunc, pHdrSelEng ); if (bShowV && bHeader && !pRowBar[SC_SPLIT_TOP]) - pRowBar[SC_SPLIT_TOP] = new ScRowBar( pFrameWin, &aViewData, SC_SPLIT_TOP, + pRowBar[SC_SPLIT_TOP] = VclPtr<ScRowBar>::Create( pFrameWin, &aViewData, SC_SPLIT_TOP, &aHdrFunc, pHdrSelEng ); // Windows anzeigen diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index 1ee8f4e1ab10..1e5d2dac7db4 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -623,7 +623,7 @@ void ScTabView::TestHintWindow() aPos.X() < aWinSize.Width() && aPos.Y() < aWinSize.Height() ) { // HintWindow anlegen, bestimmt seine Groesse selbst - mpInputHintWindow.reset(new ScHintWindow(pWin, aTitle, aMessage)); + mpInputHintWindow.reset(VclPtr<ScHintWindow>::Create(pWin, aTitle, aMessage)); Size aHintWndSize = mpInputHintWindow->GetSizePixel(); long nCellSizeX = 0; long nCellSizeY = 0; diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx index a01d9c4679f3..6bb12f6554e2 100644 --- a/sc/source/ui/view/tabview5.cxx +++ b/sc/source/ui/view/tabview5.cxx @@ -74,7 +74,7 @@ void ScTabView::Init() for (i=0; i<4; i++) pGridWin[i] = NULL; - pGridWin[SC_SPLIT_BOTTOMLEFT] = new ScGridWindow( pFrameWin, &aViewData, SC_SPLIT_BOTTOMLEFT ); + pGridWin[SC_SPLIT_BOTTOMLEFT] = VclPtr<ScGridWindow>::Create( pFrameWin, &aViewData, SC_SPLIT_BOTTOMLEFT ); pSelEngine = new ScViewSelectionEngine( pGridWin[SC_SPLIT_BOTTOMLEFT], this, SC_SPLIT_BOTTOMLEFT ); @@ -82,23 +82,23 @@ void ScTabView::Init() pHdrSelEng = new ScHeaderSelectionEngine( pFrameWin, &aHdrFunc ); - pColBar[SC_SPLIT_LEFT] = new ScColBar( pFrameWin, &aViewData, SC_SPLIT_LEFT, + pColBar[SC_SPLIT_LEFT] = VclPtr<ScColBar>::Create( pFrameWin, &aViewData, SC_SPLIT_LEFT, &aHdrFunc, pHdrSelEng ); pColBar[SC_SPLIT_RIGHT] = NULL; - pRowBar[SC_SPLIT_BOTTOM] = new ScRowBar( pFrameWin, &aViewData, SC_SPLIT_BOTTOM, + pRowBar[SC_SPLIT_BOTTOM] = VclPtr<ScRowBar>::Create( pFrameWin, &aViewData, SC_SPLIT_BOTTOM, &aHdrFunc, pHdrSelEng ); pRowBar[SC_SPLIT_TOP] = NULL; for (i=0; i<2; i++) pColOutline[i] = pRowOutline[i] = NULL; - pHSplitter = new ScTabSplitter( pFrameWin, WinBits( WB_HSCROLL ), &aViewData ); - pVSplitter = new ScTabSplitter( pFrameWin, WinBits( WB_VSCROLL ), &aViewData ); + pHSplitter = VclPtr<ScTabSplitter>::Create( pFrameWin, WinBits( WB_HSCROLL ), &aViewData ); + pVSplitter = VclPtr<ScTabSplitter>::Create( pFrameWin, WinBits( WB_VSCROLL ), &aViewData ); // SSA: override default keyboard step size to allow snap to row/column pHSplitter->SetKeyboardStepSize( 1 ); pVSplitter->SetKeyboardStepSize( 1 ); - pTabControl = new ScTabControl(pFrameWin, &aViewData); + pTabControl = VclPtr<ScTabControl>::Create(pFrameWin, &aViewData); if (mbInlineWithScrollbar) pTabControl->SetStyle(pTabControl->GetStyle() | WB_SIZEABLE); diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index bc5cff707733..9b1feb0de478 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -145,14 +145,14 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( { if (!mbInSwitch) { - pResult = new ScNameDlg( pB, pCW, pParent, &GetViewData(), + pResult = VclPtr<ScNameDlg>::Create( pB, pCW, pParent, &GetViewData(), ScAddress( GetViewData().GetCurX(), GetViewData().GetCurY(), GetViewData().GetTabNo() ) ); } else { - pResult = new ScNameDlg( pB, pCW, pParent, &GetViewData(), + pResult = VclPtr<ScNameDlg>::Create( pB, pCW, pParent, &GetViewData(), ScAddress( GetViewData().GetCurX(), GetViewData().GetCurY(), GetViewData().GetTabNo() ), &maRangeMap); @@ -168,7 +168,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( { std::map<OUString, ScRangeName*> aRangeMap; pDoc->GetRangeNameMap(aRangeMap); - pResult = new ScNameDefDlg( pB, pCW, pParent, &GetViewData(), aRangeMap, + pResult = VclPtr<ScNameDefDlg>::Create( pB, pCW, pParent, &GetViewData(), aRangeMap, ScAddress( GetViewData().GetCurX(), GetViewData().GetCurY(), GetViewData().GetTabNo() ), true ); @@ -181,7 +181,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( { aRangeMap.insert(std::pair<OUString, ScRangeName*>(itr->first, itr->second)); } - pResult = new ScNameDefDlg( pB, pCW, pParent, &GetViewData(), aRangeMap, + pResult = VclPtr<ScNameDefDlg>::Create( pB, pCW, pParent, &GetViewData(), aRangeMap, ScAddress( GetViewData().GetCurX(), GetViewData().GetCurY(), GetViewData().GetTabNo() ), false ); @@ -191,7 +191,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( case SID_DEFINE_COLROWNAMERANGES: { - pResult = new ScColRowNameRangesDlg( pB, pCW, pParent, &GetViewData() ); + pResult = VclPtr<ScColRowNameRangesDlg>::Create( pB, pCW, pParent, &GetViewData() ); } break; @@ -229,7 +229,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( { aArgSet.Put( ScConsolidateItem( SCITEM_CONSOLIDATEDATA, pDlgData ) ); } - pResult = new ScConsolidateDlg( pB, pCW, pParent, aArgSet ); + pResult = VclPtr<ScConsolidateDlg>::Create( pB, pCW, pParent, aArgSet ); } break; @@ -241,7 +241,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( if ( !rMark.IsMarked() && !rMark.IsMultiMarked() ) MarkDataArea( false ); - pResult = new ScDbNameDlg( pB, pCW, pParent, &GetViewData() ); + pResult = VclPtr<ScDbNameDlg>::Create( pB, pCW, pParent, &GetViewData() ); } break; @@ -270,7 +270,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( // aktuelle Tabelle merken (wg. RefInput im Dialog) GetViewData().SetRefTabNo( GetViewData().GetTabNo() ); - pResult = new ScSpecialFilterDlg( pB, pCW, pParent, aArgSet ); + pResult = VclPtr<ScSpecialFilterDlg>::Create( pB, pCW, pParent, aArgSet ); } break; @@ -297,7 +297,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( // aktuelle Tabelle merken (wg. RefInput im Dialog) GetViewData().SetRefTabNo( GetViewData().GetTabNo() ); - pResult = new ScFilterDlg( pB, pCW, pParent, aArgSet ); + pResult = VclPtr<ScFilterDlg>::Create( pB, pCW, pParent, aArgSet ); } break; @@ -309,7 +309,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( rViewData.GetTabNo(), false, false, false ); - pResult = new ScTabOpDlg( pB, pCW, pParent, rViewData.GetDocument(), aCurPos ); + pResult = VclPtr<ScTabOpDlg>::Create( pB, pCW, pParent, rViewData.GetDocument(), aCurPos ); } break; @@ -319,79 +319,79 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( ScAddress aCurPos( rViewData.GetCurX(), rViewData.GetCurY(), rViewData.GetTabNo()); - pResult = new ScSolverDlg( pB, pCW, pParent, rViewData.GetDocument(), aCurPos ); + pResult = VclPtr<ScSolverDlg>::Create( pB, pCW, pParent, rViewData.GetDocument(), aCurPos ); } break; case SID_RANDOM_NUMBER_GENERATOR_DIALOG: { - pResult = new ScRandomNumberGeneratorDialog( pB, pCW, pParent, &GetViewData() ); + pResult = VclPtr<ScRandomNumberGeneratorDialog>::Create( pB, pCW, pParent, &GetViewData() ); } break; case SID_SAMPLING_DIALOG: { - pResult = new ScSamplingDialog( pB, pCW, pParent, &GetViewData() ); + pResult = VclPtr<ScSamplingDialog>::Create( pB, pCW, pParent, &GetViewData() ); } break; case SID_DESCRIPTIVE_STATISTICS_DIALOG: { - pResult = new ScDescriptiveStatisticsDialog( pB, pCW, pParent, &GetViewData() ); + pResult = VclPtr<ScDescriptiveStatisticsDialog>::Create( pB, pCW, pParent, &GetViewData() ); } break; case SID_ANALYSIS_OF_VARIANCE_DIALOG: { - pResult = new ScAnalysisOfVarianceDialog( pB, pCW, pParent, &GetViewData() ); + pResult = VclPtr<ScAnalysisOfVarianceDialog>::Create( pB, pCW, pParent, &GetViewData() ); } break; case SID_CORRELATION_DIALOG: { - pResult = new ScCorrelationDialog( pB, pCW, pParent, &GetViewData() ); + pResult = VclPtr<ScCorrelationDialog>::Create( pB, pCW, pParent, &GetViewData() ); } break; case SID_COVARIANCE_DIALOG: { - pResult = new ScCovarianceDialog( pB, pCW, pParent, &GetViewData() ); + pResult = VclPtr<ScCovarianceDialog>::Create( pB, pCW, pParent, &GetViewData() ); } break; case SID_EXPONENTIAL_SMOOTHING_DIALOG: { - pResult = new ScExponentialSmoothingDialog( pB, pCW, pParent, &GetViewData() ); + pResult = VclPtr<ScExponentialSmoothingDialog>::Create( pB, pCW, pParent, &GetViewData() ); } break; case SID_MOVING_AVERAGE_DIALOG: { - pResult = new ScMovingAverageDialog( pB, pCW, pParent, &GetViewData() ); + pResult = VclPtr<ScMovingAverageDialog>::Create( pB, pCW, pParent, &GetViewData() ); } break; case SID_TTEST_DIALOG: { - pResult = new ScTTestDialog( pB, pCW, pParent, &GetViewData() ); + pResult = VclPtr<ScTTestDialog>::Create( pB, pCW, pParent, &GetViewData() ); } break; case SID_FTEST_DIALOG: { - pResult = new ScFTestDialog( pB, pCW, pParent, &GetViewData() ); + pResult = VclPtr<ScFTestDialog>::Create( pB, pCW, pParent, &GetViewData() ); } break; case SID_ZTEST_DIALOG: { - pResult = new ScZTestDialog( pB, pCW, pParent, &GetViewData() ); + pResult = VclPtr<ScZTestDialog>::Create( pB, pCW, pParent, &GetViewData() ); } break; case SID_CHI_SQUARE_TEST_DIALOG: { - pResult = new ScChiSquareTestDialog( pB, pCW, pParent, &GetViewData() ); + pResult = VclPtr<ScChiSquareTestDialog>::Create( pB, pCW, pParent, &GetViewData() ); } break; @@ -399,7 +399,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( { ScViewData& rViewData = GetViewData(); ScAddress aCurPos( rViewData.GetCurX(), rViewData.GetCurY(), rViewData.GetTabNo()); - pResult = new ScOptSolverDlg( pB, pCW, pParent, rViewData.GetDocShell(), aCurPos ); + pResult = VclPtr<ScOptSolverDlg>::Create( pB, pCW, pParent, rViewData.GetDocShell(), aCurPos ); } break; @@ -413,14 +413,14 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( ScViewData& rViewData = GetViewData(); rViewData.SetRefTabNo( rViewData.GetTabNo() ); ScDPObject* pObj = pDoc->GetDPAtCursor(rViewData.GetCurX(), rViewData.GetCurY(), rViewData.GetTabNo()); - pResult = new ScPivotLayoutDialog(pB, pCW, pParent, &rViewData, pDialogDPObject, pObj == NULL); + pResult = VclPtr<ScPivotLayoutDialog>::Create(pB, pCW, pParent, &rViewData, pDialogDPObject, pObj == nullptr); } } break; case SID_OPENDLG_EDIT_PRINTAREA: { - pResult = new ScPrintAreasDlg( pB, pCW, pParent ); + pResult = VclPtr<ScPrintAreasDlg>::Create( pB, pCW, pParent ); } break; @@ -428,14 +428,14 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( { // Dialog schaut selber, was in der Zelle steht - pResult = new ScFormulaDlg( pB, pCW, pParent, &GetViewData(),ScGlobal::GetStarCalcFunctionMgr() ); + pResult = VclPtr<ScFormulaDlg>::Create( pB, pCW, pParent, &GetViewData(),ScGlobal::GetStarCalcFunctionMgr() ); } break; case SID_MANAGE_XML_SOURCE: { #if ENABLE_ORCUS - pResult = new ScXMLSourceDlg(pB, pCW, pParent, pDoc); + pResult = VclPtr<ScXMLSourceDlg>::Create(pB, pCW, pParent, pDoc); #endif } break; @@ -444,7 +444,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( { // Dialog schaut selber, was in der Zelle steht - pResult = new ScHighlightChgDlg( pB, pCW, pParent, &GetViewData() ); + pResult = VclPtr<ScHighlightChgDlg>::Create( pB, pCW, pParent, &GetViewData() ); } break; @@ -454,7 +454,7 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( ScViewData& rViewData = GetViewData(); rViewData.SetRefTabNo( rViewData.GetTabNo() ); - pResult = new ScSimpleRefDlg( pB, pCW, pParent ); + pResult = VclPtr<ScSimpleRefDlg>::Create( pB, pCW, pParent ); } break; |