summaryrefslogtreecommitdiff
path: root/starmath/source
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-04-16 20:31:36 +0100
committerMichael Meeks <michael.meeks@collabora.com>2015-04-16 20:31:36 +0100
commit5be108ee578a4000ee77f2ccb9a2c2d5d2bcc39c (patch)
treec0cd05efba5c808fbca993a8c4c978b8dedbaa1f /starmath/source
parent16f7f5899bddc32ddfdf3b0e23faee528883e36c (diff)
starmath: convert new to ::Create to get initial ref-counting right.
Change-Id: I4382f4a9cf74f87766c76412698b4031574b6107
Diffstat (limited to 'starmath/source')
-rw-r--r--starmath/source/ElementsDockingWindow.cxx8
-rw-r--r--starmath/source/dialog.cxx8
-rw-r--r--starmath/source/document.cxx2
-rw-r--r--starmath/source/edit.cxx6
-rw-r--r--starmath/source/toolbox.cxx4
-rw-r--r--starmath/source/view.cxx6
6 files changed, 17 insertions, 17 deletions
diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx
index 47e3afcebe59..bf284e78fd4a 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -223,7 +223,7 @@ SmElementsControl::SmElementsControl(vcl::Window *pParent)
, maCurrentSetId(0)
, mpCurrentElement(NULL)
, mbVerticalMode(true)
- , mxScroll(new ScrollBar(this, WB_VERT))
+ , mxScroll(VclPtr<ScrollBar>::Create(this, WB_VERT))
{
SetMapMode( MapMode(MAP_100TH_MM) );
SetDrawMode( DRAWMODE_DEFAULT );
@@ -652,7 +652,7 @@ SmElementsDockingWindow::SmElementsDockingWindow(SfxBindings* pInputBindings, Sf
SfxDockingWindow(pInputBindings, pChildWindow, pParent, "DockingElements",
"modules/smath/ui/dockingelements.ui")
{
- mpElementsControl = new SmElementsControl(get<vcl::Window>("box"));
+ mpElementsControl = VclPtr<SmElementsControl>::Create(get<vcl::Window>("box"));
mpElementsControl->set_hexpand(true);
mpElementsControl->set_vexpand(true);
mpElementsControl->Show();
@@ -768,8 +768,8 @@ SmElementsDockingWindowWrapper::SmElementsDockingWindowWrapper(
SfxBindings *pBindings, SfxChildWinInfo *pInfo) :
SfxChildWindow(pParentWindow, nId)
{
- SmElementsDockingWindow* pDialog = new SmElementsDockingWindow(pBindings, this, pParentWindow);
- pWindow = pDialog;
+ VclPtrInstance<SmElementsDockingWindow> pDialog(pBindings, this, pParentWindow);
+ pWindow.reset(pDialog);
pDialog->setDeferredProperties();
pDialog->SetPosSizePixel(Point(0, 0), Size(300, 0));
pDialog->Show();
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index bf77a54c5f13..a78f528978ef 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -239,9 +239,9 @@ void SmPrintOptionsTabPage::Reset(const SfxItemSet* rSet)
}
-SfxTabPage* SmPrintOptionsTabPage::Create(vcl::Window* pWindow, const SfxItemSet& rSet)
+VclPtr<SfxTabPage> SmPrintOptionsTabPage::Create(vcl::Window* pWindow, const SfxItemSet& rSet)
{
- return (new SmPrintOptionsTabPage(pWindow, rSet));
+ return VclPtr<SmPrintOptionsTabPage>::Create(pWindow, rSet).get();
}
/**************************************************************************/
@@ -1294,8 +1294,8 @@ void SmShowSymbolSetWindow::setScrollbar(ScrollBar *pVScrollBar)
SmShowSymbolSet::SmShowSymbolSet(vcl::Window *pParent)
: VclHBox(pParent, false, 6)
- , aSymbolWindow(new SmShowSymbolSetWindow(this, WB_TABSTOP))
- , aVScrollBar(new ScrollBar(this, WinBits(WB_VSCROLL)))
+ , aSymbolWindow(VclPtr<SmShowSymbolSetWindow>::Create(this, WB_TABSTOP))
+ , aVScrollBar(VclPtr<ScrollBar>::Create(this, WinBits(WB_VSCROLL)))
{
aSymbolWindow->set_hexpand(true);
aSymbolWindow->set_vexpand(true);
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index 14276a84333f..a845fe69c0b7 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -595,7 +595,7 @@ Printer* SmDocShell::GetPrt()
SmModule *pp = SM_MOD();
pp->GetConfig()->ConfigToItemSet(*pOptions);
- pPrinter = new SfxPrinter(pOptions);
+ pPrinter = VclPtr<SfxPrinter>::Create(pOptions);
pPrinter->SetMapMode( MapMode(MAP_100TH_MM) );
}
return pPrinter;
diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index 890c1b1c967f..e2ee67aa7b70 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -551,11 +551,11 @@ void SmEditWindow::CreateEditView()
pEditEngine->InsertView( pEditView );
if (!pVScrollBar)
- pVScrollBar = new ScrollBar(this, WinBits(WB_VSCROLL));
+ pVScrollBar = VclPtr<ScrollBar>::Create(this, WinBits(WB_VSCROLL));
if (!pHScrollBar)
- pHScrollBar = new ScrollBar(this, WinBits(WB_HSCROLL));
+ pHScrollBar = VclPtr<ScrollBar>::Create(this, WinBits(WB_HSCROLL));
if (!pScrollBox)
- pScrollBox = new ScrollBarBox(this);
+ pScrollBox = VclPtr<ScrollBarBox>::Create(this);
pVScrollBar->SetScrollHdl(LINK(this, SmEditWindow, ScrollHdl));
pHScrollBar->SetScrollHdl(LINK(this, SmEditWindow, ScrollHdl));
pVScrollBar->EnableDrag( true );
diff --git a/starmath/source/toolbox.cxx b/starmath/source/toolbox.cxx
index c716a12633a4..26a1fbe7db23 100644
--- a/starmath/source/toolbox.cxx
+++ b/starmath/source/toolbox.cxx
@@ -127,7 +127,7 @@ SmToolBoxWindow::SmToolBoxWindow(SfxBindings *pTmpBindings,
sal_uInt16 i;
for (i = 0; i < NUM_TBX_CATEGORIES; ++i)
{
- ToolBox *pBox = new ToolBox(get<vcl::Window>("box"), SmResId( TOOLBOX_CAT_A + i ));
+ VclPtrInstance<ToolBox> pBox(get<vcl::Window>("box"), SmResId( TOOLBOX_CAT_A + i ));
vToolBoxCategories[i] = pBox;
pBox->SetSelectHdl(LINK(this, SmToolBoxWindow, CmdSelectHdl));
}
@@ -361,7 +361,7 @@ SmToolBoxWrapper::SmToolBoxWrapper(vcl::Window *pParentWindow,
{
eChildAlignment = SfxChildAlignment::NOALIGNMENT;
- pWindow = new SmToolBoxWindow(pBindings, this, pParentWindow);
+ pWindow.reset(VclPtr<SmToolBoxWindow>::Create(pBindings, this, pParentWindow));
static_cast<SfxFloatingWindow *>(pWindow.get())->Initialize(pInfo);
}
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 1e602de7b5db..7ad1fef5ac5f 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -712,7 +712,7 @@ void SmEditController::StateChanged(sal_uInt16 nSID, SfxItemState eState, const
SmCmdBoxWindow::SmCmdBoxWindow(SfxBindings *pBindings_, SfxChildWindow *pChildWindow,
vcl::Window *pParent) :
SfxDockingWindow(pBindings_, pChildWindow, pParent, WB_MOVEABLE|WB_CLOSEABLE|WB_SIZEABLE|WB_DOCKABLE),
- aEdit (new SmEditWindow(*this)),
+ aEdit (VclPtr<SmEditWindow>::Create(*this)),
aController (*(aEdit.get()), SID_TEXT, *pBindings_),
bExiting (false)
{
@@ -902,7 +902,7 @@ SmCmdBoxWrapper::SmCmdBoxWrapper(vcl::Window *pParentWindow, sal_uInt16 nId,
SfxChildWinInfo *pInfo) :
SfxChildWindow(pParentWindow, nId)
{
- pWindow = new SmCmdBoxWindow(pBindings, this, pParentWindow);
+ pWindow.reset(VclPtr<SmCmdBoxWindow>::Create(pBindings, this, pParentWindow));
// make window docked to the bottom initially (after first start)
eChildAlignment = SfxChildAlignment::BOTTOM;
@@ -1953,7 +1953,7 @@ void SmViewShell::GetState(SfxItemSet &rSet)
SmViewShell::SmViewShell(SfxViewFrame *pFrame_, SfxViewShell *)
: SfxViewShell(pFrame_, SFX_VIEW_HAS_PRINTOPTIONS | SFX_VIEW_CAN_PRINT)
, pImpl(new SmViewShell_Impl)
- , aGraphic(new SmGraphicWindow(this))
+ , aGraphic(VclPtr<SmGraphicWindow>::Create(this))
, aGraphicController(*aGraphic.get(), SID_GAPHIC_SM, pFrame_->GetBindings())
, bPasteState(false)
, bInsertIntoEditWindow(false)