diff options
author | Noel Power <noel.power@novell.com> | 2010-10-04 15:08:54 +0100 |
---|---|---|
committer | Noel Power <noel.power@novell.com> | 2010-10-04 15:08:54 +0100 |
commit | a2486209b950544c8db3650521d0c9689744f3b8 (patch) | |
tree | 5637098916ad47aa5d88abc948a84c023731a99c | |
parent | 8b072fd99db5f6ca0f0b3adf9acfebddd3c47854 (diff) |
ok, lets assert and code defensively
-rw-r--r-- | sw/source/ui/uiview/viewprt.cxx | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/sw/source/ui/uiview/viewprt.cxx b/sw/source/ui/uiview/viewprt.cxx index 0f7aabd130..6c8825a467 100644 --- a/sw/source/ui/uiview/viewprt.cxx +++ b/sw/source/ui/uiview/viewprt.cxx @@ -321,13 +321,23 @@ void __EXPORT SwView::ExecutePrint(SfxRequest& rReq) SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions, BOOL bPreview ) { + SfxTabPage* pPage = NULL; SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( TP_OPTPRINT_PAGE ); - SfxTabPage* pPage = (*fnCreatePage)( pParent, rOptions ); - SfxAllItemSet aSet(*(rOptions.GetPool())); - aSet.Put (SfxBoolItem(SID_PREVIEWFLAG_TYPE, bPreview)); - aSet.Put (SfxBoolItem(SID_FAX_LIST, sal_True)); - pPage->PageCreated(aSet); + DBG_ASSERT( pFac, "No Print Dialog" ); + if ( pFact ) + { + ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( TP_OPTPRINT_PAGE ); + pPage = (*fnCreatePage)( pParent, rOptions ); + } + + DBG_ASSERT( pPage, "No page" ); + if ( pPage ) + { + SfxAllItemSet aSet(*(rOptions.GetPool())); + aSet.Put (SfxBoolItem(SID_PREVIEWFLAG_TYPE, bPreview)); + aSet.Put (SfxBoolItem(SID_FAX_LIST, sal_True)); + pPage->PageCreated(aSet); + } return pPage; } |