diff options
-rw-r--r-- | svx/source/sdr/contact/viewcontactofunocontrol.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/svx/source/sdr/contact/viewcontactofunocontrol.cxx b/svx/source/sdr/contact/viewcontactofunocontrol.cxx index 08f11004e96a..98b4243a53cb 100644 --- a/svx/source/sdr/contact/viewcontactofunocontrol.cxx +++ b/svx/source/sdr/contact/viewcontactofunocontrol.cxx @@ -106,10 +106,13 @@ namespace sdr { namespace contact { { // print or print preview requires special handling const OutputDevice* pDevice = _rObjectContact.TryToGetOutputDevice(); - bool bPrintOrPreview = ( pDevice != NULL ) && ( pDevice->GetOutDevType() == OUTDEV_PRINTER ); + ObjectContactOfPageView* const pPageViewContact = dynamic_cast< ObjectContactOfPageView* >( &_rObjectContact ); - ObjectContactOfPageView* pPageViewContact = dynamic_cast< ObjectContactOfPageView* >( &_rObjectContact ); - bPrintOrPreview |= ( pPageViewContact != NULL ) && pPageViewContact->GetPageWindow().GetPageView().GetView().IsPrintPreview(); + const bool bPrintOrPreview = pPageViewContact + && ( ( ( pDevice != NULL ) && ( pDevice->GetOutDevType() == OUTDEV_PRINTER ) ) + || pPageViewContact->GetPageWindow().GetPageView().GetView().IsPrintPreview() + ) + ; if ( bPrintOrPreview ) return *new UnoControlPrintOrPreviewContact( *pPageViewContact, *this ); |