LCOV - code coverage report
Current view: top level - sd/source/filter/eppt - pptx-epptbase.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 464 0.0 %
Date: 2014-04-14 Functions: 0 25 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #include "eppt.hxx"
      21             : #include "epptdef.hxx"
      22             : 
      23             : #include <tools/globname.hxx>
      24             : #include <tools/datetime.hxx>
      25             : #include <tools/poly.hxx>
      26             : #include <tools/stream.hxx>
      27             : #include <vcl/graph.hxx>
      28             : #include <vcl/bmpacc.hxx>
      29             : #include <vcl/gradient.hxx>
      30             : #include <vcl/virdev.hxx>
      31             : #include <rtl/ustring.hxx>
      32             : #include <rtl/strbuf.hxx>
      33             : #include <vcl/fltcall.hxx>
      34             : #include <vcl/wmf.hxx>
      35             : #include <sfx2/docfile.hxx>
      36             : #include <sfx2/docinf.hxx>
      37             : #include <svx/unoapi.hxx>
      38             : #include <svx/svdobj.hxx>
      39             : #include <svx/svdoole2.hxx>
      40             : #include <svx/svdmodel.hxx>
      41             : #include <svx/svdpage.hxx>
      42             : #include <com/sun/star/view/PaperOrientation.hpp>
      43             : #include <com/sun/star/view/PaperFormat.hpp>
      44             : #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
      45             : #include <com/sun/star/office/XAnnotation.hpp>
      46             : #include <com/sun/star/office/XAnnotationAccess.hpp>
      47             : #include <com/sun/star/office/XAnnotationEnumeration.hpp>
      48             : #include <com/sun/star/geometry/RealPoint2D.hpp>
      49             : #include <com/sun/star/util/DateTime.hpp>
      50             : #include <com/sun/star/animations/TransitionType.hpp>
      51             : #include <com/sun/star/animations/TransitionSubType.hpp>
      52             : #include <com/sun/star/awt/FontDescriptor.hpp>
      53             : #include <com/sun/star/awt/FontFamily.hpp>
      54             : #include <com/sun/star/awt/FontPitch.hpp>
      55             : #include <com/sun/star/container/XNamed.hpp>
      56             : #include <com/sun/star/container/XNameAccess.hpp>
      57             : #include <com/sun/star/presentation/XPresentationPage.hpp>
      58             : #include <com/sun/star/text/XSimpleText.hpp>
      59             : #include <com/sun/star/style/XStyle.hpp>
      60             : #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
      61             : #include <editeng/svxenum.hxx>
      62             : #include <editeng/flditem.hxx>
      63             : #include <sot/storinfo.hxx>
      64             : #include <filter/msfilter/msoleexp.hxx>
      65             : #include <filter/msfilter/msdffimp.hxx>
      66             : #include <filter/msfilter/svxmsbas.hxx>
      67             : 
      68             : #ifdef DEBUG
      69             : #define DBG(x) x
      70             : #include <stdio.h>
      71             : #else
      72             : #define DBG(x)
      73             : #endif
      74             : 
      75             : using namespace com::sun::star;
      76             : 
      77             : using namespace ::com::sun::star::animations;
      78             : using namespace ::com::sun::star::awt::FontFamily;
      79             : using namespace ::com::sun::star::awt::FontPitch;
      80             : using namespace ::com::sun::star::presentation;
      81             : 
      82             : using ::com::sun::star::awt::FontDescriptor;
      83             : using ::com::sun::star::beans::XPropertySet;
      84             : using ::com::sun::star::container::XNameAccess;
      85             : using ::com::sun::star::container::XNamed;
      86             : using ::com::sun::star::drawing::XDrawPagesSupplier;
      87             : using ::com::sun::star::drawing::XMasterPagesSupplier;
      88             : using ::com::sun::star::drawing::XShapes;
      89             : using ::com::sun::star::drawing::XMasterPageTarget;
      90             : using ::com::sun::star::drawing::XDrawPage;
      91             : using ::com::sun::star::frame::XModel;
      92             : using ::com::sun::star::style::XStyleFamiliesSupplier;
      93             : using ::com::sun::star::style::XStyle;
      94             : using ::com::sun::star::task::XStatusIndicator;
      95             : using ::com::sun::star::text::XSimpleText;
      96             : using ::com::sun::star::uno::Any;
      97             : using ::com::sun::star::uno::Exception;
      98             : using ::com::sun::star::uno::Reference;
      99             : using ::com::sun::star::uno::UNO_QUERY;
     100             : 
     101             : static PHLayout pPHLayout[] =
     102             : {
     103             :     { EPP_LAYOUT_TITLESLIDE,            { 0x0d, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x10, sal_True, sal_True, sal_False },
     104             :     { EPP_LAYOUT_TITLEANDBODYSLIDE,     { 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, sal_True, sal_True, sal_False },
     105             :     { EPP_LAYOUT_TITLEANDBODYSLIDE,     { 0x0d, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x0d, 0x0e, sal_True, sal_True, sal_False },
     106             :     { EPP_LAYOUT_2COLUMNSANDTITLE,      { 0x0d, 0x0e, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, sal_True, sal_True, sal_True },
     107             :     { EPP_LAYOUT_2COLUMNSANDTITLE,      { 0x0d, 0x0e, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x0d, 0x0e, sal_True, sal_True, sal_False },
     108             :     { EPP_LAYOUT_BLANCSLIDE,            { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, sal_False, sal_False, sal_False },
     109             :     { EPP_LAYOUT_2COLUMNSANDTITLE,      { 0x0d, 0x0e, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0d, 0x0e, sal_True, sal_True, sal_False },
     110             :     { EPP_LAYOUT_2COLUMNSANDTITLE,      { 0x0d, 0x14, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x0d, 0x0e, sal_True, sal_True, sal_False },
     111             :     { EPP_LAYOUT_TITLEANDBODYSLIDE,     { 0x0d, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x15, 0x0d, 0x0e, sal_True, sal_False, sal_False },
     112             :     { EPP_LAYOUT_2COLUMNSANDTITLE,      { 0x0d, 0x16, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0d, 0x0e, sal_True, sal_True, sal_False },
     113             :     { EPP_LAYOUT_2COLUMNSANDTITLE,      { 0x0d, 0x0e, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, sal_True, sal_True, sal_False },
     114             :     { EPP_LAYOUT_TITLEANDBODYSLIDE,     { 0x0d, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, sal_True, sal_False, sal_False },
     115             :     { EPP_LAYOUT_RIGHTCOLUMN2ROWS,      { 0x0d, 0x0e, 0x13, 0x13, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, sal_True, sal_True, sal_False },
     116             :     { EPP_LAYOUT_2COLUMNSANDTITLE,      { 0x0d, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, sal_True, sal_True, sal_False },
     117             :     { EPP_LAYOUT_2ROWSANDTITLE,         { 0x0d, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, sal_True, sal_True, sal_False },
     118             :     { EPP_LAYOUT_LEFTCOLUMN2ROWS,       { 0x0d, 0x13, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, sal_True, sal_True, sal_False },
     119             :     { EPP_LAYOUT_TOPROW2COLUMN,         { 0x0d, 0x13, 0x13, 0x0e, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, sal_True, sal_True, sal_False },
     120             :     { EPP_LAYOUT_2ROWSANDTITLE,         { 0x0d, 0x0e, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, sal_True, sal_True, sal_False },
     121             :     { EPP_LAYOUT_4OBJECTS,              { 0x0d, 0x13, 0x13, 0x13, 0x13, 0x00, 0x00, 0x00 }, 0x13, 0x0d, 0x0e, sal_True, sal_False, sal_False },
     122             :     { EPP_LAYOUT_ONLYTITLE,             { 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, sal_True, sal_False, sal_False },
     123             :     { EPP_LAYOUT_BLANCSLIDE,            { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x0e, sal_False, sal_False, sal_False },
     124             :     { EPP_LAYOUT_TITLERIGHT2BODIESLEFT, { 0x11, 0x12, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x14, 0x11, 0x12, sal_True, sal_True, sal_False },
     125             :     { EPP_LAYOUT_TITLERIGHTBODYLEFT,    { 0x11, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x11, 0x12, sal_True, sal_True, sal_False },
     126             :     { EPP_LAYOUT_TITLEANDBODYSLIDE,     { 0x0d, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x00, 0x0d, 0x12, sal_True, sal_True, sal_False },
     127             :     { EPP_LAYOUT_2COLUMNSANDTITLE,      { 0x0d, 0x16, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00 }, 0x16, 0x0d, 0x12, sal_True, sal_True, sal_False }
     128             : };
     129             : 
     130           0 : PPTWriterBase::PPTWriterBase()
     131             :     : mXModel(0)
     132             :     , mXStatusIndicator(0)
     133             :     , mbStatusIndicator(false)
     134             :     , mbPresObj(false)
     135             :     , mbEmptyPresObj(false)
     136             :     , mnAngle(0)
     137             :     , mnPages(0)
     138             :     , mnMasterPages(0)
     139             :     , maFraction(1, 576)
     140             :     , maMapModeSrc(MAP_100TH_MM)
     141             :     , maMapModeDest(MAP_INCH, Point(), maFraction, maFraction)
     142             :     , meLatestPageType(NORMAL)
     143           0 :     , mpStyleSheet(0)
     144             : {
     145             :     DBG(printf ("PPTWriterBase::PPTWriterBase()\n"));
     146           0 : }
     147             : 
     148           0 : PPTWriterBase::PPTWriterBase( const Reference< XModel > & rXModel,
     149             :                               const Reference< XStatusIndicator > & rXStatInd )
     150             :     : mXModel(rXModel)
     151             :     , mXStatusIndicator(rXStatInd)
     152             :     , mbStatusIndicator(false)
     153             :     , mbPresObj(false)
     154             :     , mbEmptyPresObj(false)
     155             :     , mnAngle(0)
     156             :     , mnPages(0)
     157             :     , mnMasterPages(0)
     158             :     , maFraction(1, 576)
     159             :     , maMapModeSrc(MAP_100TH_MM)
     160             :     , maMapModeDest(MAP_INCH, Point(), maFraction, maFraction)
     161             :     , meLatestPageType (NORMAL)
     162           0 :     , mpStyleSheet(0)
     163             : {
     164           0 : }
     165             : 
     166           0 : PPTWriterBase::~PPTWriterBase()
     167             : {
     168             :     // Possibly unnecessary sanity check for mXStatusIndicator.is().
     169             :     // In 3.3 we had a bug report of a crash where it was null,
     170             :     // https://bugzilla.novell.com/show_bug.cgi?id=694119 (non-public,
     171             :     // bug report, sorry).
     172           0 :     if ( mbStatusIndicator && mXStatusIndicator.is() )
     173           0 :         mXStatusIndicator->end();
     174           0 : }
     175             : 
     176           0 : void PPTWriterBase::exportPPT( const std::vector< com::sun::star::beans::PropertyValue >& rMediaData )
     177             : {
     178           0 :     if ( !InitSOIface() )
     179           0 :         return;
     180             : 
     181             :     FontCollectionEntry aDefaultFontDesc( OUString( "Times New Roman" ),
     182             :                                           ROMAN,
     183             :                                           awt::FontPitch::VARIABLE,
     184           0 :                                                     RTL_TEXTENCODING_MS_1252 );
     185           0 :     maFontCollection.GetId( aDefaultFontDesc ); // default is always times new roman
     186             : 
     187           0 :     if ( !GetPageByIndex( 0, NOTICE ) )
     188           0 :         return;
     189             : 
     190           0 :     sal_Int32 nWidth = 21000;
     191           0 :     if ( ImplGetPropertyValue( mXPagePropSet, OUString(  "Width" ) ) )
     192           0 :         mAny >>= nWidth;
     193           0 :     sal_Int32 nHeight = 29700;
     194           0 :     if ( ImplGetPropertyValue( mXPagePropSet, OUString( "Height" ) ) )
     195           0 :         mAny >>= nHeight;
     196             : 
     197           0 :     maNotesPageSize = MapSize( awt::Size( nWidth, nHeight ) );
     198             : 
     199           0 :     if ( !GetPageByIndex( 0, MASTER ) )
     200           0 :         return;
     201             : 
     202           0 :     nWidth = 28000;
     203           0 :     if ( ImplGetPropertyValue( mXPagePropSet, OUString( "Width" ) ) )
     204           0 :         mAny >>= nWidth;
     205           0 :     nHeight = 21000;
     206           0 :     if ( ImplGetPropertyValue( mXPagePropSet, OUString( "Height" ) ) )
     207           0 :         mAny >>= nHeight;
     208           0 :     maDestPageSize = MapSize( awt::Size( nWidth, nHeight ) );
     209           0 :     maPageSize = awt::Size(nWidth, nHeight);
     210             : 
     211             :     DBG(printf( "call exportDocumentPre()\n"));
     212           0 :     exportPPTPre(rMediaData);
     213             : 
     214           0 :     if ( !GetStyleSheets() )
     215           0 :         return;
     216             : 
     217           0 :     if ( !ImplCreateDocument() )
     218           0 :          return;
     219             : 
     220             :     sal_uInt32 i;
     221             : 
     222           0 :     for ( i = 0; i < mnPages; i++ )
     223             :     {
     224           0 :     if ( GetPageByIndex( i, NORMAL ) ) {
     225           0 :         sal_uInt32 nMasterNum = GetMasterIndex( NORMAL );
     226           0 :         ImplWriteLayout( GetLayoutOffset( mXPagePropSet ), nMasterNum );
     227             :     }
     228             :     }
     229             : 
     230           0 :     for ( i = 0; i < mnMasterPages; i++ )
     231             :     {
     232           0 :         if ( !CreateSlideMaster( i ) )
     233           0 :             return;
     234             :     }
     235           0 :     if ( !CreateMainNotes() )
     236           0 :         return;
     237             : 
     238           0 :     for ( i = 0; i < mnPages; i++ )
     239             :     {
     240             :         DBG(printf( "call ImplCreateSlide( %" SAL_PRIuUINT32 " )\n", i));
     241           0 :         if ( !CreateSlide( i ) )
     242           0 :             return;
     243             :     }
     244             : 
     245           0 :     for ( i = 0; i < mnPages; i++ )
     246             :     {
     247           0 :         if ( !CreateNotes( i ) )
     248           0 :             return;
     249             :     }
     250             : 
     251             :     DBG(printf( "call exportDocumentPost()\n"));
     252           0 :     exportPPTPost();
     253             : }
     254             : 
     255           0 : sal_Bool PPTWriterBase::InitSOIface()
     256             : {
     257             :     while( true )
     258             :     {
     259           0 :         mXDrawPagesSupplier = Reference< XDrawPagesSupplier >( mXModel, UNO_QUERY );
     260           0 :         if ( !mXDrawPagesSupplier.is() )
     261           0 :             break;
     262             : 
     263           0 :         mXMasterPagesSupplier = Reference< XMasterPagesSupplier >( mXModel, UNO_QUERY );
     264           0 :         if ( !mXMasterPagesSupplier.is() )
     265           0 :             break;
     266           0 :         mXDrawPages = mXMasterPagesSupplier->getMasterPages();
     267           0 :         if ( !mXDrawPages.is() )
     268           0 :             break;
     269           0 :         mnMasterPages = mXDrawPages->getCount();
     270           0 :         mXDrawPages = mXDrawPagesSupplier->getDrawPages();
     271           0 :         if( !mXDrawPages.is() )
     272           0 :             break;
     273           0 :         mnPages =  mXDrawPages->getCount();
     274           0 :         if ( !GetPageByIndex( 0, NORMAL ) )
     275           0 :             break;
     276             : 
     277           0 :         return sal_True;
     278             :     }
     279           0 :     return sal_False;
     280             : }
     281             : 
     282           0 : sal_Bool PPTWriterBase::GetPageByIndex( sal_uInt32 nIndex, PageType ePageType )
     283             : {
     284             :     while( true )
     285             :     {
     286           0 :         if ( ePageType != meLatestPageType )
     287             :         {
     288           0 :             switch( ePageType )
     289             :             {
     290             :                 case NORMAL :
     291             :                 case NOTICE :
     292             :                 {
     293           0 :                     mXDrawPages = mXDrawPagesSupplier->getDrawPages();
     294           0 :                     if( !mXDrawPages.is() )
     295           0 :                         return sal_False;
     296             :                 }
     297           0 :                 break;
     298             : 
     299             :                 case MASTER :
     300             :                 {
     301           0 :                     mXDrawPages = mXMasterPagesSupplier->getMasterPages();
     302           0 :                     if( !mXDrawPages.is() )
     303           0 :                         return sal_False;
     304             :                 }
     305           0 :                 break;
     306             :                 default:
     307           0 :                     break;
     308             :             }
     309           0 :             meLatestPageType = ePageType;
     310             :         }
     311           0 :         Any aAny( mXDrawPages->getByIndex( nIndex ) );
     312           0 :         aAny >>= mXDrawPage;
     313           0 :         if ( !mXDrawPage.is() )
     314           0 :             break;
     315           0 :         if ( ePageType == NOTICE )
     316             :         {
     317           0 :             Reference< XPresentationPage > aXPresentationPage( mXDrawPage, UNO_QUERY );
     318           0 :             if ( !aXPresentationPage.is() )
     319           0 :                 break;
     320           0 :             mXDrawPage = aXPresentationPage->getNotesPage();
     321           0 :             if ( !mXDrawPage.is() )
     322           0 :                 break;
     323             :         }
     324           0 :         mXPagePropSet = Reference< XPropertySet >( mXDrawPage, UNO_QUERY );
     325           0 :         if ( !mXPagePropSet.is() )
     326           0 :             break;
     327             : 
     328           0 :         mXShapes = Reference< XShapes >( mXDrawPage, UNO_QUERY );
     329           0 :         if ( !mXShapes.is() )
     330           0 :             break;
     331             : 
     332             :         /* try to get the "real" background PropertySet. If the normal page is not supporting this property, it is
     333             :            taken the property from the master */
     334           0 :         sal_Bool bHasBackground = GetPropertyValue( aAny, mXPagePropSet, OUString( "Background" ), sal_True );
     335           0 :         if ( bHasBackground )
     336           0 :             bHasBackground = ( aAny >>= mXBackgroundPropSet );
     337           0 :         if ( !bHasBackground )
     338             :         {
     339           0 :             Reference< XMasterPageTarget > aXMasterPageTarget( mXDrawPage, UNO_QUERY );
     340           0 :             if ( aXMasterPageTarget.is() )
     341             :             {
     342           0 :                 Reference< XDrawPage > aXMasterDrawPage;
     343           0 :                 aXMasterDrawPage = aXMasterPageTarget->getMasterPage();
     344           0 :                 if ( aXMasterDrawPage.is() )
     345             :                 {
     346           0 :                     Reference< XPropertySet > aXMasterPagePropSet;
     347           0 :                     aXMasterPagePropSet = Reference< XPropertySet >
     348           0 :                         ( aXMasterDrawPage, UNO_QUERY );
     349           0 :                     if ( aXMasterPagePropSet.is() )
     350             :                     {
     351           0 :                         sal_Bool bBackground = GetPropertyValue( aAny, aXMasterPagePropSet, OUString( "Background" ) );
     352           0 :                         if ( bBackground )
     353             :                         {
     354           0 :                             aAny >>= mXBackgroundPropSet;
     355             :                         }
     356           0 :                     }
     357           0 :                 }
     358           0 :             }
     359             :         }
     360           0 :         return sal_True;
     361           0 :     }
     362           0 :     return sal_False;
     363             : }
     364             : 
     365           0 : sal_Bool PPTWriterBase::CreateSlide( sal_uInt32 nPageNum )
     366             : {
     367           0 :     Any aAny;
     368             : 
     369           0 :     if ( !GetPageByIndex( nPageNum, NORMAL ) )
     370           0 :         return sal_False;
     371             : 
     372           0 :     sal_uInt32 nMasterNum = GetMasterIndex( NORMAL );
     373           0 :     SetCurrentStyleSheet( nMasterNum );
     374             : 
     375           0 :     Reference< XPropertySet > aXBackgroundPropSet;
     376           0 :     sal_Bool bHasBackground = GetPropertyValue( aAny, mXPagePropSet, OUString( "Background" ) );
     377           0 :     if ( bHasBackground )
     378           0 :         bHasBackground = ( aAny >>= aXBackgroundPropSet );
     379             : 
     380           0 :     sal_uInt16 nMode = 7;   // Bit 1: Follow master objects, Bit 2: Follow master scheme, Bit 3: Follow master background
     381           0 :     if ( bHasBackground )
     382           0 :         nMode &=~4;
     383             : 
     384             : /* sj: Don't know what's IsBackgroundVisible for, have to ask cl
     385             :     if ( GetPropertyValue( aAny, mXPagePropSet, OUString( "IsBackgroundVisible" ) ) )
     386             :     {
     387             :         sal_Bool bBackgroundVisible;
     388             :         if ( aAny >>= bBackgroundVisible )
     389             :         {
     390             :             if ( bBackgroundVisible )
     391             :                 nMode &= ~4;
     392             :         }
     393             :     }
     394             : */
     395           0 :     if ( GetPropertyValue( aAny, mXPagePropSet, OUString( "IsBackgroundObjectsVisible" ) ) )
     396             :     {
     397           0 :         sal_Bool bBackgroundObjectsVisible = sal_False;
     398           0 :         if ( aAny >>= bBackgroundObjectsVisible )
     399             :         {
     400           0 :             if ( !bBackgroundObjectsVisible )
     401           0 :                 nMode &= ~1;
     402             :         }
     403             :     }
     404             : 
     405           0 :     ImplWriteSlide( nPageNum, nMasterNum, nMode, bHasBackground, aXBackgroundPropSet );
     406             : 
     407           0 :     return sal_True;
     408             : };
     409             : 
     410           0 : sal_Bool PPTWriterBase::CreateNotes( sal_uInt32 nPageNum )
     411             : {
     412           0 :     if ( !GetPageByIndex( nPageNum, NOTICE ) )
     413           0 :         return sal_False;
     414           0 :     SetCurrentStyleSheet( GetMasterIndex( NORMAL ) );
     415             : 
     416           0 :     ImplWriteNotes( nPageNum );
     417             : 
     418           0 :     return sal_True;
     419             : };
     420             : 
     421           0 : sal_Bool PPTWriterBase::CreateSlideMaster( sal_uInt32 nPageNum )
     422             : {
     423           0 :     if ( !GetPageByIndex( nPageNum, MASTER ) )
     424           0 :         return sal_False;
     425           0 :     SetCurrentStyleSheet( nPageNum );
     426             : 
     427           0 :     if ( !ImplGetPropertyValue( mXPagePropSet, OUString( "Background" ) ) )                // load background shape
     428           0 :         return sal_False;
     429           0 :     ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > aXBackgroundPropSet;
     430           0 :     if ( !( mAny >>= aXBackgroundPropSet ) )
     431           0 :         return sal_False;
     432             : 
     433           0 :     ImplWriteSlideMaster( nPageNum, aXBackgroundPropSet );
     434             : 
     435           0 :     return sal_True;
     436             : };
     437             : 
     438           0 : sal_Int32 PPTWriterBase::GetLayoutOffset( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rXPropSet ) const
     439             : {
     440           0 :     ::com::sun::star::uno::Any aAny;
     441           0 :     sal_Int32 nLayout = 20;
     442           0 :     if ( GetPropertyValue( aAny, rXPropSet, OUString( "Layout" ) ), sal_True )
     443           0 :         aAny >>= nLayout;
     444             : 
     445             :     DBG(printf("GetLayoutOffset %" SAL_PRIdINT32 "\n", nLayout));
     446             : 
     447           0 :     return nLayout;
     448             : }
     449             : 
     450           0 : sal_Int32 PPTWriterBase::GetLayoutOffsetFixed( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rXPropSet ) const
     451             : {
     452           0 :     sal_Int32 nLayout = GetLayoutOffset( rXPropSet );
     453             : 
     454           0 :     if ( ( nLayout >= 21 ) && ( nLayout <= 26 ) )   // NOTES _> HANDOUT6
     455           0 :         nLayout = 20;
     456           0 :     if ( ( nLayout >= 27 ) && ( nLayout <= 30 ) )   // VERTICAL LAYOUT
     457           0 :         nLayout -= 6;
     458           0 :     else if ( nLayout > 30 )
     459           0 :         nLayout = 20;
     460             : 
     461           0 :     return nLayout;
     462             : }
     463             : 
     464           0 : PHLayout& PPTWriterBase::GetLayout(  const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rXPropSet ) const
     465             : {
     466           0 :     return pPHLayout[ GetLayoutOffsetFixed( rXPropSet ) ];
     467             : }
     468             : 
     469           0 : PHLayout& PPTWriterBase::GetLayout( sal_Int32 nOffset ) const
     470             : {
     471           0 :     if( nOffset >= 0 && nOffset < EPP_LAYOUT_SIZE )
     472           0 :         return pPHLayout[ nOffset ];
     473             : 
     474             :     DBG(printf("asked %" SAL_PRIdINT32 " for layout outside of 0,%d array scope\n", nOffset, EPP_LAYOUT_SIZE ));
     475             : 
     476           0 :     return pPHLayout[ 0 ];
     477             : }
     478             : 
     479           0 : sal_uInt32 PPTWriterBase::GetMasterIndex( PageType ePageType )
     480             : {
     481           0 :     sal_uInt32 nRetValue = 0;
     482             :     ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XMasterPageTarget >
     483           0 :         aXMasterPageTarget( mXDrawPage, ::com::sun::star::uno::UNO_QUERY );
     484             : 
     485           0 :     if ( aXMasterPageTarget.is() )
     486             :     {
     487             :         ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >
     488           0 :             aXDrawPage = aXMasterPageTarget->getMasterPage();
     489           0 :         if ( aXDrawPage.is() )
     490             :         {
     491             :             ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
     492           0 :                 aXPropertySet( aXDrawPage, ::com::sun::star::uno::UNO_QUERY );
     493             : 
     494           0 :             if ( aXPropertySet.is() )
     495             :             {
     496           0 :                 if ( ImplGetPropertyValue( aXPropertySet, OUString( "Number" ) ) )
     497           0 :                     nRetValue |= *(sal_Int16*)mAny.getValue();
     498           0 :                 if ( nRetValue & 0xffff )           // avoid overflow
     499           0 :                     nRetValue--;
     500           0 :             }
     501           0 :         }
     502             :     }
     503           0 :     if ( ePageType == NOTICE )
     504           0 :         nRetValue += mnMasterPages;
     505           0 :     return nRetValue;
     506             : }
     507             : 
     508           0 : sal_Bool PPTWriterBase::SetCurrentStyleSheet( sal_uInt32 nPageNum )
     509             : {
     510           0 :     sal_Bool bRet = sal_False;
     511           0 :     if ( nPageNum >= maStyleSheetList.size() )
     512           0 :         nPageNum = 0;
     513             :     else
     514           0 :         bRet = sal_True;
     515           0 :     mpStyleSheet = maStyleSheetList[ nPageNum ];
     516           0 :     return bRet;
     517             : }
     518             : 
     519           0 : sal_Bool PPTWriterBase::GetStyleSheets()
     520             : {
     521             :     int             nInstance, nLevel;
     522           0 :     sal_Bool        bRetValue = sal_False;
     523             :     sal_uInt32      nPageNum;
     524             : 
     525           0 :     for ( nPageNum = 0; nPageNum < mnMasterPages; nPageNum++ )
     526             :     {
     527             :         Reference< XNamed >
     528           0 :             aXNamed;
     529             : 
     530             :         Reference< XNameAccess >
     531           0 :             aXNameAccess;
     532             : 
     533             :         Reference< XStyleFamiliesSupplier >
     534           0 :             aXStyleFamiliesSupplier( mXModel, UNO_QUERY );
     535             : 
     536             :         Reference< XPropertySet >
     537           0 :             aXPropSet( mXModel, UNO_QUERY );
     538             : 
     539           0 :         sal_uInt16 nDefaultTab = ( aXPropSet.is() && ImplGetPropertyValue( aXPropSet, OUString( "TabStop" ) ) )
     540           0 :             ? (sal_uInt16)( *(sal_Int32*)mAny.getValue() / 4.40972 )
     541           0 :             : 1250;
     542             : 
     543           0 :         maStyleSheetList.push_back( new PPTExStyleSheet( nDefaultTab, (PPTExBulletProvider&)*this ) );
     544           0 :         SetCurrentStyleSheet( nPageNum );
     545           0 :         if ( GetPageByIndex( nPageNum, MASTER ) )
     546           0 :             aXNamed = Reference< XNamed >
     547           0 :                         ( mXDrawPage, UNO_QUERY );
     548             : 
     549           0 :         if ( aXStyleFamiliesSupplier.is() )
     550           0 :             aXNameAccess = aXStyleFamiliesSupplier->getStyleFamilies();
     551             : 
     552           0 :         bRetValue = aXNamed.is() && aXNameAccess.is() && aXStyleFamiliesSupplier.is();
     553           0 :         if  ( bRetValue )
     554             :         {
     555           0 :             for ( nInstance = EPP_TEXTTYPE_Title; nInstance <= EPP_TEXTTYPE_CenterTitle; nInstance++ )
     556             :             {
     557           0 :                 OUString aStyle;
     558           0 :                 OUString aFamily;
     559           0 :                 switch ( nInstance )
     560             :                 {
     561             :                     case EPP_TEXTTYPE_CenterTitle :
     562             :                     case EPP_TEXTTYPE_Title :
     563             :                     {
     564           0 :                         aStyle = "title";
     565           0 :                         aFamily = aXNamed->getName();
     566             :                     }
     567           0 :                     break;
     568             :                     case EPP_TEXTTYPE_Body :
     569             :                     {
     570           0 :                         aStyle = "outline1";      // SD_LT_SEPARATOR
     571           0 :                         aFamily = aXNamed->getName();
     572             :                     }
     573           0 :                     break;
     574             :                     case EPP_TEXTTYPE_Other :
     575             :                     {
     576           0 :                         aStyle = "standard";
     577           0 :                         aFamily = "graphics";
     578             :                     }
     579           0 :                     break;
     580             :                     case EPP_TEXTTYPE_CenterBody :
     581             :                     {
     582           0 :                         aStyle = "subtitle";
     583           0 :                         aFamily = aXNamed->getName();
     584             :                     }
     585           0 :                     break;
     586             :                 }
     587           0 :                 if ( !aStyle.isEmpty() && !aFamily.isEmpty() )
     588             :                 {
     589             :                     try
     590             :                     {
     591           0 :                         Reference< XNameAccess >xNameAccess;
     592           0 :                         if ( aXNameAccess->hasByName( aFamily ) )
     593             :                         {
     594           0 :                             Any aAny( aXNameAccess->getByName( aFamily ) );
     595           0 :                             xNameAccess.set(aAny, css::uno::UNO_QUERY);
     596           0 :                             if( xNameAccess.is() )
     597             :                             {
     598           0 :                                 Reference< XNameAccess > aXFamily;
     599           0 :                                 if ( aAny >>= aXFamily )
     600             :                                 {
     601           0 :                                     if ( aXFamily->hasByName( aStyle ) )
     602             :                                     {
     603           0 :                                         aAny = aXFamily->getByName( aStyle );
     604             :                                         Reference< XStyle > xStyle(
     605           0 :                                             aAny, css::uno::UNO_QUERY);
     606           0 :                                         if( xStyle.is() )
     607             :                                         {
     608           0 :                                             Reference< XStyle > aXStyle;
     609           0 :                                             aAny >>= aXStyle;
     610             :                                             Reference< XPropertySet >
     611           0 :                                                 xPropSet( aXStyle, UNO_QUERY );
     612           0 :                                             if( xPropSet.is() )
     613           0 :                                                 mpStyleSheet->SetStyleSheet( xPropSet, maFontCollection, nInstance, 0 );
     614           0 :                                             for ( nLevel = 1; nLevel < 5; nLevel++ )
     615             :                                             {
     616           0 :                                                 if ( nInstance == EPP_TEXTTYPE_Body )
     617             :                                                 {
     618           0 :                                                     sal_Unicode cTemp = aStyle[aStyle.getLength() - 1];
     619           0 :                                                     aStyle = aStyle.copy(0, aStyle.getLength() - 1) + OUString(++cTemp);
     620           0 :                                                     if ( aXFamily->hasByName( aStyle ) )
     621             :                                                     {
     622           0 :                                                         aXFamily->getByName( aStyle ) >>= xStyle;
     623           0 :                                                         if( xStyle.is() )
     624             :                                                         {
     625             :                                                             Reference< XPropertySet >
     626           0 :                                                                 xPropertySet( xStyle, UNO_QUERY );
     627           0 :                                                             if ( xPropertySet.is() )
     628           0 :                                                                 mpStyleSheet->SetStyleSheet( xPropertySet, maFontCollection, nInstance, nLevel );
     629             :                                                         }
     630             :                                                     }
     631             :                                                 }
     632             :                                                 else
     633           0 :                                                     mpStyleSheet->SetStyleSheet( xPropSet, maFontCollection, nInstance, nLevel );
     634           0 :                                             }
     635           0 :                                         }
     636             :                                     }
     637           0 :                                 }
     638           0 :                             }
     639           0 :                         }
     640             :                     }
     641           0 :                     catch( Exception& )
     642             :                     {
     643             : 
     644             :                     }
     645             :                 }
     646           0 :             }
     647           0 :             for ( ; nInstance <= EPP_TEXTTYPE_QuarterBody; nInstance++ )
     648             :             {
     649             : 
     650             :             }
     651             :         }
     652           0 :     }
     653           0 :     return bRetValue;
     654             : }
     655             : 
     656           0 : sal_Bool PPTWriterBase::CreateMainNotes()
     657             : {
     658           0 :     if ( !GetPageByIndex( 0, NOTICE ) )
     659           0 :         return sal_False;
     660           0 :     SetCurrentStyleSheet( 0 );
     661             : 
     662             :     ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XMasterPageTarget >
     663           0 :         aXMasterPageTarget( mXDrawPage, ::com::sun::star::uno::UNO_QUERY );
     664             : 
     665           0 :     if ( !aXMasterPageTarget.is() )
     666           0 :         return sal_False;
     667             : 
     668           0 :     mXDrawPage = aXMasterPageTarget->getMasterPage();
     669           0 :     if ( !mXDrawPage.is() )
     670           0 :         return sal_False;
     671             : 
     672           0 :     mXPropSet = ::com::sun::star::uno::Reference<
     673             :         ::com::sun::star::beans::XPropertySet >
     674           0 :             ( mXDrawPage, ::com::sun::star::uno::UNO_QUERY );
     675           0 :     if ( !mXPropSet.is() )
     676           0 :         return sal_False;
     677             : 
     678           0 :     mXShapes = ::com::sun::star::uno::Reference<
     679             :         ::com::sun::star::drawing::XShapes >
     680           0 :             ( mXDrawPage, ::com::sun::star::uno::UNO_QUERY );
     681           0 :     if ( !mXShapes.is() )
     682           0 :         return sal_False;
     683             : 
     684           0 :     return ImplCreateMainNotes();
     685             : }
     686             : 
     687           0 : awt::Size PPTWriterBase::MapSize( const awt::Size& rSize )
     688             : {
     689           0 :     Size aRetSize( OutputDevice::LogicToLogic( Size( rSize.Width, rSize.Height ), maMapModeSrc, maMapModeDest ) );
     690             : 
     691           0 :     if ( !aRetSize.Width() )
     692           0 :         aRetSize.Width()++;
     693           0 :     if ( !aRetSize.Height() )
     694           0 :         aRetSize.Height()++;
     695           0 :     return awt::Size( aRetSize.Width(), aRetSize.Height() );
     696             : }
     697             : 
     698           0 : awt::Point PPTWriterBase::MapPoint( const awt::Point& rPoint )
     699             : {
     700           0 :     Point aRet( OutputDevice::LogicToLogic( Point( rPoint.X, rPoint.Y ), maMapModeSrc, maMapModeDest ) );
     701           0 :     return awt::Point( aRet.X(), aRet.Y() );
     702             : }
     703             : 
     704           0 : Rectangle PPTWriterBase::MapRectangle( const awt::Rectangle& rRect )
     705             : {
     706           0 :     ::com::sun::star::awt::Point    aPoint( rRect.X, rRect.Y );
     707           0 :     ::com::sun::star::awt::Size     aSize( rRect.Width, rRect.Height );
     708           0 :     ::com::sun::star::awt::Point    aP( MapPoint( aPoint ) );
     709           0 :     ::com::sun::star::awt::Size     aS( MapSize( aSize ) );
     710           0 :     return Rectangle( Point( aP.X, aP.Y ), Size( aS.Width, aS.Height ) );
     711             : }
     712             : 
     713           0 : sal_Bool PPTWriterBase::GetShapeByIndex( sal_uInt32 nIndex, sal_Bool bGroup )
     714             : {
     715             :     while(true)
     716             :     {
     717           0 :         if (  ( bGroup == sal_False ) || ( GetCurrentGroupLevel() == 0 ) )
     718             :         {
     719           0 :             Any aAny( mXShapes->getByIndex( nIndex ) );
     720           0 :             aAny >>= mXShape;
     721             :         }
     722             :         else
     723             :         {
     724           0 :             Any aAny( GetCurrentGroupAccess()->getByIndex( GetCurrentGroupIndex() ) );
     725           0 :             aAny >>= mXShape;
     726             :         }
     727           0 :         if ( !mXShape.is() )
     728           0 :             break;
     729             : 
     730           0 :         Any aAny( mXShape->queryInterface( ::getCppuType( (const Reference< XPropertySet >*) 0 ) ));
     731           0 :         aAny >>= mXPropSet;
     732             : 
     733           0 :         if ( !mXPropSet.is() )
     734           0 :             break;
     735           0 :         maPosition = MapPoint( mXShape->getPosition() );
     736           0 :         maSize = MapSize( mXShape->getSize() );
     737           0 :         maRect = Rectangle( Point( maPosition.X, maPosition.Y ), Size( maSize.Width, maSize.Height ) );
     738             : 
     739             :         OStringBuffer aTypeBuffer(OUStringToOString(
     740           0 :             mXShape->getShapeType(), RTL_TEXTENCODING_UTF8));
     741             :         // remove "com.sun.star."
     742           0 :         aTypeBuffer.remove(0, RTL_CONSTASCII_LENGTH("com.sun.star."));
     743             : 
     744           0 :         sal_Int32 nPos = aTypeBuffer.toString().indexOf("Shape");
     745           0 :         aTypeBuffer.remove(nPos, RTL_CONSTASCII_LENGTH("Shape"));
     746           0 :         mType = aTypeBuffer.makeStringAndClear();
     747             : 
     748           0 :         mbPresObj = mbEmptyPresObj = sal_False;
     749           0 :         if ( ImplGetPropertyValue( OUString( "IsPresentationObject" ) ) )
     750           0 :             mAny >>= mbPresObj;
     751             : 
     752           0 :         if ( mbPresObj && ImplGetPropertyValue( OUString( "IsEmptyPresentationObject" ) ) )
     753           0 :             mAny >>= mbEmptyPresObj;
     754             : 
     755             :         mnAngle = ( PropValue::GetPropertyValue( aAny,
     756           0 :             mXPropSet, OUString( "RotateAngle" ), sal_True ) )
     757           0 :                 ? *((sal_Int32*)aAny.getValue() )
     758           0 :                 : 0;
     759             : 
     760           0 :         return sal_True;
     761           0 :     }
     762           0 :     return sal_False;
     763             : }
     764             : 
     765           0 : sal_Int8 PPTWriterBase::GetTransition( sal_Int16 nTransitionType, sal_Int16 nTransitionSubtype, FadeEffect eEffect, sal_uInt8& nDirection )
     766             : {
     767           0 :     sal_Int8 nPPTTransitionType = 0;
     768           0 :     nDirection = 0;
     769             : 
     770           0 :     switch( nTransitionType )
     771             :     {
     772             :     case TransitionType::FADE :
     773             :     {
     774           0 :         if ( nTransitionSubtype == TransitionSubType::CROSSFADE )
     775           0 :         nPPTTransitionType = PPT_TRANSITION_TYPE_SMOOTHFADE;
     776           0 :         else if ( nTransitionSubtype == TransitionSubType::FADEOVERCOLOR )
     777           0 :         nPPTTransitionType = PPT_TRANSITION_TYPE_FADE;
     778             :     }
     779           0 :     break;
     780             :     case PPT_TRANSITION_TYPE_COMB :
     781             :     {
     782           0 :         nPPTTransitionType = PPT_TRANSITION_TYPE_COMB;
     783           0 :         if ( nTransitionSubtype == TransitionSubType::COMBVERTICAL )
     784           0 :         nDirection++;
     785             :     }
     786           0 :     break;
     787             :     case TransitionType::PUSHWIPE :
     788             :     {
     789           0 :         nPPTTransitionType = PPT_TRANSITION_TYPE_PUSH;
     790           0 :         switch( nTransitionSubtype )
     791             :         {
     792           0 :         case TransitionSubType::FROMRIGHT: nDirection = 0; break;
     793           0 :         case TransitionSubType::FROMBOTTOM: nDirection = 1; break;
     794           0 :         case TransitionSubType::FROMLEFT: nDirection = 2; break;
     795           0 :         case TransitionSubType::FROMTOP: nDirection = 3; break;
     796             :         }
     797             :     }
     798           0 :     break;
     799             :     case TransitionType::PINWHEELWIPE :
     800             :     {
     801           0 :         nPPTTransitionType = PPT_TRANSITION_TYPE_WHEEL;
     802           0 :         switch( nTransitionSubtype )
     803             :         {
     804           0 :         case TransitionSubType::ONEBLADE: nDirection = 1; break;
     805           0 :         case TransitionSubType::TWOBLADEVERTICAL : nDirection = 2; break;
     806           0 :         case TransitionSubType::THREEBLADE : nDirection = 3; break;
     807           0 :         case TransitionSubType::FOURBLADE: nDirection = 4; break;
     808           0 :         case TransitionSubType::EIGHTBLADE: nDirection = 8; break;
     809             :         }
     810             :     }
     811           0 :     break;
     812             :     case TransitionType::FANWIPE :
     813             :     {
     814           0 :         nPPTTransitionType = PPT_TRANSITION_TYPE_WEDGE;
     815             :     }
     816           0 :     break;
     817             :     case TransitionType::ELLIPSEWIPE :
     818             :     {
     819           0 :         nPPTTransitionType = PPT_TRANSITION_TYPE_CIRCLE;
     820             :     }
     821           0 :     break;
     822             :     case TransitionType::FOURBOXWIPE :
     823             :     {
     824           0 :         nPPTTransitionType = PPT_TRANSITION_TYPE_PLUS;
     825             :     }
     826           0 :     break;
     827             :     case TransitionType::IRISWIPE :
     828             :     {
     829           0 :         switch( nTransitionSubtype ) {
     830             :         case TransitionSubType::RECTANGLE:
     831           0 :             nPPTTransitionType = PPT_TRANSITION_TYPE_ZOOM;
     832           0 :             nDirection = (eEffect == FadeEffect_FADE_FROM_CENTER) ? 0 : 1;
     833           0 :             break;
     834             :         default:
     835           0 :             nPPTTransitionType = PPT_TRANSITION_TYPE_DIAMOND;
     836           0 :             break;
     837             :         }
     838             :     }
     839           0 :     break;
     840             :     }
     841             : 
     842           0 :     return nPPTTransitionType;
     843             : }
     844             : 
     845           0 : sal_Int8 PPTWriterBase::GetTransition( FadeEffect eEffect, sal_uInt8& nDirection )
     846             : {
     847           0 :     sal_Int8 nPPTTransitionType = 0;
     848             : 
     849           0 :     switch ( eEffect )
     850             :     {
     851             :     default :
     852             :     case FadeEffect_RANDOM :
     853           0 :         nPPTTransitionType = PPT_TRANSITION_TYPE_RANDOM;
     854           0 :         break;
     855             : 
     856             :     case FadeEffect_HORIZONTAL_STRIPES :
     857           0 :         nDirection++;
     858             :     case FadeEffect_VERTICAL_STRIPES :
     859           0 :         nPPTTransitionType = PPT_TRANSITION_TYPE_BLINDS;
     860           0 :         break;
     861             : 
     862             :     case FadeEffect_VERTICAL_CHECKERBOARD :
     863           0 :         nDirection++;
     864             :     case FadeEffect_HORIZONTAL_CHECKERBOARD :
     865           0 :         nPPTTransitionType = PPT_TRANSITION_TYPE_CHECKER;
     866           0 :         break;
     867             : 
     868             :     case FadeEffect_MOVE_FROM_UPPERLEFT :
     869           0 :         nDirection++;
     870             :     case FadeEffect_MOVE_FROM_UPPERRIGHT :
     871           0 :         nDirection++;
     872             :     case FadeEffect_MOVE_FROM_LOWERLEFT :
     873           0 :         nDirection++;
     874             :     case FadeEffect_MOVE_FROM_LOWERRIGHT :
     875           0 :         nDirection++;
     876             :     case FadeEffect_MOVE_FROM_TOP :
     877           0 :         nDirection++;
     878             :     case FadeEffect_MOVE_FROM_LEFT :
     879           0 :         nDirection++;
     880             :     case FadeEffect_MOVE_FROM_BOTTOM :
     881           0 :         nDirection++;
     882             :     case FadeEffect_MOVE_FROM_RIGHT :
     883           0 :         nPPTTransitionType = PPT_TRANSITION_TYPE_COVER;
     884           0 :         break;
     885             : 
     886             :     case FadeEffect_DISSOLVE :
     887           0 :         nPPTTransitionType = PPT_TRANSITION_TYPE_DISSOLVE;
     888           0 :         break;
     889             : 
     890             :     case FadeEffect_VERTICAL_LINES :
     891           0 :         nDirection++;
     892             :     case FadeEffect_HORIZONTAL_LINES :
     893           0 :         nPPTTransitionType = PPT_TRANSITION_TYPE_RANDOM_BARS;
     894           0 :         break;
     895             : 
     896             :     case FadeEffect_CLOSE_HORIZONTAL :
     897           0 :         nDirection++;
     898             :     case FadeEffect_OPEN_HORIZONTAL :
     899           0 :         nDirection++;
     900             :     case FadeEffect_CLOSE_VERTICAL :
     901           0 :         nDirection++;
     902             :     case FadeEffect_OPEN_VERTICAL :
     903           0 :         nPPTTransitionType = PPT_TRANSITION_TYPE_SPLIT;
     904           0 :         break;
     905             : 
     906             :     case FadeEffect_FADE_FROM_UPPERLEFT :
     907           0 :         nDirection++;
     908             :     case FadeEffect_FADE_FROM_UPPERRIGHT :
     909           0 :         nDirection++;
     910             :     case FadeEffect_FADE_FROM_LOWERLEFT :
     911           0 :         nDirection++;
     912             :     case FadeEffect_FADE_FROM_LOWERRIGHT :
     913           0 :         nDirection += 4;
     914           0 :         nPPTTransitionType = PPT_TRANSITION_TYPE_STRIPS;
     915           0 :         break;
     916             : 
     917             :     case FadeEffect_UNCOVER_TO_LOWERRIGHT :
     918           0 :         nDirection++;
     919             :     case FadeEffect_UNCOVER_TO_LOWERLEFT :
     920           0 :         nDirection++;
     921             :     case FadeEffect_UNCOVER_TO_UPPERRIGHT :
     922           0 :         nDirection++;
     923             :     case FadeEffect_UNCOVER_TO_UPPERLEFT :
     924           0 :         nDirection++;
     925             :     case FadeEffect_UNCOVER_TO_BOTTOM :
     926           0 :         nDirection++;
     927             :     case FadeEffect_UNCOVER_TO_RIGHT :
     928           0 :         nDirection++;
     929             :     case FadeEffect_UNCOVER_TO_TOP :
     930           0 :         nDirection++;
     931             :     case FadeEffect_UNCOVER_TO_LEFT :
     932           0 :         nPPTTransitionType = PPT_TRANSITION_TYPE_PULL;
     933           0 :         break;
     934             : 
     935             :     case FadeEffect_FADE_FROM_TOP :
     936           0 :         nDirection++;
     937             :     case FadeEffect_FADE_FROM_LEFT :
     938           0 :         nDirection++;
     939             :     case FadeEffect_FADE_FROM_BOTTOM :
     940           0 :         nDirection++;
     941             :     case FadeEffect_FADE_FROM_RIGHT :
     942           0 :         nPPTTransitionType = PPT_TRANSITION_TYPE_WIPE;
     943           0 :         break;
     944             : 
     945             :     case FadeEffect_ROLL_FROM_TOP :
     946           0 :         nDirection++;
     947             :     case FadeEffect_ROLL_FROM_LEFT :
     948           0 :         nDirection++;
     949             :     case FadeEffect_ROLL_FROM_BOTTOM :
     950           0 :         nDirection++;
     951             :     case FadeEffect_ROLL_FROM_RIGHT :
     952           0 :         nPPTTransitionType = PPT_TRANSITION_TYPE_WIPE;
     953           0 :         break;
     954             : 
     955             :     case FadeEffect_FADE_TO_CENTER :
     956           0 :         nDirection++;
     957             :     case FadeEffect_FADE_FROM_CENTER :
     958           0 :         nPPTTransitionType = PPT_TRANSITION_TYPE_ZOOM;
     959           0 :         break;
     960             : 
     961             :     case FadeEffect_NONE :
     962           0 :         nDirection = 2;
     963           0 :         break;
     964             :     }
     965             : 
     966           0 :     return nPPTTransitionType;
     967             : }
     968             : 
     969           0 : sal_Bool PPTWriterBase::ContainsOtherShapeThanPlaceholders( sal_Bool bForOOMLX )
     970             : {
     971           0 :     sal_uInt32 nShapes = mXShapes->getCount();
     972           0 :     sal_Bool bOtherThanPlaceHolders = sal_False;
     973             : 
     974           0 :     if ( nShapes )
     975           0 :         for ( sal_uInt32 nIndex = 0; ( nIndex < nShapes ) && ( bOtherThanPlaceHolders == sal_False ); nIndex++ )
     976             :         {
     977           0 :             if ( GetShapeByIndex( nIndex ) && mType != "drawing.Page" )
     978             :             {
     979           0 :                 if( bForOOMLX &&
     980           0 :                         ( mType == "presentation.Page" ||
     981           0 :                         mType == "presentation.Notes" ) ) {
     982           0 :                     Reference< XSimpleText > rXText( mXShape, UNO_QUERY );
     983             : 
     984           0 :                 if( rXText.is() && !rXText->getString().isEmpty() )
     985           0 :                     bOtherThanPlaceHolders = sal_True;
     986             :             }
     987             :             else
     988           0 :                 bOtherThanPlaceHolders = sal_True;
     989             :         }
     990             :         DBG(printf("mType == %s\n", mType.getStr()));
     991             :     }
     992             : 
     993           0 :     return bOtherThanPlaceHolders;
     994             : }
     995             : 
     996             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10