LCOV - code coverage report
Current view: top level - libreoffice/filter/source/flash - swffilter.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 157 0.0 %
Date: 2012-12-27 Functions: 0 29 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 <com/sun/star/frame/Desktop.hpp>
      21             : #include <com/sun/star/frame/XStorable.hpp>
      22             : #include <com/sun/star/document/XFilter.hpp>
      23             : #include <com/sun/star/document/XExporter.hpp>
      24             : #include <com/sun/star/lang/XInitialization.hpp>
      25             : #include <com/sun/star/lang/XServiceInfo.hpp>
      26             : #include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
      27             : #include <com/sun/star/drawing/XDrawView.hpp>
      28             : #include <com/sun/star/container/XIndexAccess.hpp>
      29             : #include <com/sun/star/frame/XModel.hpp>
      30             : #include <com/sun/star/task/XStatusIndicatorFactory.hpp>
      31             : #include <com/sun/star/io/XOutputStream.hpp>
      32             : #include <cppuhelper/implbase1.hxx>
      33             : #include <cppuhelper/implbase4.hxx>
      34             : #include <comphelper/processfactory.hxx>
      35             : #include <osl/file.hxx>
      36             : 
      37             : #include "swfexporter.hxx"
      38             : 
      39             : #include <string.h>
      40             : 
      41             : using namespace ::com::sun::star::uno;
      42             : using namespace ::com::sun::star::frame;
      43             : using namespace ::com::sun::star::lang;
      44             : using namespace ::com::sun::star::drawing;
      45             : using namespace ::com::sun::star::presentation;
      46             : using namespace ::com::sun::star::task;
      47             : 
      48             : using ::rtl::OUString;
      49             : using ::rtl::OString;
      50             : using ::com::sun::star::lang::XComponent;
      51             : using ::com::sun::star::beans::PropertyValue;
      52             : using ::com::sun::star::io::XOutputStream;
      53             : using ::com::sun::star::container::XIndexAccess;
      54             : using ::osl::FileBase;
      55             : using ::com::sun::star::frame::XModel;
      56             : 
      57             : namespace swf {
      58             : 
      59             : typedef ::cppu::WeakImplHelper1<com::sun::star::io::XOutputStream> OslOutputStreamWrapper_Base;
      60             :     // needed for some compilers
      61           0 : class OslOutputStreamWrapper : public OslOutputStreamWrapper_Base
      62             : {
      63             :     osl::File   mrFile;
      64             : 
      65             : public:
      66           0 :     OslOutputStreamWrapper(const OUString& sFileName) : mrFile(sFileName)
      67             :     {
      68           0 :         osl_removeFile(sFileName.pData);
      69           0 :         mrFile.open( osl_File_OpenFlag_Create|osl_File_OpenFlag_Write );
      70           0 :     }
      71             : 
      72             :     // stario::XOutputStream
      73             :     virtual void SAL_CALL writeBytes( const ::com::sun::star::uno::Sequence< sal_Int8 >& aData ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
      74             :     virtual void SAL_CALL flush(  ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
      75             :     virtual void SAL_CALL closeOutput(  ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
      76             : };
      77             : 
      78           0 : void SAL_CALL OslOutputStreamWrapper::writeBytes( const ::com::sun::star::uno::Sequence< sal_Int8 >& aData ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
      79             : {
      80           0 :     sal_uInt64 uBytesToWrite = aData.getLength();
      81           0 :     sal_uInt64 uBytesWritten = 0;
      82             : 
      83           0 :     sal_Int8 const * pBuffer = aData.getConstArray();
      84             : 
      85           0 :     while( uBytesToWrite )
      86             :     {
      87           0 :         osl::File::RC eRC = mrFile.write( pBuffer, uBytesToWrite, uBytesWritten);
      88             : 
      89           0 :         switch( eRC )
      90             :         {
      91             :         case osl::File::E_INVAL:    // the format of the parameters was not valid
      92             :         case osl::File::E_FBIG:        // File too large
      93             : 
      94             :         case osl::File::E_AGAIN:    // Operation would block
      95             :         case osl::File::E_BADF:        // Bad file
      96             :         case osl::File::E_FAULT:    // Bad address
      97             :         case osl::File::E_INTR:        // function call was interrupted
      98             :         case osl::File::E_IO:        // I/O error
      99             :         case osl::File::E_NOLCK:    // No record locks available
     100             :         case osl::File::E_NOLINK:    // Link has been severed
     101             :         case osl::File::E_NOSPC:    // No space left on device
     102             :         case osl::File::E_NXIO:        // No such device or address
     103           0 :             throw com::sun::star::io::IOException();    // TODO: Better error handling
     104           0 :         default: break;
     105             :         }
     106             : 
     107           0 :         uBytesToWrite -= uBytesWritten;
     108           0 :         pBuffer += uBytesWritten;
     109             :     }
     110           0 : }
     111             : 
     112           0 : void SAL_CALL OslOutputStreamWrapper::flush(  ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
     113             : {
     114           0 : }
     115             : 
     116           0 : void SAL_CALL OslOutputStreamWrapper::closeOutput(  ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
     117             : {
     118           0 :     osl::File::RC eRC = mrFile.close();
     119             : 
     120           0 :     switch( eRC )
     121             :     {
     122             :     case osl::File::E_INVAL:    // the format of the parameters was not valid
     123             : 
     124             :     case osl::File::E_BADF:        // Bad file
     125             :     case osl::File::E_INTR:        // function call was interrupted
     126             :     case osl::File::E_NOLINK:    // Link has been severed
     127             :     case osl::File::E_NOSPC:    // No space left on device
     128             :     case osl::File::E_IO:        // I/O error
     129           0 :         throw com::sun::star::io::IOException();    // TODO: Better error handling
     130           0 :     default: break;
     131             :     }
     132           0 : }
     133             : 
     134             : // -----------------------------------------------------------------------------
     135             : 
     136           0 : class FlashExportFilter : public cppu::WeakImplHelper4
     137             : <
     138             :     com::sun::star::document::XFilter,
     139             :     com::sun::star::document::XExporter,
     140             :     com::sun::star::lang::XInitialization,
     141             :     com::sun::star::lang::XServiceInfo
     142             : >
     143             : {
     144             :     Reference< XComponent > mxDoc;
     145             :     Reference< XMultiServiceFactory > mxMSF;
     146             :     Reference< XStatusIndicator> mxStatusIndicator;
     147             : 
     148             : public:
     149             :     FlashExportFilter( const Reference< XMultiServiceFactory > &rxMSF);
     150             : 
     151             :     // XFilter
     152             :     virtual sal_Bool SAL_CALL filter( const Sequence< PropertyValue >& aDescriptor ) throw(RuntimeException);
     153             : 
     154             :     sal_Bool ExportAsMultipleFiles( const Sequence< PropertyValue >& aDescriptor );
     155             :     sal_Bool ExportAsSingleFile( const Sequence< PropertyValue >& aDescriptor );
     156             : 
     157             :     virtual void SAL_CALL cancel( ) throw (RuntimeException);
     158             : 
     159             :     // XExporter
     160             :     virtual void SAL_CALL setSourceDocument( const Reference< XComponent >& xDoc ) throw(IllegalArgumentException, RuntimeException);
     161             : 
     162             :     // XInitialization
     163             :     virtual void SAL_CALL initialize( const Sequence< Any >& aArguments ) throw(Exception, RuntimeException);
     164             : 
     165             :     // XServiceInfo
     166             :     virtual OUString SAL_CALL getImplementationName() throw(RuntimeException);
     167             :     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(RuntimeException);
     168             :     virtual Sequence< OUString > SAL_CALL getSupportedServiceNames()  throw(RuntimeException);
     169             : };
     170             : 
     171             : // -----------------------------------------------------------------------------
     172             : 
     173           0 : FlashExportFilter::FlashExportFilter(const Reference< XMultiServiceFactory > &rxMSF)
     174           0 : :   mxMSF( rxMSF )
     175             : {
     176           0 : }
     177             : 
     178             : 
     179             : // -----------------------------------------------------------------------------
     180             : 
     181           0 : OUString exportBackground(FlashExporter &aFlashExporter, Reference< XDrawPage > xDrawPage, OUString sPath, sal_uInt32 nPage, const char* suffix)
     182             : {
     183           0 :     OUString filename = STR("slide") + VAL(nPage+1) + STR(suffix) + STR(".swf");
     184           0 :     OUString fullpath = sPath + STR("/") + filename;
     185             : 
     186             :     // AS: If suffix is "o" then the last paramter is true (for exporting objects).
     187           0 :     Reference<XOutputStream> xOutputStreamWrap(*(new OslOutputStreamWrapper(fullpath)), UNO_QUERY);
     188           0 :     sal_uInt16 nCached = aFlashExporter.exportBackgrounds( xDrawPage, xOutputStreamWrap, sal::static_int_cast<sal_uInt16>( nPage ), *suffix == 'o' );
     189           0 :     aFlashExporter.Flush();
     190           0 :     xOutputStreamWrap.clear();
     191             : 
     192           0 :     if (nCached != nPage)
     193             :     {
     194           0 :         osl_removeFile(fullpath.pData);
     195           0 :         if ( 0xffff == nCached )
     196           0 :             return STR("NULL");
     197             :         else
     198           0 :             return STR("slide") + VAL(nCached+1) + STR(suffix) + STR(".swf");
     199             :     }
     200             : 
     201           0 :     return filename;
     202             : }
     203             : 
     204             : template <typename TYPE>
     205           0 : TYPE findPropertyValue(const Sequence< PropertyValue >& aPropertySequence, const sal_Char* name, TYPE def)
     206             : {
     207           0 :     TYPE temp = TYPE();
     208             : 
     209           0 :     sal_Int32 nLength = aPropertySequence.getLength();
     210           0 :     const PropertyValue * pValue = aPropertySequence.getConstArray();
     211             : 
     212           0 :     for ( sal_Int32 i = 0 ; i < nLength; i++)
     213             :     {
     214           0 :         if ( pValue[i].Name.equalsAsciiL ( name, strlen(name) ) )
     215             :         {
     216           0 :             pValue[i].Value >>= temp;
     217           0 :             return temp;
     218             :         }
     219             :     }
     220             : 
     221           0 :     return def;
     222             : }
     223             : 
     224           0 : sal_Bool SAL_CALL FlashExportFilter::filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
     225             :     throw (RuntimeException)
     226             : {
     227           0 :     mxStatusIndicator = findPropertyValue<Reference<XStatusIndicator> >(aDescriptor, "StatusIndicator", mxStatusIndicator);
     228             : 
     229           0 :     Sequence< PropertyValue > aFilterData;
     230           0 :     aFilterData = findPropertyValue<Sequence< PropertyValue > >(aDescriptor, "FilterData", aFilterData);
     231             : 
     232           0 :     if (findPropertyValue<sal_Bool>(aFilterData, "ExportMultipleFiles", false ))
     233             :     {
     234           0 :         ExportAsMultipleFiles(aDescriptor);
     235             :     }
     236             :     else
     237             :     {
     238           0 :         ExportAsSingleFile(aDescriptor);
     239             :     }
     240             : 
     241           0 :     if( mxStatusIndicator.is() )
     242           0 :         mxStatusIndicator->end();
     243             : 
     244           0 :     return sal_True;
     245             : }
     246             : 
     247             : 
     248             : // AS: When exporting as multiple files, each background, object layer, and slide gets its own
     249             : //  file.  Additionally, a file called BackgroundConfig.txt is generated, indicating which
     250             : //  background and objects (if any) go with each slide.  The files are named slideNb.swf,
     251             : //  slideNo.swf, and slideNp.swf, where N is the slide number, and b=background, o=objects, and
     252             : //  p=slide contents.  Note that under normal circumstances, there will be very few b and o files.
     253             : 
     254             : // AS: HACK!  Right now, I create a directory as a sibling to the swf file selected in the Export
     255             : //  dialog.  This directory is called presentation.sxi-swf-files.  The name of the swf file selected
     256             : //  in the Export dialog has no impact on this.  All files created are placed in this directory.
     257           0 : sal_Bool FlashExportFilter::ExportAsMultipleFiles(const Sequence< PropertyValue >& aDescriptor)
     258             : {
     259           0 :     Reference< XDrawPagesSupplier > xDrawPagesSupplier(mxDoc, UNO_QUERY);
     260           0 :     if(!xDrawPagesSupplier.is())
     261           0 :         return sal_False;
     262             : 
     263           0 :     Reference< XIndexAccess > xDrawPages( xDrawPagesSupplier->getDrawPages(), UNO_QUERY );
     264           0 :     if(!xDrawPages.is())
     265           0 :         return sal_False;
     266             : 
     267           0 :     Reference< XDesktop2 > rDesktop = Desktop::create( comphelper::getComponentContext(mxMSF) );
     268             : 
     269           0 :     Reference< XStorable > xStorable(rDesktop->getCurrentComponent(), UNO_QUERY);
     270           0 :     if (!xStorable.is())
     271           0 :         return sal_False;
     272             : 
     273           0 :     Reference< XDrawPage > xDrawPage;
     274             : 
     275           0 :     Reference< XFrame > rFrame = rDesktop->getCurrentFrame();
     276           0 :     Reference< XDrawView > rDrawView = Reference< XDrawView >( rFrame->getController(), UNO_QUERY );
     277             : 
     278           0 :     Reference< XDrawPage > rCurrentPage = rDrawView->getCurrentPage();
     279             : 
     280           0 :     Sequence< PropertyValue > aFilterData;
     281             : 
     282           0 :     aFilterData = findPropertyValue<Sequence< PropertyValue > >(aDescriptor, "FilterData", aFilterData);
     283             : 
     284             :     //AS: Do a bunch of path mangling to figure out where to put the files.
     285             : 
     286           0 :     OUString sOriginalPath = findPropertyValue<OUString>(aDescriptor, "URL", OUString());
     287             : 
     288             :     // AS: sPath is the parent directory, where everything else exists (like the sxi,
     289             :     //  the -swf-files folder, the -audio files, etc.
     290           0 :     int lastslash = sOriginalPath.lastIndexOf('/');
     291           0 :     OUString sPath( sOriginalPath.copy(0, lastslash) );
     292             : 
     293           0 :     OUString sPresentation(xStorable->getLocation());
     294             : 
     295           0 :     lastslash = sPresentation.lastIndexOf('/') + 1;
     296           0 :     int lastdot = sPresentation.lastIndexOf('.');
     297             : 
     298             :     // AS: The name of the presentation, without 3 character extension.
     299           0 :     OUString sPresentationName = sPresentation.copy(lastslash, lastdot - lastslash);
     300             : 
     301           0 :     OUString fullpath, swfdirpath, backgroundfilename, objectsfilename;
     302             : 
     303           0 :     swfdirpath = sPath + STR("/") + sPresentationName + STR(".sxi-swf-files");
     304             : 
     305             :     oslFileError err;
     306           0 :     err = osl_createDirectory( swfdirpath.pData );
     307             : 
     308           0 :     fullpath = swfdirpath + STR("/backgroundconfig.txt");
     309             : 
     310           0 :     oslFileHandle xBackgroundConfig( 0 );
     311             : 
     312             :     // AS: Only export the background config if we're exporting all of the pages, otherwise we'll
     313             :     //  screw it up.
     314           0 :     sal_Bool bExportAll = findPropertyValue<sal_Bool>(aFilterData, "ExportAll", true);
     315           0 :     if (bExportAll)
     316             :     {
     317           0 :         osl_removeFile(fullpath.pData);
     318           0 :         osl_openFile( fullpath.pData, &xBackgroundConfig, osl_File_OpenFlag_Create | osl_File_OpenFlag_Write );
     319             : 
     320             :         sal_uInt64 bytesWritten;
     321           0 :         err = osl_writeFile(xBackgroundConfig, "slides=", strlen("slides="), &bytesWritten);
     322             :     }
     323             : 
     324             :     // TODO: check for errors
     325             :     (void) err;
     326             : 
     327             :     FlashExporter aFlashExporter( mxMSF, findPropertyValue<sal_Int32>(aFilterData, "CompressMode", 75),
     328           0 :                                          findPropertyValue<sal_Bool>(aFilterData, "ExportOLEAsJPEG", false));
     329             : 
     330           0 :     const sal_Int32 nPageCount = xDrawPages->getCount();
     331           0 :     if ( mxStatusIndicator.is() )
     332           0 :         mxStatusIndicator->start(OUString( RTL_CONSTASCII_USTRINGPARAM( "Saving :" )), nPageCount);
     333             : 
     334           0 :     for(sal_Int32 nPage = 0; nPage < nPageCount; nPage++)
     335             :     {
     336           0 :         if ( mxStatusIndicator.is() )
     337           0 :             mxStatusIndicator->setValue( nPage );
     338           0 :         xDrawPages->getByIndex(nPage) >>= xDrawPage;
     339             : 
     340             :         // AS: If we're only exporting the current page, then skip the rest.
     341           0 :         if (!bExportAll && xDrawPage != rCurrentPage)
     342           0 :             continue;
     343             : 
     344             :         // AS: Export the background, the background objects, and then the slide contents.
     345           0 :         if (bExportAll || findPropertyValue<sal_Bool>(aFilterData, "ExportBackgrounds", true))
     346             :         {
     347           0 :             backgroundfilename = exportBackground(aFlashExporter, xDrawPage, swfdirpath, nPage, "b");
     348             :         }
     349             : 
     350           0 :         if (bExportAll || findPropertyValue<sal_Bool>(aFilterData, "ExportBackgroundObjects", true))
     351             :         {
     352           0 :             objectsfilename = exportBackground(aFlashExporter, xDrawPage, swfdirpath, nPage, "o");
     353             :         }
     354             : 
     355           0 :         if (bExportAll || findPropertyValue<sal_Bool>(aFilterData, "ExportSlideContents", true))
     356             :         {
     357           0 :             fullpath = swfdirpath + STR("/slide") + VAL(nPage+1) + STR("p.swf");
     358             : 
     359           0 :             Reference<XOutputStream> xOutputStreamWrap(*(new OslOutputStreamWrapper(fullpath)), UNO_QUERY);
     360           0 :             sal_Bool ret = aFlashExporter.exportSlides( xDrawPage, xOutputStreamWrap, sal::static_int_cast<sal_uInt16>( nPage ) );
     361           0 :             aFlashExporter.Flush();
     362           0 :             xOutputStreamWrap.clear();
     363             : 
     364           0 :             if (!ret)
     365           0 :                 osl_removeFile(fullpath.pData);
     366             :         }
     367             : 
     368             :         // AS: Write out to the background config what backgrounds and objects this
     369             :         //  slide used.
     370           0 :         if (bExportAll)
     371             :         {
     372           0 :             OUString temp = backgroundfilename + STR("|") + objectsfilename;
     373           0 :             OString ASCIItemp(temp.getStr(), temp.getLength(), RTL_TEXTENCODING_ASCII_US);
     374             : 
     375             :             sal_uInt64 bytesWritten;
     376           0 :             osl_writeFile(xBackgroundConfig, ASCIItemp.getStr(), ASCIItemp.getLength(), &bytesWritten);
     377             : 
     378           0 :             if (nPage < nPageCount - 1)
     379           0 :                 osl_writeFile(xBackgroundConfig, "|", 1, &bytesWritten);
     380             :         }
     381             : 
     382             : #ifdef AUGUSTUS
     383             :         if (findPropertyValue<sal_Bool>(aFilterData, "ExportSound", true))
     384             :         {
     385             :             fullpath = swfdirpath + STR("/slide") + VAL(nPage+1) + STR("s.swf");
     386             : 
     387             :             OUString wavpath = sPath + STR("/") + sPresentationName + STR(".ppt-audio/slide") + VAL(nPage+1) + STR(".wav");
     388             :             FileBase::getSystemPathFromFileURL(wavpath, wavpath);
     389             :             OString sASCIIPath(wavpath.getStr(), wavpath.getLength(), RTL_TEXTENCODING_ASCII_US);
     390             : 
     391             :             Reference<XOutputStream> xOutputStreamWrap(*(new OslOutputStreamWrapper(fullpath)), UNO_QUERY);
     392             :             sal_Bool ret = aFlashExporter.exportSound(xOutputStreamWrap, sASCIIPath.getStr());
     393             :             aFlashExporter.Flush();
     394             :             xOutputStreamWrap.clear();
     395             : 
     396             :             if (!ret)
     397             :                 osl_removeFile(fullpath.pData);
     398             :         }
     399             : #endif // defined AUGUSTUS
     400             :     }
     401             : 
     402           0 :     if (bExportAll)
     403           0 :         osl_closeFile(xBackgroundConfig);
     404             : 
     405           0 :     return sal_True;
     406             : }
     407             : 
     408           0 : sal_Bool FlashExportFilter::ExportAsSingleFile(const Sequence< PropertyValue >& aDescriptor)
     409             : {
     410           0 :     Reference < XOutputStream > xOutputStream = findPropertyValue<Reference<XOutputStream> >(aDescriptor, "OutputStream", 0);
     411           0 :     Sequence< PropertyValue > aFilterData;
     412             : 
     413           0 :     if (!xOutputStream.is() )
     414             :     {
     415             :         OSL_ASSERT ( 0 );
     416           0 :         return sal_False;
     417             :     }
     418             : 
     419             :     FlashExporter aFlashExporter( mxMSF, findPropertyValue<sal_Int32>(aFilterData, "CompressMode", 75),
     420           0 :                                          findPropertyValue<sal_Bool>(aFilterData, "ExportOLEAsJPEG", false));
     421             : 
     422           0 :     return aFlashExporter.exportAll( mxDoc, xOutputStream, mxStatusIndicator );
     423             : }
     424             : 
     425             : // -----------------------------------------------------------------------------
     426             : 
     427           0 : void SAL_CALL FlashExportFilter::cancel(  )
     428             :     throw (RuntimeException)
     429             : {
     430           0 : }
     431             : 
     432             : // -----------------------------------------------------------------------------
     433             : 
     434             : // XExporter
     435           0 : void SAL_CALL FlashExportFilter::setSourceDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc )
     436             :     throw (::com::sun::star::lang::IllegalArgumentException, RuntimeException)
     437             : {
     438           0 :     mxDoc = xDoc;
     439           0 : }
     440             : 
     441             : // -----------------------------------------------------------------------------
     442             : 
     443             : // XInitialization
     444           0 : void SAL_CALL FlashExportFilter::initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& /* aArguments */ )
     445             :     throw (Exception, RuntimeException)
     446             : {
     447           0 : }
     448             : 
     449             : // -----------------------------------------------------------------------------
     450             : 
     451           0 : OUString FlashExportFilter_getImplementationName ()
     452             :     throw (RuntimeException)
     453             : {
     454           0 :     return OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Impress.FlashExportFilter" ) );
     455             : }
     456             : 
     457             : // -----------------------------------------------------------------------------
     458             : 
     459             : #define SERVICE_NAME "com.sun.star.document.ExportFilter"
     460             : 
     461           0 : sal_Bool SAL_CALL FlashExportFilter_supportsService( const OUString& ServiceName )
     462             :     throw (RuntimeException)
     463             : {
     464           0 :     return ServiceName == SERVICE_NAME;
     465             : }
     466             : 
     467             : // -----------------------------------------------------------------------------
     468             : 
     469           0 : Sequence< OUString > SAL_CALL FlashExportFilter_getSupportedServiceNames(  )
     470             :     throw (RuntimeException)
     471             : {
     472           0 :     Sequence < OUString > aRet(1);
     473           0 :     OUString* pArray = aRet.getArray();
     474           0 :     pArray[0] =  OUString ( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) );
     475           0 :     return aRet;
     476             : }
     477             : #undef SERVICE_NAME
     478             : 
     479             : // -----------------------------------------------------------------------------
     480             : 
     481           0 : Reference< XInterface > SAL_CALL FlashExportFilter_createInstance( const Reference< XMultiServiceFactory > & rSMgr)
     482             :     throw( Exception )
     483             : {
     484           0 :     return (cppu::OWeakObject*) new FlashExportFilter( rSMgr );
     485             : }
     486             : 
     487             : // -----------------------------------------------------------------------------
     488             : 
     489             : // XServiceInfo
     490           0 : OUString SAL_CALL FlashExportFilter::getImplementationName(  )
     491             :     throw (RuntimeException)
     492             : {
     493           0 :     return FlashExportFilter_getImplementationName();
     494             : }
     495             : 
     496             : // -----------------------------------------------------------------------------
     497             : 
     498           0 : sal_Bool SAL_CALL FlashExportFilter::supportsService( const OUString& rServiceName )
     499             :     throw (RuntimeException)
     500             : {
     501           0 :     return FlashExportFilter_supportsService( rServiceName );
     502             : }
     503             : 
     504             : // -----------------------------------------------------------------------------
     505             : 
     506           0 : ::com::sun::star::uno::Sequence< OUString > SAL_CALL FlashExportFilter::getSupportedServiceNames(  )
     507             :     throw (RuntimeException)
     508             : {
     509           0 :     return FlashExportFilter_getSupportedServiceNames();
     510             : }
     511             : 
     512             : // -----------------------------------------------------------------------------
     513             : 
     514             : }
     515             : 
     516             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10