[Libreoffice-commits] .: Branch 'libreoffice-3-4' - sd/source

Petr Mladek pmladek at kemper.freedesktop.org
Thu Apr 28 09:38:52 PDT 2011


 sd/source/ui/unoidl/unomodel.cxx |  149 +++++++++++++++++++++------------------
 1 file changed, 81 insertions(+), 68 deletions(-)

New commits:
commit 511f5bff6fe86a28b8bb2081bc7ed9130f52a86f
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Thu Apr 28 18:37:45 2011 +0200

    pdf-link-export-fix.diff: (bnc#598816, bnc#639278)
    
    In some cases when exporting a PDF from a presentation, we are asked
    to export an empty "link annotation", which gets turned into a
    rather bogus file: link to the directory the presentadion document
    is in.  Just don't bother handling such empty "link annotations".

diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 78eb0d8..76daa5d 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -1942,7 +1942,9 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
                                     // if necessary, the master page interactions will be exported first
                                     sal_Bool bIsBackgroundObjectsVisible = sal_False;	// #i39428# IsBackgroundObjectsVisible not available for Draw
                                     const rtl::OUString sIsBackgroundObjectsVisible( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundObjectsVisible" ) );
-                                    if ( mbImpressDoc && ( xPagePropSet->getPropertyValue( sIsBackgroundObjectsVisible ) >>= bIsBackgroundObjectsVisible ) && bIsBackgroundObjectsVisible )
+                                    if ( xPagePropSet->getPropertySetInfo( )->hasPropertyByName( sIsBackgroundObjectsVisible ) )
+                                        xPagePropSet->getPropertyValue( sIsBackgroundObjectsVisible ) >>= bIsBackgroundObjectsVisible;
+                                    if ( mbImpressDoc && bIsBackgroundObjectsVisible )
                                     {
                                         uno::Reference< drawing::XMasterPageTarget > xMasterPageTarget( xPage, uno::UNO_QUERY );
                                         if ( xMasterPageTarget.is() )
@@ -1981,82 +1983,93 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
                                         const rtl::OUString sSpeed ( RTL_CONSTASCII_USTRINGPARAM( "Speed" ) );
                                         sal_Int32 nTime = 800;
                                         presentation::AnimationSpeed aAs;
-                                        aAny = xPagePropSet->getPropertyValue( sSpeed );
-                                        if ( aAny >>= aAs )
+                                        if ( xPagePropSet->getPropertySetInfo( )->hasPropertyByName( sSpeed ) )
                                         {
-                                            switch( aAs )
+                                            aAny = xPagePropSet->getPropertyValue( sSpeed );
+                                            if ( aAny >>= aAs )
                                             {
-                                                case presentation::AnimationSpeed_SLOW : nTime = 1500; break;
-                                                case presentation::AnimationSpeed_FAST : nTime = 300; break;
-                                                default:
-                                                case presentation::AnimationSpeed_MEDIUM : nTime = 800;
+                                                switch( aAs )
+                                                {
+                                                    case presentation::AnimationSpeed_SLOW : nTime = 1500; break;
+                                                    case presentation::AnimationSpeed_FAST : nTime = 300; break;
+                                                    default:
+                                                    case presentation::AnimationSpeed_MEDIUM : nTime = 800;
+                                                }
                                             }
                                         }
                                         presentation::FadeEffect eFe;
-                                        aAny = xPagePropSet->getPropertyValue( sEffect );
                                         vcl::PDFWriter::PageTransition eType = vcl::PDFWriter::Regular;
-                                        if ( aAny >>= eFe )
+                                        if ( xPagePropSet->getPropertySetInfo( )->hasPropertyByName( sEffect ) )
                                         {
-                                            switch( eFe )
+                                            aAny = xPagePropSet->getPropertyValue( sEffect );
+                                            if ( aAny >>= eFe )
                                             {
-                                                case presentation::FadeEffect_HORIZONTAL_LINES :
-                                                case presentation::FadeEffect_HORIZONTAL_CHECKERBOARD :
-                                                case presentation::FadeEffect_HORIZONTAL_STRIPES : eType = vcl::PDFWriter::BlindsHorizontal; break;
-
-                                                case presentation::FadeEffect_VERTICAL_LINES :
-                                                case presentation::FadeEffect_VERTICAL_CHECKERBOARD :
-                                                case presentation::FadeEffect_VERTICAL_STRIPES : eType = vcl::PDFWriter::BlindsVertical; break;
-
-                                                case presentation::FadeEffect_UNCOVER_TO_RIGHT :
-                                                case presentation::FadeEffect_UNCOVER_TO_UPPERRIGHT :
-                                                case presentation::FadeEffect_ROLL_FROM_LEFT :
-                                                case presentation::FadeEffect_FADE_FROM_UPPERLEFT :
-                                                case presentation::FadeEffect_MOVE_FROM_UPPERLEFT :
-                                                case presentation::FadeEffect_FADE_FROM_LEFT :
-                                                case presentation::FadeEffect_MOVE_FROM_LEFT : eType = vcl::PDFWriter::WipeLeftToRight; break;
-
-                                                case presentation::FadeEffect_UNCOVER_TO_BOTTOM :
-                                                case presentation::FadeEffect_UNCOVER_TO_LOWERRIGHT :
-                                                case presentation::FadeEffect_ROLL_FROM_TOP :
-                                                case presentation::FadeEffect_FADE_FROM_UPPERRIGHT :
-                                                case presentation::FadeEffect_MOVE_FROM_UPPERRIGHT :
-                                                case presentation::FadeEffect_FADE_FROM_TOP :
-                                                case presentation::FadeEffect_MOVE_FROM_TOP : eType = vcl::PDFWriter::WipeTopToBottom; break;
-
-                                                case presentation::FadeEffect_UNCOVER_TO_LEFT :
-                                                case presentation::FadeEffect_UNCOVER_TO_LOWERLEFT :
-                                                case presentation::FadeEffect_ROLL_FROM_RIGHT :
-
-                                                case presentation::FadeEffect_FADE_FROM_LOWERRIGHT :
-                                                case presentation::FadeEffect_MOVE_FROM_LOWERRIGHT :
-                                                case presentation::FadeEffect_FADE_FROM_RIGHT :
-                                                case presentation::FadeEffect_MOVE_FROM_RIGHT : eType = vcl::PDFWriter::WipeRightToLeft; break;
-
-                                                case presentation::FadeEffect_UNCOVER_TO_TOP :
-                                                case presentation::FadeEffect_UNCOVER_TO_UPPERLEFT :
-                                                case presentation::FadeEffect_ROLL_FROM_BOTTOM :
-                                                case presentation::FadeEffect_FADE_FROM_LOWERLEFT :
-                                                case presentation::FadeEffect_MOVE_FROM_LOWERLEFT :
-                                                case presentation::FadeEffect_FADE_FROM_BOTTOM :
-                                                case presentation::FadeEffect_MOVE_FROM_BOTTOM : eType = vcl::PDFWriter::WipeBottomToTop; break;
-
-                                                case presentation::FadeEffect_OPEN_VERTICAL : eType = vcl::PDFWriter::SplitHorizontalInward; break;
-                                                case presentation::FadeEffect_CLOSE_HORIZONTAL : eType = vcl::PDFWriter::SplitHorizontalOutward; break;
-
-                                                case presentation::FadeEffect_OPEN_HORIZONTAL : eType = vcl::PDFWriter::SplitVerticalInward; break;
-                                                case presentation::FadeEffect_CLOSE_VERTICAL : eType = vcl::PDFWriter::SplitVerticalOutward; break;
-
-                                                case presentation::FadeEffect_FADE_TO_CENTER : eType = vcl::PDFWriter::BoxInward; break;
-                                                case presentation::FadeEffect_FADE_FROM_CENTER : eType = vcl::PDFWriter::BoxOutward; break;
-
-                                                case presentation::FadeEffect_NONE : eType = vcl::PDFWriter::Regular; break;
-
-                                                case presentation::FadeEffect_RANDOM :
-                                                case presentation::FadeEffect_DISSOLVE :
-                                                default: eType = vcl::PDFWriter::Dissolve; break;
+                                                switch( eFe )
+                                                {
+                                                    case presentation::FadeEffect_HORIZONTAL_LINES :
+                                                    case presentation::FadeEffect_HORIZONTAL_CHECKERBOARD :
+                                                    case presentation::FadeEffect_HORIZONTAL_STRIPES : eType = vcl::PDFWriter::BlindsHorizontal; break;
+
+                                                    case presentation::FadeEffect_VERTICAL_LINES :
+                                                    case presentation::FadeEffect_VERTICAL_CHECKERBOARD :
+                                                    case presentation::FadeEffect_VERTICAL_STRIPES : eType = vcl::PDFWriter::BlindsVertical; break;
+
+                                                    case presentation::FadeEffect_UNCOVER_TO_RIGHT :
+                                                    case presentation::FadeEffect_UNCOVER_TO_UPPERRIGHT :
+                                                    case presentation::FadeEffect_ROLL_FROM_LEFT :
+                                                    case presentation::FadeEffect_FADE_FROM_UPPERLEFT :
+                                                    case presentation::FadeEffect_MOVE_FROM_UPPERLEFT :
+                                                    case presentation::FadeEffect_FADE_FROM_LEFT :
+                                                    case presentation::FadeEffect_MOVE_FROM_LEFT : eType = vcl::PDFWriter::WipeLeftToRight; break;
+
+                                                    case presentation::FadeEffect_UNCOVER_TO_BOTTOM :
+                                                    case presentation::FadeEffect_UNCOVER_TO_LOWERRIGHT :
+                                                    case presentation::FadeEffect_ROLL_FROM_TOP :
+                                                    case presentation::FadeEffect_FADE_FROM_UPPERRIGHT :
+                                                    case presentation::FadeEffect_MOVE_FROM_UPPERRIGHT :
+                                                    case presentation::FadeEffect_FADE_FROM_TOP :
+                                                    case presentation::FadeEffect_MOVE_FROM_TOP : eType = vcl::PDFWriter::WipeTopToBottom; break;
+
+                                                    case presentation::FadeEffect_UNCOVER_TO_LEFT :
+                                                    case presentation::FadeEffect_UNCOVER_TO_LOWERLEFT :
+                                                    case presentation::FadeEffect_ROLL_FROM_RIGHT :
+
+                                                    case presentation::FadeEffect_FADE_FROM_LOWERRIGHT :
+                                                    case presentation::FadeEffect_MOVE_FROM_LOWERRIGHT :
+                                                    case presentation::FadeEffect_FADE_FROM_RIGHT :
+                                                    case presentation::FadeEffect_MOVE_FROM_RIGHT : eType = vcl::PDFWriter::WipeRightToLeft; break;
+
+                                                    case presentation::FadeEffect_UNCOVER_TO_TOP :
+                                                    case presentation::FadeEffect_UNCOVER_TO_UPPERLEFT :
+                                                    case presentation::FadeEffect_ROLL_FROM_BOTTOM :
+                                                    case presentation::FadeEffect_FADE_FROM_LOWERLEFT :
+                                                    case presentation::FadeEffect_MOVE_FROM_LOWERLEFT :
+                                                    case presentation::FadeEffect_FADE_FROM_BOTTOM :
+                                                    case presentation::FadeEffect_MOVE_FROM_BOTTOM : eType = vcl::PDFWriter::WipeBottomToTop; break;
+
+                                                    case presentation::FadeEffect_OPEN_VERTICAL : eType = vcl::PDFWriter::SplitHorizontalInward; break;
+                                                    case presentation::FadeEffect_CLOSE_HORIZONTAL : eType = vcl::PDFWriter::SplitHorizontalOutward; break;
+
+                                                    case presentation::FadeEffect_OPEN_HORIZONTAL : eType = vcl::PDFWriter::SplitVerticalInward; break;
+                                                    case presentation::FadeEffect_CLOSE_VERTICAL : eType = vcl::PDFWriter::SplitVerticalOutward; break;
+
+                                                    case presentation::FadeEffect_FADE_TO_CENTER : eType = vcl::PDFWriter::BoxInward; break;
+                                                    case presentation::FadeEffect_FADE_FROM_CENTER : eType = vcl::PDFWriter::BoxOutward; break;
+
+                                                    case presentation::FadeEffect_NONE : eType = vcl::PDFWriter::Regular; break;
+
+                                                    case presentation::FadeEffect_RANDOM :
+                                                    case presentation::FadeEffect_DISSOLVE :
+                                                    default: eType = vcl::PDFWriter::Dissolve; break;
+                                                }
                                             }
                                         }
-                                        pPDFExtOutDevData->SetPageTransition( eType, nTime, -1 );
+
+                                        if ( xPagePropSet->getPropertySetInfo( )->hasPropertyByName( sEffect ) ||
+                                             xPagePropSet->getPropertySetInfo( )->hasPropertyByName( sSpeed ) )
+                                        {
+                                             pPDFExtOutDevData->SetPageTransition( eType, nTime, -1 );
+                                        }
                                     }
                                 }
                             }
@@ -2103,7 +2116,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r
                             }
                             //<--- #i56629, #i40318
                         }
-                        catch( uno::Exception& )
+                        catch( uno::Exception& e )
                         {
                         }
 


More information about the Libreoffice-commits mailing list