LCOV - code coverage report
Current view: top level - embeddedobj/source/commonembedding - xfactory.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 178 0.0 %
Date: 2014-04-14 Functions: 0 19 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/embed/ElementModes.hpp>
      21             : #include <com/sun/star/embed/EntryInitModes.hpp>
      22             : #include <com/sun/star/document/XTypeDetection.hpp>
      23             : #include <com/sun/star/beans/PropertyValue.hpp>
      24             : #include <com/sun/star/beans/XPropertySet.hpp>
      25             : #include <com/sun/star/container/XNameAccess.hpp>
      26             : 
      27             : #include <comphelper/processfactory.hxx>
      28             : #include <cppuhelper/supportsservice.hxx>
      29             : 
      30             : #include "xfactory.hxx"
      31             : #include "commonembobj.hxx"
      32             : #include "specialobject.hxx"
      33             : #include "oleembobj.hxx"
      34             : 
      35             : 
      36             : using namespace ::com::sun::star;
      37             : 
      38           0 : uno::Sequence< OUString > SAL_CALL OOoEmbeddedObjectFactory::impl_staticGetSupportedServiceNames()
      39             : {
      40           0 :     uno::Sequence< OUString > aRet(2);
      41           0 :     aRet[0] = "com.sun.star.embed.OOoEmbeddedObjectFactory";
      42           0 :     aRet[1] = "com.sun.star.comp.embed.OOoEmbeddedObjectFactory";
      43           0 :     return aRet;
      44             : }
      45             : 
      46           0 : OUString SAL_CALL OOoEmbeddedObjectFactory::impl_staticGetImplementationName()
      47             : {
      48           0 :     return OUString("com.sun.star.comp.embed.OOoEmbeddedObjectFactory");
      49             : }
      50             : 
      51           0 : uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::impl_staticCreateSelfInstance(
      52             :             const uno::Reference< lang::XMultiServiceFactory >& xServiceManager )
      53             : {
      54           0 :     return uno::Reference< uno::XInterface >( *new OOoEmbeddedObjectFactory( comphelper::getComponentContext(xServiceManager) ) );
      55             : }
      56             : 
      57           0 : uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInstanceInitFromEntry(
      58             :                                                                     const uno::Reference< embed::XStorage >& xStorage,
      59             :                                                                     const OUString& sEntName,
      60             :                                                                     const uno::Sequence< beans::PropertyValue >& aMediaDescr,
      61             :                                                                     const uno::Sequence< beans::PropertyValue >& lObjArgs )
      62             :     throw ( lang::IllegalArgumentException,
      63             :             container::NoSuchElementException,
      64             :             io::IOException,
      65             :             uno::Exception,
      66             :             uno::RuntimeException, std::exception)
      67             : {
      68             :     SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033) OOoEmbeddedObjectFactory::createInstanceInitFromEntry" );
      69             : 
      70           0 :     if ( !xStorage.is() )
      71             :         throw lang::IllegalArgumentException( OUString( "No parent storage is provided!\n" ),
      72             :                                             uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
      73           0 :                                             1 );
      74             : 
      75           0 :     if ( sEntName.isEmpty() )
      76             :         throw lang::IllegalArgumentException( OUString( "Empty element name is provided!\n" ),
      77             :                                             uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
      78           0 :                                             2 );
      79             : 
      80           0 :     uno::Reference< container::XNameAccess > xNameAccess( xStorage, uno::UNO_QUERY );
      81           0 :     if ( !xNameAccess.is() )
      82           0 :         throw uno::RuntimeException(); //TODO
      83             : 
      84             :     // detect entry existence
      85           0 :     if ( !xNameAccess->hasByName( sEntName ) )
      86           0 :         throw container::NoSuchElementException();
      87             : 
      88           0 :     uno::Reference< uno::XInterface > xResult;
      89           0 :     if ( xStorage->isStorageElement( sEntName ) )
      90             :     {
      91             :         // the object must be based on storage
      92             :         uno::Reference< embed::XStorage > xSubStorage =
      93           0 :                 xStorage->openStorageElement( sEntName, embed::ElementModes::READ );
      94             : 
      95           0 :         uno::Reference< beans::XPropertySet > xPropSet( xSubStorage, uno::UNO_QUERY );
      96           0 :         if ( !xPropSet.is() )
      97           0 :             throw uno::RuntimeException();
      98             : 
      99           0 :         OUString aMediaType;
     100             :         try {
     101           0 :             uno::Any aAny = xPropSet->getPropertyValue("MediaType");
     102           0 :             aAny >>= aMediaType;
     103             :         }
     104           0 :         catch ( const uno::Exception& )
     105             :         {
     106             :         }
     107             : 
     108             :         try {
     109           0 :             uno::Reference< lang::XComponent > xComp( xSubStorage, uno::UNO_QUERY );
     110           0 :             if ( xComp.is() )
     111           0 :                 xComp->dispose();
     112             :         }
     113           0 :         catch ( const uno::Exception& )
     114             :         {
     115             :         }
     116           0 :         xSubStorage = uno::Reference< embed::XStorage >();
     117             : 
     118           0 :         uno::Sequence< beans::NamedValue > aObject = m_aConfigHelper.GetObjectPropsByMediaType( aMediaType );
     119           0 :         if ( !aObject.getLength() )
     120           0 :             throw io::IOException(); // unexpected mimetype of the storage
     121             : 
     122           0 :         xResult = uno::Reference< uno::XInterface >(
     123             :                     static_cast< ::cppu::OWeakObject* > ( new OCommonEmbeddedObject(
     124             :                                                 m_xContext,
     125           0 :                                                 aObject ) ),
     126           0 :                     uno::UNO_QUERY );
     127             :     }
     128             :     else
     129             :     {
     130             :         // the object must be OOo embedded object, if it is not an exception must be thrown
     131           0 :         throw io::IOException(); // TODO:
     132             :     }
     133             : 
     134           0 :     uno::Reference< embed::XEmbedPersist > xPersist( xResult, uno::UNO_QUERY );
     135             : 
     136           0 :     if ( !xPersist.is() )
     137           0 :         throw uno::RuntimeException(); // TODO: the interface must be supported by own document objects
     138             : 
     139           0 :     xPersist->setPersistentEntry( xStorage,
     140             :                                     sEntName,
     141             :                                     embed::EntryInitModes::DEFAULT_INIT,
     142             :                                     aMediaDescr,
     143           0 :                                     lObjArgs );
     144             : 
     145           0 :     return xResult;
     146             : }
     147             : 
     148           0 : uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInstanceInitFromMediaDescriptor(
     149             :         const uno::Reference< embed::XStorage >& xStorage,
     150             :         const OUString& sEntName,
     151             :         const uno::Sequence< beans::PropertyValue >& aMediaDescr,
     152             :         const uno::Sequence< beans::PropertyValue >& lObjArgs )
     153             :     throw ( lang::IllegalArgumentException,
     154             :             io::IOException,
     155             :             uno::Exception,
     156             :             uno::RuntimeException, std::exception)
     157             : {
     158             :     SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033) OOoEmbeddedObjectFactory::createInstanceInitFromMediaDescriptor" );
     159             : 
     160           0 :     if ( !xStorage.is() )
     161             :         throw lang::IllegalArgumentException( OUString( "No parent storage is provided!\n" ),
     162             :                                             uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
     163           0 :                                             1 );
     164             : 
     165           0 :     if ( sEntName.isEmpty() )
     166             :         throw lang::IllegalArgumentException( OUString( "Empty element name is provided!\n" ),
     167             :                                             uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
     168           0 :                                             2 );
     169             : 
     170           0 :     uno::Sequence< beans::PropertyValue > aTempMedDescr( aMediaDescr );
     171             : 
     172             :     // check if there is FilterName
     173           0 :     OUString aFilterName = m_aConfigHelper.UpdateMediaDescriptorWithFilterName( aTempMedDescr, false );
     174             : 
     175           0 :     uno::Reference< uno::XInterface > xResult;
     176             : 
     177             :     // find document service name
     178           0 :     if ( !aFilterName.isEmpty() )
     179             :     {
     180           0 :         uno::Sequence< beans::NamedValue > aObject = m_aConfigHelper.GetObjectPropsByFilter( aFilterName );
     181           0 :         if ( !aObject.getLength() )
     182           0 :             throw io::IOException(); // unexpected mimetype of the storage
     183             : 
     184             : 
     185           0 :         xResult = uno::Reference< uno::XInterface >(
     186             :                     static_cast< ::cppu::OWeakObject* > ( new OCommonEmbeddedObject(
     187             :                                             m_xContext,
     188           0 :                                             aObject ) ),
     189           0 :                     uno::UNO_QUERY );
     190             :     }
     191             :     else
     192             :     {
     193             :         // the object must be OOo embedded object, if it is not an exception must be thrown
     194           0 :         throw io::IOException(); // TODO:
     195             :     }
     196             : 
     197           0 :     uno::Reference< embed::XEmbedPersist > xPersist( xResult, uno::UNO_QUERY );
     198             : 
     199           0 :     if ( !xPersist.is() )
     200           0 :         throw uno::RuntimeException(); // TODO: the interface must be supported ( what about applets? )
     201             : 
     202           0 :     xPersist->setPersistentEntry( xStorage,
     203             :                                     sEntName,
     204             :                                     embed::EntryInitModes::MEDIA_DESCRIPTOR_INIT,
     205             :                                     aTempMedDescr,
     206           0 :                                     lObjArgs );
     207             : 
     208           0 :     return xResult;
     209             : }
     210             : 
     211           0 : uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInstanceInitNew(
     212             :                                             const uno::Sequence< sal_Int8 >& aClassID,
     213             :                                             const OUString& /*aClassName*/,
     214             :                                             const uno::Reference< embed::XStorage >& xStorage,
     215             :                                             const OUString& sEntName,
     216             :                                             const uno::Sequence< beans::PropertyValue >& lObjArgs )
     217             :     throw ( lang::IllegalArgumentException,
     218             :             io::IOException,
     219             :             uno::Exception,
     220             :             uno::RuntimeException, std::exception)
     221             : {
     222             :     SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033) OOoEmbeddedObjectFactory::createInstanceInitNew" );
     223             : 
     224           0 :     uno::Reference< uno::XInterface > xResult;
     225             : 
     226           0 :     if ( !xStorage.is() )
     227             :         throw lang::IllegalArgumentException( OUString( "No parent storage is provided!\n" ),
     228             :                                             uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
     229           0 :                                             3 );
     230             : 
     231           0 :     if ( sEntName.isEmpty() )
     232             :         throw lang::IllegalArgumentException( OUString( "Empty element name is provided!\n" ),
     233             :                                             uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
     234           0 :                                             4 );
     235             : 
     236           0 :     uno::Sequence< beans::NamedValue > aObject = m_aConfigHelper.GetObjectPropsByClassID( aClassID );
     237           0 :     if ( !aObject.getLength() )
     238           0 :         throw io::IOException(); // unexpected mimetype of the storage
     239             : 
     240           0 :     xResult = uno::Reference< uno::XInterface >(
     241             :                     static_cast< ::cppu::OWeakObject* > ( new OCommonEmbeddedObject(
     242             :                                                 m_xContext,
     243           0 :                                                 aObject ) ),
     244           0 :                     uno::UNO_QUERY );
     245             : 
     246             : 
     247           0 :     uno::Reference< embed::XEmbedPersist > xPersist( xResult, uno::UNO_QUERY );
     248             : 
     249           0 :     if ( !xPersist.is() )
     250           0 :         throw uno::RuntimeException(); // TODO: the interface must be supported by own document objects
     251             : 
     252           0 :     xPersist->setPersistentEntry( xStorage,
     253             :                                     sEntName,
     254             :                                     embed::EntryInitModes::TRUNCATE_INIT,
     255             :                                     uno::Sequence< beans::PropertyValue >(),
     256           0 :                                     lObjArgs );
     257             : 
     258           0 :     return xResult;
     259             : }
     260             : 
     261           0 : uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInstanceUserInit(
     262             :             const uno::Sequence< sal_Int8 >& aClassID,
     263             :             const OUString& /*aClassName*/,
     264             :             const uno::Reference< embed::XStorage >& xStorage,
     265             :             const OUString& sEntName,
     266             :             sal_Int32 nEntryConnectionMode,
     267             :             const uno::Sequence< beans::PropertyValue >& lArguments,
     268             :             const uno::Sequence< beans::PropertyValue >& lObjArgs )
     269             :     throw ( lang::IllegalArgumentException,
     270             :             io::IOException,
     271             :             uno::Exception,
     272             :             uno::RuntimeException, std::exception )
     273             : {
     274             :     SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033) OOoEmbeddedObjectFactory::createInstanceUserInit" );
     275             : 
     276             :     // the initialization is completelly controlled by user
     277           0 :     if ( !xStorage.is() )
     278             :         throw lang::IllegalArgumentException( OUString( "No parent storage is provided!\n" ),
     279             :                                             uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
     280           0 :                                             1 );
     281             : 
     282           0 :     if ( sEntName.isEmpty() )
     283             :         throw lang::IllegalArgumentException( OUString( "Empty element name is provided!\n" ),
     284             :                                             uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
     285           0 :                                             2 );
     286             : 
     287           0 :     uno::Sequence< beans::NamedValue > aObject = m_aConfigHelper.GetObjectPropsByClassID( aClassID );
     288           0 :     if ( !aObject.getLength() )
     289           0 :         throw io::IOException(); // unexpected mimetype of the storage
     290             : 
     291           0 :     uno::Sequence< beans::PropertyValue > aTempMedDescr( lArguments );
     292           0 :     if ( nEntryConnectionMode == embed::EntryInitModes::MEDIA_DESCRIPTOR_INIT )
     293             :     {
     294           0 :         OUString aFilterName = m_aConfigHelper.UpdateMediaDescriptorWithFilterName( aTempMedDescr, aObject );
     295           0 :         if ( aFilterName.isEmpty() )
     296             :         // the object must be OOo embedded object, if it is not an exception must be thrown
     297           0 :             throw io::IOException(); // TODO:
     298             :     }
     299             : 
     300             :     uno::Reference< uno::XInterface > xResult = uno::Reference< uno::XInterface > (
     301             :                     static_cast< ::cppu::OWeakObject* > ( new OCommonEmbeddedObject(
     302             :                                                 m_xContext,
     303           0 :                                                 aObject ) ),
     304           0 :                     uno::UNO_QUERY );
     305             : 
     306           0 :     uno::Reference< embed::XEmbedPersist > xPersist( xResult, uno::UNO_QUERY );
     307           0 :     if ( xPersist.is() )
     308             :     {
     309           0 :         xPersist->setPersistentEntry( xStorage,
     310             :                                     sEntName,
     311             :                                     nEntryConnectionMode,
     312             :                                     aTempMedDescr,
     313           0 :                                     lObjArgs );
     314             : 
     315             :     }
     316             :     else
     317           0 :         throw uno::RuntimeException(); // TODO:
     318             : 
     319           0 :     return xResult;
     320             : }
     321             : 
     322           0 : uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInstanceLink(
     323             :                                             const uno::Reference< embed::XStorage >& /*xStorage*/,
     324             :                                             const OUString& /*sEntName*/,
     325             :                                             const uno::Sequence< beans::PropertyValue >& aMediaDescr,
     326             :                                             const uno::Sequence< beans::PropertyValue >& lObjArgs )
     327             :         throw ( lang::IllegalArgumentException,
     328             :                 io::IOException,
     329             :                 uno::Exception,
     330             :                 uno::RuntimeException, std::exception )
     331             : {
     332             :     SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033) OOoEmbeddedObjectFactory::createInstanceLink" );
     333             : 
     334           0 :     uno::Reference< uno::XInterface > xResult;
     335             : 
     336           0 :     uno::Sequence< beans::PropertyValue > aTempMedDescr( aMediaDescr );
     337             : 
     338             :     // check if there is URL, URL must exist
     339           0 :     OUString aURL;
     340           0 :     for ( sal_Int32 nInd = 0; nInd < aTempMedDescr.getLength(); nInd++ )
     341           0 :         if ( aTempMedDescr[nInd].Name == "URL" )
     342           0 :             aTempMedDescr[nInd].Value >>= aURL;
     343             : 
     344           0 :     if ( aURL.isEmpty() )
     345             :         throw lang::IllegalArgumentException( OUString( "No URL for the link is provided!\n" ),
     346             :                                         uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
     347           0 :                                         3 );
     348             : 
     349           0 :     OUString aFilterName = m_aConfigHelper.UpdateMediaDescriptorWithFilterName( aTempMedDescr, false );
     350             : 
     351           0 :     if ( !aFilterName.isEmpty() )
     352             :     {
     353           0 :         uno::Sequence< beans::NamedValue > aObject = m_aConfigHelper.GetObjectPropsByFilter( aFilterName );
     354           0 :         if ( !aObject.getLength() )
     355           0 :             throw io::IOException(); // unexpected mimetype of the storage
     356             : 
     357             : 
     358           0 :         xResult = uno::Reference< uno::XInterface >(
     359             :                     static_cast< ::cppu::OWeakObject* > ( new OCommonEmbeddedObject(
     360             :                                             m_xContext,
     361             :                                             aObject,
     362             :                                             aTempMedDescr,
     363           0 :                                             lObjArgs ) ),
     364           0 :                     uno::UNO_QUERY );
     365             :     }
     366             :     else
     367             :     {
     368             :         // the object must be OOo embedded object, if it is not an exception must be thrown
     369           0 :         throw io::IOException(); // TODO:
     370             :     }
     371             : 
     372           0 :     return xResult;
     373             : }
     374             : 
     375           0 : uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInstanceLinkUserInit(
     376             :                                                 const uno::Sequence< sal_Int8 >& aClassID,
     377             :                                                 const OUString& /*aClassName*/,
     378             :                                                 const uno::Reference< embed::XStorage >& xStorage,
     379             :                                                 const OUString& sEntName,
     380             :                                                 const uno::Sequence< beans::PropertyValue >& lArguments,
     381             :                                                 const uno::Sequence< beans::PropertyValue >& lObjArgs )
     382             :         throw ( lang::IllegalArgumentException,
     383             :                 io::IOException,
     384             :                 uno::Exception,
     385             :                 uno::RuntimeException )
     386             : {
     387             :     SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033) OOoEmbeddedObjectFactory::createInstanceLinkUserInit" );
     388             : 
     389           0 :     uno::Reference< uno::XInterface > xResult;
     390             : 
     391             :     // the initialization is completelly controlled by user
     392           0 :     if ( !xStorage.is() )
     393             :         throw lang::IllegalArgumentException( OUString( "No parent storage is provided!\n" ),
     394             :                                             uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
     395           0 :                                             1 );
     396             : 
     397           0 :     if ( sEntName.isEmpty() )
     398             :         throw lang::IllegalArgumentException( OUString( "Empty element name is provided!\n" ),
     399             :                                             uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
     400           0 :                                             2 );
     401             : 
     402           0 :     uno::Sequence< beans::PropertyValue > aTempMedDescr( lArguments );
     403             : 
     404           0 :     OUString aURL;
     405           0 :     for ( sal_Int32 nInd = 0; nInd < aTempMedDescr.getLength(); nInd++ )
     406           0 :         if ( aTempMedDescr[nInd].Name == "URL" )
     407           0 :             aTempMedDescr[nInd].Value >>= aURL;
     408             : 
     409           0 :     if ( aURL.isEmpty() )
     410             :         throw lang::IllegalArgumentException( OUString( "No URL for the link is provided!\n" ),
     411             :                                         uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
     412           0 :                                         3 );
     413             : 
     414           0 :     uno::Sequence< beans::NamedValue > aObject = m_aConfigHelper.GetObjectPropsByClassID( aClassID );
     415           0 :     if ( !aObject.getLength() )
     416           0 :         throw io::IOException(); // unexpected mimetype of the storage
     417             : 
     418           0 :     OUString aFilterName = m_aConfigHelper.UpdateMediaDescriptorWithFilterName( aTempMedDescr, aObject );
     419             : 
     420           0 :     if ( !aFilterName.isEmpty() )
     421             :     {
     422             : 
     423           0 :         xResult = uno::Reference< uno::XInterface >(
     424             :                     static_cast< ::cppu::OWeakObject* > ( new OCommonEmbeddedObject(
     425             :                                             m_xContext,
     426             :                                             aObject,
     427             :                                             aTempMedDescr,
     428           0 :                                             lObjArgs ) ),
     429           0 :                     uno::UNO_QUERY );
     430             :     }
     431             :     else
     432             :     {
     433             :         // the object must be OOo embedded object, if it is not an exception must be thrown
     434           0 :         throw io::IOException(); // TODO:
     435             :     }
     436             : 
     437           0 :     return xResult;
     438             : }
     439             : 
     440           0 : OUString SAL_CALL OOoEmbeddedObjectFactory::getImplementationName()
     441             :     throw ( uno::RuntimeException, std::exception )
     442             : {
     443           0 :     return impl_staticGetImplementationName();
     444             : }
     445             : 
     446           0 : sal_Bool SAL_CALL OOoEmbeddedObjectFactory::supportsService( const OUString& ServiceName )
     447             :     throw ( uno::RuntimeException, std::exception )
     448             : {
     449           0 :     return cppu::supportsService(this, ServiceName);
     450             : }
     451             : 
     452           0 : uno::Sequence< OUString > SAL_CALL OOoEmbeddedObjectFactory::getSupportedServiceNames()
     453             :     throw ( uno::RuntimeException, std::exception )
     454             : {
     455           0 :     return impl_staticGetSupportedServiceNames();
     456             : }
     457             : 
     458           0 : uno::Sequence< OUString > SAL_CALL OOoSpecialEmbeddedObjectFactory::impl_staticGetSupportedServiceNames()
     459             : {
     460           0 :     uno::Sequence< OUString > aRet(2);
     461           0 :     aRet[0] = "com.sun.star.embed.OOoSpecialEmbeddedObjectFactory";
     462           0 :     aRet[1] = "com.sun.star.comp.embed.OOoSpecialEmbeddedObjectFactory";
     463           0 :     return aRet;
     464             : }
     465             : 
     466           0 : OUString SAL_CALL OOoSpecialEmbeddedObjectFactory::impl_staticGetImplementationName()
     467             : {
     468           0 :     return OUString("com.sun.star.comp.embed.OOoSpecialEmbeddedObjectFactory");
     469             : }
     470             : 
     471           0 : uno::Reference< uno::XInterface > SAL_CALL OOoSpecialEmbeddedObjectFactory::impl_staticCreateSelfInstance(
     472             :             const uno::Reference< lang::XMultiServiceFactory >& xServiceManager )
     473             : {
     474           0 :     return uno::Reference< uno::XInterface >( *new OOoSpecialEmbeddedObjectFactory( comphelper::getComponentContext(xServiceManager) ) );
     475             : }
     476             : 
     477           0 : uno::Reference< uno::XInterface > SAL_CALL OOoSpecialEmbeddedObjectFactory::createInstanceUserInit(
     478             :             const uno::Sequence< sal_Int8 >& aClassID,
     479             :             const OUString& /*aClassName*/,
     480             :             const uno::Reference< embed::XStorage >& /*xStorage*/,
     481             :             const OUString& /*sEntName*/,
     482             :             sal_Int32 /*nEntryConnectionMode*/,
     483             :             const uno::Sequence< beans::PropertyValue >& /*lArguments*/,
     484             :             const uno::Sequence< beans::PropertyValue >& /*lObjArgs*/ )
     485             :     throw ( lang::IllegalArgumentException,
     486             :             io::IOException,
     487             :             uno::Exception,
     488             :             uno::RuntimeException, std::exception )
     489             : {
     490           0 :     uno::Sequence< beans::NamedValue > aObject = m_aConfigHelper.GetObjectPropsByClassID( aClassID );
     491           0 :     if ( !aObject.getLength() )
     492           0 :         throw io::IOException(); // unexpected mimetype of the storage
     493             : 
     494             :     uno::Reference< uno::XInterface > xResult(
     495             :                     static_cast< ::cppu::OWeakObject* > ( new OSpecialEmbeddedObject(
     496             :                                                 m_xContext,
     497           0 :                                                 aObject ) ),
     498           0 :                     uno::UNO_QUERY );
     499           0 :     return xResult;
     500             : }
     501             : 
     502           0 : OUString SAL_CALL OOoSpecialEmbeddedObjectFactory::getImplementationName()
     503             :     throw ( uno::RuntimeException, std::exception )
     504             : {
     505           0 :     return impl_staticGetImplementationName();
     506             : }
     507             : 
     508           0 : sal_Bool SAL_CALL OOoSpecialEmbeddedObjectFactory::supportsService( const OUString& ServiceName )
     509             :     throw ( uno::RuntimeException, std::exception )
     510             : {
     511           0 :     return cppu::supportsService(this, ServiceName);
     512             : }
     513             : 
     514           0 : uno::Sequence< OUString > SAL_CALL OOoSpecialEmbeddedObjectFactory::getSupportedServiceNames()
     515             :     throw ( uno::RuntimeException, std::exception )
     516             : {
     517           0 :     return impl_staticGetSupportedServiceNames();
     518             : }
     519             : 
     520             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10