summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-04-20 14:42:40 +0200
committerNoel Grandin <noel@peralex.com>2015-04-20 14:42:40 +0200
commit8e934e79407fba1b0ba564dbaf295a2102d557a4 (patch)
treef85e767823500e93e75c23d4a6977eb817782d13
parent7819d49facfac7e241840ff9ea6932447e92a6f9 (diff)
sc: convert new to ::Create
Change-Id: I38bf7fe0dafe2cfd2535055f764293070de9c42c
-rw-r--r--sc/source/ui/navipi/navipi.cxx18
-rw-r--r--sc/source/ui/navipi/scenwnd.cxx4
-rw-r--r--sc/source/ui/sidebar/AlignmentPropertyPanel.cxx6
-rw-r--r--sc/source/ui/sidebar/AlignmentPropertyPanel.hxx11
-rw-r--r--sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx6
-rw-r--r--sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx11
-rw-r--r--sc/source/ui/sidebar/CellBorderStyleControl.cxx10
-rw-r--r--sc/source/ui/sidebar/CellLineStyleControl.cxx4
-rw-r--r--sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx6
-rw-r--r--sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx11
-rw-r--r--sc/source/ui/view/cellsh1.cxx6
-rw-r--r--sc/source/ui/view/gridwin.cxx10
-rw-r--r--sc/source/ui/view/gridwin2.cxx2
-rw-r--r--sc/source/ui/view/prevwsh.cxx8
-rw-r--r--sc/source/ui/view/reffact.cxx7
-rw-r--r--sc/source/ui/view/tabview.cxx32
-rw-r--r--sc/source/ui/view/tabview3.cxx2
-rw-r--r--sc/source/ui/view/tabview5.cxx12
-rw-r--r--sc/source/ui/view/tabvwshc.cxx60
19 files changed, 109 insertions, 117 deletions
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index 7c1ea4db5cf9..687128ef6d43 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -483,7 +483,7 @@ ScNavigatorDialogWrapper::ScNavigatorDialogWrapper(
SfxChildWinInfo* /* pInfo */ ) :
SfxChildWindowContext( nId )
{
- pNavigator = new ScNavigatorDlg( pBind, this, pParent, true );
+ pNavigator = VclPtr<ScNavigatorDlg>::Create( pBind, this, pParent, true );
SetWindow( pNavigator );
// handle configurations elsewhere,
@@ -555,14 +555,14 @@ ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, vcl
Window( pParent, ScResId(RID_SCDLG_NAVIGATOR) ),
rBindings ( *pB ), // is used in CommandToolBox ctor
aCmdImageList( ScResId( IL_CMD ) ),
- aFtCol ( new FixedInfo( this, ScResId( FT_COL ) ) ),
- aEdCol ( new ColumnEdit( this, ScResId( ED_COL ) ) ),
- aFtRow ( new FixedInfo( this, ScResId( FT_ROW ) ) ),
- aEdRow ( new RowEdit( this, ScResId( ED_ROW ) ) ),
- aTbxCmd ( new CommandToolBox( this, ScResId( TBX_CMD ) ) ),
- aLbEntries ( new ScContentTree( this, ScResId( LB_ENTRIES ) ) ),
- aWndScenarios( new ScScenarioWindow( this,ScResId( STR_QHLP_SCEN_LISTBOX), ScResId(STR_QHLP_SCEN_COMMENT)) ),
- aLbDocuments( new ScDocListBox( this, ScResId( LB_DOCUMENTS ) ) ),
+ aFtCol ( VclPtr<FixedInfo>::Create( this, ScResId( FT_COL ) ) ),
+ aEdCol ( VclPtr<ColumnEdit>::Create( this, ScResId( ED_COL ) ) ),
+ aFtRow ( VclPtr<FixedInfo>::Create( this, ScResId( FT_ROW ) ) ),
+ aEdRow ( VclPtr<RowEdit>::Create( this, ScResId( ED_ROW ) ) ),
+ aTbxCmd ( VclPtr<CommandToolBox>::Create( this, ScResId( TBX_CMD ) ) ),
+ aLbEntries ( VclPtr<ScContentTree>::Create( this, ScResId( LB_ENTRIES ) ) ),
+ aWndScenarios( VclPtr<ScScenarioWindow>::Create( this,ScResId( STR_QHLP_SCEN_LISTBOX), ScResId(STR_QHLP_SCEN_COMMENT)) ),
+ aLbDocuments( VclPtr<ScDocListBox>::Create( this, ScResId( LB_DOCUMENTS ) ) ),
aStrDragMode ( ScResId( STR_DRAGMODE ) ),
aStrDisplay ( ScResId( STR_DISPLAY ) ),
aStrActiveWin( ScResId( STR_ACTIVEWIN ) ),
diff --git a/sc/source/ui/navipi/scenwnd.cxx b/sc/source/ui/navipi/scenwnd.cxx
index 0ff6af496c4f..7791cfff9990 100644
--- a/sc/source/ui/navipi/scenwnd.cxx
+++ b/sc/source/ui/navipi/scenwnd.cxx
@@ -197,8 +197,8 @@ void ScScenarioListBox::DeleteScenario( bool bQueryBox )
ScScenarioWindow::ScScenarioWindow( vcl::Window* pParent, const OUString& aQH_List,
const OUString& aQH_Comment)
: Window ( pParent, WB_TABSTOP | WB_DIALOGCONTROL ),
- aLbScenario ( new ScScenarioListBox(*this) ),
- aEdComment ( new MultiLineEdit(this, WB_BORDER | WB_LEFT | WB_READONLY | WB_VSCROLL | WB_TABSTOP) )
+ aLbScenario ( VclPtr<ScScenarioListBox>::Create(*this) ),
+ aEdComment ( VclPtr<MultiLineEdit>::Create(this, WB_BORDER | WB_LEFT | WB_READONLY | WB_VSCROLL | WB_TABSTOP) )
{
vcl::Font aFont( GetFont() );
aFont.SetTransparent( true );
diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
index c9d7d4af0a01..d1da58a3cd47 100644
--- a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
+++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
@@ -238,10 +238,8 @@ VclPtr<vcl::Window> AlignmentPropertyPanel::Create (
if (pBindings == NULL)
throw lang::IllegalArgumentException("no SfxBindings given to AlignmentPropertyPanel::Create", NULL, 2);
- return VclPtr<vcl::Window>(
- new AlignmentPropertyPanel(
- pParent, rxFrame, pBindings),
- SAL_NO_ACQUIRE);
+ return VclPtr<AlignmentPropertyPanel>::Create(
+ pParent, rxFrame, pBindings);
}
void AlignmentPropertyPanel::DataChanged(
diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx
index 207b11007c99..dab38a72a3ef 100644
--- a/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx
+++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx
@@ -58,6 +58,11 @@ public:
SfxBindings* GetBindings() { return mpBindings;}
+ // constructor/destuctor
+ AlignmentPropertyPanel(
+ vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ SfxBindings* pBindings);
virtual ~AlignmentPropertyPanel();
virtual void dispose() SAL_OVERRIDE;
@@ -93,12 +98,6 @@ private:
DECL_LINK( RotationHdl, void * );
DECL_LINK( ClickStackHdl, void * );
- // constructor/destuctor
- AlignmentPropertyPanel(
- vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings);
-
void Initialize();
void FormatDegrees(double& dTmp);
};
diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
index 5dae73bd710d..b31083883552 100644
--- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
+++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
@@ -255,10 +255,8 @@ VclPtr<vcl::Window> CellAppearancePropertyPanel::Create (
if (pBindings == NULL)
throw lang::IllegalArgumentException("no SfxBindings given to CellAppearancePropertyPanel::Create", NULL, 2);
- return VclPtr<vcl::Window>(
- new CellAppearancePropertyPanel(
- pParent, rxFrame, pBindings),
- SAL_NO_ACQUIRE);
+ return VclPtr<CellAppearancePropertyPanel>::Create(
+ pParent, rxFrame, pBindings);
}
void CellAppearancePropertyPanel::DataChanged(
diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
index 8bdf1b4903ba..816db4d7b18c 100644
--- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
+++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
@@ -69,6 +69,11 @@ public:
SfxBindings* GetBindings() { return mpBindings;}
+ // constructor/destuctor
+ CellAppearancePropertyPanel(
+ vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ SfxBindings* pBindings);
virtual ~CellAppearancePropertyPanel();
virtual void dispose() SAL_OVERRIDE;
@@ -148,12 +153,6 @@ private:
svx::sidebar::PopupControl* CreateCellBorderStylePopupControl(svx::sidebar::PopupContainer* pParent);
void EndCellBorderStylePopupMode(void);
- // constructor/destuctor
- CellAppearancePropertyPanel(
- vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings);
-
void Initialize();
void SetStyleIcon();
void UpdateControlState();
diff --git a/sc/source/ui/sidebar/CellBorderStyleControl.cxx b/sc/source/ui/sidebar/CellBorderStyleControl.cxx
index 9b981096dfee..4f8a467bc359 100644
--- a/sc/source/ui/sidebar/CellBorderStyleControl.cxx
+++ b/sc/source/ui/sidebar/CellBorderStyleControl.cxx
@@ -45,11 +45,11 @@ namespace sc { namespace sidebar {
CellBorderStyleControl::CellBorderStyleControl(vcl::Window* pParent, CellAppearancePropertyPanel& rPanel)
: svx::sidebar::PopupControl(pParent, ScResId(RID_POPUPPANEL_APPEARANCE_CELL_BORDERSTYLE)),
mrCellAppearancePropertyPanel(rPanel),
- maTBBorder1(new ToolBox(this, ScResId(TB_BORDER1))),
- maTBBorder2(new ToolBox(this, ScResId(TB_BORDER2))),
- maTBBorder3(new ToolBox(this, ScResId(TB_BORDER3))),
- maFL1(new FixedLine(this, ScResId(FL_1))),
- maFL2(new FixedLine(this, ScResId(FL_2))),
+ maTBBorder1(VclPtr<ToolBox>::Create(this, ScResId(TB_BORDER1))),
+ maTBBorder2(VclPtr<ToolBox>::Create(this, ScResId(TB_BORDER2))),
+ maTBBorder3(VclPtr<ToolBox>::Create(this, ScResId(TB_BORDER3))),
+ maFL1(VclPtr<FixedLine>::Create(this, ScResId(FL_1))),
+ maFL2(VclPtr<FixedLine>::Create(this, ScResId(FL_2))),
mpImageList(0)
{
Initialize();
diff --git a/sc/source/ui/sidebar/CellLineStyleControl.cxx b/sc/source/ui/sidebar/CellLineStyleControl.cxx
index 818616275ae6..0528df76bc98 100644
--- a/sc/source/ui/sidebar/CellLineStyleControl.cxx
+++ b/sc/source/ui/sidebar/CellLineStyleControl.cxx
@@ -36,8 +36,8 @@ namespace sc { namespace sidebar {
CellLineStyleControl::CellLineStyleControl(vcl::Window* pParent, CellAppearancePropertyPanel& rPanel)
: svx::sidebar::PopupControl(pParent, ScResId(RID_POPUPPANEL_APPEARANCE_CELL_LINESTYLE)),
mrCellAppearancePropertyPanel(rPanel),
- maPushButtonMoreOptions(new PushButton(this, ScResId(PB_OPTIONS))),
- maCellLineStyleValueSet(new sc::sidebar::CellLineStyleValueSet(this, ScResId(VS_STYLE))),
+ maPushButtonMoreOptions(VclPtr<PushButton>::Create(this, ScResId(PB_OPTIONS))),
+ maCellLineStyleValueSet(VclPtr<sc::sidebar::CellLineStyleValueSet>::Create(this, ScResId(VS_STYLE))),
mbVSfocus(true)
{
Initialize();
diff --git a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
index 035b65bb1b55..3d59a6dfce51 100644
--- a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
+++ b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
@@ -194,10 +194,8 @@ VclPtr<vcl::Window> NumberFormatPropertyPanel::Create (
if (pBindings == NULL)
throw lang::IllegalArgumentException("no SfxBindings given to NumberFormatPropertyPanel::Create", NULL, 2);
- return VclPtr<vcl::Window>(
- new NumberFormatPropertyPanel(
- pParent, rxFrame, pBindings),
- SAL_NO_ACQUIRE);
+ return VclPtr<NumberFormatPropertyPanel>::Create(
+ pParent, rxFrame, pBindings);
}
void NumberFormatPropertyPanel::DataChanged(
diff --git a/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx b/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx
index ded7589db291..9a162beaf1b5 100644
--- a/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx
+++ b/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx
@@ -56,6 +56,11 @@ public:
SfxBindings* GetBindings() { return mpBindings;}
+ // constructor/destuctor
+ NumberFormatPropertyPanel(
+ vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ SfxBindings* pBindings);
virtual ~NumberFormatPropertyPanel();
virtual void dispose() SAL_OVERRIDE;
private:
@@ -80,12 +85,6 @@ private:
DECL_LINK(NumFormatSelectHdl, ListBox*);
DECL_LINK(NumFormatValueHdl, void*);
- // constructor/destuctor
- NumberFormatPropertyPanel(
- vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings);
-
void Initialize();
};
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;