LCOV - code coverage report
Current view: top level - libreoffice/xmloff/source/draw - eventimp.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 205 0.0 %
Date: 2012-12-27 Functions: 0 27 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             : 
      21             : #include <tools/debug.hxx>
      22             : #include <com/sun/star/document/XEventsSupplier.hpp>
      23             : #include <com/sun/star/container/XNameReplace.hpp>
      24             : #include <com/sun/star/presentation/AnimationSpeed.hpp>
      25             : #include <com/sun/star/beans/XPropertySet.hpp>
      26             : #include <com/sun/star/xml/sax/XAttributeList.hpp>
      27             : #include <com/sun/star/presentation/ClickAction.hpp>
      28             : #include <tools/urlobj.hxx>
      29             : #include <comphelper/extract.hxx>
      30             : 
      31             : #include <sax/tools/converter.hxx>
      32             : 
      33             : #include <xmloff/xmltoken.hxx>
      34             : #include <xmloff/xmlimp.hxx>
      35             : #include "xmloff/xmlnmspe.hxx"
      36             : #include <xmloff/xmluconv.hxx>
      37             : #include <xmloff/nmspmap.hxx>
      38             : #include "eventimp.hxx"
      39             : #include "anim.hxx"
      40             : 
      41             : using ::rtl::OUString;
      42             : using ::rtl::OUStringBuffer;
      43             : 
      44             : using namespace ::std;
      45             : using namespace ::cppu;
      46             : using namespace ::com::sun::star;
      47             : using namespace ::com::sun::star::xml;
      48             : using namespace ::com::sun::star::xml::sax;
      49             : using namespace ::com::sun::star::uno;
      50             : using namespace ::com::sun::star::drawing;
      51             : using namespace ::com::sun::star::beans;
      52             : using namespace ::com::sun::star::lang;
      53             : using namespace ::com::sun::star::document;
      54             : using namespace ::com::sun::star::container;
      55             : using namespace ::com::sun::star::presentation;
      56             : using namespace ::xmloff::token;
      57             : 
      58             : ///////////////////////////////////////////////////////////////////////
      59             : 
      60             : SvXMLEnumMapEntry const aXML_EventActions_EnumMap[] =
      61             : {
      62             :     { XML_NONE,             ClickAction_NONE    },
      63             :     { XML_PREVIOUS_PAGE,    ClickAction_PREVPAGE },
      64             :     { XML_NEXT_PAGE,        ClickAction_NEXTPAGE },
      65             :     { XML_FIRST_PAGE,       ClickAction_FIRSTPAGE },
      66             :     { XML_LAST_PAGE,        ClickAction_LASTPAGE },
      67             :     { XML_HIDE,             ClickAction_INVISIBLE },
      68             :     { XML_STOP,             ClickAction_STOPPRESENTATION },
      69             :     { XML_EXECUTE,          ClickAction_PROGRAM },
      70             :     { XML_SHOW,             ClickAction_BOOKMARK },
      71             :     { XML_SHOW,             ClickAction_DOCUMENT },
      72             :     { XML_EXECUTE_MACRO,    ClickAction_MACRO },
      73             :     { XML_VERB,             ClickAction_VERB },
      74             :     { XML_FADE_OUT,         ClickAction_VANISH },
      75             :     { XML_SOUND,            ClickAction_SOUND },
      76             :     { XML_TOKEN_INVALID, 0 }
      77             : };
      78             : 
      79             : ///////////////////////////////////////////////////////////////////////
      80             : 
      81             : class SdXMLEventContext : public SvXMLImportContext
      82             : {
      83             : private:
      84             :     com::sun::star::uno::Reference< com::sun::star::drawing::XShape > mxShape;
      85             : 
      86             : public:
      87             :     TYPEINFO();
      88             : 
      89             :     SdXMLEventContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< XAttributeList>& xAttrList, const Reference< XShape >& rxShape );
      90             :     virtual ~SdXMLEventContext();
      91             : 
      92             :     virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName,    const Reference< XAttributeList>& xAttrList );
      93             :     virtual void EndElement();
      94             : 
      95             :     sal_Bool mbValid;
      96             :     sal_Bool mbScript;
      97             :     ClickAction meClickAction;
      98             :     XMLEffect meEffect;
      99             :     XMLEffectDirection meDirection;
     100             :     sal_Int16 mnStartScale;
     101             :     AnimationSpeed meSpeed;
     102             :     sal_Int32 mnVerb;
     103             :     OUString msSoundURL;
     104             :     sal_Bool mbPlayFull;
     105             :     OUString msMacroName;
     106             :     OUString msBookmark;
     107             :     OUString msLanguage;
     108             : };
     109             : 
     110             : ///////////////////////////////////////////////////////////////////////
     111             : 
     112             : class XMLEventSoundContext : public SvXMLImportContext
     113             : {
     114             :     SdXMLEventContext*  mpParent;
     115             : 
     116             : public:
     117             :     TYPEINFO();
     118             : 
     119             :     XMLEventSoundContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList, SdXMLEventContext* pParent );
     120             :     virtual ~XMLEventSoundContext();
     121             : };
     122             : 
     123           0 : TYPEINIT1( XMLEventSoundContext, SvXMLImportContext );
     124             : 
     125           0 : XMLEventSoundContext::XMLEventSoundContext( SvXMLImport& rImp, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList, SdXMLEventContext* pParent )
     126           0 : : SvXMLImportContext( rImp, nPrfx, rLocalName ), mpParent( pParent )
     127             : {
     128           0 :     if( mpParent && nPrfx == XML_NAMESPACE_PRESENTATION && IsXMLToken( rLocalName, XML_SOUND ) )
     129             :     {
     130           0 :         const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
     131           0 :         for(sal_Int16 i=0; i < nAttrCount; i++)
     132             :         {
     133           0 :             OUString sAttrName = xAttrList->getNameByIndex( i );
     134           0 :             OUString aAttrLocalName;
     135           0 :             sal_uInt16 nAttrPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aAttrLocalName );
     136           0 :             OUString sValue = xAttrList->getValueByIndex( i );
     137             : 
     138           0 :             switch( nAttrPrefix )
     139             :             {
     140             :             case XML_NAMESPACE_XLINK:
     141           0 :                 if( IsXMLToken( aAttrLocalName, XML_HREF ) )
     142             :                 {
     143           0 :                     mpParent->msSoundURL = rImp.GetAbsoluteReference(sValue);
     144             :                 }
     145           0 :                 break;
     146             :             case XML_NAMESPACE_PRESENTATION:
     147           0 :                 if( IsXMLToken( aAttrLocalName, XML_PLAY_FULL ) )
     148             :                 {
     149           0 :                     mpParent->mbPlayFull = IsXMLToken( sValue, XML_TRUE );
     150             :                 }
     151             :             }
     152           0 :         }
     153             :     }
     154           0 : }
     155             : 
     156           0 : XMLEventSoundContext::~XMLEventSoundContext()
     157             : {
     158           0 : }
     159             : 
     160             : ///////////////////////////////////////////////////////////////////////
     161             : 
     162           0 : TYPEINIT1( SdXMLEventContext, SvXMLImportContext );
     163             : 
     164           0 : SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp,  sal_uInt16 nPrfx, const OUString& rLocalName,  const Reference< XAttributeList >& xAttrList, const Reference< XShape >& rxShape )
     165             : :   SvXMLImportContext(rImp, nPrfx, rLocalName),
     166             :     mxShape( rxShape ), mbScript( sal_False ), meClickAction( ClickAction_NONE ),
     167             :     meEffect( EK_none ), meDirection( ED_none ), mnStartScale( 100 ),
     168           0 :     meSpeed( AnimationSpeed_MEDIUM ), mnVerb(0), mbPlayFull( sal_False )
     169             : {
     170           0 :     static const OUString sXMLClickName( RTL_CONSTASCII_USTRINGPARAM( "click" ) );
     171             : 
     172           0 :     if( nPrfx == XML_NAMESPACE_PRESENTATION && IsXMLToken( rLocalName, XML_EVENT_LISTENER ) )
     173             :     {
     174           0 :         mbValid = sal_True;
     175             :     }
     176           0 :     else if( nPrfx == XML_NAMESPACE_SCRIPT && IsXMLToken( rLocalName, XML_EVENT_LISTENER ) )
     177             :     {
     178           0 :         mbScript = sal_True;
     179           0 :         mbValid = sal_True;
     180             :     }
     181             :     else
     182             :     {
     183           0 :         return;
     184             :     }
     185             : 
     186             :     // read attributes
     187           0 :     OUString sEventName;
     188           0 :     const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
     189           0 :     for(sal_Int16 i=0; (i < nAttrCount) && mbValid; i++)
     190             :     {
     191           0 :         OUString sAttrName = xAttrList->getNameByIndex( i );
     192           0 :         OUString aAttrLocalName;
     193           0 :         sal_uInt16 nAttrPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aAttrLocalName );
     194           0 :         OUString sValue = xAttrList->getValueByIndex( i );
     195             : 
     196           0 :         switch( nAttrPrefix )
     197             :         {
     198             :         case XML_NAMESPACE_PRESENTATION:
     199           0 :             if( IsXMLToken( aAttrLocalName, XML_ACTION ) )
     200             :             {
     201             :                 sal_uInt16 eEnum;
     202           0 :                 if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_EventActions_EnumMap ) )
     203           0 :                     meClickAction = (ClickAction)eEnum;
     204             :             }
     205           0 :             if( IsXMLToken( aAttrLocalName, XML_EFFECT ) )
     206             :             {
     207             :                 sal_uInt16 eEnum;
     208           0 :                 if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_AnimationEffect_EnumMap ) )
     209           0 :                     meEffect = (XMLEffect)eEnum;
     210             :             }
     211           0 :             else if( IsXMLToken( aAttrLocalName, XML_DIRECTION ) )
     212             :             {
     213             :                 sal_uInt16 eEnum;
     214           0 :                 if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_AnimationDirection_EnumMap ) )
     215           0 :                     meDirection = (XMLEffectDirection)eEnum;
     216             :             }
     217           0 :             else if( IsXMLToken( aAttrLocalName, XML_START_SCALE ) )
     218             :             {
     219             :                 sal_Int32 nScale;
     220           0 :                 if (::sax::Converter::convertPercent( nScale, sValue ))
     221           0 :                     mnStartScale = (sal_Int16)nScale;
     222             :             }
     223           0 :             else if( IsXMLToken( aAttrLocalName, XML_SPEED ) )
     224             :             {
     225             :                 sal_uInt16 eEnum;
     226           0 :                 if( SvXMLUnitConverter::convertEnum( eEnum, sValue, aXML_AnimationSpeed_EnumMap ) )
     227           0 :                     meSpeed = (AnimationSpeed)eEnum;
     228             :             }
     229           0 :             else if( IsXMLToken( aAttrLocalName, XML_VERB ) )
     230             :             {
     231           0 :                 ::sax::Converter::convertNumber( mnVerb, sValue );
     232             :             }
     233           0 :             break;
     234             : 
     235             :         case XML_NAMESPACE_SCRIPT:
     236           0 :             if( IsXMLToken( aAttrLocalName, XML_EVENT_NAME ) )
     237             :             {
     238           0 :                 sEventName = sValue;
     239             :                 sal_uInt16 nScriptPrefix =
     240           0 :                     GetImport().GetNamespaceMap().GetKeyByAttrName( sValue, &sEventName );
     241           0 :                 mbValid = XML_NAMESPACE_DOM == nScriptPrefix && sEventName == sXMLClickName;
     242             :             }
     243           0 :             else if( IsXMLToken( aAttrLocalName, XML_LANGUAGE ) )
     244             :             {
     245             :                 // language is not evaluated!
     246           0 :                 OUString aScriptLanguage;
     247           0 :                 msLanguage = sValue;
     248           0 :                 sal_uInt16 nScriptPrefix = rImp.GetNamespaceMap().
     249           0 :                     GetKeyByAttrName( msLanguage, &aScriptLanguage );
     250           0 :                 if( XML_NAMESPACE_OOO == nScriptPrefix )
     251           0 :                     msLanguage = aScriptLanguage;
     252             :             }
     253           0 :             else if( IsXMLToken( aAttrLocalName, XML_MACRO_NAME ) )
     254             :             {
     255           0 :                 msMacroName = sValue;
     256             :             }
     257           0 :             break;
     258             : 
     259             :         case XML_NAMESPACE_XLINK:
     260           0 :             if( IsXMLToken( aAttrLocalName, XML_HREF ) )
     261             :             {
     262           0 :                 if ( mbScript )
     263             :                 {
     264           0 :                     msMacroName = sValue;
     265             :                 }
     266             :                 else
     267             :                 {
     268             :                     const rtl::OUString &rTmp =
     269           0 :                         rImp.GetAbsoluteReference(sValue);
     270             :                     INetURLObject::translateToInternal( rTmp, msBookmark,
     271             :                         INetURLObject::DECODE_UNAMBIGUOUS,
     272           0 :                         RTL_TEXTENCODING_UTF8 );
     273             :                 }
     274             :             }
     275           0 :             break;
     276             :         }
     277           0 :     }
     278             : 
     279           0 :     if( mbValid )
     280           0 :         mbValid = !sEventName.isEmpty();
     281             : }
     282             : 
     283           0 : SdXMLEventContext::~SdXMLEventContext()
     284             : {
     285           0 : }
     286             : 
     287           0 : SvXMLImportContext * SdXMLEventContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< XAttributeList>& xAttrList )
     288             : {
     289           0 :     return new XMLEventSoundContext( GetImport(), nPrefix, rLocalName, xAttrList, this );
     290             : }
     291             : 
     292           0 : void SdXMLEventContext::EndElement()
     293             : {
     294           0 :     if( !mbValid )
     295           0 :         return;
     296             : 
     297             :     do
     298             :     {
     299           0 :         Reference< XEventsSupplier > xEventsSupplier( mxShape, UNO_QUERY );
     300           0 :         if( !xEventsSupplier.is() )
     301             :             break;
     302             : 
     303           0 :         Reference< XNameReplace > xEvents( xEventsSupplier->getEvents() );
     304             :         DBG_ASSERT( xEvents.is(), "XEventsSupplier::getEvents() returned NULL" );
     305           0 :         if( !xEvents.is() )
     306             :             break;
     307             : 
     308           0 :         OUString sAPIEventName;
     309           0 :         uno::Sequence< beans::PropertyValue > aProperties;
     310             : 
     311           0 :             sAPIEventName = OUString( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ) );
     312             : 
     313           0 :             if( mbScript )
     314           0 :                 meClickAction = ClickAction_MACRO;
     315             : 
     316           0 :             sal_Int32 nPropertyCount = 2;
     317           0 :             switch( meClickAction )
     318             :             {
     319             :                 case ClickAction_NONE:
     320             :                 case ClickAction_PREVPAGE:
     321             :                 case ClickAction_NEXTPAGE:
     322             :                 case ClickAction_FIRSTPAGE:
     323             :                 case ClickAction_LASTPAGE:
     324             :                 case ClickAction_INVISIBLE:
     325             :                 case ClickAction_STOPPRESENTATION:
     326           0 :                     break;
     327             :                 case ClickAction_PROGRAM:
     328             :                 case ClickAction_VERB:
     329             :                 case ClickAction_BOOKMARK:
     330             :                 case ClickAction_DOCUMENT:
     331           0 :                     nPropertyCount += 1;
     332           0 :                     break;
     333             :                 case ClickAction_MACRO:
     334           0 :                     if ( msLanguage.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("starbasic")) )
     335           0 :                         nPropertyCount += 1;
     336           0 :                     break;
     337             : 
     338             :                 case ClickAction_SOUND:
     339           0 :                     nPropertyCount += 2;
     340           0 :                     break;
     341             : 
     342             :                 case ClickAction_VANISH:
     343           0 :                     nPropertyCount += 4;
     344           0 :                     break;
     345             :                 default:
     346           0 :                     break;
     347             :             }
     348             : 
     349           0 :             aProperties.realloc( nPropertyCount );
     350           0 :             beans::PropertyValue* pProperties = aProperties.getArray();
     351             : 
     352           0 :             if( ClickAction_MACRO == meClickAction )
     353             :             {
     354           0 :                 if ( msLanguage.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("starbasic")) )
     355             :                 {
     356           0 :                     OUString sLibrary;
     357           0 :                     const OUString& rApp = GetXMLToken( XML_APPLICATION );
     358           0 :                     const OUString& rDoc = GetXMLToken( XML_DOCUMENT );
     359           0 :                     if( msMacroName.getLength() > rApp.getLength()+1 &&
     360           0 :                         msMacroName.copy(0,rApp.getLength()).equalsIgnoreAsciiCase( rApp ) &&
     361           0 :                         ':' == msMacroName[rApp.getLength()] )
     362             :                     {
     363           0 :                         sLibrary = OUString(RTL_CONSTASCII_USTRINGPARAM("StarOffice"));
     364           0 :                         msMacroName = msMacroName.copy( rApp.getLength()+1 );
     365             :                     }
     366           0 :                     else if( msMacroName.getLength() > rDoc.getLength()+1 &&
     367           0 :                         msMacroName.copy(0,rDoc.getLength()).equalsIgnoreAsciiCase( rDoc ) &&
     368           0 :                         ':' == msMacroName[rDoc.getLength()] )
     369             :                     {
     370           0 :                         sLibrary = rDoc;
     371           0 :                         msMacroName = msMacroName.copy( rDoc.getLength()+1 );
     372             :                     }
     373             : 
     374           0 :                     pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) );
     375           0 :                     pProperties->Handle = -1;
     376           0 :                     pProperties->Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM("StarBasic") );
     377           0 :                     pProperties->State = beans::PropertyState_DIRECT_VALUE;
     378           0 :                     pProperties++;
     379             : 
     380           0 :                     pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "MacroName" ) );
     381           0 :                     pProperties->Handle = -1;
     382           0 :                     pProperties->Value <<= msMacroName;
     383           0 :                     pProperties->State = beans::PropertyState_DIRECT_VALUE;
     384           0 :                     pProperties++;
     385             : 
     386           0 :                     pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Library" ) );
     387           0 :                     pProperties->Handle = -1;
     388           0 :                     pProperties->Value <<= sLibrary;
     389           0 :                     pProperties->State = beans::PropertyState_DIRECT_VALUE;
     390             :                 }
     391             :                 else
     392             :                 {
     393             :                     pProperties->Name =
     394           0 :                         OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) );
     395           0 :                     pProperties->Handle = -1;
     396             :                     pProperties->Value <<= OUString(
     397           0 :                         RTL_CONSTASCII_USTRINGPARAM("Script") );
     398           0 :                     pProperties->State = beans::PropertyState_DIRECT_VALUE;
     399           0 :                     pProperties++;
     400             : 
     401             :                     pProperties->Name = OUString(
     402           0 :                         RTL_CONSTASCII_USTRINGPARAM( "Script" ) );
     403           0 :                     pProperties->Handle = -1;
     404           0 :                     pProperties->Value <<= msMacroName;
     405           0 :                     pProperties->State = beans::PropertyState_DIRECT_VALUE;
     406             :                 }
     407             :             }
     408             :             else
     409             :             {
     410           0 :                 pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) );
     411           0 :                 pProperties->Handle = -1;
     412           0 :                 pProperties->Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM("Presentation") );
     413           0 :                 pProperties->State = beans::PropertyState_DIRECT_VALUE;
     414           0 :                 pProperties++;
     415             : 
     416             :                 // ClickAction_BOOKMARK and ClickAction_DOCUMENT share the same xml event
     417             :                 // so check here if its realy a bookmark or maybe a document
     418           0 :                 if( meClickAction == ClickAction_BOOKMARK )
     419             :                 {
     420           0 :                     if( msBookmark.compareToAscii( "#", 1 ) != 0 )
     421           0 :                         meClickAction = ClickAction_DOCUMENT;
     422             :                 }
     423             : 
     424           0 :                 pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("ClickAction") );
     425           0 :                 pProperties->Handle = -1;
     426           0 :                 pProperties->Value <<= meClickAction;
     427           0 :                 pProperties->State = beans::PropertyState_DIRECT_VALUE;
     428           0 :                 pProperties++;
     429             : 
     430           0 :                 switch( meClickAction )
     431             :                 {
     432             :                 case ClickAction_NONE:
     433             :                 case ClickAction_PREVPAGE:
     434             :                 case ClickAction_NEXTPAGE:
     435             :                 case ClickAction_FIRSTPAGE:
     436             :                 case ClickAction_LASTPAGE:
     437             :                 case ClickAction_INVISIBLE:
     438             :                 case ClickAction_STOPPRESENTATION:
     439           0 :                     break;
     440             : 
     441             :                 case ClickAction_BOOKMARK:
     442           0 :                     msBookmark = msBookmark.copy(1);
     443             : 
     444             :                     // Note: no break here!!!
     445             : 
     446             :                 case ClickAction_DOCUMENT:
     447             :                 case ClickAction_PROGRAM:
     448           0 :                     pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("Bookmark") );
     449           0 :                     pProperties->Handle = -1;
     450           0 :                     pProperties->Value <<= msBookmark;
     451           0 :                     pProperties->State = beans::PropertyState_DIRECT_VALUE;
     452           0 :                     break;
     453             : 
     454             :                 case ClickAction_VANISH:
     455           0 :                     pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("Effect") );
     456           0 :                     pProperties->Handle = -1;
     457           0 :                     pProperties->Value <<= ImplSdXMLgetEffect( meEffect, meDirection, mnStartScale, sal_True );
     458           0 :                     pProperties->State = beans::PropertyState_DIRECT_VALUE;
     459           0 :                     pProperties++;
     460             : 
     461           0 :                     pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("Speed") );
     462           0 :                     pProperties->Handle = -1;
     463           0 :                     pProperties->Value <<= meSpeed;
     464           0 :                     pProperties->State = beans::PropertyState_DIRECT_VALUE;
     465           0 :                     pProperties++;
     466             : 
     467             :                     // NOTE: no break here!!!
     468             : 
     469             :                 case ClickAction_SOUND:
     470           0 :                     pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("SoundURL") );
     471           0 :                     pProperties->Handle = -1;
     472           0 :                     pProperties->Value <<= msSoundURL;
     473           0 :                     pProperties->State = beans::PropertyState_DIRECT_VALUE;
     474           0 :                     pProperties++;
     475             : 
     476           0 :                     pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("PlayFull") );
     477           0 :                     pProperties->Handle = -1;
     478           0 :                     pProperties->Value = ::cppu::bool2any(mbPlayFull);
     479           0 :                     pProperties->State = beans::PropertyState_DIRECT_VALUE;
     480           0 :                     break;
     481             : 
     482             :                 case ClickAction_VERB:
     483           0 :                     pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("Verb") );
     484           0 :                     pProperties->Handle = -1;
     485           0 :                     pProperties->Value <<= mnVerb;
     486           0 :                     pProperties->State = beans::PropertyState_DIRECT_VALUE;
     487           0 :                     break;
     488             :                 case ClickAction_MACRO:
     489             :                     OSL_FAIL("xmloff::SdXMLEventContext::EndElement(), ClickAction_MACRO must be handled in different if case");
     490           0 :                     break;
     491             :                 default:
     492           0 :                     break;
     493             :                 }
     494             :             }
     495           0 :         xEvents->replaceByName( sAPIEventName, uno::Any( aProperties ) );
     496             : 
     497             :     } while(0);
     498             : }
     499             : 
     500             : ///////////////////////////////////////////////////////////////////////
     501             : 
     502           0 : TYPEINIT1( SdXMLEventsContext, SvXMLImportContext );
     503             : 
     504           0 : SdXMLEventsContext::SdXMLEventsContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLocalName,
     505             :         const Reference< XAttributeList>&, const Reference< XShape >& rxShape)
     506           0 : : SvXMLImportContext(rImport, nPrfx, rLocalName), mxShape( rxShape )
     507             : {
     508           0 : }
     509             : 
     510           0 : SdXMLEventsContext::~SdXMLEventsContext()
     511             : {
     512           0 : }
     513             : 
     514           0 : SvXMLImportContext * SdXMLEventsContext::CreateChildContext( sal_uInt16 nPrfx, const ::rtl::OUString& rLocalName,
     515             :         const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList )
     516             : {
     517           0 :     return new SdXMLEventContext( GetImport(), nPrfx, rLocalName,  xAttrList, mxShape );
     518             : }
     519             : 
     520             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10