[Libreoffice-commits] .: sw/source
Caolán McNamara
caolan at kemper.freedesktop.org
Wed Oct 13 02:19:48 PDT 2010
sw/source/ui/uiview/viewprt.cxx | 34 ++++++++++++++++++----------------
1 file changed, 18 insertions(+), 16 deletions(-)
New commits:
commit d3d71f2f31c20081c09244ee75a31492d36bb201
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Oct 13 09:43:03 2010 +0100
tidy this, cause it bothers me
diff --git a/sw/source/ui/uiview/viewprt.cxx b/sw/source/ui/uiview/viewprt.cxx
index 6006c82..8cbd7d4 100644
--- a/sw/source/ui/uiview/viewprt.cxx
+++ b/sw/source/ui/uiview/viewprt.cxx
@@ -306,23 +306,25 @@ void __EXPORT SwView::ExecutePrint(SfxRequest& rReq)
SfxTabPage* CreatePrintOptionsPage( Window *pParent,
const SfxItemSet &rOptions, BOOL bPreview )
{
- SfxTabPage* pPage = NULL;
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- 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);
- }
+ OSL_ENSURE(pFact, "No Print Dialog");
+ if (!pFact)
+ return NULL;
+
+ ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc(TP_OPTPRINT_PAGE);
+ OSL_ENSURE(pFact, "No Page Creator");
+ if (!fnCreatePage)
+ return NULL;
+
+ SfxTabPage* pPage = (*fnCreatePage)(pParent, rOptions);
+ OSL_ENSURE(pPage, "No page");
+ if (!pPage)
+ return NULL;
+
+ SfxAllItemSet aSet(*(rOptions.GetPool()));
+ aSet.Put(SfxBoolItem(SID_PREVIEWFLAG_TYPE, bPreview));
+ aSet.Put(SfxBoolItem(SID_FAX_LIST, sal_True));
+ pPage->PageCreated(aSet);
return pPage;
}
More information about the Libreoffice-commits
mailing list