diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-04-16 20:43:49 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-16 20:43:49 +0100 |
commit | f1879e200bf1ec60e4f56451e57517f6a42873eb (patch) | |
tree | ae66e7d446859a3f047aeba0ce65f16e2f83376c /sw | |
parent | 5be108ee578a4000ee77f2ccb9a2c2d5d2bcc39c (diff) |
make CreatePrinterOptionsPage returns a VclPtr<>.
Change-Id: Iaa7814573b48b6c9ed10426b992c944393b23332
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/inc/pview.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/inc/view.hxx | 8 | ||||
-rw-r--r-- | sw/source/uibase/uiview/pview.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewfunc.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewprt.cxx | 13 |
5 files changed, 16 insertions, 13 deletions
diff --git a/sw/source/uibase/inc/pview.hxx b/sw/source/uibase/inc/pview.hxx index 60668bfbeabc..c4b154ca2869 100644 --- a/sw/source/uibase/inc/pview.hxx +++ b/sw/source/uibase/inc/pview.hxx @@ -192,7 +192,7 @@ class SW_DLLPUBLIC SwPagePreview: public SfxViewShell SAL_DLLPRIVATE virtual SfxPrinter* GetPrinter( bool bCreate = false ) SAL_OVERRIDE; SAL_DLLPRIVATE virtual sal_uInt16 SetPrinter( SfxPrinter *pNewPrinter, SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false ) SAL_OVERRIDE; SAL_DLLPRIVATE virtual bool HasPrintOptionsPage() const SAL_OVERRIDE; - SAL_DLLPRIVATE virtual SfxTabPage* CreatePrintOptionsPage( vcl::Window *pParent, + SAL_DLLPRIVATE virtual VclPtr<SfxTabPage> CreatePrintOptionsPage( vcl::Window *pParent, const SfxItemSet &rOptions ) SAL_OVERRIDE; SAL_DLLPRIVATE void CalcAndSetBorderPixel( SvBorder &rToFill, bool bInner ); diff --git a/sw/source/uibase/inc/view.hxx b/sw/source/uibase/inc/view.hxx index c1a341eadce4..1e76ee5a3398 100644 --- a/sw/source/uibase/inc/view.hxx +++ b/sw/source/uibase/inc/view.hxx @@ -663,7 +663,7 @@ public: // methods for printing SAL_DLLPRIVATE virtual SfxPrinter* GetPrinter( bool bCreate = false ) SAL_OVERRIDE; SAL_DLLPRIVATE virtual bool HasPrintOptionsPage() const SAL_OVERRIDE; - SAL_DLLPRIVATE virtual SfxTabPage* CreatePrintOptionsPage( vcl::Window* pParent, + SAL_DLLPRIVATE virtual VclPtr<SfxTabPage> CreatePrintOptionsPage( vcl::Window* pParent, const SfxItemSet& rSet) SAL_OVERRIDE; }; @@ -682,9 +682,9 @@ inline const SwDocShell *SwView::GetDocShell() const return const_cast<SwView*>(this)->GetDocShell(); } -SfxTabPage* CreatePrintOptionsPage( vcl::Window *pParent, - const SfxItemSet &rOptions, - bool bPreview); +VclPtr<SfxTabPage> CreatePrintOptionsPage( vcl::Window *pParent, + const SfxItemSet &rOptions, + bool bPreview); #endif diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index ad29cdc9bb9c..de3d79d6ba3d 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -1709,8 +1709,8 @@ bool SwPagePreview::HasPrintOptionsPage() const return true; } -SfxTabPage* SwPagePreview::CreatePrintOptionsPage( vcl::Window *pParent, - const SfxItemSet &rOptions ) +VclPtr<SfxTabPage> SwPagePreview::CreatePrintOptionsPage( vcl::Window *pParent, + const SfxItemSet &rOptions ) { return ::CreatePrintOptionsPage( pParent, rOptions, !bNormalPrint ); } diff --git a/sw/source/uibase/uiview/viewfunc.hxx b/sw/source/uibase/uiview/viewfunc.hxx index 4102270a1999..c66822e95a26 100644 --- a/sw/source/uibase/uiview/viewfunc.hxx +++ b/sw/source/uibase/uiview/viewfunc.hxx @@ -33,7 +33,7 @@ namespace vcl { class Window; } // The following functions are available in viewprt.cxx void SetPrinter( IDocumentDeviceAccess*, SfxPrinter*, bool bWeb ); -SfxTabPage* CreatePrintOptionsPage( vcl::Window*, const SfxItemSet& ); +VclPtr<SfxTabPage> CreatePrintOptionsPage( vcl::Window*, const SfxItemSet& ); void SetAppPrintOptions( SwViewShell* pSh, bool bWeb ); // The following functions are available in viewport.cxx diff --git a/sw/source/uibase/uiview/viewprt.cxx b/sw/source/uibase/uiview/viewprt.cxx index 2309ea25209e..76cbdb39cdbe 100644 --- a/sw/source/uibase/uiview/viewprt.cxx +++ b/sw/source/uibase/uiview/viewprt.cxx @@ -147,8 +147,8 @@ bool SwView::HasPrintOptionsPage() const // TabPage for application-specific print options -SfxTabPage* SwView::CreatePrintOptionsPage(vcl::Window* pParent, - const SfxItemSet& rSet) +VclPtr<SfxTabPage> SwView::CreatePrintOptionsPage(vcl::Window* pParent, + const SfxItemSet& rSet) { return ::CreatePrintOptionsPage( pParent, rSet, false ); } @@ -245,8 +245,9 @@ void SwView::ExecutePrint(SfxRequest& rReq) // Create page printer/additions for SwView and SwPagePreview -SfxTabPage* CreatePrintOptionsPage( vcl::Window *pParent, - const SfxItemSet &rOptions, bool bPreview ) +VclPtr<SfxTabPage> CreatePrintOptionsPage( vcl::Window *pParent, + const SfxItemSet &rOptions, + bool bPreview ) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "No Print Dialog"); @@ -258,7 +259,9 @@ SfxTabPage* CreatePrintOptionsPage( vcl::Window *pParent, if (!fnCreatePage) return NULL; - SfxTabPage* pPage = (*fnCreatePage)(pParent, &rOptions); + VclPtr<SfxTabPage> pPage = + VclPtr<SfxTabPage>((*fnCreatePage)(pParent, &rOptions), + SAL_NO_ACQUIRE); OSL_ENSURE(pPage, "No page"); if (!pPage) return NULL; |