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 /sc/source/ui | |
parent | 5be108ee578a4000ee77f2ccb9a2c2d5d2bcc39c (diff) |
make CreatePrinterOptionsPage returns a VclPtr<>.
Change-Id: Iaa7814573b48b6c9ed10426b992c944393b23332
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/inc/prevwsh.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/inc/tabvwsh.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/prevwsh.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsh4.cxx | 7 |
4 files changed, 11 insertions, 9 deletions
diff --git a/sc/source/ui/inc/prevwsh.hxx b/sc/source/ui/inc/prevwsh.hxx index 66c041f8841a..fd49a0f09205 100644 --- a/sc/source/ui/inc/prevwsh.hxx +++ b/sc/source/ui/inc/prevwsh.hxx @@ -109,7 +109,7 @@ public: virtual SfxPrinter* GetPrinter( bool bCreate = false ) SAL_OVERRIDE; virtual sal_uInt16 SetPrinter( SfxPrinter* pNewPrinter, SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false ) SAL_OVERRIDE; virtual bool HasPrintOptionsPage() const SAL_OVERRIDE; - virtual SfxTabPage* CreatePrintOptionsPage( vcl::Window *pParent, const SfxItemSet &rOptions ) SAL_OVERRIDE; + virtual VclPtr<SfxTabPage> CreatePrintOptionsPage( vcl::Window *pParent, const SfxItemSet &rOptions ) SAL_OVERRIDE; void AddAccessibilityObject( SfxListener& rObject ); void RemoveAccessibilityObject( SfxListener& rObject ); diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index 81e800450180..f411397db503 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -348,7 +348,7 @@ public: SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL, bool bIsApi=false ) SAL_OVERRIDE; virtual bool HasPrintOptionsPage() const SAL_OVERRIDE; - virtual SfxTabPage* CreatePrintOptionsPage( vcl::Window *pParent, const SfxItemSet &rOptions ) SAL_OVERRIDE; + virtual VclPtr<SfxTabPage> CreatePrintOptionsPage( vcl::Window *pParent, const SfxItemSet &rOptions ) SAL_OVERRIDE; void ConnectObject( SdrOle2Obj* pObj ); bool ActivateObject( SdrOle2Obj* pObj, long nVerb ); diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index 3ec7b481b88b..225b0038d23f 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -531,14 +531,15 @@ bool ScPreviewShell::HasPrintOptionsPage() const return true; } -SfxTabPage* ScPreviewShell::CreatePrintOptionsPage( vcl::Window *pParent, const SfxItemSet &rOptions ) +VclPtr<SfxTabPage> ScPreviewShell::CreatePrintOptionsPage( vcl::Window *pParent, const SfxItemSet &rOptions ) { ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - ::CreateTabPage ScTpPrintOptionsCreate = pFact->GetTabPageCreatorFunc( RID_SCPAGE_PRINT ); + ::CreateTabPage ScTpPrintOptionsCreate = pFact->GetTabPageCreatorFunc( RID_SCPAGE_PRINT ); if ( ScTpPrintOptionsCreate ) - return (*ScTpPrintOptionsCreate)( pParent, &rOptions); - return 0; + return VclPtr<SfxTabPage>((*ScTpPrintOptionsCreate)( pParent, &rOptions) + SAL_NO_ACQUIRE); + return VclPtr<SfxTabPage>(); } void ScPreviewShell::Activate(bool bMDI) diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index a90605d795a8..78dc752b89f4 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -1063,14 +1063,15 @@ bool ScTabViewShell::HasPrintOptionsPage() const return true; } -SfxTabPage* ScTabViewShell::CreatePrintOptionsPage( vcl::Window *pParent, const SfxItemSet &rOptions ) +VclPtr<SfxTabPage> ScTabViewShell::CreatePrintOptionsPage( vcl::Window *pParent, const SfxItemSet &rOptions ) { ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); ::CreateTabPage ScTpPrintOptionsCreate = pFact->GetTabPageCreatorFunc( RID_SCPAGE_PRINT ); if ( ScTpPrintOptionsCreate ) - return (*ScTpPrintOptionsCreate)( pParent, &rOptions); - return 0; + return VclPtr<SfxTabPage>((*ScTpPrintOptionsCreate)( pParent, &rOptions), + SAL_NO_ACQUIRE); + return VclPtr<SfxTabPage>(); } void ScTabViewShell::StopEditShell() |