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

Generated by: LCOV version 1.11