svx/source/sdr/contact/viewcontactofunocontrol.cxx |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 15a4ad716c169f8502a4156238a3e79a9d7b7319
Author: David Tardon <dtar...@redhat.com>
Date:   Thu Jun 12 12:10:33 2014 +0200

    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 <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/svx/source/sdr/contact/viewcontactofunocontrol.cxx 
b/svx/source/sdr/contact/viewcontactofunocontrol.cxx
index 08f1100..98b4243 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 );
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to