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

Generated by: LCOV version 1.10