diff options
author | David Tardon <dtardon@redhat.com> | 2014-06-12 12:10:33 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-06-12 13:12:06 +0000 |
commit | 15a4ad716c169f8502a4156238a3e79a9d7b7319 (patch) | |
tree | 3106ca73f47760fcf32884f7e6edc9f560565f10 | |
parent | fab363401c0fc8c527cfad6a884b73391773077a (diff) |
fdo#79883 the page view object contact must exist
Change-Id: I5c6bd3ea267f1ea84b46e46aa508a27d00903347
(cherry picked from commit 551c915dcbf3e1d6bfd799c6e13e5700e2c3e535)
Reviewed-on: https://gerrit.libreoffice.org/9747
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-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 ); |