LCOV - code coverage report
Current view: top level - package/source/xstor - ocompinstream.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 299 0.0 %
Date: 2014-04-14 Functions: 0 33 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 "ocompinstream.hxx"
      21             : #include <com/sun/star/embed/StorageFormats.hpp>
      22             : #include <com/sun/star/lang/DisposedException.hpp>
      23             : #include <osl/diagnose.h>
      24             : 
      25             : #include "owriteablestream.hxx"
      26             : #include "xstorage.hxx"
      27             : 
      28             : using namespace ::com::sun::star;
      29             : 
      30           0 : OInputCompStream::OInputCompStream( OWriteStream_Impl& aImpl,
      31             :                                     uno::Reference < io::XInputStream > xStream,
      32             :                                     const uno::Sequence< beans::PropertyValue >& aProps,
      33             :                                     sal_Int32 nStorageType )
      34             : : m_pImpl( &aImpl )
      35             : , m_rMutexRef( m_pImpl->m_rMutexRef )
      36             : , m_xStream( xStream )
      37             : , m_pInterfaceContainer( NULL )
      38             : , m_aProperties( aProps )
      39             : , m_bDisposed( sal_False )
      40           0 : , m_nStorageType( nStorageType )
      41             : {
      42             :     OSL_ENSURE( m_pImpl->m_rMutexRef.Is(), "No mutex is provided!\n" );
      43           0 :     if ( !m_pImpl->m_rMutexRef.Is() )
      44           0 :         throw uno::RuntimeException(); // just a disaster
      45             : 
      46             :     OSL_ENSURE( xStream.is(), "No stream is provided!\n" );
      47           0 : }
      48             : 
      49           0 : OInputCompStream::OInputCompStream( uno::Reference < io::XInputStream > xStream,
      50             :                                     const uno::Sequence< beans::PropertyValue >& aProps,
      51             :                                     sal_Int32 nStorageType )
      52             : : m_pImpl( NULL )
      53           0 : , m_rMutexRef( new SotMutexHolder )
      54             : , m_xStream( xStream )
      55             : , m_pInterfaceContainer( NULL )
      56             : , m_aProperties( aProps )
      57             : , m_bDisposed( sal_False )
      58           0 : , m_nStorageType( nStorageType )
      59             : {
      60             :     OSL_ENSURE( xStream.is(), "No stream is provided!\n" );
      61           0 : }
      62             : 
      63           0 : OInputCompStream::~OInputCompStream()
      64             : {
      65             :     {
      66           0 :         ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
      67             : 
      68           0 :         if ( !m_bDisposed )
      69             :         {
      70           0 :             m_refCount++;
      71           0 :             dispose();
      72             :         }
      73             : 
      74           0 :         if ( m_pInterfaceContainer )
      75           0 :             delete m_pInterfaceContainer;
      76             :     }
      77           0 : }
      78             : 
      79           0 : uno::Any SAL_CALL OInputCompStream::queryInterface( const uno::Type& rType )
      80             :         throw( uno::RuntimeException, std::exception )
      81             : {
      82           0 :     uno::Any aReturn;
      83             : 
      84             :     // common interfaces
      85           0 :     aReturn <<= ::cppu::queryInterface
      86             :                 (   rType
      87             :                     ,   static_cast<io::XInputStream*> ( this )
      88             :                     ,   static_cast<io::XStream*> ( this )
      89             :                     ,   static_cast<lang::XComponent*> ( this )
      90             :                     ,   static_cast<beans::XPropertySet*> ( this )
      91           0 :                     ,   static_cast<embed::XExtendedStorageStream*> ( this ) );
      92             : 
      93           0 :     if ( aReturn.hasValue() )
      94           0 :         return aReturn ;
      95             : 
      96           0 :     if ( m_nStorageType == embed::StorageFormats::OFOPXML )
      97             :     {
      98           0 :         aReturn <<= ::cppu::queryInterface
      99             :                     (   rType
     100           0 :                         ,   static_cast<embed::XRelationshipAccess*> ( this ) );
     101             : 
     102           0 :         if ( aReturn.hasValue() )
     103           0 :             return aReturn ;
     104             :     }
     105             : 
     106           0 :     return OWeakObject::queryInterface( rType );
     107             : }
     108             : 
     109           0 : sal_Int32 SAL_CALL OInputCompStream::readBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead )
     110             :         throw ( io::NotConnectedException,
     111             :                 io::BufferSizeExceededException,
     112             :                 io::IOException,
     113             :                 uno::RuntimeException, std::exception )
     114             : {
     115           0 :     ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
     116           0 :     if ( m_bDisposed )
     117             :     {
     118           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" );
     119           0 :         throw lang::DisposedException();
     120             :     }
     121             : 
     122           0 :     if ( !m_xStream.is() )
     123             :     {
     124           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "No stream!" );
     125           0 :         throw uno::RuntimeException();
     126             :     }
     127             : 
     128           0 :     return m_xStream->readBytes( aData, nBytesToRead );
     129             : }
     130             : 
     131           0 : sal_Int32 SAL_CALL OInputCompStream::readSomeBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead )
     132             :         throw ( io::NotConnectedException,
     133             :                 io::BufferSizeExceededException,
     134             :                 io::IOException,
     135             :                 uno::RuntimeException, std::exception )
     136             : {
     137           0 :     ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
     138           0 :     if ( m_bDisposed )
     139             :     {
     140           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" );
     141           0 :         throw lang::DisposedException();
     142             :     }
     143             : 
     144           0 :     if ( !m_xStream.is() )
     145             :     {
     146           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "No stream!" );
     147           0 :         throw uno::RuntimeException();
     148             :     }
     149             : 
     150           0 :     return m_xStream->readSomeBytes( aData, nMaxBytesToRead );
     151             : 
     152             : }
     153             : 
     154           0 : void SAL_CALL OInputCompStream::skipBytes( sal_Int32 nBytesToSkip )
     155             :         throw ( io::NotConnectedException,
     156             :                 io::BufferSizeExceededException,
     157             :                 io::IOException,
     158             :                 uno::RuntimeException, std::exception )
     159             : {
     160           0 :     ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
     161           0 :     if ( m_bDisposed )
     162             :     {
     163           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" );
     164           0 :         throw lang::DisposedException();
     165             :     }
     166             : 
     167           0 :     if ( !m_xStream.is() )
     168             :     {
     169           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "No stream!" );
     170           0 :         throw uno::RuntimeException();
     171             :     }
     172             : 
     173           0 :     m_xStream->skipBytes( nBytesToSkip );
     174             : 
     175           0 : }
     176             : 
     177           0 : sal_Int32 SAL_CALL OInputCompStream::available(  )
     178             :         throw ( io::NotConnectedException,
     179             :                 io::IOException,
     180             :                 uno::RuntimeException, std::exception )
     181             : {
     182           0 :     ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
     183           0 :     if ( m_bDisposed )
     184             :     {
     185           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" );
     186           0 :         throw lang::DisposedException();
     187             :     }
     188             : 
     189           0 :     if ( !m_xStream.is() )
     190             :     {
     191           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "No stream!" );
     192           0 :         throw uno::RuntimeException();
     193             :     }
     194             : 
     195           0 :     return m_xStream->available();
     196             : 
     197             : }
     198             : 
     199           0 : void SAL_CALL OInputCompStream::closeInput(  )
     200             :         throw ( io::NotConnectedException,
     201             :                 io::IOException,
     202             :                 uno::RuntimeException, std::exception )
     203             : {
     204           0 :     dispose();
     205           0 : }
     206             : 
     207           0 : uno::Reference< io::XInputStream > SAL_CALL OInputCompStream::getInputStream()
     208             :         throw ( uno::RuntimeException, std::exception )
     209             : {
     210           0 :     ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
     211           0 :     if ( m_bDisposed )
     212             :     {
     213           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" );
     214           0 :         throw lang::DisposedException();
     215             :     }
     216             : 
     217           0 :     if ( !m_xStream.is() )
     218           0 :         return uno::Reference< io::XInputStream >();
     219             : 
     220           0 :     return uno::Reference< io::XInputStream >( static_cast< io::XInputStream* >( this ), uno::UNO_QUERY );
     221             : }
     222             : 
     223           0 : uno::Reference< io::XOutputStream > SAL_CALL OInputCompStream::getOutputStream()
     224             :         throw ( uno::RuntimeException, std::exception )
     225             : {
     226           0 :     ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
     227           0 :     if ( m_bDisposed )
     228             :     {
     229           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" );
     230           0 :         throw lang::DisposedException();
     231             :     }
     232             : 
     233           0 :     return uno::Reference< io::XOutputStream >();
     234             : }
     235             : 
     236           0 : void OInputCompStream::InternalDispose()
     237             : {
     238             :     // can be called only by OWriteStream_Impl
     239           0 :     ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
     240           0 :     if ( m_bDisposed )
     241             :     {
     242           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" );
     243           0 :         throw lang::DisposedException();
     244             :     }
     245             : 
     246             :     // the source object is also a kind of locker for the current object
     247             :     // since the listeners could dispose the object while being notified
     248           0 :     lang::EventObject aSource( static_cast< ::cppu::OWeakObject*>( this ) );
     249             : 
     250           0 :     if ( m_pInterfaceContainer )
     251           0 :         m_pInterfaceContainer->disposeAndClear( aSource );
     252             : 
     253             :     try
     254             :     {
     255           0 :         m_xStream->closeInput();
     256             :     }
     257           0 :     catch( uno::Exception& )
     258             :     {}
     259             : 
     260           0 :     m_pImpl = NULL;
     261           0 :     m_bDisposed = sal_True;
     262           0 : }
     263             : 
     264           0 : void SAL_CALL OInputCompStream::dispose(  )
     265             :         throw ( uno::RuntimeException, std::exception )
     266             : {
     267           0 :     ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
     268           0 :     if ( m_bDisposed )
     269             :     {
     270           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" );
     271           0 :         throw lang::DisposedException();
     272             :     }
     273             : 
     274           0 :     if ( m_pInterfaceContainer )
     275             :     {
     276           0 :         lang::EventObject aSource( static_cast< ::cppu::OWeakObject*>( this ) );
     277           0 :         m_pInterfaceContainer->disposeAndClear( aSource );
     278             :     }
     279             : 
     280           0 :     m_xStream->closeInput();
     281             : 
     282           0 :     if ( m_pImpl )
     283             :     {
     284           0 :         m_pImpl->InputStreamDisposed( this );
     285           0 :         m_pImpl = NULL;
     286             :     }
     287             : 
     288           0 :     m_bDisposed = sal_True;
     289           0 : }
     290             : 
     291           0 : void SAL_CALL OInputCompStream::addEventListener( const uno::Reference< lang::XEventListener >& xListener )
     292             :         throw ( uno::RuntimeException, std::exception )
     293             : {
     294           0 :     ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
     295           0 :     if ( m_bDisposed )
     296             :     {
     297           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" );
     298           0 :         throw lang::DisposedException();
     299             :     }
     300             : 
     301           0 :     if ( !m_pInterfaceContainer )
     302           0 :         m_pInterfaceContainer = new ::cppu::OInterfaceContainerHelper( m_rMutexRef->GetMutex() );
     303             : 
     304           0 :     m_pInterfaceContainer->addInterface( xListener );
     305           0 : }
     306             : 
     307           0 : void SAL_CALL OInputCompStream::removeEventListener( const uno::Reference< lang::XEventListener >& xListener )
     308             :         throw ( uno::RuntimeException, std::exception )
     309             : {
     310           0 :     ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
     311           0 :     if ( m_bDisposed )
     312             :     {
     313           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" );
     314           0 :         throw lang::DisposedException();
     315             :     }
     316             : 
     317           0 :     if ( m_pInterfaceContainer )
     318           0 :         m_pInterfaceContainer->removeInterface( xListener );
     319           0 : }
     320             : 
     321           0 : sal_Bool SAL_CALL OInputCompStream::hasByID(  const OUString& sID )
     322             :         throw ( io::IOException,
     323             :                 uno::RuntimeException, std::exception )
     324             : {
     325           0 :     ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
     326             : 
     327           0 :     if ( m_bDisposed )
     328             :     {
     329           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" );
     330           0 :         throw lang::DisposedException();
     331             :     }
     332             : 
     333           0 :     if ( m_nStorageType != embed::StorageFormats::OFOPXML )
     334           0 :         throw uno::RuntimeException();
     335             : 
     336             :     try
     337             :     {
     338           0 :         getRelationshipByID( sID );
     339           0 :         return sal_True;
     340             :     }
     341           0 :     catch( container::NoSuchElementException& )
     342             :     {}
     343             : 
     344           0 :     return sal_False;
     345             : }
     346             : 
     347           0 : OUString SAL_CALL OInputCompStream::getTargetByID(  const OUString& sID  )
     348             :         throw ( container::NoSuchElementException,
     349             :                 io::IOException,
     350             :                 uno::RuntimeException, std::exception )
     351             : {
     352           0 :     ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
     353             : 
     354           0 :     if ( m_bDisposed )
     355             :     {
     356           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" );
     357           0 :         throw lang::DisposedException();
     358             :     }
     359             : 
     360           0 :     if ( m_nStorageType != embed::StorageFormats::OFOPXML )
     361           0 :         throw uno::RuntimeException();
     362             : 
     363           0 :     uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID );
     364           0 :     for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
     365           0 :         if ( aSeq[nInd].First == "Target" )
     366           0 :             return aSeq[nInd].Second;
     367             : 
     368           0 :     return OUString();
     369             : }
     370             : 
     371           0 : OUString SAL_CALL OInputCompStream::getTypeByID(  const OUString& sID  )
     372             :         throw ( container::NoSuchElementException,
     373             :                 io::IOException,
     374             :                 uno::RuntimeException, std::exception )
     375             : {
     376           0 :     ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
     377             : 
     378           0 :     if ( m_bDisposed )
     379             :     {
     380           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" );
     381           0 :         throw lang::DisposedException();
     382             :     }
     383             : 
     384           0 :     if ( m_nStorageType != embed::StorageFormats::OFOPXML )
     385           0 :         throw uno::RuntimeException();
     386             : 
     387           0 :     uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID );
     388           0 :     for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
     389           0 :         if ( aSeq[nInd].First == "Type" )
     390           0 :             return aSeq[nInd].Second;
     391             : 
     392           0 :     return OUString();
     393             : }
     394             : 
     395           0 : uno::Sequence< beans::StringPair > SAL_CALL OInputCompStream::getRelationshipByID(  const OUString& sID  )
     396             :         throw ( container::NoSuchElementException,
     397             :                 io::IOException,
     398             :                 uno::RuntimeException, std::exception )
     399             : {
     400           0 :     ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
     401             : 
     402           0 :     if ( m_bDisposed )
     403             :     {
     404           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" );
     405           0 :         throw lang::DisposedException();
     406             :     }
     407             : 
     408           0 :     if ( m_nStorageType != embed::StorageFormats::OFOPXML )
     409           0 :         throw uno::RuntimeException();
     410             : 
     411             :     // TODO/LATER: in future the unification of the ID could be checked
     412           0 :     uno::Sequence< uno::Sequence< beans::StringPair > > aSeq = getAllRelationships();
     413           0 :     for ( sal_Int32 nInd1 = 0; nInd1 < aSeq.getLength(); nInd1++ )
     414           0 :         for ( sal_Int32 nInd2 = 0; nInd2 < aSeq[nInd1].getLength(); nInd2++ )
     415           0 :             if ( aSeq[nInd1][nInd2].First == "Id" )
     416             :             {
     417           0 :                 if ( aSeq[nInd1][nInd2].Second.equals( sID ) )
     418           0 :                     return aSeq[nInd1];
     419           0 :                 break;
     420             :             }
     421             : 
     422           0 :     throw container::NoSuchElementException();
     423             : }
     424             : 
     425           0 : uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OInputCompStream::getRelationshipsByType(  const OUString& sType  )
     426             :         throw ( io::IOException,
     427             :                 uno::RuntimeException, std::exception )
     428             : {
     429           0 :     ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
     430             : 
     431           0 :     if ( m_bDisposed )
     432             :     {
     433           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" );
     434           0 :         throw lang::DisposedException();
     435             :     }
     436             : 
     437           0 :     if ( m_nStorageType != embed::StorageFormats::OFOPXML )
     438           0 :         throw uno::RuntimeException();
     439             : 
     440           0 :     uno::Sequence< uno::Sequence< beans::StringPair > > aResult;
     441           0 :     sal_Int32 nEntriesNum = 0;
     442             : 
     443             :     // TODO/LATER: in future the unification of the ID could be checked
     444           0 :     uno::Sequence< uno::Sequence< beans::StringPair > > aSeq = getAllRelationships();
     445           0 :     for ( sal_Int32 nInd1 = 0; nInd1 < aSeq.getLength(); nInd1++ )
     446           0 :         for ( sal_Int32 nInd2 = 0; nInd2 < aSeq[nInd1].getLength(); nInd2++ )
     447           0 :             if ( aSeq[nInd1][nInd2].First == "Type" )
     448             :             {
     449           0 :                 if ( aSeq[nInd1][nInd2].Second.equals( sType ) )
     450             :                 {
     451           0 :                     aResult.realloc( nEntriesNum );
     452           0 :                     aResult[nEntriesNum-1] = aSeq[nInd1];
     453             :                 }
     454           0 :                 break;
     455             :             }
     456             : 
     457           0 :     return aResult;
     458             : }
     459             : 
     460           0 : uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OInputCompStream::getAllRelationships()
     461             :         throw (io::IOException, uno::RuntimeException, std::exception)
     462             : {
     463           0 :     ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
     464             : 
     465           0 :     if ( m_bDisposed )
     466             :     {
     467           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" );
     468           0 :         throw lang::DisposedException();
     469             :     }
     470             : 
     471           0 :     if ( m_nStorageType != embed::StorageFormats::OFOPXML )
     472           0 :         throw uno::RuntimeException();
     473             : 
     474             :     // TODO/LATER: in future the information could be taken directly from m_pImpl when possible
     475           0 :     uno::Sequence< uno::Sequence< beans::StringPair > > aResult;
     476           0 :     for ( sal_Int32 aInd = 0; aInd < m_aProperties.getLength(); aInd++ )
     477           0 :         if ( m_aProperties[aInd].Name == "RelationsInfo" )
     478             :         {
     479           0 :             if ( m_aProperties[aInd].Value >>= aResult )
     480           0 :                 return aResult;
     481             : 
     482           0 :             break;
     483             :         }
     484             : 
     485           0 :     throw io::IOException(); // the relations info could not be read
     486             : }
     487             : 
     488           0 : void SAL_CALL OInputCompStream::insertRelationshipByID(  const OUString& /*sID*/, const uno::Sequence< beans::StringPair >& /*aEntry*/, sal_Bool /*bReplace*/  )
     489             :         throw ( container::ElementExistException,
     490             :                 io::IOException,
     491             :                 uno::RuntimeException, std::exception )
     492             : {
     493           0 :     ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
     494             : 
     495           0 :     if ( m_bDisposed )
     496             :     {
     497           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" );
     498           0 :         throw lang::DisposedException();
     499             :     }
     500             : 
     501           0 :     if ( m_nStorageType != embed::StorageFormats::OFOPXML )
     502           0 :         throw uno::RuntimeException();
     503             : 
     504           0 :     throw io::IOException(); // TODO: Access denied
     505             : }
     506             : 
     507           0 : void SAL_CALL OInputCompStream::removeRelationshipByID(  const OUString& /*sID*/  )
     508             :         throw ( container::NoSuchElementException,
     509             :                 io::IOException,
     510             :                 uno::RuntimeException, std::exception )
     511             : {
     512           0 :     ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
     513             : 
     514           0 :     if ( m_bDisposed )
     515             :     {
     516           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" );
     517           0 :         throw lang::DisposedException();
     518             :     }
     519             : 
     520           0 :     if ( m_nStorageType != embed::StorageFormats::OFOPXML )
     521           0 :         throw uno::RuntimeException();
     522             : 
     523           0 :     throw io::IOException(); // TODO: Access denied
     524             : }
     525             : 
     526           0 : void SAL_CALL OInputCompStream::insertRelationships(  const uno::Sequence< uno::Sequence< beans::StringPair > >& /*aEntries*/, sal_Bool /*bReplace*/  )
     527             :         throw ( container::ElementExistException,
     528             :                 io::IOException,
     529             :                 uno::RuntimeException, std::exception )
     530             : {
     531           0 :     ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
     532             : 
     533           0 :     if ( m_bDisposed )
     534             :     {
     535           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" );
     536           0 :         throw lang::DisposedException();
     537             :     }
     538             : 
     539           0 :     if ( m_nStorageType != embed::StorageFormats::OFOPXML )
     540           0 :         throw uno::RuntimeException();
     541             : 
     542           0 :     throw io::IOException(); // TODO: Access denied
     543             : }
     544             : 
     545           0 : void SAL_CALL OInputCompStream::clearRelationships()
     546             :         throw ( io::IOException,
     547             :                 uno::RuntimeException, std::exception )
     548             : {
     549           0 :     ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
     550             : 
     551           0 :     if ( m_bDisposed )
     552             :     {
     553           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" );
     554           0 :         throw lang::DisposedException();
     555             :     }
     556             : 
     557           0 :     if ( m_nStorageType != embed::StorageFormats::OFOPXML )
     558           0 :         throw uno::RuntimeException();
     559             : 
     560           0 :     throw io::IOException(); // TODO: Access denied
     561             : }
     562             : 
     563           0 : uno::Reference< beans::XPropertySetInfo > SAL_CALL OInputCompStream::getPropertySetInfo()
     564             :         throw ( uno::RuntimeException, std::exception )
     565             : {
     566           0 :     ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
     567             : 
     568           0 :     if ( m_bDisposed )
     569             :     {
     570           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" );
     571           0 :         throw lang::DisposedException();
     572             :     }
     573             : 
     574             :     //TODO:
     575           0 :     return uno::Reference< beans::XPropertySetInfo >();
     576             : }
     577             : 
     578           0 : void SAL_CALL OInputCompStream::setPropertyValue( const OUString& aPropertyName, const uno::Any& /*aValue*/ )
     579             :         throw ( beans::UnknownPropertyException,
     580             :                 beans::PropertyVetoException,
     581             :                 lang::IllegalArgumentException,
     582             :                 lang::WrappedTargetException,
     583             :                 uno::RuntimeException, std::exception )
     584             : {
     585           0 :     ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
     586             : 
     587           0 :     if ( m_bDisposed )
     588             :     {
     589           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" );
     590           0 :         throw lang::DisposedException();
     591             :     }
     592             : 
     593             :     // all the provided properties are accessible
     594           0 :     for ( sal_Int32 aInd = 0; aInd < m_aProperties.getLength(); aInd++ )
     595             :     {
     596           0 :         if ( m_aProperties[aInd].Name.equals( aPropertyName ) )
     597             :         {
     598           0 :             throw beans::PropertyVetoException(); // TODO
     599             :         }
     600             :     }
     601             : 
     602           0 :     throw beans::UnknownPropertyException(); // TODO
     603             : }
     604             : 
     605           0 : uno::Any SAL_CALL OInputCompStream::getPropertyValue( const OUString& aProp )
     606             :         throw ( beans::UnknownPropertyException,
     607             :                 lang::WrappedTargetException,
     608             :                 uno::RuntimeException, std::exception )
     609             : {
     610           0 :     ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
     611             : 
     612           0 :     if ( m_bDisposed )
     613             :     {
     614           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" );
     615           0 :         throw lang::DisposedException();
     616             :     }
     617             : 
     618           0 :     OUString aPropertyName;
     619           0 :     if ( aProp == "IsEncrypted" )
     620           0 :         aPropertyName = "Encrypted";
     621             :     else
     622           0 :         aPropertyName = aProp;
     623             : 
     624           0 :     if ( aPropertyName == "RelationsInfo" )
     625           0 :         throw beans::UnknownPropertyException(); // TODO
     626             : 
     627             :     // all the provided properties are accessible
     628           0 :     for ( sal_Int32 aInd = 0; aInd < m_aProperties.getLength(); aInd++ )
     629             :     {
     630           0 :         if ( m_aProperties[aInd].Name.equals( aPropertyName ) )
     631             :         {
     632           0 :             return m_aProperties[aInd].Value;
     633             :         }
     634             :     }
     635             : 
     636           0 :     throw beans::UnknownPropertyException(); // TODO
     637             : }
     638             : 
     639           0 : void SAL_CALL OInputCompStream::addPropertyChangeListener(
     640             :     const OUString& /*aPropertyName*/,
     641             :     const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/ )
     642             :         throw ( beans::UnknownPropertyException,
     643             :                 lang::WrappedTargetException,
     644             :                 uno::RuntimeException, std::exception )
     645             : {
     646           0 :     ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
     647             : 
     648           0 :     if ( m_bDisposed )
     649             :     {
     650           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" );
     651           0 :         throw lang::DisposedException();
     652           0 :     }
     653             : 
     654             :     //TODO:
     655           0 : }
     656             : 
     657           0 : void SAL_CALL OInputCompStream::removePropertyChangeListener(
     658             :     const OUString& /*aPropertyName*/,
     659             :     const uno::Reference< beans::XPropertyChangeListener >& /*aListener*/ )
     660             :         throw ( beans::UnknownPropertyException,
     661             :                 lang::WrappedTargetException,
     662             :                 uno::RuntimeException, std::exception )
     663             : {
     664           0 :     ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
     665             : 
     666           0 :     if ( m_bDisposed )
     667             :     {
     668           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" );
     669           0 :         throw lang::DisposedException();
     670           0 :     }
     671             : 
     672             :     //TODO:
     673           0 : }
     674             : 
     675           0 : void SAL_CALL OInputCompStream::addVetoableChangeListener(
     676             :     const OUString& /*PropertyName*/,
     677             :     const uno::Reference< beans::XVetoableChangeListener >& /*aListener*/ )
     678             :         throw ( beans::UnknownPropertyException,
     679             :                 lang::WrappedTargetException,
     680             :                 uno::RuntimeException, std::exception )
     681             : {
     682           0 :     ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
     683             : 
     684           0 :     if ( m_bDisposed )
     685             :     {
     686           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" );
     687           0 :         throw lang::DisposedException();
     688           0 :     }
     689             : 
     690             :     //TODO:
     691           0 : }
     692             : 
     693           0 : void SAL_CALL OInputCompStream::removeVetoableChangeListener(
     694             :     const OUString& /*PropertyName*/,
     695             :     const uno::Reference< beans::XVetoableChangeListener >& /*aListener*/ )
     696             :         throw ( beans::UnknownPropertyException,
     697             :                 lang::WrappedTargetException,
     698             :                 uno::RuntimeException, std::exception )
     699             : {
     700           0 :     ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
     701             : 
     702           0 :     if ( m_bDisposed )
     703             :     {
     704           0 :         ::package::StaticAddLog( OSL_LOG_PREFIX "Disposed!" );
     705           0 :         throw lang::DisposedException();
     706           0 :     }
     707             : 
     708             :     //TODO:
     709           0 : }
     710             : 
     711             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10